ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilTemplate Class Reference

special template class to simplify handling of ITX/PEAR More...

+ Inheritance diagram for ilTemplate:
+ Collaboration diagram for ilTemplate:

Public Member Functions

 __construct (string $file, bool $flag1, bool $flag2, string $in_module="", string $vars="DEFAULT", bool $plugin=false, bool $a_use_cache=true)
 constructor ilTemplate constructor. More...
 
 blockExists ($a_blockname)
 check if block exists in actual template @access private More...
 
 get ($part="DEFAULT")
 
 getUnmodified ($part="DEFAULT")
 
 setCurrentBlock ($part="DEFAULT")
 Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt. More...
 
 touchBlock ($block)
 overwrites ITX::touchBlock. More...
 
 parseCurrentBlock ($part="DEFAULT")
 Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt @access public. More...
 
 addBlockFile ($var, $block, $tplname, $in_module=false)
 overwrites ITX::addBlockFile @access public More...
 
 loadTemplatefile ( $filename, $removeUnknownVariables=true, $removeEmptyBlocks=true)
 Reads a template file from the disk. More...
 
 variableExists ($a_variablename)
 
 __construct ($file, $flag1, $flag2, $in_module=false, $vars="DEFAULT")
 constructor More...
 
 printToString ()
 @inheritDoc More...
 
 getTemplatePath ($a_tplname, $a_in_module=false, $a_plugin=false)
 builds a full template path with template and module name More...
 
 addBlockFile ($var, $block, $tplname, $in_module=false)
 overwrites ITX::addBlockFile More...
 
 show ($part="DEFAULT")
 @access public More...
 
 getMessageHTML ($a_txt, $a_type="info")
 Get HTML for a system message. More...
 
 setCurrentBlock ($part="DEFAULT")
 Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt. More...
 
 touchBlock ($block)
 overwrites ITX::touchBlock. More...
 
 parseCurrentBlock ($part="DEFAULT")
 Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt @access public. More...
 
 setOnScreenMessage ($a_type, $a_txt, $a_keep=false)
 Set message. More...
 
 fillMessage ()
 
 blockExists ($a_blockname)
 check if block exists in actual template @access private More...
 
 addJavaScript ($a_js_file, $a_add_version_parameter=true, $a_batch=2)
 Add a javascript file that should be included in the header. More...
 
 fillJavaScriptFiles ($force=true)
 
 addCss ($a_css_file, $media="screen")
 Add a css file that should be included in the header. More...
 
 fillCssFiles ($a_force=false)
 Fill in the css file tags. More...
 
 get ($part="DEFAULT")
 
 hideFooter ()
 @inheritDoc More...
 
 addOnLoadCode ($a_code, $a_batch=2)
 @inheritDoc More...
 
 getOnLoadCodeForAsynch ()
 @inheritDoc More...
 
 resetJavascript ()
 @inheritDoc More...
 
 addInlineCss ($a_css, $media="screen")
 @inheritDoc More...
 
 setBodyClass ($a_class="")
 
 loadStandardTemplate ()
 @inheritDoc More...
 
 setTitle ($a_title, $hidden=false)
 @inheritDoc More...
 
 setDescription ($a_descr)
 @inheritDoc More...
 
 setTitleIcon ($a_icon_path, $a_icon_desc="")
 @inheritDoc More...
 
 setAlertProperties (array $a_props)
 @inheritDoc More...
 
 clearHeader ()
 @inheritDoc More...
 
 setHeaderActionMenu ($a_header)
 @inheritDoc More...
 
 setHeaderPageTitle ($a_title)
 @inheritDoc More...
 
 setLocator ()
 @inheritDoc More...
 
 setTabs ($a_tabs_html)
 @inheritDoc More...
 
 setSubTabs ($a_tabs_html)
 @inheritDoc More...
 
 setContent ($a_html)
 @inheritDoc More...
 
 setLeftContent ($a_html)
 @inheritDoc More...
 
 setLeftNavContent ($a_content)
 @inheritDoc More...
 
 setRightContent ($a_html)
 @inheritDoc More...
 
 setPageFormAction ($a_action)
 
 setLoginTargetPar ($a_val)
 @inheritDoc More...
 
 getSpecial ($part="DEFAULT", $add_error_mess=false, $handle_referer=false, $add_ilias_footer=false, $add_standard_elements=false, $a_main_menu=true, $a_tabs=true)
 @inheritDoc More...
 
 printToStdout ($part="DEFAULT", $a_fill_tabs=true, $a_skip_main_menu=false)
 @inheritDoc More...
 
 setTreeFlatIcon ($a_link, $a_mode)
 @inheritDoc More...
 
 addLightbox ($a_html, $a_id)
 @inheritDoc More...
 
 addAdminPanelToolbar (ilToolbarGUI $toolb, $a_bottom_panel=true, $a_arrow=false)
 @inheritDoc More...
 
 setPermanentLink ($a_type, $a_id, $a_append="", $a_target="", $a_title="")
 
 resetHeaderBlock ($a_reset_header_action=true)
 @inheritDoc More...
 
 enableDragDropFileUpload ($a_ref_id)
 @inheritDoc More...
 
- Public Member Functions inherited from HTML_Template_ITX
 __construct ($root='')
 Builds some complex regexps and calls the constructor of the parent class. More...
 
 replaceBlock ($block, $template, $keep_content=false)
 Replaces an existing block with new content. More...
 
 replaceBlockfile ($block, $filename, $keep_content=false)
 Replaces an existing block with new content from a file. More...
 
 addBlock ($placeholder, $blockname, $template)
 Adds a block to the template changing a variable placeholder to a block placeholder. More...
 
 addBlockfile ($placeholder, $blockname, $filename)
 Adds a block taken from a file to the template changing a variable placeholder to a block placeholder. More...
 
 placeholderExists ($placeholder, $block='')
 Returns the name of the (first) block that contains the specified placeholder. More...
 
 performCallback ()
 Checks the list of function calls in the template and calls their callback function. More...
 
 getFunctioncalls ()
 Returns a list of all function calls in the current template. More...
 
 setFunctioncontent ($functionID, $replacement)
 Replaces a function call with the given replacement. More...
 
 setCallbackFunction ($tplfunction, $callbackfunction, $callbackobject='', $expandCallbackParameters=false)
 Sets a callback function. More...
 
 setCallbackFuntiontable ($functions)
 Sets the Callback function lookup table. More...
 
 removeBlockData ($block)
 Recursively removes all data assiciated with a block, including all inner blocks. More...
 
 getBlocklist ()
 Returns a list of blocknames in the template. More...
 
 blockExists ($blockname)
 Checks wheter a block exists. More...
 
 getBlockvariables ($block)
 Returns a list of variables of a block. More...
 
 BlockvariableExists ($block, $variable)
 Checks wheter a block variable exists. More...
 
 buildFunctionlist ()
 Builds a functionlist from the template. More...
 
 getValue ($code, $delimiter)
 Truncates the given code from the first occurence of $delimiter but ignores $delimiter enclosed by " or '. More...
 
 deleteFromBlockvariablelist ($block, $variables)
 Deletes one or many variables from the block variable list. More...
 
 updateBlockvariablelist ($block)
 Updates the variable list of a block. More...
 
 findPlaceholderBlocks ($variable)
 Returns an array of blocknames where the given variable placeholder is used. More...
 
 warning ($message, $file='', $line=0)
 Handles warnings, saves them to $warn and prints them or calls die() depending on the flags. More...
 
- Public Member Functions inherited from HTML_Template_IT
 __construct ($root='', $options=null)
 Builds some complex regular expressions and optinally sets the file root directory. More...
 
 setOption ($option, $value)
 Sets the option for the template class. More...
 
 setOptions ($options)
 Sets the options for the template class. More...
 
 show ($block='__global__')
 Print a certain block with all replacements done. More...
 
 get ($block='__global__')
 Returns a block with all replacements done. More...
 
 parse ($block='__global__', $flag_recursion=false)
 Parses the given block. More...
 
 parseCurrentBlock ()
 Parses the current block. More...
 
 setVariable ($variable, $value='')
 Sets a variable value. More...
 
 setCurrentBlock ($block='__global__')
 Sets the name of the current block that is the block where variables are added. More...
 
 touchBlock ($block)
 Preserves an empty block even if removeEmptyBlocks is true. More...
 
 free ()
 Clears all datafields of the object. More...
 
 setTemplate ( $template, $removeUnknownVariables=true, $removeEmptyBlocks=true)
 Sets the template. More...
 
 loadTemplatefile ( $filename, $removeUnknownVariables=true, $removeEmptyBlocks=true)
 Reads a template file from the disk. More...
 
 setRoot ($root)
 Sets the file root. More...
 
 buildBlockvariablelist ()
 Build a list of all variables within of a block. More...
 
 getGlobalvariables ()
 Returns a list of all global variables. More...
 
 findBlocks ($string)
 Recusively builds a list of all blocks within the template. More...
 
 getFile ($filename)
 Reads a file from disk and returns its content. More...
 
 _addPregDelimiters ($str)
 Adds delimiters to a string, so it can be used as a pattern in preg_* functions. More...
 
 _preserveOpeningDelimiter ($str)
 Replaces an opening delimiter by a special string. More...
 
 errorMessage ($value, $blockname='')
 Return a textual error message for a IT error code. More...
 
- Public Member Functions inherited from ilGlobalTemplateInterface
 hideFooter ()
 Make the template hide the footer. More...
 
 setOnScreenMessage ($a_type, $a_txt, $a_keep=false)
 Set a message to be displayed to the user. More...
 
 addJavaScript ($a_js_file, $a_add_version_parameter=true, $a_batch=2)
 Add a javascript file that should be included in the header. More...
 
 addOnLoadCode ($a_code, $a_batch=2)
 Add on load code. More...
 
 getOnLoadCodeForAsynch ()
 Get js onload code for ajax calls. More...
 
 resetJavascript ()
 Reset javascript files. More...
 
 fillJavaScriptFiles ($a_force=false)
 
 addCss ($a_css_file, $media="screen")
 Add a css file that should be included in the header. More...
 
 addInlineCss ($a_css, $media="screen")
 Add a css file that should be included in the header. More...
 
 setBodyClass ($a_class="")
 
 loadStandardTemplate ()
 This loads the standard template "tpl.adm_content.html" and "tpl.statusline.html" the CONTENT and STATUSLINE placeholders if they are not already loaded. More...
 
 setTitle ($a_title, $hidden=false)
 Sets title in standard template. More...
 
 setDescription ($a_descr)
 Sets descripton below title in standard template. More...
 
 setTitleIcon ($a_icon_path, $a_icon_desc="")
 set title icon More...
 
 setAlertProperties (array $a_props)
 Set alert properties. More...
 
 clearHeader ()
 Clear header. More...
 
 setHeaderActionMenu ($a_header)
 Set header action menu. More...
 
 setHeaderPageTitle ($a_title)
 Sets the title of the page (for browser window). More...
 
 setLocator ()
 Insert locator. More...
 
 setTabs ($a_tabs_html)
 sets tabs in standard template More...
 
 setSubTabs ($a_tabs_html)
 sets subtabs in standard template More...
 
 setContent ($a_html)
 Sets content for standard template. More...
 
 setLeftContent ($a_html)
 Sets content of left column. More...
 
 setLeftNavContent ($a_content)
 Sets content of left navigation column. More...
 
 setRightContent ($a_html)
 Sets content of right column. More...
 
 setPageFormAction ($a_action)
 
 setLoginTargetPar ($a_val)
 Set target parameter for login (public sector). More...
 
 getSpecial ($part="DEFAULT", $add_error_mess=false, $handle_referer=false, $add_ilias_footer=false, $add_standard_elements=false, $a_main_menu=true, $a_tabs=true)
 
 printToStdout ($part="DEFAULT", $a_fill_tabs=true, $a_skip_main_menu=false)
 
 printToString ()
 Use this method to get the finally rendered page as string. More...
 
 setTreeFlatIcon ($a_link, $a_mode)
 set tree/flat icon More...
 
 addLightbox ($a_html, $a_id)
 Add lightbox html. More...
 
 addAdminPanelToolbar (ilToolbarGUI $toolb, $a_bottom_panel=true, $a_arrow=false)
 Add admin panel commands as toolbar. More...
 
 setPermanentLink ($a_type, $a_id, $a_append="", $a_target="", $a_title="")
 
 resetHeaderBlock ($a_reset_header_action=true)
 Reset all header properties: title, icon, description, alerts, action menu. More...
 
 enableDragDropFileUpload ($a_ref_id)
 Enables the file upload into this object by dropping a file. More...
 
 get ($part="DEFAULT")
 
 setVariable ($variable, $value='')
 
 setCurrentBlock ($part="DEFAULT")
 @access public More...
 
 touchBlock ($block)
 overwrites ITX::touchBlock. More...
 
 parseCurrentBlock ($part="DEFAULT")
 Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt. More...
 
 addBlockFile ($var, $block, $tplname, $in_module=false)
 overwrites ITX::addBlockFile More...
 
 blockExists ($a_blockname)
 check if block exists in actual template More...
 

Data Fields

 $vars
 
 $activeBlock
 
 $js_files = array()
 
 $css_files = array()
 
- Data Fields inherited from HTML_Template_ITX
 $warn = array()
 
 $printWarning = false
 
 $haltOnWarning = false
 
 $checkblocknameRegExp = ''
 
 $functionPrefix = 'func_'
 
 $functionnameRegExp = '[_a-zA-Z]+[A-Za-z_0-9]*'
 
 $functionRegExp = ''
 
 $functions = array()
 
 $callback = array()
 
- Data Fields inherited from HTML_Template_IT
 $err = array()
 
 $clearCache = false
 
 $openingDelimiter = '{'
 
 $closingDelimiter = '}'
 
 $blocknameRegExp = '[\.0-9A-Za-z_-]+'
 
 $variablenameRegExp = '[\.0-9A-Za-z_-]+'
 
 $variablesRegExp = ''
 
 $removeVariablesRegExp = ''
 RegExp used to strip unused variable placeholder. More...
 
 $removeUnknownVariables = true
 
 $removeEmptyBlocks = true
 
 $blockRegExp = ''
 
 $currentBlock = '__global__'
 
 $template = ''
 
 $blocklist = array()
 
 $blockdata = array()
 
 $blockvariables = array()
 
 $blockparents = array()
 
 $blockinner = array()
 
 $touchedBlocks = array()
 List of blocks to preverse even if they are "empty". More...
 
 $_hiddenBlocks = array()
 List of blocks which should not be shown even if not "empty". More...
 
 $variableCache = array()
 
 $clearCacheOnParse = false
 
 $fileRoot = ''
 
 $flagBlocktrouble = false
 
 $flagGlobalParsed = false
 
 $flagCacheTemplatefile = true
 
 $lastTemplatefile = ''
 EXPERIMENTAL! FIXME! More...
 
 $_options
 $_options['preserve_data'] Whether to substitute variables and remove empty placeholders in data passed through setVariable (see also bugs #20199, #21951). More...
 

Protected Member Functions

 init ()
 Clears all datafields of the object and rebuild the internal blocklist. More...
 
 getTemplatePath ($a_tplname, $a_in_module=false, $a_plugin=false)
 builds a full template path with template and module name More...
 
 init ()
 Clears all datafields of the object and rebuild the internal blocklist. More...
 
 init ()
 Clears all datafields of the object and rebuild the internal blocklist. More...
 

Protected Attributes

 $il_use_cache
 
 $il_cur_key
 
 $tplName
 
 $tplPath
 
 $tplIdentifier
 

Static Protected Attributes

static $il_cache = array()
 

Private Member Functions

 fillVars ()
 all template vars defined in $vars will be replaced automatically without setting and parsing them with setVariable & parseCurrentBlock @access private More...
 
 getTemplateIdentifier ($a_tplname, $a_in_module=false)
 get a unique template identifier More...
 

Detailed Description

special template class to simplify handling of ITX/PEAR

Author
Stefan Kesseler skess.nosp@m.eler.nosp@m.@data.nosp@m.bay..nosp@m.de
Sascha Hofmann shofm.nosp@m.ann@.nosp@m.datab.nosp@m.ay.d.nosp@m.e
Version
$Id$

Definition at line 13 of file class.ilTemplate.php.

Constructor & Destructor Documentation

◆ __construct() [1/2]

ilTemplate::__construct ( string  $file,
bool  $flag1,
bool  $flag2,
string  $in_module = "",
string  $vars = "DEFAULT",
bool  $plugin = false,
bool  $a_use_cache = true 
)

constructor ilTemplate constructor.

Parameters
string$filetemplate file
bool$flag1remove unknown variables
bool$flag2remove empty blocks
string$in_modulemodule/service subdirectory
string$varsvariables to replace
bool$pluginplugin template
bool$a_use_cacheus cache
Exceptions
ilTemplateException

Definition at line 71 of file class.ilTemplate.php.

79 {
80 $this->activeBlock = "__global__";
81 $this->vars = array();
82
83 $this->il_use_cache = $a_use_cache;
84 $this->il_cur_key = $file . "/" . $in_module;
85
86 $fname = $this->getTemplatePath($file, $in_module, $plugin);
87
88 $this->tplName = basename($fname);
89 $this->tplPath = dirname($fname);
90 $this->tplIdentifier = $this->getTemplateIdentifier($file, $in_module);
91
92 if (!file_exists($fname)) {
93 throw new \LogicException("Template '$fname' was not found.");
94 }
95
97 $this->loadTemplatefile($fname, $flag1, $flag2);
98 //add tplPath to replacevars
99 $this->vars["TPLPATH"] = $this->tplPath;
100
101 // Option for baseclass HTML_Template_IT
102 $this->setOption('use_preg', false);
103
104 return true;
105 }
setOption($option, $value)
Sets the option for the template class.
Definition: IT.php:399
loadTemplatefile( $filename, $removeUnknownVariables=true, $removeEmptyBlocks=true)
Reads a template file from the disk.
getTemplateIdentifier($a_tplname, $a_in_module=false)
get a unique template identifier
getTemplatePath($a_tplname, $a_in_module=false, $a_plugin=false)
builds a full template path with template and module name
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References XapiProxy\$plugin, $tplPath, ILIAS\GlobalScreen\Provider\__construct(), getTemplateIdentifier(), getTemplatePath(), loadTemplatefile(), and HTML_Template_IT\setOption().

+ Here is the call graph for this function:

◆ __construct() [2/2]

ilTemplate::__construct (   $file,
  $flag1,
  $flag2,
  $in_module = false,
  $vars = "DEFAULT" 
)

constructor

Parameters
string$filetemplatefile (mit oder ohne pfad)
boolean$flag1remove unknown variables
boolean$flag2remove empty blocks
boolean$in_moduleshould be set to true, if template file is in module subdirectory
array$varsvariables to replace @access public

Definition at line 50 of file class.ilTemplate.php.

51 {
52 $this->activeBlock = "__global__";
53 $this->vars = array();
54
55 $fname = $this->getTemplatePath($file, $in_module);
56
57 $this->tplName = basename($fname);
58 $this->tplPath = dirname($fname);
59 // set default content-type to text/html
60 $this->contenttype = "text/html";
61 if (!file_exists($fname)) {
62 die("template " . $fname . " was not found.");
63 return false;
64 }
65
66 //$this->IntegratedTemplateExtension(dirname($fname));
68 //$this->loadTemplatefile(basename($fname), $flag1, $flag2);
69 $this->loadTemplatefile($fname, $flag1, $flag2);
70 //add tplPath to replacevars
71 $this->vars["TPLPATH"] = $this->tplPath;
72
73 // set Options
74 if (method_exists($this, "setOption")) {
75 $this->setOption('use_preg', false);
76 }
77
78 return true;
79 }

References $tplPath, ILIAS\GlobalScreen\Provider\__construct(), getTemplatePath(), loadTemplatefile(), and HTML_Template_IT\setOption().

+ Here is the call graph for this function:

Member Function Documentation

◆ addAdminPanelToolbar()

ilTemplate::addAdminPanelToolbar ( ilToolbarGUI  $toolb,
  $a_bottom_panel = true,
  $a_arrow = false 
)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 707 of file class.ilTemplate.php.

708 {
709 // TODO: Implement addAdminPanelToolbar() method.
710 }

◆ addBlockFile() [1/2]

ilTemplate::addBlockFile (   $var,
  $block,
  $tplname,
  $in_module = false 
)

overwrites ITX::addBlockFile @access public

Parameters
string
string
string$tplnametemplate name
boolean$in_moduleshould be set to true, if template file is in module subdirectory
Returns
boolean/string

Implements ilGlobalTemplateInterface.

Definition at line 279 of file class.ilTemplate.php.

280 {
281 global $DIC;
282
283 if (DEBUG) {
284 echo "<br/>Template '" . $this->tplPath . "/" . $tplname . "'";
285 }
286
287 $tplfile = $this->getTemplatePath($tplname, $in_module);
288 if (file_exists($tplfile) == false) {
289 echo "<br/>Template '" . $tplfile . "' doesn't exist! aborting...";
290 return false;
291 }
292
293 $id = $this->getTemplateIdentifier($tplname, $in_module);
294 $template = $this->getFile($tplfile);
295
296 // include the template input hook
297 $ilPluginAdmin = $DIC["ilPluginAdmin"];
298 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
299 foreach ($pl_names as $pl) {
300 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
301 $gui_class = $ui_plugin->getUIClassInstance();
302
303 $resp = $gui_class->getHTML(
304 "",
305 "template_add",
306 array("tpl_id" => $id, "tpl_obj" => $this, "html" => $template)
307 );
308
309 if ($resp["mode"] != ilUIHookPluginGUI::KEEP) {
310 $template = $gui_class->modifyHTML($template, $resp);
311 }
312 }
313
314 return $this->addBlock($var, $block, $template);
315 }
addBlock($placeholder, $blockname, $template)
Adds a block to the template changing a variable placeholder to a block placeholder.
Definition: ITX.php:241
getFile($filename)
Reads a file from disk and returns its content.
Definition: IT.php:914
const IL_COMP_SERVICE
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
const DEBUG
$DIC
Definition: xapitoken.php:46

References $DIC, XapiProxy\$resp, HTML_Template_IT\$template, HTML_Template_ITX\addBlock(), DEBUG, HTML_Template_IT\getFile(), ilPluginAdmin\getPluginObject(), getTemplateIdentifier(), getTemplatePath(), IL_COMP_SERVICE, and ilUIHookPluginGUI\KEEP.

+ Here is the call graph for this function:

◆ addBlockFile() [2/2]

ilTemplate::addBlockFile (   $var,
  $block,
  $tplname,
  $in_module = false 
)

overwrites ITX::addBlockFile

@access public

Parameters
string
string
string$tplnametemplate name
boolean$in_moduleshould be set to true, if template file is in module subdirectory
Returns
boolean/string

Implements ilGlobalTemplateInterface.

Definition at line 134 of file class.ilTemplate.php.

135 {
136 if (DEBUG) {
137 echo "<br/>Template '" . $this->tplPath . "/" . $tplname . "'";
138 }
139
140 $tplfile = $this->getTemplatePath($tplname, $in_module);
141 if (file_exists($tplfile) == false) {
142 echo "<br/>Template '" . $tplfile . "' doesn't exist! aborting...";
143 return false;
144 }
145
146 return parent::addBlockFile($var, $block, $tplfile);
147 }

References DEBUG, and getTemplatePath().

+ Here is the call graph for this function:

◆ addCss()

ilTemplate::addCss (   $a_css_file,
  $media = "screen" 
)

Add a css file that should be included in the header.

Implements ilGlobalTemplateInterface.

Definition at line 422 of file class.ilTemplate.php.

423 {
424 if (!array_key_exists($a_css_file . $media, $this->css_files)) {
425 $this->css_files[$a_css_file . $media] = array("file" => $a_css_file, "media" => $media);
426 }
427 }

◆ addInlineCss()

ilTemplate::addInlineCss (   $a_css,
  $media = "screen" 
)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 506 of file class.ilTemplate.php.

507 {
508 // TODO: Implement addInlineCss() method.
509 }

◆ addJavaScript()

ilTemplate::addJavaScript (   $a_js_file,
  $a_add_version_parameter = true,
  $a_batch = 2 
)

Add a javascript file that should be included in the header.

Implements ilGlobalTemplateInterface.

Definition at line 398 of file class.ilTemplate.php.

399 {
400 if (!in_array($a_js_file, $this->js_files)) {
401 $this->js_files[] = $a_js_file;
402 }
403 }

◆ addLightbox()

ilTemplate::addLightbox (   $a_html,
  $a_id 
)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 698 of file class.ilTemplate.php.

699 {
700 // TODO: Implement addLightbox() method.
701 }

◆ addOnLoadCode()

ilTemplate::addOnLoadCode (   $a_code,
  $a_batch = 2 
)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 479 of file class.ilTemplate.php.

480 {
481 // TODO: Implement addOnLoadCode() method.
482 }

◆ blockExists() [1/2]

ilTemplate::blockExists (   $a_blockname)

check if block exists in actual template @access private

Parameters
stringblockname
Returns
boolean

Implements ilGlobalTemplateInterface.

Definition at line 154 of file class.ilTemplate.php.

155 {
156 // added second evaluation to the return statement because the first one only works for the content block (Helmut Schottmüller, 2007-09-14)
157 return (isset($this->blockvariables["content"][$a_blockname]) ? true : false) | (isset($this->blockvariables[$a_blockname]) ? true : false);
158 }

Referenced by fillCssFiles(), fillJavaScriptFiles(), ilTinyMCE\handleImgContextMenuItem(), and show().

+ Here is the caller graph for this function:

◆ blockExists() [2/2]

ilTemplate::blockExists (   $a_blockname)

check if block exists in actual template @access private

Parameters
stringblockname
Returns
boolean

Implements ilGlobalTemplateInterface.

Definition at line 389 of file class.ilTemplate.php.

390 {
391 // added second evaluation to the return statement because the first one only works for the content block (Helmut Schottmüller, 2007-09-14)
392 return (isset($this->blockvariables["content"][$a_blockname]) ? true : false) | (isset($this->blockvariables[$a_blockname]) ? true : false);
393 }

◆ clearHeader()

ilTemplate::clearHeader ( )

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 566 of file class.ilTemplate.php.

567 {
568 // TODO: Implement clearHeader() method.
569 }

◆ enableDragDropFileUpload()

ilTemplate::enableDragDropFileUpload (   $a_ref_id)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 731 of file class.ilTemplate.php.

732 {
733 // TODO: Implement enableDragDropFileUpload() method.
734 }

◆ fillCssFiles()

ilTemplate::fillCssFiles (   $a_force = false)

Fill in the css file tags.

Parameters
boolean$a_force

Definition at line 434 of file class.ilTemplate.php.

435 {
436 if (!$this->blockExists("css_file")) {
437 return;
438 }
439 foreach ($this->css_files as $css) {
440 $filename = $css["file"];
441 if (strpos($filename, "?") > 0) {
442 $filename = substr($filename, 0, strpos($filename, "?"));
443 }
444 if (is_file($filename) || $a_force) {
445 $this->setCurrentBlock("css_file");
446 $this->setVariable("CSS_FILE", $css["file"]);
447 $this->setVariable("CSS_MEDIA", $css["media"]);
448 $this->parseCurrentBlock();
449 }
450 }
451 }
$filename
Definition: buildRTE.php:89
parseCurrentBlock()
Parses the current block.
Definition: IT.php:596
blockExists($a_blockname)
check if block exists in actual template @access private
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
setVariable($variable, $value='')

References $filename, blockExists(), HTML_Template_IT\parseCurrentBlock(), setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

Referenced by show().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillJavaScriptFiles()

ilTemplate::fillJavaScriptFiles (   $force = true)

Implements ilGlobalTemplateInterface.

Definition at line 405 of file class.ilTemplate.php.

406 {
407 global $ilias,$ilTabs;
408 if ($this->blockExists("js_file")) {
409 foreach ($this->js_files as $file) {
410 if (is_file($file) || substr($file, 0, 4) == "http") {
411 $this->setCurrentBlock("js_file");
412 $this->setVariable("JS_FILE", $file);
413 $this->parseCurrentBlock();
414 }
415 }
416 }
417 }

References blockExists(), HTML_Template_IT\parseCurrentBlock(), setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

Referenced by show().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillMessage()

ilTemplate::fillMessage ( )

Definition at line 340 of file class.ilTemplate.php.

341 {
342 global $lng;
343
344 $ms = array("info", "success", "failure", "question");
345 $out = "";
346
347 foreach ($ms as $m) {
348 if ($m == "question") {
349 $m = "mess_question";
350 }
351
352 $txt = (ilSession::get($m) != "")
353 ? ilSession::get($m)
354 : $this->message[$m];
355
356 if ($m == "mess_question") {
357 $m = "question";
358 }
359
360 if ($txt != "") {
361 $mtpl = new ilTemplate("tpl.message.html", true, true, "Services/Utilities");
362 $mtpl->setCurrentBlock($m . "_message");
363 $mtpl->setVariable("TEXT", $txt);
364 $mtpl->setVariable("MESSAGE_HEADING", $lng->txt($m . "_message"));
365 $mtpl->parseCurrentBlock();
366 $out .= $mtpl->get();
367 }
368
369 if ($m == "question") {
370 $m = "mess_question";
371 }
372
373 if (ilSession::get($m)) {
375 }
376 }
377
378 if ($out != "") {
379 $this->setVariable("MESSAGE", $out);
380 }
381 }
static clear($a_var)
Unset a value.
static get($a_var)
Get a value.
special template class to simplify handling of ITX/PEAR
$txt
Definition: error.php:13
$lng

References $lng, $out, $txt, ilSession\clear(), ilSession\get(), and ilGlobalTemplateInterface\setVariable().

+ Here is the call graph for this function:

◆ fillVars()

ilTemplate::fillVars ( )
private

all template vars defined in $vars will be replaced automatically without setting and parsing them with setVariable & parseCurrentBlock @access private

Returns
integer

Definition at line 323 of file class.ilTemplate.php.

324 {
325 $count = 0;
326 reset($this->vars);
327
328 foreach ($this->vars as $key => $val) {
329 if (is_array($this->blockvariables[$this->activeBlock])) {
330 if (array_key_exists($key, $this->blockvariables[$this->activeBlock])) {
331 $count++;
332
333 $this->setVariable($key, $val);
334 }
335 }
336 }
337
338 return $count;
339 }

References ilGlobalTemplateInterface\setVariable().

Referenced by parseCurrentBlock(), and touchBlock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get() [1/2]

ilTemplate::get (   $part = "DEFAULT")
Parameters
string
Returns
string

Implements ilGlobalTemplateInterface.

Reimplemented in ilIndependantTemplate.

Definition at line 164 of file class.ilTemplate.php.

165 {
166 global $DIC;
167
168 $html = $this->getUnmodified($part);
169
170 // include the template output hook
171 $ilPluginAdmin = $DIC["ilPluginAdmin"];
172 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
173 foreach ($pl_names as $pl) {
174 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
175 $gui_class = $ui_plugin->getUIClassInstance();
176
177 $resp = $gui_class->getHTML(
178 "",
179 "template_get",
180 array("tpl_id" => $this->tplIdentifier, "tpl_obj" => $this, "html" => $html)
181 );
182
183 if ($resp["mode"] != ilUIHookPluginGUI::KEEP) {
184 $html = $gui_class->modifyHTML($html, $resp);
185 }
186 }
187
188 return $html;
189 }
getUnmodified($part="DEFAULT")

References $DIC, XapiProxy\$resp, ilPluginAdmin\getPluginObject(), getUnmodified(), IL_COMP_SERVICE, and ilUIHookPluginGUI\KEEP.

+ Here is the call graph for this function:

◆ get() [2/2]

ilTemplate::get (   $part = "DEFAULT")
Parameters
string
Returns
string

Implements ilGlobalTemplateInterface.

Reimplemented in ilIndependantTemplate.

Definition at line 454 of file class.ilTemplate.php.

455 {
456 if ($part == "DEFAULT") {
457 return parent::get();
458 } else {
459 return parent::get($part);
460 }
461 }
get(string $class_name)

References ILIAS\GlobalScreen\get().

+ Here is the call graph for this function:

◆ getMessageHTML()

ilTemplate::getMessageHTML (   $a_txt,
  $a_type = "info" 
)

Get HTML for a system message.

Definition at line 246 of file class.ilTemplate.php.

247 {
248 global $lng;
249
250 $mtpl = new ilTemplate("tpl.message.html", true, true, "Services/Utilities");
251 $mtpl->setCurrentBlock($a_type . "_message");
252 $mtpl->setVariable("TEXT", $a_txt);
253 $mtpl->setVariable("MESSAGE_HEADING", $lng->txt($a_type . "_message"));
254 $mtpl->parseCurrentBlock();
255
256 return $mtpl->get();
257 }
$a_type
Definition: workflow.php:92

References $a_type, and $lng.

Referenced by show().

+ Here is the caller graph for this function:

◆ getOnLoadCodeForAsynch()

ilTemplate::getOnLoadCodeForAsynch ( )

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 488 of file class.ilTemplate.php.

489 {
490 // TODO: Implement getOnLoadCodeForAsynch() method.
491 }

◆ getSpecial()

ilTemplate::getSpecial (   $part = "DEFAULT",
  $add_error_mess = false,
  $handle_referer = false,
  $add_ilias_footer = false,
  $add_standard_elements = false,
  $a_main_menu = true,
  $a_tabs = true 
)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 671 of file class.ilTemplate.php.

672 {
673 // TODO: Implement getSpecial() method.
674 }

◆ getTemplateIdentifier()

ilTemplate::getTemplateIdentifier (   $a_tplname,
  $a_in_module = false 
)
private

get a unique template identifier

The identifier is common for default or customized skins but distincts templates of different services with the same name.

This is used by the UI plugin hook for template input/output

Parameters
string$a_tplnametemplate name
string$in_moduleComponent, e.g. "Modules/Forum" boolean $in_module or true, if component should be determined by ilCtrl
Returns
string template identifier, e.g. "tpl.confirm.html"

Definition at line 474 of file class.ilTemplate.php.

475 {
476 global $DIC;
477
478 $ilCtrl = null;
479 if (isset($DIC["ilCtrl"])) {
480 $ilCtrl = $DIC->ctrl();
481 }
482
483
484 // if baseClass functionality is used (ilias.php):
485 // get template directory from ilCtrl
486 if (!empty($_GET["baseClass"]) && $a_in_module === true) {
487 $a_in_module = $ilCtrl->getModuleDir();
488 }
489
490 if (strpos($a_tplname, "/") === false) {
491 if ($a_in_module) {
492 if ($a_in_module === true) {
493 $module_path = ILIAS_MODULE . "/";
494 } else {
495 $module_path = $a_in_module . "/";
496 }
497 } else {
498 $module_path = "";
499 }
500
501 return $module_path . basename($a_tplname);
502 } else {
503 return $a_tplname;
504 }
505 }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
const ILIAS_MODULE
Definition: server.php:14

References $_GET, $DIC, $ilCtrl, and ILIAS_MODULE.

Referenced by __construct(), and addBlockFile().

+ Here is the caller graph for this function:

◆ getTemplatePath() [1/2]

ilTemplate::getTemplatePath (   $a_tplname,
  $a_in_module = false,
  $a_plugin = false 
)
protected

builds a full template path with template and module name

Parameters
string$a_tplnametemplate name
boolean$in_moduleshould be set to true, if template file is in module subdirectory
Returns
string full template path

Definition at line 409 of file class.ilTemplate.php.

410 {
411 global $DIC;
412
413 $ilCtrl = null;
414 if (isset($DIC["ilCtrl"])) {
415 $ilCtrl = $DIC->ctrl();
416 }
417
418 $fname = "";
419
420 if (strpos($a_tplname, "/") === false) {
421 $module_path = "";
422
423 if ($a_in_module != "") {
424 $module_path = $a_in_module . "/";
425 }
426
427 // use ilStyleDefinition instead of account to get the current skin
428 include_once "Services/Style/System/classes/class.ilStyleDefinition.php";
429 if (ilStyleDefinition::getCurrentSkin() != "default") {
431
432 $fname = "./Customizing/global/skin/" .
433 ilStyleDefinition::getCurrentSkin() . "/" . $style . "/" . $module_path
434 . basename($a_tplname);
435
436 if ($fname == "" || !file_exists($fname)) {
437 $fname = "./Customizing/global/skin/" .
438 ilStyleDefinition::getCurrentSkin() . "/" . $module_path . basename($a_tplname);
439 }
440 }
441
442 if ($fname == "" || !file_exists($fname)) {
443 $fname = "./" . $module_path . "templates/default/" . basename($a_tplname);
444 }
445 } elseif (strpos($a_tplname, "src/UI") === 0) {
446 if (class_exists("ilStyleDefinition") // for testing
447 && ilStyleDefinition::getCurrentSkin() != "default") {
448 $fname = "./Customizing/global/skin/" . ilStyleDefinition::getCurrentSkin() . "/" . str_replace("src/UI/templates/default", "UI", $a_tplname);
449 }
450 if ($fname == "" || !file_exists($fname)) {
451 $fname = $a_tplname;
452 }
453 } else {
454 $fname = $a_tplname;
455 }
456
457 return $fname;
458 }
static getCurrentSkin()
get the current skin
static getCurrentStyle()
get the current style or sub style

References $DIC, $ilCtrl, ilStyleDefinition\getCurrentSkin(), and ilStyleDefinition\getCurrentStyle().

Referenced by __construct(), and addBlockFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTemplatePath() [2/2]

ilTemplate::getTemplatePath (   $a_tplname,
  $a_in_module = false,
  $a_plugin = false 
)

builds a full template path with template and module name

Parameters
string$a_tplnametemplate name
boolean$in_moduleshould be set to true, if template file is in module subdirectory
Returns
string full template path

Definition at line 98 of file class.ilTemplate.php.

99 {
100 global $ilias, $ilCtrl;
101
102 // if baseClass functionality is used (ilias.php):
103 // get template directory from ilCtrl
104 if (!empty($_GET["baseClass"]) && $a_in_module === true) {
105 $a_in_module = $ilCtrl->getModuleDir();
106 }
107
108 if (strpos($a_tplname, "/") === false) {
109 $module_path = "";
110
111 //$fname = $ilias->tplPath;
112 if ($a_in_module) {
113 if ($a_in_module === true) {
114 $module_path = ILIAS_MODULE . "/";
115 } else {
116 $module_path = $a_in_module . "/";
117 }
118 }
119
120 if ($fname == "" || !file_exists($fname)) {
121 if ($a_in_module == "setup") {
122 $fname = "./" . $module_path . "templates/" . basename($a_tplname);
123 } else {
124 $fname = "./" . $module_path . "templates/default/" . basename($a_tplname);
125 }
126 }
127 } else {
128 $fname = $a_tplname;
129 }
130
131 return $fname;
132 }

References $_GET, $ilCtrl, and ILIAS_MODULE.

◆ getUnmodified()

ilTemplate::getUnmodified (   $part = "DEFAULT")
Parameters
string
Returns
string

Definition at line 195 of file class.ilTemplate.php.

196 {
197 global $DIC;
198
199 if ($part == "DEFAULT") {
200 return parent::get();
201 }
202 return parent::get($part);
203 }

References $DIC, and ILIAS\GlobalScreen\get().

Referenced by get().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hideFooter()

ilTemplate::hideFooter ( )

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 467 of file class.ilTemplate.php.

468 {
469 // TODO: Implement hideFooter() method.
470 }

◆ init()

ilTemplate::init ( )
protected

Clears all datafields of the object and rebuild the internal blocklist.

LoadTemplatefile() and setTemplate() automatically call this function when a new template is given. Don't use this function unless you know what you're doing.

@access public

See also
free()

Reimplemented from HTML_Template_ITX.

Definition at line 108 of file class.ilTemplate.php.

109 {
110 $this->free();
111 $this->buildFunctionlist();
112
113 $cache_hit = false;
114 if ($this->il_use_cache) {
115 // cache hit
116 if (isset(self::$il_cache[$this->il_cur_key]) && is_array(self::$il_cache[$this->il_cur_key])) {
117 $cache_hit = true;
118 //echo "cache hit";
119 $this->err = self::$il_cache[$this->il_cur_key]["err"];
120 $this->flagBlocktrouble = self::$il_cache[$this->il_cur_key]["flagBlocktrouble"];
121 $this->blocklist = self::$il_cache[$this->il_cur_key]["blocklist"];
122 $this->blockdata = self::$il_cache[$this->il_cur_key]["blockdata"];
123 $this->blockinner = self::$il_cache[$this->il_cur_key]["blockinner"];
124 $this->blockparents = self::$il_cache[$this->il_cur_key]["blockparents"];
125 $this->blockvariables = self::$il_cache[$this->il_cur_key]["blockvariables"];
126 }
127 }
128
129 if (!$cache_hit) {
130 $this->findBlocks($this->template);
131 $this->template = '';
132 $this->buildBlockvariablelist();
133 if ($this->il_use_cache) {
134 self::$il_cache[$this->il_cur_key]["err"] = $this->err;
135 self::$il_cache[$this->il_cur_key]["flagBlocktrouble"] = $this->flagBlocktrouble;
136 self::$il_cache[$this->il_cur_key]["blocklist"] = $this->blocklist;
137 self::$il_cache[$this->il_cur_key]["blockdata"] = $this->blockdata;
138 self::$il_cache[$this->il_cur_key]["blockinner"] = $this->blockinner;
139 self::$il_cache[$this->il_cur_key]["blockparents"] = $this->blockparents;
140 self::$il_cache[$this->il_cur_key]["blockvariables"] = $this->blockvariables;
141 }
142 }
143
144 // we don't need it any more
145 $this->template = '';
146 } // end func init
buildFunctionlist()
Builds a functionlist from the template.
Definition: ITX.php:591
findBlocks($string)
Recusively builds a list of all blocks within the template.
Definition: IT.php:865
free()
Clears all datafields of the object.
Definition: IT.php:716
buildBlockvariablelist()
Build a list of all variables within of a block.
Definition: IT.php:824

References HTML_Template_IT\$blockdata, HTML_Template_IT\$blockinner, HTML_Template_IT\$blocklist, HTML_Template_IT\$blockparents, HTML_Template_IT\$blockvariables, HTML_Template_IT\$err, HTML_Template_IT\$flagBlocktrouble, $il_cur_key, HTML_Template_IT\buildBlockvariablelist(), HTML_Template_ITX\buildFunctionlist(), HTML_Template_IT\findBlocks(), and HTML_Template_IT\free().

+ Here is the call graph for this function:

◆ loadStandardTemplate()

ilTemplate::loadStandardTemplate ( )

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 521 of file class.ilTemplate.php.

522 {
523 // TODO: Implement loadStandardTemplate() method.
524 }

◆ loadTemplatefile()

ilTemplate::loadTemplatefile (   $filename,
  $removeUnknownVariables = true,
  $removeEmptyBlocks = true 
)

Reads a template file from the disk.

overwrites IT:loadTemplateFile to include the template input hook

Parameters
stringname of the template file
boolhow to handle unknown variables.
boolhow to handle empty blocks. @access public
Returns
boolean false on failure, otherwise true
See also
$template, setTemplate(), $removeUnknownVariables, $removeEmptyBlocks

Reimplemented from HTML_Template_IT.

Reimplemented in ilIndependantTemplate.

Definition at line 354 of file class.ilTemplate.php.

358 {
359 global $DIC;
360
361 // copied from IT:loadTemplateFile
362 $template = '';
363 if (!$this->flagCacheTemplatefile ||
364 $this->lastTemplatefile != $filename
365 ) {
366 $template = $this->getFile($filename);
367 }
368 $this->lastTemplatefile = $filename;
369 // copied.
370
371 // new code to include the template input hook:
372 $ilPluginAdmin = $DIC["ilPluginAdmin"];
373 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
374 foreach ($pl_names as $pl) {
375 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
376 $gui_class = $ui_plugin->getUIClassInstance();
377
378 $resp = $gui_class->getHTML(
379 "",
380 "template_load",
381 array("tpl_id" => $this->tplIdentifier, "tpl_obj" => $this, "html" => $template)
382 );
383
384 if ($resp["mode"] != ilUIHookPluginGUI::KEEP) {
385 $template = $gui_class->modifyHTML($template, $resp);
386 }
387 }
388 // new.
389
390 // copied from IT:loadTemplateFile
391 return $template != '' ?
392 $this->setTemplate(
393 $template,
396 ) : false;
397 // copied.
398 }
$removeEmptyBlocks
Definition: IT.php:202
$removeUnknownVariables
Definition: IT.php:195
setTemplate( $template, $removeUnknownVariables=true, $removeEmptyBlocks=true)
Sets the template.
Definition: IT.php:743

References $DIC, $filename, HTML_Template_IT\$removeEmptyBlocks, HTML_Template_IT\$removeUnknownVariables, XapiProxy\$resp, HTML_Template_IT\$template, HTML_Template_IT\getFile(), ilPluginAdmin\getPluginObject(), IL_COMP_SERVICE, ilUIHookPluginGUI\KEEP, and HTML_Template_IT\setTemplate().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseCurrentBlock() [1/2]

ilTemplate::parseCurrentBlock (   $part = "DEFAULT")

Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt @access public.

Parameters
string
Returns
string

Implements ilGlobalTemplateInterface.

Definition at line 247 of file class.ilTemplate.php.

248 {
249 // Hier erst noch ein replace aufrufen
250 if ($part != "DEFAULT") {
251 $tmp = $this->activeBlock;
252 $this->activeBlock = $part;
253 }
254
255 if ($part != "DEFAULT") {
256 $this->activeBlock = $tmp;
257 }
258
259 $this->fillVars();
260
261 $this->activeBlock = "__global__";
262
263 if ($part == "DEFAULT") {
264 return parent::parseCurrentBlock();
265 } else {
266 return parent::parseCurrentBlock($part);
267 }
268 }
fillVars()
all template vars defined in $vars will be replaced automatically without setting and parsing them wi...

References $activeBlock, and fillVars().

Referenced by ilCalendarBlockGUI\addConsultationHourButtons(), ilContainerRenderer\addHeaderRow(), ilContainerRenderer\addSeparatorRow(), ilContainerRenderer\addStandardRow(), ilCalendarBlockGUI\addSubscriptionButton(), ilChatroomAuthInputGUI\insert(), ilOrgUnitAuthorityInputGUI\insert(), ilCaptchaInputGUI\insert(), ilEMailInputGUI\insert(), ilClozeGapInputBuilderGUI\insert(), ilContainerRenderer\renderDetails(), ilContainerRenderer\renderHelperGeneric(), ilSurveyPageGUI\renderPageNode(), and ilContainerRenderer\renderSelectAllBlock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseCurrentBlock() [2/2]

ilTemplate::parseCurrentBlock (   $part = "DEFAULT")

Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt @access public.

Parameters
string
Returns
string

Implements ilGlobalTemplateInterface.

Definition at line 299 of file class.ilTemplate.php.

300 {
301 // Hier erst noch ein replace aufrufen
302 if ($part != "DEFAULT") {
303 $tmp = $this->activeBlock;
304 $this->activeBlock = $part;
305 }
306
307 if ($part != "DEFAULT") {
308 $this->activeBlock = $tmp;
309 }
310
311 //$this->fillVars();
312
313 $this->activeBlock = "__global__";
314
315 if ($part == "DEFAULT") {
316 return parent::parseCurrentBlock();
317 } else {
318 return parent::parseCurrentBlock($part);
319 }
320 }

References $activeBlock.

◆ printToStdout()

ilTemplate::printToStdout (   $part = "DEFAULT",
  $a_fill_tabs = true,
  $a_skip_main_menu = false 
)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 680 of file class.ilTemplate.php.

681 {
682 // TODO: Implement printToStdout() method.
683 }

◆ printToString()

ilTemplate::printToString ( )

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 84 of file class.ilTemplate.php.

84 : string
85 {
86 throw new ilException('not implemented');
87 }
Base class for ILIAS Exception handling.

◆ resetHeaderBlock()

ilTemplate::resetHeaderBlock (   $a_reset_header_action = true)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 722 of file class.ilTemplate.php.

723 {
724 // TODO: Implement resetHeaderBlock() method.
725 }

◆ resetJavascript()

ilTemplate::resetJavascript ( )

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 497 of file class.ilTemplate.php.

498 {
499 // TODO: Implement resetJavascript() method.
500 }

◆ setAlertProperties()

ilTemplate::setAlertProperties ( array  $a_props)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 557 of file class.ilTemplate.php.

558 {
559 // TODO: Implement setAlertProperties() method.
560 }

◆ setBodyClass()

ilTemplate::setBodyClass (   $a_class = "")

Implements ilGlobalTemplateInterface.

Definition at line 512 of file class.ilTemplate.php.

513 {
514 // TODO: Implement setBodyClass() method.
515 }

◆ setContent()

ilTemplate::setContent (   $a_html)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 620 of file class.ilTemplate.php.

621 {
622 // TODO: Implement setContent() method.
623 }

◆ setCurrentBlock() [1/2]

ilTemplate::setCurrentBlock (   $part = "DEFAULT")

Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.

@access public

Parameters
string
Returns
???

Implements ilGlobalTemplateInterface.

Definition at line 213 of file class.ilTemplate.php.

214 {
215 $this->activeBlock = $part;
216
217 if ($part == "DEFAULT") {
218 return parent::setCurrentBlock();
219 } else {
220 return parent::setCurrentBlock($part);
221 }
222 }

Referenced by ilCalendarBlockGUI\addConsultationHourButtons(), ilContainerRenderer\addHeaderRow(), ilContainerRenderer\addSeparatorRow(), ilContainerRenderer\addStandardRow(), ilCalendarBlockGUI\addSubscriptionButton(), fillCssFiles(), fillJavaScriptFiles(), ilChatroomAuthInputGUI\insert(), ilOrgUnitAuthorityInputGUI\insert(), ilCaptchaInputGUI\insert(), ilEMailInputGUI\insert(), ilClozeGapInputBuilderGUI\insert(), ilContainerRenderer\renderDetails(), ilContainerRenderer\renderHelperGeneric(), ilSurveyPageGUI\renderPageNode(), ilContainerRenderer\renderSelectAllBlock(), and touchBlock().

+ Here is the caller graph for this function:

◆ setCurrentBlock() [2/2]

ilTemplate::setCurrentBlock (   $part = "DEFAULT")

Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.

@access public

Parameters
string
Returns
???

Implements ilGlobalTemplateInterface.

Definition at line 265 of file class.ilTemplate.php.

266 {
267 $this->activeBlock = $part;
268
269 if ($part == "DEFAULT") {
270 return parent::setCurrentBlock();
271 } else {
272 return parent::setCurrentBlock($part);
273 }
274 }

◆ setDescription()

ilTemplate::setDescription (   $a_descr)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 539 of file class.ilTemplate.php.

540 {
541 // TODO: Implement setDescription() method.
542 }

◆ setHeaderActionMenu()

ilTemplate::setHeaderActionMenu (   $a_header)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 575 of file class.ilTemplate.php.

576 {
577 // TODO: Implement setHeaderActionMenu() method.
578 }

◆ setHeaderPageTitle()

ilTemplate::setHeaderPageTitle (   $a_title)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 584 of file class.ilTemplate.php.

585 {
586 // TODO: Implement setHeaderPageTitle() method.
587 }

◆ setLeftContent()

ilTemplate::setLeftContent (   $a_html)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 629 of file class.ilTemplate.php.

630 {
631 // TODO: Implement setLeftContent() method.
632 }

◆ setLeftNavContent()

ilTemplate::setLeftNavContent (   $a_content)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 638 of file class.ilTemplate.php.

639 {
640 // TODO: Implement setLeftNavContent() method.
641 }

◆ setLocator()

ilTemplate::setLocator ( )

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 593 of file class.ilTemplate.php.

594 {
595 // TODO: Implement setLocator() method.
596 }

◆ setLoginTargetPar()

ilTemplate::setLoginTargetPar (   $a_val)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 662 of file class.ilTemplate.php.

663 {
664 // TODO: Implement setLoginTargetPar() method.
665 }

◆ setOnScreenMessage()

ilTemplate::setOnScreenMessage (   $a_type,
  $a_txt,
  $a_keep = false 
)

Set message.

Please use ilUtil::sendInfo(), ilUtil::sendSuccess() and ilUtil::sendFailure()

Implements ilGlobalTemplateInterface.

Definition at line 325 of file class.ilTemplate.php.

326 {
327 if (!in_array($a_type, array("info", "success", "failure", "question")) || $a_txt == "") {
328 return;
329 }
330 if ($a_type == "question") {
331 $a_type = "mess_question";
332 }
333 if (!$a_keep) {
334 $this->message[$a_type] = $a_txt;
335 } else {
336 ilSession::set($a_type, $a_txt);
337 }
338 }
static set($a_var, $a_val)
Set a value.

References $a_type, and ilSession\set().

+ Here is the call graph for this function:

◆ setPageFormAction()

ilTemplate::setPageFormAction (   $a_action)

Implements ilGlobalTemplateInterface.

Definition at line 653 of file class.ilTemplate.php.

654 {
655 // TODO: Implement setPageFormAction() method.
656 }

◆ setPermanentLink()

ilTemplate::setPermanentLink (   $a_type,
  $a_id,
  $a_append = "",
  $a_target = "",
  $a_title = "" 
)

Implements ilGlobalTemplateInterface.

Definition at line 713 of file class.ilTemplate.php.

714 {
715 // TODO: Implement setPermanentLink() method.
716 }

◆ setRightContent()

ilTemplate::setRightContent (   $a_html)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 647 of file class.ilTemplate.php.

648 {
649 // TODO: Implement setRightContent() method.
650 }

◆ setSubTabs()

ilTemplate::setSubTabs (   $a_tabs_html)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 611 of file class.ilTemplate.php.

612 {
613 // TODO: Implement setSubTabs() method.
614 }

◆ setTabs()

ilTemplate::setTabs (   $a_tabs_html)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 602 of file class.ilTemplate.php.

603 {
604 // TODO: Implement setTabs() method.
605 }

◆ setTitle()

ilTemplate::setTitle (   $a_title,
  $hidden = false 
)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 530 of file class.ilTemplate.php.

531 {
532 // TODO: Implement setTitle() method.
533 }

◆ setTitleIcon()

ilTemplate::setTitleIcon (   $a_icon_path,
  $a_icon_desc = "" 
)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 548 of file class.ilTemplate.php.

549 {
550 // TODO: Implement setTitleIcon() method.
551 }

◆ setTreeFlatIcon()

ilTemplate::setTreeFlatIcon (   $a_link,
  $a_mode 
)

@inheritDoc

Implements ilGlobalTemplateInterface.

Definition at line 689 of file class.ilTemplate.php.

690 {
691 // TODO: Implement setTreeFlatIcon() method.
692 }

◆ show()

ilTemplate::show (   $part = "DEFAULT")

@access public

Parameters
string

Reimplemented from HTML_Template_IT.

Definition at line 153 of file class.ilTemplate.php.

154 {
155 header('Content-type: text/html; charset=UTF-8');
156
157 $this->fillJavaScriptFiles();
158 $this->fillCssFiles();
159
160 // ERROR HANDLER SETS $_GET["message"] IN CASE OF $error_obj->MESSAGE
161 $ms = array("info", "success", "failure", "question");
162 $out = "";
163
164 foreach ($ms as $m) {
165 if ($m == "question") {
166 $m = "mess_question";
167 }
168
169 $txt = (ilSession::get($m) != "")
170 ? ilSession::get($m)
171 : $this->message[$m];
172
173 if ($m == "mess_question") {
174 $m = "question";
175 }
176
177 if ($txt != "") {
178 $out .= $this->getMessageHTML($txt, $m);
179 }
180
181 if ($m == "question") {
182 $m = "mess_question";
183 }
184
185 if (ilSession::get($m)) {
187 }
188 }
189
190 if ($this->blockExists("MESSAGE") && $out != "") {
191 $this->setVariable("MESSAGE", $out);
192 }
193
194 if ($part == "DEFAULT") {
195 parent::show();
196 } else {
197 parent::show($part);
198 }
199
200 if (((substr(strrchr($_SERVER["PHP_SELF"], "/"), 1) != "error.php")
201 && (substr(strrchr($_SERVER["PHP_SELF"], "/"), 1) != "adm_menu.php"))) {
202 ilSession::set("post_vars", $_POST);
203
204 // referer is modified if query string contains cmd=gateway and $_POST is not empty.
205 // this is a workaround to display formular again in case of error and if the referer points to another page
206 $url_parts = parse_url($_SERVER["REQUEST_URI"]);
207 if (!$url_parts) {
208 $protocol = (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://';
209 $host = $_SERVER['HTTP_HOST'];
210 $path = $_SERVER['REQUEST_URI'];
211 $url_parts = @parse_url($protocol . $host . $path);
212 }
213
214 if (preg_match("/cmd=gateway/", $url_parts["query"])) {
215 foreach ($_POST as $key => $val) {
216 if (is_array($val)) {
217 $val = key($val);
218 }
219
220 $str .= "&" . $key . "=" . $val;
221 }
222
224 "referer",
225 preg_replace("/cmd=gateway/", substr($str, 1), $_SERVER["REQUEST_URI"])
226 );
228 "referer_ref_id",
229 (int) $_GET['ref_id']
230 );
231 } else {
232 ilSession::set("referer", $_SERVER["REQUEST_URI"]);
234 "referer_ref_id",
235 (int) $_GET['ref_id']
236 );
237 }
238
239 ilSession::clear("error_post_vars");
240 }
241 }
$_POST["username"]
show()
returns the content of IniFile @access public
fillJavaScriptFiles($force=true)
fillCssFiles($a_force=false)
Fill in the css file tags.
getMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10

References $_GET, $_POST, $_SERVER, $out, $txt, blockExists(), ilSession\clear(), fillCssFiles(), fillJavaScriptFiles(), ilSession\get(), getMessageHTML(), ilSession\set(), ilGlobalTemplateInterface\setVariable(), and show().

+ Here is the call graph for this function:

◆ touchBlock() [1/2]

ilTemplate::touchBlock (   $block)

overwrites ITX::touchBlock.

@access public

Parameters
string
Returns
???

Implements ilGlobalTemplateInterface.

Definition at line 230 of file class.ilTemplate.php.

231 {
232 $this->setCurrentBlock($block);
233 $count = $this->fillVars();
234 $this->parseCurrentBlock();
235
236 if ($count == 0) {
237 parent::touchBlock($block);
238 }
239 }

References fillVars(), HTML_Template_IT\parseCurrentBlock(), and setCurrentBlock().

Referenced by ilCalendarBlockGUI\addConsultationHourButtons(), ilContainerRenderer\addHeaderRow(), ilContainerRenderer\addStandardRow(), and ilSurveyPageGUI\renderPageNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ touchBlock() [2/2]

ilTemplate::touchBlock (   $block)

overwrites ITX::touchBlock.

@access public

Parameters
string
Returns
???

Implements ilGlobalTemplateInterface.

Definition at line 282 of file class.ilTemplate.php.

283 {
284 $this->setCurrentBlock($block);
285 //$count = $this->fillVars();
286 $this->parseCurrentBlock();
287
288 if ($count == 0) {
289 parent::touchBlock($block);
290 }
291 }

References HTML_Template_IT\parseCurrentBlock(), and setCurrentBlock().

+ Here is the call graph for this function:

◆ variableExists()

ilTemplate::variableExists (   $a_variablename)

Definition at line 507 of file class.ilTemplate.php.

508 {
509 return (isset($this->blockvariables["content"][$a_variablename]) ? true : false);
510 }

Field Documentation

◆ $activeBlock

ilTemplate::$activeBlock

Definition at line 27 of file class.ilTemplate.php.

Referenced by parseCurrentBlock().

◆ $css_files

ilTemplate::$css_files = array()

Definition at line 22 of file class.ilTemplate.php.

◆ $il_cache

ilTemplate::$il_cache = array()
staticprotected

Definition at line 32 of file class.ilTemplate.php.

◆ $il_cur_key

ilTemplate::$il_cur_key
protected

Definition at line 42 of file class.ilTemplate.php.

Referenced by init().

◆ $il_use_cache

ilTemplate::$il_use_cache
protected

Definition at line 37 of file class.ilTemplate.php.

◆ $js_files

ilTemplate::$js_files = array()

Definition at line 21 of file class.ilTemplate.php.

◆ $tplIdentifier

ilTemplate::$tplIdentifier
protected

Definition at line 57 of file class.ilTemplate.php.

◆ $tplName

ilTemplate::$tplName
protected

Definition at line 47 of file class.ilTemplate.php.

◆ $tplPath

ilTemplate::$tplPath
protected

Definition at line 52 of file class.ilTemplate.php.

Referenced by __construct().

◆ $vars

ilTemplate::$vars

Definition at line 19 of file class.ilTemplate.php.


The documentation for this class was generated from the following files: