UNA
|
Public Member Functions | |
__clone () | |
collectingStart () | |
collectingEndGetCode ($aExcludeCss=array(), $aExcludeJs=array(), $sFormat='html') | |
loadTemplates () | |
init () | |
setPageNameIndex ($i) | |
setPageNameIndexByTarget ($s) | |
getPageNameIndex () | |
setPageType ($i) | |
setPageUrl ($s) | |
getPageType () | |
setPageHeader ($s) | |
getPageHeader () | |
setPageParams ($a) | |
getPageParams () | |
setPageMetaTitle ($sTitle) | |
setPageDescription ($sDescription) | |
setPageMetaRobots ($s) | |
setPageInjections ($aInjections) | |
setPageContent ($sVar, $sContent, $iIndex=false) | |
getPageContent ($sVar=false, $iIndex=false) | |
getName () | |
getCssClassName () | |
getCode () | |
getEmbed ($sContent) | |
getCodeKey () | |
getMix () | |
getPath () | |
setPageTitle ($sTitle) | |
setPageMainBoxTitle ($sTitle) | |
isLocation ($sKey) | |
getLocations () | |
addLocation ($sKey, $sLocationPath, $sLocationUrl) | |
addDynamicLocation ($sLocationPath, $sLocationUrl) | |
removeLocation ($sKey) | |
isLocationJs ($sKey) | |
addLocationJs ($sKey, $sLocationPath, $sLocationUrl) | |
addDynamicLocationJs ($sLocationPath, $sLocationUrl) | |
removeLocationJs ($sKey) | |
addJsOption ($mixedName) | |
addJsTranslation ($mixedKey, $bDynamic=false) | |
addJsImage ($aImages) | |
addJsIcon ($aIcons) | |
addCssStyle ($sName, $sContent) | |
addPageKeywords ($mixedKeywords, $sDevider=',') | |
addPageMetaLocation ($fLat, $fLng, $sCountryCode) | |
addPageMetaImage ($sImageUrl) | |
addPageRssLink ($sTitle, $sUrl) | |
getMetaInfo () | |
getTemplate ($sName) | |
getTemplateFunctions () | |
getImageMimeType ($sExtension) | |
getIcon ($mixedId, $aParams=array()) | |
getImage ($mixedId, $aParams=array()) | |
getIconUrl ($sName, $sCheckIn=BX_DOL_TEMPLATE_CHECK_IN_BOTH) | |
getIconPath ($sName, $sCheckIn=BX_DOL_TEMPLATE_CHECK_IN_BOTH) | |
getImageAuto ($sName, $bWrapped=true, $sCheckIn=BX_DOL_TEMPLATE_CHECK_IN_BOTH) | |
getImageUrl ($sName, $sCheckIn=BX_DOL_TEMPLATE_CHECK_IN_BOTH) | |
getImagePath ($sName, $sCheckIn=BX_DOL_TEMPLATE_CHECK_IN_BOTH) | |
getCssUrl ($sName, $sCheckIn=BX_DOL_TEMPLATE_CHECK_IN_BOTH) | |
getCssPath ($sName, $sCheckIn=BX_DOL_TEMPLATE_CHECK_IN_BOTH) | |
getJsUrl ($sName) | |
getJsPath ($sName) | |
getTemplateUrl ($sName, $sCheckIn=BX_DOL_TEMPLATE_CHECK_IN_BOTH) | |
getTemplatePath ($sName, $sCheckIn=BX_DOL_TEMPLATE_CHECK_IN_BOTH) | |
getMenu ($s) | |
isHtml ($sName, $sCheckIn=BX_DOL_TEMPLATE_CHECK_IN_BOTH) | |
getHtml ($sName, $sCheckIn=BX_DOL_TEMPLATE_CHECK_IN_BOTH) | |
parseHtmlByName ($sName, $aVariables, $mixedKeyWrapperHtml=null, $sCheckIn=BX_DOL_TEMPLATE_CHECK_IN_BOTH) | |
parseHtmlByContent ($sContent, $aVariables, $mixedKeyWrapperHtml=null) | |
parseHtmlByTemplateName ($sName, $aVariables, $mixedKeyWrapperHtml=null) | |
parsePageByName ($sName, $aVariables) | |
parseSystemKey ($sKey, $mixedKeyWrapperHtml=null, $bProcessInjection=true) | |
parseLink ($sLink, $sContent, $aAttrs=array()) | |
parseLinkByName ($sName, $sLink, $sContent, $aAttrs=array()) | |
parseButton ($sContent, $aAttrs=array()) | |
parseImage ($sLink, $aAttrs=array()) | |
parseIcon ($sName, $aAttrs=array()) | |
getTemplatesCacheObject () | |
getCached ($sName, &$aVariables, $mixedKeyWrapperHtml=null, $sCheckIn=BX_DOL_TEMPLATE_CHECK_IN_BOTH, $bEvaluate=true) | |
addJs ($mixedFiles, $bDynamic=false) | |
getJs () | |
addJsSystem ($mixedFiles) | |
deleteJs ($mixedFiles) | |
deleteJsSystem ($mixedFiles) | |
_compileJs ($sAbsolutePath, &$aIncluded) | |
_minifyJs ($s) | |
_wrapInTagJs ($sFile) | |
_wrapInTagJsCode ($sCode) | |
addCss ($mixedFiles, $bDynamic=false) | |
getCss () | |
addCssAsync ($mixedFiles) | |
includeCssAsync () | |
addCssSystem ($mixedFiles) | |
deleteCss ($mixedFiles) | |
deleteCssSystem ($mixedFiles) | |
_compileCss ($sAbsolutePath, &$aIncluded) | |
_lessCss ($mixed) | |
_minifyCss ($s) | |
_wrapInTagCss ($sFile) | |
_wrapInTagCssCode ($sCode) | |
includeCssStyles () | |
includeFiles ($sType, $bSystem=false, $bWrap=true) | |
_includeFiles ($sType, &$aFiles, $bWrap=true) | |
_processFiles ($sType, $sAction, $mixedFiles, $bDynamic=false, $bSystem=false) | |
_parseContent ($sContent, $aVariables, $mixedKeyWrapperHtml=null) | |
_compileContent ($sContent, $aVarName, $iVarDepth, $aVarValues, $mixedKeyWrapperHtml=null) | |
_getAbsoluteLocation ($sType, $sFolder, $sName, $sCheckIn=BX_DOL_TEMPLATE_CHECK_IN_BOTH) | |
_getAbsoluteLocationJs ($sType, $sName) | |
_getInlineData ($sType, $sName, $sCheckIn) | |
_getCacheFileName ($sType, $sAbsolutePath) | |
_getKeyWrappers ($mixedKeyWrapperHtml) | |
_processJsTranslations () | |
_processJsOptions () | |
_processJsImages () | |
_getLoaderUrl ($sType, $sName) | |
getRevision () | |
addRevision ($sUrl) | |
displayAccessDenied ($sMsg='', $iPage=BX_PAGE_DEFAULT, $iDesignBox=BX_DB_PADDING_DEF) | |
processInjection ($iPageIndex, $sKey, $sValue="") | |
addInjection ($sKey, $sType, $sData, $iReplace=0) | |
Static Public Member Functions | |
static | getInstance () |
static | retrieveCode ($sCodeKey=BX_DOL_TEMPLATE_CODE_KEY, $sMixKey=BX_DOL_TEMPLATE_MIX_KEY, $sRootPath=BX_DIRECTORY_PATH_ROOT) |
Protected Member Functions | |
__construct ($sRootPath=BX_DIRECTORY_PATH_ROOT, $sRootUrl=BX_DOL_URL_ROOT) | |
Protected Attributes | |
$_sName | |
$_bCacheEnable | |
Template engine.
An object of the class allows to:
Avalable constructions.
sys_injections
/sys_injections_admin
/ tables.Related classes: BxDolTemplateAdmin - for processing admin templates. Template classes in modules - for processing modiles' templates.
Global variables: oSysTemplate - is used for template processing in user part. oAdmTemplate - is used for template processing in admin part.
Add injection:
sys_injections
table or sys_injections_admin
table for admin panel.Predefined template keys to add injections:
Example of usage:
Memberships/ACL: Doesn't depend on user's membership.
Alerts: no alerts available
|
protected |
Constructor
BxDolTemplate::__clone | ( | ) |
Prevent cloning the instance
BxDolTemplate::_compileContent | ( | $sContent, | |
$aVarName, | |||
$iVarDepth, | |||
$aVarValues, | |||
$mixedKeyWrapperHtml = null |
|||
) |
Compile content
string | $sContent | template. |
string | $aVarName | variable name to be saved in the output file. |
integer | $iVarDepth | depth is used to process nesting, for example, in cycles. |
array | $aVarValues | values to be compiled in. |
mixed | $mixedKeyWrapperHtml | key wrapper(string value if left and right parts are the same, array(0 => left, 1 => right) otherwise). |
BxDolTemplate::_compileCss | ( | $sAbsolutePath, | |
& | $aIncluded | ||
) |
Compile CSS files' structure(
string | $sAbsolutePath | CSS file absolute path(full URL for external CSS/JS files). |
array | $aIncluded | an array of already included CSS files. |
BxDolTemplate::_compileJs | ( | $sAbsolutePath, | |
& | $aIncluded | ||
) |
Compile JS files in one file.
string | $sAbsolutePath | CSS file absolute path(full URL for external CSS/JS files). |
array | $aIncluded | an array of already included JS files. |
BxDolTemplate::_getAbsoluteLocation | ( | $sType, | |
$sFolder, | |||
$sName, | |||
$sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH |
|||
) |
Get absolute location of some template's part.
string | $sType | - result type. Available values 'url' and 'path'. |
string | $sFolder | - folders to be searched in. |
string | $sName | - requested part name. |
string | $sCheckIn | where the content would be searched(base, template, both) |
Module(mod) related locations will be checked first in TMPL and BASE, then system(sys) location(s) will be checked in TMPL and BASE.
try to find from received path
BxDolTemplate::_getAbsoluteLocationJs | ( | $sType, | |
$sName | |||
) |
Get absolute location of some template's part.
string | $sType | result type. Available values 'url' and 'path'. |
string | $sName | requested part name. |
BxDolTemplate::_getCacheFileName | ( | $sType, | |
$sAbsolutePath | |||
) |
Get file name where the template would be cached.
string | $sAbsolutePath | template's real path. |
BxDolTemplate::_getInlineData | ( | $sType, | |
$sName, | |||
$sCheckIn | |||
) |
Get inline data for Images and Icons.
string | $sType | image/icon |
string | $sName | file name |
string | $sCheckIn | where the content would be searched(base, template, both) |
BxDolTemplate::_getKeyWrappers | ( | $mixedKeyWrapperHtml | ) |
Get template key wrappers(left, right)
mixed | $mixedKeyWrapperHtml | key wrapper(string value if left and right parts are the same, array(0 => left, 1 => right) otherwise). |
BxDolTemplate::_getLoaderUrl | ( | $sType, | |
$sName | |||
) |
Get Gzip loader URL.
$sType | content type CSS/JS |
$sName | file name. |
BxDolTemplate::_includeFiles | ( | $sType, | |
& | $aFiles, | ||
$bWrap = true |
|||
) |
Include CSS/JS files without caching.
string | $sType | the file type (css or js) |
array | $aFiles | CSS/JS files to be added to the page. |
BxDolTemplate::_lessCss | ( | $mixed | ) |
Less CSS
mixed | $mixed | CSS string to process with Less compiler or an array with CSS file's Path and URL. |
BxDolTemplate::_minifyCss | ( | $s | ) |
Minify CSS
string | $s | CSS string to minify |
BxDolTemplate::_minifyJs | ( | $s | ) |
Minify JS
string | $s | JS string to minify |
BxDolTemplate::_parseContent | ( | $sContent, | |
$aVariables, | |||
$mixedKeyWrapperHtml = null |
|||
) |
Parse content.
string | $sContent | - HTML file's content. |
array | $aVariables | - key/value pairs. key should be the same as template's key, but without prefix and postfix. |
mixed | $mixedKeyWrapperHtml | - key wrapper(string value if left and right parts are the same, array(0 => left, 1 => right) otherwise). |
BxDolTemplate::_processFiles | ( | $sType, | |
$sAction, | |||
$mixedFiles, | |||
$bDynamic = false , |
|||
$bSystem = false |
|||
) |
Insert/Delete CSS file from output stack.
string | $sType | the file type (css or js) |
string | $sAction | add/delete |
mixed | $mixedFiles | string value represents a single CSS file name. An array - array of CSS file names. |
BxDolTemplate::_processJsImages | ( | ) |
Process all added images and return them as a string.
BxDolTemplate::_processJsOptions | ( | ) |
Process all added options and return them as a string.
BxDolTemplate::_processJsTranslations | ( | ) |
Process all added language translations and return them as a string.
BxDolTemplate::_wrapInTagCss | ( | $sFile | ) |
Wrap an URL to CSS file into CSS tag.
string | $sFile | - URL to CSS file. |
BxDolTemplate::_wrapInTagCssCode | ( | $sCode | ) |
Wrap CSS code into CSS tag.
string | $sCode | - CSS code. |
BxDolTemplate::_wrapInTagJs | ( | $sFile | ) |
Wrap an URL to JS file into JS tag.
string | $sFile | - URL to JS file. |
BxDolTemplate::_wrapInTagJsCode | ( | $sCode | ) |
Wrap JS code into JS tag.
string | $sCode | - JS code. |
BxDolTemplate::addCss | ( | $mixedFiles, | |
$bDynamic = false |
|||
) |
Add CSS file(s) to global output.
mixed | $mixedFiles | string value represents a single CSS file name. An array - array of CSS file names. |
boolean | $bDynamic | in the dynamic mode CSS file(s) are not included to global output, but are returned from the function directly. |
BxDolTemplate::addCssAsync | ( | $mixedFiles | ) |
Add additional heavy css file (not very necessary) to load asynchronously for desktop browsers only
mixed | $mixedFiles | string value represents a single CSS file name. An array - array of CSS file names. |
BxDolTemplate::addCssStyle | ( | $sName, | |
$sContent | |||
) |
Add CSS style.
string | $sName | CSS class name. |
string | $sContent | CSS class styles. |
BxDolTemplate::addCssSystem | ( | $mixedFiles | ) |
Add System CSS file(s) to global output. System CSS files are the files which are attached to all pages. They will be cached separately from the others.
mixed | $mixedFiles | string value represents a single CSS file name. An array - array of CSS file names. |
BxDolTemplate::addDynamicLocation | ( | $sLocationPath, | |
$sLocationUrl | |||
) |
Add dynamic location.
string | $sLocationPath | - location's path. For modules: '[path_to_script]/modules/[vendor_name]/[module_name]/' |
string | $sLocationUrl | - location's url. For modules: '[url_to_script]/modules/[vendor_name]/[module_name]/' |
BxDolTemplate::addDynamicLocationJs | ( | $sLocationPath, | |
$sLocationUrl | |||
) |
Add dynamic JS location.
string | $sLocationPath | - location's path. For modules: '[path_to_script]/modules/[vendor_name]/[module_name]/' |
string | $sLocationUrl | - location's url. For modules: '[url_to_script]/modules/[vendor_name]/[module_name]/' |
BxDolTemplate::addInjection | ( | $sKey, | |
$sType, | |||
$sData, | |||
$iReplace = 0 |
|||
) |
Static method to add ingection available on the current page only.
string | $sKey | - template's key. |
string | $sType | - injection type(text, php). |
string | $sData | - the data to be added. |
integer | $iReplace | - replace already existed data or not. |
BxDolTemplate::addJs | ( | $mixedFiles, | |
$bDynamic = false |
|||
) |
Add JS file(s) to global output.
mixed | $mixedFiles | string value represents a single JS file name. An array - array of JS file names. |
boolean | $bDynamic | in the dynamic mode JS file(s) are not included to global output, but are returned from the function directly. |
BxDolTemplate::addJsIcon | ( | $aIcons | ) |
Add icon in JS output.
array | $aIcons | an array of icons descriptors. The descriptor is a key/value pear in the array of descriptors. |
BxDolTemplate::addJsImage | ( | $aImages | ) |
Add image in JS output.
array | $aImages | an array of image descriptors. The descriptor is a key/value pear in the array of descriptors. |
BxDolTemplate::addJsOption | ( | $mixedName | ) |
Add Option in JS output.
mixed | $mixedName | option's name or an array of options' names. |
BxDolTemplate::addJsSystem | ( | $mixedFiles | ) |
Add System JS file(s) to global output. System JS files are the files which are attached to all pages. They will be cached separately from the others.
mixed | $mixedFiles | string value represents a single JS file name. An array - array of JS file names. |
boolean | $bDynamic | in the dynamic mode JS file(s) are not included to global output, but are returned from the function directly. |
BxDolTemplate::addJsTranslation | ( | $mixedKey, | |
$bDynamic = false |
|||
) |
Add language translation for key in JS output.
mixed | $mixedKey | language key or an array of keys. |
BxDolTemplate::addLocation | ( | $sKey, | |
$sLocationPath, | |||
$sLocationUrl | |||
) |
Add location in array of locations. Note. Location is the path/url to folder where 'templates' folder is stored.
string | $sKey | - location's unique key. |
string | $sLocationPath | - location's path. For modules: '[path_to_script]/modules/[vendor_name]/[module_name]/' |
string | $sLocationUrl | - location's url. For modules: '[url_to_script]/modules/[vendor_name]/[module_name]/' |
BxDolTemplate::addLocationJs | ( | $sKey, | |
$sLocationPath, | |||
$sLocationUrl | |||
) |
Add JS location in array of JS locations. Note. Location is the path/url to folder where JS files are stored.
string | $sKey | - location's unique key. |
string | $sLocationPath | - location's path. For modules: '[path_to_script]/modules/[vendor_name]/[module_name]/js/' |
string | $sLocationUrl | - location's url. For modules: '[url_to_script]/modules/[vendor_name]/[module_name]/js/' |
BxDolTemplate::addPageKeywords | ( | $mixedKeywords, | |
$sDevider = ',' |
|||
) |
Set page keywords.
mixed | $mixedKeywords | necessary page keywords(string - single keyword, array - an array of keywords). |
string | $sDevider | - string devider. |
BxDolTemplate::addPageMetaImage | ( | $sImageUrl | ) |
Set page meta image.
$sImageUrl | meta image url |
BxDolTemplate::addPageMetaLocation | ( | $fLat, | |
$fLng, | |||
$sCountryCode | |||
) |
Set page locatoin coordinates.
$fLat | latitude |
$fLng | longitude |
BxDolTemplate::addPageRssLink | ( | $sTitle, | |
$sUrl | |||
) |
Set page rss link.
$sTitle | - rss feed title |
$sUrl | - rss feed URL |
BxDolTemplate::addRevision | ( | $sUrl | ) |
Add current revision number to URL.
BxDolTemplate::collectingEndGetCode | ( | $aExcludeCss = array() , |
|
$aExcludeJs = array() , |
|||
$sFormat = 'html' |
|||
) |
Get difference for non-system css and js files from previously remembered state as ready HTML code, additionally filter out css and js from $aExcludeCss and $aExcludeJs arrays
BxDolTemplate::collectingStart | ( | ) |
Remember current state of aPage variable with all css, js, etc
BxDolTemplate::deleteCss | ( | $mixedFiles | ) |
Delete CSS file(s) from global output.
mixed | $mixedFiles | string value represents a single CSS file name. An array - array of CSS file names. |
BxDolTemplate::deleteCssSystem | ( | $mixedFiles | ) |
Delete System CSS file(s) from global output.
mixed | $mixedFiles | string value represents a single CSS file name. An array - array of CSS file names. |
BxDolTemplate::deleteJs | ( | $mixedFiles | ) |
Delete JS file(s) from global output.
mixed | $mixedFiles | string value represents a single JS file name. An array - array of JS file names. |
BxDolTemplate::deleteJsSystem | ( | $mixedFiles | ) |
Delete System JS file(s) from global output.
mixed | $mixedFiles | string value represents a single JS file name. An array - array of JS file names. |
BxDolTemplate::displayAccessDenied | ( | $sMsg = '' , |
|
$iPage = BX_PAGE_DEFAULT , |
|||
$iDesignBox = BX_DB_PADDING_DEF |
|||
) |
Functions to display pages with errors, messages and so on.
BxDolTemplate::getCached | ( | $sName, | |
& | $aVariables, | ||
$mixedKeyWrapperHtml = null , |
|||
$sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH , |
|||
$bEvaluate = true |
|||
) |
Get template from cache if it's enabled.
string | $sName | template name |
string | $aVariables | key/value pairs. key should be the same as template's key, but without prefix and postfix. |
mixed | $mixedKeyWrapperHtml | - key wrapper(string value if left and right parts are the same, array(0 => left, 1 => right) otherwise). |
string | $sCheckIn | where the content would be searched(base, template, both) |
boolean | $bEvaluate | need to evaluate the template or not. |
BxDolTemplate::getCode | ( | ) |
Get currently active template code.
BxDolTemplate::getCodeKey | ( | ) |
Get code key.
BxDolTemplate::getCss | ( | ) |
get added css files
BxDolTemplate::getCssClassName | ( | ) |
Get currently active template name.
BxDolTemplate::getCssPath | ( | $sName, | |
$sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH |
|||
) |
Get full Path of CSS file.
string | $sName | - CSS file name. |
string | $sCheckIn | where the content would be searched(base, template, both) |
BxDolTemplate::getCssUrl | ( | $sName, | |
$sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH |
|||
) |
Get full URL of CSS file.
string | $sName | - CSS file name. |
string | $sCheckIn | where the content would be searched(base, template, both) |
BxDolTemplate::getEmbed | ( | $sContent | ) |
Get embed code.
BxDolTemplate::getHtml | ( | $sName, | |
$sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH |
|||
) |
Get content of HTML file.
string | $sName | - HTML file name. |
string | $sCheckIn | where the content would be searched(base, template, both) |
BxDolTemplate::getIcon | ( | $mixedId, | |
$aParams = array() |
|||
) |
Get icon template in dependence of a value, provided in $mixedId.
mixed | $mixedId | numeric id from Storage, string with template's file name or string with font icon. |
BxDolTemplate::getIconPath | ( | $sName, | |
$sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH |
|||
) |
Get absolute Path for the icon.
string | $sName | - icon's file name. |
string | $sCheckIn | where the content would be searched(base, template, both) |
BxDolTemplate::getIconUrl | ( | $sName, | |
$sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH |
|||
) |
Get full URL for the icon.
string | $sName | icon's file name. |
string | $sCheckIn | where the content would be searched(base, template, both) |
BxDolTemplate::getImage | ( | $mixedId, | |
$aParams = array() |
|||
) |
Get image template in dependence of a value, provided in $mixedId.
mixed | $mixedId | numeric id from Storage, string with template's file name or string with font icon. |
BxDolTemplate::getImageAuto | ( | $sName, | |
$bWrapped = true , |
|||
$sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH |
|||
) |
Get image/icon by name automatically. Cache item description: [ 'v' => value (name, url or source), 'c' => classes list divided with comma (,) 't' => parse type (ic - icon, im - image, sc - source) ] Cached images can be overwritten by listening 'system' - 'get_layout_images' alert.
string | $sName | unique name. The following format can be used: name|classes. Where name and classes can consists of multiple parts (divided with comma (,) in HTML variant). For example, in PHP: $this->getImageAuto('far star|class1 class2'); in HTML: <bx_image_auto:far,star|class1,class2 /> |
boolean | $bWrapped | wrap in HTML tag or not. |
string | $sCheckIn | where the content would be searched(base, template, both) |
BxDolTemplate::getImageMimeType | ( | $sExtension | ) |
Get image MIME type.
string | $sExtension | - image file's extension. |
BxDolTemplate::getImagePath | ( | $sName, | |
$sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH |
|||
) |
Get absolute Path for the image.
string | $sName | - image's file name. |
string | $sCheckIn | where the content would be searched(base, template, both) |
BxDolTemplate::getImageUrl | ( | $sName, | |
$sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH |
|||
) |
Get full URL for the image.
string | $sName | - images's file name. |
string | $sCheckIn | where the content would be searched(base, template, both) |
|
static |
Get singleton instance of the class
Implements iBxDolSingleton.
BxDolTemplate::getJs | ( | ) |
get added js files
BxDolTemplate::getJsPath | ( | $sName | ) |
Get full Path of JS file.
string | $sName | - JS file name. |
BxDolTemplate::getJsUrl | ( | $sName | ) |
Get full URL of JS file.
string | $sName | - JS file name. |
BxDolTemplate::getLocations | ( | ) |
Get a lis of all added locations.
BxDolTemplate::getMenu | ( | $s | ) |
Get menu.
$s | menu object name |
BxDolTemplate::getMetaInfo | ( | ) |
Returns page meta info, like meta keyword, meta description, location, etc
BxDolTemplate::getMix | ( | ) |
Get currently active template mix.
BxDolTemplate::getName | ( | ) |
Get currently active template name.
BxDolTemplate::getPageContent | ( | $sVar = false , |
|
$iIndex = false |
|||
) |
Get page content for some variable.
string | $sVar | name of content variable |
int | $iIndex | optional page index, default is index which was set before with |
BxDolTemplate::getPageHeader | ( | ) |
Get page header
BxDolTemplate::getPageNameIndex | ( | ) |
Get page name index
BxDolTemplate::getPageParams | ( | ) |
Get page params.
BxDolTemplate::getPageType | ( | ) |
Get page type
BxDolTemplate::getPath | ( | ) |
Get currently active template path.
BxDolTemplate::getRevision | ( | ) |
Get current revision number.
BxDolTemplate::getTemplate | ( | $sName | ) |
Get template, which was loaded earlier.
string | $sName | - template name. |
BxDolTemplate::getTemplateFunctions | ( | ) |
Get template functions object.
BxDolTemplate::getTemplatePath | ( | $sName, | |
$sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH |
|||
) |
Get full Path of JS file.
string | $sName | - JS file name. |
BxDolTemplate::getTemplatesCacheObject | ( | ) |
Get cache object for templates
BxDolTemplate::getTemplateUrl | ( | $sName, | |
$sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH |
|||
) |
Get full URL of Template (HTML) file.
string | $sName | - Template file name. |
BxDolTemplate::includeCssAsync | ( | ) |
Return script tag with special code to load async css. This tag is added after js files list
BxDolTemplate::includeCssStyles | ( | ) |
Include CSS style(s) in the page's head section.
BxDolTemplate::includeFiles | ( | $sType, | |
$bSystem = false , |
|||
$bWrap = true |
|||
) |
Include CSS/JS file(s) attached to the page in its head section.
string | $sType | the type of file('js' or 'css') |
BxDolTemplate::init | ( | ) |
Initialize template engine. Note. The method is executed with the system, you shouldn't execute it in your subclasses.
BxDolTemplate::isHtml | ( | $sName, | |
$sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH |
|||
) |
Check whether HTML file exists or not.
string | $sName | - HTML file name. |
string | $sCheckIn | where the content would be searched(base, template, both) |
BxDolTemplate::isLocation | ( | $sKey | ) |
Check whether location exists or not.
string | $sKey | - location's unique key. |
BxDolTemplate::isLocationJs | ( | $sKey | ) |
Check whether JS location exists or not.
string | $sKey | - JS location's unique key. |
BxDolTemplate::loadTemplates | ( | ) |
Load templates.
BxDolTemplate::parseButton | ( | $sContent, | |
$aAttrs = array() |
|||
) |
Parse tag <BUTTON>
string | $sContent | link content |
array | $aAttrs | an array of key => value pairs |
BxDolTemplate::parseHtmlByContent | ( | $sContent, | |
$aVariables, | |||
$mixedKeyWrapperHtml = null |
|||
) |
Parse HTML template.
string | $sContent | - HTML file content. |
array | $aVariables | - key/value pairs. key should be the same as template's key, but without prefix and postfix. |
mixed | $mixedKeyWrapperHtml | - key wrapper(string value if left and right parts are the same, array(left, right) otherwise). |
BxDolTemplate::parseHtmlByName | ( | $sName, | |
$aVariables, | |||
$mixedKeyWrapperHtml = null , |
|||
$sCheckIn = BX_DOL_TEMPLATE_CHECK_IN_BOTH |
|||
) |
Parse HTML template. Search for the template with accordance to it's file name.
string | $sName | - HTML file name. |
array | $aVariables | - key/value pairs. key should be the same as template's key, but without prefix and postfix. |
mixed | $mixedKeyWrapperHtml | - key wrapper(string value if left and right parts are the same, array(left, right) otherwise). |
string | $sCheckIn | where the content would be searched(base, template, both) |
BxDolTemplate::parseHtmlByTemplateName | ( | $sName, | |
$aVariables, | |||
$mixedKeyWrapperHtml = null |
|||
) |
Parse earlier loaded HTML template.
string | $sName | - template name. |
array | $aVariables | - key/value pairs. Key should be the same as template's key, excluding prefix and postfix. |
BxDolTemplate::parseIcon | ( | $sName, | |
$aAttrs = array() |
|||
) |
Parse font based icon in tag
string | $sName | font icon name |
array | $aAttrs | an array of key => value pairs |
BxDolTemplate::parseImage | ( | $sLink, | |
$aAttrs = array() |
|||
) |
Parse tag
string | $sLink | URL to image source |
array | $aAttrs | an array of key => value pairs |
BxDolTemplate::parseLink | ( | $sLink, | |
$sContent, | |||
$aAttrs = array() |
|||
) |
Parse tag
string | $sLink | link URL |
string | $sContent | link content |
array | $aAttrs | an array of key => value pairs |
BxDolTemplate::parseLinkByName | ( | $sName, | |
$sLink, | |||
$sContent, | |||
$aAttrs = array() |
|||
) |
Parse tag using provided HTML template
string | $sName | template's file name |
string | $sLink | link URL |
string | $sContent | link content |
array | $aAttrs | an array of key => value pairs |
BxDolTemplate::parsePageByName | ( | $sName, | |
$aVariables | |||
) |
Parse page HTML template. Search for the page's template with accordance to it's file name.
string | $sName | - HTML file name. |
array | $aVariables | - key/value pairs. key should be the same as template's key, but without prefix and postfix. |
BxDolTemplate::parseSystemKey | ( | $sKey, | |
$mixedKeyWrapperHtml = null , |
|||
$bProcessInjection = true |
|||
) |
Parse system keys.
string | $sKey | key |
BxDolTemplate::processInjection | ( | $iPageIndex, | |
$sKey, | |||
$sValue = "" |
|||
) |
Static method is used to add/replace the content of some key in the template. It's usefull when you don't want to modify existing template but need to add some data to existing template key.
integer | $iPageIndex | - page index where injections would processed. Use 0 if you want it to be done on all the pages. |
string | $sKey | - template key. |
string | $sValue | - the data to be added. |
BxDolTemplate::removeLocation | ( | $sKey | ) |
Remove location from array of locations. Note. Location is the path/url to folder where templates are stored.
string | $sKey | - location's unique key. |
BxDolTemplate::removeLocationJs | ( | $sKey | ) |
Remove JS location from array of locations. Note. Location is the path/url to folder where templates are stored.
string | $sKey | - JS location's unique key. |
|
static |
Retrieve template code and check whether it's associated with active template or not.
string | $sCodeKey | template's code key. |
string | $sMixKey | template's mix key. |
string | $sRootPath | path to root directory. |
BxDolTemplate::setPageContent | ( | $sVar, | |
$sContent, | |||
$iIndex = false |
|||
) |
Set page content for some variable.
string | $sVar | name of content variable |
string | $sContent | content for $sVar variable |
int | $iIndex | optional page index, default is index which was set before with |
BxDolTemplate::setPageDescription | ( | $sDescription | ) |
Set page description.
string | $sDescription | necessary page description. |
BxDolTemplate::setPageHeader | ( | $s | ) |
Set page header
string | $s | page header |
BxDolTemplate::setPageInjections | ( | $aInjections | ) |
Set page injections.
array | $aInjections | name => value injections. |
BxDolTemplate::setPageMainBoxTitle | ( | $sTitle | ) |
Set page's main box title.
string | $sTitle | necessary page's main box title. |
BxDolTemplate::setPageMetaRobots | ( | $s | ) |
Set page meta robots.
string | $s | page meta robots. |
BxDolTemplate::setPageMetaTitle | ( | $sTitle | ) |
Set page meta title.
string | sTitle necessary page description. |
BxDolTemplate::setPageNameIndex | ( | $i | ) |
Set page name index
int | $i | name index |
BxDolTemplate::setPageNameIndexByTarget | ( | $s | ) |
Set page name index by target.
string | $s | target. |
BxDolTemplate::setPageParams | ( | $a | ) |
Set page params. Available page params are: name_index, header
array | $a | page params |
BxDolTemplate::setPageTitle | ( | $sTitle | ) |
BxDolTemplate::setPageType | ( | $i | ) |
Set page type
int | $i | page type |
BxDolTemplate::setPageUrl | ( | $s | ) |
Set page url
string | $s | page url |
|
protected |
Cache related fields
|
protected |
Main fields