XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
xos_opal_Theme Class Reference

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
 

Detailed Description

Definition at line 128 of file theme.php.

Member Function Documentation

xos_opal_Theme::addHttpMeta (   $name,
  $value = null 
)

Set a meta http-equiv value

Definition at line 644 of file theme.php.

References addMeta().

Here is the call graph for this function:

xos_opal_Theme::addLanguage (   $type = "main",
  $language = null 
)

Load theme specific language constants

Parameters
string$typelanguage type, like 'main', 'admin'; Needs to be declared in theme xo-info.php
string$languagespecific language

Definition at line 521 of file theme.php.

References $GLOBALS, $language, $ret, and resourcePath().

Referenced by loadLocalization().

Here is the call graph for this function:

Here is the caller graph for this function:

xos_opal_Theme::addLink (   $rel,
  $href = '',
  $attributes = array(),
  $name = '' 
)

Add a <link> to the header

Parameters
string$relRelationship from the current doc to the anchored one
string$hrefURI of the anchored document
array$attributesAdditional attributes to add to the <link> element
string$nameElement Name in array links are stored in.

Definition at line 625 of file theme.php.

References addMeta().

Here is the call graph for this function:

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().

Here is the caller graph for this function:

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' );

Parameters
string$srcpath to an external script file
array$attributeshash of attributes to add to the <script> tag
string$contentCode snippet to output within the <script> tag
string$nameElement Name in array scripts are stored in.
Returns
void

Definition at line 565 of file theme.php.

References $content, $GLOBALS, addMeta(), and resourcePath().

Referenced by loadLocalization(), and xoInit().

Here is the call graph for this function:

Here is the caller graph for this function:

xos_opal_Theme::addStylesheet (   $src = '',
  $attributes = array(),
  $content = '',
  $name = '' 
)

Add StyleSheet or CSS code to the document head

Parameters
string$srcpath to .css file
array$attributesname => value paired array of attributes such as title
string$contentCSS code to output between the <style> tags (in case $src is empty)
string$nameElement Name in array stylesheets are stored in.
Returns
void

Definition at line 596 of file theme.php.

References $content, $GLOBALS, addMeta(), and resourcePath().

Referenced by loadLocalization().

Here is the call graph for this function:

Here is the caller graph for this function:

xos_opal_Theme::checkCache ( )

xos_opal_Theme::checkCache()

Returns

Definition at line 369 of file theme.php.

References $_SERVER, $contentCacheLifetime, $template, $xoopsLogger, generateCacheId(), XoopsLogger\getInstance(), and render().

Here is the call graph for this function:

xos_opal_Theme::genElementId (   $tagName = 'xos')

Generates a unique element ID

Parameters
string$tagName
Returns
string

Definition at line 751 of file theme.php.

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

Parameters
string$cache_idraw cache id
string$extraStringextra string
Returns
string complete cache id

Definition at line 336 of file theme.php.

References $GLOBALS, $groups, XOOPS_DB_NAME, XOOPS_DB_PASS, and XOOPS_DB_USER.

Referenced by checkCache().

Here is the caller graph for this function:

xos_opal_Theme::headContent (   $params,
  $content,
$smarty,
$repeat 
)

xos_opal_Theme::headContent()

Parameters
mixed$params
mixed$content
mixed$smarty
mixed$repeat
Returns

Definition at line 677 of file theme.php.

References $content.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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).

Parameters
string$canvasTplThe canvas template, if different from the theme default
string$pageTplThe page template, if different from the theme default (unsupported, 2.3+ only)
string$contentTplThe content template
array$varsTemplate 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().

Here is the call graph for this function:

Here is the caller graph for this function:

xos_opal_Theme::renderAttributes (   $coll)

Transform an attributes collection to an XML string

Parameters
array$coll
Returns
string

Definition at line 766 of file theme.php.

Referenced by renderMetas().

Here is the caller graph for this function:

xos_opal_Theme::renderMetas (   $type = null,
  $return = false 
)

xos_opal_Theme::renderMetas()

Parameters
mixed$type
mixed$return
Returns

Definition at line 691 of file theme.php.

References $content, $type, and renderAttributes().

Referenced by render().

Here is the call graph for this function:

Here is the caller graph for this function:

xos_opal_Theme::resourcePath (   $path)

Return a themable file resource path

Parameters
string$path
Returns
string

Definition at line 783 of file theme.php.

References $path.

Referenced by addLanguage(), addScript(), and addStylesheet().

Here is the caller graph for this function:

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.

Parameters
array$options
Returns
bool

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.

Here is the call graph for this function:

Member Data Documentation

xos_opal_Theme::$bufferOutput = true

Definition at line 155 of file theme.php.

xos_opal_Theme::$canvasTemplate = 'theme.html'

Definition at line 161 of file theme.php.

xos_opal_Theme::$content = ''

Definition at line 185 of file theme.php.

Referenced by addScript(), addStylesheet(), headContent(), render(), and renderMetas().

xos_opal_Theme::$contentCacheId = null

Definition at line 178 of file theme.php.

xos_opal_Theme::$contentCacheLifetime = 0

Definition at line 177 of file theme.php.

Referenced by checkCache().

xos_opal_Theme::$contentTemplate = ''

Definition at line 175 of file theme.php.

xos_opal_Theme::$folderName = ''

Definition at line 141 of file theme.php.

Referenced by xoInit().

xos_opal_Theme::$htmlHeadStrings = array()

Definition at line 220 of file theme.php.

Referenced by render().

xos_opal_Theme::$metas
Initial value:
= array(
'meta' => array() ,
'link' => array() ,
'script' => array())

Definition at line 207 of file theme.php.

Referenced by render().

xos_opal_Theme::$path = ''

Definition at line 147 of file theme.php.

Referenced by resourcePath().

xos_opal_Theme::$plugins
Initial value:
= array(
'xos_logos_PageBuilder')

Definition at line 192 of file theme.php.

xos_opal_Theme::$renderBanner = true

Definition at line 135 of file theme.php.

xos_opal_Theme::$renderCount = 0

Definition at line 194 of file theme.php.

xos_opal_Theme::$template = false

Definition at line 200 of file theme.php.

Referenced by checkCache(), and xoInit().

xos_opal_Theme::$templateVars = array()

Definition at line 226 of file theme.php.

xos_opal_Theme::$themesPath = 'themes'

Definition at line 168 of file theme.php.

xos_opal_Theme::$url = ''

Definition at line 148 of file theme.php.

xos_opal_Theme::$use_extra_cache_id = true

Definition at line 233 of file theme.php.


The documentation for this class was generated from the following file: