XOOPS
2.6.0
|
Public Member Functions | |
addBaseAssets ($type, $assets) | |
addBaseScriptAssets ($assets) | |
addBaseStylesheetAssets ($assets) | |
addHttpMeta ($name, $value=null) | |
addLink ($rel, $href= '', $attributes=array()) | |
addMeta ($type= 'meta', $name= '', $value= '') | |
addScript ($src= '', $attributes=array(), $content= '') | |
addScriptAssets ($assets, $filters= 'default', $target=null) | |
addStylesheet ($src= '', $attributes=array(), $content= '') | |
addStylesheetAssets ($assets, $filters= 'default', $target=null) | |
checkCache () | |
genElementId ($tagName= 'xos') | |
generateCacheId ($cache_id, $extraString= '') | |
getLocalizationAssets ($type="main") | |
headContent ($params, $content, &$smarty, &$repeat) | |
render ($canvasTpl=null, $pageTpl=null, $contentTpl=null, $vars=array()) | |
renderAttributes ($coll) | |
renderMetas ($return=false) | |
renderMetasByType ($type) | |
resourcePath ($path) | |
setNamedAsset ($name, $assets, $filters=null) | |
xoInit () | |
Public Attributes | |
$assets = null | |
$baseAssets | |
$bufferOutput = true | |
$canvasTemplate = 'theme.html' | |
$content = '' | |
$contentCacheId = null | |
$contentCacheLifetime = 0 | |
$contentTemplate = '' | |
$folderName = '' | |
$headersCacheEngine = 'default' | |
$htmlHeadStrings = array() | |
$metas | |
$path = '' | |
$plugins = array('XoopsThemeBlocksPlugin') | |
$renderBanner = true | |
$renderCount = 0 | |
$template = false | |
$templateVars = array() | |
$themesPath = 'themes' | |
$url = '' | |
$use_extra_cache_id = true | |
XoopsTheme::addBaseAssets | ( | $type, | |
$assets | |||
) |
addBaseAssets - add a list of assets to the page, these will all be combined into a single asset file at render time
string | $type | type of asset, i.e. 'css' or 'js' |
array | $assets | list of source files to process |
Definition at line 740 of file theme.php.
References $assets, and $type.
Referenced by addBaseScriptAssets(), and addBaseStylesheetAssets().
XoopsTheme::addBaseScriptAssets | ( | $assets | ) |
addBaseScriptAssets - add a list of scripts to the page
array | $assets | list of source files to process |
Definition at line 756 of file theme.php.
References $assets, and addBaseAssets().
Referenced by xoInit().
XoopsTheme::addBaseStylesheetAssets | ( | $assets | ) |
addBaseStylesheetAssets - add a list of stylesheets to the page
array | $assets | list of source files to process |
Definition at line 768 of file theme.php.
References $assets, and addBaseAssets().
Referenced by xoInit().
XoopsTheme::addHttpMeta | ( | $name, | |
$value = null |
|||
) |
XoopsTheme::addLink | ( | $rel, | |
$href = '' , |
|||
$attributes = array() |
|||
) |
Add a <link> to the header
string | $rel | Relationship from the current doc to the anchored one |
string | $href | URI of the anchored document |
array | $attributes | Additional attributes to add to the <link> element |
Definition at line 807 of file theme.php.
References addMeta().
XoopsTheme::addMeta | ( | $type = 'meta' , |
|
$name = '' , |
|||
$value = '' |
|||
) |
Change output page meta-information
string | $type | |
string | $name | |
string | $value |
Definition at line 845 of file theme.php.
Referenced by addHttpMeta(), addLink(), addScript(), addStylesheet(), and xoInit().
XoopsTheme::addScript | ( | $src = '' , |
|
$attributes = array() , |
|||
$content = '' |
|||
) |
Load theme specific language constants
string | $type | language type, like 'main', 'admin'; Needs to be declared in theme xo-info.php |
string | $language | specific language |
// Add an external script using a physical path $theme->addScript( 'www/script.js', null, '' ); $theme->addScript( 'modules/newbb/script.js', null, '' ); // Specify attributes for the <script> tag $theme->addScript( 'mod_xoops_SiteManager::common.js', array( 'type' => 'application/x-javascript' ), '' ); // Insert a code snippet $theme->addScript( null, array( 'type' => 'application/x-javascript' ), 'window.open("Hello world");' );
string | $src | path to an external script file |
array | $attributes | hash of attributes to add to the <script> tag |
string | $content | Code snippet to output within the <script> tag |
Definition at line 654 of file theme.php.
References $content, $xoops, addMeta(), Xoops\getInstance(), and resourcePath().
Referenced by addScriptAssets().
XoopsTheme::addScriptAssets | ( | $assets, | |
$filters = 'default' , |
|||
$target = null |
|||
) |
addScriptAssets - add a list of scripts to the page
array | $assets | list of source files to process |
string | $filters | comma separated list of filters |
string | $target | target path, will default to assets directory |
Definition at line 710 of file theme.php.
References $assets, $target, $url, and addScript().
XoopsTheme::addStylesheet | ( | $src = '' , |
|
$attributes = array() , |
|||
$content = '' |
|||
) |
Add StyleSheet or CSS code to the document head
string | null | $src | path to .css file |
array | null | $attributes | name => value paired array of attributes such as title |
string | $content | CSS code to output between the <style> tags (in case $src is empty) |
Definition at line 682 of file theme.php.
References $content, $xoops, addMeta(), Xoops\getInstance(), and resourcePath().
Referenced by addStylesheetAssets().
XoopsTheme::addStylesheetAssets | ( | $assets, | |
$filters = 'default' , |
|||
$target = null |
|||
) |
addStylesheetAssets - add a list of stylesheets to the page
string[] | $assets list of source files to process | |
string | $filters | comma separated list of filters |
string | $target | target path, will default to assets directory |
Definition at line 725 of file theme.php.
References $assets, $target, $url, and addStylesheet().
XoopsTheme::checkCache | ( | ) |
Definition at line 459 of file theme.php.
References $_SERVER, $contentCacheLifetime, $template, $uri, generateCacheId(), XoopsBaseConfig\get(), Xoops\getInstance(), and render().
XoopsTheme::genElementId | ( | $tagName = 'xos' | ) |
XoopsTheme::generateCacheId | ( | $cache_id, | |
$extraString = '' |
|||
) |
Generate cache id based on extra information of language and user groups User groups other than anonymous should be detected to avoid disclosing group sensitive contents
string | $cache_id | raw cache id |
string | $extraString | extra string |
Definition at line 425 of file theme.php.
References $groups, $xoops, XoopsBaseConfig\get(), and Xoops\getInstance().
Referenced by checkCache().
XoopsTheme::getLocalizationAssets | ( | $type = "main" | ) |
Load localization information Folder structure for localization: themes/themefolder/english
string | $type | language domain (unused?) |
Definition at line 579 of file theme.php.
References $language, $xoops, XoopsLoad\fileExists(), Xoops\getInstance(), Xoops_Locale_Abstract\getLocale(), and Xoops_Locale\loadThemeLocale().
Referenced by xoInit().
XoopsTheme::headContent | ( | $params, | |
$content, | |||
& | $smarty, | ||
& | $repeat | ||
) |
XoopsTheme::render | ( | $canvasTpl = null , |
|
$pageTpl = null , |
|||
$contentTpl = null , |
|||
$vars = array() |
|||
) |
Render the page The theme engine builds pages from 2 templates: canvas and content. A module can call this method directly and specify what templates the theme engine must use. If render() hasn't been called before, the theme defaults will be used for the canvas and page template (and xoopsOption['template_main'] for the content).
string | $canvasTpl | The canvas template, if different from the theme default |
string | $pageTpl | The page template, if different from the theme default (unsupported, 2.3+ only) |
string | $contentTpl | The content template |
array | $vars | Template variables to send to the template engine |
Definition at line 494 of file theme.php.
References $content, $header, $name, $type, $xoops, Xoops\getInstance(), and renderMetas().
Referenced by checkCache().
XoopsTheme::renderAttributes | ( | $coll | ) |
Transform an attributes collection to an XML string
array | $coll |
Definition at line 991 of file theme.php.
References $name.
Referenced by renderMetasByType().
XoopsTheme::renderMetas | ( | $return = false | ) |
XoopsTheme::renderMetasByType | ( | $type | ) |
XoopsTheme::renderMetasByType() render the specified metadata type
string | $type | type to render |
Definition at line 919 of file theme.php.
References $content, $name, $type, and renderAttributes().
Referenced by renderMetas().
XoopsTheme::resourcePath | ( | $path | ) |
Return a themable file resource path
string | $path |
Definition at line 1009 of file theme.php.
References $path, $xoops_root_path, XoopsLoad\fileExists(), and XoopsBaseConfig\get().
Referenced by addScript(), addStylesheet(), and Xoops_Locale\loadThemeLocale().
XoopsTheme::setNamedAsset | ( | $name, | |
$assets, | |||
$filters = null |
|||
) |
setNamedAsset - Add an asset reference to the asset manager. The specifed assest will be added to the asset manager with the specified name. As an example:
$theme->setNamedAsset('aacss','module/aa/assets/css/*.css');
This will create an asset reference which can be added using other asset functions, such as:
$theme->addBaseStylesheetAssets('');
Additional custom filters can be specified for the named assest if needed.
string | $name | the name of the reference to be added |
mixed | $assets | a string asset path, or an array of asset paths, may include wildcard |
string | $filters | comma separated list of filters |
XoopsTheme::xoInit | ( | ) |
*#@- *#@+ 10 Initialization Initializes this theme Upon initialization, the theme creates its template engine and instanciates the plug-ins from the specified $plugins list. If the theme is a 2.0 theme, that does not display redirection messages, the HTTP redirections system is disabled to ensure users will see the redirection screen.
Definition at line 304 of file theme.php.
References $_SERVER, $avatar, $folderName, $GLOBALS, $metas, $name, $response, $xoops, addBaseScriptAssets(), addBaseStylesheetAssets(), addMeta(), XoopsLoad\fileExists(), XoopsBaseConfig\get(), Xoops\getInstance(), and getLocalizationAssets().
XoopsTheme::$assets = null |
Definition at line 245 of file theme.php.
Referenced by addBaseAssets(), addBaseScriptAssets(), addBaseStylesheetAssets(), addScriptAssets(), addStylesheetAssets(), and setNamedAsset().
XoopsTheme::$baseAssets |
XoopsTheme::$content = '' |
Definition at line 209 of file theme.php.
Referenced by addScript(), addStylesheet(), headContent(), render(), and renderMetasByType().
XoopsTheme::$contentCacheLifetime = 0 |
Definition at line 197 of file theme.php.
Referenced by checkCache().
XoopsTheme::$metas |
XoopsTheme::$path = '' |
Definition at line 159 of file theme.php.
Referenced by resourcePath().
XoopsTheme::$plugins = array('XoopsThemeBlocksPlugin') |
XoopsTheme::$template = false |
Definition at line 229 of file theme.php.
Referenced by checkCache().
XoopsTheme::$url = '' |
Definition at line 164 of file theme.php.
Referenced by addScriptAssets(), addStylesheetAssets(), and renderMetas().