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

Static Public Member Functions

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

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

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.
 variableExists ($a_variablename)
 fillHeader ()
 Fill header.
 fillStopFloating ()
 stop floating
 fillRightContent ()
 Fill right content.
 setCenterColumnClass ()
 fillLeftContent ()
 Fill left content.

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:
class.ilTemplate.php 61548 2016-01-26 10:26:22Z gitmgr
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:
class.ilTemplate.php 56910 2015-01-08 11:57:02Z akill

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

Member Function Documentation

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

Add a command to the admin panel.

Deprecated:
use addAdminPanelToolbar

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

{
$this->admin_panel_commands[] =
array("cmd" => $a_cmd, "txt" => $a_txt);
if ($a_arrow)
{
$this->admin_panel_arrow = true;
}
$this->admin_panel_top_only = false;
}
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 2326 of file class.ilTemplate.php.

{
$this->admin_panel_commands_toolbar = $toolb;
$this->admin_panel_arrow = $a_arrow;
$this->admin_panel_bottom = $a_bottom_panel;
}
ilTemplate::addBlockFile (   $var,
  $block,
  $tplname,
  $in_module = false 
)

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

References addBlockFile(), and getTemplatePath().

{
if (DEBUG)
{
echo "<br/>Template '".$this->tplPath."/".$tplname."'";
}
$tplfile = $this->getTemplatePath($tplname, $in_module);
if (file_exists($tplfile) == false)
{
echo "<br/>Template '".$tplfile."' doesn't exist! aborting...";
return false;
}
return parent::addBlockFile($var, $block, $tplfile);
}

+ Here is the call graph for this function:

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

overwrites ITX::addBlockFile public

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

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

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

Referenced by addBlockFile(), and getStandardTemplate().

{
if (DEBUG)
{
echo "<br/>Template '".$this->tplPath."/".$tplname."'";
}
$tplfile = $this->getTemplatePath($tplname, $in_module);
if (file_exists($tplfile) == false)
{
echo "<br/>Template '".$tplfile."' doesn't exist! aborting...";
return false;
}
$id = $this->getTemplateIdentifier($tplname, $in_module);
$template = $this->getFile($tplfile);
// include the template input hook
global $ilPluginAdmin;
$pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
foreach ($pl_names as $pl)
{
$ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
$gui_class = $ui_plugin->getUIClassInstance();
$resp = $gui_class->getHTML("", "template_add",
array("tpl_id" => $id, "tpl_obj" => $this, "html" => $template));
if ($resp["mode"] != ilUIHookPluginGUI::KEEP)
{
$template = $gui_class->modifyHTML($template, $resp);
}
}
return $this->addBlock($var, $block, $template);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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.

{
if (!array_key_exists($a_css_file . $media, $this->css_files))
{
$this->css_files[$a_css_file . $media] = array("file" => $a_css_file, "media" => $media);
}
}
ilTemplate::addCss (   $a_css_file,
  $media = "screen" 
)

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

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

{
if (!array_key_exists($a_css_file . $media, $this->css_files))
{
$this->css_files[$a_css_file . $media] = array("file" => $a_css_file, "media" => $media);
}
}
ilTemplate::addILIASFooter ( )

add ILIAS footer

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

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

Referenced by get(), and show().

{
global $ilAuth;
if (!$this->getAddFooter()) return;
global $ilias, $ilClientIniFile, $ilCtrl, $ilDB, $ilSetting, $lng;
$ftpl = new ilTemplate("tpl.footer.html", true, true, "Services/UICore");
$ftpl->setVariable("ILIAS_VERSION", $ilias->getSetting("ilias_version"));
$link_items = array();
// imprint
include_once "Services/Imprint/classes/class.ilImprint.php";
if($_REQUEST["baseClass"] != "ilImprintGUI" && ilImprint::isActive())
{
include_once "Services/Link/classes/class.ilLink.php";
$link_items[ilLink::_getStaticLink(0, "impr")] = array($lng->txt("imprint"), true);
}
$link_items["mailto:".ilUtil::prepareFormOutput($ilSetting->get("feedback_recipient"))] = array($lng->txt("contact_sysadmin"), false);
if (DEVMODE && version_compare(PHP_VERSION,'5','>='))
{
$link_items[ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=xhtml")] = array("Validate", true);
$link_items[ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=accessibility")] = array("Accessibility", true);
}
// output translation link (extended language maintenance)
if ($ilSetting->get("lang_ext_maintenance") == "1")
{
include_once("Services/Language/classes/class.ilObjLanguageAccess.php");
{
// fix #9992: remember linked translation instead of saving language usages here
$this->translation_linked = true;
$link_items[ilObjLanguageAccess::_getTranslationLink()] = array($lng->txt('translation'), true);
}
}
$cnt = 0;
foreach($link_items as $url => $caption)
{
$cnt ++;
if($caption[1])
{
$ftpl->touchBlock("blank");
}
if($cnt < sizeof($link_items))
{
$ftpl->touchBlock("item_separator");
}
$ftpl->setCurrentBlock("items");
$ftpl->setVariable("URL_ITEM", $url);
$ftpl->setVariable("TXT_ITEM", $caption[0]);
$ftpl->parseCurrentBlock();
}
if (DEVMODE)
{
// execution time
$t1 = explode(" ", $GLOBALS['ilGlobalStartTime']);
$t2 = explode(" ", microtime());
$diff = $t2[0] - $t1[0] + $t2[1] - $t1[1];
$mem_usage = array();
if(function_exists("memory_get_usage"))
{
$mem_usage[] =
"Memory Usage: ".memory_get_usage()." Bytes";
}
if(function_exists("xdebug_peak_memory_usage"))
{
$mem_usage[] =
"XDebug Peak Memory Usage: ".xdebug_peak_memory_usage()." Bytes";
}
$mem_usage[] = round($diff, 4)." Seconds";
if (sizeof($mem_usage))
{
$ftpl->setVariable("MEMORY_USAGE", "<br>".implode(" | ", $mem_usage));
}
if (is_object($ilAuth) && isset($_SESSION[$ilAuth->_sessionName]) &&
isset($_SESSION[$ilAuth->_sessionName]["timestamp"]))
{
$ftpl->setVariable("SESS_INFO", "<br />maxlifetime: ".
ini_get("session.gc_maxlifetime")." (".
(ini_get("session.gc_maxlifetime")/60)."), id: ".session_id()."<br />".
"timestamp: ".date("Y-m-d H:i:s", $_SESSION[$ilAuth->_sessionName]["timestamp"]).
", idle: ".date("Y-m-d H:i:s", $_SESSION[$ilAuth->_sessionName]["idle"]).
"<br />expire: ".($exp = $ilClientIniFile->readVariable("session","expire")).
" (".($exp/60)."), session ends at: ".
date("Y-m-d H:i:s", $_SESSION[$ilAuth->_sessionName]["idle"] + $exp));
}
if (!empty($_GET["do_dev_validate"]) && $ftpl->blockExists("xhtml_validation"))
{
require_once("Services/XHTMLValidator/classes/class.ilValidatorAdapter.php");
$template2 = clone($this);
//echo "-".ilValidatorAdapter::validate($template2->get(), $_GET["do_dev_validate"])."-";
$ftpl->setCurrentBlock("xhtml_validation");
$ftpl->setVariable("VALIDATION",
ilValidatorAdapter::validate($template2->get("DEFAULT",
false, false, false, true), $_GET["do_dev_validate"]));
$ftpl->parseCurrentBlock();
}
// controller history
if (is_object($ilCtrl) && $ftpl->blockExists("c_entry") &&
$ftpl->blockExists("call_history"))
{
$hist = $ilCtrl->getCallHistory();
foreach($hist as $entry)
{
$ftpl->setCurrentBlock("c_entry");
$ftpl->setVariable("C_ENTRY", $entry["class"]);
if (is_object($ilDB))
{
$file = $ilCtrl->lookupClassPath($entry["class"]);
$add = $entry["mode"]." - ".$entry["cmd"];
if ($file != "")
{
$add.= " - ".$file;
}
$ftpl->setVariable("C_FILE", $add);
}
$ftpl->parseCurrentBlock();
}
$ftpl->setCurrentBlock("call_history");
$ftpl->parseCurrentBlock();
// debug hack
$debug = $ilCtrl->getDebug();
foreach($debug as $d)
{
$ftpl->setCurrentBlock("c_entry");
$ftpl->setVariable("C_ENTRY", $d);
$ftpl->parseCurrentBlock();
}
$ftpl->setCurrentBlock("call_history");
$ftpl->parseCurrentBlock();
}
// included files
if (is_object($ilCtrl) && $ftpl->blockExists("i_entry") &&
$ftpl->blockExists("included_files"))
{
$fs = get_included_files();
$ifiles = array();
$total = 0;
foreach($fs as $f)
{
$ifiles[] = array("file" => $f, "size" => filesize($f));
$total += filesize($f);
}
$ifiles = ilUtil::sortArray($ifiles, "size", "desc", true);
foreach($ifiles as $f)
{
$ftpl->setCurrentBlock("i_entry");
$ftpl->setVariable("I_ENTRY", $f["file"]." (".$f["size"]." Bytes, ".round(100 / $total * $f["size"], 2)."%)");
$ftpl->parseCurrentBlock();
}
$ftpl->setCurrentBlock("i_entry");
$ftpl->setVariable("I_ENTRY", "Total (".$total." Bytes, 100%)");
$ftpl->parseCurrentBlock();
$ftpl->setCurrentBlock("included_files");
$ftpl->parseCurrentBlock();
}
}
// BEGIN Usability: Non-Delos Skins can display the elapsed time in the footer
// The corresponding $ilBench->start invocation is in inc.header.php
global $ilBench;
$ilBench->stop("Core", "ElapsedTimeUntilFooter");
$ftpl->setVariable("ELAPSED_TIME",
", ".number_format($ilBench->getMeasuredTime("Core", "ElapsedTimeUntilFooter"),1).' seconds');
// END Usability: Non-Delos Skins can display the elapsed time in the footer
$this->setVariable("FOOTER", $ftpl->get());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

{
$this->inline_css[] = array("css" => $a_css, "media" => $media);
}
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.

{
if (!in_array($a_js_file, $this->js_files))
{
$this->js_files[] = $a_js_file;
}
}
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 2186 of file class.ilTemplate.php.

{
// three batches currently
if ($a_batch < 1 || $a_batch > 3)
{
$a_batch = 2;
}
// ensure jquery files being loaded first
if (is_int(strpos($a_js_file, "Services/jQuery")) ||
is_int(strpos($a_js_file, "/jquery.js")) ||
is_int(strpos($a_js_file, "/jquery-min.js")))
{
$a_batch = 0;
}
if (!in_array($a_js_file, $this->js_files))
{
$this->js_files[] = $a_js_file;
$this->js_files_vp[$a_js_file] = $a_add_version_parameter;
$this->js_files_batch[$a_js_file] = $a_batch;
}
}
ilTemplate::addLightbox (   $a_html,
  $a_id 
)

Add lightbox html.

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

{
$this->lightbox[$a_id] = $a_html;
}
ilTemplate::addOnLoadCode (   $a_code,
  $a_batch = 2 
)

Add on load code.

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

Referenced by ilWikiPageGUI\initEditingJS().

{
// three batches currently
if ($a_batch < 1 || $a_batch > 3)
{
$a_batch = 2;
}
$this->on_load_code[$a_batch][] = $a_code;
}

+ Here is the caller graph for this function:

ilTemplate::blockExists (   $a_blockname)

check if block exists in actual template private

Parameters
stringblockname
Returns
boolean

Reimplemented from HTML_Template_ITX.

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

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

check if block exists in actual template private

Parameters
stringblockname
Returns
boolean

Reimplemented from HTML_Template_ITX.

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

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

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

+ Here is the caller graph for this function:

static ilTemplate::buildLoginTarget ( )
static

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

Returns
string

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

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

{
global $tree, $ilUser;
$target_str = "";
// repository
if ($_GET["ref_id"] != "")
{
if ($tree->isInTree($_GET["ref_id"]) && $_GET["ref_id"] != $tree->getRootId())
{
$obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
$type = ilObject::_lookupType($obj_id);
$target_str = $type."_".$_GET["ref_id"];
}
}
// personal workspace
else if ($_GET["wsp_id"] != "")
{
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
$tree = new ilWorkspaceTree($ilUser->getId());
$obj_id = $tree->lookupObjectId((int)$_GET["wsp_id"]);
if($obj_id)
{
$type = ilObject::_lookupType($obj_id);
$target_str = $type."_".(int)$_GET["wsp_id"]."_wsp";
}
}
// portfolio
else if ($_GET["prt_id"] != "")
{
$target_str = "prtf_".(int)$_GET["prt_id"];
}
return $target_str;
}

+ Here is the call graph for this function:

ilTemplate::checkTopic (   $a_block,
  $a_topic 
)

checks for a topic in the template private

Parameters
string
string
Returns
boolean

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

Referenced by includeNavigation(), and includeTree().

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

+ Here is the caller graph for this function:

ilTemplate::clearHeader ( )

Clear header.

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

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

{
$this->setTitle("");
$this->setTitleIcon("");
$this->setDescription("");
$this->setAlertProperties(array());
}

+ Here is the call graph for this function:

ilTemplate::enableDragDropFileUpload (   $a_ref_id)

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

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

Referenced by resetHeaderBlock().

{
$this->enable_fileupload = $a_ref_id;
}

+ Here is the caller graph for this function:

ilTemplate::fileExists (   $filename)

check if a file exists public

Returns
boolean

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

References $filename.

{
return file_exists($this->tplPath."/".$filename);
}
ilTemplate::fillAdminPanel ( )

Put admin panel into template:

  • creation selector
  • admin view on/off button

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

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

Referenced by get(), and show().

{
global $lng, $ilHelp;
$adm_view_cmp = $adm_cmds = $adm_view = false;
$toolb = new ilToolbarGUI();
// admin panel commands
if ((count($this->admin_panel_commands) > 0))
{
foreach($this->admin_panel_commands as $cmd)
{
$toolb->addFormButton($cmd["txt"], $cmd["cmd"]);
}
$adm_cmds = true;
}
elseif($this->admin_panel_commands_toolbar instanceof ilToolbarGUI)
{
$toolb = $this->admin_panel_commands_toolbar;
$adm_cmds = true;
}
// Add arrow if desired
if($this->admin_panel_arrow)
{
$toolb->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), $lng->txt("actions"));
}
if ($adm_cmds)
{
$this->setCurrentBlock("adm_view_components");
$this->setVariable("ADM_PANEL1", $toolb->getHTML());
$adm_view_cmp = true;
}
// admin view button
if ($this->page_actions != "")
{
$this->setVariable("PAGE_ACTIONS", $this->page_actions);
$adm_view = true;
}
// creation selector
// see: ilObjectAddNewItemGUI
// placeholder "SELECT_OBJTYPE_REPOS" still needed!
if ($adm_cmds and $this->admin_panel_bottom)
{
$this->setCurrentBlock("adm_view_components2");
if ($this->admin_panel_arrow)
{
$toolb->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), $lng->txt("actions"));
}
$this->setVariable("ADM_PANEL2", $toolb->getHTML());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillBodyClass ( )

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

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

Referenced by get(), and show().

{
if ($this->body_class != "" && $this->blockExists("body_class"))
{
$this->setCurrentBlock("body_class");
$this->setVariable("BODY_CLASS", $this->body_class);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillContentLanguage ( )

Add current user language to meta tags.

public

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

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

Referenced by get(), and show().

{
global $ilUser,$lng;
$contentLanguage = 'en';
$rtl = array('ar','fa','ur','he');//, 'de'); //make a list of rtl languages
/* rtl-review: add "de" for testing with ltr lang shown in rtl
* and set unicode-bidi to bidi-override for mirror effect */
$textdir = 'ltr';
if(is_object($ilUser))
{
if($ilUser->getLanguage())
{
$contentLanguage = $ilUser->getLanguage();
}
else if(is_object($lng))
{
$contentLanguage = $lng->getDefaultLanguage();
}
}
$this->setVariable('META_CONTENT_LANGUAGE', $contentLanguage);
if (in_array($contentLanguage, $rtl)) {
$textdir = 'rtl';
}
$this->setVariable('LANGUAGE_DIRECTION', $textdir);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillContentStyle ( )

Fill Content Style.

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

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

Referenced by get(), and show().

{
if ($this->content_style_sheet != "")
{
$this->setCurrentBlock("ContentStyle");
$this->setVariable("LOCATION_CONTENT_STYLESHEET",
$this->content_style_sheet);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillCssFiles (   $a_force = false)

Fill in the css file tags.

Parameters
boolean$a_force

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

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

{
if (!$this->blockExists("css_file"))
{
return;
}
foreach($this->css_files as $css)
{
$filename = $css["file"];
if (strpos($filename, "?") > 0) $filename = substr($filename, 0, strpos($filename, "?"));
if (is_file($filename) || $a_force)
{
$this->setCurrentBlock("css_file");
$this->setVariable("CSS_FILE", $css["file"]);
$this->setVariable("CSS_MEDIA", $css["media"]);
}
}
}

+ Here is the call graph for this function:

ilTemplate::fillCssFiles (   $a_force = false)

Fill in the css file tags.

Parameters
boolean$a_force

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

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

Referenced by get(), and show().

{
if (!$this->blockExists("css_file"))
{
return;
}
foreach($this->css_files as $css)
{
$filename = $css["file"];
if (strpos($filename, "?") > 0) $filename = substr($filename, 0, strpos($filename, "?"));
if (is_file($filename) || $a_force)
{
$this->setCurrentBlock("css_file");
$this->setVariable("CSS_FILE", $css["file"]);
$this->setVariable("CSS_MEDIA", $css["media"]);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillHeader ( )
private

Fill header.

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

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

{
global $lng, $ilUser, $ilCtrl;
$icon = false;
if ($this->icon_path != "")
{
$icon = true;
$this->setCurrentBlock("header_image");
if ($this->icon_desc != "")
{
$this->setVariable("IMAGE_DESC", $lng->txt("icon")." ".$this->icon_desc);
$this->setVariable("IMAGE_ALT", $lng->txt("icon")." ".$this->icon_desc);
}
$this->setVariable("IMG_HEADER", $this->icon_path);
$header = true;
}
if ($this->title != "")
{
$this->title = ilUtil::stripScriptHTML($this->title);
$this->setVariable("HEADER", $this->title);
if ($this->title_url != "")
{
$this->setVariable("HEADER_URL", ' href="'.$this->title_url.'"');
}
if ($this->getTitleColor() != "")
{
$this->setVariable("HEADER_COLOR", " style=\"color: #".$this->getTitleColor()."\"");
}
if ($icon)
{
//$this->setVariable("HICONCL", "ilHeaderHasIcon");
}
$header = true;
}
if ($header)
{
$this->setCurrentBlock("header_image");
}
if ($this->title_desc != "")
{
$this->setCurrentBlock("header_desc");
$this->setVariable("H_DESCRIPTION", $this->title_desc);
}
$header = $this->getHeaderActionMenu();
if ($header)
{
$this->setCurrentBlock("head_action_inner");
$this->setVariable("HEAD_ACTION", $header);
$this->touchBlock("head_action");
}
if(count((array) $this->title_alerts))
{
foreach($this->title_alerts as $alert)
{
$this->setCurrentBlock('header_alert');
if(!($alert['propertyNameVisible'] === false))
{
$this->setVariable('H_PROP', $alert['property'].':');
}
$this->setVariable('H_VALUE', $alert['value']);
}
}
// add file upload drop zone in header
if ($this->enable_fileupload != null)
{
$ref_id = $this->enable_fileupload;
$upload_id = "dropzone_" . $ref_id;
include_once("./Services/FileUpload/classes/class.ilFileUploadGUI.php");
$upload = new ilFileUploadGUI($upload_id, $ref_id, true);
$this->setVariable("FILEUPLOAD_DROPZONE_ID", " id=\"$upload_id\"");
$this->setCurrentBlock("header_fileupload");
$this->setVariable("HEADER_FILEUPLOAD_SCRIPT", $upload->getHTML());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillInlineCss ( )

Fill in the inline css.

Parameters
boolean$a_force

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

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

Referenced by get(), and show().

{
if (!$this->blockExists("css_inline"))
{
return;
}
foreach($this->inline_css as $css)
{
$this->setCurrentBlock("css_file");
$this->setVariable("CSS_INLINE", $css["css"]);
//$this->setVariable("CSS_MEDIA", $css["media"]);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

Referenced by fillJavaScriptFiles().

{
$this->setCurrentBlock("js_file");
if($this->js_files_vp[$file])
{
$this->setVariable("JS_FILE", ilUtil::appendUrlParameterString($file, $vers));
}
else
{
$this->setVariable("JS_FILE", $file);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillJavaScriptFiles ( )

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

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

Referenced by get(), and show().

{
global $ilias,$ilTabs;
if ($this->blockExists("js_file"))
{
foreach($this->js_files as $file)
{
if (is_file($file) || substr($file, 0, 4) == "http")
{
$this->setCurrentBlock("js_file");
$this->setVariable("JS_FILE", $file);
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillJavaScriptFiles (   $a_force = false)

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

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

{
global $ilias, $ilTabs, $ilSetting, $ilUser;
if (is_object($ilSetting)) // maybe this one can be removed
{
$vers = "vers=".str_replace(array(".", " "), "-", $ilSetting->get("ilias_version"));
}
if ($this->blockExists("js_file"))
{
// three batches
for ($i=0; $i<=3; $i++)
{
reset($this->js_files);
foreach($this->js_files as $file)
{
if (is_file($file) || substr($file, 0, 4) == "http" || substr($file, 0, 2) == "//" || $a_force)
{
if ($this->js_files_batch[$file] == $i)
{
$this->fillJavascriptFile($file, $vers);
}
}
else if(substr($file, 0, 2) == './') // #13962
{
$url_parts = parse_url($file);
if(is_file($url_parts['path']))
{
$this->fillJavascriptFile($file, $vers);
}
}
}
}
}
}

+ Here is the call graph for this function:

ilTemplate::fillLeftContent ( )
private

Fill left content.

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

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

Referenced by get(), and show().

{
if (trim($this->left_content) != "")
{
$this->setCurrentBlock("left_column");
$this->setVariable("LEFT_CONTENT", $this->left_content);
$left_col_class = (trim($this->right_content) == "")
? "col-sm-3 col-sm-pull-9"
: "col-sm-3 col-sm-pull-6";
$this->setVariable("LEFT_COL_CLASS", $left_col_class);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillLeftNav ( )

Fill left navigation frame.

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

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

Referenced by get(), and show().

{
if (trim($this->left_nav_content) != "")
{
$this->setCurrentBlock("left_nav");
$this->setVariable("LEFT_NAV_CONTENT", $this->left_nav_content);
$this->touchBlock("left_nav_space");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillLightbox ( )

Fill lightbox content.

Parameters
@return

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

References HTML_Template_IT\setVariable().

Referenced by get(), and show().

{
$html = "";
foreach ($this->lightbox as $lb)
{
$html.= $lb;
}
$this->setVariable("LIGHTBOX", $html);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillMainContent ( )

Fill main content.

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

References HTML_Template_IT\setVariable().

Referenced by get(), and show().

{
if (trim($this->main_content) != "")
{
$this->setVariable("ADM_CONTENT", $this->main_content);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillMainMenu ( )

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

References $tpl, and variableExists().

Referenced by get(), and show().

{
global $tpl;
if($this->variableExists('MAINMENU'))
{
$tpl->setVariable("MAINMENU", $this->main_menu);
$tpl->setVariable("MAINMENU_SPACER", $this->main_menu_spacer);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillMessage ( )

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

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

Referenced by get(), and show().

{
global $lng;
$ms = array("info", "success", "failure", "question");
$out = "";
foreach ($ms as $m)
{
$txt = "";
if ($m == "question")
{
$m = "mess_question";
}
if (isset($_SESSION[$m]) && $_SESSION[$m] != "")
{
$txt = $_SESSION[$m];
}
else if (isset($this->message[$m]))
{
$txt = $this->message[$m];
}
if ($m == "mess_question")
{
$m = "question";
}
if ($txt != "")
{
$out.= $this->getMessageHTML($txt, $m);
}
if ($m == "question")
{
$m = "mess_question";
}
if (isset($_SESSION[$m]) && $_SESSION[$m])
{
unset($_SESSION[$m]);
}
}
if ($out != "")
{
$this->setVariable("MESSAGE", $out);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillMessage ( )

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

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

{
global $lng;
$ms = array("info", "success", "failure", "question");
$out = "";
foreach ($ms as $m)
{
if ($m == "question")
{
$m = "mess_question";
}
$txt = (ilSession::get($m) != "")
: $this->message[$m];
if ($m == "mess_question")
{
$m = "question";
}
if ($txt != "")
{
$mtpl = new ilTemplate("tpl.message.html", true, true, "Services/Utilities");
$mtpl->setCurrentBlock($m."_message");
$mtpl->setVariable("TEXT", $txt);
$mtpl->setVariable("MESSAGE_HEADING", $lng->txt($m."_message"));
$mtpl->parseCurrentBlock();
$out.= $mtpl->get();
}
if ($m == "question")
{
$m = "mess_question";
}
if (ilSession::get($m))
{
}
}
if ($out != "")
{
$this->setVariable("MESSAGE", $out);
}
}

+ Here is the call graph for this function:

ilTemplate::fillNewContentStyle ( )
private

Fill Content Style.

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

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

Referenced by get(), and show().

{
$this->setVariable("LOCATION_NEWCONTENT_STYLESHEET_TAG",
'<link rel="stylesheet" type="text/css" href="'.
.'" />');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillOnLoadCode ( )

Fill add on load code.

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

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

Referenced by get(), and show().

{
for ($i = 1; $i <= 3; $i++)
{
if (is_array($this->on_load_code[$i]))
{
$this->setCurrentBlock("on_load_code");
foreach ($this->on_load_code[$i] as $code)
{
$this->setCurrentBlock("on_load_code_inner");
$this->setVariable("OLCODE", $code);
}
$this->setCurrentBlock("on_load_code");
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillPageFormAction ( )

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

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

Referenced by fillAdminPanel().

{
if ($this->page_form_action != "")
{
$this->setCurrentBlock("page_form_start");
$this->setVariable("PAGE_FORM_ACTION", $this->page_form_action);
$this->touchBlock("page_form_end");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillPermanentLink ( )

Fill in permanent link.

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

References HTML_Template_IT\setVariable().

Referenced by get(), and show().

{
if (is_array($this->permanent_link))
{
include_once("./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
$plinkgui = new ilPermanentLinkGUI(
$this->permanent_link["type"],
$this->permanent_link["id"],
$this->permanent_link["append"],
$this->permanent_link["target"]);
$this->setVariable("PRMLINK", $plinkgui->getHTML());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillRightContent ( )
private

Fill right content.

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

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

Referenced by get(), and show().

{
if (trim($this->right_content) != "")
{
$this->setCurrentBlock("right_column");
$this->setVariable("RIGHT_CONTENT", $this->right_content);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillScreenReaderFocus ( )

Accessibility focus for screen readers.

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

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

Referenced by get(), and show().

{
global $ilUser;
if (is_object($ilUser) && $ilUser->getPref("screen_reader_optimization") && $this->blockExists("sr_focus"))
{
$this->touchBlock("sr_focus");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillSideIcons ( )

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

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

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

{
global $lng, $ilSetting;
if ($this->upper_icon == "" && $this->tree_flat_link == ""
&& $this->mount_webfolder == "")
{
return;
}
// upper icon
// deprecated
if ($this->upper_icon != "")
{
/*if ($this->upper_icon_frame != "")
{
$this->setCurrentBlock("target_top");
$this->setVariable("TARGET_TOP", $this->upper_icon_frame);
$this->parseCurrentBlock();
}
$this->setCurrentBlock("alt_top");
$this->setVariable("ALT_TOP", $lng->txt("up"));
$this->parseCurrentBlock();
$this->setCurrentBlock("top");
$this->setVariable("LINK_TOP", $this->upper_icon);
$this->parseCurrentBlock();*/
}
// tree/flat icon
if ($this->tree_flat_link != "")
{
if ($this->left_nav_content != "")
{
$this->touchBlock("tree_lns");
}
$this->setCurrentBlock("tree_mode");
$this->setVariable("LINK_MODE", $this->tree_flat_link);
if ($ilSetting->get("tree_frame") == "right")
{
if ($this->tree_flat_mode == "tree")
{
$this->setVariable("IMG_TREE",ilUtil::getImagePath("icon_sidebar_on.svg"));
$this->setVariable("RIGHT", "Right");
}
else
{
$this->setVariable("IMG_TREE",ilUtil::getImagePath("icon_sidebar_on.svg"));
$this->setVariable("RIGHT", "Right");
}
}
else
{
if ($this->tree_flat_mode == "tree")
{
$this->setVariable("IMG_TREE",ilUtil::getImagePath("icon_sidebar_on.svg"));
}
else
{
$this->setVariable("IMG_TREE",ilUtil::getImagePath("icon_sidebar_on.svg"));
}
}
$this->setVariable("ALT_TREE",$lng->txt($this->tree_flat_mode."view"));
$this->setVariable("TARGET_TREE", ilFrameTargetInfo::_getFrame("MainContent"));
include_once("./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
$this->setVariable("TREE_ACC_KEY",
ilAccessKeyGUI::getAttribute(($this->tree_flat_mode == "tree")
}
// mount webfolder
if ($this->mount_webfolder != "")
{
require_once('Services/WebDAV/classes/class.ilDAVServer.php');
$davServer = new ilDAVServer();
$a_link = $davServer->getMountURI($a_ref_id);
$a_folder = $davServer->getFolderURI($a_ref_id);
$this->setCurrentBlock("mount_webfolder");
$this->setVariable("LINK_MOUNT_WEBFOLDER", $a_link);
$this->setVariable("FOLDER_MOUNT_WEBFOLDER", $a_folder);
$this->setVariable("IMG_MOUNT_WEBFOLDER",ilUtil::getImagePath("ic_mount_webfolder.png"));
$this->setVariable("ALT_MOUNT_WEBFOLDER",$lng->txt("mount_webfolder"));
$this->setVariable("TARGET_MOUNT_WEBFOLDER", '_blank');
}
$this->setCurrentBlock("tree_icons");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillStopFloating ( )
private

stop floating

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

References touchBlock().

Referenced by get(), and show().

{
if ($this->stop_floating)
{
$this->touchBlock("stop_floating");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillTabs ( )

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

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

Referenced by get(), and show().

{
global $ilias,$ilTabs;
if ($this->blockExists("tabs_outer_start"))
{
$this->touchBlock("tabs_outer_start");
$this->touchBlock("tabs_outer_end");
$this->touchBlock("tabs_inner_start");
$this->touchBlock("tabs_inner_end");
if ($this->thtml != "")
{
$this->setVariable("TABS",$this->thtml);
}
$this->setVariable("SUB_TABS", $this->sthtml);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillToolbar ( )

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

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

Referenced by get(), and show().

{
global $ilToolbar;
$thtml = $ilToolbar->getHTML();
if ($thtml != "")
{
$this->setCurrentBlock("toolbar_buttons");
$this->setVariable("BUTTONS", $thtml);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillVars ( )

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

Returns
integer

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

References HTML_Template_IT\setVariable().

Referenced by parseCurrentBlock(), and touchBlock().

{
$count = 0;
reset($this->vars);
while(list($key, $val) = each($this->vars))
{
if (is_array($this->blockvariables[$this->activeBlock]))
{
if (array_key_exists($key, $this->blockvariables[$this->activeBlock]))
{
$count++;
$this->setVariable($key, $val);
}
}
}
return $count;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillWindowTitle ( )

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

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

Referenced by get(), and show().

{
global $ilSetting;
if ($this->header_page_title != "")
{
$a_title = ilUtil::stripScriptHTML($this->header_page_title);
$this->setVariable("PAGETITLE", "- ".$a_title);
}
if ($ilSetting->get('short_inst_name') != "")
{
$this->setVariable("WINDOW_TITLE",
$ilSetting->get('short_inst_name'));
}
else
{
$this->setVariable("WINDOW_TITLE",
"ILIAS");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

??? public

Parameters
string
Returns
string

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

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

Referenced by fillMessage(), get(), and show().

{
if ($add_error_mess)
{
$this->fillMessage();
}
if ($add_ilias_footer)
{
$this->addILIASFooter();
}
// set standard parts (tabs and title icon)
if($add_standard_elements)
{
if ($this->blockExists("content") && $a_tabs)
{
// determine default screen id
$this->getTabsHTML();
}
// to get also the js files for the main menu
$this->getMainMenu();
$this->initHelp();
// these fill blocks in tpl.main.html
$this->fillCssFiles();
$this->fillInlineCss();
$this->fillContentStyle();
$this->fillBodyClass();
// these fill just plain placeholder variables in tpl.main.html
$this->setCurrentBlock("DEFAULT");
$this->fillWindowTitle();
// these fill blocks in tpl.adm_content.html
$this->fillHeader();
$this->fillSideIcons();
$this->fillStopFloating();
$this->fillLeftContent();
$this->fillLeftNav();
$this->fillRightContent();
$this->fillAdminPanel();
$this->fillToolbar();
// late loading of javascipr files, since operations above may add files
$this->fillOnLoadCode();
// these fill just plain placeholder variables in tpl.adm_content.html
if ($this->blockExists("content"))
{
$this->setCurrentBlock("content");
if ($a_tabs)
{
$this->fillTabs();
}
$this->fillMainContent();
if ($a_main_menu)
{
$this->fillMainMenu();
}
$this->fillLightbox();
}
}
if ($handle_referer)
{
$this->handleReferer();
}
if ($part == "DEFAULT")
{
$html = parent::get();
}
else
{
$html = parent::get($part);
}
// include the template output hook
global $ilPluginAdmin;
$pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
foreach ($pl_names as $pl)
{
$ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
$gui_class = $ui_plugin->getUIClassInstance();
$resp = $gui_class->getHTML("", "template_get",
array("tpl_id" => $this->tplIdentifier, "tpl_obj" => $this, "html" => $html));
if ($resp["mode"] != ilUIHookPluginGUI::KEEP)
{
$html = $gui_class->modifyHTML($html, $resp);
}
}
// fix #9992: save language usages as late as possible
if ($this->translation_linked)
{
}
return $html;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Returns a block with all replacements done.

Parameters
stringname of the block
Returns
string
Exceptions
PEAR_Errorpublic
See Also
show()

Reimplemented from HTML_Template_IT.

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

References get().

{
if ($part == "DEFAULT")
{
return parent::get();
}
else
{
return parent::get($part);
}
}

+ Here is the call graph for this function:

ilTemplate::getAddFooter ( )

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

References $addFooter.

Referenced by addILIASFooter().

{
}

+ Here is the caller graph for this function:

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.

References getContentType().

{
header("Content-type: " . $this->getContentType() . "; charset=UTF-8");
return $this->get();
}

+ Here is the call graph for this function:

ilTemplate::getContentType ( )

Get the content type for the template output.

Returns
string Content type public

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

References $contenttype.

Referenced by getAsynch(), and show().

{
}

+ Here is the caller graph for this function:

ilTemplate::getHeaderActionMenu ( )

Get header action menu.

Returns
int ref id

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

References $header_action.

Referenced by fillHeader().

{
}

+ Here is the caller graph for this function:

ilTemplate::getLoginTargetPar ( )

Get target parameter for login.

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

Referenced by getMainMenu().

{
return $this->login_target_par;
}

+ Here is the caller graph for this function:

ilTemplate::getMainMenu ( )

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

References getLoginTargetPar(), and variableExists().

Referenced by get(), and show().

{
global $ilMainMenu;
if($this->variableExists('MAINMENU'))
{
$ilMainMenu->setLoginTargetPar($this->getLoginTargetPar());
$this->main_menu = $ilMainMenu->getHTML();
$this->main_menu_spacer = $ilMainMenu->getSpacerClass();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Get HTML for a system message.

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

References $lng, and ilTemplate().

{
global $lng;
$mtpl = new ilTemplate("tpl.message.html", true, true, "Services/Utilities");
$mtpl->setCurrentBlock($a_type."_message");
$mtpl->setVariable("TEXT", $a_txt);
$mtpl->setVariable("MESSAGE_HEADING", $lng->txt($a_type."_message"));
$mtpl->parseCurrentBlock();
return $mtpl->get();
}

+ Here is the call graph for this function:

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

Get HTML for a system message.

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

References $lng, and ilTemplate().

Referenced by fillMessage(), and show().

{
global $lng;
$mtpl = new ilTemplate("tpl.message.html", true, true, "Services/Utilities");
$mtpl->setCurrentBlock($a_type."_message");
$mtpl->setVariable("TEXT", $a_txt);
$mtpl->setVariable("MESSAGE_HEADING", $lng->txt($a_type."_message"));
$mtpl->parseCurrentBlock();
return $mtpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::getOnLoadCodeForAsynch ( )

Get js onload code for ajax calls.

Returns
string

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

{
$js = "";
for ($i = 1; $i <= 3; $i++)
{
if (is_array($this->on_load_code[$i]))
{
foreach ($this->on_load_code[$i] as $code)
{
$js .= $code."\n";
}
}
}
if($js)
{
return '<script type="text/javascript">'."\n".
$js.
'</script>'."\n";
}
}
ilTemplate::getStandardTemplate ( )

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

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

{
// always load jQuery
include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
// always load ui framework
include_once("./Services/UICore/classes/class.ilUIFramework.php");
// always load Basic js
// $this->addJavaScript("./Services/JavaScript/js/Basic.js",
// true, 1);
$this->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$this->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
}

+ Here is the call graph for this function:

ilTemplate::getTabsHTML ( )

Get tabs HTML.

Parameters
@return

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

References blockExists().

Referenced by get(), and show().

{
global $ilTabs;
if ($this->blockExists("tabs_outer_start"))
{
$this->sthtml = $ilTabs->getSubTabHTML();
$this->thtml = $ilTabs->getHTML((trim($sthtml) == ""));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

References $_GET, $ilCtrl, and ILIAS_MODULE.

Referenced by addBlockFile(), and ilTemplate().

{
global $ilCtrl;
// if baseClass functionality is used (ilias.php):
// get template directory from ilCtrl
if (!empty($_GET["baseClass"]) && $a_in_module === true)
{
$a_in_module = $ilCtrl->getModuleDir();
}
if (strpos($a_tplname,"/") === false)
{
if ($a_in_module)
{
if ($a_in_module === true)
{
$module_path = ILIAS_MODULE."/";
}
else
{
$module_path = $a_in_module."/";
}
}
else
{
$module_path = "";
}
return $module_path.basename($a_tplname);
}
else
{
return $a_tplname;
}
}

+ Here is the caller graph for this function:

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.

References $_GET, $ilCtrl, and ILIAS_MODULE.

{
global $ilias, $ilCtrl;
// if baseClass functionality is used (ilias.php):
// get template directory from ilCtrl
if (!empty($_GET["baseClass"]) && $a_in_module === true)
{
$a_in_module = $ilCtrl->getModuleDir();
}
if (strpos($a_tplname,"/") === false)
{
$module_path = "";
//$fname = $ilias->tplPath;
if ($a_in_module)
{
if ($a_in_module === true)
{
$module_path = ILIAS_MODULE."/";
}
else
{
$module_path = $a_in_module."/";
}
}
if($fname == "" || !file_exists($fname))
{
if ($a_in_module == "setup")
{
$fname = "./".$module_path."templates/".basename($a_tplname);
}
else
{
$fname = "./".$module_path."templates/default/".basename($a_tplname);
}
}
}
else
{
$fname = $a_tplname;
}
return $fname;
}
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 1472 of file class.ilTemplate.php.

References $_GET, $ilCtrl, and ILIAS_MODULE.

Referenced by addBlockFile(), and ilTemplate().

{
global $ilias, $ilCtrl;
$fname = "";
// if baseClass functionality is used (ilias.php):
// get template directory from ilCtrl
if (!empty($_GET["baseClass"]) && $a_in_module === true)
{
$a_in_module = $ilCtrl->getModuleDir();
}
if (strpos($a_tplname,"/") === false)
{
$module_path = "";
//$fname = $ilias->tplPath;
if ($a_in_module)
{
if ($a_in_module === true)
{
$module_path = ILIAS_MODULE."/";
}
else
{
$module_path = $a_in_module."/";
}
}
// use ilStyleDefinition instead of account to get the current skin
include_once "Services/Style/classes/class.ilStyleDefinition.php";
if (ilStyleDefinition::getCurrentSkin() != "default")
{
$fname = "./Customizing/global/skin/".
ilStyleDefinition::getCurrentSkin()."/".$module_path.basename($a_tplname);
}
if($fname == "" || !file_exists($fname))
{
$fname = "./".$module_path."templates/default/".basename($a_tplname);
}
}
else
{
$fname = $a_tplname;
}
return $fname;
}

+ Here is the caller graph for this function:

ilTemplate::getTitleColor ( )

Get title color.

Returns
string color

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

Referenced by fillHeader().

{
return $this->title_color;
}

+ Here is the caller graph for this function:

ilTemplate::handleReferer ( )

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

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

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

Referenced by get(), and show().

{
if (((substr(strrchr($_SERVER["PHP_SELF"],"/"),1) != "error.php")
&& (substr(strrchr($_SERVER["PHP_SELF"],"/"),1) != "adm_menu.php")
&& (substr(strrchr($_SERVER["PHP_SELF"],"/"),1) != "chat.php")))
{
$_SESSION["post_vars"] = $_POST;
// referer is modified if query string contains cmd=gateway and $_POST is not empty.
// this is a workaround to display formular again in case of error and if the referer points to another page
$url_parts = @parse_url($_SERVER["REQUEST_URI"]);
if(!$url_parts)
{
$protocol = (isset($_SERVER['HTTPS']) ? 'https' : 'http').'://';
$host = $_SERVER['HTTP_HOST'];
$path = $_SERVER['REQUEST_URI'];
$url_parts = @parse_url($protocol.$host.$path);
}
if (isset($url_parts["query"]) && preg_match("/cmd=gateway/",$url_parts["query"]) && (isset($_POST["cmd"]["create"])))
{
foreach ($_POST as $key => $val)
{
if (is_array($val))
{
$val = key($val);
}
$str .= "&".$key."=".$val;
}
$_SESSION["referer"] = preg_replace("/cmd=gateway/",substr($str,1),$_SERVER["REQUEST_URI"]);
$_SESSION['referer_ref_id'] = (int) $_GET['ref_id'];
}
else if (isset($url_parts["query"]) && preg_match("/cmd=post/",$url_parts["query"]) && (isset($_POST["cmd"]["create"])))
{
foreach ($_POST as $key => $val)
{
if (is_array($val))
{
$val = key($val);
}
$str .= "&".$key."=".$val;
}
$_SESSION["referer"] = preg_replace("/cmd=post/",substr($str,1),$_SERVER["REQUEST_URI"]);
if (isset($_GET['ref_id']))
{
$_SESSION['referer_ref_id'] = (int) $_GET['ref_id'];
}
else
{
$_SESSION['referer_ref_id'] = 0;
}
}
else
{
$_SESSION["referer"] = $_SERVER["REQUEST_URI"];
if (isset($_GET['ref_id']))
{
$_SESSION['referer_ref_id'] = (int) $_GET['ref_id'];
}
else
{
$_SESSION['referer_ref_id'] = 0;
}
}
unset($_SESSION["error_post_vars"]);
}
}

+ Here is the caller graph for this function:

ilTemplate::hasMessage (   $a_type)

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

{
return (isset($this->message[$a_type]) && strlen($this->message[$a_type]));
}
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 public

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

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

{
$this->activeBlock = "__global__";
$this->vars = array();
$fname = $this->getTemplatePath($file, $in_module);
$this->tplName = basename($fname);
$this->tplPath = dirname($fname);
// set default content-type to text/html
$this->contenttype = "text/html";
if (!file_exists($fname))
{
die("template ".$fname." was not found.");
return false;
}
//$this->IntegratedTemplateExtension(dirname($fname));
$this->callConstructor();
//$this->loadTemplatefile(basename($fname), $flag1, $flag2);
$this->loadTemplatefile($fname, $flag1, $flag2);
//add tplPath to replacevars
$this->vars["TPLPATH"] = $this->tplPath;
// set Options
if (method_exists($this, "setOption"))
{
$this->setOption('use_preg', false);
}
return true;
}

+ Here is the call graph for this function:

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 public

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

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

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

{
global $ilias;
//echo "<br>-".$file."-";
$this->activeBlock = "__global__";
$this->vars = array();
$this->addFooter = TRUE;
$this->il_use_cache = $a_use_cache;
$this->il_cur_key = $file."/".$in_module;
$fname = $this->getTemplatePath($file, $in_module, $plugin);
$this->tplName = basename($fname);
$this->tplPath = dirname($fname);
// template identifier e.g. "Services/Calendar/tpl.minical.html"
$this->tplIdentifier = $this->getTemplateIdentifier($file, $in_module);
// set default content-type to text/html
$this->contenttype = "text/html";
if (!file_exists($fname))
{
$ilias->raiseError("template ".$fname." was not found.", $ilias->error_obj->FATAL);
return false;
}
//$this->IntegratedTemplateExtension(dirname($fname));
$this->callConstructor();
//$this->loadTemplatefile(basename($fname), $flag1, $flag2);
$this->loadTemplatefile($fname, $flag1, $flag2);
//add tplPath to replacevars
$this->vars["TPLPATH"] = $this->tplPath;
// set Options
if (method_exists($this, "setOption"))
{
$this->setOption('use_preg', false);
}
$this->setBodyClass("std");
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::includeNavigation ( )

check if there is a NAVIGATION-topic public

Returns
boolean

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

References checkTopic().

{
return $this->checkTopic("__global__", "NAVIGATION");
}

+ Here is the call graph for this function:

ilTemplate::includeTree ( )

check if there is a TREE-topic public

Returns
boolean

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

References checkTopic().

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

+ Here is the call graph for this function:

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.

public

See Also
free()

Reimplemented from HTML_Template_ITX.

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

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

Referenced by getStandardTemplate().

{
$this->free();
$cache_hit = false;
if ($this->il_use_cache)
{
// cache hit
if (isset(self::$il_cache[$this->il_cur_key]) && is_array(self::$il_cache[$this->il_cur_key]))
{
$cache_hit = true;
//echo "cache hit";
$this->err = self::$il_cache[$this->il_cur_key]["err"];
$this->flagBlocktrouble = self::$il_cache[$this->il_cur_key]["flagBlocktrouble"];
$this->blocklist = self::$il_cache[$this->il_cur_key]["blocklist"];
$this->blockdata = self::$il_cache[$this->il_cur_key]["blockdata"];
$this->blockinner = self::$il_cache[$this->il_cur_key]["blockinner"];
$this->blockparents = self::$il_cache[$this->il_cur_key]["blockparents"];
$this->blockvariables = self::$il_cache[$this->il_cur_key]["blockvariables"];
}
}
if (!$cache_hit)
{
$this->findBlocks($this->template);
$this->template = '';
if ($this->il_use_cache)
{
self::$il_cache[$this->il_cur_key]["err"] = $this->err;
self::$il_cache[$this->il_cur_key]["flagBlocktrouble"] = $this->flagBlocktrouble;
self::$il_cache[$this->il_cur_key]["blocklist"] = $this->blocklist;
self::$il_cache[$this->il_cur_key]["blockdata"] = $this->blockdata;
self::$il_cache[$this->il_cur_key]["blockinner"] = $this->blockinner;
self::$il_cache[$this->il_cur_key]["blockparents"] = $this->blockparents;
self::$il_cache[$this->il_cur_key]["blockvariables"] = $this->blockvariables;
}
}
// we don't need it any more
$this->template = '';
} // end func init

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::initHelp ( )

Init help.

Parameters
@return

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

Referenced by get(), and show().

{
include_once("./Services/Help/classes/class.ilHelpGUI.php");
}

+ Here is the caller graph for this function:

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

Reads a template file from the disk.

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

Reimplemented from HTML_Template_IT.

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

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

{
// copied from IT:loadTemplateFile
$template = '';
if (!$this->flagCacheTemplatefile ||
$this->lastTemplatefile != $filename
) {
}
$this->lastTemplatefile = $filename;
// copied.
// new code to include the template input hook:
global $ilPluginAdmin;
$pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
foreach ($pl_names as $pl)
{
$ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
$gui_class = $ui_plugin->getUIClassInstance();
$resp = $gui_class->getHTML("", "template_load",
array("tpl_id" => $this->tplIdentifier, "tpl_obj" => $this, "html" => $template));
if ($resp["mode"] != ilUIHookPluginGUI::KEEP)
{
$template = $gui_class->modifyHTML($template, $resp);
}
}
// new.
// copied from IT:loadTemplateFile
return $template != '' ?
$this->setTemplate(
) : false;
// copied.
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

Parameters
string
Returns
string

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

References $activeBlock, and HTML_Template_IT\parseCurrentBlock().

{
// Hier erst noch ein replace aufrufen
if ($part != "DEFAULT")
{
$this->activeBlock = $part;
}
if ($part != "DEFAULT")
{
$this->activeBlock = $tmp;
}
//$this->fillVars();
$this->activeBlock = "__global__";
if ($part == "DEFAULT")
{
}
else
{
}
}

+ Here is the call graph for this function:

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

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

Parameters
string
Returns
string

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

References $activeBlock, fillVars(), and HTML_Template_IT\parseCurrentBlock().

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

{
// Hier erst noch ein replace aufrufen
if ($part != "DEFAULT")
{
$this->activeBlock = $part;
}
if ($part != "DEFAULT")
{
$this->activeBlock = $tmp;
}
$this->fillVars();
$this->activeBlock = "__global__";
if ($part == "DEFAULT")
{
}
else
{
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::prepareForFormular (   $vars)

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

public

Parameters
string

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

References $vars.

{
if (!is_array($vars))
{
return;
}
reset($vars);
while (list($i) = each($vars))
{
$vars[$i] = stripslashes($vars[$i]);
$vars[$i] = htmlspecialchars($vars[$i]);
}
return($vars);
}
ilTemplate::replace ( )

??? public

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

References HTML_Template_IT\setVariable().

Referenced by replaceDefault(), and replaceFromDatabase().

{
reset($this->vars);
while(list($key, $val) = each($this->vars))
{
$this->setVariable($key, $val);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::replaceDefault ( )

??? public

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

References replace().

{
$this->replace($this->vars);
}

+ Here is the call graph for this function:

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

??? TODO: Adjust var names to ilias.

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

Parameters
string
string
string
string

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

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

{
$res = $DB->selectDbAll();
while ($DB->getDbNextElement($res))
{
$this->setCurrentBlock($block);
$result = array();
reset($conv);
while (list ($key,$val) = each ($conv))
{
$result[$val]=$DB->element->data[$key];
}
if (($select != "default")
&& ($DB->element->data[$select["id"]]==$select["value"]
|| (strtolower($select["text"]) == "checked"
&& strpos( ",,".$select["value"].",," , ",".$DB->element->data[$select["id"]]."," )!=false)))
{
$result[$select["field"]] = $select["text"];
}
$this->replace($result);
$this->parseCurrentBlock($block);
}
}

+ Here is the call graph for this function:

ilTemplate::resetCss ( )

Reset css files.

Parameters
@return

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

{
$this->css_files = array();
}
ilTemplate::resetHeaderBlock (   $a_reset_header_action = true)

Set variable.

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

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

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

{
$this->setTitle(null);
$this->setTitleIcon(null);
$this->setDescription(null);
$this->setAlertProperties(array());
// see setFullscreenHeader()
if($a_reset_header_action)
{
$this->setHeaderActionMenu(null);
}
}

+ Here is the call graph for this function:

ilTemplate::resetJavascript ( )

Reset javascript files.

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

{
$this->js_files = array();
$this->js_files_vp = array();
$this->js_files_batch = array();
}
ilTemplate::setAddFooter (   $value)

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

{
$this->addFooter = $value;
}
ilTemplate::setAlertProperties ( array  $a_props)

Set alert properties.

Parameters
array$a_props
Returns
void

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

Referenced by clearHeader(), and resetHeaderBlock().

{
$this->title_alerts = $a_props;
}

+ Here is the caller graph for this function:

ilTemplate::setBackgroundColor (   $a_bg_color)

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

References HTML_Template_IT\setVariable().

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

+ Here is the call graph for this function:

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

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

{
if($a_img)
{
if(!$a_export)
{
$a_img = ILIAS_HTTP_PATH."/".$a_img;
}
$this->setCurrentBlock("banner_bl");
$this->setVariable("BANNER_WIDTH", $a_width); // currently not needed
$this->setVariable("BANNER_HEIGHT", $a_height);
$this->setVariable("BANNER_URL", $a_img);
}
}

+ Here is the call graph for this function:

ilTemplate::setBodyClass (   $a_class = "")

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

Referenced by ilTemplate().

{
$this->body_class = $a_class;
}

+ Here is the caller graph for this function:

ilTemplate::setCenterColumnClass ( )
private

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

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

Referenced by get(), and show().

{
if (!$this->blockExists("center_col_width"))
{
return;
}
$center_column_class = "";
if (trim($this->right_content) != "" && trim($this->left_content) != "") {
$center_column_class = "two_side_col";
}
else if (trim($this->right_content) != "" || trim($this->left_content) != "") {
$center_column_class = "one_side_col";
}
switch ($center_column_class)
{
case "one_side_col": $center_column_class = "col-sm-9"; break;
case "two_side_col": $center_column_class = "col-sm-6"; break;
default: $center_column_class = "col-sm-12"; break;
}
if (trim($this->left_content) != "")
{
$center_column_class.= " col-sm-push-3";
}
$this->setCurrentBlock("center_col_width");
$this->setVariable("CENTER_COL", $center_column_class);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::setContent (   $a_html)

sets content for standard template

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

{
if ($a_html != "")
{
$this->main_content = $a_html;
}
}
ilTemplate::setContentStyleSheet (   $a_style)

Set content style (used for page content editor)

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

{
$this->content_style_sheet = $a_style;
}
ilTemplate::setContentType (   $a_content_type = "text/html")

Set the content type for the template output.

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

Parameters
string$a_content_typeContent type public

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

{
$this->contenttype = $a_content_type;
}
ilTemplate::setCurrentBlock (   $part = "DEFAULT")

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

public

Parameters
string
Returns
???

Reimplemented from HTML_Template_IT.

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

References setCurrentBlock().

{
$this->activeBlock = $part;
if ($part == "DEFAULT")
{
}
else
{
return parent::setCurrentBlock($part);
}
}

+ Here is the call graph for this function:

ilTemplate::setDescription (   $a_descr)

sets title in standard template

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

Referenced by clearHeader(), and resetHeaderBlock().

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

+ Here is the caller graph for this function:

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

Show admin view button.

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

{
$this->edit_page_button =
array("link" => $a_link, "txt" => $a_txt, "frame" => $a_frame);
}
ilTemplate::setHeaderActionMenu (   $a_header)

Set header action menu.

Parameters
string$a_gui$a_header

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

Referenced by resetHeaderBlock().

{
$this->header_action = $a_header;
}

+ Here is the caller graph for this function:

ilTemplate::setHeaderPageTitle (   $a_title)

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

References ilUtil\stripScriptHTML().

{
$a_title = ilUtil::stripScriptHTML($a_title);
$this->header_page_title = $a_title;
}

+ Here is the call graph for this function:

ilTemplate::setLeftContent (   $a_html)

sets content of left column

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

{
$this->left_content = $a_html;
}
ilTemplate::setLeftNavContent (   $a_content)

Sets content of left navigation column.

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

{
$this->left_nav_content = $a_content;
}
ilTemplate::setLocator ( )

Insert locator.

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

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

{
global $ilLocator, $lng, $ilPluginAdmin, $ilMainMenu;
// blog/portfolio
if($ilMainMenu->getMode() == ilMainMenuGUI::MODE_TOPBAR_REDUCED ||
$ilMainMenu->getMode() == ilMainMenuGUI::MODE_TOPBAR_ONLY)
{
$this->setVariable("LOCATOR", "");
return;
}
$html = "";
if (is_object($ilPluginAdmin))
{
include_once("./Services/UIComponent/classes/class.ilUIHookProcessor.php");
$uip = new ilUIHookProcessor("Services/Locator", "main_locator",
array("locator_gui" => $ilLocator));
if (!$uip->replaced())
{
$html = $ilLocator->getHTML();
}
$html = $uip->getHTML($html);
}
else
{
$html = $ilLocator->getHTML();
}
$this->setVariable("LOCATOR", $html);
}

+ Here is the call graph for this function:

ilTemplate::setLoginTargetPar (   $a_val)

Set target parameter for login (public sector).

This is used by the main menu

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

{
$this->login_target_par = $a_val;
}
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.

References $_SESSION.

{
if (!in_array($a_type, array("info", "success", "failure", "question")) || $a_txt == "")
{
return;
}
if ($a_type == "question")
{
$a_type = "mess_question";
}
if (!$a_keep)
{
$this->message[$a_type] = $a_txt;
}
else
{
$_SESSION[$a_type] = $a_txt;
}
}
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.

References ilSession\set().

{
if (!in_array($a_type, array("info", "success", "failure", "question")) || $a_txt == "")
{
return;
}
if ($a_type == "question")
{
$a_type = "mess_question";
}
if (!$a_keep)
{
$this->message[$a_type] = $a_txt;
}
else
{
ilSession::set($a_type, $a_txt);
}
}

+ Here is the call graph for this function:

ilTemplate::setMountWebfolderIcon (   $a_ref_id)

shows icon for mounting a webfolder

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

References $lng.

{
global $lng;
$this->mount_webfolder = $a_ref_id;
}
ilTemplate::setNewContentStyleSheetLocation (   $a_stylesheet)

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

References HTML_Template_IT\setVariable().

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

+ Here is the call graph for this function:

ilTemplate::setPageActions (   $a_page_actions_html)

Show admin view button.

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

{
$this->page_actions = $a_page_actions_html;
}
ilTemplate::setPageFormAction (   $a_action)

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

{
$this->page_form_action = $a_action;
}
ilTemplate::setPermanentLink (   $a_type,
  $a_id,
  $a_append = "",
  $a_target = "" 
)

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

{
$this->permanent_link = array(
"type" => $a_type,
"id" => $a_id,
"append" => $a_append,
"target" => $a_target);
}
ilTemplate::setRightContent (   $a_html)

sets content of right column

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

{
$this->right_content = $a_html;
}
ilTemplate::setStyleSheetLocation (   $a_stylesheet)

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

References HTML_Template_IT\setVariable().

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

+ Here is the call graph for this function:

ilTemplate::setSubTabs (   $a_tabs_html)

sets subtabs in standard template

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

References HTML_Template_IT\setVariable().

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

+ Here is the call graph for this function:

ilTemplate::setTabs (   $a_tabs_html)

sets tabs in standard template

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

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

{
if ($a_tabs_html != "" && $this->blockExists("tabs_outer_start"))
{
$this->touchBlock("tabs_outer_start");
$this->touchBlock("tabs_outer_end");
$this->touchBlock("tabs_inner_start");
$this->touchBlock("tabs_inner_end");
$this->setVariable("TABS", $a_tabs_html);
}
}

+ Here is the call graph for this function:

ilTemplate::setTitle (   $a_title)

sets title in standard template

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

References ilUtil\stripScriptHTML().

Referenced by clearHeader(), and resetHeaderBlock().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::setTitleColor (   $a_val)

Set title color.

Parameters
string$a_valcolor

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

{
$this->title_color = $a_val;
}
ilTemplate::setTitleIcon (   $a_icon_path,
  $a_icon_desc = "" 
)

set title icon

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

Referenced by clearHeader(), and resetHeaderBlock().

{
$this->icon_desc = $a_icon_desc;
$this->icon_path = $a_icon_path;
}

+ Here is the caller graph for this function:

ilTemplate::setTitleUrl (   $a_url)

sets title url in standard template

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

{
$this->title_url = $a_url;
}
ilTemplate::setTreeFlatIcon (   $a_link,
  $a_mode 
)

set tree/flat icon

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

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

References $lng.

{
global $lng;
$this->tree_flat_link = $a_link;
$this->tree_flat_mode = $a_mode;
}
ilTemplate::setUpperIcon (   $a_link,
  $a_frame = "" 
)

sets icon to upper level

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

References $lng.

{
global $lng;
$this->upper_icon = $a_link;
$this->upper_icon_frame = $a_frame;
}
ilTemplate::show (   $part = "DEFAULT")

public

Parameters
string

Reimplemented from HTML_Template_IT.

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

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

{
header('Content-type: text/html; charset=UTF-8');
$this->fillCssFiles();
// ERROR HANDLER SETS $_GET["message"] IN CASE OF $error_obj->MESSAGE
$ms = array("info", "success", "failure", "question");
$out = "";
foreach ($ms as $m)
{
if ($m == "question")
{
$m = "mess_question";
}
$txt = (ilSession::get($m) != "")
: $this->message[$m];
if ($m == "mess_question")
{
$m = "question";
}
if ($txt != "")
{
$out.= $this->getMessageHTML($txt, $m);
}
if ($m == "question")
{
$m = "mess_question";
}
if (ilSession::get($m))
{
}
}
if ($this->blockExists("MESSAGE") && $out != "")
{
$this->setVariable("MESSAGE", $out);
}
if ($part == "DEFAULT")
{
}
else
{
parent::show($part);
}
if (((substr(strrchr($_SERVER["PHP_SELF"],"/"),1) != "error.php")
&& (substr(strrchr($_SERVER["PHP_SELF"],"/"),1) != "adm_menu.php")))
{
ilSession::set("post_vars", $_POST);
// referer is modified if query string contains cmd=gateway and $_POST is not empty.
// this is a workaround to display formular again in case of error and if the referer points to another page
$url_parts = parse_url($_SERVER["REQUEST_URI"]);
if(!$url_parts)
{
$protocol = (isset($_SERVER['HTTPS']) ? 'https' : 'http').'://';
$host = $_SERVER['HTTP_HOST'];
$path = $_SERVER['REQUEST_URI'];
$url_parts = @parse_url($protocol.$host.$path);
}
if (preg_match("/cmd=gateway/",$url_parts["query"]))
{
foreach ($_POST as $key => $val)
{
if (is_array($val))
{
$val = key($val);
}
$str .= "&".$key."=".$val;
}
ilSession::set("referer",
preg_replace("/cmd=gateway/",substr($str,1),$_SERVER["REQUEST_URI"]));
ilSession::set("referer_ref_id",
(int) $_GET['ref_id']);
}
else
{
ilSession::set("referer", $_SERVER["REQUEST_URI"]);
ilSession::set("referer_ref_id",
(int) $_GET['ref_id']);
}
ilSession::clear("error_post_vars");
}
}

+ Here is the call graph for this function:

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

public

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

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

References $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(), get(), getContentType(), getMainMenu(), ilPluginAdmin\getPluginObject(), getTabsHTML(), handleReferer(), IL_COMP_SERVICE, ilYuiUtil\initDom(), initHelp(), ilUIHookPluginGUI\KEEP, HTML_Template_IT\parseCurrentBlock(), setCenterColumnClass(), setCurrentBlock(), and variableExists().

Referenced by show().

{
global $ilias, $ilTabs;
// include yahoo dom per default
include_once("./Services/YUI/classes/class.ilYuiUtil.php");
//echo "-".ilUtil::getP3PLocation()."-";
//header('P3P: policyref="'.ilUtil::getP3PLocation().
// '", CP="CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa OUR BUS IND UNI COM NAV INT CNT STA PRE"');
header('P3P: CP="CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa OUR BUS IND UNI COM NAV INT CNT STA PRE"');
header("Content-type: " . $this->getContentType() . "; charset=UTF-8");
$this->fillMessage();
// display ILIAS footer
if ($part !== false)
{
$this->addILIASFooter();
}
// set standard parts (tabs and title icon)
$this->fillBodyClass();
if ($a_fill_tabs)
{
if ($this->blockExists("content"))
{
// determine default screen id
$this->getTabsHTML();
}
// to get also the js files for the main menu
if (!$a_skip_main_menu)
{
$this->getMainMenu();
$this->initHelp();
}
if($this->blockExists("content") && $this->variableExists('MAINMENU'))
{
global $tpl;
include_once 'Services/Authentication/classes/class.ilSessionReminderGUI.php';
$session_reminder_gui = new ilSessionReminderGUI(ilSessionReminder::createInstanceWithCurrentUserSession());
$tpl->setVariable('SESSION_REMINDER', $session_reminder_gui->getHtml());
}
// these fill blocks in tpl.main.html
$this->fillCssFiles();
$this->fillInlineCss();
//$this->fillJavaScriptFiles();
$this->fillContentStyle();
// these fill just plain placeholder variables in tpl.main.html
$this->setCurrentBlock("DEFAULT");
$this->fillWindowTitle();
// these fill blocks in tpl.adm_content.html
$this->fillHeader();
$this->fillSideIcons();
$this->fillStopFloating();
$this->fillLeftContent();
$this->fillLeftNav();
$this->fillRightContent();
$this->fillAdminPanel();
$this->fillToolbar();
// late loading of javascipr files, since operations above may add files
$this->fillOnLoadCode();
// these fill just plain placeholder variables in tpl.adm_content.html
// these fill just plain placeholder variables in tpl.adm_content.html
if ($this->blockExists("content"))
{
$this->setCurrentBlock("content");
$this->fillTabs();
$this->fillMainContent();
$this->fillMainMenu();
$this->fillLightbox();
}
}
if ($part == "DEFAULT" or is_bool($part))
{
$html = parent::get();
}
else
{
$html = parent::get($part);
}
// include the template output hook
global $ilPluginAdmin;
$pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
foreach ($pl_names as $pl)
{
$ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
$gui_class = $ui_plugin->getUIClassInstance();
$resp = $gui_class->getHTML("", "template_show",
array("tpl_id" => $this->tplIdentifier, "tpl_obj" => $this, "html" => $html));
if ($resp["mode"] != ilUIHookPluginGUI::KEEP)
{
$html = $gui_class->modifyHTML($html, $resp);
}
}
// fix #9992: save language usages as late as possible
if ($this->translation_linked)
{
}
print $html;
$this->handleReferer();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::stopTitleFloating ( )

set stop floating (if no tabs are used)

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

{
$this->stop_floating = true;
}
ilTemplate::touchBlock (   $block)

overwrites ITX::touchBlock.

public

Parameters
string
Returns
???

Reimplemented from HTML_Template_IT.

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

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

{
$this->setCurrentBlock($block);
//$count = $this->fillVars();
if ($count == 0)
{
}
}

+ Here is the call graph for this function:

ilTemplate::touchBlock (   $block)

overwrites ITX::touchBlock.

public

Parameters
string
Returns
???

Reimplemented from HTML_Template_IT.

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

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

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

{
$this->setCurrentBlock($block);
$count = $this->fillVars();
if ($count == 0)
{
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::variableExists (   $a_variablename)
private

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

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

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

+ Here is the caller graph for this function:

Field Documentation

ilTemplate::$activeBlock

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

Referenced by parseCurrentBlock().

ilTemplate::$addFooter
private

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

Referenced by getAddFooter().

ilTemplate::$admin_panel_commands = array()

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

ilTemplate::$content_style_sheet = ""
protected

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

ilTemplate::$contenttype

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

Referenced by getContentType().

ilTemplate::$css_files = array()

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

ilTemplate::$header_action
protected

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

Referenced by getHeaderActionMenu().

ilTemplate::$il_cache = array()
staticprotected

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

ilTemplate::$inline_css = array()

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

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

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

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

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

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

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

ilTemplate::$lightbox = array()
protected

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

ilTemplate::$message = ""
protected

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

ilTemplate::$mount_webfolder = ""
protected

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

Referenced by fillSideIcons().

ilTemplate::$page_actions = array()
protected

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

ilTemplate::$page_form_action = ""
protected

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

ilTemplate::$permanent_link = false
protected

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

ilTemplate::$stop_floating = ""
protected

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

ilTemplate::$title_alerts = array()
protected

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

ilTemplate::$title_desc = ""
protected

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

ilTemplate::$title_url = ""
protected

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

ilTemplate::$translation_linked = false
protected

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

ilTemplate::$tree_flat_link = ""
protected

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

ilTemplate::$upper_icon = ""
protected

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

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: