static string preFilter(
string
$source, mixed
&$smarty
)
|
|
Remove leading whitespace when compiling tpl to produce smaller html page sizes.
Parameters:
string |
$source: |
tpl content |
API Tags:
Return: | processed tpl content ready for compilation |
static boolean shouldDoCompileCheck(
)
|
|
Check whether modification checks should be done to see if the compiled templates are still up to date. The result is cached in memory.
API Tags:
Return: | false if the compiled templates should be used without any checking |
static string _getActualTemplatePath(
string
$templateName,
&$smarty, Smarty
$smarty
)
|
|
Given a template name (foo/bar/path/file.tpl), return the active template path based on the
following: if (module bar): /fullpath/themes/themeId/templates/bar_templateversion/path/local/file.tpl if (module bar): /fullpath/themes/themeId/templates/bar_templateversion/path/file.tpl /fullpath/foo/bar/path/local/file.tpl /fullpath/foo/bar/path/file.tpl
Parameters:
string |
$templateName: |
base template name |
Smarty |
$smarty: |
|
|
&$smarty: |
|
API Tags:
Return: | path to the current active template file for the specified template name |
Access: | private |
static Smarty _getSmarty(
$trimWhitespace
)
|
|
Return a properly configured instance of Smarty. This used to be a single shared static instance of Smarty, but now we build it every time we need it. Theoretically we shouldn't be creating more than one GalleryTemplate and hence, more than one Smarty instance per request. However, having it as a static object makes it less testable.
Parameters:
API Tags:
Redefined in descendants as:
static array _getThemeId(
)
|
|
Return the themeid for the current item.
API Tags:
Return: | GalleryStatus a status code string ThemeId |
Access: | private |
GalleryTemplate GalleryTemplate(
$templateDir, [
$initSmarty = true], [
$trimWhitespace = true]
)
|
|
Parameters:
|
$templateDir: |
|
|
$initSmarty: |
|
|
$trimWhitespace: |
|
Display the properly localized template
Parameters:
API Tags:
Return: | the status of the call |
Redefined in descendants as:
array fetch(
string
$templateName
)
|
|
Render the properly localized template
Parameters:
API Tags:
Return: | GalleryStatus the status of the call string the HTML content |
Redefined in descendants as:
mixed getVariable(
string
$key
)
|
|
Retrieve a template value
Parameters:
API Tags:
Redefined in descendants as:
mixed &getVariableByReference(
string
$key
)
|
|
Retrieve a reference to a template value
Parameters:
API Tags:
Redefined in descendants as:
boolean hasVariable(
string
$key
)
|
|
Return true if the given variable is set
Parameters:
Redefined in descendants as:
void head(
string
$tpl, [string
$l10Domain = null]
)
|
|
Add a template to include in the <head> section
Parameters:
string |
$tpl: |
template path |
string |
$l10Domain: |
(optional) localization domain default={1stdir}_{2nddir} from template path |
Redefined in descendants as:
void javascript(
string
$path
)
|
|
Add a JavaScript to include in the <head> section
Parameters:
string |
$path: |
script path relative to gallery2 dir |
void link(
$attributes, string
$path
)
|
|
Add a <link> element in the <head> section
Parameters:
string |
$path: |
script path relative to gallery2 dir |
|
$attributes: |
|
void meta(
unknown_type
$name, unknown_type
$content, [unknown_type
$isHttpEquiv = false]
)
|
|
Add a meta element to the <head> section
Parameters:
unknown_type |
$name: |
Value for the name (or http-equiv) attribute |
unknown_type |
$content: |
Value for the content attribute |
unknown_type |
$isHttpEquiv: |
(optional) Whether this is a http-equiv element. Default false. |
void resourceGetSecure(
$templateName,
&$smarty
)
|
|
Parameters:
API Tags:
void resourceGetTemplate(
$templateName,
&$templateSource,
&$smarty
)
|
|
Parameters:
|
$templateName: |
|
|
&$templateSource: |
|
|
&$smarty: |
|
API Tags:
void resourceGetTemplateBaseDir(
string
$templateName,
&$smarty, Smarty
$smarty
)
|
|
Returns the base directory of the specified template. This is required to support loading templates from g2data/plugins.
This method was only used in resourceGetTemplate and resourceGetTimestamp to determine the base directory. That functionality is now handled in the _getActualTemplatePath method as part of the template override version checking, so is no longer required.
Parameters:
string |
$templateName: |
Template to get base directory for. |
Smarty |
$smarty: |
|
|
&$smarty: |
|
API Tags:
Information Tags:
Author: | Jozef Selesi (selesi at gmail dot com) |
void resourceGetTimestamp(
$templateName,
&$templateTimestamp,
&$smarty
)
|
|
Parameters:
|
$templateName: |
|
|
&$templateTimestamp: |
|
|
&$smarty: |
|
API Tags:
void resourceGetTrusted(
$templateName,
&$smarty
)
|
|
Parameters:
API Tags:
void setVariable(
string
$key, [mixed
$value = null]
)
|
|
Assign a template key/value pair
Parameters:
string |
$key: |
|
mixed |
$value: |
|
Redefined in descendants as:
void setVariableByReference(
string
$key,
&$value, mixed
$value
)
|
|
Assign a template key/value pair
Parameters:
string |
$key: |
|
mixed |
$value: |
|
|
&$value: |
|
Redefined in descendants as:
void style(
string
$path
)
|
|
Add a stylesheet to include in the <head> section
Parameters:
string |
$path: |
stylesheet path relative to gallery2 dir |
void title(
string
$title
)
|
|
Set the title to include in the <head> section
Parameters:
string |
$title: |
localized title |
array _initCompiledTemplateDir(
)
|
|
Initializes the directory where compiled templates will be saved for this specific template directory
Each theme should have its own directory for compiled Smarty templates so that no name clashes occur. This subdirectory will be created on demand here.
API Tags:
Return: | GalleryStatus a status code string directory to use for complide templates |