Class xos_opal_Theme
Methods | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
public
|
xoInit(array $options = []): bool
Initializes this theme
Initializes this theme Upon initialization, the theme creates its template engine and instantiates the plug-ins from the specified {@link $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. |
# | ||||||||
public
|
generateCacheId(string $cache_id, string $extraString = ''): string
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
Returnscomplete cache id |
# | ||||||||
public
|
checkCache(): bool
xos_opal_Theme::checkCache()
xos_opal_Theme::checkCache() |
# | ||||||||
public
|
render(string $canvasTpl = null, string $pageTpl = null, string $contentTpl = null, array $vars = []): bool
Render the page
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
|
# | ||||||||
public
|
loadLocalization(string $type = 'main'): bool
Load localization information
Load localization information Folder structure for localization:
|
# | ||||||||
public
|
addLanguage(string $type = 'main', string $language = null): bool|mixed
Load theme specific language constants
Load theme specific language constants Parameters
|
# | ||||||||
public
|
addScript(string $src = '', array $attributes = [], string $content = '', string $name = ''): void
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 <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
|
# | ||||||||
public
|
addStylesheet(string $src = '', array $attributes = [], string $content = '', string $name = ''): void
Add StyleSheet or CSS code to the document head
Add StyleSheet or CSS code to the document head Parameters
|
# | ||||||||
public
|
addLink(string $rel, string $href = '', array $attributes = [], string $name = '')
Add a <link> to the header
Add a to the header Parameters
|
# | ||||||||
public
|
addHttpMeta($name, null $value = null): string
Set a meta http-equiv value
Set a meta http-equiv value |
# | ||||||||
public
|
addMeta(string $type = 'meta', string $name = '', string $value = ''): string
Change output page meta-information
Change output page meta-information |
# | ||||||||
public
|
headContent(mixed $params, mixed $content, mixed &$smarty, mixed &$repeat): void
xos_opal_Theme::headContent()
xos_opal_Theme::headContent() |
# | ||||||||
public
|
renderMetas(mixed $type = null, mixed $return = false): bool|string
xos_opal_Theme::renderMetas()
xos_opal_Theme::renderMetas() |
# | ||||||||
public
|
genElementId(string $tagName = 'xos'): string
Generates a unique element ID
Generates a unique element ID |
# | ||||||||
public
|
renderAttributes(array $coll): string
Transform an attribute collection to an XML string
Transform an attribute collection to an XML string |
# | ||||||||
public
|
resourcePath(string $path): string
Return a themeable file resource path
Return a themeable file resource path |
# |
Properties | |||
---|---|---|---|
public
|
bool
|
$renderBanner = true
|
# |
public
|
string
|
$folderName = ''
|
# |
public
|
string
|
$path = ''
|
# |
public
|
|
$url = ''
|
# |
public
|
string
|
$bufferOutput = true
|
# |
public
|
string
|
$canvasTemplate = 'theme.tpl'
|
# |
public
|
string
|
$themesPath = 'themes'
|
# |
public
|
string
|
$contentTemplate = ''
|
# |
public
|
|
$contentCacheLifetime = 0
|
# |
public
|
|
$contentCacheId
|
# |
public
|
string
|
$content = ''
|
# |
public
|
array
|
$plugins = ['xos_logos_PageBuilder']
|
# |
public
|
|
$renderCount = 0
|
# |
public
|
XoopsTpl
|
$template = false
|
# |
public
|
array
|
$metas = ['meta' => [], 'link' => [], 'script' => []]
|
# |
public
|
array
|
$htmlHeadStrings = []
|
# |
public
|
array
|
$templateVars = []
|
# |
public
|
boolean
|
$use_extra_cache_id = true
|
# |