XOOPS 2.5.6
Final
|
Public Member Functions | |
addHttpMeta ($name, $value=null) | |
addLanguage ($type="main", $language=null) | |
addLink ($rel, $href= '', $attributes=array(), $name= '') | |
addMeta ($type= 'meta', $name= '', $value= '') | |
addScript ($src= '', $attributes=array(), $content= '', $name= '') | |
addStylesheet ($src= '', $attributes=array(), $content= '', $name= '') | |
checkCache () | |
genElementId ($tagName= 'xos') | |
generateCacheId ($cache_id, $extraString= '') | |
headContent ($params, $content, &$smarty, &$repeat) | |
loadLocalization ($type="main") | |
render ($canvasTpl=null, $pageTpl=null, $contentTpl=null, $vars=array()) | |
renderAttributes ($coll) | |
renderMetas ($type=null, $return=false) | |
resourcePath ($path) | |
xoInit ($options=array()) | |
Public Attributes | |
$bufferOutput = true | |
$canvasTemplate = 'theme.html' | |
$content = '' | |
$contentCacheId = null | |
$contentCacheLifetime = 0 | |
$contentTemplate = '' | |
$folderName = '' | |
$htmlHeadStrings = array() | |
$metas | |
$path = '' | |
$plugins | |
$renderBanner = true | |
$renderCount = 0 | |
$template = false | |
$templateVars = array() | |
$themesPath = 'themes' | |
$url = '' | |
$use_extra_cache_id = true | |
xos_opal_Theme::addHttpMeta | ( | $name, | |
$value = null |
|||
) |
xos_opal_Theme::addLanguage | ( | $type = "main" , |
|
$language = null |
|||
) |
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 |
Definition at line 521 of file theme.php.
References $GLOBALS, $language, $ret, and resourcePath().
Referenced by loadLocalization().
xos_opal_Theme::addLink | ( | $rel, | |
$href = '' , |
|||
$attributes = array() , |
|||
$name = '' |
|||
) |
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 |
string | $name | Element Name in array links are stored in. |
Definition at line 625 of file theme.php.
References addMeta().
xos_opal_Theme::addMeta | ( | $type = 'meta' , |
|
$name = '' , |
|||
$value = '' |
|||
) |
Change output page meta-information
Definition at line 655 of file theme.php.
References $type.
Referenced by addHttpMeta(), addLink(), addScript(), addStylesheet(), and xoInit().
xos_opal_Theme::addScript | ( | $src = '' , |
|
$attributes = array() , |
|||
$content = '' , |
|||
$name = '' |
|||
) |
*#@+
20 Manipulating page meta-information Adds script code to the document head
This methods allows the insertion of an external script file (if $src is provided), or of a script snippet. The file URI is parsed to take benefit of the theme resource overloading system.
The $attributes parameter allows you to specify the attributes that will be added to the inserted <script> tag. If unspecified, the type attribute value will default to 'text/javascript'.
// 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' ), '', 'mod_xoops_Sitemanager' ); // Insert a code snippet $theme->addScript( null, array( 'type' => 'application/x-javascript' ), 'window.open("Hello world");', 'hello' );
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 |
string | $name | Element Name in array scripts are stored in. |
Definition at line 565 of file theme.php.
References $content, $GLOBALS, addMeta(), and resourcePath().
Referenced by loadLocalization(), and xoInit().
xos_opal_Theme::addStylesheet | ( | $src = '' , |
|
$attributes = array() , |
|||
$content = '' , |
|||
$name = '' |
|||
) |
Add StyleSheet or CSS code to the document head
string | $src | path to .css file |
array | $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) |
string | $name | Element Name in array stylesheets are stored in. |
Definition at line 596 of file theme.php.
References $content, $GLOBALS, addMeta(), and resourcePath().
Referenced by loadLocalization().
xos_opal_Theme::checkCache | ( | ) |
Definition at line 369 of file theme.php.
References $_SERVER, $contentCacheLifetime, $template, $xoopsLogger, generateCacheId(), XoopsLogger\getInstance(), and render().
xos_opal_Theme::genElementId | ( | $tagName = 'xos' | ) |
xos_opal_Theme::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 336 of file theme.php.
References $GLOBALS, $groups, XOOPS_DB_NAME, XOOPS_DB_PASS, and XOOPS_DB_USER.
Referenced by checkCache().
xos_opal_Theme::headContent | ( | $params, | |
$content, | |||
& | $smarty, | ||
& | $repeat | ||
) |
xos_opal_Theme::loadLocalization | ( | $type = "main" | ) |
Load localization information
Folder structure for localization:
main.php - language definitions style.css - localization stylesheet script.js - localization script
Definition at line 497 of file theme.php.
References $GLOBALS, $language, $type, addLanguage(), addScript(), addStylesheet(), and xoops_getConfigOption().
Referenced by xoInit().
xos_opal_Theme::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 405 of file theme.php.
References $content, $GLOBALS, $htmlHeadStrings, $metas, $type, $vars, $xoopsLogger, XoopsCache\getInstance(), XoopsLogger\getInstance(), renderMetas(), and xoops_load().
Referenced by checkCache().
xos_opal_Theme::renderAttributes | ( | $coll | ) |
Transform an attributes collection to an XML string
array | $coll |
Definition at line 766 of file theme.php.
Referenced by renderMetas().
xos_opal_Theme::renderMetas | ( | $type = null , |
|
$return = false |
|||
) |
xos_opal_Theme::resourcePath | ( | $path | ) |
Return a themable file resource path
string | $path |
Definition at line 783 of file theme.php.
References $path.
Referenced by addLanguage(), addScript(), and addStylesheet().
xos_opal_Theme::xoInit | ( | $options = array() | ) |
*#@- *#@+
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.
array | $options |
Definition at line 255 of file theme.php.
References $_SERVER, $config, $config_handler, $criteria, $folderName, $GLOBALS, $i, $template, addMeta(), addScript(), loadLocalization(), XOOPS_CONF_METAFOOTER, xoops_getbanner(), xoops_getcss(), xoops_gethandler(), XOOPS_THEME_PATH, XOOPS_THEME_URL, and XOOPS_UPLOAD_URL.
xos_opal_Theme::$content = '' |
Definition at line 185 of file theme.php.
Referenced by addScript(), addStylesheet(), headContent(), render(), and renderMetas().
xos_opal_Theme::$contentCacheLifetime = 0 |
Definition at line 177 of file theme.php.
Referenced by checkCache().
xos_opal_Theme::$htmlHeadStrings = array() |
xos_opal_Theme::$metas |
xos_opal_Theme::$path = '' |
Definition at line 147 of file theme.php.
Referenced by resourcePath().
xos_opal_Theme::$plugins |
xos_opal_Theme::$template = false |
Definition at line 200 of file theme.php.
Referenced by checkCache(), and xoInit().