ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ($file, $flag1, $flag2, $in_module=false, $vars="DEFAULT", $plugin=false, $a_use_cache=false)
 constructor More...
 
 init ()
 Clears all datafields of the object and rebuild the internal blocklist. More...
 
 setAddFooter ($value)
 
 getAddFooter ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 get ($part="DEFAULT", $add_error_mess=false, $handle_referer=false, $add_ilias_footer=false, $add_standard_elements=false, $a_main_menu=true, $a_tabs=true)
 ??? @access public More...
 
 setMessage ($a_type, $a_txt, $a_keep=false)
 Set message. More...
 
 hasMessage ($a_type)
 
 fillMessage ()
 
 getMessageHTML ($a_txt, $a_type="info")
 Get HTML for a system message. More...
 
 getContentType ()
 Get the content type for the template output. More...
 
 setContentType ($a_content_type="text/html")
 Set the content type for the template output. More...
 
 show ($part="DEFAULT", $a_fill_tabs=true, $a_skip_main_menu=false)
 @access public More...
 
 fillContentLanguage ()
 Add current user language to meta tags. More...
 
 fillWindowTitle ()
 
 getTabsHTML ()
 Get tabs HTML. More...
 
 fillTabs ()
 
 fillToolbar ()
 
 fillPageFormAction ()
 
 fillJavaScriptFiles ($a_force=false)
 
 fillCssFiles ($a_force=false)
 Fill in the css file tags. More...
 
 fillInlineCss ()
 Fill in the inline css. More...
 
 setContentStyleSheet ($a_style)
 Set content style (used for page content editor) More...
 
 fillContentStyle ()
 Fill Content Style. More...
 
 getMainMenu ()
 
 fillMainMenu ()
 
 initHelp ()
 Init help. More...
 
 addILIASFooter ()
 add ILIAS footer More...
 
 handleReferer ()
 TODO: this is nice, but shouldn't be done here (-> maybe at the end of ilias.php!?, alex) More...
 
 blockExists ($a_blockname)
 check if block exists in actual template @access private More...
 
 fillVars ()
 all template vars defined in $vars will be replaced automatically without setting and parsing them with setVariable & parseCurrentBlock @access private 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...
 
 replaceFromDatabase (&$DB, $block, $conv, $select="default")
 ??? TODO: Adjust var names to ilias. More...
 
 prepareForFormular ($vars)
 Wird angewendet, wenn die Daten in ein Formular replaced werden sollen, Dann wird erst noch ein htmlspecialchars drumherum gemacht. More...
 
 replace ()
 ??? @access public More...
 
 replaceDefault ()
 ??? @access public More...
 
 checkTopic ($a_block, $a_topic)
 checks for a topic in the template @access private More...
 
 includeNavigation ()
 check if there is a NAVIGATION-topic @access public More...
 
 includeTree ()
 check if there is a TREE-topic @access public More...
 
 fileExists ($filename)
 check if a file exists @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...
 
 getTemplatePath ($a_tplname, $a_in_module=false, $a_plugin=false)
 builds a full template path with template and module name More...
 
 getTemplateIdentifier ($a_tplname, $a_in_module=false)
 get a unique template identifier More...
 
 setHeaderPageTitle ($a_title)
 
 setStyleSheetLocation ($a_stylesheet)
 
 setNewContentStyleSheetLocation ($a_stylesheet)
 
 getStandardTemplate ()
 
 setTitle ($a_title)
 sets title in standard template More...
 
 setTitleUrl ($a_url)
 sets title url in standard template More...
 
 setTitleColor ($a_val)
 Set title color. More...
 
 getTitleColor ()
 Get title color. More...
 
 setAlertProperties (array $a_props)
 Set alert properties. More...
 
 clearHeader ()
 Clear header. More...
 
 setTitleIcon ($a_icon_path, $a_icon_desc="")
 set title icon More...
 
 setBodyClass ($a_class="")
 
 fillBodyClass ()
 
 setPageFormAction ($a_action)
 
 setDescription ($a_descr)
 sets title in standard template More...
 
 stopTitleFloating ()
 set stop floating (if no tabs are used) More...
 
 setHeaderActionMenu ($a_header)
 Set header action menu. More...
 
 getHeaderActionMenu ()
 Get header action menu. More...
 
 setContent ($a_html)
 sets content for standard template More...
 
 fillMainContent ()
 Fill main content. More...
 
 setRightContent ($a_html)
 sets content of right column More...
 
 setLeftContent ($a_html)
 sets content of left column More...
 
 setLeftNavContent ($a_content)
 Sets content of left navigation column. More...
 
 fillLeftNav ()
 Fill left navigation frame. 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...
 
 setUpperIcon ($a_link, $a_frame="")
 sets icon to upper level More...
 
 setLoginTargetPar ($a_val)
 Set target parameter for login (public sector). More...
 
 getLoginTargetPar ()
 Get target parameter for login. More...
 
 fillScreenReaderFocus ()
 Accessibility focus for screen readers. More...
 
 fillSideIcons ()
 Fill side icons (upper icon, tree icon, webfolder icon) More...
 
 setMountWebfolderIcon ($a_ref_id)
 shows icon for mounting a webfolder More...
 
 setTreeFlatIcon ($a_link, $a_mode)
 set tree/flat icon 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...
 
 resetJavascript ()
 Reset javascript files. More...
 
 resetCss ()
 Reset css files. More...
 
 addOnLoadCode ($a_code, $a_batch=2)
 Add on load code. More...
 
 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...
 
 addLightbox ($a_html, $a_id)
 Add lightbox html. More...
 
 fillLightbox ()
 Fill lightbox content. More...
 
 setPageActions ($a_page_actions_html)
 Show admin view button. More...
 
 setEditPageButton ($a_link, $a_txt, $a_frame)
 Show admin view button. More...
 
 addAdminPanelCommand ($a_cmd, $a_txt, $a_arrow=false)
 Add a command to the admin panel. More...
 
 addAdminPanelToolbar (ilToolbarGUI $toolb, $a_bottom_panel=true, $a_arrow=false)
 Add admin panel commands as toolbar. More...
 
 fillAdminPanel ()
 Put admin panel into template: More...
 
 setPermanentLink ($a_type, $a_id, $a_append="", $a_target="", $a_title="")
 
 fillPermanentLink ()
 Fill in permanent link. More...
 
 fillOnLoadCode ()
 Fill add on load code. More...
 
 getOnLoadCodeForAsynch ()
 Get js onload code for ajax calls. More...
 
 setBackgroundColor ($a_bg_color)
 
 setBanner ($a_img, $a_width=1370, $a_height=100, $a_export=false)
 Set banner. More...
 
 resetHeaderBlock ($a_reset_header_action=true)
 Set variable. More...
 
 enableDragDropFileUpload ($a_ref_id)
 Enables the file upload into this object by dropping a file. More...
 
 __construct ($file, $flag1, $flag2, $in_module=false, $vars="DEFAULT")
 constructor 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)
 
 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...
 
 setMessage ($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)
 Add a javascript file that should be included in the header. More...
 
 fillJavaScriptFiles ()
 
 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")
 Returns a block with all replacements done. More...
 
- Public Member Functions inherited from HTML_Template_ITX
 __construct ($root='')
 Builds some complex regexps and calls the constructor of the parent class. More...
 
 init ()
 Clears all datafields of the object and rebuild the internal blocklist. 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...
 
 init ()
 Clears all datafields of the object and rebuild the internal blocklist. 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...
 

Static Public Member Functions

static buildLoginTarget ()
 Add current object (repository/workspace) as target for login url. More...
 

Data Fields

 $contenttype
 
 $vars
 
 $activeBlock
 
 $js_files = array(0 => "./Services/JavaScript/js/Basic.js")
 
 $js_files_vp = array("./Services/JavaScript/js/Basic.js" => true)
 
 $js_files_batch = array("./Services/JavaScript/js/Basic.js" => 1)
 
 $css_files = array()
 
 $inline_css = array()
 
 $admin_panel_commands = 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()
 
 $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

 fillJavascriptFile ($file, $vers)
 

Protected Attributes

 $message = array()
 
 $title_desc = ""
 
 $title_url = ""
 
 $upper_icon = ""
 
 $tree_flat_link = ""
 
 $mount_webfolder = ""
 
 $stop_floating = ""
 
 $page_form_action = ""
 
 $page_actions = array()
 
 $permanent_link = false
 
 $content_style_sheet = ""
 
 $title_alerts = array()
 
 $header_action
 
 $lightbox = array()
 
 $standard_template_loaded = false
 
 $translation_linked = false
 

Static Protected Attributes

static $il_cache = array()
 

Private Member Functions

 fillNewContentStyle ()
 Fill Content Style. More...
 
 variableExists ($a_variablename)
 
 fillHeader ()
 Fill header. More...
 
 fillStopFloating ()
 stop floating More...
 
 fillRightContent ()
 Fill right content. More...
 
 setCenterColumnClass ()
 
 fillLeftContent ()
 Fill left content. More...
 

Private Attributes

 $addFooter
 

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 (   $file,
  $flag1,
  $flag2,
  $in_module = false,
  $vars = "DEFAULT",
  $plugin = false,
  $a_use_cache = false 
)

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 73 of file class.ilTemplate.php.

75 {
76 global $ilias;
77//echo "<br>-".$file."-";
78
79 $this->activeBlock = "__global__";
80 $this->vars = array();
81 $this->addFooter = TRUE;
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 // template identifier e.g. "Services/Calendar/tpl.minical.html"
91 $this->tplIdentifier = $this->getTemplateIdentifier($file, $in_module);
92
93 // set default content-type to text/html
94 $this->contenttype = "text/html";
95 if (!file_exists($fname))
96 {
97 $ilias->raiseError("template ".$fname." was not found.", $ilias->error_obj->FATAL);
98 return false;
99 }
100
101 //$this->IntegratedTemplateExtension(dirname($fname));
102 parent::__construct();
103 //$this->loadTemplatefile(basename($fname), $flag1, $flag2);
104 $this->loadTemplatefile($fname, $flag1, $flag2);
105 //add tplPath to replacevars
106 $this->vars["TPLPATH"] = $this->tplPath;
107
108 // set Options
109 if (method_exists($this, "setOption"))
110 {
111 $this->setOption('use_preg', false);
112 }
113 $this->setBodyClass("std");
114
115 return true;
116 }
setOption($option, $value)
Sets the option for the template class.
Definition: IT.php:397
loadTemplatefile( $filename, $removeUnknownVariables=true, $removeEmptyBlocks=true)
Reads a template file from the disk.
setBodyClass($a_class="")
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
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file

References $file, getTemplateIdentifier(), getTemplatePath(), loadTemplatefile(), setBodyClass(), 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 {
63 die("template ".$fname." was not found.");
64 return false;
65 }
66
67 //$this->IntegratedTemplateExtension(dirname($fname));
68 parent::__construct();
69 //$this->loadTemplatefile(basename($fname), $flag1, $flag2);
70 $this->loadTemplatefile($fname, $flag1, $flag2);
71 //add tplPath to replacevars
72 $this->vars["TPLPATH"] = $this->tplPath;
73
74 // set Options
75 if (method_exists($this, "setOption"))
76 {
77 $this->setOption('use_preg', false);
78 }
79
80 return true;
81 }

References $file, getTemplatePath(), loadTemplatefile(), and HTML_Template_IT\setOption().

+ Here is the call graph for this function:

Member Function Documentation

◆ addAdminPanelCommand()

ilTemplate::addAdminPanelCommand (   $a_cmd,
  $a_txt,
  $a_arrow = false 
)

Add a command to the admin panel.

Deprecated:
use addAdminPanelToolbar

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

2335 {
2336 $this->admin_panel_commands[] =
2337 array("cmd" => $a_cmd, "txt" => $a_txt);
2338 if ($a_arrow)
2339 {
2340 $this->admin_panel_arrow = true;
2341 }
2342 $this->admin_panel_top_only = false;
2343 }

◆ addAdminPanelToolbar()

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

Add admin panel commands as toolbar.

Parameters
ilToolbarGUI$toolb
bool$a_top_only

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

2351 {
2352 $this->admin_panel_commands_toolbar = $toolb;
2353 $this->admin_panel_arrow = $a_arrow;
2354 $this->admin_panel_bottom = $a_bottom_panel;
2355 }

◆ 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

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

1377 {
1378 if (DEBUG)
1379 {
1380 echo "<br/>Template '".$this->tplPath."/".$tplname."'";
1381 }
1382
1383 $tplfile = $this->getTemplatePath($tplname, $in_module);
1384 if (file_exists($tplfile) == false)
1385 {
1386 echo "<br/>Template '".$tplfile."' doesn't exist! aborting...";
1387 return false;
1388 }
1389
1390 $id = $this->getTemplateIdentifier($tplname, $in_module);
1391 $template = $this->getFile($tplfile);
1392
1393 // include the template input hook
1394 global $ilPluginAdmin;
1395 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
1396 foreach ($pl_names as $pl)
1397 {
1398 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
1399 $gui_class = $ui_plugin->getUIClassInstance();
1400
1401 $resp = $gui_class->getHTML("", "template_add",
1402 array("tpl_id" => $id, "tpl_obj" => $this, "html" => $template));
1403
1404 if ($resp["mode"] != ilUIHookPluginGUI::KEEP)
1405 {
1406 $template = $gui_class->modifyHTML($template, $resp);
1407 }
1408 }
1409
1410 return $this->addBlock($var, $block, $template);
1411 }
addBlock($placeholder, $blockname, $template)
Adds a block to the template changing a variable placeholder to a block placeholder.
Definition: ITX.php:243
getFile($filename)
Reads a file from disk and returns its content.
Definition: IT.php:905
const IL_COMP_SERVICE
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
const DEBUG

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

Referenced by getStandardTemplate().

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

◆ addBlockFile() [2/2]

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

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

140 {
141 if (DEBUG)
142 {
143 echo "<br/>Template '".$this->tplPath."/".$tplname."'";
144 }
145
146 $tplfile = $this->getTemplatePath($tplname, $in_module);
147 if (file_exists($tplfile) == false)
148 {
149 echo "<br/>Template '".$tplfile."' doesn't exist! aborting...";
150 return false;
151 }
152
153 return parent::addBlockFile($var, $block, $tplfile);
154 }

References DEBUG, and getTemplatePath().

+ Here is the call graph for this function:

◆ addCss() [1/2]

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

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

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

2273 {
2274 if (!array_key_exists($a_css_file . $media, $this->css_files))
2275 {
2276 $this->css_files[$a_css_file . $media] = array("file" => $a_css_file, "media" => $media);
2277 }
2278 }

◆ addCss() [2/2]

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

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

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

466 {
467 if (!array_key_exists($a_css_file . $media, $this->css_files))
468 {
469 $this->css_files[$a_css_file . $media] = array("file" => $a_css_file, "media" => $media);
470 }
471 }

◆ addILIASFooter()

ilTemplate::addILIASFooter ( )

add ILIAS footer

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

863 {
864 global $ilAuth;
865
866 if (!$this->getAddFooter()) return;
867 global $ilias, $ilClientIniFile, $ilCtrl, $ilDB, $ilSetting, $lng;
868
869 $ftpl = new ilTemplate("tpl.footer.html", true, true, "Services/UICore");
870
871 $php = "";
872 if (DEVMODE)
873 {
874 $php = ", PHP ".phpversion();
875 }
876 $ftpl->setVariable("ILIAS_VERSION", $ilias->getSetting("ilias_version").$php);
877
878 $link_items = array();
879
880 // imprint
881 include_once "Services/Imprint/classes/class.ilImprint.php";
882 if($_REQUEST["baseClass"] != "ilImprintGUI" && ilImprint::isActive())
883 {
884 include_once "Services/Link/classes/class.ilLink.php";
885 $link_items[ilLink::_getStaticLink(0, "impr")] = array($lng->txt("imprint"), true);
886 }
887
888 // system support contacts
889 include_once("./Modules/SystemFolder/classes/class.ilSystemSupportContactsGUI.php");
891 {
892 $link_items[$l] = array(ilSystemSupportContactsGUI::getFooterText(), false);
893 }
894
895 if (DEVMODE)
896 {
897 if (function_exists("tidy_parse_string"))
898 {
899 $link_items[ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=xhtml")] = array("Validate", true);
900 $link_items[ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=accessibility")] = array("Accessibility", true);
901 }
902 }
903
904 // output translation link
905 include_once("Services/Language/classes/class.ilObjLanguageAccess.php");
907 {
908 // fix #9992: remember linked translation instead of saving language usages here
909 $this->translation_linked = true;
910 $link_items[ilObjLanguageAccess::_getTranslationLink()] = array($lng->txt('translation'), true);
911 }
912
913 $cnt = 0;
914 foreach($link_items as $url => $caption)
915 {
916 $cnt ++;
917 if($caption[1])
918 {
919 $ftpl->touchBlock("blank");
920 }
921 if($cnt < sizeof($link_items))
922 {
923 $ftpl->touchBlock("item_separator");
924 }
925
926 $ftpl->setCurrentBlock("items");
927 $ftpl->setVariable("URL_ITEM", ilUtil::secureUrl($url));
928 $ftpl->setVariable("TXT_ITEM", $caption[0]);
929 $ftpl->parseCurrentBlock();
930 }
931
932 if (DEVMODE)
933 {
934 // execution time
935 $t1 = explode(" ", $GLOBALS['ilGlobalStartTime']);
936 $t2 = explode(" ", microtime());
937 $diff = $t2[0] - $t1[0] + $t2[1] - $t1[1];
938
939 $mem_usage = array();
940 if(function_exists("memory_get_usage"))
941 {
942 $mem_usage[] =
943 "Memory Usage: ".memory_get_usage()." Bytes";
944 }
945 if(function_exists("xdebug_peak_memory_usage"))
946 {
947 $mem_usage[] =
948 "XDebug Peak Memory Usage: ".xdebug_peak_memory_usage()." Bytes";
949 }
950 $mem_usage[] = round($diff, 4)." Seconds";
951
952 if (sizeof($mem_usage))
953 {
954 $ftpl->setVariable("MEMORY_USAGE", "<br>".implode(" | ", $mem_usage));
955 }
956
957 if (!empty($_GET["do_dev_validate"]) && $ftpl->blockExists("xhtml_validation"))
958 {
959 require_once("Services/XHTMLValidator/classes/class.ilValidatorAdapter.php");
960 $template2 = clone($this);
961//echo "-".ilValidatorAdapter::validate($template2->get(), $_GET["do_dev_validate"])."-";
962 $ftpl->setCurrentBlock("xhtml_validation");
963 $ftpl->setVariable("VALIDATION",
964 ilValidatorAdapter::validate($template2->get("DEFAULT",
965 false, false, false, true), $_GET["do_dev_validate"]));
966 $ftpl->parseCurrentBlock();
967 }
968
969 // controller history
970 if (is_object($ilCtrl) && $ftpl->blockExists("c_entry") &&
971 $ftpl->blockExists("call_history"))
972 {
973 $hist = $ilCtrl->getCallHistory();
974 foreach($hist as $entry)
975 {
976 $ftpl->setCurrentBlock("c_entry");
977 $ftpl->setVariable("C_ENTRY", $entry["class"]);
978 if (is_object($ilDB))
979 {
980 $file = $ilCtrl->lookupClassPath($entry["class"]);
981 $add = $entry["mode"]." - ".$entry["cmd"];
982 if ($file != "")
983 {
984 $add.= " - ".$file;
985 }
986 $ftpl->setVariable("C_FILE", $add);
987 }
988 $ftpl->parseCurrentBlock();
989 }
990 $ftpl->setCurrentBlock("call_history");
991 $ftpl->parseCurrentBlock();
992
993 // debug hack
994 $debug = $ilCtrl->getDebug();
995 foreach($debug as $d)
996 {
997 $ftpl->setCurrentBlock("c_entry");
998 $ftpl->setVariable("C_ENTRY", $d);
999 $ftpl->parseCurrentBlock();
1000 }
1001 $ftpl->setCurrentBlock("call_history");
1002 $ftpl->parseCurrentBlock();
1003 }
1004
1005 // included files
1006 if (is_object($ilCtrl) && $ftpl->blockExists("i_entry") &&
1007 $ftpl->blockExists("included_files"))
1008 {
1009 $fs = get_included_files();
1010 $ifiles = array();
1011 $total = 0;
1012 foreach($fs as $f)
1013 {
1014 $ifiles[] = array("file" => $f, "size" => filesize($f));
1015 $total += filesize($f);
1016 }
1017 $ifiles = ilUtil::sortArray($ifiles, "size", "desc", true);
1018 foreach($ifiles as $f)
1019 {
1020 $ftpl->setCurrentBlock("i_entry");
1021 $ftpl->setVariable("I_ENTRY", $f["file"]." (".$f["size"]." Bytes, ".round(100 / $total * $f["size"], 2)."%)");
1022 $ftpl->parseCurrentBlock();
1023 }
1024 $ftpl->setCurrentBlock("i_entry");
1025 $ftpl->setVariable("I_ENTRY", "Total (".$total." Bytes, 100%)");
1026 $ftpl->parseCurrentBlock();
1027 $ftpl->setCurrentBlock("included_files");
1028 $ftpl->parseCurrentBlock();
1029 }
1030
1031 }
1032
1033 // BEGIN Usability: Non-Delos Skins can display the elapsed time in the footer
1034 // The corresponding $ilBench->start invocation is in inc.header.php
1035 global $ilBench;
1036 $ilBench->stop("Core", "ElapsedTimeUntilFooter");
1037 $ftpl->setVariable("ELAPSED_TIME",
1038 ", ".number_format($ilBench->getMeasuredTime("Core", "ElapsedTimeUntilFooter"),1).' seconds');
1039 // END Usability: Non-Delos Skins can display the elapsed time in the footer
1040
1041 $this->setVariable("FOOTER", $ftpl->get());
1042 }
for($col=0; $col< 50; $col++) $d
$total
Definition: Utf8Test.php:87
global $l
Definition: afr.php:30
$_GET["client_id"]
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
static isActive()
static _checkTranslate()
Permission check for translations.
static _isPageTranslation()
Check if the current request is a page translation.
static _getTranslationLink()
Get the link to translate the current page.
special template class to simplify handling of ITX/PEAR
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static secureUrl($url)
Prepare secure href attribute.
static validate($a_html, $a_mode)
$php
Definition: flush.php:22
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $ilBench
Definition: ilias.php:18
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
global $ilSetting
Definition: privfeed.php:17
$url
Definition: shib_logout.php:72
global $ilDB
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']

References $_GET, $_SERVER, $d, $file, $GLOBALS, $ilBench, $ilCtrl, $ilDB, $ilSetting, $l, $lng, $php, $total, $url, ilObjLanguageAccess\_checkTranslate(), ilLink\_getStaticLink(), ilObjLanguageAccess\_getTranslationLink(), ilObjLanguageAccess\_isPageTranslation(), ilUtil\appendUrlParameterString(), getAddFooter(), ilSystemSupportContactsGUI\getFooterLink(), ilSystemSupportContactsGUI\getFooterText(), ilImprint\isActive(), ilUtil\secureUrl(), HTML_Template_IT\setVariable(), ilUtil\sortArray(), and ilValidatorAdapter\validate().

Referenced by get(), and show().

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

◆ addInlineCss()

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

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

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

2284 {
2285 $this->inline_css[] = array("css" => $a_css, "media" => $media);
2286 }

◆ addJavaScript() [1/2]

ilTemplate::addJavaScript (   $a_js_file)

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

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

438 {
439 if (!in_array($a_js_file, $this->js_files))
440 {
441 $this->js_files[] = $a_js_file;
442 }
443 }

◆ addJavaScript() [2/2]

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

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

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

2211 {
2212 // three batches currently
2213 if ($a_batch < 1 || $a_batch > 3)
2214 {
2215 $a_batch = 2;
2216 }
2217
2218 // ensure jquery files being loaded first
2219 if (is_int(strpos($a_js_file, "Services/jQuery")) ||
2220 is_int(strpos($a_js_file, "/jquery.js")) ||
2221 is_int(strpos($a_js_file, "/jquery-min.js")))
2222 {
2223 $a_batch = 0;
2224 }
2225
2226 if (!in_array($a_js_file, $this->js_files))
2227 {
2228 $this->js_files[] = $a_js_file;
2229 $this->js_files_vp[$a_js_file] = $a_add_version_parameter;
2230 $this->js_files_batch[$a_js_file] = $a_batch;
2231 }
2232 }

◆ addLightbox()

ilTemplate::addLightbox (   $a_html,
  $a_id 
)

Add lightbox html.

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

2292 {
2293 $this->lightbox[$a_id] = $a_html;
2294 }

◆ addOnLoadCode()

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

Add on load code.

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

2260 {
2261 // three batches currently
2262 if ($a_batch < 1 || $a_batch > 3)
2263 {
2264 $a_batch = 2;
2265 }
2266 $this->on_load_code[$a_batch][] = $a_code;
2267 }

Referenced by ilWikiPageGUI\initEditingJS().

+ Here is the caller graph for this function:

◆ blockExists() [1/2]

ilTemplate::blockExists (   $a_blockname)

check if block exists in actual template @access private

Parameters
stringblockname
Returns
boolean

Reimplemented from HTML_Template_ITX.

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

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

Referenced by fillBodyClass(), fillCssFiles(), fillInlineCss(), fillJavaScriptFiles(), fillTabs(), get(), getTabsHTML(), ilTinyMCE\handleImgContextMenuItem(), setCenterColumnClass(), setTabs(), 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

Reimplemented from HTML_Template_ITX.

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

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

◆ buildLoginTarget()

static ilTemplate::buildLoginTarget ( )
static

Add current object (repository/workspace) as target for login url.

Returns
string

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

2546 {
2547 global $tree, $ilUser;
2548
2549 $target_str = "";
2550
2551 // repository
2552 if ($_GET["ref_id"] != "")
2553 {
2554 if ($tree->isInTree($_GET["ref_id"]) && $_GET["ref_id"] != $tree->getRootId())
2555 {
2556 $obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
2557 $type = ilObject::_lookupType($obj_id);
2558 $target_str = $type."_".$_GET["ref_id"];
2559 }
2560 }
2561 // personal workspace
2562 else if ($_GET["wsp_id"] != "" && $_GET["wsp_id"] > 0)
2563 {
2564 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
2565 $tree = new ilWorkspaceTree($ilUser->getId());
2566 $obj_id = $tree->lookupObjectId((int)$_GET["wsp_id"]);
2567 if($obj_id)
2568 {
2569 $type = ilObject::_lookupType($obj_id);
2570 $target_str = $type."_".(int)$_GET["wsp_id"]."_wsp";
2571 }
2572 }
2573 // portfolio
2574 else if ($_GET["prt_id"] != "")
2575 {
2576 $target_str = "prtf_".(int)$_GET["prt_id"];
2577 }
2578
2579 return $target_str;
2580 }
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
Tree handler for personal workspace.
$ilUser
Definition: imgupload.php:18

References $_GET, $ilUser, ilObject\_lookupObjId(), and ilObject\_lookupType().

Referenced by ilMainMenuGUI\setTemplateVars().

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

◆ checkTopic()

ilTemplate::checkTopic (   $a_block,
  $a_topic 
)

checks for a topic in the template @access private

Parameters
string
string
Returns
boolean

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

1332 {
1333 return array_key_exists($a_topic, $this->blockvariables[$a_block]);
1334 }

Referenced by includeNavigation(), and includeTree().

+ Here is the caller graph for this function:

◆ clearHeader()

ilTemplate::clearHeader ( )

Clear header.

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

1683 {
1684 $this->setTitle("");
1685 $this->setTitleIcon("");
1686 $this->setDescription("");
1687 $this->setAlertProperties(array());
1688 }
setDescription($a_descr)
sets title in standard template
setTitleIcon($a_icon_path, $a_icon_desc="")
set title icon
setTitle($a_title)
sets title in standard template
setAlertProperties(array $a_props)
Set alert properties.

References setAlertProperties(), setDescription(), setTitle(), and setTitleIcon().

+ Here is the call graph for this function:

◆ enableDragDropFileUpload()

ilTemplate::enableDragDropFileUpload (   $a_ref_id)

Enables the file upload into this object by dropping a file.

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

2614 {
2615 $this->enable_fileupload = $a_ref_id;
2616 }

Referenced by resetHeaderBlock().

+ Here is the caller graph for this function:

◆ fileExists()

ilTemplate::fileExists (   $filename)

check if a file exists @access public

Returns
boolean

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

1362 {
1363 return file_exists($this->tplPath."/".$filename);
1364 }

References $filename.

◆ fillAdminPanel()

ilTemplate::fillAdminPanel ( )

Put admin panel into template:

  • creation selector
  • admin view on/off button

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

2363 {
2364 global $lng, $ilHelp;
2365
2366 $adm_view_cmp = $adm_cmds = $adm_view = false;
2367
2368 $toolb = new ilToolbarGUI();
2369
2370 // admin panel commands
2371 if ((count($this->admin_panel_commands) > 0))
2372 {
2373 foreach($this->admin_panel_commands as $cmd)
2374 {
2375 $toolb->addFormButton($cmd["txt"], $cmd["cmd"]);
2376 }
2377 $adm_cmds = true;
2378 }
2379 elseif($this->admin_panel_commands_toolbar instanceof ilToolbarGUI)
2380 {
2381 $toolb = $this->admin_panel_commands_toolbar;
2382 $adm_cmds = true;
2383 }
2384 // Add arrow if desired
2385 if($this->admin_panel_arrow)
2386 {
2387 $toolb->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), $lng->txt("actions"));
2388 }
2389
2390 if ($adm_cmds)
2391 {
2392 $this->fillPageFormAction();
2393
2394 $this->setCurrentBlock("adm_view_components");
2395 $this->setVariable("ADM_PANEL1", $toolb->getHTML());
2396 $this->parseCurrentBlock();
2397 $adm_view_cmp = true;
2398 }
2399
2400 // admin view button
2401 if ($this->page_actions != "")
2402 {
2403 $this->setVariable("PAGE_ACTIONS", $this->page_actions);
2404 $adm_view = true;
2405 }
2406
2407 // creation selector
2408 // see: ilObjectAddNewItemGUI
2409 // placeholder "SELECT_OBJTYPE_REPOS" still needed!
2410
2411 if ($adm_cmds and $this->admin_panel_bottom)
2412 {
2413 $this->setCurrentBlock("adm_view_components2");
2414 if ($this->admin_panel_arrow)
2415 {
2416 $toolb->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), $lng->txt("actions"));
2417 }
2418 $this->setVariable("ADM_PANEL2", $toolb->getHTML());
2419
2420 $this->parseCurrentBlock();
2421 }
2422 }
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$cmd
Definition: sahs_server.php:35

References $cmd, $lng, fillPageFormAction(), ilUtil\getImagePath(), HTML_Template_IT\parseCurrentBlock(), setCurrentBlock(), and HTML_Template_IT\setVariable().

Referenced by get(), and show().

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

◆ fillBodyClass()

ilTemplate::fillBodyClass ( )

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

1802 {
1803 if ($this->body_class != "" && $this->blockExists("body_class"))
1804 {
1805 $this->setCurrentBlock("body_class");
1806 $this->setVariable("BODY_CLASS", $this->body_class);
1807 $this->parseCurrentBlock();
1808 }
1809 }
blockExists($a_blockname)
check if block exists in actual template @access private

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

Referenced by get(), and show().

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

◆ fillContentLanguage()

ilTemplate::fillContentLanguage ( )

Add current user language to meta tags.

@access public

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

596 {
597 global $ilUser,$lng;
598 $contentLanguage = 'en';
599 $rtl = array('ar','fa','ur','he');//, 'de'); //make a list of rtl languages
600 /* rtl-review: add "de" for testing with ltr lang shown in rtl
601 * and set unicode-bidi to bidi-override for mirror effect */
602 $textdir = 'ltr';
603 if(is_object($ilUser))
604 {
605 if($ilUser->getLanguage())
606 {
607 $contentLanguage = $ilUser->getLanguage();
608 }
609 else if(is_object($lng))
610 {
611 $contentLanguage = $lng->getDefaultLanguage();
612 }
613 }
614 $this->setVariable('META_CONTENT_LANGUAGE', $contentLanguage);
615 if (in_array($contentLanguage, $rtl)) {
616 $textdir = 'rtl';
617 }
618 $this->setVariable('LANGUAGE_DIRECTION', $textdir);
619 return true;
620 }

References $ilUser, $lng, and HTML_Template_IT\setVariable().

Referenced by get(), and show().

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

◆ fillContentStyle()

ilTemplate::fillContentStyle ( )

Fill Content Style.

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

803 {
804 if ($this->content_style_sheet != "")
805 {
806 $this->setCurrentBlock("ContentStyle");
807 $this->setVariable("LOCATION_CONTENT_STYLESHEET",
808 $this->content_style_sheet);
809 $this->parseCurrentBlock();
810 }
811 }

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

Referenced by get(), and show().

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

◆ fillCssFiles() [1/2]

ilTemplate::fillCssFiles (   $a_force = false)

Fill in the css file tags.

Parameters
boolean$a_force

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

752 {
753 if (!$this->blockExists("css_file"))
754 {
755 return;
756 }
757 foreach($this->css_files as $css)
758 {
759 $filename = $css["file"];
760 if (strpos($filename, "?") > 0) $filename = substr($filename, 0, strpos($filename, "?"));
761 if (is_file($filename) || $a_force)
762 {
763 $this->setCurrentBlock("css_file");
764 $this->setVariable("CSS_FILE", $css["file"]);
765 $this->setVariable("CSS_MEDIA", $css["media"]);
766 $this->parseCurrentBlock();
767 }
768 }
769 }

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

Referenced by get(), and show().

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

◆ fillCssFiles() [2/2]

ilTemplate::fillCssFiles (   $a_force = false)

Fill in the css file tags.

Parameters
boolean$a_force

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

479 {
480 if (!$this->blockExists("css_file"))
481 {
482 return;
483 }
484 foreach($this->css_files as $css)
485 {
486 $filename = $css["file"];
487 if (strpos($filename, "?") > 0) $filename = substr($filename, 0, strpos($filename, "?"));
488 if (is_file($filename) || $a_force)
489 {
490 $this->setCurrentBlock("css_file");
491 $this->setVariable("CSS_FILE", $css["file"]);
492 $this->setVariable("CSS_MEDIA", $css["media"]);
493 $this->parseCurrentBlock();
494 }
495 }
496 }

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

+ Here is the call graph for this function:

◆ fillHeader()

ilTemplate::fillHeader ( )
private

Fill header.

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

1695 {
1696 global $lng, $ilUser, $ilCtrl;
1697
1698 $icon = false;
1699 if ($this->icon_path != "")
1700 {
1701 $icon = true;
1702 $this->setCurrentBlock("header_image");
1703 if ($this->icon_desc != "")
1704 {
1705 $this->setVariable("IMAGE_DESC", $lng->txt("icon")." ".$this->icon_desc);
1706 $this->setVariable("IMAGE_ALT", $lng->txt("icon")." ".$this->icon_desc);
1707 }
1708
1709 $this->setVariable("IMG_HEADER", $this->icon_path);
1710 $this->parseCurrentBlock();
1711 $header = true;
1712 }
1713
1714 if ($this->title != "")
1715 {
1716 $this->title = ilUtil::stripScriptHTML($this->title);
1717 $this->setVariable("HEADER", $this->title);
1718 if ($this->title_url != "")
1719 {
1720 $this->setVariable("HEADER_URL", ' href="'.$this->title_url.'"');
1721 }
1722 if ($this->getTitleColor() != "")
1723 {
1724 $this->setVariable("HEADER_COLOR", " style=\"color: #".$this->getTitleColor()."\"");
1725 }
1726
1727 if ($icon)
1728 {
1729 //$this->setVariable("HICONCL", "ilHeaderHasIcon");
1730 }
1731 $header = true;
1732 }
1733
1734 if ($header)
1735 {
1736 $this->setCurrentBlock("header_image");
1737 $this->parseCurrentBlock();
1738 }
1739
1740 if ($this->title_desc != "")
1741 {
1742 $this->setCurrentBlock("header_desc");
1743 $this->setVariable("H_DESCRIPTION", $this->title_desc);
1744 $this->parseCurrentBlock();
1745 }
1746
1747 $header = $this->getHeaderActionMenu();
1748 if ($header)
1749 {
1750 $this->setCurrentBlock("head_action_inner");
1751 $this->setVariable("HEAD_ACTION", $header);
1752 $this->parseCurrentBlock();
1753 $this->touchBlock("head_action");
1754 }
1755
1756 if(count((array) $this->title_alerts))
1757 {
1758 foreach($this->title_alerts as $alert)
1759 {
1760 $this->setCurrentBlock('header_alert');
1761 if(!($alert['propertyNameVisible'] === false))
1762 {
1763 $this->setVariable('H_PROP', $alert['property'].':');
1764 }
1765 $this->setVariable('H_VALUE', $alert['value']);
1766 $this->parseCurrentBlock();
1767 }
1768 }
1769
1770 // add file upload drop zone in header
1771 if ($this->enable_fileupload != null)
1772 {
1773 $ref_id = $this->enable_fileupload;
1774 $upload_id = "dropzone_" . $ref_id;
1775
1776 include_once("./Services/FileUpload/classes/class.ilFileUploadGUI.php");
1777 $upload = new ilFileUploadGUI($upload_id, $ref_id, true);
1778
1779 $this->setVariable("FILEUPLOAD_DROPZONE_ID", " id=\"$upload_id\"");
1780
1781 $this->setCurrentBlock("header_fileupload");
1782 $this->setVariable("HEADER_FILEUPLOAD_SCRIPT", $upload->getHTML());
1783 $this->parseCurrentBlock();
1784 }
1785 }
getHeaderActionMenu()
Get header action menu.
getTitleColor()
Get title color.
touchBlock($block)
overwrites ITX::touchBlock.
static stripScriptHTML($a_str, $a_allow="", $a_rm_js=true)
strip only html tags (4.0) from text $allowed contains tags to be allowed, in format tags a and b ar...
$header
$ref_id
Definition: sahs_server.php:39

References $header, $ilCtrl, $ilUser, $lng, $ref_id, getHeaderActionMenu(), getTitleColor(), HTML_Template_IT\parseCurrentBlock(), setCurrentBlock(), HTML_Template_IT\setVariable(), ilUtil\stripScriptHTML(), and touchBlock().

Referenced by get(), and show().

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

◆ fillInlineCss()

ilTemplate::fillInlineCss ( )

Fill in the inline css.

Parameters
boolean$a_force

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

777 {
778 if (!$this->blockExists("css_inline"))
779 {
780 return;
781 }
782 foreach($this->inline_css as $css)
783 {
784 $this->setCurrentBlock("css_file");
785 $this->setVariable("CSS_INLINE", $css["css"]);
786 //$this->setVariable("CSS_MEDIA", $css["media"]);
787 $this->parseCurrentBlock();
788 }
789 }

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

Referenced by get(), and show().

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

◆ fillJavascriptFile()

ilTemplate::fillJavascriptFile (   $file,
  $vers 
)
protected
Parameters
string$file
string$vers

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

123 {
124 $this->setCurrentBlock("js_file");
125 if($this->js_files_vp[$file])
126 {
127 $this->setVariable("JS_FILE", ilUtil::appendUrlParameterString($file, $vers));
128 }
129 else
130 {
131 $this->setVariable("JS_FILE", $file);
132 }
133 $this->parseCurrentBlock();
134 }

References $file, ilUtil\appendUrlParameterString(), HTML_Template_IT\parseCurrentBlock(), setCurrentBlock(), and HTML_Template_IT\setVariable().

Referenced by fillJavaScriptFiles().

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

◆ fillJavaScriptFiles() [1/2]

ilTemplate::fillJavaScriptFiles (   $a_force = false)

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

706 {
707 global $ilias, $ilTabs, $ilSetting, $ilUser;
708
709 if (is_object($ilSetting)) // maybe this one can be removed
710 {
711 $vers = "vers=".str_replace(array(".", " "), "-", $ilSetting->get("ilias_version"));
712
713 if(DEVMODE)
714 {
715 $vers .= '-'.time();
716 }
717 }
718 if ($this->blockExists("js_file"))
719 {
720 // three batches
721 for ($i=0; $i<=3; $i++)
722 {
723 reset($this->js_files);
724 foreach($this->js_files as $file)
725 {
726 if ($this->js_files_batch[$file] == $i)
727 {
728 if (is_file($file) || substr($file, 0, 4) == "http" || substr($file, 0, 2) == "//" || $a_force)
729 {
730 $this->fillJavascriptFile($file, $vers);
731 }
732 else if(substr($file, 0, 2) == './') // #13962
733 {
734 $url_parts = parse_url($file);
735 if(is_file($url_parts['path']))
736 {
737 $this->fillJavascriptFile($file, $vers);
738 }
739 }
740 }
741 }
742 }
743 }
744 }
fillJavascriptFile($file, $vers)

References $file, $ilSetting, $ilUser, blockExists(), and fillJavascriptFile().

+ Here is the call graph for this function:

◆ fillJavaScriptFiles() [2/2]

ilTemplate::fillJavaScriptFiles ( )

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

446 {
447 global $ilias,$ilTabs;
448 if ($this->blockExists("js_file"))
449 {
450 foreach($this->js_files as $file)
451 {
452 if (is_file($file) || substr($file, 0, 4) == "http")
453 {
454 $this->setCurrentBlock("js_file");
455 $this->setVariable("JS_FILE", $file);
456 $this->parseCurrentBlock();
457 }
458 }
459 }
460 }

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

Referenced by get(), and show().

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

◆ fillLeftContent()

ilTemplate::fillLeftContent ( )
private

Fill left content.

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

1949 {
1950 if (trim($this->left_content) != "")
1951 {
1952 $this->setCurrentBlock("left_column");
1953 $this->setVariable("LEFT_CONTENT", $this->left_content);
1954 $left_col_class = (trim($this->right_content) == "")
1955 ? "col-sm-3 col-sm-pull-9"
1956 : "col-sm-3 col-sm-pull-6";
1957 $this->setVariable("LEFT_COL_CLASS", $left_col_class);
1958 $this->parseCurrentBlock();
1959 }
1960 }

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

Referenced by get(), and show().

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

◆ fillLeftNav()

ilTemplate::fillLeftNav ( )

Fill left navigation frame.

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

1974 {
1975 if (trim($this->left_nav_content) != "")
1976 {
1977 $this->setCurrentBlock("left_nav");
1978 $this->setVariable("LEFT_NAV_CONTENT", $this->left_nav_content);
1979 $this->parseCurrentBlock();
1980 $this->touchBlock("left_nav_space");
1981 }
1982 }

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

Referenced by get(), and show().

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

◆ fillLightbox()

ilTemplate::fillLightbox ( )

Fill lightbox content.

Parameters

return

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

2303 {
2304 $html = "";
2305
2306 foreach ($this->lightbox as $lb)
2307 {
2308 $html.= $lb;
2309 }
2310 $this->setVariable("LIGHTBOX", $html);
2311 }
$html
Definition: example_001.php:87

References $html, and HTML_Template_IT\setVariable().

Referenced by get(), and show().

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

◆ fillMainContent()

ilTemplate::fillMainContent ( )

Fill main content.

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

1879 {
1880 if (trim($this->main_content) != "")
1881 {
1882 $this->setVariable("ADM_CONTENT", $this->main_content);
1883 }
1884 }

References HTML_Template_IT\setVariable().

Referenced by get(), and show().

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

◆ fillMainMenu()

ilTemplate::fillMainMenu ( )

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

837 {
838 global $tpl;
839 if($this->variableExists('MAINMENU'))
840 {
841 $tpl->setVariable("MAINMENU", $this->main_menu);
842 $tpl->setVariable("MAINMENU_SPACER", $this->main_menu_spacer);
843 }
844 }
global $tpl
Definition: ilias.php:8
variableExists($a_variablename)

References $tpl, and variableExists().

Referenced by get(), and show().

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

◆ fillMessage() [1/2]

ilTemplate::fillMessage ( )

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

364 {
365 global $lng;
366
367 $ms = array("info", "success", "failure", "question");
368 $out = "";
369
370 foreach ($ms as $m)
371 {
372 $txt = "";
373 if ($m == "question")
374 {
375 $m = "mess_question";
376 }
377
378 if (isset($_SESSION[$m]) && $_SESSION[$m] != "")
379 {
380 $txt = $_SESSION[$m];
381 }
382 else if (isset($this->message[$m]))
383 {
384 $txt = $this->message[$m];
385 }
386
387 if ($m == "mess_question")
388 {
389 $m = "question";
390 }
391
392 if ($txt != "")
393 {
394 $out.= $this->getMessageHTML($txt, $m);
395 }
396
397 if ($m == "question")
398 {
399 $m = "mess_question";
400 }
401
402 if (isset($_SESSION[$m]) && $_SESSION[$m])
403 {
404 unset($_SESSION[$m]);
405 }
406 }
407
408 if ($out != "")
409 {
410 $this->setVariable("MESSAGE", $out);
411 }
412 }
$_SESSION["AccountId"]
getMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
$txt
Definition: error.php:12

References $_SESSION, $lng, $out, $txt, getMessageHTML(), and HTML_Template_IT\setVariable().

Referenced by get(), and show().

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

◆ fillMessage() [2/2]

ilTemplate::fillMessage ( )

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

373 {
374 global $lng;
375
376 $ms = array("info", "success", "failure", "question");
377 $out = "";
378
379 foreach ($ms as $m)
380 {
381 if ($m == "question")
382 {
383 $m = "mess_question";
384 }
385
386 $txt = (ilSession::get($m) != "")
387 ? ilSession::get($m)
388 : $this->message[$m];
389
390 if ($m == "mess_question")
391 {
392 $m = "question";
393 }
394
395 if ($txt != "")
396 {
397 $mtpl = new ilTemplate("tpl.message.html", true, true, "Services/Utilities");
398 $mtpl->setCurrentBlock($m."_message");
399 $mtpl->setVariable("TEXT", $txt);
400 $mtpl->setVariable("MESSAGE_HEADING", $lng->txt($m."_message"));
401 $mtpl->parseCurrentBlock();
402 $out.= $mtpl->get();
403 }
404
405 if ($m == "question")
406 {
407 $m = "mess_question";
408 }
409
410 if (ilSession::get($m))
411 {
413 }
414 }
415
416 if ($out != "")
417 {
418 $this->setVariable("MESSAGE", $out);
419 }
420 }
static clear($a_var)
Unset a value.
static get($a_var)
Get a value.

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

+ Here is the call graph for this function:

◆ fillNewContentStyle()

ilTemplate::fillNewContentStyle ( )
private

Fill Content Style.

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

817 {
818 $this->setVariable("LOCATION_NEWCONTENT_STYLESHEET_TAG",
819 '<link rel="stylesheet" type="text/css" href="'.
821 .'" />');
822 }
static getNewContentStyleSheetLocation($mode="output")
get full style sheet file name (path inclusive) of current user

References ilUtil\getNewContentStyleSheetLocation(), and HTML_Template_IT\setVariable().

Referenced by get(), and show().

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

◆ fillOnLoadCode()

ilTemplate::fillOnLoadCode ( )

Fill add on load code.

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

2460 {
2461 for ($i = 1; $i <= 3; $i++)
2462 {
2463 if (is_array($this->on_load_code[$i]))
2464 {
2465 $this->setCurrentBlock("on_load_code");
2466 foreach ($this->on_load_code[$i] as $code)
2467 {
2468 $this->setCurrentBlock("on_load_code_inner");
2469 $this->setVariable("OLCODE", $code);
2470 $this->parseCurrentBlock();
2471 }
2472 $this->setCurrentBlock("on_load_code");
2473 $this->parseCurrentBlock();
2474 }
2475 }
2476 }
$code
Definition: example_050.php:99

References $code, HTML_Template_IT\parseCurrentBlock(), setCurrentBlock(), and HTML_Template_IT\setVariable().

Referenced by get(), and show().

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

◆ fillPageFormAction()

ilTemplate::fillPageFormAction ( )

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

695 {
696 if ($this->page_form_action != "")
697 {
698 $this->setCurrentBlock("page_form_start");
699 $this->setVariable("PAGE_FORM_ACTION", $this->page_form_action);
700 $this->parseCurrentBlock();
701 $this->touchBlock("page_form_end");
702 }
703 }

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

Referenced by fillAdminPanel().

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

◆ fillPermanentLink()

ilTemplate::fillPermanentLink ( )

Fill in permanent link.

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

2439 {
2440 if (is_array($this->permanent_link))
2441 {
2442 include_once("./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
2443 $plinkgui = new ilPermanentLinkGUI(
2444 $this->permanent_link["type"],
2445 $this->permanent_link["id"],
2446 $this->permanent_link["append"],
2447 $this->permanent_link["target"]);
2448 if ($this->permanent_link["title"] != "")
2449 {
2450 $plinkgui->setTitle($this->permanent_link["title"]);
2451 }
2452 $this->setVariable("PRMLINK", $plinkgui->getHTML());
2453 }
2454 }
Class for permanent links.

References HTML_Template_IT\setVariable().

Referenced by get(), and show().

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

◆ fillRightContent()

ilTemplate::fillRightContent ( )
private

Fill right content.

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

1898 {
1899 if (trim($this->right_content) != "")
1900 {
1901 $this->setCurrentBlock("right_column");
1902 $this->setVariable("RIGHT_CONTENT", $this->right_content);
1903 $this->parseCurrentBlock();
1904 }
1905 }

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

Referenced by get(), and show().

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

◆ fillScreenReaderFocus()

ilTemplate::fillScreenReaderFocus ( )

Accessibility focus for screen readers.

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

2074 {
2075 global $ilUser;
2076
2077 if (is_object($ilUser) && $ilUser->getPref("screen_reader_optimization") && $this->blockExists("sr_focus"))
2078 {
2079 $this->touchBlock("sr_focus");
2080 }
2081 }

References $ilUser, and touchBlock().

Referenced by get(), and show().

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

◆ fillSideIcons()

ilTemplate::fillSideIcons ( )

Fill side icons (upper icon, tree icon, webfolder icon)

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

2087 {
2088 global $lng, $ilSetting;
2089
2090 if ($this->upper_icon == "" && $this->tree_flat_link == ""
2091 && $this->mount_webfolder == "")
2092 {
2093 return;
2094 }
2095
2096 // upper icon
2097 // deprecated
2098 if ($this->upper_icon != "")
2099 {
2100 /*if ($this->upper_icon_frame != "")
2101 {
2102 $this->setCurrentBlock("target_top");
2103 $this->setVariable("TARGET_TOP", $this->upper_icon_frame);
2104 $this->parseCurrentBlock();
2105 }
2106
2107 $this->setCurrentBlock("alt_top");
2108 $this->setVariable("ALT_TOP", $lng->txt("up"));
2109 $this->parseCurrentBlock();
2110
2111 $this->setCurrentBlock("top");
2112 $this->setVariable("LINK_TOP", $this->upper_icon);
2113 $this->parseCurrentBlock();*/
2114 }
2115
2116 // tree/flat icon
2117 if ($this->tree_flat_link != "")
2118 {
2119 if ($this->left_nav_content != "")
2120 {
2121 $this->touchBlock("tree_lns");
2122 }
2123
2124 $this->setCurrentBlock("tree_mode");
2125 $this->setVariable("LINK_MODE", $this->tree_flat_link);
2126 if ($ilSetting->get("tree_frame") == "right")
2127 {
2128 if ($this->tree_flat_mode == "tree")
2129 {
2130 $this->setVariable("IMG_TREE",ilUtil::getImagePath("icon_sidebar_on.svg"));
2131 $this->setVariable("RIGHT", "Right");
2132 }
2133 else
2134 {
2135 $this->setVariable("IMG_TREE",ilUtil::getImagePath("icon_sidebar_on.svg"));
2136 $this->setVariable("RIGHT", "Right");
2137 }
2138 }
2139 else
2140 {
2141 if ($this->tree_flat_mode == "tree")
2142 {
2143 $this->setVariable("IMG_TREE",ilUtil::getImagePath("icon_sidebar_on.svg"));
2144 }
2145 else
2146 {
2147 $this->setVariable("IMG_TREE",ilUtil::getImagePath("icon_sidebar_on.svg"));
2148 }
2149 }
2150 $this->setVariable("ALT_TREE",$lng->txt($this->tree_flat_mode."view"));
2151 $this->setVariable("TARGET_TREE", ilFrameTargetInfo::_getFrame("MainContent"));
2152 include_once("./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
2153 $this->setVariable("TREE_ACC_KEY",
2154 ilAccessKeyGUI::getAttribute(($this->tree_flat_mode == "tree")
2157 $this->parseCurrentBlock();
2158 }
2159
2160 // mount webfolder
2161 if ($this->mount_webfolder != "")
2162 {
2163 require_once('Services/WebDAV/classes/class.ilDAVServer.php');
2164 $davServer = ilDAVServer::getInstance();
2165 $a_ref_id = $this->mount_webfolder;
2166 $a_link = $davServer->getMountURI($a_ref_id);
2167 $a_folder = $davServer->getFolderURI($a_ref_id);
2168
2169 $this->setCurrentBlock("mount_webfolder");
2170 $this->setVariable("LINK_MOUNT_WEBFOLDER", $a_link);
2171 $this->setVariable("FOLDER_MOUNT_WEBFOLDER", $a_folder);
2172 $this->setVariable("IMG_MOUNT_WEBFOLDER",ilUtil::getImagePath("ic_mount_webfolder.png"));
2173 $this->setVariable("ALT_MOUNT_WEBFOLDER",$lng->txt("mount_webfolder"));
2174 $this->setVariable("TARGET_MOUNT_WEBFOLDER", '_blank');
2175 $this->parseCurrentBlock();
2176 }
2177
2178 $this->setCurrentBlock("tree_icons");
2179 $this->parseCurrentBlock();
2180 }
static getAttribute($a_func_id)
Get accesskey HTML attribute.
static getInstance()
Get singelton instance.
static _getFrame($a_class, $a_type='')
Get content frame name.

References $ilSetting, $lng, $mount_webfolder, ilFrameTargetInfo\_getFrame(), ilAccessKeyGUI\getAttribute(), ilUtil\getImagePath(), ilDAVServer\getInstance(), HTML_Template_IT\parseCurrentBlock(), setCurrentBlock(), HTML_Template_IT\setVariable(), touchBlock(), ilAccessKey\TREE_OFF, and ilAccessKey\TREE_ON.

Referenced by get(), and show().

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

◆ fillStopFloating()

ilTemplate::fillStopFloating ( )
private

stop floating

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

1837 {
1838 if ($this->stop_floating)
1839 {
1840 $this->touchBlock("stop_floating");
1841 }
1842 }

References touchBlock().

Referenced by get(), and show().

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

◆ fillTabs()

ilTemplate::fillTabs ( )

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

663 {
664 global $ilias,$ilTabs;
665
666 if ($this->blockExists("tabs_outer_start"))
667 {
668 $this->touchBlock("tabs_outer_start");
669 $this->touchBlock("tabs_outer_end");
670 $this->touchBlock("tabs_inner_start");
671 $this->touchBlock("tabs_inner_end");
672
673 if ($this->thtml != "")
674 {
675 $this->setVariable("TABS",$this->thtml);
676 }
677 $this->setVariable("SUB_TABS", $this->sthtml);
678 }
679 }

References blockExists(), HTML_Template_IT\setVariable(), and touchBlock().

Referenced by get(), and show().

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

◆ fillToolbar()

ilTemplate::fillToolbar ( )

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

682 {
683 global $ilToolbar;
684
685 $thtml = $ilToolbar->getHTML();
686 if ($thtml != "")
687 {
688 $this->setCurrentBlock("toolbar_buttons");
689 $this->setVariable("BUTTONS", $thtml);
690 $this->parseCurrentBlock();
691 }
692 }

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

Referenced by get(), and show().

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

◆ fillVars()

ilTemplate::fillVars ( )

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 1146 of file class.ilTemplate.php.

1147 {
1148 $count = 0;
1149 reset($this->vars);
1150
1151 while(list($key, $val) = each($this->vars))
1152 {
1153 if (is_array($this->blockvariables[$this->activeBlock]))
1154 {
1155 if (array_key_exists($key, $this->blockvariables[$this->activeBlock]))
1156 {
1157 $count++;
1158
1159 $this->setVariable($key, $val);
1160 }
1161 }
1162 }
1163
1164 return $count;
1165 }

References HTML_Template_IT\setVariable().

Referenced by parseCurrentBlock(), and touchBlock().

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

◆ fillWindowTitle()

ilTemplate::fillWindowTitle ( )

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

623 {
624 global $ilSetting;
625
626 if ($this->header_page_title != "")
627 {
628 $a_title = ilUtil::stripScriptHTML($this->header_page_title);
629 $this->setVariable("PAGETITLE", "- ".$a_title);
630 }
631
632 if ($ilSetting->get('short_inst_name') != "")
633 {
634 $this->setVariable("WINDOW_TITLE",
635 $ilSetting->get('short_inst_name'));
636 }
637 else
638 {
639 $this->setVariable("WINDOW_TITLE",
640 "ILIAS");
641 }
642 }

References $ilSetting, HTML_Template_IT\setVariable(), and ilUtil\stripScriptHTML().

Referenced by get(), and show().

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

◆ get() [1/2]

ilTemplate::get (   $block = "DEFAULT")

Returns a block with all replacements done.

Parameters
stringname of the block
Returns
string
Exceptions
ilTemplateException@access public
See also
show()

Reimplemented from HTML_Template_IT.

Reimplemented in ilIndependentTemplate.

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

500 {
501 if ($part == "DEFAULT")
502 {
503 return parent::get();
504 }
505 else
506 {
507 return parent::get($part);
508 }
509 }
get($resource)
Loads and returns the value for the supplied cache key.
Definition: ConfigCache.php:75

References Assetic\Cache\get().

+ Here is the call graph for this function:

◆ get() [2/2]

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

??? @access public

Parameters
string
Returns
string

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

222 {
223 if ($add_error_mess)
224 {
225 $this->fillMessage();
226 }
227
228 if ($add_ilias_footer)
229 {
230 $this->addILIASFooter();
231 }
232
233 // set standard parts (tabs and title icon)
234 if($add_standard_elements)
235 {
236 if ($this->blockExists("content") && $a_tabs)
237 {
238 // determine default screen id
239 $this->getTabsHTML();
240 }
241
242 // to get also the js files for the main menu
243 $this->getMainMenu();
244 $this->initHelp();
245
246 // these fill blocks in tpl.main.html
247 $this->fillCssFiles();
248 $this->fillInlineCss();
249 $this->fillContentStyle();
250 $this->fillBodyClass();
251
252 // these fill just plain placeholder variables in tpl.main.html
253 $this->setCurrentBlock("DEFAULT");
254 $this->fillNewContentStyle();
255 $this->fillContentLanguage();
256 $this->fillWindowTitle();
257
258 // these fill blocks in tpl.adm_content.html
259 $this->fillHeader();
260 $this->fillSideIcons();
261 $this->fillScreenReaderFocus();
262 $this->fillStopFloating();
263 $this->fillLeftContent();
264 $this->fillLeftNav();
265 $this->fillRightContent();
266 $this->fillAdminPanel();
267 $this->fillToolbar();
268 $this->fillPermanentLink();
269
270 $this->setCenterColumnClass();
271
272 // late loading of javascipr files, since operations above may add files
273 $this->fillJavaScriptFiles();
274 $this->fillOnLoadCode();
275
276 // these fill just plain placeholder variables in tpl.adm_content.html
277 if ($this->blockExists("content"))
278 {
279 $this->setCurrentBlock("content");
280 if ($a_tabs)
281 {
282 $this->fillTabs();
283 }
284 $this->fillMainContent();
285 if ($a_main_menu)
286 {
287 $this->fillMainMenu();
288 }
289 $this->fillLightbox();
290 $this->parseCurrentBlock();
291 }
292 }
293
294 if ($handle_referer)
295 {
296 $this->handleReferer();
297 }
298
299 if ($part == "DEFAULT")
300 {
301 $html = parent::get();
302 }
303 else
304 {
305 $html = parent::get($part);
306 }
307
308 // include the template output hook
309 global $ilPluginAdmin;
310 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
311 foreach ($pl_names as $pl)
312 {
313 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
314 $gui_class = $ui_plugin->getUIClassInstance();
315
316 $resp = $gui_class->getHTML("", "template_get",
317 array("tpl_id" => $this->tplIdentifier, "tpl_obj" => $this, "html" => $html));
318
319 if ($resp["mode"] != ilUIHookPluginGUI::KEEP)
320 {
321 $html = $gui_class->modifyHTML($html, $resp);
322 }
323 }
324
325 // fix #9992: save language usages as late as possible
326 if ($this->translation_linked)
327 {
329 }
330
331 return $html;
332 }
static _saveUsages()
Store the collected usages in the user session.
fillContentLanguage()
Add current user language to meta tags.
fillLightbox()
Fill lightbox content.
fillPermanentLink()
Fill in permanent link.
fillAdminPanel()
Put admin panel into template:
fillMainContent()
Fill main content.
fillStopFloating()
stop floating
fillInlineCss()
Fill in the inline css.
fillLeftContent()
Fill left content.
addILIASFooter()
add ILIAS footer
fillRightContent()
Fill right content.
fillCssFiles($a_force=false)
Fill in the css file tags.
fillNewContentStyle()
Fill Content Style.
initHelp()
Init help.
getTabsHTML()
Get tabs HTML.
fillOnLoadCode()
Fill add on load code.
fillContentStyle()
Fill Content Style.
fillScreenReaderFocus()
Accessibility focus for screen readers.
fillLeftNav()
Fill left navigation frame.
fillSideIcons()
Fill side icons (upper icon, tree icon, webfolder icon)
fillHeader()
Fill header.
handleReferer()
TODO: this is nice, but shouldn't be done here (-> maybe at the end of ilias.php!?...

References $html, ilObjLanguageAccess\_saveUsages(), addILIASFooter(), blockExists(), fillAdminPanel(), fillBodyClass(), fillContentLanguage(), fillContentStyle(), fillCssFiles(), fillHeader(), fillInlineCss(), fillJavaScriptFiles(), fillLeftContent(), fillLeftNav(), fillLightbox(), fillMainContent(), fillMainMenu(), fillMessage(), fillNewContentStyle(), fillOnLoadCode(), fillPermanentLink(), fillRightContent(), fillScreenReaderFocus(), fillSideIcons(), fillStopFloating(), fillTabs(), fillToolbar(), fillWindowTitle(), Assetic\Cache\get(), getMainMenu(), ilPluginAdmin\getPluginObject(), getTabsHTML(), handleReferer(), IL_COMP_SERVICE, initHelp(), ilUIHookPluginGUI\KEEP, HTML_Template_IT\parseCurrentBlock(), setCenterColumnClass(), and setCurrentBlock().

+ Here is the call graph for this function:

◆ getAddFooter()

ilTemplate::getAddFooter ( )

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

198 {
199 return $this->addFooter;
200 }

References $addFooter.

Referenced by addILIASFooter().

+ Here is the caller graph for this function:

◆ getAsynch()

ilTemplate::getAsynch ( )

Use this for final get before sending asynchronous output (ajax) per echo to output.

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

208 {
209 header("Content-type: " . $this->getContentType() . "; charset=UTF-8");
210 return $this->get();
211 }
getContentType()
Get the content type for the template output.

References getContentType().

+ Here is the call graph for this function:

◆ getContentType()

ilTemplate::getContentType ( )

Get the content type for the template output.

Returns
string Content type @access public

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

436 {
437 return $this->contenttype;
438 }

References $contenttype.

Referenced by getAsynch(), and show().

+ Here is the caller graph for this function:

◆ getHeaderActionMenu()

ilTemplate::getHeaderActionMenu ( )

Get header action menu.

Returns
int ref id

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

1860 {
1861 return $this->header_action;
1862 }

References $header_action.

Referenced by fillHeader().

+ Here is the caller graph for this function:

◆ getLoginTargetPar()

ilTemplate::getLoginTargetPar ( )

Get target parameter for login.

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

2066 {
2067 return $this->login_target_par;
2068 }

Referenced by getMainMenu().

+ Here is the caller graph for this function:

◆ getMainMenu()

ilTemplate::getMainMenu ( )

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

825 {
826 global $ilMainMenu;
827
828 if($this->variableExists('MAINMENU'))
829 {
830 $ilMainMenu->setLoginTargetPar($this->getLoginTargetPar());
831 $this->main_menu = $ilMainMenu->getHTML();
832 $this->main_menu_spacer = $ilMainMenu->getSpacerClass();
833 }
834 }
getLoginTargetPar()
Get target parameter for login.

References getLoginTargetPar(), and variableExists().

Referenced by get(), and show().

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

◆ getMessageHTML() [1/2]

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

Get HTML for a system message.

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

418 {
419 global $lng;
420 $mtpl = new ilTemplate("tpl.message.html", true, true, "Services/Utilities");
421 $mtpl->setCurrentBlock($a_type."_message");
422 $mtpl->setVariable("TEXT", $a_txt);
423 $mtpl->setVariable("MESSAGE_HEADING", $lng->txt($a_type."_message"));
424 $mtpl->parseCurrentBlock();
425
426 return $mtpl->get();
427 }
$a_type
Definition: workflow.php:93

References $a_type, and $lng.

Referenced by fillMessage(), and show().

+ Here is the caller graph for this function:

◆ getMessageHTML() [2/2]

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

Get HTML for a system message.

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

265 {
266 global $lng;
267
268 $mtpl = new ilTemplate("tpl.message.html", true, true, "Services/Utilities");
269 $mtpl->setCurrentBlock($a_type."_message");
270 $mtpl->setVariable("TEXT", $a_txt);
271 $mtpl->setVariable("MESSAGE_HEADING", $lng->txt($a_type."_message"));
272 $mtpl->parseCurrentBlock();
273
274 return $mtpl->get();
275 }

References $a_type, and $lng.

◆ getOnLoadCodeForAsynch()

ilTemplate::getOnLoadCodeForAsynch ( )

Get js onload code for ajax calls.

Returns
string

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

2484 {
2485 $js = "";
2486 for ($i = 1; $i <= 3; $i++)
2487 {
2488 if (is_array($this->on_load_code[$i]))
2489 {
2490 foreach ($this->on_load_code[$i] as $code)
2491 {
2492 $js .= $code."\n";
2493 }
2494 }
2495 }
2496 if($js)
2497 {
2498 return '<script type="text/javascript">'."\n".
2499 $js.
2500 '</script>'."\n";
2501 }
2502 }
$js

References $code, and $js.

◆ getStandardTemplate()

ilTemplate::getStandardTemplate ( )

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

1608 {
1609 if ($this->standard_template_loaded)
1610 {
1611 return;
1612 }
1613
1614 // always load jQuery
1615 include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
1617
1618 // always load ui framework
1619 include_once("./Services/UICore/classes/class.ilUIFramework.php");
1621
1622 // always load Basic js
1623// $this->addJavaScript("./Services/JavaScript/js/Basic.js",
1624// true, 1);
1625
1626 $this->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
1627 $this->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
1628
1629 $this->standard_template_loaded = true;
1630 }
addBlockFile($var, $block, $tplname, $in_module=false)
overwrites ITX::addBlockFile @access public
static init($a_tpl=null)
Init.
static initjQuery($a_tpl=null)
Init jQuery.

References addBlockFile(), ilUIFramework\init(), and iljQueryUtil\initjQuery().

+ Here is the call graph for this function:

◆ getTabsHTML()

ilTemplate::getTabsHTML ( )

Get tabs HTML.

Parameters

return

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

651 {
652 global $ilTabs;
653
654 if ($this->blockExists("tabs_outer_start"))
655 {
656 $this->sthtml = $ilTabs->getSubTabHTML();
657 $this->thtml = $ilTabs->getHTML((trim($sthtml) == ""));
658 }
659 }

References blockExists().

Referenced by get(), and show().

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

◆ getTemplateIdentifier()

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

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. "Services/Calendar/tpl.minical.html", "tpl.confirm.html"

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

1555 {
1556 global $ilCtrl;
1557
1558 // if baseClass functionality is used (ilias.php):
1559 // get template directory from ilCtrl
1560 if (!empty($_GET["baseClass"]) && $a_in_module === true)
1561 {
1562 $a_in_module = $ilCtrl->getModuleDir();
1563 }
1564
1565 if (strpos($a_tplname,"/") === false)
1566 {
1567 if ($a_in_module)
1568 {
1569 if ($a_in_module === true)
1570 {
1571 $module_path = ILIAS_MODULE."/";
1572 }
1573 else
1574 {
1575 $module_path = $a_in_module."/";
1576 }
1577 }
1578 else
1579 {
1580 $module_path = "";
1581 }
1582
1583 return $module_path.basename($a_tplname);
1584 }
1585 else
1586 {
1587 return $a_tplname;
1588 }
1589 }
const ILIAS_MODULE
Definition: server.php:14

References $_GET, $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 
)

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 1477 of file class.ilTemplate.php.

1478 {
1479 global $ilias, $ilCtrl;
1480
1481 $fname = "";
1482
1483 // if baseClass functionality is used (ilias.php):
1484 // get template directory from ilCtrl
1485 if (!empty($_GET["baseClass"]) && $a_in_module === true)
1486 {
1487 $a_in_module = $ilCtrl->getModuleDir();
1488 }
1489
1490 if (strpos($a_tplname,"/") === false)
1491 {
1492 $module_path = "";
1493
1494 //$fname = $ilias->tplPath;
1495 if ($a_in_module)
1496 {
1497 if ($a_in_module === true)
1498 {
1499 $module_path = ILIAS_MODULE."/";
1500 }
1501 else
1502 {
1503 $module_path = $a_in_module."/";
1504 }
1505 }
1506
1507 // use ilStyleDefinition instead of account to get the current skin
1508 include_once "Services/Style/System/classes/class.ilStyleDefinition.php";
1509 if (ilStyleDefinition::getCurrentSkin() != "default")
1510 {
1511 $fname = "./Customizing/global/skin/".
1512 ilStyleDefinition::getCurrentSkin()."/".$module_path.basename($a_tplname);
1513 }
1514
1515 if($fname == "" || !file_exists($fname))
1516 {
1517 $fname = "./".$module_path."templates/default/".basename($a_tplname);
1518 }
1519 }
1520 else if(strpos($a_tplname,"src/UI")===0)
1521 {
1522 if (class_exists("ilStyleDefinition") // for testing
1523 && ilStyleDefinition::getCurrentSkin() != "default")
1524 {
1525 $fname = "./Customizing/global/skin/".ilStyleDefinition::getCurrentSkin()."/".str_replace("src/UI/templates/default","UI",$a_tplname);
1526 }
1527 if($fname == "" || !file_exists($fname))
1528 {
1529 $fname = $a_tplname;
1530 }
1531 }
1532 else
1533 {
1534 $fname = $a_tplname;
1535 }
1536
1537 return $fname;
1538 }

References $_GET, $ilCtrl, and ILIAS_MODULE.

Referenced by __construct(), and addBlockFile().

+ 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 91 of file class.ilTemplate.php.

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

References $_GET, $ilCtrl, and ILIAS_MODULE.

◆ getTitleColor()

ilTemplate::getTitleColor ( )

Get title color.

Returns
string color

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

1665 {
1666 return $this->title_color;
1667 }

Referenced by fillHeader().

+ Here is the caller graph for this function:

◆ handleReferer()

ilTemplate::handleReferer ( )

TODO: this is nice, but shouldn't be done here (-> maybe at the end of ilias.php!?, alex)

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

1050 {
1051 if (((substr(strrchr($_SERVER["PHP_SELF"],"/"),1) != "error.php")
1052 && (substr(strrchr($_SERVER["PHP_SELF"],"/"),1) != "adm_menu.php")
1053 && (substr(strrchr($_SERVER["PHP_SELF"],"/"),1) != "chat.php")))
1054 {
1055 $_SESSION["post_vars"] = $_POST;
1056
1057 // referer is modified if query string contains cmd=gateway and $_POST is not empty.
1058 // this is a workaround to display formular again in case of error and if the referer points to another page
1059 $url_parts = @parse_url($_SERVER["REQUEST_URI"]);
1060 if(!$url_parts)
1061 {
1062 $protocol = (isset($_SERVER['HTTPS']) ? 'https' : 'http').'://';
1063 $host = $_SERVER['HTTP_HOST'];
1064 $path = $_SERVER['REQUEST_URI'];
1065 $url_parts = @parse_url($protocol.$host.$path);
1066 }
1067
1068 if (isset($url_parts["query"]) && preg_match("/cmd=gateway/",$url_parts["query"]) && (isset($_POST["cmd"]["create"])))
1069 {
1070 foreach ($_POST as $key => $val)
1071 {
1072 if (is_array($val))
1073 {
1074 $val = key($val);
1075 }
1076
1077 $str .= "&".$key."=".$val;
1078 }
1079
1080 $_SESSION["referer"] = preg_replace("/cmd=gateway/",substr($str,1),$_SERVER["REQUEST_URI"]);
1081 $_SESSION['referer_ref_id'] = (int) $_GET['ref_id'];
1082
1083 }
1084 else if (isset($url_parts["query"]) && preg_match("/cmd=post/",$url_parts["query"]) && (isset($_POST["cmd"]["create"])))
1085 {
1086 foreach ($_POST as $key => $val)
1087 {
1088 if (is_array($val))
1089 {
1090 $val = key($val);
1091 }
1092
1093 $str .= "&".$key."=".$val;
1094 }
1095
1096 $_SESSION["referer"] = preg_replace("/cmd=post/",substr($str,1),$_SERVER["REQUEST_URI"]);
1097 if (isset($_GET['ref_id']))
1098 {
1099 $_SESSION['referer_ref_id'] = (int) $_GET['ref_id'];
1100 }
1101 else
1102 {
1103 $_SESSION['referer_ref_id'] = 0;
1104 }
1105 }
1106 else
1107 {
1108 $_SESSION["referer"] = $_SERVER["REQUEST_URI"];
1109 if (isset($_GET['ref_id']))
1110 {
1111 $_SESSION['referer_ref_id'] = (int) $_GET['ref_id'];
1112 }
1113 else
1114 {
1115 $_SESSION['referer_ref_id'] = 0;
1116 }
1117 }
1118
1119 unset($_SESSION["error_post_vars"]);
1120 }
1121 }
$path
Definition: aliased.php:25
$_POST["username"]

References $_GET, $_POST, $_SERVER, $_SESSION, and $path.

Referenced by get(), and show().

+ Here is the caller graph for this function:

◆ hasMessage()

ilTemplate::hasMessage (   $a_type)

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

359 {
360 return (isset($this->message[$a_type]) && strlen($this->message[$a_type]));
361 }

References $a_type.

◆ includeNavigation()

ilTemplate::includeNavigation ( )

check if there is a NAVIGATION-topic @access public

Returns
boolean

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

1342 {
1343 return $this->checkTopic("__global__", "NAVIGATION");
1344 }
checkTopic($a_block, $a_topic)
checks for a topic in the template @access private

References checkTopic().

+ Here is the call graph for this function:

◆ includeTree()

ilTemplate::includeTree ( )

check if there is a TREE-topic @access public

Returns
boolean

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

1352 {
1353 return $this->checkTopic("__global__", "TREE");
1354 }

References checkTopic().

+ Here is the call graph for this function:

◆ init()

ilTemplate::init ( )

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 137 of file class.ilTemplate.php.

138 {
139 $this->free();
140 $this->buildFunctionlist();
141
142 $cache_hit = false;
143 if ($this->il_use_cache)
144 {
145 // cache hit
146 if (isset(self::$il_cache[$this->il_cur_key]) && is_array(self::$il_cache[$this->il_cur_key]))
147 {
148 $cache_hit = true;
149//echo "cache hit";
150 $this->err = self::$il_cache[$this->il_cur_key]["err"];
151 $this->flagBlocktrouble = self::$il_cache[$this->il_cur_key]["flagBlocktrouble"];
152 $this->blocklist = self::$il_cache[$this->il_cur_key]["blocklist"];
153 $this->blockdata = self::$il_cache[$this->il_cur_key]["blockdata"];
154 $this->blockinner = self::$il_cache[$this->il_cur_key]["blockinner"];
155 $this->blockparents = self::$il_cache[$this->il_cur_key]["blockparents"];
156 $this->blockvariables = self::$il_cache[$this->il_cur_key]["blockvariables"];
157 }
158 }
159
160 if (!$cache_hit)
161 {
162 $this->findBlocks($this->template);
163 $this->template = '';
164 $this->buildBlockvariablelist();
165 if ($this->il_use_cache)
166 {
167 self::$il_cache[$this->il_cur_key]["err"] = $this->err;
168 self::$il_cache[$this->il_cur_key]["flagBlocktrouble"] = $this->flagBlocktrouble;
169 self::$il_cache[$this->il_cur_key]["blocklist"] = $this->blocklist;
170 self::$il_cache[$this->il_cur_key]["blockdata"] = $this->blockdata;
171 self::$il_cache[$this->il_cur_key]["blockinner"] = $this->blockinner;
172 self::$il_cache[$this->il_cur_key]["blockparents"] = $this->blockparents;
173 self::$il_cache[$this->il_cur_key]["blockvariables"] = $this->blockvariables;
174 }
175 }
176
177 // we don't need it any more
178 $this->template = '';
179
180 } // end func init
buildFunctionlist()
Builds a functionlist from the template.
Definition: ITX.php:600
findBlocks($string)
Recusively builds a list of all blocks within the template.
Definition: IT.php:858
free()
Clears all datafields of the object.
Definition: IT.php:714
buildBlockvariablelist()
Build a list of all variables within of a block.
Definition: IT.php:817

References HTML_Template_IT\$blockdata, HTML_Template_IT\$blockinner, HTML_Template_IT\$blocklist, HTML_Template_IT\$blockvariables, HTML_Template_IT\$err, HTML_Template_IT\$flagBlocktrouble, 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:

◆ initHelp()

ilTemplate::initHelp ( )

Init help.

Parameters

return

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

853 {
854 include_once("./Services/Help/classes/class.ilHelpGUI.php");
855 ilHelpGUI::initHelp($this);
856 }
static initHelp($a_tpl)
Render current help page.

References ilHelpGUI\initHelp().

Referenced by get(), and show().

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

◆ 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 ilIndependentTemplate.

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

1430 {
1431 // copied from IT:loadTemplateFile
1432 $template = '';
1433 if (!$this->flagCacheTemplatefile ||
1434 $this->lastTemplatefile != $filename
1435 ) {
1436 $template = $this->getFile($filename);
1437 }
1438 $this->lastTemplatefile = $filename;
1439 // copied.
1440
1441 // new code to include the template input hook:
1442 global $ilPluginAdmin;
1443 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
1444 foreach ($pl_names as $pl)
1445 {
1446 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
1447 $gui_class = $ui_plugin->getUIClassInstance();
1448
1449 $resp = $gui_class->getHTML("", "template_load",
1450 array("tpl_id" => $this->tplIdentifier, "tpl_obj" => $this, "html" => $template));
1451
1452 if ($resp["mode"] != ilUIHookPluginGUI::KEEP)
1453 {
1454 $template = $gui_class->modifyHTML($template, $resp);
1455 }
1456 }
1457 // new.
1458
1459 // copied from IT:loadTemplateFile
1460 return $template != '' ?
1461 $this->setTemplate(
1463 ) : false;
1464 // copied.
1465
1466 }
$removeEmptyBlocks
Definition: IT.php:202
$removeUnknownVariables
Definition: IT.php:195
setTemplate( $template, $removeUnknownVariables=true, $removeEmptyBlocks=true)
Sets the template.
Definition: IT.php:741

References $filename, HTML_Template_IT\$removeEmptyBlocks, HTML_Template_IT\$removeUnknownVariables, 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

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

1212 {
1213 // Hier erst noch ein replace aufrufen
1214 if ($part != "DEFAULT")
1215 {
1216 $tmp = $this->activeBlock;
1217 $this->activeBlock = $part;
1218 }
1219
1220 if ($part != "DEFAULT")
1221 {
1222 $this->activeBlock = $tmp;
1223 }
1224
1225 $this->fillVars();
1226
1227 $this->activeBlock = "__global__";
1228
1229 if ($part == "DEFAULT")
1230 {
1231 return parent::parseCurrentBlock();
1232 }
1233 else
1234 {
1235 return parent::parseCurrentBlock($part);
1236 }
1237 }
fillVars()
all template vars defined in $vars will be replaced automatically without setting and parsing them wi...

References $activeBlock, and fillVars().

Referenced by ilContainerRenderer\addHeaderRow(), ilContainerRenderer\addSeparatorRow(), ilContainerRenderer\addStandardRow(), ilChatroomAuthInputGUI\insert(), ilCaptchaInputGUI\insert(), ilEMailInputGUI\insert(), ilClozeGapInputBuilderGUI\insert(), ilContainerRenderer\renderDetails(), 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

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

322 {
323 // Hier erst noch ein replace aufrufen
324 if ($part != "DEFAULT")
325 {
326 $tmp = $this->activeBlock;
327 $this->activeBlock = $part;
328 }
329
330 if ($part != "DEFAULT")
331 {
332 $this->activeBlock = $tmp;
333 }
334
335 //$this->fillVars();
336
337 $this->activeBlock = "__global__";
338
339 if ($part == "DEFAULT")
340 {
341 return parent::parseCurrentBlock();
342 }
343 else
344 {
345 return parent::parseCurrentBlock($part);
346 }
347 }

References $activeBlock.

◆ prepareForFormular()

ilTemplate::prepareForFormular (   $vars)

Wird angewendet, wenn die Daten in ein Formular replaced werden sollen, Dann wird erst noch ein htmlspecialchars drumherum gemacht.

@access public

Parameters
string

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

1284 {
1285 if (!is_array($vars))
1286 {
1287 return;
1288 }
1289
1290 reset($vars);
1291
1292 while (list($i) = each($vars))
1293 {
1294 $vars[$i] = stripslashes($vars[$i]);
1295 $vars[$i] = htmlspecialchars($vars[$i]);
1296 }
1297
1298 return($vars);
1299 }

References $vars.

◆ replace()

ilTemplate::replace ( )

??? @access public

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

1306 {
1307 reset($this->vars);
1308
1309 while(list($key, $val) = each($this->vars))
1310 {
1311 $this->setVariable($key, $val);
1312 }
1313 }

References HTML_Template_IT\setVariable().

Referenced by replaceDefault(), and replaceFromDatabase().

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

◆ replaceDefault()

ilTemplate::replaceDefault ( )

??? @access public

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

1320 {
1321 $this->replace($this->vars);
1322 }
replace()
??? @access public

References replace().

+ Here is the call graph for this function:

◆ replaceFromDatabase()

ilTemplate::replaceFromDatabase ( $DB,
  $block,
  $conv,
  $select = "default" 
)

??? TODO: Adjust var names to ilias.

This method wasn't used so far and isn't translated yet @access public

Parameters
string
string
string
string

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

1250 {
1251 $res = $DB->selectDbAll();
1252
1253 while ($DB->getDbNextElement($res))
1254 {
1255 $this->setCurrentBlock($block);
1256 $result = array();
1257 reset($conv);
1258
1259 while (list ($key,$val) = each ($conv))
1260 {
1261 $result[$val]=$DB->element->data[$key];
1262 }
1263
1264 if (($select != "default")
1265 && ($DB->element->data[$select["id"]]==$select["value"]
1266 || (strtolower($select["text"]) == "checked"
1267 && strpos( ",,".$select["value"].",," , ",".$DB->element->data[$select["id"]]."," )!=false)))
1268 {
1269 $result[$select["field"]] = $select["text"];
1270 }
1271
1272 $this->replace($result);
1273 $this->parseCurrentBlock($block);
1274 }
1275 }
$result

References $res, $result, HTML_Template_IT\parseCurrentBlock(), replace(), and setCurrentBlock().

+ Here is the call graph for this function:

◆ resetCss()

ilTemplate::resetCss ( )

Reset css files.

Parameters

return

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

2251 {
2252 $this->css_files = array();
2253 }

◆ resetHeaderBlock()

ilTemplate::resetHeaderBlock (   $a_reset_header_action = true)

Set variable.

Reset all header properties: title, icon, description, alerts, action menu

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

2596 {
2597 $this->setTitle(null);
2598 $this->setTitleIcon(null);
2599 $this->setDescription(null);
2600 $this->setAlertProperties(array());
2601 $this->enableDragDropFileUpload(null);
2602
2603 // see setFullscreenHeader()
2604 if($a_reset_header_action)
2605 {
2606 $this->setHeaderActionMenu(null);
2607 }
2608 }
enableDragDropFileUpload($a_ref_id)
Enables the file upload into this object by dropping a file.
setHeaderActionMenu($a_header)
Set header action menu.

References enableDragDropFileUpload(), setAlertProperties(), setDescription(), setHeaderActionMenu(), setTitle(), and setTitleIcon().

+ Here is the call graph for this function:

◆ resetJavascript()

ilTemplate::resetJavascript ( )

Reset javascript files.

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

2238 {
2239 $this->js_files = array();
2240 $this->js_files_vp = array();
2241 $this->js_files_batch = array();
2242 }

◆ setAddFooter()

ilTemplate::setAddFooter (   $value)

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

188 {
189 $this->addFooter = $value;
190 }

◆ setAlertProperties()

ilTemplate::setAlertProperties ( array  $a_props)

Set alert properties.

Parameters
array$a_props
Returns
void

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

1675 {
1676 $this->title_alerts = $a_props;
1677 }

Referenced by clearHeader(), and resetHeaderBlock().

+ Here is the caller graph for this function:

◆ setBackgroundColor()

ilTemplate::setBackgroundColor (   $a_bg_color)

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

2505 {
2506 // :TODO: currently inactive, JF should discuss this
2507 return;
2508
2509 if($a_bg_color != "")
2510 {
2511 $this->setVariable("FRAME_BG_COLOR", " style=\"background-color: #".$a_bg_color."\"");
2512 }
2513 }

References HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ setBanner()

ilTemplate::setBanner (   $a_img,
  $a_width = 1370,
  $a_height = 100,
  $a_export = false 
)

Set banner.

Parameters
string$a_imgbanner full path (background image)
int$a_widthbanner width
int$a_heightbanner height
bool$a_export

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

2524 {
2525 if($a_img)
2526 {
2527 if(!$a_export)
2528 {
2529 $a_img = ILIAS_HTTP_PATH."/".$a_img;
2530 }
2531
2532 $this->setCurrentBlock("banner_bl");
2533 $this->setVariable("BANNER_WIDTH", $a_width); // currently not needed
2534 $this->setVariable("BANNER_HEIGHT", $a_height);
2535 $this->setVariable("BANNER_URL", $a_img);
2536 $this->parseCurrentBlock();
2537 }
2538 }

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

+ Here is the call graph for this function:

◆ setBodyClass()

ilTemplate::setBodyClass (   $a_class = "")

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

1797 {
1798 $this->body_class = $a_class;
1799 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setCenterColumnClass()

ilTemplate::setCenterColumnClass ( )
private

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

1908 {
1909 if (!$this->blockExists("center_col_width"))
1910 {
1911 return;
1912 }
1913 $center_column_class = "";
1914 if (trim($this->right_content) != "" && trim($this->left_content) != "") {
1915 $center_column_class = "two_side_col";
1916 }
1917 else if (trim($this->right_content) != "" || trim($this->left_content) != "") {
1918 $center_column_class = "one_side_col";
1919 }
1920
1921 switch ($center_column_class)
1922 {
1923 case "one_side_col": $center_column_class = "col-sm-9"; break;
1924 case "two_side_col": $center_column_class = "col-sm-6"; break;
1925 default: $center_column_class = "col-sm-12"; break;
1926 }
1927 if (trim($this->left_content) != "")
1928 {
1929 $center_column_class.= " col-sm-push-3";
1930 }
1931
1932 $this->setCurrentBlock("center_col_width");
1933 $this->setVariable("CENTER_COL", $center_column_class);
1934 $this->parseCurrentBlock();
1935 }

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

Referenced by get(), and show().

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

◆ setContent()

ilTemplate::setContent (   $a_html)

sets content for standard template

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

1868 {
1869 if ($a_html != "")
1870 {
1871 $this->main_content = $a_html;
1872 }
1873 }

◆ setContentStyleSheet()

ilTemplate::setContentStyleSheet (   $a_style)

Set content style (used for page content editor)

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

795 {
796 $this->content_style_sheet = $a_style;
797 }

◆ setContentType()

ilTemplate::setContentType (   $a_content_type = "text/html")

Set the content type for the template output.

Set the content type for the template output Usually this is text/html. For MathML output the content type should be set to text/xml

Parameters
string$a_content_typeContent type @access public

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

451 {
452 $this->contenttype = $a_content_type;
453 }

◆ setCurrentBlock() [1/2]

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

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

@access public

Parameters
string
Returns
???

Reimplemented from HTML_Template_IT.

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

1174 {
1175 $this->activeBlock = $part;
1176
1177 if ($part == "DEFAULT")
1178 {
1179 return parent::setCurrentBlock();
1180 }
1181 else
1182 {
1183 return parent::setCurrentBlock($part);
1184 }
1185 }

Referenced by ilContainerRenderer\addHeaderRow(), ilContainerRenderer\addSeparatorRow(), ilContainerRenderer\addStandardRow(), fillAdminPanel(), fillBodyClass(), fillContentStyle(), fillCssFiles(), fillHeader(), fillInlineCss(), fillJavascriptFile(), fillJavaScriptFiles(), fillLeftContent(), fillLeftNav(), fillOnLoadCode(), fillPageFormAction(), fillRightContent(), fillSideIcons(), fillToolbar(), get(), ilChatroomAuthInputGUI\insert(), ilCaptchaInputGUI\insert(), ilEMailInputGUI\insert(), ilClozeGapInputBuilderGUI\insert(), ilContainerRenderer\renderDetails(), ilSurveyPageGUI\renderPageNode(), ilContainerRenderer\renderSelectAllBlock(), replaceFromDatabase(), setBanner(), setCenterColumnClass(), show(), 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
???

Reimplemented from HTML_Template_IT.

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

284 {
285 $this->activeBlock = $part;
286
287 if ($part == "DEFAULT")
288 {
289 return parent::setCurrentBlock();
290 }
291 else
292 {
293 return parent::setCurrentBlock($part);
294 }
295 }

◆ setDescription()

ilTemplate::setDescription (   $a_descr)

sets title in standard template

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

1820 {
1821 $this->title_desc = $a_descr;
1822// $this->setVariable("H_DESCRIPTION", $a_descr);
1823 }

Referenced by clearHeader(), and resetHeaderBlock().

+ Here is the caller graph for this function:

◆ setEditPageButton()

ilTemplate::setEditPageButton (   $a_link,
  $a_txt,
  $a_frame 
)

Show admin view button.

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

2325 {
2326 $this->edit_page_button =
2327 array("link" => $a_link, "txt" => $a_txt, "frame" => $a_frame);
2328 }

◆ setHeaderActionMenu()

ilTemplate::setHeaderActionMenu (   $a_header)

Set header action menu.

Parameters
string$a_gui$a_header

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

1850 {
1851 $this->header_action = $a_header;
1852 }

Referenced by resetHeaderBlock().

+ Here is the caller graph for this function:

◆ setHeaderPageTitle()

ilTemplate::setHeaderPageTitle (   $a_title)

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

1592 {
1593 $a_title = ilUtil::stripScriptHTML($a_title);
1594 $this->header_page_title = $a_title;
1595 }

References ilUtil\stripScriptHTML().

+ Here is the call graph for this function:

◆ setLeftContent()

ilTemplate::setLeftContent (   $a_html)

sets content of left column

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

1941 {
1942 $this->left_content = $a_html;
1943 }

◆ setLeftNavContent()

ilTemplate::setLeftNavContent (   $a_content)

Sets content of left navigation column.

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

1966 {
1967 $this->left_nav_content = $a_content;
1968 }
$a_content
Definition: workflow.php:94

References $a_content.

◆ setLocator()

ilTemplate::setLocator ( )

Insert locator.

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

1988 {
1989 global $ilLocator, $lng, $ilPluginAdmin, $ilMainMenu;
1990
1991 // blog/portfolio
1992 if($ilMainMenu->getMode() == ilMainMenuGUI::MODE_TOPBAR_REDUCED ||
1993 $ilMainMenu->getMode() == ilMainMenuGUI::MODE_TOPBAR_ONLY)
1994 {
1995 $this->setVariable("LOCATOR", "");
1996 return;
1997 }
1998
1999 $html = "";
2000 if (is_object($ilPluginAdmin))
2001 {
2002 include_once("./Services/UIComponent/classes/class.ilUIHookProcessor.php");
2003 $uip = new ilUIHookProcessor("Services/Locator", "main_locator",
2004 array("locator_gui" => $ilLocator));
2005 if (!$uip->replaced())
2006 {
2007 $html = $ilLocator->getHTML();
2008 }
2009 $html = $uip->getHTML($html);
2010 }
2011 else
2012 {
2013 $html = $ilLocator->getHTML();
2014 }
2015
2016 $this->setVariable("LOCATOR", $html);
2017 }
UI interface hook processor.

References $html, $lng, ilMainMenuGUI\MODE_TOPBAR_ONLY, ilMainMenuGUI\MODE_TOPBAR_REDUCED, and HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ setLoginTargetPar()

ilTemplate::setLoginTargetPar (   $a_val)

Set target parameter for login (public sector).

This is used by the main menu

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

2058 {
2059 $this->login_target_par = $a_val;
2060 }

◆ setMessage() [1/2]

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

Set message.

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

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

339 {
340 if (!in_array($a_type, array("info", "success", "failure", "question")) || $a_txt == "")
341 {
342 return;
343 }
344 if ($a_type == "question")
345 {
346 $a_type = "mess_question";
347 }
348 if (!$a_keep)
349 {
350 $this->message[$a_type] = $a_txt;
351 }
352 else
353 {
354 $_SESSION[$a_type] = $a_txt;
355 }
356 }

References $_SESSION, and $a_type.

◆ setMessage() [2/2]

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

Set message.

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

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

353 {
354 if (!in_array($a_type, array("info", "success", "failure", "question")) || $a_txt == "")
355 {
356 return;
357 }
358 if ($a_type == "question")
359 {
360 $a_type = "mess_question";
361 }
362 if (!$a_keep)
363 {
364 $this->message[$a_type] = $a_txt;
365 }
366 else
367 {
368 ilSession::set($a_type, $a_txt);
369 }
370 }
static set($a_var, $a_val)
Set a value.

References $a_type, and ilSession\set().

+ Here is the call graph for this function:

◆ setMountWebfolderIcon()

ilTemplate::setMountWebfolderIcon (   $a_ref_id)

shows icon for mounting a webfolder

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

2187 {
2188 global $lng;
2189
2190 $this->mount_webfolder = $a_ref_id;
2191 }

References $lng.

◆ setNewContentStyleSheetLocation()

ilTemplate::setNewContentStyleSheetLocation (   $a_stylesheet)

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

1603 {
1604 $this->setVariable("LOCATION_NEWCONTENT_STYLESHEET", $a_stylesheet);
1605 }

References HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ setPageActions()

ilTemplate::setPageActions (   $a_page_actions_html)

Show admin view button.

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

2317 {
2318 $this->page_actions = $a_page_actions_html;
2319 }

◆ setPageFormAction()

ilTemplate::setPageFormAction (   $a_action)

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

1812 {
1813 $this->page_form_action = $a_action;
1814 }

◆ setPermanentLink()

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

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

2425 {
2426 $this->permanent_link = array(
2427 "type" => $a_type,
2428 "id" => $a_id,
2429 "append" => $a_append,
2430 "target" => $a_target,
2431 "title" => $a_title);
2432
2433 }

References $a_type.

◆ setRightContent()

ilTemplate::setRightContent (   $a_html)

sets content of right column

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

1890 {
1891 $this->right_content = $a_html;
1892 }

◆ setStyleSheetLocation()

ilTemplate::setStyleSheetLocation (   $a_stylesheet)

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

1598 {
1599 $this->setVariable("LOCATION_STYLESHEET", $a_stylesheet);
1600 }

References HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ setSubTabs()

ilTemplate::setSubTabs (   $a_tabs_html)

sets subtabs in standard template

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

2038 {
2039 $this->setVariable("SUB_TABS", $a_tabs_html);
2040 }

References HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ setTabs()

ilTemplate::setTabs (   $a_tabs_html)

sets tabs in standard template

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

2023 {
2024 if ($a_tabs_html != "" && $this->blockExists("tabs_outer_start"))
2025 {
2026 $this->touchBlock("tabs_outer_start");
2027 $this->touchBlock("tabs_outer_end");
2028 $this->touchBlock("tabs_inner_start");
2029 $this->touchBlock("tabs_inner_end");
2030 $this->setVariable("TABS", $a_tabs_html);
2031 }
2032 }

References blockExists(), HTML_Template_IT\setVariable(), and touchBlock().

+ Here is the call graph for this function:

◆ setTitle()

ilTemplate::setTitle (   $a_title)

sets title in standard template

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

1636 {
1637 $this->title = ilUtil::stripScriptHTML($a_title);
1638 $this->header_page_title = $a_title;
1639 }

References ilUtil\stripScriptHTML().

Referenced by clearHeader(), and resetHeaderBlock().

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

◆ setTitleColor()

ilTemplate::setTitleColor (   $a_val)

Set title color.

Parameters
string$a_valcolor

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

1655 {
1656 $this->title_color = $a_val;
1657 }

◆ setTitleIcon()

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

set title icon

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

1791 {
1792 $this->icon_desc = $a_icon_desc;
1793 $this->icon_path = $a_icon_path;
1794 }

Referenced by clearHeader(), and resetHeaderBlock().

+ Here is the caller graph for this function:

◆ setTitleUrl()

ilTemplate::setTitleUrl (   $a_url)

sets title url in standard template

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

1645 {
1646 $this->title_url = $a_url;
1647 }

◆ setTreeFlatIcon()

ilTemplate::setTreeFlatIcon (   $a_link,
  $a_mode 
)

set tree/flat icon

Parameters
stringlink target
strongmode ("tree" | "flat")

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

2200 {
2201 global $lng;
2202
2203 $this->tree_flat_link = $a_link;
2204 $this->tree_flat_mode = $a_mode;
2205 }

References $lng.

◆ setUpperIcon()

ilTemplate::setUpperIcon (   $a_link,
  $a_frame = "" 
)

sets icon to upper level

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

2046 {
2047 global $lng;
2048
2049 $this->upper_icon = $a_link;
2050 $this->upper_icon_frame = $a_frame;
2051 }

References $lng.

◆ show() [1/2]

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

@access public

Parameters
string

Reimplemented from HTML_Template_IT.

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

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

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

+ Here is the call graph for this function:

◆ show() [2/2]

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

@access public

Parameters
string
boolfill template variable {TABS} with content of ilTabs

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

461 {
462 global $ilias, $ilTabs;
463
464 // include yahoo dom per default
465 include_once("./Services/YUI/classes/class.ilYuiUtil.php");
467
468//echo "-".ilUtil::getP3PLocation()."-";
469 //header('P3P: policyref="'.ilUtil::getP3PLocation().
470 // '", CP="CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa OUR BUS IND UNI COM NAV INT CNT STA PRE"');
471 header('P3P: CP="CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa OUR BUS IND UNI COM NAV INT CNT STA PRE"');
472 header("Content-type: " . $this->getContentType() . "; charset=UTF-8");
473
474 $this->fillMessage();
475
476 // display ILIAS footer
477 if ($part !== false)
478 {
479 $this->addILIASFooter();
480 }
481
482 // set standard parts (tabs and title icon)
483 $this->fillBodyClass();
484 if ($a_fill_tabs)
485 {
486 if ($this->blockExists("content"))
487 {
488 // determine default screen id
489 $this->getTabsHTML();
490 }
491
492 // to get also the js files for the main menu
493 if (!$a_skip_main_menu)
494 {
495 $this->getMainMenu();
496 $this->initHelp();
497 }
498
499 if($this->blockExists("content") && $this->variableExists('MAINMENU'))
500 {
501 global $tpl;
502
503 include_once 'Services/Authentication/classes/class.ilSessionReminderGUI.php';
504 $session_reminder_gui = new ilSessionReminderGUI(ilSessionReminder::createInstanceWithCurrentUserSession());
505 $tpl->setVariable('SESSION_REMINDER', $session_reminder_gui->getHtml());
506 }
507
508 // these fill blocks in tpl.main.html
509 $this->fillCssFiles();
510 $this->fillInlineCss();
511 //$this->fillJavaScriptFiles();
512 $this->fillContentStyle();
513
514 // these fill just plain placeholder variables in tpl.main.html
515 $this->setCurrentBlock("DEFAULT");
516 $this->fillNewContentStyle();
517 $this->fillContentLanguage();
518 $this->fillWindowTitle();
519
520 // these fill blocks in tpl.adm_content.html
521 $this->fillHeader();
522 $this->fillSideIcons();
523 $this->fillScreenReaderFocus();
524 $this->fillStopFloating();
525 $this->fillLeftContent();
526 $this->fillLeftNav();
527 $this->fillRightContent();
528 $this->fillAdminPanel();
529 $this->fillToolbar();
530 $this->fillPermanentLink();
531
532 $this->setCenterColumnClass();
533
534 // late loading of javascipr files, since operations above may add files
535 $this->fillJavaScriptFiles();
536 $this->fillOnLoadCode();
537
538 // these fill just plain placeholder variables in tpl.adm_content.html
539 // these fill just plain placeholder variables in tpl.adm_content.html
540 if ($this->blockExists("content"))
541 {
542 $this->setCurrentBlock("content");
543 $this->fillTabs();
544 $this->fillMainContent();
545 $this->fillMainMenu();
546 $this->fillLightbox();
547 $this->parseCurrentBlock();
548 }
549 }
550
551 if ($part == "DEFAULT" or is_bool($part))
552 {
553 $html = parent::get();
554 }
555 else
556 {
557 $html = parent::get($part);
558 }
559
560 // include the template output hook
561 global $ilPluginAdmin;
562 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
563 foreach ($pl_names as $pl)
564 {
565 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
566 $gui_class = $ui_plugin->getUIClassInstance();
567
568 $resp = $gui_class->getHTML("", "template_show",
569 array("tpl_id" => $this->tplIdentifier, "tpl_obj" => $this, "html" => $html));
570
571 if ($resp["mode"] != ilUIHookPluginGUI::KEEP)
572 {
573 $html = $gui_class->modifyHTML($html, $resp);
574 }
575 }
576
577 // fix #9992: save language usages as late as possible
578 if ($this->translation_linked)
579 {
581 }
582
583 print $html;
584
585 $this->handleReferer();
586 }
if(! $in) print
static initDom()
Init YUI Dom.

References $html, $tpl, ilObjLanguageAccess\_saveUsages(), addILIASFooter(), blockExists(), fillAdminPanel(), fillBodyClass(), fillContentLanguage(), fillContentStyle(), fillCssFiles(), fillHeader(), fillInlineCss(), fillJavaScriptFiles(), fillLeftContent(), fillLeftNav(), fillLightbox(), fillMainContent(), fillMainMenu(), fillMessage(), fillNewContentStyle(), fillOnLoadCode(), fillPermanentLink(), fillRightContent(), fillScreenReaderFocus(), fillSideIcons(), fillStopFloating(), fillTabs(), fillToolbar(), fillWindowTitle(), Assetic\Cache\get(), getContentType(), getMainMenu(), ilPluginAdmin\getPluginObject(), getTabsHTML(), handleReferer(), IL_COMP_SERVICE, ilYuiUtil\initDom(), initHelp(), ilUIHookPluginGUI\KEEP, HTML_Template_IT\parseCurrentBlock(), print, setCenterColumnClass(), setCurrentBlock(), and variableExists().

+ Here is the call graph for this function:

◆ stopTitleFloating()

ilTemplate::stopTitleFloating ( )

set stop floating (if no tabs are used)

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

1829 {
1830 $this->stop_floating = true;
1831 }

◆ touchBlock() [1/2]

ilTemplate::touchBlock (   $block)

overwrites ITX::touchBlock.

@access public

Parameters
string
Returns
???

Reimplemented from HTML_Template_IT.

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

1194 {
1195 $this->setCurrentBlock($block);
1196 $count = $this->fillVars();
1197 $this->parseCurrentBlock();
1198
1199 if ($count == 0)
1200 {
1201 parent::touchBlock($block);
1202 }
1203 }

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

Referenced by ilContainerRenderer\addHeaderRow(), ilContainerRenderer\addStandardRow(), fillHeader(), fillLeftNav(), fillPageFormAction(), fillScreenReaderFocus(), fillSideIcons(), fillStopFloating(), fillTabs(), ilSurveyPageGUI\renderPageNode(), and setTabs().

+ 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
???

Reimplemented from HTML_Template_IT.

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

304 {
305 $this->setCurrentBlock($block);
306 //$count = $this->fillVars();
307 $this->parseCurrentBlock();
308
309 if ($count == 0)
310 {
311 parent::touchBlock($block);
312 }
313 }

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

+ Here is the call graph for this function:

◆ variableExists()

ilTemplate::variableExists (   $a_variablename)
private

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

1136 {
1137 return (isset($this->blockvariables["content"][$a_variablename]) ? true : false);
1138 }

Referenced by fillMainMenu(), getMainMenu(), and show().

+ Here is the caller graph for this function:

Field Documentation

◆ $activeBlock

ilTemplate::$activeBlock

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

Referenced by parseCurrentBlock().

◆ $addFooter

ilTemplate::$addFooter
private

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

Referenced by getAddFooter().

◆ $admin_panel_commands

ilTemplate::$admin_panel_commands = array()

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

◆ $content_style_sheet

ilTemplate::$content_style_sheet = ""
protected

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

◆ $contenttype

ilTemplate::$contenttype

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

Referenced by getContentType().

◆ $css_files

ilTemplate::$css_files = array()

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

◆ $header_action

ilTemplate::$header_action
protected

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

Referenced by getHeaderActionMenu().

◆ $il_cache

ilTemplate::$il_cache = array()
staticprotected

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

◆ $inline_css

ilTemplate::$inline_css = array()

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

◆ $js_files

ilTemplate::$js_files = array(0 => "./Services/JavaScript/js/Basic.js")

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

◆ $js_files_batch

ilTemplate::$js_files_batch = array("./Services/JavaScript/js/Basic.js" => 1)

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

◆ $js_files_vp

ilTemplate::$js_files_vp = array("./Services/JavaScript/js/Basic.js" => true)

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

◆ $lightbox

ilTemplate::$lightbox = array()
protected

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

◆ $message

ilTemplate::$message = array()
protected

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

◆ $mount_webfolder

ilTemplate::$mount_webfolder = ""
protected

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

Referenced by fillSideIcons().

◆ $page_actions

ilTemplate::$page_actions = array()
protected

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

◆ $page_form_action

ilTemplate::$page_form_action = ""
protected

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

◆ $permanent_link

ilTemplate::$permanent_link = false
protected

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

◆ $standard_template_loaded

ilTemplate::$standard_template_loaded = false
protected

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

◆ $stop_floating

ilTemplate::$stop_floating = ""
protected

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

◆ $title_alerts

ilTemplate::$title_alerts = array()
protected

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

◆ $title_desc

ilTemplate::$title_desc = ""
protected

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

◆ $title_url

ilTemplate::$title_url = ""
protected

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

◆ $translation_linked

ilTemplate::$translation_linked = false
protected

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

◆ $tree_flat_link

ilTemplate::$tree_flat_link = ""
protected

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

◆ $upper_icon

ilTemplate::$upper_icon = ""
protected

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

◆ $vars

ilTemplate::$vars

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

Referenced by prepareForFormular().


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