ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
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 ::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 14 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 100 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 427 of file Template.php.
Referenced by __construct().
|
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 449 of file Template.php.
|
private |
Add overriding templates from the configured theme.
Definition at line 270 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 345 of file Template.php.
SimpleSAML_XHTML_Template::getAttributeTranslation | ( | $name | ) |
$name |
Definition at line 541 of file Template.php.
SimpleSAML_XHTML_Template::getLanguage | ( | ) |
Definition at line 552 of file Template.php.
|
static |
Definition at line 576 of file Template.php.
|
private |
Wraps Language->getLanguageList.
Definition at line 597 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 306 of file Template.php.
References $module.
Referenced by setupTwigTemplatepaths().
SimpleSAML_XHTML_Template::getTag | ( | $tag | ) |
$tag |
Definition at line 609 of file Template.php.
SimpleSAML_XHTML_Template::getTranslation | ( | $translations | ) |
Temporary wrapper for ::getPreferredTranslation().
Definition at line 621 of file Template.php.
SimpleSAML_XHTML_Template::getTranslator | ( | ) |
Return the internal translator object used by this template.
Definition at line 512 of file Template.php.
Referenced by present_eptid().
SimpleSAML_XHTML_Template::getTwig | ( | ) |
Get the current instance of Twig in use.
Definition at line 523 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 632 of file Template.php.
SimpleSAML_XHTML_Template::includeInlineTranslation | ( | $tag, | |
$translation | |||
) |
Wraps Translate->includeInlineTranslation()
Definition at line 649 of file Template.php.
SimpleSAML_XHTML_Template::includeLanguageFile | ( | $file, | |
$otherConfig = null |
|||
) |
$file | ||
null | $otherConfig |
Definition at line 662 of file Template.php.
|
private |
Wrap Language->isLanguageRTL.
Definition at line 671 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 686 of file Template.php.
|
static |
Behave like Language->noop to mark a tag for translation but actually do it later.
Definition at line 703 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 137 of file Template.php.
Referenced by setupTwig(), and setupTwigTemplatepaths().
SimpleSAML_XHTML_Template::setLanguage | ( | $language, | |
$setLanguageCookie = true |
|||
) |
$language | ||
bool | $setLanguageCookie |
Definition at line 565 of file Template.php.
|
static |
$language |
Definition at line 588 of file Template.php.
|
private |
Setup twig.
Definition at line 194 of file Template.php.
References $_GET, PHPMailer\PHPMailer\$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 160 of file Template.php.
References $filename, $namespace, 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 405 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 715 of file Template.php.
|
private |
Set some default context.
Definition at line 375 of file Template.php.
|
private |
Definition at line 42 of file Template.php.
Referenced by __construct().
|
private |
Definition at line 79 of file Template.php.
Referenced by __construct().
SimpleSAML_XHTML_Template::$data = array() |
Definition at line 21 of file Template.php.
|
private |
Definition at line 35 of file Template.php.
|
private |
Current module, if any.
Definition at line 68 of file Template.php.
Referenced by getModuleTemplateDir().
|
private |
Definition at line 49 of file Template.php.
Referenced by __construct().
|
private |
Definition at line 91 of file Template.php.
|
private |
Definition at line 28 of file Template.php.
|
private |
Definition at line 56 of file Template.php.
Referenced by setupTwig().
|
private |
Definition at line 63 of file Template.php.