ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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=true)
 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)
 
 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

const MESSAGE_TYPE_FAILURE = 'failure'
 
const MESSAGE_TYPE_INFO = "info"
 
const MESSAGE_TYPE_SUCCESS = "success"
 
const MESSAGE_TYPE_QUESTION = "question"
 
 $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

 $tpl
 
 $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 = ""
 
 $main_content = ""
 
 $title_alerts = array()
 
 $header_action
 
 $lightbox = array()
 
 $standard_template_loaded = false
 
 $translation_linked = false
 

Static Protected Attributes

static $message_types
 
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...
 
 getMessageTextForType ($m)
 

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 = true 
)

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

Reimplemented in LTI\ilTemplate, and ilIndependentTemplate.

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

101 {
102 global $DIC;
103
104 //echo "<br>-".$file."-";
105
106 $this->activeBlock = "__global__";
107 $this->vars = array();
108 $this->addFooter = true;
109
110 $this->il_use_cache = $a_use_cache;
111 $this->il_cur_key = $file . "/" . $in_module;
112
113 $fname = $this->getTemplatePath($file, $in_module, $plugin);
114
115 $this->tplName = basename($fname);
116 $this->tplPath = dirname($fname);
117 $this->tplIdentifier = $this->getTemplateIdentifier($file, $in_module);
118
119 // set default content-type to text/html
120 $this->contenttype = "text/html";
121 if (!file_exists($fname)) {
122 if (isset($DIC["ilErr"])) {
123 $ilErr = $DIC["ilErr"];
124 $ilErr->raiseError("template " . $fname . " was not found.", $ilErr->FATAL);
125 }
126 return false;
127 }
128
129 //$this->IntegratedTemplateExtension(dirname($fname));
130 parent::__construct();
131 //$this->loadTemplatefile(basename($fname), $flag1, $flag2);
132 $this->loadTemplatefile($fname, $flag1, $flag2);
133 //add tplPath to replacevars
134 $this->vars["TPLPATH"] = $this->tplPath;
135
136 // set Options
137 if (method_exists($this, "setOption")) {
138 $this->setOption('use_preg', false);
139 }
140 $this->setBodyClass("std");
141
142 return true;
143 }
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
$ilErr
Definition: raiseError.php:18
global $DIC
Definition: saml.php:7

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

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

2261 {
2262 $this->admin_panel_commands[] =
2263 array("cmd" => $a_cmd, "txt" => $a_txt);
2264 if ($a_arrow) {
2265 $this->admin_panel_arrow = true;
2266 }
2267 $this->admin_panel_top_only = false;
2268 }

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

2276 {
2277 $this->admin_panel_commands_toolbar = $toolb;
2278 $this->admin_panel_arrow = $a_arrow;
2279 $this->admin_panel_bottom = $a_bottom_panel;
2280 }

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

1341 {
1342 global $DIC;
1343
1344 if (DEBUG) {
1345 echo "<br/>Template '" . $this->tplPath . "/" . $tplname . "'";
1346 }
1347
1348 $tplfile = $this->getTemplatePath($tplname, $in_module);
1349 if (file_exists($tplfile) == false) {
1350 echo "<br/>Template '" . $tplfile . "' doesn't exist! aborting...";
1351 return false;
1352 }
1353
1354 $id = $this->getTemplateIdentifier($tplname, $in_module);
1355 $template = $this->getFile($tplfile);
1356
1357 // include the template input hook
1358 $ilPluginAdmin = $DIC["ilPluginAdmin"];
1359 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
1360 foreach ($pl_names as $pl) {
1361 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
1362 $gui_class = $ui_plugin->getUIClassInstance();
1363
1364 $resp = $gui_class->getHTML(
1365 "",
1366 "template_add",
1367 array("tpl_id" => $id, "tpl_obj" => $this, "html" => $template)
1368 );
1369
1370 if ($resp["mode"] != ilUIHookPluginGUI::KEEP) {
1371 $template = $gui_class->modifyHTML($template, $resp);
1372 }
1373 }
1374
1375 return $this->addBlock($var, $block, $template);
1376 }
addBlock($placeholder, $blockname, $template)
Adds a block to the template changing a variable placeholder to a block placeholder.
Definition: ITX.php:241
getFile($filename)
Reads a file from disk and returns its content.
Definition: IT.php:912
const IL_COMP_SERVICE
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
if(!array_key_exists('StateId', $_REQUEST)) $id
const DEBUG

References $DIC, $id, 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 125 of file class.ilTemplate.php.

126 {
127 if (DEBUG) {
128 echo "<br/>Template '" . $this->tplPath . "/" . $tplname . "'";
129 }
130
131 $tplfile = $this->getTemplatePath($tplname, $in_module);
132 if (file_exists($tplfile) == false) {
133 echo "<br/>Template '" . $tplfile . "' doesn't exist! aborting...";
134 return false;
135 }
136
137 return parent::addBlockFile($var, $block, $tplfile);
138 }

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

2201 {
2202 if (!array_key_exists($a_css_file . $media, $this->css_files)) {
2203 $this->css_files[$a_css_file . $media] = array("file" => $a_css_file, "media" => $media);
2204 }
2205 }

◆ addCss() [2/2]

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

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

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

414 {
415 if (!array_key_exists($a_css_file . $media, $this->css_files)) {
416 $this->css_files[$a_css_file . $media] = array("file" => $a_css_file, "media" => $media);
417 }
418 }

◆ addILIASFooter()

ilTemplate::addILIASFooter ( )

add ILIAS footer

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

876 {
877 global $DIC;
878
879 $ilSetting = $DIC->settings();
880
881 $lng = $DIC->language();
882
883 $ilCtrl = $DIC->ctrl();
884 $ilDB = $DIC->database();
885
886 if (!$this->getAddFooter()) {
887 return;
888 }
889
890 $ftpl = new ilTemplate("tpl.footer.html", true, true, "Services/UICore");
891
892 $php = "";
893 if (DEVMODE) {
894 $php = ", PHP " . phpversion();
895 }
896 $ftpl->setVariable("ILIAS_VERSION", $ilSetting->get("ilias_version") . $php);
897
898 $link_items = array();
899
900 // imprint
901 include_once "Services/Imprint/classes/class.ilImprint.php";
902 if ($_REQUEST["baseClass"] != "ilImprintGUI" && ilImprint::isActive()) {
903 include_once "Services/Link/classes/class.ilLink.php";
904 $link_items[ilLink::_getStaticLink(0, "impr")] = array($lng->txt("imprint"), true);
905 }
906
907 // system support contacts
908 include_once("./Modules/SystemFolder/classes/class.ilSystemSupportContactsGUI.php");
910 $link_items[$l] = array(ilSystemSupportContactsGUI::getFooterText(), false);
911 }
912
913 if (DEVMODE) {
914 if (function_exists("tidy_parse_string")) {
915 $link_items[ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=xhtml")] = array("Validate", true);
916 $link_items[ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=accessibility")] = array("Accessibility", true);
917 }
918 }
919
920 // output translation link
921 include_once("Services/Language/classes/class.ilObjLanguageAccess.php");
923 // fix #9992: remember linked translation instead of saving language usages here
924 $this->translation_linked = true;
925 $link_items[ilObjLanguageAccess::_getTranslationLink()] = array($lng->txt('translation'), true);
926 }
927
928 $cnt = 0;
929 foreach ($link_items as $url => $caption) {
930 $cnt++;
931 if ($caption[1]) {
932 $ftpl->touchBlock("blank");
933 }
934 if ($cnt < sizeof($link_items)) {
935 $ftpl->touchBlock("item_separator");
936 }
937
938 $ftpl->setCurrentBlock("items");
939 $ftpl->setVariable("URL_ITEM", ilUtil::secureUrl($url));
940 $ftpl->setVariable("TXT_ITEM", $caption[0]);
941 $ftpl->parseCurrentBlock();
942 }
943
944 if (DEVMODE) {
945 // execution time
946 $t1 = explode(" ", $GLOBALS['ilGlobalStartTime']);
947 $t2 = explode(" ", microtime());
948 $diff = $t2[0] - $t1[0] + $t2[1] - $t1[1];
949
950 $mem_usage = array();
951 if (function_exists("memory_get_usage")) {
952 $mem_usage[] =
953 "Memory Usage: " . memory_get_usage() . " Bytes";
954 }
955 if (function_exists("xdebug_peak_memory_usage")) {
956 $mem_usage[] =
957 "XDebug Peak Memory Usage: " . xdebug_peak_memory_usage() . " Bytes";
958 }
959 $mem_usage[] = round($diff, 4) . " Seconds";
960
961 if (sizeof($mem_usage)) {
962 $ftpl->setVariable("MEMORY_USAGE", "<br>" . implode(" | ", $mem_usage));
963 }
964
965 if (!empty($_GET["do_dev_validate"]) && $ftpl->blockExists("xhtml_validation")) {
966 require_once("Services/XHTMLValidator/classes/class.ilValidatorAdapter.php");
967 $template2 = clone($this);
968 //echo "-".ilValidatorAdapter::validate($template2->get(), $_GET["do_dev_validate"])."-";
969 $ftpl->setCurrentBlock("xhtml_validation");
970 $ftpl->setVariable(
971 "VALIDATION",
972 ilValidatorAdapter::validate($template2->get(
973 "DEFAULT",
974 false,
975 false,
976 false,
977 true
978 ), $_GET["do_dev_validate"])
979 );
980 $ftpl->parseCurrentBlock();
981 }
982
983 // controller history
984 if (is_object($ilCtrl) && $ftpl->blockExists("c_entry") &&
985 $ftpl->blockExists("call_history")) {
986 $hist = $ilCtrl->getCallHistory();
987 foreach ($hist as $entry) {
988 $ftpl->setCurrentBlock("c_entry");
989 $ftpl->setVariable("C_ENTRY", $entry["class"]);
990 if (is_object($ilDB)) {
991 $file = $ilCtrl->lookupClassPath($entry["class"]);
992 $add = $entry["mode"] . " - " . $entry["cmd"];
993 if ($file != "") {
994 $add .= " - " . $file;
995 }
996 $ftpl->setVariable("C_FILE", $add);
997 }
998 $ftpl->parseCurrentBlock();
999 }
1000 $ftpl->setCurrentBlock("call_history");
1001 $ftpl->parseCurrentBlock();
1002
1003 $ftpl->setCurrentBlock("call_history");
1004 $ftpl->parseCurrentBlock();
1005 }
1006
1007 // included files
1008 if (is_object($ilCtrl) && $ftpl->blockExists("i_entry") &&
1009 $ftpl->blockExists("included_files")) {
1010 $fs = get_included_files();
1011 $ifiles = array();
1012 $total = 0;
1013 foreach ($fs as $f) {
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 $ftpl->setCurrentBlock("i_entry");
1020 $ftpl->setVariable("I_ENTRY", $f["file"] . " (" . $f["size"] . " Bytes, " . round(100 / $total * $f["size"], 2) . "%)");
1021 $ftpl->parseCurrentBlock();
1022 }
1023 $ftpl->setCurrentBlock("i_entry");
1024 $ftpl->setVariable("I_ENTRY", "Total (" . $total . " Bytes, 100%)");
1025 $ftpl->parseCurrentBlock();
1026 $ftpl->setCurrentBlock("included_files");
1027 $ftpl->parseCurrentBlock();
1028 }
1029 }
1030
1031 // BEGIN Usability: Non-Delos Skins can display the elapsed time in the footer
1032 // The corresponding $ilBench->start invocation is in inc.header.php
1033 $ilBench = $DIC["ilBench"];
1034 $ilBench->stop("Core", "ElapsedTimeUntilFooter");
1035 $ftpl->setVariable(
1036 "ELAPSED_TIME",
1037 ", " . number_format($ilBench->getMeasuredTime("Core", "ElapsedTimeUntilFooter"), 1) . ' seconds'
1038 );
1039 // END Usability: Non-Delos Skins can display the elapsed time in the footer
1040
1041 $this->setVariable("FOOTER", $ftpl->get());
1042 }
$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)
global $ilBench
Definition: ilias.php:18
global $ilCtrl
Definition: ilias.php:18
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
global $ilSetting
Definition: privfeed.php:17
$url
$lng
global $ilDB
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']

References $_GET, $_SERVER, $DIC, $f, $GLOBALS, $ilBench, $ilCtrl, $ilDB, $ilSetting, $l, $lng, $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 2210 of file class.ilTemplate.php.

2211 {
2212 $this->inline_css[] = array("css" => $a_css, "media" => $media);
2213 }

◆ addJavaScript() [1/2]

ilTemplate::addJavaScript (   $a_js_file)

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

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

390 {
391 if (!in_array($a_js_file, $this->js_files)) {
392 $this->js_files[] = $a_js_file;
393 }
394 }

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

2143 {
2144 // three batches currently
2145 if ($a_batch < 1 || $a_batch > 3) {
2146 $a_batch = 2;
2147 }
2148
2149 // ensure jquery files being loaded first
2150 if (is_int(strpos($a_js_file, "Services/jQuery")) ||
2151 is_int(strpos($a_js_file, "/jquery.js")) ||
2152 is_int(strpos($a_js_file, "/jquery-min.js"))) {
2153 $a_batch = 0;
2154 }
2155
2156 if (!in_array($a_js_file, $this->js_files)) {
2157 $this->js_files[] = $a_js_file;
2158 $this->js_files_vp[$a_js_file] = $a_add_version_parameter;
2159 $this->js_files_batch[$a_js_file] = $a_batch;
2160 }
2161 }

◆ addLightbox()

ilTemplate::addLightbox (   $a_html,
  $a_id 
)

Add lightbox html.

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

2219 {
2220 $this->lightbox[$a_id] = $a_html;
2221 }

◆ addOnLoadCode()

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

Add on load code.

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

2189 {
2190 // three batches currently
2191 if ($a_batch < 1 || $a_batch > 3) {
2192 $a_batch = 2;
2193 }
2194 $this->on_load_code[$a_batch][] = $a_code;
2195 }

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

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

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

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

◆ buildLoginTarget()

static ilTemplate::buildLoginTarget ( )
static

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

Returns
string

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

2452 {
2453 global $DIC;
2454
2455 $tree = $DIC->repositoryTree();
2456 $ilUser = $DIC->user();
2457
2458 $target_str = "";
2459
2460 // repository
2461 if ($_GET["ref_id"] != "") {
2462 if ($tree->isInTree($_GET["ref_id"]) && $_GET["ref_id"] != $tree->getRootId()) {
2463 $obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
2464 $type = ilObject::_lookupType($obj_id);
2465 $target_str = $type . "_" . $_GET["ref_id"];
2466 }
2467 }
2468 // personal workspace
2469 elseif ($_GET["wsp_id"] != "" && $_GET["wsp_id"] > 0) {
2470 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
2471 $tree = new ilWorkspaceTree($ilUser->getId());
2472 $obj_id = $tree->lookupObjectId((int) $_GET["wsp_id"]);
2473 if ($obj_id) {
2474 $type = ilObject::_lookupType($obj_id);
2475 $target_str = $type . "_" . (int) $_GET["wsp_id"] . "_wsp";
2476 }
2477 }
2478 // portfolio
2479 elseif ($_GET["prt_id"] != "") {
2480 $target_str = "prtf_" . (int) $_GET["prt_id"];
2481 }
2482
2483 return $target_str;
2484 }
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
Tree handler for personal workspace.
$type
$ilUser
Definition: imgupload.php:18

References $_GET, $DIC, $ilUser, $tree, $type, 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 1295 of file class.ilTemplate.php.

1296 {
1297 return array_key_exists($a_topic, $this->blockvariables[$a_block]);
1298 }

Referenced by includeNavigation(), and includeTree().

+ Here is the caller graph for this function:

◆ clearHeader()

ilTemplate::clearHeader ( )

Clear header.

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

1647 {
1648 $this->setTitle("");
1649 $this->setTitleIcon("");
1650 $this->setDescription("");
1651 $this->setAlertProperties(array());
1652 }
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 2516 of file class.ilTemplate.php.

2517 {
2518 $this->enable_fileupload = $a_ref_id;
2519 }

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

1326 {
1327 return file_exists($this->tplPath . "/" . $filename);
1328 }
$filename
Definition: buildRTE.php:89

References $filename.

◆ fillAdminPanel()

ilTemplate::fillAdminPanel ( )

Put admin panel into template:

  • creation selector
  • admin view on/off button

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

2288 {
2289 global $DIC;
2290
2291 $lng = $DIC->language();
2292
2293 $adm_view_cmp = $adm_cmds = $adm_view = false;
2294
2295 $toolb = new ilToolbarGUI();
2296
2297 // admin panel commands
2298 if ((count($this->admin_panel_commands) > 0)) {
2299 foreach ($this->admin_panel_commands as $cmd) {
2300 $toolb->addFormButton($cmd["txt"], $cmd["cmd"]);
2301 }
2302 $adm_cmds = true;
2303 } elseif ($this->admin_panel_commands_toolbar instanceof ilToolbarGUI) {
2304 $toolb = $this->admin_panel_commands_toolbar;
2305 $adm_cmds = true;
2306 }
2307 // Add arrow if desired
2308 if ($this->admin_panel_arrow) {
2309 $toolb->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), $lng->txt("actions"));
2310 }
2311
2312 if ($adm_cmds) {
2313 $this->fillPageFormAction();
2314
2315 $this->setCurrentBlock("adm_view_components");
2316 $this->setVariable("ADM_PANEL1", $toolb->getHTML());
2317 $this->parseCurrentBlock();
2318 $adm_view_cmp = true;
2319 }
2320
2321 // admin view button
2322 if ($this->page_actions != "") {
2323 $this->setVariable("PAGE_ACTIONS", $this->page_actions);
2324 $adm_view = true;
2325 }
2326
2327 // creation selector
2328 // see: ilObjectAddNewItemGUI
2329 // placeholder "SELECT_OBJTYPE_REPOS" still needed!
2330
2331 if ($adm_cmds and $this->admin_panel_bottom) {
2332 $this->setCurrentBlock("adm_view_components2");
2333 if ($this->admin_panel_arrow) {
2334 $toolb->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), $lng->txt("actions"));
2335 }
2336 $this->setVariable("ADM_PANEL2", $toolb->getHTML());
2337
2338 $this->parseCurrentBlock();
2339 }
2340 }
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)

References $DIC, $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 1755 of file class.ilTemplate.php.

1756 {
1757 if ($this->body_class != "" && $this->blockExists("body_class")) {
1758 $this->setCurrentBlock("body_class");
1759 $this->setVariable("BODY_CLASS", $this->body_class);
1760 $this->parseCurrentBlock();
1761 }
1762 }
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 615 of file class.ilTemplate.php.

616 {
617 global $DIC;
618
619 $lng = $DIC->language();
620 $ilUser = $DIC->user();
621
622 $contentLanguage = 'en';
623 $rtl = array('ar','fa','ur','he');//, 'de'); //make a list of rtl languages
624 /* rtl-review: add "de" for testing with ltr lang shown in rtl
625 * and set unicode-bidi to bidi-override for mirror effect */
626 $textdir = 'ltr';
627 if (is_object($ilUser)) {
628 if ($ilUser->getLanguage()) {
629 $contentLanguage = $ilUser->getLanguage();
630 } elseif (is_object($lng)) {
631 $contentLanguage = $lng->getDefaultLanguage();
632 }
633 if ($ilUser->getId() == ANONYMOUS_USER_ID && is_object($lng)) {
634 $contentLanguage = $lng->getLangKey();
635 }
636 }
637 $this->setVariable('META_CONTENT_LANGUAGE', $contentLanguage);
638 if (in_array($contentLanguage, $rtl)) {
639 $textdir = 'rtl';
640 }
641 $this->setVariable('LANGUAGE_DIRECTION', $textdir);
642 return true;
643 }

References $DIC, $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 814 of file class.ilTemplate.php.

815 {
816 if ($this->content_style_sheet != "") {
817 $this->setCurrentBlock("ContentStyle");
818 $this->setVariable(
819 "LOCATION_CONTENT_STYLESHEET",
820 $this->content_style_sheet
821 );
822 $this->parseCurrentBlock();
823 }
824 }

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

767 {
768 if (!$this->blockExists("css_file")) {
769 return;
770 }
771 foreach ($this->css_files as $css) {
772 $filename = $css["file"];
773 if (strpos($filename, "?") > 0) {
774 $filename = substr($filename, 0, strpos($filename, "?"));
775 }
776 if (is_file($filename) || $a_force) {
777 $this->setCurrentBlock("css_file");
778 $this->setVariable("CSS_FILE", $css["file"]);
779 $this->setVariable("CSS_MEDIA", $css["media"]);
780 $this->parseCurrentBlock();
781 }
782 }
783 }

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

426 {
427 if (!$this->blockExists("css_file")) {
428 return;
429 }
430 foreach ($this->css_files as $css) {
431 $filename = $css["file"];
432 if (strpos($filename, "?") > 0) {
433 $filename = substr($filename, 0, strpos($filename, "?"));
434 }
435 if (is_file($filename) || $a_force) {
436 $this->setCurrentBlock("css_file");
437 $this->setVariable("CSS_FILE", $css["file"]);
438 $this->setVariable("CSS_MEDIA", $css["media"]);
439 $this->parseCurrentBlock();
440 }
441 }
442 }

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

1659 {
1660 global $DIC;
1661
1662 $lng = $DIC->language();
1663
1664 $icon = false;
1665 if ($this->icon_path != "") {
1666 $icon = true;
1667 $this->setCurrentBlock("header_image");
1668 if ($this->icon_desc != "") {
1669 $this->setVariable("IMAGE_DESC", $lng->txt("icon") . " " . $this->icon_desc);
1670 $this->setVariable("IMAGE_ALT", $lng->txt("icon") . " " . $this->icon_desc);
1671 }
1672
1673 $this->setVariable("IMG_HEADER", $this->icon_path);
1674 $this->parseCurrentBlock();
1675 $header = true;
1676 }
1677
1678 if ($this->title != "") {
1679 $this->title = ilUtil::stripScriptHTML($this->title);
1680 $this->setVariable("HEADER", $this->title);
1681 if ($this->title_url != "") {
1682 $this->setVariable("HEADER_URL", ' href="' . $this->title_url . '"');
1683 }
1684 if ($this->getTitleColor() != "") {
1685 $this->setVariable("HEADER_COLOR", " style=\"color: #" . $this->getTitleColor() . "\"");
1686 }
1687
1688 if ($icon) {
1689 //$this->setVariable("HICONCL", "ilHeaderHasIcon");
1690 }
1691 $header = true;
1692 }
1693
1694 if ($header) {
1695 $this->setCurrentBlock("header_image");
1696 $this->parseCurrentBlock();
1697 }
1698
1699 if ($this->title_desc != "") {
1700 $this->setCurrentBlock("header_desc");
1701 $this->setVariable("H_DESCRIPTION", $this->title_desc);
1702 $this->parseCurrentBlock();
1703 }
1704
1705 $header = $this->getHeaderActionMenu();
1706 if ($header) {
1707 $this->setCurrentBlock("head_action_inner");
1708 $this->setVariable("HEAD_ACTION", $header);
1709 $this->parseCurrentBlock();
1710 $this->setCurrentBlock("head_action");
1711 $this->parseCurrentBlock();
1712 }
1713
1714 if (count((array) $this->title_alerts)) {
1715 foreach ($this->title_alerts as $alert) {
1716 $this->setCurrentBlock('header_alert');
1717 if (!($alert['propertyNameVisible'] === false)) {
1718 $this->setVariable('H_PROP', $alert['property'] . ':');
1719 }
1720 $this->setVariable('H_VALUE', $alert['value']);
1721 $this->parseCurrentBlock();
1722 }
1723 }
1724
1725 // add file upload drop zone in header
1726 if ($this->enable_fileupload != null) {
1727 $ref_id = $this->enable_fileupload;
1728 $upload_id = "dropzone_" . $ref_id;
1729
1730 include_once("./Services/FileUpload/classes/class.ilFileUploadGUI.php");
1731 $upload = new ilFileUploadGUI($upload_id, $ref_id, true);
1732
1733 $this->setVariable("FILEUPLOAD_DROPZONE_ID", " id=\"$upload_id\"");
1734
1735 $this->setCurrentBlock("header_fileupload");
1736 $this->setVariable("HEADER_FILEUPLOAD_SCRIPT", $upload->getHTML());
1737 $this->parseCurrentBlock();
1738 }
1739 }
getHeaderActionMenu()
Get header action menu.
getTitleColor()
Get title color.
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...

References $DIC, $header, $lng, getHeaderActionMenu(), getTitleColor(), HTML_Template_IT\parseCurrentBlock(), setCurrentBlock(), 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:

◆ fillInlineCss()

ilTemplate::fillInlineCss ( )

Fill in the inline css.

Parameters
boolean$a_force

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

791 {
792 if (!$this->blockExists("css_inline")) {
793 return;
794 }
795 foreach ($this->inline_css as $css) {
796 $this->setCurrentBlock("css_inline");
797 $this->setVariable("CSS_INLINE", $css["css"]);
798 //$this->setVariable("CSS_MEDIA", $css["media"]);
799 $this->parseCurrentBlock();
800 }
801 }

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

150 {
151 $this->setCurrentBlock("js_file");
152 if ($this->js_files_vp[$file]) {
153 $this->setVariable("JS_FILE", ilUtil::appendUrlParameterString($file, $vers));
154 } else {
155 $this->setVariable("JS_FILE", $file);
156 }
157 $this->parseCurrentBlock();
158 }

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

729 {
730 global $DIC;
731
732 $ilSetting = $DIC->settings();
733
734 if (is_object($ilSetting)) { // maybe this one can be removed
735 $vers = "vers=" . str_replace(array(".", " "), "-", $ilSetting->get("ilias_version"));
736
737 if (DEVMODE) {
738 $vers .= '-' . time();
739 }
740 }
741 if ($this->blockExists("js_file")) {
742 // three batches
743 for ($i = 0; $i <= 3; $i++) {
744 reset($this->js_files);
745 foreach ($this->js_files as $file) {
746 if ($this->js_files_batch[$file] == $i) {
747 if (is_file($file) || substr($file, 0, 4) == "http" || substr($file, 0, 2) == "//" || $a_force) {
748 $this->fillJavascriptFile($file, $vers);
749 } elseif (substr($file, 0, 2) == './') { // #13962
750 $url_parts = parse_url($file);
751 if (is_file($url_parts['path'])) {
752 $this->fillJavascriptFile($file, $vers);
753 }
754 }
755 }
756 }
757 }
758 }
759 }
fillJavascriptFile($file, $vers)
$i
Definition: disco.tpl.php:19

References $DIC, $i, $ilSetting, blockExists(), and fillJavascriptFile().

+ Here is the call graph for this function:

◆ fillJavaScriptFiles() [2/2]

ilTemplate::fillJavaScriptFiles ( )

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

397 {
398 global $ilias,$ilTabs;
399 if ($this->blockExists("js_file")) {
400 foreach ($this->js_files as $file) {
401 if (is_file($file) || substr($file, 0, 4) == "http") {
402 $this->setCurrentBlock("js_file");
403 $this->setVariable("JS_FILE", $file);
404 $this->parseCurrentBlock();
405 }
406 }
407 }
408 }

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:

◆ fillLeftContent()

ilTemplate::fillLeftContent ( )
private

Fill left content.

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

1894 {
1895 if (trim($this->left_content) != "") {
1896 $this->setCurrentBlock("left_column");
1897 $this->setVariable("LEFT_CONTENT", $this->left_content);
1898 $left_col_class = (trim($this->right_content) == "")
1899 ? "col-sm-3 col-sm-pull-9"
1900 : "col-sm-3 col-sm-pull-6";
1901 $this->setVariable("LEFT_COL_CLASS", $left_col_class);
1902 $this->parseCurrentBlock();
1903 }
1904 }

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

1918 {
1919 if (trim($this->left_nav_content) != "") {
1920 $this->setCurrentBlock("left_nav");
1921 $this->setVariable("LEFT_NAV_CONTENT", $this->left_nav_content);
1922 $this->parseCurrentBlock();
1923 $this->touchBlock("left_nav_space");
1924 }
1925 }
touchBlock($block)
overwrites ITX::touchBlock.

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

2230 {
2231 $html = "";
2232
2233 foreach ($this->lightbox as $lb) {
2234 $html .= $lb;
2235 }
2236 $this->setVariable("LIGHTBOX", $html);
2237 }
$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 1829 of file class.ilTemplate.php.

1830 {
1831 if (trim($this->main_content) != "") {
1832 $this->setVariable("ADM_CONTENT", $this->main_content);
1833 }
1834 }

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

853 {
854 global $DIC;
855 $tpl = $DIC["tpl"];
856 if ($this->variableExists('MAINMENU')) {
857 $tpl->setVariable("MAINMENU", $this->main_menu);
858 $tpl->setVariable("MAINMENU_SPACER", $this->main_menu_spacer);
859 }
860 }
variableExists($a_variablename)

References $DIC, $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 381 of file class.ilTemplate.php.

382 {
383 global $DIC;
384
385 $ms = array( self::MESSAGE_TYPE_INFO,
386 self::MESSAGE_TYPE_SUCCESS, self::MESSAGE_TYPE_FAILURE,
387 self::MESSAGE_TYPE_QUESTION
388 );
389 $out = "";
390
391 foreach ($ms as $m) {
392 if ($m == self::MESSAGE_TYPE_QUESTION) {
393 $m = "mess_question";
394 }
395 $txt = $this->getMessageTextForType($m);
396
397 if ($m == "mess_question") {
399 }
400
401 if ($txt != "") {
402 // this is a workaround that allows to send rendered message boxes directly
403 // should be removed if we have a decent place for messages in a new ks layout
404 if (strpos($txt, 'role="alert"') > 0) {
405 $out .= $txt;
406 } else {
407 $out .= $this->getMessageHTML($txt, $m);
408 }
409 }
410
411 if ($m == self::MESSAGE_TYPE_QUESTION) {
412 $m = "mess_question";
413 }
414
415 $request = $DIC->http()->request();
416 $accept_header = $request->getHeaderLine('Accept');
417 if (isset($_SESSION[$m]) && $_SESSION[$m] && ($accept_header !== 'application/json')) {
418 unset($_SESSION[$m]);
419 }
420 }
421
422 if ($out != "") {
423 $this->setVariable("MESSAGE", $out);
424 }
425 }
foreach($paths as $path) $request
Definition: asyncclient.php:32
$_SESSION["AccountId"]
const MESSAGE_TYPE_QUESTION
getMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
$txt
Definition: error.php:11

References $_SESSION, $DIC, $m, $out, $request, $txt, getMessageHTML(), getMessageTextForType(), MESSAGE_TYPE_QUESTION, 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 331 of file class.ilTemplate.php.

332 {
333 global $lng;
334
335 $ms = array("info", "success", "failure", "question");
336 $out = "";
337
338 foreach ($ms as $m) {
339 if ($m == "question") {
340 $m = "mess_question";
341 }
342
343 $txt = (ilSession::get($m) != "")
345 : $this->message[$m];
346
347 if ($m == "mess_question") {
348 $m = "question";
349 }
350
351 if ($txt != "") {
352 $mtpl = new ilTemplate("tpl.message.html", true, true, "Services/Utilities");
353 $mtpl->setCurrentBlock($m . "_message");
354 $mtpl->setVariable("TEXT", $txt);
355 $mtpl->setVariable("MESSAGE_HEADING", $lng->txt($m . "_message"));
356 $mtpl->parseCurrentBlock();
357 $out .= $mtpl->get();
358 }
359
360 if ($m == "question") {
361 $m = "mess_question";
362 }
363
364 if (ilSession::get($m)) {
366 }
367 }
368
369 if ($out != "") {
370 $this->setVariable("MESSAGE", $out);
371 }
372 }
static clear($a_var)
Unset a value.
static get($a_var)
Get a value.

References $lng, $m, $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 829 of file class.ilTemplate.php.

830 {
831 $this->setVariable(
832 "LOCATION_NEWCONTENT_STYLESHEET_TAG",
833 '<link rel="stylesheet" type="text/css" href="' .
835 . '" />'
836 );
837 }
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 2375 of file class.ilTemplate.php.

2376 {
2377 for ($i = 1; $i <= 3; $i++) {
2378 if (is_array($this->on_load_code[$i])) {
2379 $this->setCurrentBlock("on_load_code");
2380 foreach ($this->on_load_code[$i] as $code) {
2381 $this->setCurrentBlock("on_load_code_inner");
2382 $this->setVariable("OLCODE", $code);
2383 $this->parseCurrentBlock();
2384 }
2385 $this->setCurrentBlock("on_load_code");
2386 $this->parseCurrentBlock();
2387 }
2388 }
2389 }
$code
Definition: example_050.php:99

References $code, $i, 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 718 of file class.ilTemplate.php.

719 {
720 if ($this->page_form_action != "") {
721 $this->setCurrentBlock("page_form_start");
722 $this->setVariable("PAGE_FORM_ACTION", $this->page_form_action);
723 $this->parseCurrentBlock();
724 $this->touchBlock("page_form_end");
725 }
726 }

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

2356 {
2357 if (is_array($this->permanent_link)) {
2358 include_once("./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
2359 $plinkgui = new ilPermanentLinkGUI(
2360 $this->permanent_link["type"],
2361 $this->permanent_link["id"],
2362 $this->permanent_link["append"],
2363 $this->permanent_link["target"]
2364 );
2365 if ($this->permanent_link["title"] != "") {
2366 $plinkgui->setTitle($this->permanent_link["title"]);
2367 }
2368 $this->setVariable("PRMLINK", $plinkgui->getHTML());
2369 }
2370 }
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 1847 of file class.ilTemplate.php.

1848 {
1849 if (trim($this->right_content) != "") {
1850 $this->setCurrentBlock("right_column");
1851 $this->setVariable("RIGHT_CONTENT", $this->right_content);
1852 $this->parseCurrentBlock();
1853 }
1854 }

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

2017 {
2018 global $DIC;
2019
2020 $ilUser = $DIC->user();
2021
2022 if (is_object($ilUser) && $ilUser->getPref("screen_reader_optimization") && $this->blockExists("sr_focus")) {
2023 $this->touchBlock("sr_focus");
2024 }
2025 }

References $DIC, $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 2030 of file class.ilTemplate.php.

2031 {
2032 global $DIC;
2033
2034 $ilSetting = $DIC->settings();
2035
2036 $lng = $DIC->language();
2037
2038 if ($this->upper_icon == "" && $this->tree_flat_link == ""
2039 && $this->mount_webfolder == "") {
2040 return;
2041 }
2042
2043 // upper icon
2044 // deprecated
2045 if ($this->upper_icon != "") {
2046 /*if ($this->upper_icon_frame != "")
2047 {
2048 $this->setCurrentBlock("target_top");
2049 $this->setVariable("TARGET_TOP", $this->upper_icon_frame);
2050 $this->parseCurrentBlock();
2051 }
2052
2053 $this->setCurrentBlock("alt_top");
2054 $this->setVariable("ALT_TOP", $lng->txt("up"));
2055 $this->parseCurrentBlock();
2056
2057 $this->setCurrentBlock("top");
2058 $this->setVariable("LINK_TOP", $this->upper_icon);
2059 $this->parseCurrentBlock();*/
2060 }
2061
2062 // tree/flat icon
2063 if ($this->tree_flat_link != "") {
2064 if ($this->left_nav_content != "") {
2065 $this->touchBlock("tree_lns");
2066 }
2067
2068 $this->setCurrentBlock("tree_mode");
2069 $this->setVariable("LINK_MODE", $this->tree_flat_link);
2070 if ($ilSetting->get("tree_frame") == "right") {
2071 if ($this->tree_flat_mode == "tree") {
2072 $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
2073 $this->setVariable("RIGHT", "Right");
2074 } else {
2075 $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
2076 $this->setVariable("RIGHT", "Right");
2077 }
2078 } else {
2079 if ($this->tree_flat_mode == "tree") {
2080 $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
2081 } else {
2082 $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
2083 }
2084 }
2085 $this->setVariable("ALT_TREE", $lng->txt($this->tree_flat_mode . "view"));
2086 $this->setVariable("TARGET_TREE", ilFrameTargetInfo::_getFrame("MainContent"));
2087 include_once("./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
2088 $this->setVariable(
2089 "TREE_ACC_KEY",
2090 ilAccessKeyGUI::getAttribute(($this->tree_flat_mode == "tree")
2093 );
2094 $this->parseCurrentBlock();
2095 }
2096
2097 // mount webfolder
2098 if ($this->mount_webfolder != "") {
2099 require_once('Services/WebDAV/classes/class.ilWebDAVUtil.php');
2100 $dav_util = ilWebDAVUtil::getInstance();
2101 $a_ref_id = $this->mount_webfolder;
2102 $a_link = $dav_util->getMountURI($a_ref_id);
2103 $a_folder = $dav_util->getFolderURI($a_ref_id);
2104
2105 $this->setCurrentBlock("mount_webfolder");
2106 $this->setVariable("LINK_MOUNT_WEBFOLDER", $a_link);
2107 $this->setVariable("FOLDER_MOUNT_WEBFOLDER", $a_folder);
2108 $this->setVariable("IMG_MOUNT_WEBFOLDER", ilUtil::getImagePath("ic_mount_webfolder.png"));
2109 $this->setVariable("ALT_MOUNT_WEBFOLDER", $lng->txt("mount_webfolder"));
2110 $this->setVariable("TARGET_MOUNT_WEBFOLDER", '_blank');
2111 $this->parseCurrentBlock();
2112 }
2113
2114 $this->setCurrentBlock("tree_icons");
2115 $this->parseCurrentBlock();
2116 }
static getAttribute($a_func_id)
Get accesskey HTML attribute.
static _getFrame($a_class, $a_type='')
Get content frame name.
static getInstance()
Get singleton instance.

References $DIC, $ilSetting, $lng, $mount_webfolder, ilFrameTargetInfo\_getFrame(), ilAccessKeyGUI\getAttribute(), ilUtil\getImagePath(), ilWebDAVUtil\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 1789 of file class.ilTemplate.php.

1790 {
1791 if ($this->stop_floating) {
1792 $this->touchBlock("stop_floating");
1793 }
1794 }

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

689 {
690 if ($this->blockExists("tabs_outer_start")) {
691 $this->touchBlock("tabs_outer_start");
692 $this->touchBlock("tabs_outer_end");
693 $this->touchBlock("tabs_inner_start");
694 $this->touchBlock("tabs_inner_end");
695
696 if ($this->thtml != "") {
697 $this->setVariable("TABS", $this->thtml);
698 }
699 $this->setVariable("SUB_TABS", $this->sthtml);
700 }
701 }

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

704 {
705 global $DIC;
706
707 $ilToolbar = $DIC["ilToolbar"];
708 ;
709
710 $thtml = $ilToolbar->getHTML();
711 if ($thtml != "") {
712 $this->setCurrentBlock("toolbar_buttons");
713 $this->setVariable("BUTTONS", $thtml);
714 $this->parseCurrentBlock();
715 }
716 }

References $DIC, 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 1128 of file class.ilTemplate.php.

1129 {
1130 $count = 0;
1131 reset($this->vars);
1132
1133 foreach ($this->vars as $key => $val) {
1134 if (is_array($this->blockvariables[$this->activeBlock])) {
1135 if (array_key_exists($key, $this->blockvariables[$this->activeBlock])) {
1136 $count++;
1137
1138 $this->setVariable($key, $val);
1139 }
1140 }
1141 }
1142
1143 return $count;
1144 }
$key
Definition: croninfo.php:18

References $key, and 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 645 of file class.ilTemplate.php.

646 {
647 global $DIC;
648
649 $ilSetting = $DIC->settings();
650
651 if ($this->header_page_title != "") {
652 $a_title = ilUtil::stripScriptHTML($this->header_page_title);
653 $this->setVariable("PAGETITLE", "- " . $a_title);
654 }
655
656 if ($ilSetting->get('short_inst_name') != "") {
657 $this->setVariable(
658 "WINDOW_TITLE",
659 $ilSetting->get('short_inst_name')
660 );
661 } else {
662 $this->setVariable(
663 "WINDOW_TITLE",
664 "ILIAS"
665 );
666 }
667 }

References $DIC, $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 (   $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

Reimplemented in ilIndependentTemplate.

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

246 {
247 global $DIC;
248
249 if ($add_error_mess) {
250 $this->fillMessage();
251 }
252
253 if ($add_ilias_footer) {
254 $this->addILIASFooter();
255 }
256
257 // set standard parts (tabs and title icon)
258 if ($add_standard_elements) {
259 if ($this->blockExists("content") && $a_tabs) {
260 // determine default screen id
261 $this->getTabsHTML();
262 }
263
264 // to get also the js files for the main menu
265 $this->getMainMenu();
266 $this->initHelp();
267
268 // these fill blocks in tpl.main.html
269 $this->fillCssFiles();
270 $this->fillInlineCss();
271 $this->fillContentStyle();
272 $this->fillBodyClass();
273
274 // these fill just plain placeholder variables in tpl.main.html
275 $this->setCurrentBlock("DEFAULT");
276 $this->fillNewContentStyle();
277 $this->fillContentLanguage();
278 $this->fillWindowTitle();
279
280 // these fill blocks in tpl.adm_content.html
281 $this->fillHeader();
282 $this->fillSideIcons();
283 $this->fillScreenReaderFocus();
284 $this->fillStopFloating();
285 $this->fillLeftContent();
286 $this->fillLeftNav();
287 $this->fillRightContent();
288 $this->fillAdminPanel();
289 $this->fillToolbar();
290 $this->fillPermanentLink();
291
292 $this->setCenterColumnClass();
293
294 // late loading of javascipr files, since operations above may add files
295 $this->fillJavaScriptFiles();
296 $this->fillOnLoadCode();
297
298 // these fill just plain placeholder variables in tpl.adm_content.html
299 if ($this->blockExists("content")) {
300 $this->setCurrentBlock("content");
301 if ($a_tabs) {
302 $this->fillTabs();
303 }
304 $this->fillMainContent();
305 if ($a_main_menu) {
306 $this->fillMainMenu();
307 }
308 $this->fillLightbox();
309 $this->parseCurrentBlock();
310 }
311 }
312
313 if ($handle_referer) {
314 $this->handleReferer();
315 }
316
317 if ($part == "DEFAULT") {
318 $html = parent::get();
319 } else {
320 $html = parent::get($part);
321 }
322
323 // include the template output hook
324 $ilPluginAdmin = $DIC["ilPluginAdmin"];
325 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
326 foreach ($pl_names as $pl) {
327 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
328 $gui_class = $ui_plugin->getUIClassInstance();
329
330 $resp = $gui_class->getHTML(
331 "",
332 "template_get",
333 array("tpl_id" => $this->tplIdentifier, "tpl_obj" => $this, "html" => $html)
334 );
335
336 if ($resp["mode"] != ilUIHookPluginGUI::KEEP) {
337 $html = $gui_class->modifyHTML($html, $resp);
338 }
339 }
340
341 // fix #9992: save language usages as late as possible
342 if ($this->translation_linked) {
344 }
345
346 return $html;
347 }
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!?...
get(string $class_name)

References $DIC, $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(), ILIAS\GlobalScreen\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:

◆ get() [2/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.

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

446 {
447 if ($part == "DEFAULT") {
448 return parent::get();
449 } else {
450 return parent::get($part);
451 }
452 }

References ILIAS\GlobalScreen\get().

+ Here is the call graph for this function:

◆ getAddFooter()

ilTemplate::getAddFooter ( )

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

217 {
218 return $this->addFooter;
219 }

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

227 {
228 header("Content-type: " . $this->getContentType() . "; charset=UTF-8");
229 return $this->get();
230 }
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 450 of file class.ilTemplate.php.

451 {
452 return $this->contenttype;
453 }

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

1812 {
1813 return $this->header_action;
1814 }

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

2009 {
2010 return $this->login_target_par;
2011 }

Referenced by getMainMenu().

+ Here is the caller graph for this function:

◆ getMainMenu()

ilTemplate::getMainMenu ( )

Reimplemented in LTI\ilTemplate.

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

840 {
841 global $DIC;
842
843 $ilMainMenu = $DIC["ilMainMenu"];
844
845 if ($this->variableExists('MAINMENU')) {
846 $ilMainMenu->setLoginTargetPar($this->getLoginTargetPar());
847 $this->main_menu = $ilMainMenu->getHTML();
848 $this->main_menu_spacer = $ilMainMenu->getSpacerClass();
849 }
850 }
getLoginTargetPar()
Get target parameter for login.

References $DIC, 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 430 of file class.ilTemplate.php.

431 {
432 global $DIC;
433
434 $lng = $DIC->language();
435 $mtpl = new ilTemplate("tpl.message.html", true, true, "Services/Utilities");
436 $mtpl->setCurrentBlock($a_type . "_message");
437 $mtpl->setVariable("TEXT", $a_txt);
438 $mtpl->setVariable("MESSAGE_HEADING", $lng->txt($a_type . "_message"));
439 $mtpl->parseCurrentBlock();
440
441 return $mtpl->get();
442 }
$a_type
Definition: workflow.php:92

References $a_type, $DIC, 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 237 of file class.ilTemplate.php.

238 {
239 global $lng;
240
241 $mtpl = new ilTemplate("tpl.message.html", true, true, "Services/Utilities");
242 $mtpl->setCurrentBlock($a_type . "_message");
243 $mtpl->setVariable("TEXT", $a_txt);
244 $mtpl->setVariable("MESSAGE_HEADING", $lng->txt($a_type . "_message"));
245 $mtpl->parseCurrentBlock();
246
247 return $mtpl->get();
248 }

References $a_type, and $lng.

◆ getMessageTextForType()

ilTemplate::getMessageTextForType (   $m)
private
Parameters
$m
Returns
mixed|string

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

2528 {
2529 $txt = "";
2530 if (isset($_SESSION[$m]) && $_SESSION[$m] != "") {
2531 $txt = $_SESSION[$m];
2532 } else {
2533 if (isset($this->message[$m])) {
2534 $txt = $this->message[$m];
2535 }
2536 }
2537
2538 return $txt;
2539 }

References $_SESSION, $m, and $txt.

Referenced by fillMessage().

+ Here is the caller graph for this function:

◆ getOnLoadCodeForAsynch()

ilTemplate::getOnLoadCodeForAsynch ( )

Get js onload code for ajax calls.

Returns
string

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

2397 {
2398 $js = "";
2399 for ($i = 1; $i <= 3; $i++) {
2400 if (is_array($this->on_load_code[$i])) {
2401 foreach ($this->on_load_code[$i] as $code) {
2402 $js .= $code . "\n";
2403 }
2404 }
2405 }
2406 if ($js) {
2407 return '<script type="text/javascript">' . "\n" .
2408 $js .
2409 '</script>' . "\n";
2410 }
2411 }
$js

References $code, $i, and $js.

◆ getStandardTemplate()

ilTemplate::getStandardTemplate ( )

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

1572 {
1573 if ($this->standard_template_loaded) {
1574 return;
1575 }
1576
1577 // always load jQuery
1578 include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
1581
1582 // always load ui framework
1583 include_once("./Services/UICore/classes/class.ilUIFramework.php");
1585
1586 // always load Basic js
1587 // $this->addJavaScript("./Services/JavaScript/js/Basic.js",
1588 // true, 1);
1589
1590 $this->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
1591 $this->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
1592
1593 $this->standard_template_loaded = true;
1594 }
addBlockFile($var, $block, $tplname, $in_module=false)
overwrites ITX::addBlockFile @access public
static init($a_tpl=null)
Init.
static initjQueryUI($a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components....
static initjQuery($a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template

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

+ Here is the call graph for this function:

◆ getTabsHTML()

ilTemplate::getTabsHTML ( )

Get tabs HTML.

Parameters

return

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

676 {
677 global $DIC;
678
679 $ilTabs = $DIC["ilTabs"];
680
681 if ($this->blockExists("tabs_outer_start")) {
682 $this->sthtml = $ilTabs->getSubTabHTML();
683 $this->thtml = $ilTabs->getHTML((trim($this->sthtml) == ""));
684 }
685 }

References $DIC, and 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. "tpl.confirm.html"

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

1523 {
1524 global $DIC;
1525
1526 $ilCtrl = null;
1527 if (isset($DIC["ilCtrl"])) {
1528 $ilCtrl = $DIC->ctrl();
1529 }
1530
1531
1532 // if baseClass functionality is used (ilias.php):
1533 // get template directory from ilCtrl
1534 if (!empty($_GET["baseClass"]) && $a_in_module === true) {
1535 $a_in_module = $ilCtrl->getModuleDir();
1536 }
1537
1538 if (strpos($a_tplname, "/") === false) {
1539 if ($a_in_module) {
1540 if ($a_in_module === true) {
1541 $module_path = ILIAS_MODULE . "/";
1542 } else {
1543 $module_path = $a_in_module . "/";
1544 }
1545 } else {
1546 $module_path = "";
1547 }
1548
1549 return $module_path . basename($a_tplname);
1550 } else {
1551 return $a_tplname;
1552 }
1553 }
const ILIAS_MODULE
Definition: server.php:14

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

Referenced by __construct(), and addBlockFile().

+ Here is the caller graph for this function:

◆ getTemplatePath() [1/2]

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

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

1448 {
1449 global $DIC;
1450
1451 $ilCtrl = null;
1452 if (isset($DIC["ilCtrl"])) {
1453 $ilCtrl = $DIC->ctrl();
1454 }
1455
1456 $fname = "";
1457
1458 // if baseClass functionality is used (ilias.php):
1459 // get template directory from ilCtrl
1460 if (!empty($_GET["baseClass"]) && $a_in_module === true) {
1461 $a_in_module = $ilCtrl->getModuleDir();
1462 }
1463
1464 if (strpos($a_tplname, "/") === false) {
1465 $module_path = "";
1466
1467 if ($a_in_module) {
1468 if ($a_in_module === true) {
1469 $module_path = ILIAS_MODULE . "/";
1470 } else {
1471 $module_path = $a_in_module . "/";
1472 }
1473 }
1474
1475 // use ilStyleDefinition instead of account to get the current skin
1476 include_once "Services/Style/System/classes/class.ilStyleDefinition.php";
1477 if (ilStyleDefinition::getCurrentSkin() != "default") {
1479
1480 $fname = "./Customizing/global/skin/" .
1481 ilStyleDefinition::getCurrentSkin() . "/" . $style . "/" . $module_path
1482 . basename($a_tplname);
1483
1484 if ($fname == "" || !file_exists($fname)) {
1485 $fname = "./Customizing/global/skin/" .
1486 ilStyleDefinition::getCurrentSkin() . "/" . $module_path . basename($a_tplname);
1487 }
1488 }
1489
1490 if ($fname == "" || !file_exists($fname)) {
1491 $fname = "./" . $module_path . "templates/default/" . basename($a_tplname);
1492 }
1493 } elseif (strpos($a_tplname, "src/UI") === 0) {
1494 if (class_exists("ilStyleDefinition") // for testing
1495 && ilStyleDefinition::getCurrentSkin() != "default") {
1496 $fname = "./Customizing/global/skin/" . ilStyleDefinition::getCurrentSkin() . "/" . str_replace("src/UI/templates/default", "UI", $a_tplname);
1497 }
1498 if ($fname == "" || !file_exists($fname)) {
1499 $fname = $a_tplname;
1500 }
1501 } else {
1502 $fname = $a_tplname;
1503 }
1504
1505 return $fname;
1506 }
static getCurrentSkin()
get the current skin
static getCurrentStyle()
get the current style or sub style
$style
Definition: example_012.php:70

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

Referenced by __construct(), and addBlockFile().

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

◆ getTemplatePath() [2/2]

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

builds a full template path with template and module name

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

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

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

References $_GET, $ilCtrl, and ILIAS_MODULE.

◆ getTitleColor()

ilTemplate::getTitleColor ( )

Get title color.

Returns
string color

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

1629 {
1630 return $this->title_color;
1631 }

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 $_SESSION["post_vars"] = $_POST;
1055
1056 // referer is modified if query string contains cmd=gateway and $_POST is not empty.
1057 // this is a workaround to display formular again in case of error and if the referer points to another page
1058 $url_parts = @parse_url($_SERVER["REQUEST_URI"]);
1059 if (!$url_parts) {
1060 $protocol = (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://';
1061 $host = $_SERVER['HTTP_HOST'];
1062 $path = $_SERVER['REQUEST_URI'];
1063 $url_parts = @parse_url($protocol . $host . $path);
1064 }
1065
1066 if (isset($url_parts["query"]) && preg_match("/cmd=gateway/", $url_parts["query"]) && (isset($_POST["cmd"]["create"]))) {
1067 foreach ($_POST as $key => $val) {
1068 if (is_array($val)) {
1069 $val = key($val);
1070 }
1071
1072 $str .= "&" . $key . "=" . $val;
1073 }
1074
1075 $_SESSION["referer"] = preg_replace("/cmd=gateway/", substr($str, 1), $_SERVER["REQUEST_URI"]);
1076 $_SESSION['referer_ref_id'] = (int) $_GET['ref_id'];
1077 } elseif (isset($url_parts["query"]) && preg_match("/cmd=post/", $url_parts["query"]) && (isset($_POST["cmd"]["create"]))) {
1078 foreach ($_POST as $key => $val) {
1079 if (is_array($val)) {
1080 $val = key($val);
1081 }
1082
1083 $str .= "&" . $key . "=" . $val;
1084 }
1085
1086 $_SESSION["referer"] = preg_replace("/cmd=post/", substr($str, 1), $_SERVER["REQUEST_URI"]);
1087 if (isset($_GET['ref_id'])) {
1088 $_SESSION['referer_ref_id'] = (int) $_GET['ref_id'];
1089 } else {
1090 $_SESSION['referer_ref_id'] = 0;
1091 }
1092 } else {
1093 $_SESSION["referer"] = $_SERVER["REQUEST_URI"];
1094 if (isset($_GET['ref_id'])) {
1095 $_SESSION['referer_ref_id'] = (int) $_GET['ref_id'];
1096 } else {
1097 $_SESSION['referer_ref_id'] = 0;
1098 }
1099 }
1100
1101 unset($_SESSION["error_post_vars"]);
1102 }
1103 }
$path
Definition: aliased.php:25
$_POST["username"]

References $_GET, $_POST, $_SERVER, $_SESSION, $key, $path, and GuzzleHttp\Psr7\$protocol.

Referenced by get(), and show().

+ Here is the caller graph for this function:

◆ hasMessage()

ilTemplate::hasMessage (   $a_type)

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

377 {
378 return (isset($this->message[$a_type]) && strlen($this->message[$a_type]));
379 }

References $a_type.

◆ includeNavigation()

ilTemplate::includeNavigation ( )

check if there is a NAVIGATION-topic @access public

Returns
boolean

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

1306 {
1307 return $this->checkTopic("__global__", "NAVIGATION");
1308 }
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 1315 of file class.ilTemplate.php.

1316 {
1317 return $this->checkTopic("__global__", "TREE");
1318 }

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

162 {
163 $this->free();
164 $this->buildFunctionlist();
165
166 $cache_hit = false;
167 if ($this->il_use_cache) {
168 // cache hit
169 if (isset(self::$il_cache[$this->il_cur_key]) && is_array(self::$il_cache[$this->il_cur_key])) {
170 $cache_hit = true;
171 //echo "cache hit";
172 $this->err = self::$il_cache[$this->il_cur_key]["err"];
173 $this->flagBlocktrouble = self::$il_cache[$this->il_cur_key]["flagBlocktrouble"];
174 $this->blocklist = self::$il_cache[$this->il_cur_key]["blocklist"];
175 $this->blockdata = self::$il_cache[$this->il_cur_key]["blockdata"];
176 $this->blockinner = self::$il_cache[$this->il_cur_key]["blockinner"];
177 $this->blockparents = self::$il_cache[$this->il_cur_key]["blockparents"];
178 $this->blockvariables = self::$il_cache[$this->il_cur_key]["blockvariables"];
179 }
180 }
181
182 if (!$cache_hit) {
183 $this->findBlocks($this->template);
184 $this->template = '';
185 $this->buildBlockvariablelist();
186 if ($this->il_use_cache) {
187 self::$il_cache[$this->il_cur_key]["err"] = $this->err;
188 self::$il_cache[$this->il_cur_key]["flagBlocktrouble"] = $this->flagBlocktrouble;
189 self::$il_cache[$this->il_cur_key]["blocklist"] = $this->blocklist;
190 self::$il_cache[$this->il_cur_key]["blockdata"] = $this->blockdata;
191 self::$il_cache[$this->il_cur_key]["blockinner"] = $this->blockinner;
192 self::$il_cache[$this->il_cur_key]["blockparents"] = $this->blockparents;
193 self::$il_cache[$this->il_cur_key]["blockvariables"] = $this->blockvariables;
194 }
195 }
196
197 // we don't need it any more
198 $this->template = '';
199 } // end func init
buildFunctionlist()
Builds a functionlist from the template.
Definition: ITX.php:591
findBlocks($string)
Recusively builds a list of all blocks within the template.
Definition: IT.php:863
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:822

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.

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

866 {
867 include_once("./Services/Help/classes/class.ilHelpGUI.php");
868 ilHelpGUI::initHelp($this);
869 }
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 1392 of file class.ilTemplate.php.

1396 {
1397 global $DIC;
1398
1399 // copied from IT:loadTemplateFile
1400 $template = '';
1401 if (!$this->flagCacheTemplatefile ||
1402 $this->lastTemplatefile != $filename
1403 ) {
1404 $template = $this->getFile($filename);
1405 }
1406 $this->lastTemplatefile = $filename;
1407 // copied.
1408
1409 // new code to include the template input hook:
1410 $ilPluginAdmin = $DIC["ilPluginAdmin"];
1411 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
1412 foreach ($pl_names as $pl) {
1413 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
1414 $gui_class = $ui_plugin->getUIClassInstance();
1415
1416 $resp = $gui_class->getHTML(
1417 "",
1418 "template_load",
1419 array("tpl_id" => $this->tplIdentifier, "tpl_obj" => $this, "html" => $template)
1420 );
1421
1422 if ($resp["mode"] != ilUIHookPluginGUI::KEEP) {
1423 $template = $gui_class->modifyHTML($template, $resp);
1424 }
1425 }
1426 // new.
1427
1428 // copied from IT:loadTemplateFile
1429 return $template != '' ?
1430 $this->setTemplate(
1431 $template,
1434 ) : false;
1435 // copied.
1436 }
$removeEmptyBlocks
Definition: IT.php:202
$removeUnknownVariables
Definition: IT.php:195
setTemplate( $template, $removeUnknownVariables=true, $removeEmptyBlocks=true)
Sets the template.
Definition: IT.php:741

References $DIC, $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 1186 of file class.ilTemplate.php.

1187 {
1188 // Hier erst noch ein replace aufrufen
1189 if ($part != "DEFAULT") {
1190 $tmp = $this->activeBlock;
1191 $this->activeBlock = $part;
1192 }
1193
1194 if ($part != "DEFAULT") {
1195 $this->activeBlock = $tmp;
1196 }
1197
1198 $this->fillVars();
1199
1200 $this->activeBlock = "__global__";
1201
1202 if ($part == "DEFAULT") {
1203 return parent::parseCurrentBlock();
1204 } else {
1205 return parent::parseCurrentBlock($part);
1206 }
1207 }
fillVars()
all template vars defined in $vars will be replaced automatically without setting and parsing them wi...

References $activeBlock, and fillVars().

Referenced by ilBTPopOverGUI\addButton(), ilContainerRenderer\addHeaderRow(), ilPDSelectedItemsBlockGUI\addSectionHeader(), ilContainerRenderer\addSeparatorRow(), ilContainerRenderer\addStandardRow(), ilChatroomAuthInputGUI\insert(), ilOrgUnitAuthorityInputGUI\insert(), ilCaptchaInputGUI\insert(), ilEMailInputGUI\insert(), ilContainerRenderer\renderDetails(), ilContainerRenderer\renderHelperGeneric(), ilSurveyPageGUI\renderPageNode(), ilContainerRenderer\renderSelectAllBlock(), and ilMainMenuGUI\renderStatusBox().

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

291 {
292 // Hier erst noch ein replace aufrufen
293 if ($part != "DEFAULT") {
294 $tmp = $this->activeBlock;
295 $this->activeBlock = $part;
296 }
297
298 if ($part != "DEFAULT") {
299 $this->activeBlock = $tmp;
300 }
301
302 //$this->fillVars();
303
304 $this->activeBlock = "__global__";
305
306 if ($part == "DEFAULT") {
307 return parent::parseCurrentBlock();
308 } else {
309 return parent::parseCurrentBlock($part);
310 }
311 }

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

1251 {
1252 if (!is_array($vars)) {
1253 return;
1254 }
1255
1256 reset($vars);
1257
1258 while (list($i) = each($vars)) {
1259 $vars[$i] = stripslashes($vars[$i]);
1260 $vars[$i] = htmlspecialchars($vars[$i]);
1261 }
1262
1263 return($vars);
1264 }

References $i, and $vars.

◆ replace()

ilTemplate::replace ( )

??? @access public

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

1271 {
1272 reset($this->vars);
1273
1274 while (list($key, $val) = each($this->vars)) {
1275 $this->setVariable($key, $val);
1276 }
1277 }

References $key, and 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 1283 of file class.ilTemplate.php.

1284 {
1285 $this->replace($this->vars);
1286 }
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 1219 of file class.ilTemplate.php.

1220 {
1221 $res = $DB->selectDbAll();
1222
1223 while ($DB->getDbNextElement($res)) {
1224 $this->setCurrentBlock($block);
1225 $result = array();
1226 reset($conv);
1227
1228 while (list($key, $val) = each($conv)) {
1229 $result[$val] = $DB->element->data[$key];
1230 }
1231
1232 if (($select != "default")
1233 && ($DB->element->data[$select["id"]] == $select["value"]
1234 || (strtolower($select["text"]) == "checked"
1235 && strpos(",," . $select["value"] . ",,", "," . $DB->element->data[$select["id"]] . ",") != false))) {
1236 $result[$select["field"]] = $select["text"];
1237 }
1238
1239 $this->replace($result);
1240 $this->parseCurrentBlock($block);
1241 }
1242 }
$result
foreach($_POST as $key=> $value) $res

References $key, $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 2179 of file class.ilTemplate.php.

2180 {
2181 $this->css_files = array();
2182 }

◆ resetHeaderBlock()

ilTemplate::resetHeaderBlock (   $a_reset_header_action = true)

Set variable.

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

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

2500 {
2501 $this->setTitle(null);
2502 $this->setTitleIcon(null);
2503 $this->setDescription(null);
2504 $this->setAlertProperties(array());
2505 $this->enableDragDropFileUpload(null);
2506
2507 // see setFullscreenHeader()
2508 if ($a_reset_header_action) {
2509 $this->setHeaderActionMenu(null);
2510 }
2511 }
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 2166 of file class.ilTemplate.php.

2167 {
2168 $this->js_files = array();
2169 $this->js_files_vp = array();
2170 $this->js_files_batch = array();
2171 }

◆ setAddFooter()

ilTemplate::setAddFooter (   $value)

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

207 {
208 $this->addFooter = $value;
209 }

◆ setAlertProperties()

ilTemplate::setAlertProperties ( array  $a_props)

Set alert properties.

Parameters
array$a_props
Returns
void

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

1639 {
1640 $this->title_alerts = $a_props;
1641 }

Referenced by clearHeader(), and resetHeaderBlock().

+ Here is the caller graph for this function:

◆ setBackgroundColor()

ilTemplate::setBackgroundColor (   $a_bg_color)

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

2414 {
2415 // :TODO: currently inactive, JF should discuss this
2416 return;
2417
2418 if ($a_bg_color != "") {
2419 $this->setVariable("FRAME_BG_COLOR", " style=\"background-color: #" . $a_bg_color . "\"");
2420 }
2421 }

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

2432 {
2433 if ($a_img) {
2434 if (!$a_export) {
2435 $a_img = ILIAS_HTTP_PATH . "/" . $a_img;
2436 }
2437
2438 $this->setCurrentBlock("banner_bl");
2439 $this->setVariable("BANNER_WIDTH", $a_width); // currently not needed
2440 $this->setVariable("BANNER_HEIGHT", $a_height);
2441 $this->setVariable("BANNER_URL", $a_img);
2442 $this->parseCurrentBlock();
2443 }
2444 }

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

1751 {
1752 $this->body_class = $a_class;
1753 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setCenterColumnClass()

ilTemplate::setCenterColumnClass ( )
private

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

1857 {
1858 if (!$this->blockExists("center_col_width")) {
1859 return;
1860 }
1861 $center_column_class = "";
1862 if (trim($this->right_content) != "" && trim($this->left_content) != "") {
1863 $center_column_class = "two_side_col";
1864 } elseif (trim($this->right_content) != "" || trim($this->left_content) != "") {
1865 $center_column_class = "one_side_col";
1866 }
1867
1868 switch ($center_column_class) {
1869 case "one_side_col": $center_column_class = "col-sm-9"; break;
1870 case "two_side_col": $center_column_class = "col-sm-6"; break;
1871 default: $center_column_class = "col-sm-12"; break;
1872 }
1873 if (trim($this->left_content) != "") {
1874 $center_column_class .= " col-sm-push-3";
1875 }
1876
1877 $this->setCurrentBlock("center_col_width");
1878 $this->setVariable("CENTER_COL", $center_column_class);
1879 $this->parseCurrentBlock();
1880 }

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

1820 {
1821 if ($a_html != "") {
1822 $this->main_content = $a_html;
1823 }
1824 }

◆ setContentStyleSheet()

ilTemplate::setContentStyleSheet (   $a_style)

Set content style (used for page content editor)

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

807 {
808 $this->content_style_sheet = $a_style;
809 }

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

466 {
467 $this->contenttype = $a_content_type;
468 }

◆ setCurrentBlock() [1/2]

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

257 {
258 $this->activeBlock = $part;
259
260 if ($part == "DEFAULT") {
261 return parent::setCurrentBlock();
262 } else {
263 return parent::setCurrentBlock($part);
264 }
265 }

◆ setDescription()

ilTemplate::setDescription (   $a_descr)

sets title in standard template

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

1773 {
1774 $this->title_desc = $a_descr;
1775 // $this->setVariable("H_DESCRIPTION", $a_descr);
1776 }

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

2251 {
2252 $this->edit_page_button =
2253 array("link" => $a_link, "txt" => $a_txt, "frame" => $a_frame);
2254 }

◆ setHeaderActionMenu()

ilTemplate::setHeaderActionMenu (   $a_header)

Set header action menu.

Parameters
string$a_gui$a_header

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

1802 {
1803 $this->header_action = $a_header;
1804 }

Referenced by resetHeaderBlock().

+ Here is the caller graph for this function:

◆ setHeaderPageTitle()

ilTemplate::setHeaderPageTitle (   $a_title)

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

1556 {
1557 $a_title = ilUtil::stripScriptHTML($a_title);
1558 $this->header_page_title = $a_title;
1559 }

References ilUtil\stripScriptHTML().

+ Here is the call graph for this function:

◆ setLeftContent()

ilTemplate::setLeftContent (   $a_html)

sets content of left column

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

1886 {
1887 $this->left_content = $a_html;
1888 }

◆ setLeftNavContent()

ilTemplate::setLeftNavContent (   $a_content)

Sets content of left navigation column.

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

1910 {
1911 $this->left_nav_content = $a_content;
1912 }
$a_content
Definition: workflow.php:93

References $a_content.

◆ setLocator()

ilTemplate::setLocator ( )

Insert locator.

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

1931 {
1932 global $DIC;
1933
1934 $ilMainMenu = $DIC["ilMainMenu"];
1935 $ilLocator = $DIC["ilLocator"];
1936
1937 $ilPluginAdmin = $DIC["ilPluginAdmin"];
1938
1939 // blog/portfolio
1940 if ($ilMainMenu->getMode() == ilMainMenuGUI::MODE_TOPBAR_REDUCED ||
1941 $ilMainMenu->getMode() == ilMainMenuGUI::MODE_TOPBAR_ONLY) {
1942 $this->setVariable("LOCATOR", "");
1943 return;
1944 }
1945
1946 $html = "";
1947 if (is_object($ilPluginAdmin)) {
1948 include_once("./Services/UIComponent/classes/class.ilUIHookProcessor.php");
1949 $uip = new ilUIHookProcessor(
1950 "Services/Locator",
1951 "main_locator",
1952 array("locator_gui" => $ilLocator)
1953 );
1954 if (!$uip->replaced()) {
1955 $html = $ilLocator->getHTML();
1956 }
1957 $html = $uip->getHTML($html);
1958 } else {
1959 $html = $ilLocator->getHTML();
1960 }
1961
1962 $this->setVariable("LOCATOR", $html);
1963 }
UI interface hook processor.

References $DIC, $html, 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 2000 of file class.ilTemplate.php.

2001 {
2002 $this->login_target_par = $a_val;
2003 }

◆ setMessage() [1/2]

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

Set message.

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

Parameters
string$a_type\ilTemplate::MESSAGE_TYPE_SUCCESS, \ilTemplate::MESSAGE_TYPE_FAILURE,, \ilTemplate::MESSAGE_TYPE_QUESTION, \ilTemplate::MESSAGE_TYPE_INFO
string$a_txtThe message to be sent
bool$a_keepKeep this message over one redirect

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

362 {
363 if (!in_array($a_type, self::$message_types) || $a_txt == "") {
364 return;
365 }
366 if ($a_type == self::MESSAGE_TYPE_QUESTION) {
367 $a_type = "mess_question";
368 }
369 if (!$a_keep) {
370 $this->message[$a_type] = $a_txt;
371 } else {
372 $_SESSION[$a_type] = $a_txt;
373 }
374 }

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

317 {
318 if (!in_array($a_type, array("info", "success", "failure", "question")) || $a_txt == "") {
319 return;
320 }
321 if ($a_type == "question") {
322 $a_type = "mess_question";
323 }
324 if (!$a_keep) {
325 $this->message[$a_type] = $a_txt;
326 } else {
327 ilSession::set($a_type, $a_txt);
328 }
329 }
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 2122 of file class.ilTemplate.php.

2123 {
2124 $this->mount_webfolder = $a_ref_id;
2125 }

◆ setNewContentStyleSheetLocation()

ilTemplate::setNewContentStyleSheetLocation (   $a_stylesheet)

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

1567 {
1568 $this->setVariable("LOCATION_NEWCONTENT_STYLESHEET", $a_stylesheet);
1569 }

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

2243 {
2244 $this->page_actions = $a_page_actions_html;
2245 }

◆ setPageFormAction()

ilTemplate::setPageFormAction (   $a_action)

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

1765 {
1766 $this->page_form_action = $a_action;
1767 }

◆ setPermanentLink()

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

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

2343 {
2344 $this->permanent_link = array(
2345 "type" => $a_type,
2346 "id" => $a_id,
2347 "append" => $a_append,
2348 "target" => $a_target,
2349 "title" => $a_title);
2350 }

References $a_type.

◆ setRightContent()

ilTemplate::setRightContent (   $a_html)

sets content of right column

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

1840 {
1841 $this->right_content = $a_html;
1842 }

◆ setStyleSheetLocation()

ilTemplate::setStyleSheetLocation (   $a_stylesheet)

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

1562 {
1563 $this->setVariable("LOCATION_STYLESHEET", $a_stylesheet);
1564 }

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

1983 {
1984 $this->setVariable("SUB_TABS", $a_tabs_html);
1985 }

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

1969 {
1970 if ($a_tabs_html != "" && $this->blockExists("tabs_outer_start")) {
1971 $this->touchBlock("tabs_outer_start");
1972 $this->touchBlock("tabs_outer_end");
1973 $this->touchBlock("tabs_inner_start");
1974 $this->touchBlock("tabs_inner_end");
1975 $this->setVariable("TABS", $a_tabs_html);
1976 }
1977 }

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

1600 {
1601 $this->title = ilUtil::stripScriptHTML($a_title);
1602 $this->header_page_title = $a_title;
1603 }

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

1619 {
1620 $this->title_color = $a_val;
1621 }

◆ setTitleIcon()

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

set title icon

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

1745 {
1746 $this->icon_desc = $a_icon_desc;
1747 $this->icon_path = $a_icon_path;
1748 }

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

1609 {
1610 $this->title_url = $a_url;
1611 }

◆ setTreeFlatIcon()

ilTemplate::setTreeFlatIcon (   $a_link,
  $a_mode 
)

set tree/flat icon

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

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

2134 {
2135 $this->tree_flat_link = $a_link;
2136 $this->tree_flat_mode = $a_mode;
2137 }

◆ setUpperIcon()

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

sets icon to upper level

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

1991 {
1992 $this->upper_icon = $a_link;
1993 $this->upper_icon_frame = $a_frame;
1994 }

◆ show() [1/2]

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

@access public

Parameters
string

Reimplemented from HTML_Template_IT.

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

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

References $_GET, $_POST, $_SERVER, $key, $m, $out, $path, GuzzleHttp\Psr7\$protocol, $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 
)
Parameters
string$part
bool$a_fill_tabsfill template variable {TABS} with content of ilTabs
bool$a_skip_main_menu

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

477 {
478 global $DIC;
479
480 $http = $DIC->http();
481 switch ($http->request()->getHeaderLine('Accept')) {
482 case 'application/json':
483 $string = json_encode([
484 self::MESSAGE_TYPE_SUCCESS => is_null($this->message[self::MESSAGE_TYPE_FAILURE]),
485 'message' => '',
486 ]);
488 $http->saveResponse($http->response()->withBody($stream));
489 $http->sendResponse();
490 exit;
491 default:
492 // include yahoo dom per default
493 include_once("./Services/YUI/classes/class.ilYuiUtil.php");
495
496 header('P3P: CP="CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa OUR BUS IND UNI COM NAV INT CNT STA PRE"');
497 header("Content-type: " . $this->getContentType() . "; charset=UTF-8");
498
499 $this->fillMessage();
500
501 // display ILIAS footer
502 if ($part !== false) {
503 $this->addILIASFooter();
504 }
505
506 // set standard parts (tabs and title icon)
507 $this->fillBodyClass();
508
509 // see #22992
510 $this->fillContentLanguage();
511
512 if ($a_fill_tabs) {
513 if ($this->blockExists("content")) {
514 // determine default screen id
515 $this->getTabsHTML();
516 }
517
518 // to get also the js files for the main menu
519 if (!$a_skip_main_menu) {
520 $this->getMainMenu();
521 $this->initHelp();
522 }
523
524 if ($this->blockExists("content") && $this->variableExists('MAINMENU')) {
525 $tpl = $DIC["tpl"];
526
527 include_once 'Services/Authentication/classes/class.ilSessionReminderGUI.php';
528 $session_reminder_gui = new ilSessionReminderGUI(ilSessionReminder::createInstanceWithCurrentUserSession());
529 $tpl->setVariable('SESSION_REMINDER', $session_reminder_gui->getHtml());
530 }
531
532 // these fill blocks in tpl.main.html
533 $this->fillCssFiles();
534 $this->fillInlineCss();
535 //$this->fillJavaScriptFiles();
536 $this->fillContentStyle();
537
538 // these fill just plain placeholder variables in tpl.main.html
539 $this->setCurrentBlock("DEFAULT");
540 $this->fillNewContentStyle();
541 $this->fillWindowTitle();
542
543 // these fill blocks in tpl.adm_content.html
544 $this->fillHeader();
545 $this->fillSideIcons();
546 $this->fillScreenReaderFocus();
547 $this->fillStopFloating();
548 $this->fillLeftContent();
549 $this->fillLeftNav();
550 $this->fillRightContent();
551 $this->fillAdminPanel();
552 $this->fillToolbar();
553 $this->fillPermanentLink();
554
555 $this->setCenterColumnClass();
556
557 // late loading of javascipr files, since operations above may add files
558 $this->fillJavaScriptFiles();
559 $this->fillOnLoadCode();
560
561 // these fill just plain placeholder variables in tpl.adm_content.html
562 if ($this->blockExists("content")) {
563 $this->setCurrentBlock("content");
564 $this->fillTabs();
565 $this->fillMainContent();
566 $this->fillMainMenu();
567 $this->fillLightbox();
568 $this->parseCurrentBlock();
569 }
570 }
571
572 if ($part == "DEFAULT" or is_bool($part)) {
573 $html = parent::get();
574 } else {
575 $html = parent::get($part);
576 }
577
578 // include the template output hook
579 $ilPluginAdmin = $DIC["ilPluginAdmin"];
580 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
581 foreach ($pl_names as $pl) {
582 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
583 $gui_class = $ui_plugin->getUIClassInstance();
584
585 $resp = $gui_class->getHTML(
586 "",
587 "template_show",
588 array("tpl_id" => $this->tplIdentifier, "tpl_obj" => $this, "html" => $html)
589 );
590
591 if ($resp["mode"] != ilUIHookPluginGUI::KEEP) {
592 $html = $gui_class->modifyHTML($html, $resp);
593 }
594 }
595
596 // fix #9992: save language usages as late as possible
597 if ($this->translation_linked) {
599 }
600
601 print $html;
602
603 $this->handleReferer();
604 break;
605 }
606 }
if(! $in) print
exit
Definition: backend.php:16
static ofString($string)
Creates a new stream with an initial value.
Definition: Streams.php:30
static initDom()
Init YUI Dom.
$stream
PHP stream implementation.
$http
Definition: raiseError.php:7

References $DIC, $html, $http, GuzzleHttp\Psr7\$stream, $tpl, ilObjLanguageAccess\_saveUsages(), addILIASFooter(), blockExists(), exit, fillAdminPanel(), fillBodyClass(), fillContentLanguage(), fillContentStyle(), fillCssFiles(), fillHeader(), fillInlineCss(), fillJavaScriptFiles(), fillLeftContent(), fillLeftNav(), fillLightbox(), fillMainContent(), fillMainMenu(), fillMessage(), fillNewContentStyle(), fillOnLoadCode(), fillPermanentLink(), fillRightContent(), fillScreenReaderFocus(), fillSideIcons(), fillStopFloating(), fillTabs(), fillToolbar(), fillWindowTitle(), ILIAS\GlobalScreen\get(), getContentType(), getMainMenu(), ilPluginAdmin\getPluginObject(), getTabsHTML(), handleReferer(), IL_COMP_SERVICE, ilYuiUtil\initDom(), initHelp(), ilUIHookPluginGUI\KEEP, ILIAS\Filesystem\Stream\Streams\ofString(), 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 1781 of file class.ilTemplate.php.

1782 {
1783 $this->stop_floating = true;
1784 }

◆ touchBlock() [1/2]

ilTemplate::touchBlock (   $block)

overwrites ITX::touchBlock.

@access public

Parameters
string
Returns
???

Reimplemented from HTML_Template_IT.

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

1170 {
1171 $this->setCurrentBlock($block);
1172 $count = $this->fillVars();
1173 $this->parseCurrentBlock();
1174
1175 if ($count == 0) {
1176 parent::touchBlock($block);
1177 }
1178 }

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

Referenced by ilContainerRenderer\addHeaderRow(), ilPDSelectedItemsBlockGUI\addSectionHeader(), ilContainerRenderer\addStandardRow(), 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 273 of file class.ilTemplate.php.

274 {
275 $this->setCurrentBlock($block);
276 //$count = $this->fillVars();
277 $this->parseCurrentBlock();
278
279 if ($count == 0) {
280 parent::touchBlock($block);
281 }
282 }

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

+ Here is the call graph for this function:

◆ variableExists()

ilTemplate::variableExists (   $a_variablename)
private

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

1118 {
1119 return (isset($this->blockvariables["content"][$a_variablename]) ? true : false);
1120 }

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

+ Here is the caller graph for this function:

Field Documentation

◆ $activeBlock

ilTemplate::$activeBlock

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

Referenced by parseCurrentBlock().

◆ $addFooter

ilTemplate::$addFooter
private

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

Referenced by getAddFooter().

◆ $admin_panel_commands

ilTemplate::$admin_panel_commands = array()

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

◆ $content_style_sheet

ilTemplate::$content_style_sheet = ""
protected

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

◆ $contenttype

ilTemplate::$contenttype

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

Referenced by getContentType().

◆ $css_files

ilTemplate::$css_files = array()

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

◆ $header_action

ilTemplate::$header_action
protected

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

Referenced by getHeaderActionMenu().

◆ $il_cache

ilTemplate::$il_cache = array()
staticprotected

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

◆ $inline_css

ilTemplate::$inline_css = array()

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

◆ $js_files

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

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

◆ $js_files_batch

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

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

◆ $js_files_vp

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

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

◆ $lightbox

ilTemplate::$lightbox = array()
protected

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

◆ $main_content

ilTemplate::$main_content = ""
protected

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

◆ $message

ilTemplate::$message = array()
protected

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

◆ $message_types

ilTemplate::$message_types
staticprotected
Initial value:
= array(
self::MESSAGE_TYPE_FAILURE,
self::MESSAGE_TYPE_INFO,
self::MESSAGE_TYPE_SUCCESS,
self::MESSAGE_TYPE_QUESTION,
)

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

◆ $mount_webfolder

ilTemplate::$mount_webfolder = ""
protected

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

Referenced by fillSideIcons().

◆ $page_actions

ilTemplate::$page_actions = array()
protected

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

◆ $page_form_action

ilTemplate::$page_form_action = ""
protected

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

◆ $permanent_link

ilTemplate::$permanent_link = false
protected

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

◆ $standard_template_loaded

ilTemplate::$standard_template_loaded = false
protected

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

◆ $stop_floating

ilTemplate::$stop_floating = ""
protected

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

◆ $title_alerts

ilTemplate::$title_alerts = array()
protected

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

◆ $title_desc

ilTemplate::$title_desc = ""
protected

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

◆ $title_url

ilTemplate::$title_url = ""
protected

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

◆ $tpl

ilTemplate::$tpl
protected

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

Referenced by fillMainMenu(), and show().

◆ $translation_linked

ilTemplate::$translation_linked = false
protected

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

◆ $tree_flat_link

ilTemplate::$tree_flat_link = ""
protected

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

◆ $upper_icon

ilTemplate::$upper_icon = ""
protected

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

◆ $vars

ilTemplate::$vars

◆ MESSAGE_TYPE_FAILURE

const ilTemplate::MESSAGE_TYPE_FAILURE = 'failure'

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

◆ MESSAGE_TYPE_INFO

const ilTemplate::MESSAGE_TYPE_INFO = "info"

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

◆ MESSAGE_TYPE_QUESTION

const ilTemplate::MESSAGE_TYPE_QUESTION = "question"

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

Referenced by fillMessage().

◆ MESSAGE_TYPE_SUCCESS

const ilTemplate::MESSAGE_TYPE_SUCCESS = "success"

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

Referenced by ilUserCertificateGUI\executeCommand().


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