railo-context.Componentcoldbox.system.FrameworkSupertype
coldbox.system.Plugin
contentbox.plugins.CBHelper
ContentBox - A Modular Content Platform Copyright 2012 by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com Apache License, Version 2.0 Copyright Since [2012] [Luis Majano and Ortus Solutions,Corp] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. This is the ContentBox UI helper class that is injected by the CBRequest interceptor
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
authorService
|
true
|
false
|
|
any
|
categoryService
|
true
|
false
|
|
any
|
commentService
|
true
|
false
|
|
any
|
contentStoreService
|
true
|
false
|
|
any
|
entryService
|
true
|
false
|
|
any
|
menuItemService
|
true
|
false
|
|
any
|
menuService
|
true
|
false
|
|
any
|
minifier
|
true
|
false
|
|
any
|
mobileDetector
|
true
|
false
|
|
any
|
moduleService
|
true
|
false
|
|
any
|
pageService
|
true
|
false
|
|
any
|
settingService
|
true
|
false
|
|
any
|
widgetService
|
true
|
false
|
Constructor Summary | |
---|---|
init(any controller)
|
Method Summary | |
---|---|
any
|
adminRoot()
|
any
|
breadCrumbs([any page], [any separator='>'])
Create breadcrumbs for a page. |
private any
|
buildMenu([any pageRecords], [any excludes=''], [any type='ul'], [any typeClass='submenu'], [any separator=''], [boolean showNone='true'], [any levels='1'], [numeric currentLevel='1'], [any elementClass=''], [any parentClass='parent'], [any activeClass='active'], [any activeShowChildren='false'])
PRIVATE ********************************************. |
any
|
buildModuleLink(string module, string linkTo, [any queryString=''], [boolean ssl='false'])
Build out ContentBox module links. |
string
|
buildProviderMenu(Menu menu, array slugCache='[runtime expression]')
Builds out a custom menu. |
private string
|
buildProviderMenuLevel(array items, string listType='ul', array slugCache='[runtime expression]', [string listClass=''])
Builds out a level of a custom menu. |
boolean
|
categoryFilterExists()
|
any
|
contentStore(any slug, [any defaultValue=''])
Get a published content store and return its latest active content. |
any
|
contentStoreObject(any slug)
Get a content store object by slug, if not found it returns null. |
any
|
customHTML(any slug, [any defaultValue=''])
Get a published custom HTML content pieces by slug: DEPRECATED, use contentStore() instead. |
any
|
event(any state, [struct data='[runtime expression]'])
events ********************************************. |
string
|
getAuthorService()
|
any
|
getBlogEntryPoint()
|
any
|
getCategoryFilter()
|
string
|
getCategoryService()
|
array
|
getCommentErrors()
|
string
|
getCommentService()
|
any
|
getContentBoxCodeName()
|
any
|
getContentBoxCodeNameURL()
|
any
|
getContentBoxVersion()
|
string
|
getContentStoreService()
|
any
|
getCurrentCategories()
|
any
|
getCurrentComments()
|
any
|
getCurrentCommentsCount()
|
struct
|
getCurrentCustomFields()
|
any
|
getCurrentEntries()
|
any
|
getCurrentEntriesCount()
|
any
|
getCurrentEntry()
|
any
|
getCurrentPage()
|
any
|
getCurrentRelatedContent()
|
any
|
getCustomField(any key, [any defaultValue])
|
any
|
getDayFilter()
|
string
|
getEntryService()
|
any
|
getFlash()
Return the current system flash scope. |
any
|
getHomePage()
|
any
|
getMaintenanceMessage()
|
string
|
getMenuItemService()
|
string
|
getMenuService()
|
any
|
getMinifier()
Minify methods ********************************************. |
any
|
getMissingPage()
|
string
|
getMobileDetector()
|
string
|
getModuleService()
|
any
|
getMonthFilter()
|
string
|
getPageService()
|
SearchResults
|
getSearchResults()
|
any
|
getSearchResultsContent()
|
any
|
getSearchTerm()
|
string
|
getSettingService()
|
any
|
getWidget(any name)
Return a widget object. |
string
|
getWidgetService()
|
any
|
getYearFilter()
|
boolean
|
isArchivesView()
|
boolean
|
isBlogView()
|
boolean
|
isCommentFormError()
|
any
|
isCommentsEnabled([any content])
Determines if site comments are enabled and if the entry accepts comments. |
boolean
|
isEntryView()
|
boolean
|
isIndexView()
|
boolean
|
isMobile()
Detects if the incoming request is from a mobile device or NOT. |
boolean
|
isPageView([any page=''])
Determine if you are in the page view. |
boolean
|
isPreview()
Determine if you're in a "preview" mode or not. |
boolean
|
isPrintFormat()
|
boolean
|
isSearchView()
search ********************************************. |
any
|
layoutName()
|
any
|
layoutRoot()
root methods ********************************************. |
any
|
layoutSetting(any key, [any value])
Get a layout setting. |
any
|
linkAdmin([any event=''], [boolean ssl='false'])
Link to the admin. |
any
|
linkAdminLogin([boolean ssl='false'])
Link to the admin login. |
any
|
linkAdminLogout([boolean ssl='false'])
Link to the admin logout. |
any
|
linkArchive([any year], [any month], [any day], [boolean ssl='false'])
Link to a specific filtered archive of entries. |
any
|
linkBlog([boolean ssl='false'])
Create a link to your site blog. |
any
|
linkCategory(any category, [boolean ssl='false'])
Link to a specific filtered category view of blog entries. |
any
|
linkCategoryWithSlug(string categorySlug, [boolean ssl='false'])
Link to a specific filtered category view of blog entries. |
any
|
linkComment(any comment, [boolean ssl='false'])
Create a link to a specific comment in a page or in an entry. |
any
|
linkCommentPost(any content, [boolean ssl='false'])
Link to the commenting post action, this is where comments are submitted to. |
any
|
linkComments(any content, [boolean ssl='false'])
Create a link to an entry's or page's comments section. |
any
|
linkContent(any content, [boolean ssl='false'], [any format='html'])
Link to a specific content object. |
any
|
linkContentSearch([boolean ssl='false'])
Link to the content search route. |
any
|
linkContentSubscription([boolean ssl='false'])
Link to the content subscription route. |
any
|
linkContentUnsubscribe(string token, [boolean ssl='false'])
Link to the ContentBox Content Subscription unsubscribe URL. |
any
|
linkEntry(any entry, [boolean ssl='false'], [any format='html'])
Link to a specific blog entry's page. |
any
|
linkEntryWithSlug(any slug, [boolean ssl='false'], [any format='html'])
Link to a specific entry's page using a slug only. |
any
|
linkHome([boolean ssl='false'])
Create a link to your site root or home page entry point for your blog. |
any
|
linkPage(any page, [boolean ssl='false'], [any format='html'])
Link to a specific page. |
any
|
linkPageRSS([any category], [boolean comments='false'], [any page], [boolean ssl='false'])
Link to the ContentBox Page RSS Feeds. |
any
|
linkPageWithSlug(any slug, [boolean ssl='false'], [any format='html'])
Link to a specific page using a slug only. |
any
|
linkRSS([any category], [any comments='false'], [any entry], [boolean ssl='false'])
Link to RSS feeds that ContentBox generates, by default it is the recent updates feed. |
any
|
linkSearch([boolean ssl='false'])
Link to the search route for this blog. |
any
|
linkSelf()
Create a link to the current page/entry you are on. |
any
|
linkSiteRSS([any category], [boolean comments='false'], [string slug], [boolean ssl='false'])
Link to the ContentBox Site RSS Feeds. |
any
|
linkToParentPage([any page], [any text=''])
Create an href to a page's parent. |
any
|
mainView()
Render the incoming event's main view, basically a proxy to ColdBox's renderView(). |
any
|
menu(string slug, any type='html', array slugCache='[runtime expression]')
MENUS ********************************************. |
any
|
minify(any assets)
Prepare source(s) statements using our fabulous jsmin compressor. |
CBHelper
|
minifyClearCache()
|
CBHelper
|
minifyToHead(any assets)
Prepare source(s) statements using our fabulous jsmin compressor and send them to the head section. |
CBHelper
|
prepareUIRequest()
Prepare a ContentBox UI request. |
any
|
quickAvatar(any author, [numeric size='25'])
Renders out an author's avatar. |
any
|
quickCategories([any template='category'], [any collectionAs='category'], [any args='[runtime expression]'])
Render out categories anywhere using ColdBox collection rendering. |
any
|
quickCategoryLinks(any entry)
quick HTML ********************************************. |
any
|
quickCommentForm(any content)
quickCommentForm will build a standard ContentBox Comment Form according to the CommentForm widget. |
any
|
quickComments([any template='comment'], [any collectionAs='comment'], [any args='[runtime expression]'])
Render out comments anywhere using ColdBox collection rendering. |
any
|
quickCustomFields()
Render out custom fields for the current content. |
any
|
quickEntries([any template='entry'], [any collectionAs='entry'], [any args='[runtime expression]'])
Render out entries in the home page by using our ColdBox collection rendering. |
any
|
quickEntry([any template='entry'], [any collectionAs='entry'], [any args='[runtime expression]'])
Render out an entry using your pre-defined 'entry' template. |
any
|
quickLayout(any layout, [any view=''], [any module='contentbox'], [any args='[runtime expression]'], [any viewModule=''], [any prePostExempt='false'])
QuickLayout is a proxy to ColdBox's renderLayout method with the addition of prefixing the location of the layout according to the. |
any
|
quickPaging()
Render out paging for blog entries only. |
any
|
quickRelatedContent([any template='relatedContent'], [any collectionAs='relatedContent'], [any args='[runtime expression]'])
Render out related content anywhere using ColdBox collection rendering. |
any
|
quickSearchForm()
quickSearchForm will build a standard ContentBox Content Search Form according to the SearchForm widget. |
any
|
quickSearchPaging()
Render out paging for search content. |
any
|
quickView(any view, [any cache='false'], [any cacheTimeout], [any cacheLastAccessTimeout], [any cacheSuffix], [any module='contentbox'], [any args], [any collection], [any collectionAs], [any prepostExempt])
QuickView is a proxy to ColdBox's renderview method with the addition of prefixing the location of the view according to the. |
any
|
r(string resource, [string defaultValue], [string locale], [any values], [string bundle])
Retrieve i18n resources. |
any
|
rootMenu([any excludes=''], [any type='ul'], [any typeClass=''], [any separator=''], [any levels='1'], [any elementClass=''], [any parentClass='parent'], [any activeClass='active'])
Render out a quick menu for root level pages. |
boolean
|
searchTermExists()
|
private any
|
sep()
Get the site URL separator. |
any
|
setAuthorService(any authorService)
|
any
|
setCategoryService(any categoryService)
|
any
|
setCommentService(any commentService)
|
any
|
setContentStoreService(any contentStoreService)
|
any
|
setEntryService(any entryService)
|
any
|
setMenuItemService(any menuItemService)
|
any
|
setMenuService(any menuService)
|
any
|
setMinifier(any minifier)
|
any
|
setMobileDetector(any mobileDetector)
|
any
|
setModuleService(any moduleService)
|
any
|
setNextModuleEvent(string module, [string event], [any queryString=''], [boolean addToken='false'], [any persist], [struct persistStruct], [boolean ssl='false'], [boolean postProcessExempt='false'], [numeric statusCode])
SetNextEvent For ContentBox Modules. |
any
|
setPageService(any pageService)
|
any
|
setSettingService(any settingService)
|
any
|
setting(any key, [any value])
settings ********************************************. |
any
|
setWidgetService(any widgetService)
|
any
|
siteBaseURL()
|
any
|
siteDescription()
|
any
|
siteEmail()
|
any
|
siteKeywords()
|
any
|
siteName()
site properties ********************************************. |
any
|
siteOutgoingEmail()
|
any
|
siteRoot()
|
any
|
siteTagLine()
|
any
|
stripHTML(any stringTarget)
utility to strip HTML. |
any
|
subPageMenu([any page], [any excludes=''], [any type='ul'], [any typeClass=''], [any separator=''], [boolean showNone='true'], [any levels='1'], [any elementClass=''], [any parentClass='parent'], [any activeClass='active'], [any activeShowChildren='false'])
Create a sub page menu for a given page or current page. |
any
|
widget(any name, [struct args='[runtime expression]'])
Execute a widget's renderit method. |
any
|
widgetRoot()
|
Methods inherited from class coldbox.system.Plugin |
---|
getpluginAuthor, getpluginAuthorURL, getPluginDescription, getPluginName, getpluginPath, getPluginVersion, getRequestCollection, getRequestContext, setpluginAuthor, setpluginAuthorURL, setPluginDescription, setPluginName, setPluginVersion |
Methods inherited from class coldbox.system.FrameworkSupertype |
---|
addAsset, announceInterception, getCache, getController, getDatasource, getInstance, getInterceptor, getModel, getModuleConfig, getModuleSettings, getMyPlugin, getPlugin, getRenderer, getSetting, getSettingStructure, includeUDF, loadApplicationHelpers, locateDirectoryPath, locateFilePath, persistVariables, populateModel, renderExternalView, renderLayout, renderView, runEvent, setController, setNextEvent, setSetting, settingExists |
Methods inherited from class railo-context.Component |
---|
None |
Constructor Detail |
---|
controller
Property Detail |
---|
required
- falseinject
- id:authorService@cbserializable
- truerequired
- falseinject
- id:categoryService@cbserializable
- truerequired
- falseinject
- id:commentService@cbserializable
- truerequired
- falseinject
- id:contentStoreService@cbserializable
- truerequired
- falseinject
- id:entryService@cbserializable
- truerequired
- falseinject
- id:menuItemService@cbserializable
- truerequired
- falseinject
- id:menuService@cbserializable
- truerequired
- falseinject
- coldbox:myplugin:JSMin@contentboxserializable
- truerequired
- falseinject
- id:mobileDetector@cbserializable
- truerequired
- falseinject
- id:moduleService@cbserializable
- truerequired
- falseinject
- id:pageService@cbserializable
- truerequired
- falseinject
- id:settingService@cbserializable
- truerequired
- falseinject
- id:widgetService@cbserializable
- trueMethod Detail |
---|
Create breadcrumbs for a page
page
- Optional page to create link for, else look for current pageseparator
- Breadcrumb separatorPRIVATE ********************************************
pageRecords
excludes
type
typeClass
separator
showNone
levels
currentLevel
elementClass
parentClass
activeClass
activeShowChildren
Build out ContentBox module links
module
- The module to link this URL tolinkTo
- The handler action combination to link toqueryString
- The query string to append in SES formatssl
- Create the link in SSL or notBuilds out a custom menu
menu
- The root menu that should be renderedslugCache
- The cache of menu slugs already used in this requestBuilds out a level of a custom menu
items
- An array of menu items for this levellistType
- The type of list to create (derived from owning menu)slugCache
- The cache of menu slugs already used in this requestlistClass
Get a published content store and return its latest active content
slug
- The content slug to retrievedefaultValue
- The default value to use if the content element not found.Get a content store object by slug, if not found it returns null.
slug
- The content slug to retrieveGet a published custom HTML content pieces by slug: DEPRECATED, use contentStore() instead
slug
- The content slug to retrievedefaultValue
- The default value to use if custom html element not found.events ********************************************
state
data
key
defaultValue
Return the current system flash scope
Minify methods ********************************************
Return a widget object
name
- The name of the installed widget to returnDetermines if site comments are enabled and if the entry accepts comments
content
- The entry or page content to validate comments also withDetects if the incoming request is from a mobile device or NOT.
Determine if you are in the page view
page
- Optional page slug to determine if you are in that page or not.Determine if you're in a "preview" mode or not
search ********************************************
root methods ********************************************
Get a layout setting
key
- The name of the layout settingvalue
- The default value if the layout setting does not existLink to the admin
event
- An optional event to link tossl
- Use SSL or not, defaults to false.Link to the admin login
ssl
- Use SSL or not, defaults to false.Link to the admin logout
ssl
- Use SSL or not, defaults to false.Link to a specific filtered archive of entries
year
- The year of the archivemonth
- The month of the archiveday
- The day of the archivessl
- Use SSL or not, defaults to false.Create a link to your site blog
ssl
- Use SSL or not, defaults to false.Link to a specific filtered category view of blog entries
category
- The category object or slug to link tossl
- Use SSL or not, defaults to false.Link to a specific filtered category view of blog entries
categorySlug
- The category slug as a string to link tossl
- Use SSL or not, defaults to false.Create a link to a specific comment in a page or in an entry
comment
- The comment to link tossl
- Use SSL or not, defaults to false.Link to the commenting post action, this is where comments are submitted to
content
- The entry or page to link to its commentsssl
- Use SSL or not, defaults to false.Create a link to an entry's or page's comments section
content
- The entry or page to link to its commentsssl
- Use SSL or not, defaults to false.Link to a specific content object
content
- The content object to link tossl
- Use SSL or not, defaults to false.format
- The format output of the content default is HTML but you can pass pdf,print or doc.Link to the content search route
ssl
- Use SSL or not, defaults to false.Link to the content subscription route
ssl
- Use SSL or not, defaults to false.Link to the ContentBox Content Subscription unsubscribe URL
token
- The token to use for unsubscribingssl
Link to a specific blog entry's page
entry
- The entry to link tossl
- Use SSL or not, defaults to false.format
- The format output of the content default is HTML bu you can pass pdf,print or doc.Link to a specific entry's page using a slug only
slug
- The entry slug to link tossl
- Use SSL or not, defaults to false.format
- The format output of the content default is HTML bu you can pass pdf,print or doc.Create a link to your site root or home page entry point for your blog.
ssl
- Use SSL or not, defaults to false.Link to a specific page
page
- The page to link to. This can be a simple value or a page objectssl
- Use SSL or not, defaults to false.format
- The format output of the content default is HTML but you can pass pdf,print or doc.Link to the ContentBox Page RSS Feeds
category
- The category to filter oncomments
- Page comments or not, defaults to falsepage
- The page you want to filter onssl
- Use SSL or not, defaults to false.Link to a specific page using a slug only
slug
- The page slug to link tossl
- Use SSL or not, defaults to false.format
- The format output of the content default is HTML bu you can pass pdf,print or doc.Link to RSS feeds that ContentBox generates, by default it is the recent updates feed
category
- You can optionally pass the category to filter oncomments
- A boolean flag that determines if you want the comments RSS feedentry
- You can optionally pass the entry to filter the comment's RSS feedssl
- Use SSL or not, defaults to false.Link to the search route for this blog
ssl
- Use SSL or not, defaults to false.Create a link to the current page/entry you are on
Link to the ContentBox Site RSS Feeds
category
- The category to filter oncomments
- Do comments RSS feedsslug
- The content slug to filter on when using commentsssl
- Use SSL or not, defaults to false.Create an href to a page's parent
page
- Optional page to create link for, else look for current pagetext
- The optional text to use for the link, else it uses the page's titleRender the incoming event's main view, basically a proxy to ColdBox's renderView().
MENUS ********************************************
slug
type
slugCache
Prepare source(s) statements using our fabulous jsmin compressor
assets
- A list of js or css files to compress and add to the page. They will be concatenated in orderPrepare source(s) statements using our fabulous jsmin compressor and send them to the head section
assets
- A list of js or css files to compress and add to the page. They will be concatenated in orderPrepare a ContentBox UI request. This sets ups settings, layout, etc. This method is usualy called automatically for you on the UI module. However, you can use it a-la-carte if you are building ajax or module extensions
Renders out an author's avatar
author
- The author object to render an avatar fromsize
- The size of the gravatar, by default we use 25 pixelsRender out categories anywhere using ColdBox collection rendering
template
- The name of the template to use, by default it looks in the 'templates/category.cfm' convention, no '.cfm' pleasecollectionAs
- The name of the iterating object in the template, by default it is called 'category'args
- A structure of name-value pairs to pass to the templatequick HTML ********************************************
entry
quickCommentForm will build a standard ContentBox Comment Form according to the CommentForm widget
content
- The content this comment form will be linked to, page or entryRender out comments anywhere using ColdBox collection rendering
template
- The name of the template to use, by default it looks in the 'templates/comment.cfm' convention, no '.cfm' pleasecollectionAs
- The name of the iterating object in the template, by default it is called 'comment'args
- A structure of name-value pairs to pass to the templateRender out custom fields for the current content
Render out entries in the home page by using our ColdBox collection rendering
template
- The name of the template to use, by default it looks in the 'templates/entry.cfm' convention, no '.cfm' pleasecollectionAs
- The name of the iterating object in the template, by default it is called 'entry'args
- A structure of name-value pairs to pass to the templateRender out an entry using your pre-defined 'entry' template
template
- The name of the template to use, by default it looks in the 'templates/entry.cfm' convention, no '.cfm' pleasecollectionAs
- The name of the iterating object in the template, by default it is called 'entry'args
- A structure of name-value pairs to pass to the templateQuickLayout is a proxy to ColdBox's renderLayout method with the addition of prefixing the location of the layout according to the layout theme you are using. All the arguments are the same as renderLayout()'s methods
layout
view
module
args
viewModule
prePostExempt
Render out paging for blog entries only
Render out related content anywhere using ColdBox collection rendering
template
- The name of the template to use, by default it looks in the 'templates/relatedContent.cfm' convention, no '.cfm' pleasecollectionAs
- The name of the iterating object in the template, by default it is called 'relatedContent'args
- A structure of name-value pairs to pass to the templatequickSearchForm will build a standard ContentBox Content Search Form according to the SearchForm widget
Render out paging for search content
QuickView is a proxy to ColdBox's renderview method with the addition of prefixing the location of the view according to the layout theme you are using. All the arguments are the same as renderView()'s methods
view
cache
cacheTimeout
cacheLastAccessTimeout
cacheSuffix
module
args
collection
collectionAs
prepostExempt
Retrieve i18n resources
resource
- The resource (key) to retrieve from a loaded bundle or pass a @bundledefaultValue
- A default value to send back if the resource (key) not foundlocale
- Pass in which locale to take the resource from. By default it uses the user's current set localevalues
- An array, struct or simple string of value replacements to use on the resource stringbundle
- The bundle alias to use to get the resource from when using multiple resource bundles. By default the bundle name used is 'default'Render out a quick menu for root level pages
excludes
- The list of pages to exclude from the menutype
- The type of menu, valid choices are: ul,ol,li,data,nonetypeClass
- The CSS class(es) to add to the type tag, defaults to 'submenu'separator
- Used if type eq none, to separate the list of href'slevels
- The number of levels to nest hierarchical pages, by default it does only 1 level, * does all levelselementClass
- The name of the CSS class to attach to the menu parentClass
- The name of the CSS class to attach to the menu activeClass
- The name of the CSS class to attach to the menu Get the site URL separator
authorService
categoryService
commentService
contentStoreService
entryService
menuItemService
menuService
minifier
mobileDetector
moduleService
SetNextEvent For ContentBox Modules
module
- The module to link this URL toevent
- The handler action combination to link toqueryString
- The query string to append in SES formataddToken
persist
persistStruct
ssl
- Create the link in SSL or notpostProcessExempt
statusCode
pageService
settingService
settings ********************************************
key
value
widgetService
site properties ********************************************
utility to strip HTML
stringTarget
Create a sub page menu for a given page or current page
page
- Optional page to create menu for, else look for current page, this can be a page object or a page slugexcludes
- The list of pages to exclude from the menutype
- The type of menu, valid choices are: ul,ol,li,nonetypeClass
- The CSS class(es) to add to the type tag, defaults to 'submenu'separator
- Used if type eq none, to separate the list of href'sshowNone
- Shows a 'No Sub Pages' message or notlevels
- The number of levels to nest hierarchical pages, by default it does only 1 level, * does all levelselementClass
- The name of the CSS class to attach to the menu parentClass
- The name of the CSS class to attach to the menu activeClass
- The name of the CSS class to attach to the menu activeShowChildren
- If true, then we will show the children of the active menu element, else we just show the active elementExecute a widget's renderit method
name
- The name of the installed widget to executeargs
- The argument collection to pass to the widget's renderIt() method