ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 ()
 
 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)
 ??? 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 private More...
 
 fillVars ()
 all template vars defined in $vars will be replaced automatically without setting and parsing them with setVariable & parseCurrentBlock 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 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 ()
 ??? public More...
 
 replaceDefault ()
 ??? public More...
 
 checkTopic ($a_block, $a_topic)
 checks for a topic in the template private More...
 
 includeNavigation ()
 check if there is a NAVIGATION-topic public More...
 
 includeTree ()
 check if there is a TREE-topic public More...
 
 fileExists ($filename)
 check if a file exists public More...
 
 addBlockFile ($var, $block, $tplname, $in_module=false)
 overwrites ITX::addBlockFile 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")
 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 public. More...
 
 setMessage ($a_type, $a_txt, $a_keep=false)
 Set message. More...
 
 fillMessage ()
 
 blockExists ($a_blockname)
 check if block exists in actual template 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")
 
- Public Member Functions inherited from HTML_Template_ITX
 __construct ($root='')
 Builds some complex regexps and calls the constructor of the parent class. More...
 
 init ()
 
 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 = ""
 
 $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 public

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

References $DIC, $file, $ilErr, array, getTemplateIdentifier(), getTemplatePath(), loadTemplatefile(), setBodyClass(), and HTML_Template_IT\setOption().

100  {
101  global $DIC;
102 
103  //echo "<br>-".$file."-";
104 
105  $this->activeBlock = "__global__";
106  $this->vars = array();
107  $this->addFooter = true;
108 
109  $this->il_use_cache = $a_use_cache;
110  $this->il_cur_key = $file . "/" . $in_module;
111 
112  $fname = $this->getTemplatePath($file, $in_module, $plugin);
113 
114  $this->tplName = basename($fname);
115  $this->tplPath = dirname($fname);
116  $this->tplIdentifier = $this->getTemplateIdentifier($file, $in_module);
117 
118  // set default content-type to text/html
119  $this->contenttype = "text/html";
120  if (!file_exists($fname)) {
121  if (isset($DIC["ilErr"])) {
122  $ilErr = $DIC["ilErr"];
123  $ilErr->raiseError("template " . $fname . " was not found.", $ilErr->FATAL);
124  }
125  return false;
126  }
127 
128  //$this->IntegratedTemplateExtension(dirname($fname));
129  parent::__construct();
130  //$this->loadTemplatefile(basename($fname), $flag1, $flag2);
131  $this->loadTemplatefile($fname, $flag1, $flag2);
132  //add tplPath to replacevars
133  $this->vars["TPLPATH"] = $this->tplPath;
134 
135  // set Options
136  if (method_exists($this, "setOption")) {
137  $this->setOption('use_preg', false);
138  }
139  $this->setBodyClass("std");
140 
141  return true;
142  }
getTemplatePath($a_tplname, $a_in_module=false, $a_plugin=false)
builds a full template path with template and module name
global $ilErr
Definition: raiseError.php:16
global $DIC
Definition: saml.php:7
setBodyClass($a_class="")
getTemplateIdentifier($a_tplname, $a_in_module=false)
get a unique template identifier
loadTemplatefile( $filename, $removeUnknownVariables=true, $removeEmptyBlocks=true)
Reads a template file from the disk.
Create styles array
The data for the language used.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
setOption($option, $value)
Sets the option for the template class.
Definition: IT.php:397
+ 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 public

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

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

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  }
getTemplatePath($a_tplname, $a_in_module=false, $a_plugin=false)
builds a full template path with template and module name
loadTemplatefile( $filename, $removeUnknownVariables=true, $removeEmptyBlocks=true)
Reads a template file from the disk.
Create styles array
The data for the language used.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
setOption($option, $value)
Sets the option for the template class.
Definition: IT.php:397
+ 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 2248 of file class.ilTemplate.php.

References array.

2249  {
2250  $this->admin_panel_commands[] =
2251  array("cmd" => $a_cmd, "txt" => $a_txt);
2252  if ($a_arrow) {
2253  $this->admin_panel_arrow = true;
2254  }
2255  $this->admin_panel_top_only = false;
2256  }
Create styles array
The data for the language used.

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

2264  {
2265  $this->admin_panel_commands_toolbar = $toolb;
2266  $this->admin_panel_arrow = $a_arrow;
2267  $this->admin_panel_bottom = $a_bottom_panel;
2268  }

◆ addBlockFile() [1/2]

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

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

References DEBUG, and getTemplatePath().

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  }
getTemplatePath($a_tplname, $a_in_module=false, $a_plugin=false)
builds a full template path with template and module name
const DEBUG
+ Here is the call graph for this function:

◆ addBlockFile() [2/2]

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

overwrites ITX::addBlockFile 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 1337 of file class.ilTemplate.php.

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

Referenced by getStandardTemplate().

1338  {
1339  global $DIC;
1340 
1341  if (DEBUG) {
1342  echo "<br/>Template '" . $this->tplPath . "/" . $tplname . "'";
1343  }
1344 
1345  $tplfile = $this->getTemplatePath($tplname, $in_module);
1346  if (file_exists($tplfile) == false) {
1347  echo "<br/>Template '" . $tplfile . "' doesn't exist! aborting...";
1348  return false;
1349  }
1350 
1351  $id = $this->getTemplateIdentifier($tplname, $in_module);
1352  $template = $this->getFile($tplfile);
1353 
1354  // include the template input hook
1355  $ilPluginAdmin = $DIC["ilPluginAdmin"];
1356  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
1357  foreach ($pl_names as $pl) {
1358  $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
1359  $gui_class = $ui_plugin->getUIClassInstance();
1360 
1361  $resp = $gui_class->getHTML(
1362  "",
1363  "template_add",
1364  array("tpl_id" => $id, "tpl_obj" => $this, "html" => $template)
1365  );
1366 
1367  if ($resp["mode"] != ilUIHookPluginGUI::KEEP) {
1368  $template = $gui_class->modifyHTML($template, $resp);
1369  }
1370  }
1371 
1372  return $this->addBlock($var, $block, $template);
1373  }
getTemplatePath($a_tplname, $a_in_module=false, $a_plugin=false)
builds a full template path with template and module name
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id
addBlock($placeholder, $blockname, $template)
Adds a block to the template changing a variable placeholder to a block placeholder.
Definition: ITX.php:241
const DEBUG
getTemplateIdentifier($a_tplname, $a_in_module=false)
get a unique template identifier
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
Create styles array
The data for the language used.
const IL_COMP_SERVICE
getFile($filename)
Reads a file from disk and returns its content.
Definition: IT.php:912
+ Here is the call graph for this function:
+ Here is the caller 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 413 of file class.ilTemplate.php.

References array.

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  }
Create styles array
The data for the language used.

◆ addCss() [2/2]

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

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

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

References array.

2189  {
2190  if (!array_key_exists($a_css_file . $media, $this->css_files)) {
2191  $this->css_files[$a_css_file . $media] = array("file" => $a_css_file, "media" => $media);
2192  }
2193  }
Create styles array
The data for the language used.

◆ addILIASFooter()

ilTemplate::addILIASFooter ( )

add ILIAS footer

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

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

Referenced by get(), and show().

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

References array.

2199  {
2200  $this->inline_css[] = array("css" => $a_css, "media" => $media);
2201  }
Create styles array
The data for the language used.

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

Referenced by assQuestionGUI\populateJavascriptFilesRequiredForWorkForm(), and assMultipleChoiceGUI\populateJavascriptFilesRequiredForWorkForm().

2131  {
2132  // three batches currently
2133  if ($a_batch < 1 || $a_batch > 3) {
2134  $a_batch = 2;
2135  }
2136 
2137  // ensure jquery files being loaded first
2138  if (is_int(strpos($a_js_file, "Services/jQuery")) ||
2139  is_int(strpos($a_js_file, "/jquery.js")) ||
2140  is_int(strpos($a_js_file, "/jquery-min.js"))) {
2141  $a_batch = 0;
2142  }
2143 
2144  if (!in_array($a_js_file, $this->js_files)) {
2145  $this->js_files[] = $a_js_file;
2146  $this->js_files_vp[$a_js_file] = $a_add_version_parameter;
2147  $this->js_files_batch[$a_js_file] = $a_batch;
2148  }
2149  }
+ Here is the caller graph for this function:

◆ addLightbox()

ilTemplate::addLightbox (   $a_html,
  $a_id 
)

Add lightbox html.

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

2207  {
2208  $this->lightbox[$a_id] = $a_html;
2209  }

◆ addOnLoadCode()

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

Add on load code.

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

Referenced by ilWikiPageGUI\initEditingJS().

2177  {
2178  // three batches currently
2179  if ($a_batch < 1 || $a_batch > 3) {
2180  $a_batch = 2;
2181  }
2182  $this->on_load_code[$a_batch][] = $a_code;
2183  }
+ Here is the caller graph for this function:

◆ blockExists() [1/2]

ilTemplate::blockExists (   $a_blockname)

check if block exists in actual template private

Parameters
stringblockname
Returns
boolean

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  }

◆ blockExists() [2/2]

ilTemplate::blockExists (   $a_blockname)

check if block exists in actual template private

Parameters
stringblockname
Returns
boolean

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

Referenced by fillBodyClass(), fillCssFiles(), fillInlineCss(), fillJavaScriptFiles(), fillScreenReaderFocus(), fillTabs(), get(), getTabsHTML(), ilTinyMCE\handleImgContextMenuItem(), setCenterColumnClass(), setTabs(), and show().

1109  {
1110  // added second evaluation to the return statement because the first one only works for the content block (Helmut Schottmüller, 2007-09-14)
1111  return (isset($this->blockvariables["content"][$a_blockname]) ? true : false) | (isset($this->blockvariables[$a_blockname]) ? true : false);
1112  }
+ Here is the caller graph for this function:

◆ buildLoginTarget()

static ilTemplate::buildLoginTarget ( )
static

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

Returns
string

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

References $_GET, $DIC, $ilUser, $type, ilObject\_lookupObjId(), ilObject\_lookupType(), and ilWorkspaceTree\lookupObjectId().

Referenced by ilMainMenuGUI\setTemplateVars().

2440  {
2441  global $DIC;
2442 
2443  $tree = $DIC->repositoryTree();
2444  $ilUser = $DIC->user();
2445 
2446  $target_str = "";
2447 
2448  // repository
2449  if ($_GET["ref_id"] != "") {
2450  if ($tree->isInTree($_GET["ref_id"]) && $_GET["ref_id"] != $tree->getRootId()) {
2451  $obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
2452  $type = ilObject::_lookupType($obj_id);
2453  $target_str = $type . "_" . $_GET["ref_id"];
2454  }
2455  }
2456  // personal workspace
2457  elseif ($_GET["wsp_id"] != "" && $_GET["wsp_id"] > 0) {
2458  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
2459  $tree = new ilWorkspaceTree($ilUser->getId());
2460  $obj_id = $tree->lookupObjectId((int) $_GET["wsp_id"]);
2461  if ($obj_id) {
2462  $type = ilObject::_lookupType($obj_id);
2463  $target_str = $type . "_" . (int) $_GET["wsp_id"] . "_wsp";
2464  }
2465  }
2466  // portfolio
2467  elseif ($_GET["prt_id"] != "") {
2468  $target_str = "prtf_" . (int) $_GET["prt_id"];
2469  }
2470 
2471  return $target_str;
2472  }
$type
global $DIC
Definition: saml.php:7
$_GET["client_id"]
Tree handler for personal workspace.
static _lookupObjId($a_id)
$ilUser
Definition: imgupload.php:18
static _lookupType($a_id, $a_reference=false)
lookup object type
lookupObjectId($a_node_id)
Get object id for node id.
+ 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 private

Parameters
string
string
Returns
boolean

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

Referenced by includeNavigation(), and includeTree().

1293  {
1294  return array_key_exists($a_topic, $this->blockvariables[$a_block]);
1295  }
+ Here is the caller graph for this function:

◆ clearHeader()

ilTemplate::clearHeader ( )

Clear header.

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

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

1636  {
1637  $this->setTitle("");
1638  $this->setTitleIcon("");
1639  $this->setDescription("");
1640  $this->setAlertProperties(array());
1641  }
setTitleIcon($a_icon_path, $a_icon_desc="")
set title icon
setDescription($a_descr)
sets title in standard template
setAlertProperties(array $a_props)
Set alert properties.
setTitle($a_title)
sets title in standard template
Create styles array
The data for the language used.
+ 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 2504 of file class.ilTemplate.php.

Referenced by resetHeaderBlock().

2505  {
2506  $this->enable_fileupload = $a_ref_id;
2507  }
+ Here is the caller graph for this function:

◆ fileExists()

ilTemplate::fileExists (   $filename)

check if a file exists public

Returns
boolean

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

References $filename.

1323  {
1324  return file_exists($this->tplPath . "/" . $filename);
1325  }

◆ fillAdminPanel()

ilTemplate::fillAdminPanel ( )

Put admin panel into template:

  • creation selector
  • admin view on/off button

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

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

Referenced by get(), and show().

2276  {
2277  global $DIC;
2278 
2279  $lng = $DIC->language();
2280 
2281  $adm_view_cmp = $adm_cmds = $adm_view = false;
2282 
2283  $toolb = new ilToolbarGUI();
2284 
2285  // admin panel commands
2286  if ((count($this->admin_panel_commands) > 0)) {
2287  foreach ($this->admin_panel_commands as $cmd) {
2288  $toolb->addFormButton($cmd["txt"], $cmd["cmd"]);
2289  }
2290  $adm_cmds = true;
2291  } elseif ($this->admin_panel_commands_toolbar instanceof ilToolbarGUI) {
2292  $toolb = $this->admin_panel_commands_toolbar;
2293  $adm_cmds = true;
2294  }
2295  // Add arrow if desired
2296  if ($this->admin_panel_arrow) {
2297  $toolb->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), $lng->txt("actions"));
2298  }
2299 
2300  if ($adm_cmds) {
2301  $this->fillPageFormAction();
2302 
2303  $this->setCurrentBlock("adm_view_components");
2304  $this->setVariable("ADM_PANEL1", $toolb->getHTML());
2305  $this->parseCurrentBlock();
2306  $adm_view_cmp = true;
2307  }
2308 
2309  // admin view button
2310  if ($this->page_actions != "") {
2311  $this->setVariable("PAGE_ACTIONS", $this->page_actions);
2312  $adm_view = true;
2313  }
2314 
2315  // creation selector
2316  // see: ilObjectAddNewItemGUI
2317  // placeholder "SELECT_OBJTYPE_REPOS" still needed!
2318 
2319  if ($adm_cmds and $this->admin_panel_bottom) {
2320  $this->setCurrentBlock("adm_view_components2");
2321  if ($this->admin_panel_arrow) {
2322  $toolb->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), $lng->txt("actions"));
2323  }
2324  $this->setVariable("ADM_PANEL2", $toolb->getHTML());
2325 
2326  $this->parseCurrentBlock();
2327  }
2328  }
global $DIC
Definition: saml.php:7
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillBodyClass()

ilTemplate::fillBodyClass ( )

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

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

Referenced by get(), and show().

1744  {
1745  if ($this->body_class != "" && $this->blockExists("body_class")) {
1746  $this->setCurrentBlock("body_class");
1747  $this->setVariable("BODY_CLASS", $this->body_class);
1748  $this->parseCurrentBlock();
1749  }
1750  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
blockExists($a_blockname)
check if block exists in actual template private
+ 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.

public

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

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

Referenced by get(), and show().

606  {
607  global $DIC;
608 
609  $lng = $DIC->language();
610  $ilUser = $DIC->user();
611 
612  $contentLanguage = 'en';
613  $rtl = array('ar','fa','ur','he');//, 'de'); //make a list of rtl languages
614  /* rtl-review: add "de" for testing with ltr lang shown in rtl
615  * and set unicode-bidi to bidi-override for mirror effect */
616  $textdir = 'ltr';
617  if (is_object($ilUser)) {
618  if ($ilUser->getLanguage()) {
619  $contentLanguage = $ilUser->getLanguage();
620  } elseif (is_object($lng)) {
621  $contentLanguage = $lng->getDefaultLanguage();
622  }
623  if ($ilUser->getId() == ANONYMOUS_USER_ID && is_object($lng)) {
624  $contentLanguage = $lng->getLangKey();
625  }
626  }
627  $this->setVariable('META_CONTENT_LANGUAGE', $contentLanguage);
628  if (in_array($contentLanguage, $rtl)) {
629  $textdir = 'rtl';
630  }
631  $this->setVariable('LANGUAGE_DIRECTION', $textdir);
632  return true;
633  }
global $DIC
Definition: saml.php:7
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
+ 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 804 of file class.ilTemplate.php.

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

Referenced by get(), and show().

805  {
806  if ($this->content_style_sheet != "") {
807  $this->setCurrentBlock("ContentStyle");
808  $this->setVariable(
809  "LOCATION_CONTENT_STYLESHEET",
810  $this->content_style_sheet
811  );
812  $this->parseCurrentBlock();
813  }
814  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
+ 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 425 of file class.ilTemplate.php.

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

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  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
blockExists($a_blockname)
check if block exists in actual template private
+ Here is the call 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 756 of file class.ilTemplate.php.

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

Referenced by get(), and show().

757  {
758  if (!$this->blockExists("css_file")) {
759  return;
760  }
761  foreach ($this->css_files as $css) {
762  $filename = $css["file"];
763  if (strpos($filename, "?") > 0) {
764  $filename = substr($filename, 0, strpos($filename, "?"));
765  }
766  if (is_file($filename) || $a_force) {
767  $this->setCurrentBlock("css_file");
768  $this->setVariable("CSS_FILE", $css["file"]);
769  $this->setVariable("CSS_MEDIA", $css["media"]);
770  $this->parseCurrentBlock();
771  }
772  }
773  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
blockExists($a_blockname)
check if block exists in actual template private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillHeader()

ilTemplate::fillHeader ( )
private

Fill header.

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

References $DIC, $header, $lng, array, getHeaderActionMenu(), getTitleColor(), HTML_Template_IT\parseCurrentBlock(), setCurrentBlock(), HTML_Template_IT\setVariable(), ilUtil\stripScriptHTML(), and touchBlock().

Referenced by get(), and show().

1648  {
1649  global $DIC;
1650 
1651  $lng = $DIC->language();
1652 
1653  $icon = false;
1654  if ($this->icon_path != "") {
1655  $icon = true;
1656  $this->setCurrentBlock("header_image");
1657  if ($this->icon_desc != "") {
1658  $this->setVariable("IMAGE_DESC", $lng->txt("icon") . " " . $this->icon_desc);
1659  $this->setVariable("IMAGE_ALT", $lng->txt("icon") . " " . $this->icon_desc);
1660  }
1661 
1662  $this->setVariable("IMG_HEADER", $this->icon_path);
1663  $this->parseCurrentBlock();
1664  $header = true;
1665  }
1666 
1667  if ($this->title != "") {
1668  $this->title = ilUtil::stripScriptHTML($this->title);
1669  $this->setVariable("HEADER", $this->title);
1670  if ($this->title_url != "") {
1671  $this->setVariable("HEADER_URL", ' href="' . $this->title_url . '"');
1672  }
1673  if ($this->getTitleColor() != "") {
1674  $this->setVariable("HEADER_COLOR", " style=\"color: #" . $this->getTitleColor() . "\"");
1675  }
1676 
1677  if ($icon) {
1678  //$this->setVariable("HICONCL", "ilHeaderHasIcon");
1679  }
1680  $header = true;
1681  }
1682 
1683  if ($header) {
1684  $this->setCurrentBlock("header_image");
1685  $this->parseCurrentBlock();
1686  }
1687 
1688  if ($this->title_desc != "") {
1689  $this->setCurrentBlock("header_desc");
1690  $this->setVariable("H_DESCRIPTION", $this->title_desc);
1691  $this->parseCurrentBlock();
1692  }
1693 
1694  $header = $this->getHeaderActionMenu();
1695  if ($header) {
1696  $this->setCurrentBlock("head_action_inner");
1697  $this->setVariable("HEAD_ACTION", $header);
1698  $this->parseCurrentBlock();
1699  $this->touchBlock("head_action");
1700  }
1701 
1702  if (count((array) $this->title_alerts)) {
1703  foreach ($this->title_alerts as $alert) {
1704  $this->setCurrentBlock('header_alert');
1705  if (!($alert['propertyNameVisible'] === false)) {
1706  $this->setVariable('H_PROP', $alert['property'] . ':');
1707  }
1708  $this->setVariable('H_VALUE', $alert['value']);
1709  $this->parseCurrentBlock();
1710  }
1711  }
1712 
1713  // add file upload drop zone in header
1714  if ($this->enable_fileupload != null) {
1715  $ref_id = $this->enable_fileupload;
1716  $upload_id = "dropzone_" . $ref_id;
1717 
1718  include_once("./Services/FileUpload/classes/class.ilFileUploadGUI.php");
1719  $upload = new ilFileUploadGUI($upload_id, $ref_id, true);
1720 
1721  $this->setVariable("FILEUPLOAD_DROPZONE_ID", " id=\"$upload_id\"");
1722 
1723  $this->setCurrentBlock("header_fileupload");
1724  $this->setVariable("HEADER_FILEUPLOAD_SCRIPT", $upload->getHTML());
1725  $this->parseCurrentBlock();
1726  }
1727  }
global $DIC
Definition: saml.php:7
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...
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
touchBlock($block)
overwrites ITX::touchBlock.
Create styles array
The data for the language used.
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
global $lng
Definition: privfeed.php:17
getTitleColor()
Get title color.
getHeaderActionMenu()
Get header action menu.
+ 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 780 of file class.ilTemplate.php.

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

Referenced by get(), and show().

781  {
782  if (!$this->blockExists("css_inline")) {
783  return;
784  }
785  foreach ($this->inline_css as $css) {
786  $this->setCurrentBlock("css_inline");
787  $this->setVariable("CSS_INLINE", $css["css"]);
788  //$this->setVariable("CSS_MEDIA", $css["media"]);
789  $this->parseCurrentBlock();
790  }
791  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
blockExists($a_blockname)
check if block exists in actual template private
+ 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 148 of file class.ilTemplate.php.

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

Referenced by fillJavaScriptFiles().

149  {
150  $this->setCurrentBlock("js_file");
151  if ($this->js_files_vp[$file]) {
152  $this->setVariable("JS_FILE", ilUtil::appendUrlParameterString($file, $vers));
153  } else {
154  $this->setVariable("JS_FILE", $file);
155  }
156  $this->parseCurrentBlock();
157  }
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillJavaScriptFiles() [1/2]

ilTemplate::fillJavaScriptFiles ( )

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

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

Referenced by get(), and show().

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  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
blockExists($a_blockname)
check if block exists in actual template private
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillJavaScriptFiles() [2/2]

ilTemplate::fillJavaScriptFiles (   $a_force = false)

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

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

719  {
720  global $DIC;
721 
722  $ilSetting = $DIC->settings();
723 
724  if (is_object($ilSetting)) { // maybe this one can be removed
725  $vers = "vers=" . str_replace(array(".", " "), "-", $ilSetting->get("ilias_version"));
726 
727  if (DEVMODE) {
728  $vers .= '-' . time();
729  }
730  }
731  if ($this->blockExists("js_file")) {
732  // three batches
733  for ($i=0; $i<=3; $i++) {
734  reset($this->js_files);
735  foreach ($this->js_files as $file) {
736  if ($this->js_files_batch[$file] == $i) {
737  if (is_file($file) || substr($file, 0, 4) == "http" || substr($file, 0, 2) == "//" || $a_force) {
738  $this->fillJavascriptFile($file, $vers);
739  } elseif (substr($file, 0, 2) == './') { // #13962
740  $url_parts = parse_url($file);
741  if (is_file($url_parts['path'])) {
742  $this->fillJavascriptFile($file, $vers);
743  }
744  }
745  }
746  }
747  }
748  }
749  }
global $DIC
Definition: saml.php:7
Create styles array
The data for the language used.
blockExists($a_blockname)
check if block exists in actual template private
global $ilSetting
Definition: privfeed.php:17
$i
Definition: disco.tpl.php:19
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
fillJavascriptFile($file, $vers)
+ Here is the call graph for this function:

◆ fillLeftContent()

ilTemplate::fillLeftContent ( )
private

Fill left content.

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

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

Referenced by get(), and show().

1882  {
1883  if (trim($this->left_content) != "") {
1884  $this->setCurrentBlock("left_column");
1885  $this->setVariable("LEFT_CONTENT", $this->left_content);
1886  $left_col_class = (trim($this->right_content) == "")
1887  ? "col-sm-3 col-sm-pull-9"
1888  : "col-sm-3 col-sm-pull-6";
1889  $this->setVariable("LEFT_COL_CLASS", $left_col_class);
1890  $this->parseCurrentBlock();
1891  }
1892  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
+ 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 1905 of file class.ilTemplate.php.

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

Referenced by get(), and show().

1906  {
1907  if (trim($this->left_nav_content) != "") {
1908  $this->setCurrentBlock("left_nav");
1909  $this->setVariable("LEFT_NAV_CONTENT", $this->left_nav_content);
1910  $this->parseCurrentBlock();
1911  $this->touchBlock("left_nav_space");
1912  }
1913  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
touchBlock($block)
overwrites ITX::touchBlock.
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillLightbox()

ilTemplate::fillLightbox ( )

Fill lightbox content.

Parameters

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

References $html, and HTML_Template_IT\setVariable().

Referenced by get(), and show().

2218  {
2219  $html = "";
2220 
2221  foreach ($this->lightbox as $lb) {
2222  $html.= $lb;
2223  }
2224  $this->setVariable("LIGHTBOX", $html);
2225  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
$html
Definition: example_001.php:87
+ 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 1817 of file class.ilTemplate.php.

References HTML_Template_IT\setVariable().

Referenced by get(), and show().

1818  {
1819  if (trim($this->main_content) != "") {
1820  $this->setVariable("ADM_CONTENT", $this->main_content);
1821  }
1822  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillMainMenu()

ilTemplate::fillMainMenu ( )

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

References $DIC, $tpl, and variableExists().

Referenced by get(), and show().

843  {
844  global $DIC;
845  $tpl = $DIC["tpl"];
846  if ($this->variableExists('MAINMENU')) {
847  $tpl->setVariable("MAINMENU", $this->main_menu);
848  $tpl->setVariable("MAINMENU_SPACER", $this->main_menu_spacer);
849  }
850  }
global $DIC
Definition: saml.php:7
variableExists($a_variablename)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillMessage() [1/2]

ilTemplate::fillMessage ( )

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

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

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) != "")
344  ? 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)) {
365  ilSession::clear($m);
366  }
367  }
368 
369  if ($out != "") {
370  $this->setVariable("MESSAGE", $out);
371  }
372  }
static get($a_var)
Get a value.
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
special template class to simplify handling of ITX/PEAR
static clear($a_var)
Unset a value.
$txt
Definition: error.php:11
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ fillMessage() [2/2]

ilTemplate::fillMessage ( )

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

References $_SESSION, $DIC, $m, $out, $txt, array, getMessageHTML(), getMessageTextForType(), and HTML_Template_IT\setVariable().

Referenced by get(), and show().

381  {
382  global $DIC;
383 
384  $ms = array( self::MESSAGE_TYPE_INFO,
385  self::MESSAGE_TYPE_SUCCESS, self::MESSAGE_TYPE_FAILURE,
386  self::MESSAGE_TYPE_QUESTION
387  );
388  $out = "";
389 
390  foreach ($ms as $m) {
391  if ($m == self::MESSAGE_TYPE_QUESTION) {
392  $m = "mess_question";
393  }
394  $txt = $this->getMessageTextForType($m);
395 
396  if ($m == "mess_question") {
397  $m = self::MESSAGE_TYPE_QUESTION;
398  }
399 
400  if ($txt != "") {
401  $out.= $this->getMessageHTML($txt, $m);
402  }
403 
404  if ($m == self::MESSAGE_TYPE_QUESTION) {
405  $m = "mess_question";
406  }
407 
408  $request = $DIC->http()->request();
409  $accept_header = $request->getHeaderLine('Accept');
410  if (isset($_SESSION[$m]) && $_SESSION[$m] && ($accept_header !== 'application/json')) {
411  unset($_SESSION[$m]);
412  }
413  }
414 
415  if ($out != "") {
416  $this->setVariable("MESSAGE", $out);
417  }
418  }
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
$txt
Definition: error.php:11
Create styles array
The data for the language used.
getMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillNewContentStyle()

ilTemplate::fillNewContentStyle ( )
private

Fill Content Style.

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

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

Referenced by get(), and show().

820  {
821  $this->setVariable(
822  "LOCATION_NEWCONTENT_STYLESHEET_TAG",
823  '<link rel="stylesheet" type="text/css" href="' .
825  . '" />'
826  );
827  }
static getNewContentStyleSheetLocation($mode="output")
get full style sheet file name (path inclusive) of current user
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
+ 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 2363 of file class.ilTemplate.php.

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

Referenced by get(), and show().

2364  {
2365  for ($i = 1; $i <= 3; $i++) {
2366  if (is_array($this->on_load_code[$i])) {
2367  $this->setCurrentBlock("on_load_code");
2368  foreach ($this->on_load_code[$i] as $code) {
2369  $this->setCurrentBlock("on_load_code_inner");
2370  $this->setVariable("OLCODE", $code);
2371  $this->parseCurrentBlock();
2372  }
2373  $this->setCurrentBlock("on_load_code");
2374  $this->parseCurrentBlock();
2375  }
2376  }
2377  }
$code
Definition: example_050.php:99
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillPageFormAction()

ilTemplate::fillPageFormAction ( )

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

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

Referenced by fillAdminPanel().

709  {
710  if ($this->page_form_action != "") {
711  $this->setCurrentBlock("page_form_start");
712  $this->setVariable("PAGE_FORM_ACTION", $this->page_form_action);
713  $this->parseCurrentBlock();
714  $this->touchBlock("page_form_end");
715  }
716  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
touchBlock($block)
overwrites ITX::touchBlock.
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
+ 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 2343 of file class.ilTemplate.php.

References HTML_Template_IT\setVariable().

Referenced by get(), and show().

2344  {
2345  if (is_array($this->permanent_link)) {
2346  include_once("./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
2347  $plinkgui = new ilPermanentLinkGUI(
2348  $this->permanent_link["type"],
2349  $this->permanent_link["id"],
2350  $this->permanent_link["append"],
2351  $this->permanent_link["target"]
2352  );
2353  if ($this->permanent_link["title"] != "") {
2354  $plinkgui->setTitle($this->permanent_link["title"]);
2355  }
2356  $this->setVariable("PRMLINK", $plinkgui->getHTML());
2357  }
2358  }
Class for permanent links.
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
+ 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 1835 of file class.ilTemplate.php.

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

Referenced by get(), and show().

1836  {
1837  if (trim($this->right_content) != "") {
1838  $this->setCurrentBlock("right_column");
1839  $this->setVariable("RIGHT_CONTENT", $this->right_content);
1840  $this->parseCurrentBlock();
1841  }
1842  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
+ 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 2004 of file class.ilTemplate.php.

References $DIC, $ilUser, blockExists(), and touchBlock().

Referenced by get(), and show().

2005  {
2006  global $DIC;
2007 
2008  $ilUser = $DIC->user();
2009 
2010  if (is_object($ilUser) && $ilUser->getPref("screen_reader_optimization") && $this->blockExists("sr_focus")) {
2011  $this->touchBlock("sr_focus");
2012  }
2013  }
global $DIC
Definition: saml.php:7
touchBlock($block)
overwrites ITX::touchBlock.
$ilUser
Definition: imgupload.php:18
blockExists($a_blockname)
check if block exists in actual template private
+ 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 2018 of file class.ilTemplate.php.

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

Referenced by get(), and show().

2019  {
2020  global $DIC;
2021 
2022  $ilSetting = $DIC->settings();
2023 
2024  $lng = $DIC->language();
2025 
2026  if ($this->upper_icon == "" && $this->tree_flat_link == ""
2027  && $this->mount_webfolder == "") {
2028  return;
2029  }
2030 
2031  // upper icon
2032  // deprecated
2033  if ($this->upper_icon != "") {
2034  /*if ($this->upper_icon_frame != "")
2035  {
2036  $this->setCurrentBlock("target_top");
2037  $this->setVariable("TARGET_TOP", $this->upper_icon_frame);
2038  $this->parseCurrentBlock();
2039  }
2040 
2041  $this->setCurrentBlock("alt_top");
2042  $this->setVariable("ALT_TOP", $lng->txt("up"));
2043  $this->parseCurrentBlock();
2044 
2045  $this->setCurrentBlock("top");
2046  $this->setVariable("LINK_TOP", $this->upper_icon);
2047  $this->parseCurrentBlock();*/
2048  }
2049 
2050  // tree/flat icon
2051  if ($this->tree_flat_link != "") {
2052  if ($this->left_nav_content != "") {
2053  $this->touchBlock("tree_lns");
2054  }
2055 
2056  $this->setCurrentBlock("tree_mode");
2057  $this->setVariable("LINK_MODE", $this->tree_flat_link);
2058  if ($ilSetting->get("tree_frame") == "right") {
2059  if ($this->tree_flat_mode == "tree") {
2060  $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
2061  $this->setVariable("RIGHT", "Right");
2062  } else {
2063  $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
2064  $this->setVariable("RIGHT", "Right");
2065  }
2066  } else {
2067  if ($this->tree_flat_mode == "tree") {
2068  $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
2069  } else {
2070  $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
2071  }
2072  }
2073  $this->setVariable("ALT_TREE", $lng->txt($this->tree_flat_mode . "view"));
2074  $this->setVariable("TARGET_TREE", ilFrameTargetInfo::_getFrame("MainContent"));
2075  include_once("./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
2076  $this->setVariable(
2077  "TREE_ACC_KEY",
2078  ilAccessKeyGUI::getAttribute(($this->tree_flat_mode == "tree")
2081  );
2082  $this->parseCurrentBlock();
2083  }
2084 
2085  // mount webfolder
2086  if ($this->mount_webfolder != "") {
2087  require_once('Services/WebDAV/classes/class.ilDAVServer.php');
2088  $davServer = ilDAVServer::getInstance();
2089  $a_ref_id = $this->mount_webfolder;
2090  $a_link = $davServer->getMountURI($a_ref_id);
2091  $a_folder = $davServer->getFolderURI($a_ref_id);
2092 
2093  $this->setCurrentBlock("mount_webfolder");
2094  $this->setVariable("LINK_MOUNT_WEBFOLDER", $a_link);
2095  $this->setVariable("FOLDER_MOUNT_WEBFOLDER", $a_folder);
2096  $this->setVariable("IMG_MOUNT_WEBFOLDER", ilUtil::getImagePath("ic_mount_webfolder.png"));
2097  $this->setVariable("ALT_MOUNT_WEBFOLDER", $lng->txt("mount_webfolder"));
2098  $this->setVariable("TARGET_MOUNT_WEBFOLDER", '_blank');
2099  $this->parseCurrentBlock();
2100  }
2101 
2102  $this->setCurrentBlock("tree_icons");
2103  $this->parseCurrentBlock();
2104  }
global $DIC
Definition: saml.php:7
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
touchBlock($block)
overwrites ITX::touchBlock.
static getInstance()
Get singelton instance.
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
static _getFrame($a_class, $a_type='')
Get content frame name.
global $ilSetting
Definition: privfeed.php:17
global $lng
Definition: privfeed.php:17
static getAttribute($a_func_id)
Get accesskey HTML attribute.
+ 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 1777 of file class.ilTemplate.php.

References touchBlock().

Referenced by get(), and show().

1778  {
1779  if ($this->stop_floating) {
1780  $this->touchBlock("stop_floating");
1781  }
1782  }
touchBlock($block)
overwrites ITX::touchBlock.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillTabs()

ilTemplate::fillTabs ( )

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

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

Referenced by get(), and show().

679  {
680  if ($this->blockExists("tabs_outer_start")) {
681  $this->touchBlock("tabs_outer_start");
682  $this->touchBlock("tabs_outer_end");
683  $this->touchBlock("tabs_inner_start");
684  $this->touchBlock("tabs_inner_end");
685 
686  if ($this->thtml != "") {
687  $this->setVariable("TABS", $this->thtml);
688  }
689  $this->setVariable("SUB_TABS", $this->sthtml);
690  }
691  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
touchBlock($block)
overwrites ITX::touchBlock.
blockExists($a_blockname)
check if block exists in actual template private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillToolbar()

ilTemplate::fillToolbar ( )

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

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

Referenced by get(), and show().

694  {
695  global $DIC;
696 
697  $ilToolbar = $DIC["ilToolbar"];
698  ;
699 
700  $thtml = $ilToolbar->getHTML();
701  if ($thtml != "") {
702  $this->setCurrentBlock("toolbar_buttons");
703  $this->setVariable("BUTTONS", $thtml);
704  $this->parseCurrentBlock();
705  }
706  }
global $DIC
Definition: saml.php:7
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
+ 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 private

Returns
integer

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

References $key, and HTML_Template_IT\setVariable().

Referenced by parseCurrentBlock(), and touchBlock().

1126  {
1127  $count = 0;
1128  reset($this->vars);
1129 
1130  foreach ($this->vars as $key => $val) {
1131  if (is_array($this->blockvariables[$this->activeBlock])) {
1132  if (array_key_exists($key, $this->blockvariables[$this->activeBlock])) {
1133  $count++;
1134 
1135  $this->setVariable($key, $val);
1136  }
1137  }
1138  }
1139 
1140  return $count;
1141  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillWindowTitle()

ilTemplate::fillWindowTitle ( )

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

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

Referenced by get(), and show().

636  {
637  global $DIC;
638 
639  $ilSetting = $DIC->settings();
640 
641  if ($this->header_page_title != "") {
642  $a_title = ilUtil::stripScriptHTML($this->header_page_title);
643  $this->setVariable("PAGETITLE", "- " . $a_title);
644  }
645 
646  if ($ilSetting->get('short_inst_name') != "") {
647  $this->setVariable(
648  "WINDOW_TITLE",
649  $ilSetting->get('short_inst_name')
650  );
651  } else {
652  $this->setVariable(
653  "WINDOW_TITLE",
654  "ILIAS"
655  );
656  }
657  }
global $DIC
Definition: saml.php:7
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...
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
global $ilSetting
Definition: privfeed.php:17
+ 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 
)

??? public

Parameters
string
Returns
string

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

References $DIC, $html, ilObjLanguageAccess\_saveUsages(), addILIASFooter(), array, 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(), getMainMenu(), ilPluginAdmin\getPluginObject(), getTabsHTML(), handleReferer(), IL_COMP_SERVICE, initHelp(), ilUIHookPluginGUI\KEEP, HTML_Template_IT\parseCurrentBlock(), setCenterColumnClass(), and setCurrentBlock().

Referenced by ilPDSelectedItemsBlockGUI\getViewBlockHtml().

245  {
246  global $DIC;
247 
248  if ($add_error_mess) {
249  $this->fillMessage();
250  }
251 
252  if ($add_ilias_footer) {
253  $this->addILIASFooter();
254  }
255 
256  // set standard parts (tabs and title icon)
257  if ($add_standard_elements) {
258  if ($this->blockExists("content") && $a_tabs) {
259  // determine default screen id
260  $this->getTabsHTML();
261  }
262 
263  // to get also the js files for the main menu
264  $this->getMainMenu();
265  $this->initHelp();
266 
267  // these fill blocks in tpl.main.html
268  $this->fillCssFiles();
269  $this->fillInlineCss();
270  $this->fillContentStyle();
271  $this->fillBodyClass();
272 
273  // these fill just plain placeholder variables in tpl.main.html
274  $this->setCurrentBlock("DEFAULT");
275  $this->fillNewContentStyle();
276  $this->fillContentLanguage();
277  $this->fillWindowTitle();
278 
279  // these fill blocks in tpl.adm_content.html
280  $this->fillHeader();
281  $this->fillSideIcons();
282  $this->fillScreenReaderFocus();
283  $this->fillStopFloating();
284  $this->fillLeftContent();
285  $this->fillLeftNav();
286  $this->fillRightContent();
287  $this->fillAdminPanel();
288  $this->fillToolbar();
289  $this->fillPermanentLink();
290 
291  $this->setCenterColumnClass();
292 
293  // late loading of javascipr files, since operations above may add files
294  $this->fillJavaScriptFiles();
295  $this->fillOnLoadCode();
296 
297  // these fill just plain placeholder variables in tpl.adm_content.html
298  if ($this->blockExists("content")) {
299  $this->setCurrentBlock("content");
300  if ($a_tabs) {
301  $this->fillTabs();
302  }
303  $this->fillMainContent();
304  if ($a_main_menu) {
305  $this->fillMainMenu();
306  }
307  $this->fillLightbox();
308  $this->parseCurrentBlock();
309  }
310  }
311 
312  if ($handle_referer) {
313  $this->handleReferer();
314  }
315 
316  if ($part == "DEFAULT") {
317  $html = parent::get();
318  } else {
319  $html = parent::get($part);
320  }
321 
322  // include the template output hook
323  $ilPluginAdmin = $DIC["ilPluginAdmin"];
324  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
325  foreach ($pl_names as $pl) {
326  $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
327  $gui_class = $ui_plugin->getUIClassInstance();
328 
329  $resp = $gui_class->getHTML(
330  "",
331  "template_get",
332  array("tpl_id" => $this->tplIdentifier, "tpl_obj" => $this, "html" => $html)
333  );
334 
335  if ($resp["mode"] != ilUIHookPluginGUI::KEEP) {
336  $html = $gui_class->modifyHTML($html, $resp);
337  }
338  }
339 
340  // fix #9992: save language usages as late as possible
341  if ($this->translation_linked) {
343  }
344 
345  return $html;
346  }
fillNewContentStyle()
Fill Content Style.
global $DIC
Definition: saml.php:7
fillScreenReaderFocus()
Accessibility focus for screen readers.
getTabsHTML()
Get tabs HTML.
fillPermanentLink()
Fill in permanent link.
fillLeftContent()
Fill left content.
fillOnLoadCode()
Fill add on load code.
fillStopFloating()
stop floating
fillHeader()
Fill header.
fillAdminPanel()
Put admin panel into template:
fillSideIcons()
Fill side icons (upper icon, tree icon, webfolder icon)
fillLeftNav()
Fill left navigation frame.
initHelp()
Init help.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
fillLightbox()
Fill lightbox content.
fillRightContent()
Fill right content.
Create styles array
The data for the language used.
fillContentLanguage()
Add current user language to meta tags.
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
handleReferer()
TODO: this is nice, but shouldn&#39;t be done here (-> maybe at the end of ilias.php!?, alex)
fillCssFiles($a_force=false)
Fill in the css file tags.
blockExists($a_blockname)
check if block exists in actual template private
fillMainContent()
Fill main content.
static _saveUsages()
Store the collected usages in the user session.
fillContentStyle()
Fill Content Style.
fillInlineCss()
Fill in the inline css.
addILIASFooter()
add ILIAS footer
$html
Definition: example_001.php:87
const IL_COMP_SERVICE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get() [2/2]

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

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  }

◆ getAddFooter()

ilTemplate::getAddFooter ( )

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

References $addFooter.

Referenced by addILIASFooter().

216  {
217  return $this->addFooter;
218  }
+ 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 225 of file class.ilTemplate.php.

References getContentType(), and header.

226  {
227  header("Content-type: " . $this->getContentType() . "; charset=UTF-8");
228  return $this->get();
229  }
Add a drawing to the header
Definition: 04printing.php:69
getContentType()
Get the content type for the template output.
+ Here is the call graph for this function:

◆ getContentType()

ilTemplate::getContentType ( )

Get the content type for the template output.

Returns
string Content type public

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

References $contenttype.

Referenced by getAsynch(), and show().

444  {
445  return $this->contenttype;
446  }
+ Here is the caller graph for this function:

◆ getHeaderActionMenu()

ilTemplate::getHeaderActionMenu ( )

Get header action menu.

Returns
int ref id

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

References $header_action.

Referenced by fillHeader().

1800  {
1801  return $this->header_action;
1802  }
+ Here is the caller graph for this function:

◆ getLoginTargetPar()

ilTemplate::getLoginTargetPar ( )

Get target parameter for login.

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

Referenced by getMainMenu().

1997  {
1998  return $this->login_target_par;
1999  }
+ Here is the caller graph for this function:

◆ getMainMenu()

ilTemplate::getMainMenu ( )

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

References $DIC, getLoginTargetPar(), and variableExists().

Referenced by get(), and show().

830  {
831  global $DIC;
832 
833  $ilMainMenu = $DIC["ilMainMenu"];
834 
835  if ($this->variableExists('MAINMENU')) {
836  $ilMainMenu->setLoginTargetPar($this->getLoginTargetPar());
837  $this->main_menu = $ilMainMenu->getHTML();
838  $this->main_menu_spacer = $ilMainMenu->getSpacerClass();
839  }
840  }
global $DIC
Definition: saml.php:7
getLoginTargetPar()
Get target parameter for login.
variableExists($a_variablename)
+ 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 237 of file class.ilTemplate.php.

References $a_type, and $lng.

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  }
$a_type
Definition: workflow.php:92
special template class to simplify handling of ITX/PEAR
global $lng
Definition: privfeed.php:17

◆ getMessageHTML() [2/2]

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

Get HTML for a system message.

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

References $a_type, $DIC, and $lng.

Referenced by fillMessage(), and show().

424  {
425  global $DIC;
426 
427  $lng = $DIC->language();
428  $mtpl = new ilTemplate("tpl.message.html", true, true, "Services/Utilities");
429  $mtpl->setCurrentBlock($a_type . "_message");
430  $mtpl->setVariable("TEXT", $a_txt);
431  $mtpl->setVariable("MESSAGE_HEADING", $lng->txt($a_type . "_message"));
432  $mtpl->parseCurrentBlock();
433 
434  return $mtpl->get();
435  }
global $DIC
Definition: saml.php:7
$a_type
Definition: workflow.php:92
special template class to simplify handling of ITX/PEAR
global $lng
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ getMessageTextForType()

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

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

References $_SESSION, $m, and $txt.

Referenced by fillMessage().

2516  {
2517  $txt = "";
2518  if (isset($_SESSION[$m]) && $_SESSION[$m] != "") {
2519  $txt = $_SESSION[$m];
2520  } else {
2521  if (isset($this->message[$m])) {
2522  $txt = $this->message[$m];
2523  }
2524  }
2525 
2526  return $txt;
2527  }
$_SESSION["AccountId"]
$txt
Definition: error.php:11
+ Here is the caller graph for this function:

◆ getOnLoadCodeForAsynch()

ilTemplate::getOnLoadCodeForAsynch ( )

Get js onload code for ajax calls.

Returns
string

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

References $code, $i, and $js.

2385  {
2386  $js = "";
2387  for ($i = 1; $i <= 3; $i++) {
2388  if (is_array($this->on_load_code[$i])) {
2389  foreach ($this->on_load_code[$i] as $code) {
2390  $js .= $code . "\n";
2391  }
2392  }
2393  }
2394  if ($js) {
2395  return '<script type="text/javascript">' . "\n" .
2396  $js .
2397  '</script>' . "\n";
2398  }
2399  }
$js
$code
Definition: example_050.php:99
$i
Definition: disco.tpl.php:19

◆ getStandardTemplate()

ilTemplate::getStandardTemplate ( )

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

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

1561  {
1562  if ($this->standard_template_loaded) {
1563  return;
1564  }
1565 
1566  // always load jQuery
1567  include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
1570 
1571  // always load ui framework
1572  include_once("./Services/UICore/classes/class.ilUIFramework.php");
1574 
1575  // always load Basic js
1576  // $this->addJavaScript("./Services/JavaScript/js/Basic.js",
1577  // true, 1);
1578 
1579  $this->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
1580  $this->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
1581 
1582  $this->standard_template_loaded = true;
1583  }
static init($a_tpl=null)
Init.
addBlockFile($var, $block, $tplname, $in_module=false)
overwrites ITX::addBlockFile public
static initjQueryUI($a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components.txt for included components)
static initjQuery($a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
+ Here is the call graph for this function:

◆ getTabsHTML()

ilTemplate::getTabsHTML ( )

Get tabs HTML.

Parameters

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

References $DIC, and blockExists().

Referenced by get(), and show().

666  {
667  global $DIC;
668 
669  $ilTabs = $DIC["ilTabs"];
670 
671  if ($this->blockExists("tabs_outer_start")) {
672  $this->sthtml = $ilTabs->getSubTabHTML();
673  $this->thtml = $ilTabs->getHTML((trim($sthtml) == ""));
674  }
675  }
global $DIC
Definition: saml.php:7
blockExists($a_blockname)
check if block exists in actual template private
+ 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 1511 of file class.ilTemplate.php.

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

Referenced by __construct(), and addBlockFile().

1512  {
1513  global $DIC;
1514 
1515  $ilCtrl = null;
1516  if (isset($DIC["ilCtrl"])) {
1517  $ilCtrl = $DIC->ctrl();
1518  }
1519 
1520 
1521  // if baseClass functionality is used (ilias.php):
1522  // get template directory from ilCtrl
1523  if (!empty($_GET["baseClass"]) && $a_in_module === true) {
1524  $a_in_module = $ilCtrl->getModuleDir();
1525  }
1526 
1527  if (strpos($a_tplname, "/") === false) {
1528  if ($a_in_module) {
1529  if ($a_in_module === true) {
1530  $module_path = ILIAS_MODULE . "/";
1531  } else {
1532  $module_path = $a_in_module . "/";
1533  }
1534  } else {
1535  $module_path = "";
1536  }
1537 
1538  return $module_path . basename($a_tplname);
1539  } else {
1540  return $a_tplname;
1541  }
1542  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
const ILIAS_MODULE
Definition: server.php:14
+ 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 89 of file class.ilTemplate.php.

References $_GET, $ilCtrl, and ILIAS_MODULE.

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  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
const ILIAS_MODULE
Definition: server.php:14

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

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

Referenced by __construct(), and addBlockFile().

1445  {
1446  global $DIC;
1447 
1448  $ilCtrl = null;
1449  if (isset($DIC["ilCtrl"])) {
1450  $ilCtrl = $DIC->ctrl();
1451  }
1452 
1453  $fname = "";
1454 
1455  // if baseClass functionality is used (ilias.php):
1456  // get template directory from ilCtrl
1457  if (!empty($_GET["baseClass"]) && $a_in_module === true) {
1458  $a_in_module = $ilCtrl->getModuleDir();
1459  }
1460 
1461  if (strpos($a_tplname, "/") === false) {
1462  $module_path = "";
1463 
1464  if ($a_in_module) {
1465  if ($a_in_module === true) {
1466  $module_path = ILIAS_MODULE . "/";
1467  } else {
1468  $module_path = $a_in_module . "/";
1469  }
1470  }
1471 
1472  // use ilStyleDefinition instead of account to get the current skin
1473  include_once "Services/Style/System/classes/class.ilStyleDefinition.php";
1474  if (ilStyleDefinition::getCurrentSkin() != "default") {
1475  $fname = "./Customizing/global/skin/" .
1476  ilStyleDefinition::getCurrentSkin() . "/" . $module_path . basename($a_tplname);
1477  }
1478 
1479  if ($fname == "" || !file_exists($fname)) {
1480  $fname = "./" . $module_path . "templates/default/" . basename($a_tplname);
1481  }
1482  } elseif (strpos($a_tplname, "src/UI")===0) {
1483  if (class_exists("ilStyleDefinition") // for testing
1484  && ilStyleDefinition::getCurrentSkin() != "default") {
1485  $fname = "./Customizing/global/skin/" . ilStyleDefinition::getCurrentSkin() . "/" . str_replace("src/UI/templates/default", "UI", $a_tplname);
1486  }
1487  if ($fname == "" || !file_exists($fname)) {
1488  $fname = $a_tplname;
1489  }
1490  } else {
1491  $fname = $a_tplname;
1492  }
1493 
1494  return $fname;
1495  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
const ILIAS_MODULE
Definition: server.php:14
+ Here is the caller graph for this function:

◆ getTitleColor()

ilTemplate::getTitleColor ( )

Get title color.

Returns
string color

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

Referenced by fillHeader().

1618  {
1619  return $this->title_color;
1620  }
+ 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 1046 of file class.ilTemplate.php.

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

Referenced by get(), and show().

1047  {
1048  if (((substr(strrchr($_SERVER["PHP_SELF"], "/"), 1) != "error.php")
1049  && (substr(strrchr($_SERVER["PHP_SELF"], "/"), 1) != "adm_menu.php")
1050  && (substr(strrchr($_SERVER["PHP_SELF"], "/"), 1) != "chat.php"))) {
1051  $_SESSION["post_vars"] = $_POST;
1052 
1053  // referer is modified if query string contains cmd=gateway and $_POST is not empty.
1054  // this is a workaround to display formular again in case of error and if the referer points to another page
1055  $url_parts = @parse_url($_SERVER["REQUEST_URI"]);
1056  if (!$url_parts) {
1057  $protocol = (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://';
1058  $host = $_SERVER['HTTP_HOST'];
1059  $path = $_SERVER['REQUEST_URI'];
1060  $url_parts = @parse_url($protocol . $host . $path);
1061  }
1062 
1063  if (isset($url_parts["query"]) && preg_match("/cmd=gateway/", $url_parts["query"]) && (isset($_POST["cmd"]["create"]))) {
1064  foreach ($_POST as $key => $val) {
1065  if (is_array($val)) {
1066  $val = key($val);
1067  }
1068 
1069  $str .= "&" . $key . "=" . $val;
1070  }
1071 
1072  $_SESSION["referer"] = preg_replace("/cmd=gateway/", substr($str, 1), $_SERVER["REQUEST_URI"]);
1073  $_SESSION['referer_ref_id'] = (int) $_GET['ref_id'];
1074  } elseif (isset($url_parts["query"]) && preg_match("/cmd=post/", $url_parts["query"]) && (isset($_POST["cmd"]["create"]))) {
1075  foreach ($_POST as $key => $val) {
1076  if (is_array($val)) {
1077  $val = key($val);
1078  }
1079 
1080  $str .= "&" . $key . "=" . $val;
1081  }
1082 
1083  $_SESSION["referer"] = preg_replace("/cmd=post/", substr($str, 1), $_SERVER["REQUEST_URI"]);
1084  if (isset($_GET['ref_id'])) {
1085  $_SESSION['referer_ref_id'] = (int) $_GET['ref_id'];
1086  } else {
1087  $_SESSION['referer_ref_id'] = 0;
1088  }
1089  } else {
1090  $_SESSION["referer"] = $_SERVER["REQUEST_URI"];
1091  if (isset($_GET['ref_id'])) {
1092  $_SESSION['referer_ref_id'] = (int) $_GET['ref_id'];
1093  } else {
1094  $_SESSION['referer_ref_id'] = 0;
1095  }
1096  }
1097 
1098  unset($_SESSION["error_post_vars"]);
1099  }
1100  }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$_SESSION["AccountId"]
$_GET["client_id"]
$key
Definition: croninfo.php:18
$_POST["username"]
+ Here is the caller graph for this function:

◆ hasMessage()

ilTemplate::hasMessage (   $a_type)

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

References $a_type.

376  {
377  return (isset($this->message[$a_type]) && strlen($this->message[$a_type]));
378  }
$a_type
Definition: workflow.php:92

◆ includeNavigation()

ilTemplate::includeNavigation ( )

check if there is a NAVIGATION-topic public

Returns
boolean

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

References checkTopic().

1303  {
1304  return $this->checkTopic("__global__", "NAVIGATION");
1305  }
checkTopic($a_block, $a_topic)
checks for a topic in the template private
+ Here is the call graph for this function:

◆ includeTree()

ilTemplate::includeTree ( )

check if there is a TREE-topic public

Returns
boolean

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

References checkTopic().

1313  {
1314  return $this->checkTopic("__global__", "TREE");
1315  }
checkTopic($a_block, $a_topic)
checks for a topic in the template private
+ Here is the call graph for this function:

◆ init()

ilTemplate::init ( )

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

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().

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

◆ initHelp()

ilTemplate::initHelp ( )

Init help.

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

References ilHelpGUI\initHelp().

Referenced by get(), and show().

856  {
857  include_once("./Services/Help/classes/class.ilHelpGUI.php");
858  ilHelpGUI::initHelp($this);
859  }
static initHelp($a_tpl)
Render current help page.
+ 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. public
Returns
boolean false on failure, otherwise true
See also
$template, setTemplate(), $removeUnknownVariables, $removeEmptyBlocks

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

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

Referenced by __construct().

1393  {
1394  global $DIC;
1395 
1396  // copied from IT:loadTemplateFile
1397  $template = '';
1398  if (!$this->flagCacheTemplatefile ||
1399  $this->lastTemplatefile != $filename
1400  ) {
1401  $template = $this->getFile($filename);
1402  }
1403  $this->lastTemplatefile = $filename;
1404  // copied.
1405 
1406  // new code to include the template input hook:
1407  $ilPluginAdmin = $DIC["ilPluginAdmin"];
1408  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
1409  foreach ($pl_names as $pl) {
1410  $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
1411  $gui_class = $ui_plugin->getUIClassInstance();
1412 
1413  $resp = $gui_class->getHTML(
1414  "",
1415  "template_load",
1416  array("tpl_id" => $this->tplIdentifier, "tpl_obj" => $this, "html" => $template)
1417  );
1418 
1419  if ($resp["mode"] != ilUIHookPluginGUI::KEEP) {
1420  $template = $gui_class->modifyHTML($template, $resp);
1421  }
1422  }
1423  // new.
1424 
1425  // copied from IT:loadTemplateFile
1426  return $template != '' ?
1427  $this->setTemplate(
1428  $template,
1431  ) : false;
1432  // copied.
1433  }
global $DIC
Definition: saml.php:7
$removeUnknownVariables
Definition: IT.php:195
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
Create styles array
The data for the language used.
$removeEmptyBlocks
Definition: IT.php:202
setTemplate( $template, $removeUnknownVariables=true, $removeEmptyBlocks=true)
Sets the template.
Definition: IT.php:741
const IL_COMP_SERVICE
getFile($filename)
Reads a file from disk and returns its content.
Definition: IT.php:912
+ 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 public.

Parameters
string
Returns
string

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

References $activeBlock.

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  }

◆ parseCurrentBlock() [2/2]

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

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

Parameters
string
Returns
string

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

References $activeBlock, and fillVars().

Referenced by ilBTPopOverGUI\addButton(), ilContainerRenderer\addHeaderRow(), ilPDSelectedItemsBlockGUI\addSectionHeader(), ilContainerRenderer\addSeparatorRow(), ilContainerRenderer\addStandardRow(), ilPDSelectedItemsBlockGUI\getViewBlockHtml(), ilOrgUnitAuthorityInputGUI\insert(), ilTermsOfServiceSignedDocumentFormElementGUI\insert(), ilChatroomAuthInputGUI\insert(), ilEMailInputGUI\insert(), ilCaptchaInputGUI\insert(), ilClozeGapInputBuilderGUI\insert(), ilSCORMExplorer\insertObject(), ilTestQuestionNavigationGUI\parseButtonsBlock(), ilTestQuestionNavigationGUI\parseNavigation(), ilAssQuestionPreviewGUI\populateGenericQuestionFeedback(), ilAssQuestionPreviewGUI\populateSolutionOutput(), ilAssQuestionPreviewGUI\populateSpecificQuestionFeedback(), ilTestQuestionNavigationGUI\renderActionsIcon(), ilTestQuestionNavigationGUI\renderButtonInstance(), ilAssLacLegendGUI\renderCommonLegendPart(), ilContainerRenderer\renderDetails(), ilAssLacLegendGUI\renderExample(), ilTestQuestionNavigationGUI\renderIcon(), ilSurveyPageGUI\renderPageNode(), ilForumExportGUI\renderPostHtml(), ilAssLacLegendGUI\renderQuestSpecificLegendPart(), and ilContainerRenderer\renderSelectAllBlock().

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

◆ prepareForFormular()

ilTemplate::prepareForFormular (   $vars)

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

public

Parameters
string

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

References $i, and $vars.

1248  {
1249  if (!is_array($vars)) {
1250  return;
1251  }
1252 
1253  reset($vars);
1254 
1255  while (list($i) = each($vars)) {
1256  $vars[$i] = stripslashes($vars[$i]);
1257  $vars[$i] = htmlspecialchars($vars[$i]);
1258  }
1259 
1260  return($vars);
1261  }
$i
Definition: disco.tpl.php:19

◆ replace()

ilTemplate::replace ( )

??? public

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

References $key, and HTML_Template_IT\setVariable().

Referenced by replaceDefault(), and replaceFromDatabase().

1268  {
1269  reset($this->vars);
1270 
1271  while (list($key, $val) = each($this->vars)) {
1272  $this->setVariable($key, $val);
1273  }
1274  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ replaceDefault()

ilTemplate::replaceDefault ( )

??? public

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

References replace().

1281  {
1282  $this->replace($this->vars);
1283  }
replace()
??? public
+ 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 public

Parameters
string
string
string
string

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

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

1217  {
1218  $res = $DB->selectDbAll();
1219 
1220  while ($DB->getDbNextElement($res)) {
1221  $this->setCurrentBlock($block);
1222  $result = array();
1223  reset($conv);
1224 
1225  while (list($key, $val) = each($conv)) {
1226  $result[$val]=$DB->element->data[$key];
1227  }
1228 
1229  if (($select != "default")
1230  && ($DB->element->data[$select["id"]]==$select["value"]
1231  || (strtolower($select["text"]) == "checked"
1232  && strpos(",," . $select["value"] . ",,", "," . $DB->element->data[$select["id"]] . ",")!=false))) {
1233  $result[$select["field"]] = $select["text"];
1234  }
1235 
1236  $this->replace($result);
1237  $this->parseCurrentBlock($block);
1238  }
1239  }
$result
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
replace()
??? public
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:

◆ resetCss()

ilTemplate::resetCss ( )

Reset css files.

Parameters

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

References array.

2168  {
2169  $this->css_files = array();
2170  }
Create styles array
The data for the language used.

◆ resetHeaderBlock()

ilTemplate::resetHeaderBlock (   $a_reset_header_action = true)

Set variable.

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

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

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

2488  {
2489  $this->setTitle(null);
2490  $this->setTitleIcon(null);
2491  $this->setDescription(null);
2492  $this->setAlertProperties(array());
2493  $this->enableDragDropFileUpload(null);
2494 
2495  // see setFullscreenHeader()
2496  if ($a_reset_header_action) {
2497  $this->setHeaderActionMenu(null);
2498  }
2499  }
setTitleIcon($a_icon_path, $a_icon_desc="")
set title icon
setDescription($a_descr)
sets title in standard template
setAlertProperties(array $a_props)
Set alert properties.
setTitle($a_title)
sets title in standard template
setHeaderActionMenu($a_header)
Set header action menu.
Create styles array
The data for the language used.
enableDragDropFileUpload($a_ref_id)
Enables the file upload into this object by dropping a file.
+ Here is the call graph for this function:

◆ resetJavascript()

ilTemplate::resetJavascript ( )

Reset javascript files.

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

References array.

2155  {
2156  $this->js_files = array();
2157  $this->js_files_vp = array();
2158  $this->js_files_batch = array();
2159  }
Create styles array
The data for the language used.

◆ setAddFooter()

ilTemplate::setAddFooter (   $value)

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

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

◆ setAlertProperties()

ilTemplate::setAlertProperties ( array  $a_props)

Set alert properties.

Parameters
array$a_props
Returns
void

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

Referenced by clearHeader(), and resetHeaderBlock().

1628  {
1629  $this->title_alerts = $a_props;
1630  }
+ Here is the caller graph for this function:

◆ setBackgroundColor()

ilTemplate::setBackgroundColor (   $a_bg_color)

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

References HTML_Template_IT\setVariable().

2402  {
2403  // :TODO: currently inactive, JF should discuss this
2404  return;
2405 
2406  if ($a_bg_color != "") {
2407  $this->setVariable("FRAME_BG_COLOR", " style=\"background-color: #" . $a_bg_color . "\"");
2408  }
2409  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
+ 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 2419 of file class.ilTemplate.php.

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

2420  {
2421  if ($a_img) {
2422  if (!$a_export) {
2423  $a_img = ILIAS_HTTP_PATH . "/" . $a_img;
2424  }
2425 
2426  $this->setCurrentBlock("banner_bl");
2427  $this->setVariable("BANNER_WIDTH", $a_width); // currently not needed
2428  $this->setVariable("BANNER_HEIGHT", $a_height);
2429  $this->setVariable("BANNER_URL", $a_img);
2430  $this->parseCurrentBlock();
2431  }
2432  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
+ Here is the call graph for this function:

◆ setBodyClass()

ilTemplate::setBodyClass (   $a_class = "")

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

Referenced by __construct().

1739  {
1740  $this->body_class = $a_class;
1741  }
+ Here is the caller graph for this function:

◆ setCenterColumnClass()

ilTemplate::setCenterColumnClass ( )
private

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

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

Referenced by get(), and show().

1845  {
1846  if (!$this->blockExists("center_col_width")) {
1847  return;
1848  }
1849  $center_column_class = "";
1850  if (trim($this->right_content) != "" && trim($this->left_content) != "") {
1851  $center_column_class = "two_side_col";
1852  } elseif (trim($this->right_content) != "" || trim($this->left_content) != "") {
1853  $center_column_class = "one_side_col";
1854  }
1855 
1856  switch ($center_column_class) {
1857  case "one_side_col": $center_column_class = "col-sm-9"; break;
1858  case "two_side_col": $center_column_class = "col-sm-6"; break;
1859  default: $center_column_class = "col-sm-12"; break;
1860  }
1861  if (trim($this->left_content) != "") {
1862  $center_column_class.= " col-sm-push-3";
1863  }
1864 
1865  $this->setCurrentBlock("center_col_width");
1866  $this->setVariable("CENTER_COL", $center_column_class);
1867  $this->parseCurrentBlock();
1868  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
blockExists($a_blockname)
check if block exists in actual template private
+ 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 1807 of file class.ilTemplate.php.

1808  {
1809  if ($a_html != "") {
1810  $this->main_content = $a_html;
1811  }
1812  }

◆ setContentStyleSheet()

ilTemplate::setContentStyleSheet (   $a_style)

Set content style (used for page content editor)

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

797  {
798  $this->content_style_sheet = $a_style;
799  }

◆ 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 public

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

459  {
460  $this->contenttype = $a_content_type;
461  }

◆ setCurrentBlock() [1/2]

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

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

public

Parameters
string
Returns
???

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  }

◆ setCurrentBlock() [2/2]

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

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

public

Parameters
string
Returns
???

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

Referenced by ilBTPopOverGUI\addButton(), ilContainerRenderer\addHeaderRow(), ilPDSelectedItemsBlockGUI\addSectionHeader(), ilContainerRenderer\addSeparatorRow(), ilContainerRenderer\addStandardRow(), fillAdminPanel(), fillBodyClass(), fillContentStyle(), fillCssFiles(), fillHeader(), fillInlineCss(), fillJavascriptFile(), fillJavaScriptFiles(), fillLeftContent(), fillLeftNav(), fillOnLoadCode(), fillPageFormAction(), fillRightContent(), fillSideIcons(), fillToolbar(), get(), ilPDSelectedItemsBlockGUI\getViewBlockHtml(), ilOrgUnitAuthorityInputGUI\insert(), ilTermsOfServiceSignedDocumentFormElementGUI\insert(), ilChatroomAuthInputGUI\insert(), ilEMailInputGUI\insert(), ilCaptchaInputGUI\insert(), ilClozeGapInputBuilderGUI\insert(), ilSCORMExplorer\insertObject(), ilTestQuestionNavigationGUI\parseButtonsBlock(), ilTestQuestionNavigationGUI\parseNavigation(), ilAssQuestionPreviewGUI\populateGenericQuestionFeedback(), ilAssQuestionPreviewGUI\populateSolutionOutput(), ilAssQuestionPreviewGUI\populateSpecificQuestionFeedback(), ilTestQuestionNavigationGUI\renderActionsIcon(), ilTestQuestionNavigationGUI\renderButtonInstance(), ilAssLacLegendGUI\renderCommonLegendPart(), ilContainerRenderer\renderDetails(), ilAssLacLegendGUI\renderExample(), ilTestQuestionNavigationGUI\renderIcon(), ilSurveyPageGUI\renderPageNode(), ilForumExportGUI\renderPostHtml(), ilAssLacLegendGUI\renderQuestSpecificLegendPart(), ilContainerRenderer\renderSelectAllBlock(), replaceFromDatabase(), setBanner(), setCenterColumnClass(), show(), and touchBlock().

1150  {
1151  $this->activeBlock = $part;
1152 
1153  if ($part == "DEFAULT") {
1154  return parent::setCurrentBlock();
1155  } else {
1156  return parent::setCurrentBlock($part);
1157  }
1158  }
+ Here is the caller graph for this function:

◆ setDescription()

ilTemplate::setDescription (   $a_descr)

sets title in standard template

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

Referenced by clearHeader(), and resetHeaderBlock().

1761  {
1762  $this->title_desc = $a_descr;
1763  // $this->setVariable("H_DESCRIPTION", $a_descr);
1764  }
+ Here is the caller graph for this function:

◆ setEditPageButton()

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

Show admin view button.

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

References array.

2239  {
2240  $this->edit_page_button =
2241  array("link" => $a_link, "txt" => $a_txt, "frame" => $a_frame);
2242  }
Create styles array
The data for the language used.

◆ setHeaderActionMenu()

ilTemplate::setHeaderActionMenu (   $a_header)

Set header action menu.

Parameters
string$a_gui$a_header

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

Referenced by resetHeaderBlock().

1790  {
1791  $this->header_action = $a_header;
1792  }
+ Here is the caller graph for this function:

◆ setHeaderPageTitle()

ilTemplate::setHeaderPageTitle (   $a_title)

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

References ilUtil\stripScriptHTML().

1545  {
1546  $a_title = ilUtil::stripScriptHTML($a_title);
1547  $this->header_page_title = $a_title;
1548  }
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...
+ Here is the call graph for this function:

◆ setLeftContent()

ilTemplate::setLeftContent (   $a_html)

sets content of left column

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

1874  {
1875  $this->left_content = $a_html;
1876  }

◆ setLeftNavContent()

ilTemplate::setLeftNavContent (   $a_content)

Sets content of left navigation column.

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

References $a_content.

1898  {
1899  $this->left_nav_content = $a_content;
1900  }
$a_content
Definition: workflow.php:93

◆ setLocator()

ilTemplate::setLocator ( )

Insert locator.

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

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

1919  {
1920  global $DIC;
1921 
1922  $ilMainMenu = $DIC["ilMainMenu"];
1923  $ilLocator = $DIC["ilLocator"];
1924 
1925  $ilPluginAdmin = $DIC["ilPluginAdmin"];
1926 
1927  // blog/portfolio
1928  if ($ilMainMenu->getMode() == ilMainMenuGUI::MODE_TOPBAR_REDUCED ||
1929  $ilMainMenu->getMode() == ilMainMenuGUI::MODE_TOPBAR_ONLY) {
1930  $this->setVariable("LOCATOR", "");
1931  return;
1932  }
1933 
1934  $html = "";
1935  if (is_object($ilPluginAdmin)) {
1936  include_once("./Services/UIComponent/classes/class.ilUIHookProcessor.php");
1937  $uip = new ilUIHookProcessor(
1938  "Services/Locator",
1939  "main_locator",
1940  array("locator_gui" => $ilLocator)
1941  );
1942  if (!$uip->replaced()) {
1943  $html = $ilLocator->getHTML();
1944  }
1945  $html = $uip->getHTML($html);
1946  } else {
1947  $html = $ilLocator->getHTML();
1948  }
1949 
1950  $this->setVariable("LOCATOR", $html);
1951  }
global $DIC
Definition: saml.php:7
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
Create styles array
The data for the language used.
$html
Definition: example_001.php:87
+ 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 1988 of file class.ilTemplate.php.

1989  {
1990  $this->login_target_par = $a_val;
1991  }

◆ setMessage() [1/2]

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

Set message.

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

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

References $a_type, array, and ilSession\set().

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.
$a_type
Definition: workflow.php:92
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ setMessage() [2/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::MESSAGE_TYPE_SUCCESS, ::MESSAGE_TYPE_FAILURE,, ::MESSAGE_TYPE_QUESTION, ::MESSAGE_TYPE_INFO
string$a_txtThe message to be sent
bool$a_keepKeep this message over one redirect

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

References $_SESSION, and $a_type.

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

◆ setMountWebfolderIcon()

ilTemplate::setMountWebfolderIcon (   $a_ref_id)

shows icon for mounting a webfolder

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

2111  {
2112  $this->mount_webfolder = $a_ref_id;
2113  }

◆ setNewContentStyleSheetLocation()

ilTemplate::setNewContentStyleSheetLocation (   $a_stylesheet)

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

References HTML_Template_IT\setVariable().

1556  {
1557  $this->setVariable("LOCATION_NEWCONTENT_STYLESHEET", $a_stylesheet);
1558  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
+ Here is the call graph for this function:

◆ setPageActions()

ilTemplate::setPageActions (   $a_page_actions_html)

Show admin view button.

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

2231  {
2232  $this->page_actions = $a_page_actions_html;
2233  }

◆ setPageFormAction()

ilTemplate::setPageFormAction (   $a_action)

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

1753  {
1754  $this->page_form_action = $a_action;
1755  }

◆ setPermanentLink()

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

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

References $a_type, and array.

2331  {
2332  $this->permanent_link = array(
2333  "type" => $a_type,
2334  "id" => $a_id,
2335  "append" => $a_append,
2336  "target" => $a_target,
2337  "title" => $a_title);
2338  }
$a_type
Definition: workflow.php:92
Create styles array
The data for the language used.

◆ setRightContent()

ilTemplate::setRightContent (   $a_html)

sets content of right column

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

1828  {
1829  $this->right_content = $a_html;
1830  }

◆ setStyleSheetLocation()

ilTemplate::setStyleSheetLocation (   $a_stylesheet)

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

References HTML_Template_IT\setVariable().

1551  {
1552  $this->setVariable("LOCATION_STYLESHEET", $a_stylesheet);
1553  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
+ Here is the call graph for this function:

◆ setSubTabs()

ilTemplate::setSubTabs (   $a_tabs_html)

sets subtabs in standard template

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

References HTML_Template_IT\setVariable().

1971  {
1972  $this->setVariable("SUB_TABS", $a_tabs_html);
1973  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
+ Here is the call graph for this function:

◆ setTabs()

ilTemplate::setTabs (   $a_tabs_html)

sets tabs in standard template

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

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

1957  {
1958  if ($a_tabs_html != "" && $this->blockExists("tabs_outer_start")) {
1959  $this->touchBlock("tabs_outer_start");
1960  $this->touchBlock("tabs_outer_end");
1961  $this->touchBlock("tabs_inner_start");
1962  $this->touchBlock("tabs_inner_end");
1963  $this->setVariable("TABS", $a_tabs_html);
1964  }
1965  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
touchBlock($block)
overwrites ITX::touchBlock.
blockExists($a_blockname)
check if block exists in actual template private
+ Here is the call graph for this function:

◆ setTitle()

ilTemplate::setTitle (   $a_title)

sets title in standard template

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

References ilUtil\stripScriptHTML().

Referenced by clearHeader(), and resetHeaderBlock().

1589  {
1590  $this->title = ilUtil::stripScriptHTML($a_title);
1591  $this->header_page_title = $a_title;
1592  }
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...
+ 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 1607 of file class.ilTemplate.php.

1608  {
1609  $this->title_color = $a_val;
1610  }

◆ setTitleIcon()

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

set title icon

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

Referenced by clearHeader(), and resetHeaderBlock().

1733  {
1734  $this->icon_desc = $a_icon_desc;
1735  $this->icon_path = $a_icon_path;
1736  }
+ Here is the caller graph for this function:

◆ setTitleUrl()

ilTemplate::setTitleUrl (   $a_url)

sets title url in standard template

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

1598  {
1599  $this->title_url = $a_url;
1600  }

◆ setTreeFlatIcon()

ilTemplate::setTreeFlatIcon (   $a_link,
  $a_mode 
)

set tree/flat icon

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

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

2122  {
2123  $this->tree_flat_link = $a_link;
2124  $this->tree_flat_mode = $a_mode;
2125  }

◆ setUpperIcon()

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

sets icon to upper level

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

1979  {
1980  $this->upper_icon = $a_link;
1981  $this->upper_icon_frame = $a_frame;
1982  }

◆ show() [1/2]

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

public

Parameters
string

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

References $_GET, $_POST, $_SERVER, $key, $m, $out, $path, GuzzleHttp\Psr7\$protocol, $txt, array, blockExists(), ilSession\clear(), fillCssFiles(), fillJavaScriptFiles(), ilSession\get(), getMessageHTML(), header, ilSession\set(), and HTML_Template_IT\setVariable().

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) != "")
161  ? 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)) {
177  ilSession::clear($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  }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$_GET["client_id"]
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
static clear($a_var)
Unset a value.
Add a drawing to the header
Definition: 04printing.php:69
$txt
Definition: error.php:11
Create styles array
The data for the language used.
getMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
fillCssFiles($a_force=false)
Fill in the css file tags.
blockExists($a_blockname)
check if block exists in actual template private
$key
Definition: croninfo.php:18
$_POST["username"]
+ 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 469 of file class.ilTemplate.php.

References $DIC, $html, $http, GuzzleHttp\Psr7\$stream, $tpl, ilObjLanguageAccess\_saveUsages(), addILIASFooter(), array, 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(), getContentType(), getMainMenu(), ilPluginAdmin\getPluginObject(), getTabsHTML(), handleReferer(), header, IL_COMP_SERVICE, ilYuiUtil\initDom(), initHelp(), ilUIHookPluginGUI\KEEP, ILIAS\Filesystem\Stream\Streams\ofString(), HTML_Template_IT\parseCurrentBlock(), setCenterColumnClass(), setCurrentBlock(), and variableExists().

470  {
471  global $DIC;
472 
473  $http = $DIC->http();
474  switch ($http->request()->getHeaderLine('Accept')) {
475  case 'application/json':
476  $string = json_encode([
477  self::MESSAGE_TYPE_SUCCESS => is_null($this->message[self::MESSAGE_TYPE_FAILURE]),
478  'message' => '',
479  ]);
481  $http->saveResponse($http->response()->withBody($stream));
482  $http->sendResponse();
483  exit;
484  default:
485  // include yahoo dom per default
486  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
488 
489  header('P3P: CP="CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa OUR BUS IND UNI COM NAV INT CNT STA PRE"');
490  header("Content-type: " . $this->getContentType() . "; charset=UTF-8");
491 
492  $this->fillMessage();
493 
494  // display ILIAS footer
495  if ($part !== false) {
496  $this->addILIASFooter();
497  }
498 
499  // set standard parts (tabs and title icon)
500  $this->fillBodyClass();
501  if ($a_fill_tabs) {
502  if ($this->blockExists("content")) {
503  // determine default screen id
504  $this->getTabsHTML();
505  }
506 
507  // to get also the js files for the main menu
508  if (!$a_skip_main_menu) {
509  $this->getMainMenu();
510  $this->initHelp();
511  }
512 
513  if ($this->blockExists("content") && $this->variableExists('MAINMENU')) {
514  $tpl = $DIC["tpl"];
515 
516  include_once 'Services/Authentication/classes/class.ilSessionReminderGUI.php';
517  $session_reminder_gui = new ilSessionReminderGUI(ilSessionReminder::createInstanceWithCurrentUserSession());
518  $tpl->setVariable('SESSION_REMINDER', $session_reminder_gui->getHtml());
519  }
520 
521  // these fill blocks in tpl.main.html
522  $this->fillCssFiles();
523  $this->fillInlineCss();
524  //$this->fillJavaScriptFiles();
525  $this->fillContentStyle();
526 
527  // these fill just plain placeholder variables in tpl.main.html
528  $this->setCurrentBlock("DEFAULT");
529  $this->fillNewContentStyle();
530  $this->fillContentLanguage();
531  $this->fillWindowTitle();
532 
533  // these fill blocks in tpl.adm_content.html
534  $this->fillHeader();
535  $this->fillSideIcons();
536  $this->fillScreenReaderFocus();
537  $this->fillStopFloating();
538  $this->fillLeftContent();
539  $this->fillLeftNav();
540  $this->fillRightContent();
541  $this->fillAdminPanel();
542  $this->fillToolbar();
543  $this->fillPermanentLink();
544 
545  $this->setCenterColumnClass();
546 
547  // late loading of javascipr files, since operations above may add files
548  $this->fillJavaScriptFiles();
549  $this->fillOnLoadCode();
550 
551  // these fill just plain placeholder variables in tpl.adm_content.html
552  if ($this->blockExists("content")) {
553  $this->setCurrentBlock("content");
554  $this->fillTabs();
555  $this->fillMainContent();
556  $this->fillMainMenu();
557  $this->fillLightbox();
558  $this->parseCurrentBlock();
559  }
560  }
561 
562  if ($part == "DEFAULT" or is_bool($part)) {
563  $html = parent::get();
564  } else {
565  $html = parent::get($part);
566  }
567 
568  // include the template output hook
569  $ilPluginAdmin = $DIC["ilPluginAdmin"];
570  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
571  foreach ($pl_names as $pl) {
572  $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
573  $gui_class = $ui_plugin->getUIClassInstance();
574 
575  $resp = $gui_class->getHTML(
576  "",
577  "template_show",
578  array("tpl_id" => $this->tplIdentifier, "tpl_obj" => $this, "html" => $html)
579  );
580 
581  if ($resp["mode"] != ilUIHookPluginGUI::KEEP) {
582  $html = $gui_class->modifyHTML($html, $resp);
583  }
584  }
585 
586  // fix #9992: save language usages as late as possible
587  if ($this->translation_linked) {
589  }
590 
591  print $html;
592 
593  $this->handleReferer();
594  break;
595  }
596  }
fillNewContentStyle()
Fill Content Style.
global $DIC
Definition: saml.php:7
fillScreenReaderFocus()
Accessibility focus for screen readers.
getTabsHTML()
Get tabs HTML.
fillPermanentLink()
Fill in permanent link.
fillLeftContent()
Fill left content.
fillOnLoadCode()
Fill add on load code.
fillStopFloating()
stop floating
fillHeader()
Fill header.
$stream
PHP stream implementation.
fillAdminPanel()
Put admin panel into template:
fillSideIcons()
Fill side icons (upper icon, tree icon, webfolder icon)
static initDom()
Init YUI Dom.
fillLeftNav()
Fill left navigation frame.
initHelp()
Init help.
static ofString($string)
Creates a new stream with an initial value.
Definition: Streams.php:29
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
fillLightbox()
Fill lightbox content.
Add a drawing to the header
Definition: 04printing.php:69
$http
Definition: raiseError.php:7
fillRightContent()
Fill right content.
Create styles array
The data for the language used.
fillContentLanguage()
Add current user language to meta tags.
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
handleReferer()
TODO: this is nice, but shouldn&#39;t be done here (-> maybe at the end of ilias.php!?, alex)
getContentType()
Get the content type for the template output.
fillCssFiles($a_force=false)
Fill in the css file tags.
blockExists($a_blockname)
check if block exists in actual template private
fillMainContent()
Fill main content.
static _saveUsages()
Store the collected usages in the user session.
fillContentStyle()
Fill Content Style.
fillInlineCss()
Fill in the inline css.
variableExists($a_variablename)
addILIASFooter()
add ILIAS footer
$html
Definition: example_001.php:87
const IL_COMP_SERVICE
+ Here is the call graph for this function:

◆ stopTitleFloating()

ilTemplate::stopTitleFloating ( )

set stop floating (if no tabs are used)

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

1770  {
1771  $this->stop_floating = true;
1772  }

◆ touchBlock() [1/2]

ilTemplate::touchBlock (   $block)

overwrites ITX::touchBlock.

public

Parameters
string
Returns
???

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

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

274  {
275  $this->setCurrentBlock($block);
276  //$count = $this->fillVars();
277  $this->parseCurrentBlock();
278 
279  if ($count == 0) {
280  parent::touchBlock($block);
281  }
282  }
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
+ Here is the call graph for this function:

◆ touchBlock() [2/2]

ilTemplate::touchBlock (   $block)

overwrites ITX::touchBlock.

public

Parameters
string
Returns
???

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

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

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

1167  {
1168  $this->setCurrentBlock($block);
1169  $count = $this->fillVars();
1170  $this->parseCurrentBlock();
1171 
1172  if ($count == 0) {
1173  parent::touchBlock($block);
1174  }
1175  }
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
Definition: IT.php:594
fillVars()
all template vars defined in $vars will be replaced automatically without setting and parsing them wi...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ variableExists()

ilTemplate::variableExists (   $a_variablename)
private

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

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

1115  {
1116  return (isset($this->blockvariables["content"][$a_variablename]) ? true : false);
1117  }
+ 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 77 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 78 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:
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 79 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 76 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 81 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.

◆ MESSAGE_TYPE_SUCCESS

const ilTemplate::MESSAGE_TYPE_SUCCESS = "success"

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


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