ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Public Member Functions | |
__construct (\SimpleSAML_Configuration $configuration, $template, $defaultDictionary=null) | |
Constructor. More... | |
show () | |
Show the template to the user. More... | |
getTranslator () | |
Return the internal translator object used by this template. More... | |
getTwig () | |
Get the current instance of Twig in use. More... | |
getAttributeTranslation ($name) | |
getLanguage () | |
setLanguage ($language, $setLanguageCookie=true) | |
getTag ($tag) | |
getTranslation ($translations) | |
Temporary wrapper for \SimpleSAML\Locale\Translate::getPreferredTranslation(). More... | |
includeInlineTranslation ($tag, $translation) | |
Wraps Translate->includeInlineTranslation() More... | |
includeLanguageFile ($file, $otherConfig=null) | |
t ( $tag, $replacements=array(), $fallbackdefault=true, $oldreplacements=array(), $striptags=false) | |
Wrap Language->t to translate tag into the current language, with a fallback to english. More... | |
Static Public Member Functions | |
static | getLanguageCookie () |
static | setLanguageCookie ($language) |
static | lang_merge ($def, $lang) |
Merge two translation arrays. More... | |
static | noop ($tag) |
Behave like Language->noop to mark a tag for translation but actually do it later. More... | |
Data Fields | |
$data = array() | |
Private Member Functions | |
normalizeTemplateName ($templateName) | |
Normalize the name of the template to one of the possible alternatives. More... | |
setupTwigTemplatepaths () | |
Set up the places where twig can look for templates. More... | |
setupTwig () | |
Setup twig. More... | |
findThemeTemplateDirs () | |
Add overriding templates from the configured theme. More... | |
getModuleTemplateDir ($module) | |
Get the template directory of a module, if it exists. More... | |
generateLanguageBar () | |
Generate an array for its use in the language bar, indexed by the ISO 639-2 codes of the languages available, containing their localized names and the URL that should be used in order to change to that language. More... | |
twigDefaultContext () | |
Set some default context. More... | |
findModuleAndTemplateName ($template) | |
Find module the template is in, if any. More... | |
findTemplatePath ($template, $throw_exception=true) | |
Find template path. More... | |
getLanguageList () | |
Wraps Language->getLanguageList. More... | |
includeAtTemplateBase ($file) | |
Includes a file relative to the template base directory. More... | |
isLanguageRTL () | |
Wrap Language->isLanguageRTL. More... | |
Private Attributes | |
$translator | |
$localization | |
$configuration | |
$template = 'default.php' | |
$twig | |
$twig_template | |
$module | |
Current module, if any. More... | |
$controller | |
$theme | |
Definition at line 16 of file Template.php.
SimpleSAML_XHTML_Template::__construct | ( | \SimpleSAML_Configuration | $configuration, |
$template, | |||
$defaultDictionary = null |
|||
) |
Constructor.
SimpleSAML_Configuration | $configuration | Configuration object |
string | $template | Which template file to load |
string | null | $defaultDictionary | The default dictionary where tags will come from. |
Definition at line 103 of file Template.php.
References $configuration, $controller, $template, data, findModuleAndTemplateName(), and setupTwig().
|
private |
Find module the template is in, if any.
string | $template | The relative path from the theme directory to the template file. |
Definition at line 421 of file Template.php.
Referenced by __construct(), and setupTwigTemplatepaths().
|
private |
Find template path.
This function locates the given template based on the template name. It will first search for the template in the current theme directory, and then the default theme.
The template name may be on the form <module name>:<template path>, in which case it will search for the template file in the given module.
string | $template | The relative path from the theme directory to the template file. |
Exception | If the template file couldn't be found. |
Definition at line 443 of file Template.php.
|
private |
Add overriding templates from the configured theme.
Definition at line 263 of file Template.php.
References SimpleSAML\Module\getModuleDir(), Twig_Loader_Filesystem\MAIN_NAMESPACE, and SimpleSAML\Logger\warning().
Referenced by setupTwigTemplatepaths().
|
private |
Generate an array for its use in the language bar, indexed by the ISO 639-2 codes of the languages available, containing their localized names and the URL that should be used in order to change to that language.
Definition at line 339 of file Template.php.
SimpleSAML_XHTML_Template::getAttributeTranslation | ( | $name | ) |
$name |
Definition at line 535 of file Template.php.
SimpleSAML_XHTML_Template::getLanguage | ( | ) |
Definition at line 546 of file Template.php.
|
static |
Definition at line 570 of file Template.php.
|
private |
Wraps Language->getLanguageList.
Definition at line 591 of file Template.php.
|
private |
Get the template directory of a module, if it exists.
InvalidArgumentException | If the module is not enabled or it has no templates directory. |
Definition at line 299 of file Template.php.
References $module.
Referenced by setupTwigTemplatepaths().
SimpleSAML_XHTML_Template::getTag | ( | $tag | ) |
$tag |
Definition at line 603 of file Template.php.
SimpleSAML_XHTML_Template::getTranslation | ( | $translations | ) |
Temporary wrapper for \SimpleSAML\Locale\Translate::getPreferredTranslation().
Definition at line 615 of file Template.php.
SimpleSAML_XHTML_Template::getTranslator | ( | ) |
Return the internal translator object used by this template.
Definition at line 506 of file Template.php.
SimpleSAML_XHTML_Template::getTwig | ( | ) |
Get the current instance of Twig in use.
Definition at line 517 of file Template.php.
|
private |
Includes a file relative to the template base directory.
This function can be used to include headers and footers etc.
Definition at line 626 of file Template.php.
SimpleSAML_XHTML_Template::includeInlineTranslation | ( | $tag, | |
$translation | |||
) |
Wraps Translate->includeInlineTranslation()
Definition at line 643 of file Template.php.
SimpleSAML_XHTML_Template::includeLanguageFile | ( | $file, | |
$otherConfig = null |
|||
) |
$file | ||
null | $otherConfig |
Definition at line 656 of file Template.php.
|
private |
Wrap Language->isLanguageRTL.
Definition at line 665 of file Template.php.
|
static |
Merge two translation arrays.
array | $def | The array holding string definitions. |
array | $lang | The array holding translations for every string. |
Definition at line 680 of file Template.php.
|
static |
Behave like Language->noop to mark a tag for translation but actually do it later.
Definition at line 697 of file Template.php.
|
private |
Normalize the name of the template to one of the possible alternatives.
string | $templateName | The template name to normalize. |
Definition at line 140 of file Template.php.
Referenced by setupTwig(), and setupTwigTemplatepaths().
SimpleSAML_XHTML_Template::setLanguage | ( | $language, | |
$setLanguageCookie = true |
|||
) |
$language | ||
bool | $setLanguageCookie |
Definition at line 559 of file Template.php.
|
static |
$language |
Definition at line 582 of file Template.php.
|
private |
Setup twig.
Definition at line 197 of file Template.php.
References $_GET, $loader, $options, $twig, normalizeTemplateName(), and setupTwigTemplatepaths().
Referenced by __construct().
|
private |
Set up the places where twig can look for templates.
Twig_Error_Loader | In case a failure occurs. |
Definition at line 163 of file Template.php.
References $filename, $loader, $namespace, findModuleAndTemplateName(), findThemeTemplateDirs(), getModuleTemplateDir(), Twig_Loader_Filesystem\MAIN_NAMESPACE, and normalizeTemplateName().
Referenced by setupTwig().
SimpleSAML_XHTML_Template::show | ( | ) |
Show the template to the user.
Definition at line 399 of file Template.php.
SimpleSAML_XHTML_Template::t | ( | $tag, | |
$replacements = array() , |
|||
$fallbackdefault = true , |
|||
$oldreplacements = array() , |
|||
$striptags = false |
|||
) |
Wrap Language->t to translate tag into the current language, with a fallback to english.
Definition at line 709 of file Template.php.
|
private |
Set some default context.
Definition at line 369 of file Template.php.
|
private |
Definition at line 45 of file Template.php.
Referenced by __construct().
|
private |
Definition at line 82 of file Template.php.
Referenced by __construct().
SimpleSAML_XHTML_Template::$data = array() |
Definition at line 24 of file Template.php.
|
private |
Definition at line 38 of file Template.php.
|
private |
Current module, if any.
Definition at line 71 of file Template.php.
Referenced by getModuleTemplateDir().
|
private |
Definition at line 52 of file Template.php.
Referenced by __construct().
|
private |
Definition at line 94 of file Template.php.
|
private |
Definition at line 31 of file Template.php.
|
private |
Definition at line 59 of file Template.php.
Referenced by setupTwig().
|
private |
Definition at line 66 of file Template.php.