XOOPS API 2.5.11 Beta1
UI v0.5
Réalisé par monxoops.fr
|
Fonctions membres publiques | |
generateCacheId ($cache_id, $extraString='') | |
checkCache () | |
render ($canvasTpl=null, $pageTpl=null, $contentTpl=null, $vars=array()) | |
loadLocalization ($type='main') | |
addLanguage ($type='main', $language=null) | |
addScript ($src='', $attributes=array(), $content='', $name='') | |
addStylesheet ($src='', $attributes=array(), $content='', $name='') | |
addLink ($rel, $href='', $attributes=array(), $name='') | |
addHttpMeta ($name, $value=null) | |
addMeta ($type='meta', $name='', $value='') | |
headContent ($params, $content, &$smarty, &$repeat) | |
renderMetas ($type=null, $return=false) | |
genElementId ($tagName='xos') | |
renderAttributes ($coll) | |
resourcePath ($path) | |
Champs de données | |
$renderBanner = true | |
$folderName = '' | |
$path = '' | |
$url = '' | |
$bufferOutput = true | |
$canvasTemplate = 'theme.tpl' | |
$themesPath = 'themes' | |
$contentTemplate = '' | |
$contentCacheLifetime = 0 | |
$contentCacheId | |
$content = '' | |
$plugins | |
$renderCount = 0 | |
$template = false | |
$metas | |
$htmlHeadStrings = array() | |
$templateVars = array() | |
$use_extra_cache_id = true | |
Class xos_opal_Theme
addHttpMeta | ( | $name, | |
$value = null |
|||
) |
Set a meta http-equiv value
$name | ||
null | $value |
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 |
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. |
addMeta | ( | $type = 'meta' , |
|
$name = '' , |
|||
$value = '' |
|||
) |
Change output page meta-information
string | $type | |
string | $name | |
string | $value |
addScript | ( | $src = '' , |
|
$attributes = array() , |
|||
$content = '' , |
|||
$name = '' |
|||
) |
*#+
@tasktype 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. |
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. |
checkCache | ( | ) |
genElementId | ( | $tagName = 'xos' | ) |
Generates a unique element ID
string | $tagName |
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 |
headContent | ( | $params, | |
$content, | |||
& | $smarty, | ||
& | $repeat | ||
) |
mixed | $params | |
mixed | $content | |
mixed | $smarty | |
mixed | $repeat |
loadLocalization | ( | $type = 'main' | ) |
Load localization information
Folder structure for localization:
main.php - language definitions style.css - localization stylesheet script.js - localization script
string | $type |
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 |
renderAttributes | ( | $coll | ) |
Transform an attributes collection to an XML string
array | $coll |
mixed | $type | |
mixed | $return |
resourcePath | ( | $path | ) |
Return a themeable file resource path
string | $path |
$bufferOutput = true |
$canvasTemplate = 'theme.tpl' |
$content = '' |
$contentCacheId |
$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 |