Class xos_opal_Theme
Methods summary
public
boolean
|
#
xoInit( array $options = array() )
Initializes this theme
Upon initialization, the theme creates its template engine and instantiates the
plug-ins from the specified xos_opal_Theme::$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.
Parameters
Returns
boolean
|
public
string
|
#
generateCacheId( string $cache_id, string $extraString = '' )
Generate cache id based on extra information of language and user groups
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
Parameters
- $cache_id
- raw cache id
- $extraString
- extra string
Returns
string complete cache id
|
public
boolean
|
#
checkCache( )
xos_opal_Theme::checkCache()
xos_opal_Theme::checkCache()
Returns
boolean
|
public
boolean
|
#
render( string $canvasTpl = null, string $pageTpl = null, string $contentTpl = null, array $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).
Parameters
- $canvasTpl
- The canvas template, if different from the theme default
- $pageTpl
- The page template, if different from the theme default (unsupported, 2.3+ only)
- $contentTpl
- The content template
- $vars
- Template variables to send to the template engine
Returns
boolean
|
public
boolean
|
#
loadLocalization( string $type = 'main' )
Load localization information
Load localization information
Folder structure for localization:
themes/themefolder/english - main.php - language definitions
- style.css - localization stylesheet
- script.js - localization script
Parameters
Returns
boolean
|
public
boolean|mixed
|
#
addLanguage( string $type = 'main', string $language = null )
Load theme specific language constants
Load theme specific language constants
Parameters
- $type
- language type, like 'main', 'admin'; Needs to be declared in theme xo-info.php
- $language
- specific language
Returns
boolean|mixed
|
public
|
#
addScript( string $src = '', array $attributes = array(), string $content = '', string $name = '' )
Adds script code to the document head
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
|