|
ContentBox Core API 1.6.0 | ||||
FRAMES |
WEB-INF.cftags.componentcoldbox.system.FrameworkSupertype
coldbox.system.Plugin
contentbox.plugins.CBHelper
public class CBHelper
******************************************************************************* ContentBox - A Modular Content Platform Copyright 2012 by Luis Majano and Ortus Solutions, Corp www.gocontentbox.org | www.luismajano.com | 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 & Description | Default | Serializable | Required |
any
|
authorService
Attributes:
|
|
true
|
false
|
any
|
categoryService
Attributes:
|
|
true
|
false
|
any
|
commentService
Attributes:
|
|
true
|
false
|
any
|
contentStoreService
Attributes:
|
|
true
|
false
|
any
|
entryService
Attributes:
|
|
true
|
false
|
any
|
minifier
Attributes:
|
|
true
|
false
|
any
|
mobileDetector
Attributes:
|
|
true
|
false
|
any
|
moduleService
Attributes:
|
|
true
|
false
|
any
|
pageService
Attributes:
|
|
true
|
false
|
any
|
widgetService
Attributes:
|
|
true
|
false
|
Constructor Summary | |
---|---|
init(any controller)
|
Method Summary | |
---|---|
any |
GETAUTHORSERVICE()
|
any |
GETCATEGORYSERVICE()
|
any |
GETCOMMENTSERVICE()
|
any |
GETCONTENTSTORESERVICE()
|
any |
GETENTRYSERVICE()
|
any |
GETMOBILEDETECTOR()
|
any |
GETMODULESERVICE()
|
any |
GETPAGESERVICE()
|
any |
GETWIDGETSERVICE()
|
CBHelper |
SETAUTHORSERVICE(any authorService)
|
CBHelper |
SETCATEGORYSERVICE(any categoryService)
|
CBHelper |
SETCOMMENTSERVICE(any commentService)
|
CBHelper |
SETCONTENTSTORESERVICE(any contentStoreService)
|
CBHelper |
SETENTRYSERVICE(any entryService)
|
CBHelper |
SETMINIFIER(any minifier)
|
CBHelper |
SETMOBILEDETECTOR(any mobileDetector)
|
CBHelper |
SETMODULESERVICE(any moduleService)
|
CBHelper |
SETPAGESERVICE(any pageService)
|
CBHelper |
SETWIDGETSERVICE(any widgetService)
|
any |
adminRoot()
|
any |
breadCrumbs([any page], [any separator='>'])
Create breadcrumbs for a page |
private any |
buildMenu([any pageRecords], [any excludes=''], [any type='ul'], [any separator=''], [boolean showNone='true'], [any levels='1'], [numeric currentLevel='1'], [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 |
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]'])
|
any |
getBlogEntryPoint()
|
any |
getCategoryFilter()
|
array |
getCommentErrors()
|
any |
getContentBoxCodeName()
|
any |
getContentBoxCodeNameURL()
|
any |
getContentBoxVersion()
|
any |
getCurrentCategories()
|
any |
getCurrentComments()
|
any |
getCurrentCommentsCount()
|
struct |
getCurrentCustomFields()
|
any |
getCurrentEntries()
|
any |
getCurrentEntriesCount()
|
any |
getCurrentEntry()
|
any |
getCurrentPage()
|
any |
getCustomField(any key, [any defaultValue])
|
any |
getDayFilter()
|
any |
getFlash()
Return the current system flash scope |
any |
getHomePage()
|
any |
getMaintenanceMessage()
|
any |
getMinifier()
|
any |
getMissingPage()
|
any |
getMonthFilter()
|
SearchResults |
getSearchResults()
|
any |
getSearchResultsContent()
|
any |
getSearchTerm()
|
any |
getWidget(any name)
Return a widget object |
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 |
isPrintFormat()
|
boolean |
isSearchView()
|
any |
layoutName()
|
any |
layoutRoot()
|
any |
layoutSetting(any key, [any value])
Get a layout setting |
any |
linkAdmin([any event=''])
Link to the admin event An optional event to link to |
any |
linkAdminLogin()
Link to the admin login |
any |
linkAdminLogout()
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()
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 |
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 |
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()
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 |
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 |
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)
|
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 layout theme you are using |
any |
quickPaging()
Render out paging for blog entries only |
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 layout theme you are using |
any |
rootMenu([any excludes=''], [any type='ul'], [any separator=''], [any levels='1'], [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 |
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 |
setting(any key, [any value])
|
any |
siteBaseURL()
|
any |
siteDescription()
|
any |
siteEmail()
|
any |
siteKeywords()
|
any |
siteName()
|
any |
siteOutgoingEmail()
|
any |
siteRoot()
|
any |
siteTagLine()
|
any |
stripHTML(any stringTarget)
utility to strip HTML |
any |
subPageMenu([any page], [any excludes=''], [any type='ul'], [any separator=''], [boolean showNone='true'], [any levels='1'], [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 |
---|
getPluginDescription, getPluginName, getPluginVersion, getRequestCollection, getRequestContext, getpluginAuthor, getpluginAuthorURL, getpluginPath, setPluginDescription, setPluginName, setPluginVersion, setpluginAuthor, setpluginAuthorURL
|
Methods inherited from class coldbox.system.FrameworkSupertype |
---|
$abort, $dump, $htmlhead, $include, $rethrow, $throw, addAsset, announceInterception, getColdboxOCM, getController, getDatasource, getDebugMode, getInterceptor, getMailService, getMailSettings, getMemento, getModel, getModuleSettings, getMyPlugin, getNewMail, getPlugin, getResource, getSetting, getSettingStructure, getSettingsBean, getValidationManager, getfwLocale, includeUDF, loadGlobalUDFLibraries, locateDirectoryPath, locateFilePath, persistVariables, populateModel, relocate, renderExternalView, renderLayout, renderView, runEvent, setDebugMode, setNextEvent, setNextRoute, setSetting, setfwLocale, settingExists, validateModel
|
Methods inherited from class WEB-INF.cftags.component |
---|
None
|
Constructor Detail |
---|
public init(any controller)
controller
Property Detail |
---|
any authorService
inject
- id:authorService@cbrequired
- falseserializable
- truedefault
- any categoryService
inject
- id:categoryService@cbrequired
- falseserializable
- truedefault
- any commentService
inject
- id:commentService@cbrequired
- falseserializable
- truedefault
- any contentStoreService
inject
- id:contentStoreService@cbrequired
- falseserializable
- truedefault
- any entryService
inject
- id:entryService@cbrequired
- falseserializable
- truedefault
- any minifier
inject
- coldbox:myplugin:JSMin@contentboxrequired
- falseserializable
- truedefault
- any mobileDetector
inject
- id:mobileDetector@cbrequired
- falseserializable
- truedefault
- any moduleService
inject
- id:moduleService@cbrequired
- falseserializable
- truedefault
- any pageService
inject
- id:pageService@cbrequired
- falseserializable
- truedefault
- any widgetService
inject
- id:widgetService@cbrequired
- falseserializable
- truedefault
- Method Detail |
---|
public any GETAUTHORSERVICE()
public any GETCATEGORYSERVICE()
public any GETCOMMENTSERVICE()
public any GETCONTENTSTORESERVICE()
public any GETENTRYSERVICE()
public any GETMOBILEDETECTOR()
public any GETMODULESERVICE()
public any GETPAGESERVICE()
public any GETWIDGETSERVICE()
public CBHelper SETAUTHORSERVICE(any authorService)
authorService
public CBHelper SETCATEGORYSERVICE(any categoryService)
categoryService
public CBHelper SETCOMMENTSERVICE(any commentService)
commentService
public CBHelper SETCONTENTSTORESERVICE(any contentStoreService)
contentStoreService
public CBHelper SETENTRYSERVICE(any entryService)
entryService
public CBHelper SETMINIFIER(any minifier)
minifier
public CBHelper SETMOBILEDETECTOR(any mobileDetector)
mobileDetector
public CBHelper SETMODULESERVICE(any moduleService)
moduleService
public CBHelper SETPAGESERVICE(any pageService)
pageService
public CBHelper SETWIDGETSERVICE(any widgetService)
widgetService
public any adminRoot()
public any breadCrumbs([any page], [any separator='>'])
page
- Optional page to create link for, else look for current pageseparator
- Breadcrumb separatorprivate any buildMenu([any pageRecords], [any excludes=''], [any type='ul'], [any separator=''], [boolean showNone='true'], [any levels='1'], [numeric currentLevel='1'], [any parentClass='parent'], [any activeClass='active'], [any activeShowChildren='false'])
pageRecords
excludes
type
separator
showNone
levels
currentLevel
parentClass
activeClass
activeShowChildren
public any buildModuleLink(string module, string linkTo, [any queryString=''], [boolean ssl='false'])
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 notpublic boolean categoryFilterExists()
public any contentStore(any slug, [any defaultValue=''])
slug
- The content slug to retrievedefaultValue
- The default value to use if the content element not found.public any contentStoreObject(any slug)
slug
- The content slug to retrievepublic any customHTML(any slug, [any defaultValue=''])
slug
- The content slug to retrievedefaultValue
- The default value to use if custom html element not found.public any event(any state, [struct data='[runtime expression]'])
state
data
public any getBlogEntryPoint()
public any getCategoryFilter()
public array getCommentErrors()
public any getContentBoxCodeName()
public any getContentBoxCodeNameURL()
public any getContentBoxVersion()
public any getCurrentCategories()
public any getCurrentComments()
public any getCurrentCommentsCount()
public struct getCurrentCustomFields()
public any getCurrentEntries()
public any getCurrentEntriesCount()
public any getCurrentEntry()
public any getCurrentPage()
public any getCustomField(any key, [any defaultValue])
key
defaultValue
public any getDayFilter()
public any getFlash()
public any getHomePage()
public any getMaintenanceMessage()
public any getMinifier()
public any getMissingPage()
public any getMonthFilter()
public SearchResults getSearchResults()
public any getSearchResultsContent()
public any getSearchTerm()
public any getWidget(any name)
name
- The name of the installed widget to returnpublic any getYearFilter()
public boolean isArchivesView()
public boolean isBlogView()
public boolean isCommentFormError()
public any isCommentsEnabled([any content])
content
- The entry or page content to validate comments also withpublic boolean isEntryView()
public boolean isIndexView()
public boolean isMobile()
public boolean isPageView([any page=''])
page
- Optional page slug to determine if you are in that page or not.public boolean isPrintFormat()
public boolean isSearchView()
public any layoutName()
public any layoutRoot()
public any layoutSetting(any key, [any value])
key
- The name of the layout settingvalue
- The default value if the layout setting does not existpublic any linkAdmin([any event=''])
event
public any linkAdminLogin()
public any linkAdminLogout()
public any linkArchive([any year], [any month], [any day], [boolean ssl='false'])
year
- The year of the archivemonth
- The month of the archiveday
- The day of the archivessl
public any linkBlog()
public any linkCategory(any category, [boolean ssl='false'])
category
- The category object to link tossl
public any linkComment(any comment, [boolean ssl='false'])
comment
- The comment to link tossl
public any linkCommentPost(any content, [boolean ssl='false'])
content
- The entry or page to link to its commentsssl
public any linkComments(any content, [boolean ssl='false'])
content
- The entry or page to link to its commentsssl
public any linkContent(any content, [boolean ssl='false'], [any format='html'])
content
- The content object to link tossl
format
- The format output of the content default is HTML but you can pass pdf,print or doc.public any linkContentSearch([boolean ssl='false'])
ssl
public any linkEntry(any entry, [boolean ssl='false'], [any format='html'])
entry
- The entry to link tossl
format
- The format output of the content default is HTML bu you can pass pdf,print or doc.public any linkEntryWithSlug(any slug, [boolean ssl='false'], [any format='html'])
slug
- The entry slug to link tossl
format
- The format output of the content default is HTML bu you can pass pdf,print or doc.public any linkHome()
public any linkPage(any page, [boolean ssl='false'], [any format='html'])
page
- The page to link to. This can be a simple value or a page objectssl
format
- The format output of the content default is HTML but you can pass pdf,print or doc.public any linkPageRSS([any category], [boolean comments='false'], [any page], [boolean ssl='false'])
category
- The category to filter oncomments
- Page comments or not, defaults to falsepage
- The page you want to filter onssl
public any linkPageWithSlug(any slug, [boolean ssl='false'], [any format='html'])
slug
- The page slug to link tossl
format
- The format output of the content default is HTML bu you can pass pdf,print or doc.public any linkRSS([any category], [any comments='false'], [any entry], [boolean ssl='false'])
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
public any linkSearch([boolean ssl='false'])
ssl
public any linkSelf()
public any linkSiteRSS([any category], [boolean comments='false'], [string slug], [boolean ssl='false'])
category
- The category to filter oncomments
- Do comments RSS feedsslug
- The content slug to filter on when using commentsssl
public any linkToParentPage([any page], [any text=''])
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 titlepublic any mainView()
public any minify(any assets)
assets
- A list of js or css files to compress and add to the page. They will be concatenated in orderpublic CBHelper minifyClearCache()
public CBHelper minifyToHead(any assets)
assets
- A list of js or css files to compress and add to the page. They will be concatenated in orderpublic any quickAvatar(any author, [numeric size='25'])
author
- The author object to render an avatar fromsize
- The size of the gravatar, by default we use 25 pixelspublic any quickCategories([any template='category'], [any collectionAs='category'], [any args='[runtime expression]'])
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 'categoryargs
- A structure of name-value pairs to pass to the templatepublic any quickCategoryLinks(any entry)
entry
public any quickCommentForm(any content)
content
- The content this comment form will be linked to, page or entrypublic any quickComments([any template='comment'], [any collectionAs='comment'], [any args='[runtime expression]'])
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 'commentargs
- A structure of name-value pairs to pass to the templatepublic any quickCustomFields()
public any quickEntries([any template='entry'], [any collectionAs='entry'], [any args='[runtime expression]'])
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 'entryargs
- A structure of name-value pairs to pass to the templatepublic any quickEntry([any template='entry'], [any collectionAs='entry'], [any args='[runtime expression]'])
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 'entryargs
- A structure of name-value pairs to pass to the templatepublic any quickLayout(any layout, [any view=''], [any module='contentbox'], [any args='[runtime expression]'], [any viewModule=''], [any prePostExempt='false'])
layout
view
module
args
viewModule
prePostExempt
public any quickPaging()
public any quickSearchForm()
public any quickSearchPaging()
public any quickView(any view, [any cache='false'], [any cacheTimeout], [any cacheLastAccessTimeout], [any cacheSuffix], [any module='contentbox'], [any args], [any collection], [any collectionAs], [any prepostExempt])
view
cache
cacheTimeout
cacheLastAccessTimeout
cacheSuffix
module
args
collection
collectionAs
prepostExempt
public any rootMenu([any excludes=''], [any type='ul'], [any separator=''], [any levels='1'], [any parentClass='parent'], [any activeClass='active'])
excludes
- The list of pages to exclude from the menutype
- The type of menu, valid choices are: ul,ol,li,data,noneseparator
- 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 levelsparentClass
- The name of the CSS class to attach to the menu activeClass
- The name of the CSS class to attach to the menu public boolean searchTermExists()
private any sep()
public any setNextModuleEvent(string module, [string event], [any queryString=''], [boolean addToken='false'], [any persist], [struct persistStruct], [boolean ssl='false'], [boolean postProcessExempt='false'], [numeric statusCode])
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
public any setting(any key, [any value])
key
value
public any siteBaseURL()
public any siteDescription()
public any siteEmail()
public any siteKeywords()
public any siteName()
public any siteOutgoingEmail()
public any siteRoot()
public any siteTagLine()
public any stripHTML(any stringTarget)
stringTarget
public any subPageMenu([any page], [any excludes=''], [any type='ul'], [any separator=''], [boolean showNone='true'], [any levels='1'], [any parentClass='parent'], [any activeClass='active'], [any activeShowChildren='false'])
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,noneseparator
- 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 levelsparentClass
- 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 elementpublic any widget(any name, [struct args='[runtime expression]'])
name
- The name of the installed widget to executeargs
- The argument collection to pass to the widget's renderIt() methodpublic any widgetRoot()
|
ContentBox Core API 1.6.0 | ||||
FRAMES |