ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilTemplate Class Reference

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

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

Public Member Functions

 ilTemplate ($file, $flag1, $flag2, $in_module=false, $vars="DEFAULT", $plugin=false, $a_use_cache=false)
 constructor More...
 
 init ()
 Clears all datafields of the object and rebuild the internal blocklist. More...
 
 setAddFooter ($value)
 
 getAddFooter ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 get ($part="DEFAULT", $add_error_mess=false, $handle_referer=false, $add_ilias_footer=false, $add_standard_elements=false, $a_main_menu=true, $a_tabs=true)
 ??? @access public More...
 
 setMessage ($a_type, $a_txt, $a_keep=false)
 Set message. More...
 
 hasMessage ($a_type)
 
 fillMessage ()
 
 getMessageHTML ($a_txt, $a_type="info")
 Get HTML for a system message. More...
 
 getContentType ()
 Get the content type for the template output. More...
 
 setContentType ($a_content_type="text/html")
 Set the content type for the template output. More...
 
 show ($part="DEFAULT", $a_fill_tabs=true, $a_skip_main_menu=false)
 @access public More...
 
 fillContentLanguage ()
 Add current user language to meta tags. More...
 
 fillWindowTitle ()
 
 getTabsHTML ()
 Get tabs HTML. More...
 
 fillTabs ()
 
 fillToolbar ()
 
 fillPageFormAction ()
 
 fillJavaScriptFiles ($a_force=false)
 
 fillCssFiles ($a_force=false)
 Fill in the css file tags. More...
 
 fillInlineCss ()
 Fill in the inline css. More...
 
 setContentStyleSheet ($a_style)
 Set content style (used for page content editor) More...
 
 fillContentStyle ()
 Fill Content Style. More...
 
 getMainMenu ()
 
 fillMainMenu ()
 
 initHelp ()
 Init help. More...
 
 addILIASFooter ()
 add ILIAS footer More...
 
 handleReferer ()
 TODO: this is nice, but shouldn't be done here (-> maybe at the end of ilias.php!?, alex) More...
 
 blockExists ($a_blockname)
 check if block exists in actual template @access private More...
 
 fillVars ()
 all template vars defined in $vars will be replaced automatically without setting and parsing them with setVariable & parseCurrentBlock @access private More...
 
 setCurrentBlock ($part="DEFAULT")
 Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt. More...
 
 touchBlock ($block)
 overwrites ITX::touchBlock. More...
 
 parseCurrentBlock ($part="DEFAULT")
 Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt @access public. More...
 
 replaceFromDatabase (&$DB, $block, $conv, $select="default")
 ??? TODO: Adjust var names to ilias. More...
 
 prepareForFormular ($vars)
 Wird angewendet, wenn die Daten in ein Formular replaced werden sollen, Dann wird erst noch ein htmlspecialchars drumherum gemacht. More...
 
 replace ()
 ??? @access public More...
 
 replaceDefault ()
 ??? @access public More...
 
 checkTopic ($a_block, $a_topic)
 checks for a topic in the template @access private More...
 
 includeNavigation ()
 check if there is a NAVIGATION-topic @access public More...
 
 includeTree ()
 check if there is a TREE-topic @access public More...
 
 fileExists ($filename)
 check if a file exists @access public More...
 
 addBlockFile ($var, $block, $tplname, $in_module=false)
 overwrites ITX::addBlockFile @access public More...
 
 loadTemplatefile ( $filename, $removeUnknownVariables=true, $removeEmptyBlocks=true)
 Reads a template file from the disk. More...
 
 getTemplatePath ($a_tplname, $a_in_module=false, $a_plugin=false)
 builds a full template path with template and module name More...
 
 getTemplateIdentifier ($a_tplname, $a_in_module=false)
 get a unique template identifier More...
 
 setHeaderPageTitle ($a_title)
 
 setStyleSheetLocation ($a_stylesheet)
 
 setNewContentStyleSheetLocation ($a_stylesheet)
 
 getStandardTemplate ()
 
 setTitle ($a_title)
 sets title in standard template More...
 
 setTitleUrl ($a_url)
 sets title url in standard template More...
 
 setTitleColor ($a_val)
 Set title color. More...
 
 getTitleColor ()
 Get title color. More...
 
 setAlertProperties (array $a_props)
 Set alert properties. More...
 
 clearHeader ()
 Clear header. More...
 
 setTitleIcon ($a_icon_path, $a_icon_desc="")
 set title icon More...
 
 setBodyClass ($a_class="")
 
 fillBodyClass ()
 
 setPageFormAction ($a_action)
 
 setDescription ($a_descr)
 sets title in standard template More...
 
 stopTitleFloating ()
 set stop floating (if no tabs are used) More...
 
 setHeaderActionMenu ($a_header)
 Set header action menu. More...
 
 getHeaderActionMenu ()
 Get header action menu. More...
 
 setContent ($a_html)
 sets content for standard template More...
 
 fillMainContent ()
 Fill main content. More...
 
 setRightContent ($a_html)
 sets content of right column More...
 
 setLeftContent ($a_html)
 sets content of left column More...
 
 setLeftNavContent ($a_content)
 Sets content of left navigation column. More...
 
 fillLeftNav ()
 Fill left navigation frame. More...
 
 setLocator ()
 Insert locator. More...
 
 setTabs ($a_tabs_html)
 sets tabs in standard template More...
 
 setSubTabs ($a_tabs_html)
 sets subtabs in standard template More...
 
 setUpperIcon ($a_link, $a_frame="")
 sets icon to upper level More...
 
 setLoginTargetPar ($a_val)
 Set target parameter for login (public sector). More...
 
 getLoginTargetPar ()
 Get target parameter for login. More...
 
 fillScreenReaderFocus ()
 Accessibility focus for screen readers. More...
 
 fillSideIcons ()
 Fill side icons (upper icon, tree icon, webfolder icon) More...
 
 setMountWebfolderIcon ($a_ref_id)
 shows icon for mounting a webfolder More...
 
 setTreeFlatIcon ($a_link, $a_mode)
 set tree/flat icon More...
 
 addJavaScript ($a_js_file, $a_add_version_parameter=true, $a_batch=2)
 Add a javascript file that should be included in the header. More...
 
 resetJavascript ()
 Reset javascript files. More...
 
 resetCss ()
 Reset css files. More...
 
 addOnLoadCode ($a_code, $a_batch=2)
 Add on load code. More...
 
 addCss ($a_css_file, $media="screen")
 Add a css file that should be included in the header. More...
 
 addInlineCss ($a_css, $media="screen")
 Add a css file that should be included in the header. More...
 
 addLightbox ($a_html, $a_id)
 Add lightbox html. More...
 
 fillLightbox ()
 Fill lightbox content. More...
 
 setPageActions ($a_page_actions_html)
 Show admin view button. More...
 
 setEditPageButton ($a_link, $a_txt, $a_frame)
 Show admin view button. More...
 
 addAdminPanelCommand ($a_cmd, $a_txt, $a_arrow=false)
 Add a command to the admin panel. More...
 
 addAdminPanelToolbar (ilToolbarGUI $toolb, $a_bottom_panel=true, $a_arrow=false)
 Add admin panel commands as toolbar. More...
 
 fillAdminPanel ()
 Put admin panel into template: More...
 
 setPermanentLink ($a_type, $a_id, $a_append="", $a_target="")
 
 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...
 
 ilTemplate ($file, $flag1, $flag2, $in_module=false, $vars="DEFAULT")
 constructor More...
 
 getTemplatePath ($a_tplname, $a_in_module=false, $a_plugin=false)
 builds a full template path with template and module name More...
 
 addBlockFile ($var, $block, $tplname, $in_module=false)
 
 show ($part="DEFAULT")
 @access public More...
 
 getMessageHTML ($a_txt, $a_type="info")
 Get HTML for a system message. More...
 
 setCurrentBlock ($part="DEFAULT")
 Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt. More...
 
 touchBlock ($block)
 overwrites ITX::touchBlock. More...
 
 parseCurrentBlock ($part="DEFAULT")
 Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt @access public. More...
 
 setMessage ($a_type, $a_txt, $a_keep=false)
 Set message. More...
 
 fillMessage ()
 
 blockExists ($a_blockname)
 check if block exists in actual template @access private More...
 
 addJavaScript ($a_js_file)
 Add a javascript file that should be included in the header. More...
 
 fillJavaScriptFiles ()
 
 addCss ($a_css_file, $media="screen")
 Add a css file that should be included in the header. More...
 
 fillCssFiles ($a_force=false)
 Fill in the css file tags. More...
 
 get ($part="DEFAULT")
 Returns a block with all replacements done. More...
 
- Public Member Functions inherited from ilTemplateX
 callConstructor ()
 
- Public Member Functions inherited from HTML_Template_ITX
 HTML_Template_ITX ($root='')
 Builds some complex regexps and calls the constructor of the parent class. More...
 
 init ()
 Clears all datafields of the object and rebuild the internal blocklist. More...
 
 replaceBlock ($block, $template, $keep_content=false)
 Replaces an existing block with new content. More...
 
 replaceBlockfile ($block, $filename, $keep_content=false)
 Replaces an existing block with new content from a file. More...
 
 addBlock ($placeholder, $blockname, $template)
 Adds a block to the template changing a variable placeholder to a block placeholder. More...
 
 addBlockfile ($placeholder, $blockname, $filename)
 Adds a block taken from a file to the template changing a variable placeholder to a block placeholder. More...
 
 placeholderExists ($placeholder, $block='')
 Returns the name of the (first) block that contains the specified placeholder. More...
 
 performCallback ()
 Checks the list of function calls in the template and calls their callback function. More...
 
 getFunctioncalls ()
 Returns a list of all function calls in the current template. More...
 
 setFunctioncontent ($functionID, $replacement)
 Replaces a function call with the given replacement. More...
 
 setCallbackFunction ($tplfunction, $callbackfunction, $callbackobject='', $expandCallbackParameters=false)
 Sets a callback function. More...
 
 setCallbackFuntiontable ($functions)
 Sets the Callback function lookup table. More...
 
 removeBlockData ($block)
 Recursively removes all data assiciated with a block, including all inner blocks. More...
 
 getBlocklist ()
 Returns a list of blocknames in the template. More...
 
 blockExists ($blockname)
 Checks wheter a block exists. More...
 
 getBlockvariables ($block)
 Returns a list of variables of a block. More...
 
 BlockvariableExists ($block, $variable)
 Checks wheter a block variable exists. More...
 
 buildFunctionlist ()
 Builds a functionlist from the template. More...
 
 getValue ($code, $delimiter)
 Truncates the given code from the first occurence of $delimiter but ignores $delimiter enclosed by " or '. More...
 
 deleteFromBlockvariablelist ($block, $variables)
 Deletes one or many variables from the block variable list. More...
 
 updateBlockvariablelist ($block)
 Updates the variable list of a block. More...
 
 findPlaceholderBlocks ($variable)
 Returns an array of blocknames where the given variable placeholder is used. More...
 
 warning ($message, $file='', $line=0)
 Handles warnings, saves them to $warn and prints them or calls die() depending on the flags. More...
 
- Public Member Functions inherited from HTML_Template_IT
 HTML_Template_IT ($root='', $options=null)
 Builds some complex regular expressions and optinally sets the file root directory. More...
 
 setOption ($option, $value)
 Sets the option for the template class. More...
 
 setOptions ($options)
 Sets the options for the template class. More...
 
 show ($block='__global__')
 Print a certain block with all replacements done. More...
 
 get ($block='__global__')
 Returns a block with all replacements done. More...
 
 parse ($block='__global__', $flag_recursion=false)
 Parses the given block. More...
 
 parseCurrentBlock ()
 Parses the current block. More...
 
 setVariable ($variable, $value='')
 Sets a variable value. More...
 
 setCurrentBlock ($block='__global__')
 Sets the name of the current block that is the block where variables are added. More...
 
 touchBlock ($block)
 Preserves an empty block even if removeEmptyBlocks is true. More...
 
 init ()
 Clears all datafields of the object and rebuild the internal blocklist. More...
 
 free ()
 Clears all datafields of the object. More...
 
 setTemplate ( $template, $removeUnknownVariables=true, $removeEmptyBlocks=true)
 Sets the template. More...
 
 loadTemplatefile ( $filename, $removeUnknownVariables=true, $removeEmptyBlocks=true)
 Reads a template file from the disk. More...
 
 setRoot ($root)
 Sets the file root. More...
 
 buildBlockvariablelist ()
 Build a list of all variables within of a block. More...
 
 getGlobalvariables ()
 Returns a list of all global variables. More...
 
 findBlocks ($string)
 Recusively builds a list of all blocks within the template. More...
 
 getFile ($filename)
 Reads a file from disk and returns its content. More...
 
 _addPregDelimiters ($str)
 Adds delimiters to a string, so it can be used as a pattern in preg_* functions. More...
 
 _preserveOpeningDelimiter ($str)
 Replaces an opening delimiter by a special string. More...
 
 errorMessage ($value, $blockname='')
 Return a textual error message for a IT error code. More...
 

Static Public Member Functions

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

Data Fields

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

Protected Member Functions

 fillJavascriptFile ($file, $vers)
 

Protected Attributes

 $message = ""
 
 $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()
 
 $translation_linked = false
 

Static Protected Attributes

static $il_cache = array()
 

Private Member Functions

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

Private Attributes

 $addFooter
 

Detailed Description

special template class to simplify handling of ITX/PEAR

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

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

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

2316 {
2317 $this->admin_panel_commands[] =
2318 array("cmd" => $a_cmd, "txt" => $a_txt);
2319 if ($a_arrow)
2320 {
2321 $this->admin_panel_arrow = true;
2322 }
2323 $this->admin_panel_top_only = false;
2324 }

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

2332 {
2333 $this->admin_panel_commands_toolbar = $toolb;
2334 $this->admin_panel_arrow = $a_arrow;
2335 $this->admin_panel_bottom = $a_bottom_panel;
2336 }

◆ addBlockFile() [1/2]

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

overwrites ITX::addBlockFile @access public

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

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

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

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

Referenced by getStandardTemplate().

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

◆ addBlockFile() [2/2]

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

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

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

References DEBUG, and getTemplatePath().

+ Here is the call graph for this function:

◆ addCss() [1/2]

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

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

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

2254 {
2255 if (!array_key_exists($a_css_file . $media, $this->css_files))
2256 {
2257 $this->css_files[$a_css_file . $media] = array("file" => $a_css_file, "media" => $media);
2258 }
2259 }

◆ addCss() [2/2]

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

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

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

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

◆ addILIASFooter()

ilTemplate::addILIASFooter ( )

add ILIAS footer

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

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

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

Referenced by get(), and show().

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

◆ addInlineCss()

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

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

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

2265 {
2266 $this->inline_css[] = array("css" => $a_css, "media" => $media);
2267 }

◆ addJavaScript() [1/2]

ilTemplate::addJavaScript (   $a_js_file)

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

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

435 {
436 if (!in_array($a_js_file, $this->js_files))
437 {
438 $this->js_files[] = $a_js_file;
439 }
440 }

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

2192 {
2193 // three batches currently
2194 if ($a_batch < 1 || $a_batch > 3)
2195 {
2196 $a_batch = 2;
2197 }
2198
2199 // ensure jquery files being loaded first
2200 if (is_int(strpos($a_js_file, "Services/jQuery")) ||
2201 is_int(strpos($a_js_file, "/jquery.js")) ||
2202 is_int(strpos($a_js_file, "/jquery-min.js")))
2203 {
2204 $a_batch = 0;
2205 }
2206
2207 if (!in_array($a_js_file, $this->js_files))
2208 {
2209 $this->js_files[] = $a_js_file;
2210 $this->js_files_vp[$a_js_file] = $a_add_version_parameter;
2211 $this->js_files_batch[$a_js_file] = $a_batch;
2212 }
2213 }

◆ addLightbox()

ilTemplate::addLightbox (   $a_html,
  $a_id 
)

Add lightbox html.

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

2273 {
2274 $this->lightbox[$a_id] = $a_html;
2275 }

◆ addOnLoadCode()

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

Add on load code.

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

2241 {
2242 // three batches currently
2243 if ($a_batch < 1 || $a_batch > 3)
2244 {
2245 $a_batch = 2;
2246 }
2247 $this->on_load_code[$a_batch][] = $a_code;
2248 }

Referenced by ilWikiPageGUI\initEditingJS().

+ Here is the caller graph for this function:

◆ blockExists() [1/2]

ilTemplate::blockExists (   $a_blockname)

check if block exists in actual template @access private

Parameters
stringblockname
Returns
boolean

Reimplemented from HTML_Template_ITX.

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

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

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

+ Here is the caller graph for this function:

◆ blockExists() [2/2]

ilTemplate::blockExists (   $a_blockname)

check if block exists in actual template @access private

Parameters
stringblockname
Returns
boolean

Reimplemented from HTML_Template_ITX.

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

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

◆ buildLoginTarget()

static ilTemplate::buildLoginTarget ( )
static

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

Returns
string

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

2521 {
2522 global $tree, $ilUser;
2523
2524 $target_str = "";
2525
2526 // repository
2527 if ($_GET["ref_id"] != "")
2528 {
2529 if ($tree->isInTree($_GET["ref_id"]) && $_GET["ref_id"] != $tree->getRootId())
2530 {
2531 $obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
2532 $type = ilObject::_lookupType($obj_id);
2533 $target_str = $type."_".$_GET["ref_id"];
2534 }
2535 }
2536 // personal workspace
2537 else if ($_GET["wsp_id"] != "" && $_GET["wsp_id"] > 0)
2538 {
2539 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
2540 $tree = new ilWorkspaceTree($ilUser->getId());
2541 $obj_id = $tree->lookupObjectId((int)$_GET["wsp_id"]);
2542 if($obj_id)
2543 {
2544 $type = ilObject::_lookupType($obj_id);
2545 $target_str = $type."_".(int)$_GET["wsp_id"]."_wsp";
2546 }
2547 }
2548 // portfolio
2549 else if ($_GET["prt_id"] != "")
2550 {
2551 $target_str = "prtf_".(int)$_GET["prt_id"];
2552 }
2553
2554 return $target_str;
2555 }
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
Tree handler for personal workspace.
global $ilUser
Definition: imgupload.php:15

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

+ Here is the call graph for this function:

◆ checkTopic()

ilTemplate::checkTopic (   $a_block,
  $a_topic 
)

checks for a topic in the template @access private

Parameters
string
string
Returns
boolean

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

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

Referenced by includeNavigation(), and includeTree().

+ Here is the caller graph for this function:

◆ clearHeader()

ilTemplate::clearHeader ( )

Clear header.

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

1664 {
1665 $this->setTitle("");
1666 $this->setTitleIcon("");
1667 $this->setDescription("");
1668 $this->setAlertProperties(array());
1669 }
setDescription($a_descr)
sets title in standard template
setTitleIcon($a_icon_path, $a_icon_desc="")
set title icon
setTitle($a_title)
sets title in standard template
setAlertProperties(array $a_props)
Set alert properties.

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

+ Here is the call graph for this function:

◆ enableDragDropFileUpload()

ilTemplate::enableDragDropFileUpload (   $a_ref_id)

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

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

2589 {
2590 $this->enable_fileupload = $a_ref_id;
2591 }

Referenced by resetHeaderBlock().

+ Here is the caller graph for this function:

◆ fileExists()

ilTemplate::fileExists (   $filename)

check if a file exists @access public

Returns
boolean

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

1362 {
1363 return file_exists($this->tplPath."/".$filename);
1364 }
$filename
Definition: buildRTE.php:89

References $filename.

◆ fillAdminPanel()

ilTemplate::fillAdminPanel ( )

Put admin panel into template:

  • creation selector
  • admin view on/off button

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

2344 {
2345 global $lng, $ilHelp;
2346
2347 $adm_view_cmp = $adm_cmds = $adm_view = false;
2348
2349 $toolb = new ilToolbarGUI();
2350
2351 // admin panel commands
2352 if ((count($this->admin_panel_commands) > 0))
2353 {
2354 foreach($this->admin_panel_commands as $cmd)
2355 {
2356 $toolb->addFormButton($cmd["txt"], $cmd["cmd"]);
2357 }
2358 $adm_cmds = true;
2359 }
2360 elseif($this->admin_panel_commands_toolbar instanceof ilToolbarGUI)
2361 {
2362 $toolb = $this->admin_panel_commands_toolbar;
2363 $adm_cmds = true;
2364 }
2365 // Add arrow if desired
2366 if($this->admin_panel_arrow)
2367 {
2368 $toolb->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), $lng->txt("actions"));
2369 }
2370
2371 if ($adm_cmds)
2372 {
2373 $this->fillPageFormAction();
2374
2375 $this->setCurrentBlock("adm_view_components");
2376 $this->setVariable("ADM_PANEL1", $toolb->getHTML());
2377 $this->parseCurrentBlock();
2378 $adm_view_cmp = true;
2379 }
2380
2381 // admin view button
2382 if ($this->page_actions != "")
2383 {
2384 $this->setVariable("PAGE_ACTIONS", $this->page_actions);
2385 $adm_view = true;
2386 }
2387
2388 // creation selector
2389 // see: ilObjectAddNewItemGUI
2390 // placeholder "SELECT_OBJTYPE_REPOS" still needed!
2391
2392 if ($adm_cmds and $this->admin_panel_bottom)
2393 {
2394 $this->setCurrentBlock("adm_view_components2");
2395 if ($this->admin_panel_arrow)
2396 {
2397 $toolb->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), $lng->txt("actions"));
2398 }
2399 $this->setVariable("ADM_PANEL2", $toolb->getHTML());
2400
2401 $this->parseCurrentBlock();
2402 }
2403 }
parseCurrentBlock()
Parses the current block.
Definition: IT.php:607
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$cmd
Definition: sahs_server.php:35

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

Referenced by get(), and show().

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

◆ fillBodyClass()

ilTemplate::fillBodyClass ( )

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

1783 {
1784 if ($this->body_class != "" && $this->blockExists("body_class"))
1785 {
1786 $this->setCurrentBlock("body_class");
1787 $this->setVariable("BODY_CLASS", $this->body_class);
1788 $this->parseCurrentBlock();
1789 }
1790 }
blockExists($a_blockname)
check if block exists in actual template @access private

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

Referenced by get(), and show().

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

◆ fillContentLanguage()

ilTemplate::fillContentLanguage ( )

Add current user language to meta tags.

@access public

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

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

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

Referenced by get(), and show().

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

◆ fillContentStyle()

ilTemplate::fillContentStyle ( )

Fill Content Style.

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

795 {
796 if ($this->content_style_sheet != "")
797 {
798 $this->setCurrentBlock("ContentStyle");
799 $this->setVariable("LOCATION_CONTENT_STYLESHEET",
800 $this->content_style_sheet);
801 $this->parseCurrentBlock();
802 }
803 }

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

Referenced by get(), and show().

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

◆ fillCssFiles() [1/2]

ilTemplate::fillCssFiles (   $a_force = false)

Fill in the css file tags.

Parameters
boolean$a_force

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

744 {
745 if (!$this->blockExists("css_file"))
746 {
747 return;
748 }
749 foreach($this->css_files as $css)
750 {
751 $filename = $css["file"];
752 if (strpos($filename, "?") > 0) $filename = substr($filename, 0, strpos($filename, "?"));
753 if (is_file($filename) || $a_force)
754 {
755 $this->setCurrentBlock("css_file");
756 $this->setVariable("CSS_FILE", $css["file"]);
757 $this->setVariable("CSS_MEDIA", $css["media"]);
758 $this->parseCurrentBlock();
759 }
760 }
761 }

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

Referenced by get(), and show().

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

◆ fillCssFiles() [2/2]

ilTemplate::fillCssFiles (   $a_force = false)

Fill in the css file tags.

Parameters
boolean$a_force

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

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

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

+ Here is the call graph for this function:

◆ fillHeader()

ilTemplate::fillHeader ( )
private

Fill header.

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

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

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

Referenced by get(), and show().

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

◆ fillInlineCss()

ilTemplate::fillInlineCss ( )

Fill in the inline css.

Parameters
boolean$a_force

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

769 {
770 if (!$this->blockExists("css_inline"))
771 {
772 return;
773 }
774 foreach($this->inline_css as $css)
775 {
776 $this->setCurrentBlock("css_file");
777 $this->setVariable("CSS_INLINE", $css["css"]);
778 //$this->setVariable("CSS_MEDIA", $css["media"]);
779 $this->parseCurrentBlock();
780 }
781 }

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

Referenced by get(), and show().

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

◆ fillJavascriptFile()

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

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

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

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

Referenced by fillJavaScriptFiles().

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

◆ fillJavaScriptFiles() [1/2]

ilTemplate::fillJavaScriptFiles (   $a_force = false)

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

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

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

+ Here is the call graph for this function:

◆ fillJavaScriptFiles() [2/2]

ilTemplate::fillJavaScriptFiles ( )

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

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

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

Referenced by get(), and show().

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

◆ fillLeftContent()

ilTemplate::fillLeftContent ( )
private

Fill left content.

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

1930 {
1931 if (trim($this->left_content) != "")
1932 {
1933 $this->setCurrentBlock("left_column");
1934 $this->setVariable("LEFT_CONTENT", $this->left_content);
1935 $left_col_class = (trim($this->right_content) == "")
1936 ? "col-sm-3 col-sm-pull-9"
1937 : "col-sm-3 col-sm-pull-6";
1938 $this->setVariable("LEFT_COL_CLASS", $left_col_class);
1939 $this->parseCurrentBlock();
1940 }
1941 }

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

Referenced by get(), and show().

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

◆ fillLeftNav()

ilTemplate::fillLeftNav ( )

Fill left navigation frame.

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

1955 {
1956 if (trim($this->left_nav_content) != "")
1957 {
1958 $this->setCurrentBlock("left_nav");
1959 $this->setVariable("LEFT_NAV_CONTENT", $this->left_nav_content);
1960 $this->parseCurrentBlock();
1961 $this->touchBlock("left_nav_space");
1962 }
1963 }

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

Referenced by get(), and show().

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

◆ fillLightbox()

ilTemplate::fillLightbox ( )

Fill lightbox content.

Parameters

return

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

2284 {
2285 $html = "";
2286
2287 foreach ($this->lightbox as $lb)
2288 {
2289 $html.= $lb;
2290 }
2291 $this->setVariable("LIGHTBOX", $html);
2292 }
$html
Definition: example_001.php:87

References $html, and HTML_Template_IT\setVariable().

Referenced by get(), and show().

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

◆ fillMainContent()

ilTemplate::fillMainContent ( )

Fill main content.

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

1860 {
1861 if (trim($this->main_content) != "")
1862 {
1863 $this->setVariable("ADM_CONTENT", $this->main_content);
1864 }
1865 }

References HTML_Template_IT\setVariable().

Referenced by get(), and show().

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

◆ fillMainMenu()

ilTemplate::fillMainMenu ( )

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

829 {
830 global $tpl;
831 if($this->variableExists('MAINMENU'))
832 {
833 $tpl->setVariable("MAINMENU", $this->main_menu);
834 $tpl->setVariable("MAINMENU_SPACER", $this->main_menu_spacer);
835 }
836 }
global $tpl
Definition: ilias.php:8
variableExists($a_variablename)

References $tpl, and variableExists().

Referenced by get(), and show().

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

◆ fillMessage() [1/2]

ilTemplate::fillMessage ( )

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

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

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

Referenced by get(), and show().

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

◆ fillMessage() [2/2]

ilTemplate::fillMessage ( )

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

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

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

+ Here is the call graph for this function:

◆ fillNewContentStyle()

ilTemplate::fillNewContentStyle ( )
private

Fill Content Style.

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

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

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

Referenced by get(), and show().

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

◆ fillOnLoadCode()

ilTemplate::fillOnLoadCode ( )

Fill add on load code.

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

2435 {
2436 for ($i = 1; $i <= 3; $i++)
2437 {
2438 if (is_array($this->on_load_code[$i]))
2439 {
2440 $this->setCurrentBlock("on_load_code");
2441 foreach ($this->on_load_code[$i] as $code)
2442 {
2443 $this->setCurrentBlock("on_load_code_inner");
2444 $this->setVariable("OLCODE", $code);
2445 $this->parseCurrentBlock();
2446 }
2447 $this->setCurrentBlock("on_load_code");
2448 $this->parseCurrentBlock();
2449 }
2450 }
2451 }
$code
Definition: example_050.php:99

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

Referenced by get(), and show().

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

◆ fillPageFormAction()

ilTemplate::fillPageFormAction ( )

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

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

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

Referenced by fillAdminPanel().

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

◆ fillPermanentLink()

ilTemplate::fillPermanentLink ( )

Fill in permanent link.

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

2418 {
2419 if (is_array($this->permanent_link))
2420 {
2421 include_once("./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
2422 $plinkgui = new ilPermanentLinkGUI(
2423 $this->permanent_link["type"],
2424 $this->permanent_link["id"],
2425 $this->permanent_link["append"],
2426 $this->permanent_link["target"]);
2427 $this->setVariable("PRMLINK", $plinkgui->getHTML());
2428 }
2429 }
Class for permanent links.

References HTML_Template_IT\setVariable().

Referenced by get(), and show().

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

◆ fillRightContent()

ilTemplate::fillRightContent ( )
private

Fill right content.

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

1879 {
1880 if (trim($this->right_content) != "")
1881 {
1882 $this->setCurrentBlock("right_column");
1883 $this->setVariable("RIGHT_CONTENT", $this->right_content);
1884 $this->parseCurrentBlock();
1885 }
1886 }

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

Referenced by get(), and show().

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

◆ fillScreenReaderFocus()

ilTemplate::fillScreenReaderFocus ( )

Accessibility focus for screen readers.

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

2055 {
2056 global $ilUser;
2057
2058 if (is_object($ilUser) && $ilUser->getPref("screen_reader_optimization") && $this->blockExists("sr_focus"))
2059 {
2060 $this->touchBlock("sr_focus");
2061 }
2062 }

References $ilUser, and touchBlock().

Referenced by get(), and show().

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

◆ fillSideIcons()

ilTemplate::fillSideIcons ( )

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

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

2068 {
2069 global $lng, $ilSetting;
2070
2071 if ($this->upper_icon == "" && $this->tree_flat_link == ""
2072 && $this->mount_webfolder == "")
2073 {
2074 return;
2075 }
2076
2077 // upper icon
2078 // deprecated
2079 if ($this->upper_icon != "")
2080 {
2081 /*if ($this->upper_icon_frame != "")
2082 {
2083 $this->setCurrentBlock("target_top");
2084 $this->setVariable("TARGET_TOP", $this->upper_icon_frame);
2085 $this->parseCurrentBlock();
2086 }
2087
2088 $this->setCurrentBlock("alt_top");
2089 $this->setVariable("ALT_TOP", $lng->txt("up"));
2090 $this->parseCurrentBlock();
2091
2092 $this->setCurrentBlock("top");
2093 $this->setVariable("LINK_TOP", $this->upper_icon);
2094 $this->parseCurrentBlock();*/
2095 }
2096
2097 // tree/flat icon
2098 if ($this->tree_flat_link != "")
2099 {
2100 if ($this->left_nav_content != "")
2101 {
2102 $this->touchBlock("tree_lns");
2103 }
2104
2105 $this->setCurrentBlock("tree_mode");
2106 $this->setVariable("LINK_MODE", $this->tree_flat_link);
2107 if ($ilSetting->get("tree_frame") == "right")
2108 {
2109 if ($this->tree_flat_mode == "tree")
2110 {
2111 $this->setVariable("IMG_TREE",ilUtil::getImagePath("icon_sidebar_on.svg"));
2112 $this->setVariable("RIGHT", "Right");
2113 }
2114 else
2115 {
2116 $this->setVariable("IMG_TREE",ilUtil::getImagePath("icon_sidebar_on.svg"));
2117 $this->setVariable("RIGHT", "Right");
2118 }
2119 }
2120 else
2121 {
2122 if ($this->tree_flat_mode == "tree")
2123 {
2124 $this->setVariable("IMG_TREE",ilUtil::getImagePath("icon_sidebar_on.svg"));
2125 }
2126 else
2127 {
2128 $this->setVariable("IMG_TREE",ilUtil::getImagePath("icon_sidebar_on.svg"));
2129 }
2130 }
2131 $this->setVariable("ALT_TREE",$lng->txt($this->tree_flat_mode."view"));
2132 $this->setVariable("TARGET_TREE", ilFrameTargetInfo::_getFrame("MainContent"));
2133 include_once("./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
2134 $this->setVariable("TREE_ACC_KEY",
2135 ilAccessKeyGUI::getAttribute(($this->tree_flat_mode == "tree")
2138 $this->parseCurrentBlock();
2139 }
2140
2141 // mount webfolder
2142 if ($this->mount_webfolder != "")
2143 {
2144 require_once('Services/WebDAV/classes/class.ilDAVServer.php');
2145 $davServer = new ilDAVServer();
2146 $a_ref_id = $this->mount_webfolder;
2147 $a_link = $davServer->getMountURI($a_ref_id);
2148 $a_folder = $davServer->getFolderURI($a_ref_id);
2149
2150 $this->setCurrentBlock("mount_webfolder");
2151 $this->setVariable("LINK_MOUNT_WEBFOLDER", $a_link);
2152 $this->setVariable("FOLDER_MOUNT_WEBFOLDER", $a_folder);
2153 $this->setVariable("IMG_MOUNT_WEBFOLDER",ilUtil::getImagePath("ic_mount_webfolder.png"));
2154 $this->setVariable("ALT_MOUNT_WEBFOLDER",$lng->txt("mount_webfolder"));
2155 $this->setVariable("TARGET_MOUNT_WEBFOLDER", '_blank');
2156 $this->parseCurrentBlock();
2157 }
2158
2159 $this->setCurrentBlock("tree_icons");
2160 $this->parseCurrentBlock();
2161 }
static getAttribute($a_func_id)
Get accesskey HTML attribute.
static _getFrame($a_class, $a_type='')
Get content frame name.

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

Referenced by get(), and show().

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

◆ fillStopFloating()

ilTemplate::fillStopFloating ( )
private

stop floating

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

1818 {
1819 if ($this->stop_floating)
1820 {
1821 $this->touchBlock("stop_floating");
1822 }
1823 }

References touchBlock().

Referenced by get(), and show().

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

◆ fillTabs()

ilTemplate::fillTabs ( )

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

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

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

Referenced by get(), and show().

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

◆ fillToolbar()

ilTemplate::fillToolbar ( )

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

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

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

Referenced by get(), and show().

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

◆ fillVars()

ilTemplate::fillVars ( )

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

Returns
integer

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

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

References HTML_Template_IT\setVariable().

Referenced by parseCurrentBlock(), and touchBlock().

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

◆ fillWindowTitle()

ilTemplate::fillWindowTitle ( )

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

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

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

Referenced by get(), and show().

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

◆ get() [1/2]

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

Returns a block with all replacements done.

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

Reimplemented from HTML_Template_IT.

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

497 {
498 if ($part == "DEFAULT")
499 {
500 return parent::get();
501 }
502 else
503 {
504 return parent::get($part);
505 }
506 }

◆ get() [2/2]

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

??? @access public

Parameters
string
Returns
string

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

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

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

+ Here is the call graph for this function:

◆ getAddFooter()

ilTemplate::getAddFooter ( )

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

195 {
196 return $this->addFooter;
197 }

References $addFooter.

Referenced by addILIASFooter().

+ Here is the caller graph for this function:

◆ getAsynch()

ilTemplate::getAsynch ( )

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

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

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

References getContentType().

+ Here is the call graph for this function:

◆ getContentType()

ilTemplate::getContentType ( )

Get the content type for the template output.

Returns
string Content type @access public

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

433 {
434 return $this->contenttype;
435 }

References $contenttype.

Referenced by getAsynch(), and show().

+ Here is the caller graph for this function:

◆ getHeaderActionMenu()

ilTemplate::getHeaderActionMenu ( )

Get header action menu.

Returns
int ref id

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

1841 {
1842 return $this->header_action;
1843 }

References $header_action.

Referenced by fillHeader().

+ Here is the caller graph for this function:

◆ getLoginTargetPar()

ilTemplate::getLoginTargetPar ( )

Get target parameter for login.

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

2047 {
2048 return $this->login_target_par;
2049 }

Referenced by getMainMenu().

+ Here is the caller graph for this function:

◆ getMainMenu()

ilTemplate::getMainMenu ( )

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

817 {
818 global $ilMainMenu;
819
820 if($this->variableExists('MAINMENU'))
821 {
822 $ilMainMenu->setLoginTargetPar($this->getLoginTargetPar());
823 $this->main_menu = $ilMainMenu->getHTML();
824 $this->main_menu_spacer = $ilMainMenu->getSpacerClass();
825 }
826 }
getLoginTargetPar()
Get target parameter for login.

References getLoginTargetPar(), and variableExists().

Referenced by get(), and show().

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

◆ getMessageHTML() [1/2]

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

Get HTML for a system message.

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

415 {
416 global $lng;
417 $mtpl = new ilTemplate("tpl.message.html", true, true, "Services/Utilities");
418 $mtpl->setCurrentBlock($a_type."_message");
419 $mtpl->setVariable("TEXT", $a_txt);
420 $mtpl->setVariable("MESSAGE_HEADING", $lng->txt($a_type."_message"));
421 $mtpl->parseCurrentBlock();
422
423 return $mtpl->get();
424 }

References $lng, and ilTemplate().

Referenced by fillMessage(), and show().

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

◆ getMessageHTML() [2/2]

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

Get HTML for a system message.

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

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

References $lng, and ilTemplate().

+ Here is the call graph for this function:

◆ getOnLoadCodeForAsynch()

ilTemplate::getOnLoadCodeForAsynch ( )

Get js onload code for ajax calls.

Returns
string

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

2459 {
2460 $js = "";
2461 for ($i = 1; $i <= 3; $i++)
2462 {
2463 if (is_array($this->on_load_code[$i]))
2464 {
2465 foreach ($this->on_load_code[$i] as $code)
2466 {
2467 $js .= $code."\n";
2468 }
2469 }
2470 }
2471 if($js)
2472 {
2473 return '<script type="text/javascript">'."\n".
2474 $js.
2475 '</script>'."\n";
2476 }
2477 }
$js

References $code, and $js.

◆ getStandardTemplate()

ilTemplate::getStandardTemplate ( )

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

1596 {
1597 // always load jQuery
1598 include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
1600
1601 // always load ui framework
1602 include_once("./Services/UICore/classes/class.ilUIFramework.php");
1604
1605 // always load Basic js
1606// $this->addJavaScript("./Services/JavaScript/js/Basic.js",
1607// true, 1);
1608
1609 $this->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
1610 $this->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
1611 }
addBlockFile($var, $block, $tplname, $in_module=false)
overwrites ITX::addBlockFile @access public
init($a_tpl=null)
Init.
static initjQuery($a_tpl=null)
Init jQuery.

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

+ Here is the call graph for this function:

◆ getTabsHTML()

ilTemplate::getTabsHTML ( )

Get tabs HTML.

Parameters

return

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

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

References blockExists().

Referenced by get(), and show().

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

◆ getTemplateIdentifier()

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

get a unique template identifier

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

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

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

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

1543 {
1544 global $ilCtrl;
1545
1546 // if baseClass functionality is used (ilias.php):
1547 // get template directory from ilCtrl
1548 if (!empty($_GET["baseClass"]) && $a_in_module === true)
1549 {
1550 $a_in_module = $ilCtrl->getModuleDir();
1551 }
1552
1553 if (strpos($a_tplname,"/") === false)
1554 {
1555 if ($a_in_module)
1556 {
1557 if ($a_in_module === true)
1558 {
1559 $module_path = ILIAS_MODULE."/";
1560 }
1561 else
1562 {
1563 $module_path = $a_in_module."/";
1564 }
1565 }
1566 else
1567 {
1568 $module_path = "";
1569 }
1570
1571 return $module_path.basename($a_tplname);
1572 }
1573 else
1574 {
1575 return $a_tplname;
1576 }
1577 }
const ILIAS_MODULE
Definition: payment.php:15

References $_GET, $ilCtrl, and ILIAS_MODULE.

Referenced by addBlockFile(), and ilTemplate().

+ Here is the caller graph for this function:

◆ getTemplatePath() [1/2]

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

builds a full template path with template and module name

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

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

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

References $_GET, $ilCtrl, and ILIAS_MODULE.

Referenced by addBlockFile(), and ilTemplate().

+ Here is the caller graph for this function:

◆ getTemplatePath() [2/2]

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

builds a full template path with template and module name

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

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

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

References $_GET, $ilCtrl, and ILIAS_MODULE.

◆ getTitleColor()

ilTemplate::getTitleColor ( )

Get title color.

Returns
string color

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

1646 {
1647 return $this->title_color;
1648 }

Referenced by fillHeader().

+ Here is the caller graph for this function:

◆ handleReferer()

ilTemplate::handleReferer ( )

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

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

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

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

Referenced by get(), and show().

+ Here is the caller graph for this function:

◆ hasMessage()

ilTemplate::hasMessage (   $a_type)

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

356 {
357 return (isset($this->message[$a_type]) && strlen($this->message[$a_type]));
358 }

◆ ilTemplate() [1/2]

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

constructor

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

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

48 {
49 $this->activeBlock = "__global__";
50 $this->vars = array();
51
52 $fname = $this->getTemplatePath($file, $in_module);
53
54 $this->tplName = basename($fname);
55 $this->tplPath = dirname($fname);
56 // set default content-type to text/html
57 $this->contenttype = "text/html";
58 if (!file_exists($fname))
59 {
60 die("template ".$fname." was not found.");
61 return false;
62 }
63
64 //$this->IntegratedTemplateExtension(dirname($fname));
65 $this->callConstructor();
66 //$this->loadTemplatefile(basename($fname), $flag1, $flag2);
67 $this->loadTemplatefile($fname, $flag1, $flag2);
68 //add tplPath to replacevars
69 $this->vars["TPLPATH"] = $this->tplPath;
70
71 // set Options
72 if (method_exists($this, "setOption"))
73 {
74 $this->setOption('use_preg', false);
75 }
76
77 return true;
78 }
setOption($option, $value)
Sets the option for the template class.
Definition: IT.php:397
loadTemplatefile( $filename, $removeUnknownVariables=true, $removeEmptyBlocks=true)
Reads a template file from the disk.

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

+ Here is the call graph for this function:

◆ ilTemplate() [2/2]

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

constructor

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

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

72 {
73 global $ilias;
74//echo "<br>-".$file."-";
75
76 $this->activeBlock = "__global__";
77 $this->vars = array();
78 $this->addFooter = TRUE;
79
80 $this->il_use_cache = $a_use_cache;
81 $this->il_cur_key = $file."/".$in_module;
82
83 $fname = $this->getTemplatePath($file, $in_module, $plugin);
84
85 $this->tplName = basename($fname);
86 $this->tplPath = dirname($fname);
87 // template identifier e.g. "Services/Calendar/tpl.minical.html"
88 $this->tplIdentifier = $this->getTemplateIdentifier($file, $in_module);
89
90 // set default content-type to text/html
91 $this->contenttype = "text/html";
92 if (!file_exists($fname))
93 {
94 $ilias->raiseError("template ".$fname." was not found.", $ilias->error_obj->FATAL);
95 return false;
96 }
97
98 //$this->IntegratedTemplateExtension(dirname($fname));
99 $this->callConstructor();
100 //$this->loadTemplatefile(basename($fname), $flag1, $flag2);
101 $this->loadTemplatefile($fname, $flag1, $flag2);
102 //add tplPath to replacevars
103 $this->vars["TPLPATH"] = $this->tplPath;
104
105 // set Options
106 if (method_exists($this, "setOption"))
107 {
108 $this->setOption('use_preg', false);
109 }
110 $this->setBodyClass("std");
111
112 return true;
113 }
setBodyClass($a_class="")

References $file, ilTemplateX\callConstructor(), getTemplateIdentifier(), getTemplatePath(), loadTemplatefile(), setBodyClass(), and HTML_Template_IT\setOption().

Referenced by addILIASFooter(), fillMessage(), and getMessageHTML().

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

◆ includeNavigation()

ilTemplate::includeNavigation ( )

check if there is a NAVIGATION-topic @access public

Returns
boolean

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

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

References checkTopic().

+ Here is the call graph for this function:

◆ includeTree()

ilTemplate::includeTree ( )

check if there is a TREE-topic @access public

Returns
boolean

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

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

References checkTopic().

+ Here is the call graph for this function:

◆ init()

ilTemplate::init ( )

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

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

@access public

See also
free()

Reimplemented from HTML_Template_ITX.

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

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

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

+ Here is the call graph for this function:

◆ initHelp()

ilTemplate::initHelp ( )

Init help.

Parameters

return

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

845 {
846 include_once("./Services/Help/classes/class.ilHelpGUI.php");
847 ilHelpGUI::initHelp($this);
848 }
initHelp($a_tpl)
Render current help page.

References ilHelpGUI\initHelp().

Referenced by get(), and show().

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

◆ loadTemplatefile()

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

Reads a template file from the disk.

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

Reimplemented from HTML_Template_IT.

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

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

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

Referenced by ilTemplate().

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

◆ parseCurrentBlock() [1/2]

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

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

Parameters
string
Returns
string

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

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

References $activeBlock, and fillVars().

Referenced by ilContainerRenderer\addHeaderRow(), ilContainerRenderer\addSeparatorRow(), ilContainerRenderer\addStandardRow(), ilCaptchaInputGUI\insert(), ilEMailInputGUI\insert(), ilClozeGapInputBuilderGUI\insert(), ilContainerRenderer\renderDetails(), ilSurveyPageGUI\renderPageNode(), and ilContainerRenderer\renderSelectAllBlock().

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

◆ parseCurrentBlock() [2/2]

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

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

Parameters
string
Returns
string

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

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

References $activeBlock.

◆ prepareForFormular()

ilTemplate::prepareForFormular (   $vars)

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

@access public

Parameters
string

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

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

References $vars.

◆ replace()

ilTemplate::replace ( )

??? @access public

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

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

References HTML_Template_IT\setVariable().

Referenced by replaceDefault(), and replaceFromDatabase().

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

◆ replaceDefault()

ilTemplate::replaceDefault ( )

??? @access public

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

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

References replace().

+ Here is the call graph for this function:

◆ replaceFromDatabase()

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

??? TODO: Adjust var names to ilias.

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

Parameters
string
string
string
string

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

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

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

+ Here is the call graph for this function:

◆ resetCss()

ilTemplate::resetCss ( )

Reset css files.

Parameters

return

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

2232 {
2233 $this->css_files = array();
2234 }

◆ resetHeaderBlock()

ilTemplate::resetHeaderBlock (   $a_reset_header_action = true)

Set variable.

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

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

2571 {
2572 $this->setTitle(null);
2573 $this->setTitleIcon(null);
2574 $this->setDescription(null);
2575 $this->setAlertProperties(array());
2576 $this->enableDragDropFileUpload(null);
2577
2578 // see setFullscreenHeader()
2579 if($a_reset_header_action)
2580 {
2581 $this->setHeaderActionMenu(null);
2582 }
2583 }
enableDragDropFileUpload($a_ref_id)
Enables the file upload into this object by dropping a file.
setHeaderActionMenu($a_header)
Set header action menu.

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

+ Here is the call graph for this function:

◆ resetJavascript()

ilTemplate::resetJavascript ( )

Reset javascript files.

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

2219 {
2220 $this->js_files = array();
2221 $this->js_files_vp = array();
2222 $this->js_files_batch = array();
2223 }

◆ setAddFooter()

ilTemplate::setAddFooter (   $value)

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

185 {
186 $this->addFooter = $value;
187 }

◆ setAlertProperties()

ilTemplate::setAlertProperties ( array  $a_props)

Set alert properties.

Parameters
array$a_props
Returns
void

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

1656 {
1657 $this->title_alerts = $a_props;
1658 }

Referenced by clearHeader(), and resetHeaderBlock().

+ Here is the caller graph for this function:

◆ setBackgroundColor()

ilTemplate::setBackgroundColor (   $a_bg_color)

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

2480 {
2481 // :TODO: currently inactive, JF should discuss this
2482 return;
2483
2484 if($a_bg_color != "")
2485 {
2486 $this->setVariable("FRAME_BG_COLOR", " style=\"background-color: #".$a_bg_color."\"");
2487 }
2488 }

References HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ setBanner()

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

Set banner.

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

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

2499 {
2500 if($a_img)
2501 {
2502 if(!$a_export)
2503 {
2504 $a_img = ILIAS_HTTP_PATH."/".$a_img;
2505 }
2506
2507 $this->setCurrentBlock("banner_bl");
2508 $this->setVariable("BANNER_WIDTH", $a_width); // currently not needed
2509 $this->setVariable("BANNER_HEIGHT", $a_height);
2510 $this->setVariable("BANNER_URL", $a_img);
2511 $this->parseCurrentBlock();
2512 }
2513 }

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

+ Here is the call graph for this function:

◆ setBodyClass()

ilTemplate::setBodyClass (   $a_class = "")

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

1778 {
1779 $this->body_class = $a_class;
1780 }

Referenced by ilTemplate().

+ Here is the caller graph for this function:

◆ setCenterColumnClass()

ilTemplate::setCenterColumnClass ( )
private

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

1889 {
1890 if (!$this->blockExists("center_col_width"))
1891 {
1892 return;
1893 }
1894 $center_column_class = "";
1895 if (trim($this->right_content) != "" && trim($this->left_content) != "") {
1896 $center_column_class = "two_side_col";
1897 }
1898 else if (trim($this->right_content) != "" || trim($this->left_content) != "") {
1899 $center_column_class = "one_side_col";
1900 }
1901
1902 switch ($center_column_class)
1903 {
1904 case "one_side_col": $center_column_class = "col-sm-9"; break;
1905 case "two_side_col": $center_column_class = "col-sm-6"; break;
1906 default: $center_column_class = "col-sm-12"; break;
1907 }
1908 if (trim($this->left_content) != "")
1909 {
1910 $center_column_class.= " col-sm-push-3";
1911 }
1912
1913 $this->setCurrentBlock("center_col_width");
1914 $this->setVariable("CENTER_COL", $center_column_class);
1915 $this->parseCurrentBlock();
1916 }

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

Referenced by get(), and show().

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

◆ setContent()

ilTemplate::setContent (   $a_html)

sets content for standard template

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

1849 {
1850 if ($a_html != "")
1851 {
1852 $this->main_content = $a_html;
1853 }
1854 }

◆ setContentStyleSheet()

ilTemplate::setContentStyleSheet (   $a_style)

Set content style (used for page content editor)

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

787 {
788 $this->content_style_sheet = $a_style;
789 }

◆ setContentType()

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

Set the content type for the template output.

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

Parameters
string$a_content_typeContent type @access public

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

448 {
449 $this->contenttype = $a_content_type;
450 }

◆ setCurrentBlock() [1/2]

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

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

@access public

Parameters
string
Returns
???

Reimplemented from HTML_Template_IT.

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

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

Referenced by ilContainerRenderer\addHeaderRow(), ilContainerRenderer\addSeparatorRow(), ilContainerRenderer\addStandardRow(), fillAdminPanel(), fillBodyClass(), fillContentStyle(), fillCssFiles(), fillHeader(), fillInlineCss(), fillJavascriptFile(), fillJavaScriptFiles(), fillLeftContent(), fillLeftNav(), fillOnLoadCode(), fillPageFormAction(), fillRightContent(), fillSideIcons(), fillToolbar(), get(), ilCaptchaInputGUI\insert(), ilEMailInputGUI\insert(), ilClozeGapInputBuilderGUI\insert(), ilContainerRenderer\renderDetails(), ilSurveyPageGUI\renderPageNode(), ilContainerRenderer\renderSelectAllBlock(), replaceFromDatabase(), setBanner(), setCenterColumnClass(), show(), and touchBlock().

+ Here is the caller graph for this function:

◆ setCurrentBlock() [2/2]

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

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

@access public

Parameters
string
Returns
???

Reimplemented from HTML_Template_IT.

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

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

◆ setDescription()

ilTemplate::setDescription (   $a_descr)

sets title in standard template

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

1801 {
1802 $this->title_desc = $a_descr;
1803// $this->setVariable("H_DESCRIPTION", $a_descr);
1804 }

Referenced by clearHeader(), and resetHeaderBlock().

+ Here is the caller graph for this function:

◆ setEditPageButton()

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

Show admin view button.

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

2306 {
2307 $this->edit_page_button =
2308 array("link" => $a_link, "txt" => $a_txt, "frame" => $a_frame);
2309 }

◆ setHeaderActionMenu()

ilTemplate::setHeaderActionMenu (   $a_header)

Set header action menu.

Parameters
string$a_gui$a_header

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

1831 {
1832 $this->header_action = $a_header;
1833 }

Referenced by resetHeaderBlock().

+ Here is the caller graph for this function:

◆ setHeaderPageTitle()

ilTemplate::setHeaderPageTitle (   $a_title)

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

1580 {
1581 $a_title = ilUtil::stripScriptHTML($a_title);
1582 $this->header_page_title = $a_title;
1583 }

References ilUtil\stripScriptHTML().

+ Here is the call graph for this function:

◆ setLeftContent()

ilTemplate::setLeftContent (   $a_html)

sets content of left column

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

1922 {
1923 $this->left_content = $a_html;
1924 }

◆ setLeftNavContent()

ilTemplate::setLeftNavContent (   $a_content)

Sets content of left navigation column.

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

1947 {
1948 $this->left_nav_content = $a_content;
1949 }

◆ setLocator()

ilTemplate::setLocator ( )

Insert locator.

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

1969 {
1970 global $ilLocator, $lng, $ilPluginAdmin, $ilMainMenu;
1971
1972 // blog/portfolio
1973 if($ilMainMenu->getMode() == ilMainMenuGUI::MODE_TOPBAR_REDUCED ||
1974 $ilMainMenu->getMode() == ilMainMenuGUI::MODE_TOPBAR_ONLY)
1975 {
1976 $this->setVariable("LOCATOR", "");
1977 return;
1978 }
1979
1980 $html = "";
1981 if (is_object($ilPluginAdmin))
1982 {
1983 include_once("./Services/UIComponent/classes/class.ilUIHookProcessor.php");
1984 $uip = new ilUIHookProcessor("Services/Locator", "main_locator",
1985 array("locator_gui" => $ilLocator));
1986 if (!$uip->replaced())
1987 {
1988 $html = $ilLocator->getHTML();
1989 }
1990 $html = $uip->getHTML($html);
1991 }
1992 else
1993 {
1994 $html = $ilLocator->getHTML();
1995 }
1996
1997 $this->setVariable("LOCATOR", $html);
1998 }
UI interface hook processor.

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

+ Here is the call graph for this function:

◆ setLoginTargetPar()

ilTemplate::setLoginTargetPar (   $a_val)

Set target parameter for login (public sector).

This is used by the main menu

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

2039 {
2040 $this->login_target_par = $a_val;
2041 }

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

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

References $_SESSION.

◆ setMessage() [2/2]

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

Set message.

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

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

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

References ilSession\set().

+ Here is the call graph for this function:

◆ setMountWebfolderIcon()

ilTemplate::setMountWebfolderIcon (   $a_ref_id)

shows icon for mounting a webfolder

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

2168 {
2169 global $lng;
2170
2171 $this->mount_webfolder = $a_ref_id;
2172 }

References $lng.

◆ setNewContentStyleSheetLocation()

ilTemplate::setNewContentStyleSheetLocation (   $a_stylesheet)

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

1591 {
1592 $this->setVariable("LOCATION_NEWCONTENT_STYLESHEET", $a_stylesheet);
1593 }

References HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ setPageActions()

ilTemplate::setPageActions (   $a_page_actions_html)

Show admin view button.

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

2298 {
2299 $this->page_actions = $a_page_actions_html;
2300 }

◆ setPageFormAction()

ilTemplate::setPageFormAction (   $a_action)

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

1793 {
1794 $this->page_form_action = $a_action;
1795 }

◆ setPermanentLink()

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

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

2406 {
2407 $this->permanent_link = array(
2408 "type" => $a_type,
2409 "id" => $a_id,
2410 "append" => $a_append,
2411 "target" => $a_target);
2412 }

◆ setRightContent()

ilTemplate::setRightContent (   $a_html)

sets content of right column

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

1871 {
1872 $this->right_content = $a_html;
1873 }

◆ setStyleSheetLocation()

ilTemplate::setStyleSheetLocation (   $a_stylesheet)

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

1586 {
1587 $this->setVariable("LOCATION_STYLESHEET", $a_stylesheet);
1588 }

References HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ setSubTabs()

ilTemplate::setSubTabs (   $a_tabs_html)

sets subtabs in standard template

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

2019 {
2020 $this->setVariable("SUB_TABS", $a_tabs_html);
2021 }

References HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ setTabs()

ilTemplate::setTabs (   $a_tabs_html)

sets tabs in standard template

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

2004 {
2005 if ($a_tabs_html != "" && $this->blockExists("tabs_outer_start"))
2006 {
2007 $this->touchBlock("tabs_outer_start");
2008 $this->touchBlock("tabs_outer_end");
2009 $this->touchBlock("tabs_inner_start");
2010 $this->touchBlock("tabs_inner_end");
2011 $this->setVariable("TABS", $a_tabs_html);
2012 }
2013 }

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

+ Here is the call graph for this function:

◆ setTitle()

ilTemplate::setTitle (   $a_title)

sets title in standard template

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

1617 {
1618 $this->title = ilUtil::stripScriptHTML($a_title);
1619 $this->header_page_title = $a_title;
1620 }

References ilUtil\stripScriptHTML().

Referenced by clearHeader(), and resetHeaderBlock().

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

◆ setTitleColor()

ilTemplate::setTitleColor (   $a_val)

Set title color.

Parameters
string$a_valcolor

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

1636 {
1637 $this->title_color = $a_val;
1638 }

◆ setTitleIcon()

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

set title icon

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

1772 {
1773 $this->icon_desc = $a_icon_desc;
1774 $this->icon_path = $a_icon_path;
1775 }

Referenced by clearHeader(), and resetHeaderBlock().

+ Here is the caller graph for this function:

◆ setTitleUrl()

ilTemplate::setTitleUrl (   $a_url)

sets title url in standard template

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

1626 {
1627 $this->title_url = $a_url;
1628 }

◆ setTreeFlatIcon()

ilTemplate::setTreeFlatIcon (   $a_link,
  $a_mode 
)

set tree/flat icon

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

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

2181 {
2182 global $lng;
2183
2184 $this->tree_flat_link = $a_link;
2185 $this->tree_flat_mode = $a_mode;
2186 }

References $lng.

◆ setUpperIcon()

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

sets icon to upper level

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

2027 {
2028 global $lng;
2029
2030 $this->upper_icon = $a_link;
2031 $this->upper_icon_frame = $a_frame;
2032 }

References $lng.

◆ show() [1/2]

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

@access public

Parameters
string

Reimplemented from HTML_Template_IT.

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

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

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

+ Here is the call graph for this function:

◆ show() [2/2]

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

@access public

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

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

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

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

+ Here is the call graph for this function:

◆ stopTitleFloating()

ilTemplate::stopTitleFloating ( )

set stop floating (if no tabs are used)

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

1810 {
1811 $this->stop_floating = true;
1812 }

◆ touchBlock() [1/2]

ilTemplate::touchBlock (   $block)

overwrites ITX::touchBlock.

@access public

Parameters
string
Returns
???

Reimplemented from HTML_Template_IT.

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

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

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

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

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

◆ touchBlock() [2/2]

ilTemplate::touchBlock (   $block)

overwrites ITX::touchBlock.

@access public

Parameters
string
Returns
???

Reimplemented from HTML_Template_IT.

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

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

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

+ Here is the call graph for this function:

◆ variableExists()

ilTemplate::variableExists (   $a_variablename)
private

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

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

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

+ Here is the caller graph for this function:

Field Documentation

◆ $activeBlock

ilTemplate::$activeBlock

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

Referenced by parseCurrentBlock().

◆ $addFooter

ilTemplate::$addFooter
private

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

Referenced by getAddFooter().

◆ $admin_panel_commands

ilTemplate::$admin_panel_commands = array()

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

◆ $content_style_sheet

ilTemplate::$content_style_sheet = ""
protected

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

◆ $contenttype

ilTemplate::$contenttype

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

Referenced by getContentType().

◆ $css_files

ilTemplate::$css_files = array()

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

◆ $header_action

ilTemplate::$header_action
protected

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

Referenced by getHeaderActionMenu().

◆ $il_cache

ilTemplate::$il_cache = array()
staticprotected

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

◆ $inline_css

ilTemplate::$inline_css = array()

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

◆ $js_files

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

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

◆ $js_files_batch

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

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

◆ $js_files_vp

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

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

◆ $lightbox

ilTemplate::$lightbox = array()
protected

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

◆ $message

ilTemplate::$message = ""
protected

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

◆ $mount_webfolder

ilTemplate::$mount_webfolder = ""
protected

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

Referenced by fillSideIcons().

◆ $page_actions

ilTemplate::$page_actions = array()
protected

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

◆ $page_form_action

ilTemplate::$page_form_action = ""
protected

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

◆ $permanent_link

ilTemplate::$permanent_link = false
protected

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

◆ $stop_floating

ilTemplate::$stop_floating = ""
protected

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

◆ $title_alerts

ilTemplate::$title_alerts = array()
protected

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

◆ $title_desc

ilTemplate::$title_desc = ""
protected

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

◆ $title_url

ilTemplate::$title_url = ""
protected

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

◆ $translation_linked

ilTemplate::$translation_linked = false
protected

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

◆ $tree_flat_link

ilTemplate::$tree_flat_link = ""
protected

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

◆ $upper_icon

ilTemplate::$upper_icon = ""
protected

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

◆ $vars

ilTemplate::$vars

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

Referenced by prepareForFormular().


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