Cheetah
|
Public Member Functions | |
__construct ($sRootPath=CH_DIRECTORY_PATH_ROOT, $sRootUrl=CH_WSB_URL_ROOT) | |
loadTemplates () | |
init () | |
addLocation ($sKey, $sLocationPath, $sLocationUrl) | |
addDynamicLocation ($sLocationPath, $sLocationUrl) | |
removeLocation ($sKey) | |
addLocationJs ($sKey, $sLocationPath, $sLocationUrl) | |
addDynamicLocationJs ($sLocationPath, $sLocationUrl) | |
removeLocationJs ($sKey) | |
getCodeKey () | |
getCode () | |
getPageWidth () | |
setPageWidth ($sWidth) | |
setPageTitle ($sTitle) | |
setPageMainBoxTitle ($sTitle) | |
setPageDescription ($sDescription) | |
addJsOption ($mixedName) | |
addJsTranslation ($mixedKey) | |
addJsImage ($aImages) | |
addJsIcon ($aIcons) | |
addCssStyle ($sName, $sContent) | |
addPageKeywords ($mixedKeywords, $sDevider=',') | |
setOpenGraphInfo ($a, $sNamespace='og') | |
getMetaInfo () | |
getTemplate ($sName) | |
getIconUrl ($sName, $sCheckIn=CH_WSB_TEMPLATE_CHECK_IN_BOTH) | |
getIconPath ($sName, $sCheckIn=CH_WSB_TEMPLATE_CHECK_IN_BOTH) | |
getImageUrl ($sName, $sCheckIn=CH_WSB_TEMPLATE_CHECK_IN_BOTH) | |
getImagePath ($sName, $sCheckIn=CH_WSB_TEMPLATE_CHECK_IN_BOTH) | |
getCssUrl ($sName, $sCheckIn=CH_WSB_TEMPLATE_CHECK_IN_BOTH) | |
getCssPath ($sName, $sCheckIn=CH_WSB_TEMPLATE_CHECK_IN_BOTH) | |
getHtml ($sName, $sCheckIn=CH_WSB_TEMPLATE_CHECK_IN_BOTH) | |
parseHtmlByName ($sName, $aVariables, $mixedKeyWrapperHtml=null, $sCheckIn=CH_WSB_TEMPLATE_CHECK_IN_BOTH) | |
parseHtmlByContent ($sContent, $aVariables, $mixedKeyWrapperHtml=null) | |
parseHtmlByTemplateName ($sName, $aVariables, $mixedKeyWrapperHtml=null) | |
parsePageByName ($sName, $aVariables) | |
parseSystemKey ($sKey, $mixedKeyWrapperHtml=null) | |
getTemplatesCacheObject () | |
getCached ($sName, &$aVariables, $mixedKeyWrapperHtml=null, $sCheckIn=CH_WSB_TEMPLATE_CHECK_IN_BOTH, $bEvaluate=true) | |
addJs ($mixedFiles, $bDynamic=false) | |
addJsSystem ($mixedFiles) | |
deleteJs ($mixedFiles) | |
deleteJsSystem ($mixedFiles) | |
_compileJs ($sAbsolutePath, &$aIncluded) | |
_wrapInTagJs ($sFile) | |
_wrapInTagJsCode ($sCode) | |
addCss ($mixedFiles, $bDynamic=false) | |
addCssAsync ($mixedFiles) | |
includeCssAsync () | |
addCssSystem ($mixedFiles) | |
deleteCss ($mixedFiles) | |
deleteCssSystem ($mixedFiles) | |
_compileCss ($sAbsolutePath, &$aIncluded) | |
_minifyCss ($s) | |
_wrapInTagCss ($sFile) | |
_wrapInTagCssCode ($sCode) | |
includeCssStyles () | |
includeFiles ($sType, $bSystem=false) | |
_includeFiles ($sType, &$aFiles) | |
_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=CH_WSB_TEMPLATE_CHECK_IN_BOTH) | |
_getAbsoluteLocationJs ($sType, $sName) | |
_getAbsoluteLocationCss ($sType, $sName) | |
_getInlineData ($sType, $sName, $sCheckIn) | |
_getCacheFileName ($sType, $sAbsolutePath) | |
_getKeyWrappers ($mixedKeyWrapperHtml) | |
_processJsTranslations () | |
_processJsOptions () | |
_processJsImages () | |
_getLoaderUrl ($sType, $sName) | |
displayAccessDenied () | |
displayNoData () | |
displayErrorOccured () | |
displayPageNotFound () | |
displayMsg ($s, $bTranslate=false) | |
processInjection ($iPageIndex, $sKey, $sValue="") | |
addInjection ($sKey, $sType, $sData, $iReplace=0) | |
Static Public Member Functions | |
static | _callbackParseUrl ($sPath, $aMatches) |
Template engine.
An object of the class allows to:
Avalable constructions.
sys_injections
/sys_injections_admin
/ tables.Related classes: ChWsbTemplateAdmin - 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: global $oSysTemplate;
$oSysTemplate->addCss(array('test1.css', 'test2.css')); $oSysTemplate->addJs(array('test1.js', 'test2.js')); $oSysTemplate->parseHtmlByName('messageBox.html', array( 'id' => $iId, 'msgText' => $sText, 'ch_if:timer' => array( 'condition' => $iTimer > 0, 'content' => array( 'id' => $iId, 'time' => 1000 * $iTimer, 'on_close' => $sOnClose, ) ), 'ch_if:timer' => array( array( 'name' => $sName, 'title' => $sTitle ), array( 'name' => $sName, 'title' => $sTitle ) ) ));
Memberships/ACL: Doesn't depend on user's membership.
Alerts: no alerts available
Definition at line 120 of file ChWsbTemplate.php.
ChWsbTemplate::__construct | ( | $sRootPath = CH_DIRECTORY_PATH_ROOT , |
|
$sRootUrl = CH_WSB_URL_ROOT |
|||
) |
Constructor
Reimplemented in ChWsbOrcaForumsTemplate.
Definition at line 162 of file ChWsbTemplate.php.
|
static |
Private callback function for CSS compiler.
string | $sPath | CSS file absolute path. |
array | $aMatches | matched parts of image's URL. |
Definition at line 1276 of file ChWsbTemplate.php.
ChWsbTemplate::_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). |
Definition at line 1604 of file ChWsbTemplate.php.
ChWsbTemplate::_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. |
Definition at line 1198 of file ChWsbTemplate.php.
ChWsbTemplate::_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. |
Definition at line 1044 of file ChWsbTemplate.php.
ChWsbTemplate::_getAbsoluteLocation | ( | $sType, | |
$sFolder, | |||
$sName, | |||
$sCheckIn = CH_WSB_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) |
try to find from received path
Definition at line 1711 of file ChWsbTemplate.php.
ChWsbTemplate::_getAbsoluteLocationCss | ( | $sType, | |
$sName | |||
) |
Definition at line 1774 of file ChWsbTemplate.php.
ChWsbTemplate::_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. |
Definition at line 1761 of file ChWsbTemplate.php.
ChWsbTemplate::_getCacheFileName | ( | $sType, | |
$sAbsolutePath | |||
) |
Get file name where the template would be cached.
string | $sAbsolutePath | template's real path. |
Definition at line 1812 of file ChWsbTemplate.php.
ChWsbTemplate::_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) |
Definition at line 1786 of file ChWsbTemplate.php.
ChWsbTemplate::_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). |
Definition at line 1835 of file ChWsbTemplate.php.
ChWsbTemplate::_getLoaderUrl | ( | $sType, | |
$sName | |||
) |
Get Gzip loader URL.
$sType | content type CSS/JS |
$sName | file name. |
Definition at line 1901 of file ChWsbTemplate.php.
ChWsbTemplate::_includeFiles | ( | $sType, | |
& | $aFiles | ||
) |
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. |
Definition at line 1404 of file ChWsbTemplate.php.
ChWsbTemplate::_minifyCss | ( | $s | ) |
Minify CSS
string | $s | CSS string to minify |
Definition at line 1263 of file ChWsbTemplate.php.
ChWsbTemplate::_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). |
Definition at line 1496 of file ChWsbTemplate.php.
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. |
Definition at line 1422 of file ChWsbTemplate.php.
ChWsbTemplate::_processJsImages | ( | ) |
Process all added images and return them as a string.
Definition at line 1885 of file ChWsbTemplate.php.
ChWsbTemplate::_processJsOptions | ( | ) |
Process all added options and return them as a string.
Definition at line 1872 of file ChWsbTemplate.php.
ChWsbTemplate::_processJsTranslations | ( | ) |
Process all added language translations and return them as a string.
Definition at line 1852 of file ChWsbTemplate.php.
ChWsbTemplate::_wrapInTagCss | ( | $sFile | ) |
Wrap an URL to CSS file into CSS tag.
string | $sFile | - URL to CSS file. |
Definition at line 1296 of file ChWsbTemplate.php.
ChWsbTemplate::_wrapInTagCssCode | ( | $sCode | ) |
Wrap CSS code into CSS tag.
string | $sCode | - CSS code. |
Definition at line 1308 of file ChWsbTemplate.php.
ChWsbTemplate::_wrapInTagJs | ( | $sFile | ) |
Wrap an URL to JS file into JS tag.
string | $sFile | - URL to JS file. |
Definition at line 1092 of file ChWsbTemplate.php.
ChWsbTemplate::_wrapInTagJsCode | ( | $sCode | ) |
Wrap JS code into JS tag.
string | $sCode | - JS code. |
Definition at line 1102 of file ChWsbTemplate.php.
ChWsbTemplate::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. |
Definition at line 1114 of file ChWsbTemplate.php.
ChWsbTemplate::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. |
Definition at line 1123 of file ChWsbTemplate.php.
ChWsbTemplate::addCssStyle | ( | $sName, | |
$sContent | |||
) |
Add CSS style.
string | $sName | CSS class name. |
string | $sContent | CSS class styles. |
Definition at line 499 of file ChWsbTemplate.php.
ChWsbTemplate::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. |
Definition at line 1166 of file ChWsbTemplate.php.
ChWsbTemplate::addDynamicLocation | ( | $sLocationPath, | |
$sLocationUrl | |||
) |
Add dynamic location.
string | $sLocationPath | - location's path. For modules: '[path_to_cheetah]/modules/[vendor_name]/[module_name]/' |
string | $sLocationUrl | - location's url. For modules: '[url_to_cheetah]/modules/[vendor_name]/[module_name]/' |
Definition at line 304 of file ChWsbTemplate.php.
ChWsbTemplate::addDynamicLocationJs | ( | $sLocationPath, | |
$sLocationUrl | |||
) |
Add dynamic JS location.
string | $sLocationPath | - location's path. For modules: '[path_to_cheetah]/modules/[vendor_name]/[module_name]/' |
string | $sLocationUrl | - location's url. For modules: '[url_to_cheetah]/modules/[vendor_name]/[module_name]/' |
Definition at line 344 of file ChWsbTemplate.php.
ChWsbTemplate::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. |
Definition at line 2042 of file ChWsbTemplate.php.
ChWsbTemplate::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. |
Definition at line 999 of file ChWsbTemplate.php.
ChWsbTemplate::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. |
Definition at line 480 of file ChWsbTemplate.php.
ChWsbTemplate::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. |
Definition at line 461 of file ChWsbTemplate.php.
ChWsbTemplate::addJsOption | ( | $mixedName | ) |
Add Option in JS output.
mixed | $mixedName | option's name or an array of options' names. |
Definition at line 434 of file ChWsbTemplate.php.
ChWsbTemplate::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. |
Definition at line 1012 of file ChWsbTemplate.php.
ChWsbTemplate::addJsTranslation | ( | $mixedKey | ) |
Add language translation for key in JS output.
mixed | $mixedKey | language key or an array of keys. |
Definition at line 447 of file ChWsbTemplate.php.
ChWsbTemplate::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_cheetah]/modules/[vendor_name]/[module_name]/' |
string | $sLocationUrl | - location's url. For modules: '[url_to_cheetah]/modules/[vendor_name]/[module_name]/' |
Definition at line 290 of file ChWsbTemplate.php.
ChWsbTemplate::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_cheetah]/modules/[vendor_name]/[module_name]/js/' |
string | $sLocationUrl | - location's url. For modules: '[url_to_cheetah]/modules/[vendor_name]/[module_name]/js/' |
Definition at line 330 of file ChWsbTemplate.php.
ChWsbTemplate::addPageKeywords | ( | $mixedKeywords, | |
$sDevider = ',' |
|||
) |
Set page keywords.
mixed | $mixedKeywords | necessary page keywords(string - single keyword, array - an array of keywords). |
string | $sDevider | - string devider. |
Definition at line 509 of file ChWsbTemplate.php.
ChWsbTemplate::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. |
Definition at line 1176 of file ChWsbTemplate.php.
ChWsbTemplate::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. |
Definition at line 1187 of file ChWsbTemplate.php.
ChWsbTemplate::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. |
Definition at line 1022 of file ChWsbTemplate.php.
ChWsbTemplate::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. |
Definition at line 1033 of file ChWsbTemplate.php.
ChWsbTemplate::displayAccessDenied | ( | ) |
Static functions to display pages with errors, messages and so on.
Reimplemented in ChBlogsTemplate, ChAdsTemplate, and ChWsbTwigTemplate.
Definition at line 1911 of file ChWsbTemplate.php.
ChWsbTemplate::displayErrorOccured | ( | ) |
Reimplemented in ChWsbTwigTemplate.
Definition at line 1939 of file ChWsbTemplate.php.
ChWsbTemplate::displayMsg | ( | $s, | |
$bTranslate = false |
|||
) |
Reimplemented in ChWsbTwigTemplate.
Definition at line 1968 of file ChWsbTemplate.php.
ChWsbTemplate::displayNoData | ( | ) |
Reimplemented in ChWsbTwigTemplate.
Definition at line 1925 of file ChWsbTemplate.php.
ChWsbTemplate::displayPageNotFound | ( | ) |
Reimplemented in ChWsbTwigTemplate, and ChWsbMobileTemplate.
Definition at line 1953 of file ChWsbTemplate.php.
ChWsbTemplate::getCached | ( | $sName, | |
& | $aVariables, | ||
$mixedKeyWrapperHtml = null , |
|||
$sCheckIn = CH_WSB_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. |
Definition at line 932 of file ChWsbTemplate.php.
ChWsbTemplate::getCode | ( | ) |
Get currently active template code.
Definition at line 376 of file ChWsbTemplate.php.
ChWsbTemplate::getCodeKey | ( | ) |
ChWsbTemplate::getCssPath | ( | $sName, | |
$sCheckIn = CH_WSB_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) |
Definition at line 632 of file ChWsbTemplate.php.
ChWsbTemplate::getCssUrl | ( | $sName, | |
$sCheckIn = CH_WSB_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) |
Definition at line 621 of file ChWsbTemplate.php.
ChWsbTemplate::getHtml | ( | $sName, | |
$sCheckIn = CH_WSB_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) |
Definition at line 643 of file ChWsbTemplate.php.
ChWsbTemplate::getIconPath | ( | $sName, | |
$sCheckIn = CH_WSB_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) |
Definition at line 584 of file ChWsbTemplate.php.
ChWsbTemplate::getIconUrl | ( | $sName, | |
$sCheckIn = CH_WSB_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) |
Definition at line 569 of file ChWsbTemplate.php.
ChWsbTemplate::getImagePath | ( | $sName, | |
$sCheckIn = CH_WSB_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) |
Definition at line 610 of file ChWsbTemplate.php.
ChWsbTemplate::getImageUrl | ( | $sName, | |
$sCheckIn = CH_WSB_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) |
Definition at line 595 of file ChWsbTemplate.php.
ChWsbTemplate::getMetaInfo | ( | ) |
Returns page meta info, like meta keyword, meta description, location, etc
Definition at line 534 of file ChWsbTemplate.php.
ChWsbTemplate::getPageWidth | ( | ) |
ChWsbTemplate::getTemplate | ( | $sName | ) |
Get template, which was loaded earlier.
string | $sName | - template name. |
Definition at line 558 of file ChWsbTemplate.php.
ChWsbTemplate::getTemplatesCacheObject | ( | ) |
Get cache object for templates
Definition at line 914 of file ChWsbTemplate.php.
ChWsbTemplate::includeCssAsync | ( | ) |
Return script tag with special code to load async css. This tag is added after js files list
Definition at line 1138 of file ChWsbTemplate.php.
ChWsbTemplate::includeCssStyles | ( | ) |
Definition at line 1315 of file ChWsbTemplate.php.
ChWsbTemplate::includeFiles | ( | $sType, | |
$bSystem = false |
|||
) |
Include CSS/JS file(s) attached to the page in its head section.
string | $sType | the type of file('js' or 'css') |
Definition at line 1339 of file ChWsbTemplate.php.
ChWsbTemplate::init | ( | ) |
Initialize template engine. Note. The method is executed with the system, you shouldn't execute it in your subclasses.
Definition at line 249 of file ChWsbTemplate.php.
ChWsbTemplate::loadTemplates | ( | ) |
Load templates.
Reimplemented in ChQuotesTemplate, ChPmtTemplate, ChCRSSTemplate, ChBlogsTemplate, and ChAdsTemplate.
Definition at line 238 of file ChWsbTemplate.php.
ChWsbTemplate::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). |
Definition at line 687 of file ChWsbTemplate.php.
ChWsbTemplate::parseHtmlByName | ( | $sName, | |
$aVariables, | |||
$mixedKeyWrapperHtml = null , |
|||
$sCheckIn = CH_WSB_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) |
Reimplemented in ChQuotesTemplate, and ChWsbTwigTemplate.
Definition at line 660 of file ChWsbTemplate.php.
ChWsbTemplate::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. |
Reimplemented in ChCRSSTemplate, ChBlogsTemplate, and ChAdsTemplate.
Definition at line 704 of file ChWsbTemplate.php.
ChWsbTemplate::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. |
Definition at line 720 of file ChWsbTemplate.php.
ChWsbTemplate::parseSystemKey | ( | $sKey, | |
$mixedKeyWrapperHtml = null |
|||
) |
Parse system keys.
string | $sKey | key |
Reimplemented in ChWsbTemplateAdmin.
Definition at line 760 of file ChWsbTemplate.php.
ChWsbTemplate::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. |
Definition at line 1994 of file ChWsbTemplate.php.
ChWsbTemplate::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. |
Definition at line 317 of file ChWsbTemplate.php.
ChWsbTemplate::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. |
Definition at line 357 of file ChWsbTemplate.php.
ChWsbTemplate::setOpenGraphInfo | ( | $a, | |
$sNamespace = 'og' |
|||
) |
Set page meta Open Graph info.
array | $a | open graph info, such as type, image, title, site_name |
string | $sNamespace | namespace, by default 'og' |
Definition at line 527 of file ChWsbTemplate.php.
ChWsbTemplate::setPageDescription | ( | $sDescription | ) |
Set page description.
string | $sDescription | necessary page description. |
Definition at line 425 of file ChWsbTemplate.php.
ChWsbTemplate::setPageMainBoxTitle | ( | $sTitle | ) |
Set page's main box title.
string | $sTitle | necessary page's main box title. |
Definition at line 416 of file ChWsbTemplate.php.
ChWsbTemplate::setPageTitle | ( | $sTitle | ) |
Set page title.
string | $sTitle | necessary page title. |
Definition at line 407 of file ChWsbTemplate.php.
ChWsbTemplate::setPageWidth | ( | $sWidth | ) |
Set page width.
string | $sWidth | necessary page width. |
Definition at line 394 of file ChWsbTemplate.php.
ChWsbTemplate::$_aLocations |
Definition at line 139 of file ChWsbTemplate.php.
ChWsbTemplate::$_aLocationsJs |
Definition at line 140 of file ChWsbTemplate.php.
ChWsbTemplate::$_aTemplates |
Definition at line 137 of file ChWsbTemplate.php.
ChWsbTemplate::$_bCacheEnable |
Cache related fields
Definition at line 145 of file ChWsbTemplate.php.
ChWsbTemplate::$_bCssArchive |
Definition at line 153 of file ChWsbTemplate.php.
ChWsbTemplate::$_bCssCache |
Definition at line 152 of file ChWsbTemplate.php.
ChWsbTemplate::$_bImagesInline |
Definition at line 150 of file ChWsbTemplate.php.
ChWsbTemplate::$_bJsArchive |
Definition at line 156 of file ChWsbTemplate.php.
ChWsbTemplate::$_bJsCache |
Definition at line 155 of file ChWsbTemplate.php.
ChWsbTemplate::$_iImagesMaxSize |
Definition at line 151 of file ChWsbTemplate.php.
ChWsbTemplate::$_sCacheFilePrefix |
Definition at line 149 of file ChWsbTemplate.php.
ChWsbTemplate::$_sCacheFolderUrl |
Definition at line 146 of file ChWsbTemplate.php.
ChWsbTemplate::$_sCachePublicFolderPath |
Definition at line 148 of file ChWsbTemplate.php.
ChWsbTemplate::$_sCachePublicFolderUrl |
Definition at line 147 of file ChWsbTemplate.php.
ChWsbTemplate::$_sCode |
Definition at line 130 of file ChWsbTemplate.php.
ChWsbTemplate::$_sCodeKey |
Definition at line 131 of file ChWsbTemplate.php.
ChWsbTemplate::$_sCssCachePrefix |
Definition at line 154 of file ChWsbTemplate.php.
ChWsbTemplate::$_sFolderCss |
Definition at line 134 of file ChWsbTemplate.php.
ChWsbTemplate::$_sFolderHtml |
Definition at line 133 of file ChWsbTemplate.php.
ChWsbTemplate::$_sFolderIcons |
Definition at line 136 of file ChWsbTemplate.php.
ChWsbTemplate::$_sFolderImages |
Definition at line 135 of file ChWsbTemplate.php.
ChWsbTemplate::$_sInjectionsCache |
Definition at line 129 of file ChWsbTemplate.php.
ChWsbTemplate::$_sInjectionsTable |
Definition at line 128 of file ChWsbTemplate.php.
ChWsbTemplate::$_sJsCachePrefix |
Definition at line 157 of file ChWsbTemplate.php.
ChWsbTemplate::$_sKeyWrapperHtml |
Definition at line 132 of file ChWsbTemplate.php.
ChWsbTemplate::$_sPrefix |
Main fields
Definition at line 125 of file ChWsbTemplate.php.
ChWsbTemplate::$_sRootPath |
Definition at line 126 of file ChWsbTemplate.php.
ChWsbTemplate::$_sRootUrl |
Definition at line 127 of file ChWsbTemplate.php.