icms_view_theme_Object
Notice: Wiki was automatic generated from project sources as project API documentation. Do not edit manually!
Builds the theme components
- Class name: icms_view_theme_Object
- Namespace:
public mixed $folderName
The name of this theme
- Visibility: public
public mixed $path
Physical path of this theme folder
- Visibility: public
public mixed $url
- Visibility: public
public mixed $bufferOutput = \true
Whether or not the theme engine should include the output generated by php
- Visibility: public
public mixed $canvasTemplate = theme.html
Canvas-level template to use
- Visibility: public
public mixed $contentTemplate
Content-level template to use
- Visibility: public
public mixed $contentCacheLifetime
- Visibility: public
public mixed $contentCacheId = \null
- Visibility: public
public mixed $content
Text content to display right after the contentTemplate output
- Visibility: public
public mixed $plugins = array(icms_view_PageBuilder)
Page construction plug-ins to use
- Visibility: public
public mixed $renderCount
- Visibility: public
public \icms_view_Tpl $template = \false
Pointer to the theme template engine
- Visibility: public
public mixed $metas = array(head => array(), module => array(), foot => array())
Array containing the document meta-information
- Visibility: public
public mixed $types = array(http, meta, link, stylesheet, script)
Array of meta types - their order in the array determines their rendering sequence
- Visibility: public
public mixed $htmlHeadStrings = array()
Array of strings to be inserted in the head tag of HTML documents
- Visibility: public
public mixed $templateVars = array()
Custom publiciables that will always be assigned to the template
- Visibility: public
public mixed $use_extra_cache_id = \true
User extra information for cache id, like language, user groups
- Visibility: public
bool icms_view_theme_Object::xoInit(array options)
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.
- Visibility: public
- options array
string icms_view_theme_Object::generateCacheId(string cache_id, string 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
- Visibility: public
- cache_id string - <p>raw cache id</p>
- extraString string - <p>extra string</p>
bool icms_view_theme_Object::checkCache()
Checks cache for a changed version of the template and renders template
- Visibility: public
mixed icms_view_theme_Object::render(string canvasTpl, string pageTpl, string contentTpl, array vars)
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).
- Visibility: public
- canvasTpl string - <p>The canvas template, if different from the theme default</p>
- pageTpl string - <p>The page template, if different from the theme default (unsupported, 2.3+ only)</p>
- contentTpl string - <p>The content template</p>
- vars array - <p>Template variables to send to the template engine</p>
void icms_view_theme_Object::addScript(string src, array attributes, string content, \str zone, int weight)
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'), '');
// Insert a code snippet
$theme->addScript(NULL, array('type' => 'application/x-javascript'), 'window.open("Hello world");');
- Visibility: public
- src string - <p>path to an external script file</p>
- attributes array - <p>hash of attributes to add to the <script> tag</p>
- content string - <p>Code snippet to output within the <script> tag</p>
- zone str - <p>Area of the HTML page to place the script</p>
- weight int - <p>Sort factor - lower weights are loaded first</p>
void icms_view_theme_Object::addStylesheet(string src, array attributes, string content, \str zone, int weight)
Add StyleSheet or CSS code to the document head
- Visibility: public
- src string - <p>path to .css file</p>
- attributes array - <p>name => value paired array of attributes such as title</p>
- content string - <p>CSS code to output between the <style> tags (in case $src is empty)</p>
- zone str - <p>Area of the HTML page to place the stylesheet</p>
- weight int - <p>Sort factor - lower weights are loaded first</p>
mixed icms_view_theme_Object::addLink(string rel, string href, array attributes, \str zone, int weight)
Add a to the header
- Visibility: public
- rel string - <p>Relationship from the current doc to the anchored one</p>
- href string - <p>URI of the anchored document</p>
- attributes array - <p>Additional attributes to add to the <link> element</p>
- zone str - <p>Area of the HTML page to place the link</p>
- weight int - <p>Sort factor - lower weights are loaded first</p>
mixed icms_view_theme_Object::addHttpMeta(mixed name, mixed value, \str zone, int weight)
Set a meta http-equiv value
- Visibility: public
- name mixed
- value mixed
- zone str - <p>Area of the HTML page to place the http meta</p>
- weight int - <p>Sort factor - lower weights are loaded first</p>
mixed icms_view_theme_Object::addMeta(\str type, \str name, \str value, \str zone, int weight)
Change output page meta-information
- Visibility: public
- type str - <p>Type of meta tag: script, link, stylesheet, http</p>
- name str - <p>Name</p>
- value str
- zone str - <p>Area of the HTML page to place the meta</p>
- weight int - <p>Sort factor - lower weights are loaded first</p>
mixed icms_view_theme_Object::headContent(string params, string content, mixed smarty, mixed repeat)
Puts $content into the htmlheadstrings array
- Visibility: public
- params string
- content string - <p>content to put in the htmlheadstrings array</p>
- smarty mixed
- repeat mixed
bool icms_view_theme_Object::renderMetas(string type, string return, mixed zone)
Render the meta content in the metas array (carefull Recursive!)
- Visibility: public
- type string - <p>what type of metacontent is it</p>
- return string - <p>will we return to the calling function (just default setting)</p>
- zone mixed
\str icms_view_theme_Object::renderOldMetas(\str type, bool return)
Legacy method to render all the zones as a single zone
- Visibility: public
- type str
- return bool
string icms_view_theme_Object::genElementId(string tagName)
Generates a unique element ID
- Visibility: public
- tagName string
string icms_view_theme_Object::renderAttributes(array coll)
Transform an attributes collection to an XML string
- Visibility: public
- coll array
string icms_view_theme_Object::resourcePath(string path)
Return a themable file resource path
- Visibility: public
- path string