ILIAS  Release_4_1_x_branch Revision 61804
 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.
 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 ()
 fillTabs ()
 enableAdvancedColumnLayout ($a_left, $a_right)
 Advanced column layout (alpha! do not use yet)
 fillToolbar ()
 fillPageFormAction ()
 fillJavaScriptFiles ($a_force=false)
 fillCssFiles ($a_force=false)
 setContentStyleSheet ($a_style)
 Set content style (used for page content editor)
 fillContentStyle ()
 Fill Content Style.
 getMainMenu ()
 fillMainMenu ()
 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
 getTemplatePath ($a_tplname, $a_in_module=false, $a_plugin=false)
 builds a full template path with template and module name
 setHeaderPageTitle ($a_title)
 setStyleSheetLocation ($a_stylesheet)
 setNewContentStyleSheetLocation ($a_stylesheet)
 getStandardTemplate ()
 setTitle ($a_title)
 sets title in standard template
 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)
 setContent ($a_html)
 sets content for standard template
 setRightContent ($a_html)
 sets content of right column
 setLeftContent ($a_html)
 sets content of left column
 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.
 addOnLoadCode ($a_code)
 Add on load code.
 addCss ($a_css_file, $media="screen")
 Add a css file that should be included in the header.
 setCreationSelector ($a_form_action, $a_options, $a_command, $a_txt)
 Set selection and create button for adding new objects.
 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.
 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.
 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 ()
 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.
 loadTemplatefile ($filename, $removeUnknownVariables=true, $removeEmptyBlocks=true)
 Reads a template file from the disk.
 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.

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()
 $admin_panel_commands = array()

Protected Attributes

 $message = ""
 $title_desc = ""
 $upper_icon = ""
 $tree_flat_link = ""
 $mount_webfolder = ""
 $stop_floating = ""
 $page_form_action = ""
 $page_actions = array()
 $creation_selector = false
 $permanent_link = false
 $adv_layout = false
 $content_style_sheet = ""

Static Protected Attributes

static $il_cache = array()

Private Member Functions

 fillNewContentStyle ()
 Fill Content Style.
 variableExists ($a_variablename)
 fillHeader ()
 Fill header.
 fillStopFloating ()
 stop floating
 fillMainContent ()
 Fill main content.
 fillRightContent ()
 Fill right content.
 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 38208 2012-11-15 14:21:39Z bheyser
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 20768 2009-07-27 16:41:04Z smeyer

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.

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

{
$this->admin_panel_commands[] =
array("cmd" => $a_cmd, "txt" => $a_txt);
if ($a_arrow)
{
$this->admin_panel_arrow = true;
}
}
ilTemplate::addBlockFile (   $var,
  $block,
  $tplname,
  $in_module = false 
)

Definition at line 134 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 1206 of file class.ilTemplate.php.

References getTemplatePath().

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;
}
return parent::addBlockFile($var, $block, $tplfile);
}

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

References $_GET, $_SESSION, $d, $file, $GLOBALS, $ilAuth, $ilBench, $ilCtrl, $ilDB, $ilSetting, $total, ilObjLanguageAccess\_checkTranslate(), ilObjLanguageExtGUI\_getTranslationLink(), ilUtil\appendUrlParameterString(), ilPHP\cloneObject(), getAddFooter(), ilTemplate(), 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;
$ftpl = new ilTemplate("tpl.footer.html", true, true);
$ftpl->setVariable("ILIAS_VERSION", $ilias->getSetting("ilias_version"));
// output translation link
if ($ilSetting->get("lang_ext_maintenance") == "1")
{
include_once("Services/Language/classes/class.ilObjLanguageAccess.php");
{
include_once("Services/Language/classes/class.ilObjLanguageExtGUI.php");
$ftpl->setVariable("TRANSLATION_LINK",
}
}
if (DEVMODE)
{
// execution time
$t1 = explode(" ", $GLOBALS['ilGlobalStartTime']);
$t2 = explode(" ", microtime());
$diff = $t2[0] - $t1[0] + $t2[1] - $t1[1];
$mem_usage = "";
if(function_exists("memory_get_usage"))
{
$mem_usage.=
"<br /> Memory Usage: ".memory_get_usage()." Bytes";
}
if(function_exists("xdebug_peak_memory_usage"))
{
$mem_usage.=
"<br /> XDebug Peak Memory Usage: ".xdebug_peak_memory_usage()." Bytes";
}
$mem_usage.= "<br>".round($diff, 4)." Seconds";
if ($mem_usage != "")
{
$ftpl->setVariable("MEMORY_USAGE", $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 (version_compare(PHP_VERSION,'5','>='))
{
$ftpl->setVariable("VALIDATION_LINKS",
'<br /><a href="'.
ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=xhtml").
'">Validate</a> | <a href="'.
ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=accessibility").
'">Accessibility</a>');
}
if (!empty($_GET["do_dev_validate"]) && $ftpl->blockExists("xhtml_validation"))
{
require_once("Services/XHTMLValidator/classes/class.ilValidatorAdapter.php");
$template2 = ilPHP::cloneObject($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::addJavaScript (   $a_js_file)

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

Definition at line 431 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 1685 of file class.ilTemplate.php.

{
// three batches currently
if ($a_batch < 1 || $a_batch > 3)
{
$a_batch = 2;
}
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::addOnLoadCode (   $a_code)

Add on load code.

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

{
$this->on_load_code[] = $a_code;
}
ilTemplate::blockExists (   $a_blockname)

check if block exists in actual template private

Parameters
stringblockname
Returns
boolean

Reimplemented from HTML_Template_ITX.

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

{
return $this->blockvariables["content"][$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 959 of file class.ilTemplate.php.

Referenced by fillBodyClass(), fillCssFiles(), fillJavaScriptFiles(), fillTabs(), get(), 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:

ilTemplate::checkTopic (   $a_block,
  $a_topic 
)

checks for a topic in the template private

Parameters
string
string
Returns
boolean

Definition at line 1161 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::enableAdvancedColumnLayout (   $a_left,
  $a_right 
)

Advanced column layout (alpha! do not use yet)

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

References ilYuiUtil\initLayout().

{
$this->adv_layout = true;
include_once("./Services/YUI/classes/class.ilYuiUtil.php");
}

+ Here is the call graph for this function:

ilTemplate::fileExists (   $filename)

check if a file exists public

Returns
boolean

Definition at line 1191 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 1769 of file class.ilTemplate.php.

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

Referenced by get(), and show().

{
global $lng;
$adm_view_cmp = $adm_cmds = $creation_selector = $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;
}
if ($adm_cmds)
{
$this->setCurrentBlock("adm_view_components");
if ($this->admin_panel_arrow)
{
$toolb->setLeadingImage(ilUtil::getImagePath("arrow_upright.gif"), $lng->txt("actions"));
}
$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
if (is_array($this->creation_selector))
{
$this->setCurrentBlock("add_commands");
if ($adm_cmds)
{
$this->setVariable("ADD_COM_WIDTH", 'width="1"');
}
include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
$selection = new ilAdvancedSelectionListGUI();
$selection->setFormSelectMode("new_type", "", false,
"", "", "",
"", $this->creation_selector["txt"], "", $this->creation_selector["command"]);
$selection->setListTitle($lng->txt("cntr_add_new_item"));
$selection->setId("item_creation");
//$selection->setSelectionHeaderClass("MMInactive");
$selection->setHeaderIcon(ilUtil::getImagePath("cmd_add_s.gif"));
$selection->setItemLinkClass("xsmall");
//$selection->setSelectionHeaderClass("submit");
$selection->setUseImages(true);
"main_page_form");
foreach ($this->creation_selector["options"] as $item)
{
$selection->addItem($item["title"], $item["value"], "",
$item["img"], $item["title"], "");
}
$this->setVariable("SELECT_OBJTYPE_REPOS",
$selection->getHTML());
}
if ($adm_cmds)
{
$this->setCurrentBlock("adm_view_components2");
if ($this->admin_panel_arrow)
{
$toolb->setLeadingImage(ilUtil::getImagePath("arrow_downright.gif"), $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 1376 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 482 of file class.ilTemplate.php.

References $lng, and HTML_Template_IT\setVariable().

Referenced by get(), and show().

{
global $ilUser,$lng;
if(is_object($ilUser))
{
if($ilUser->getLanguage())
{
$this->setVariable('META_CONTENT_LANGUAGE',$ilUser->getLanguage());
return true;
}
if(is_object($lng))
{
$this->setVariable('META_CONTENT_LANGUAGE',$lng->getDefaultLanguage());
return true;
}
}
$this->setVariable('META_CONTENT_LANGUAGE','en');
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 645 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)

Definition at line 614 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 1313 of file class.ilTemplate.php.

References $lng, HTML_Template_IT\parseCurrentBlock(), setCurrentBlock(), HTML_Template_IT\setVariable(), and ilUtil\stripScriptHTML().

Referenced by get(), and show().

{
global $lng;
if ($this->icon_path != "")
{
if ($this->icon_desc != "")
{
$this->setCurrentBlock("header_image_desc");
$this->setVariable("IMAGE_DESC", $lng->txt("icon")." ".$this->icon_desc);
}
$this->setCurrentBlock("header_image");
if ($this->icon_desc != "")
{
$this->setVariable("IMAGE_ALT", $lng->txt("icon")." ".$this->icon_desc);
}
else
{
// empty alt tag for images that, e.g. are directly attached in heading
// and would only repeat the heading text
$this->setVariable("IMAGE_ALT", "");
}
$this->setVariable("IMG_HEADER", $this->icon_path);
$header = true;
}
if ($this->title != "")
{
$this->title = ilUtil::stripScriptHTML($this->title);
$this->setVariable("HEADER", $this->title);
$header = true;
}
if ($header)
{
$this->setCurrentBlock("header_image");
}
if ($this->title_desc != "")
{
$this->setCurrentBlock("header_desc");
$this->setVariable("H_DESCRIPTION", $this->title_desc);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillJavaScriptFiles ( )

Definition at line 439 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 575 of file class.ilTemplate.php.

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

{
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=1; $i<=3; $i++)
{
reset($this->js_files);
foreach($this->js_files as $file)
{
if (is_file($file) || substr($file, 0, 4) == "http" || $a_force)
{
if ($this->js_files_batch[$file] == $i)
{
$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:

ilTemplate::fillLeftContent ( )
private

Fill left content.

Definition at line 1479 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_content) != "")
{
$this->setCurrentBlock("left_column");
$this->setVariable("LEFT_CONTENT", $this->left_content);
$this->touchBlock("left_columnt");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillMainContent ( )
private

Fill main content.

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

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

Referenced by get(), and show().

{
if (trim($this->main_content) != "")
{
$this->setVariable("ADM_CONTENT", $this->main_content);
}
if($this->adv_layout)
{
$this->touchBlock("adv_layout_init");
$this->setVariable("COL_LAY_SKIN", " yui-skin-sam");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillMainMenu ( )

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

References $currentTime, $ilAuth, $ilCtrl, $ilSetting, $lng, $tpl, ilTemplate(), and variableExists().

Referenced by get(), and show().

{
global $tpl, $ilMainMenu, $ilCtrl, $ilSetting, $ilUser;
$tpl->setVariable("MAINMENU", $this->main_menu);
if($this->variableExists('MAINMENU'))
{
global $ilAuth, $lng, $tpl, $ilClientIniFile, $ilUser;
if((int)$ilSetting->get('session_handling_type') == 0 &&
(int)$ilSetting->get('session_reminder_enabled') &&
$ilUser->getId() != ANONYMOUS_USER_ID &&
(int)$ilUser->getPref('session_reminder_enabled'))
{
$leadTime = (float)$ilUser->getPref('session_reminder_lead_time') * 60;
$expiresTime = $ilAuth->sessionValidThru();
$currentTime = time();
$expiresInXSeconds = $expiresTime - $currentTime;
if($leadTime > $expiresInXSeconds) return;
$tplSR = new ilTemplate('tpl.SessionReminder.js', true, true);
$tplSR->setVariable('ILIAS_SESSION_COUNTDOWN', ($expiresInXSeconds - $leadTime) * 1000);
$tplSR->setVariable('ILIAS_SESSION_EXTENDER_URL', './ilias.php?baseClass=ilPersonalDesktopGUI');
$tplSR->setVariable('ILIAS_SESSION_CHECKER_URL',
'./sessioncheck.php'.
'?lang='.$lng->getLangKey().
'&client_id='.CLIENT_ID.
'&session_id='.session_id().
'&lead_time='.$leadTime.
'&timezone='.urlencode($ilUser->getTimeZone()).
'&countDownTime='.($expiresInXSeconds - $leadTime));
$tplSR->setVariable('CONFIRM_TXT', $lng->txt('session_reminder_alert'));
$tpl->setVariable('SESSION_REMINDER', $tplSR->get());
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillMessage ( )

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

References $_SESSION, $lng, $out, 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 365 of file class.ilTemplate.php.

References $_SESSION, $lng, $out, ilUtil\getImagePath(), 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 = ($_SESSION[$m] != "")
? $_SESSION[$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->setVariable("ALT_IMAGE", $lng->txt("icon")." ".$lng->txt($m."_message"));
$mtpl->setVariable("SRC_IMAGE", ilUtil::getImagePath("mess_".$m.".gif"));
$mtpl->parseCurrentBlock();
$out.= $mtpl->get();
}
if ($m == "question")
{
$m = "mess_question";
}
if ($_SESSION[$m])
{
session_unregister($m);
}
}
if ($out != "")
{
$this->setVariable("MESSAGE", $out);
}
}

+ Here is the call graph for this function:

ilTemplate::fillNewContentStyle ( )
private

Fill Content Style.

Definition at line 659 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 1883 of file class.ilTemplate.php.

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

Referenced by get(), and show().

{
if (is_array($this->on_load_code))
{
$this->setCurrentBlock("on_load_code");
foreach ($this->on_load_code 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 564 of file class.ilTemplate.php.

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

Referenced by get(), and show().

{
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 1866 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 1457 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->right_content) != "")
{
$this->setCurrentBlock("right_column");
$this->setVariable("RIGHT_CONTENT", $this->right_content);
$this->touchBlock("right_columnt");
}
}

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

References touchBlock().

Referenced by get(), and show().

{
global $ilUser;
if (is_object($ilUser) && $ilUser->getPref("screen_reader_optimization"))
{
$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 1566 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(), 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
if ($this->upper_icon != "")
{
if ($this->upper_icon_frame != "")
{
$this->setCurrentBlock("target_top");
$this->setVariable("TARGET_TOP", $this->upper_icon_frame);
}
$this->setCurrentBlock("alt_top");
$this->setVariable("ALT_TOP", $lng->txt("up"));
$this->setCurrentBlock("top");
$this->setVariable("LINK_TOP", $this->upper_icon);
$this->setVariable("IMG_TOP",ilUtil::getImagePath("ic_top.gif"));
}
// tree/flat icon
if ($this->tree_flat_link != "")
{
$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("ic_sidebar_left.gif"));
$this->setVariable("RIGHT", "Right");
}
else
{
$this->setVariable("IMG_TREE",ilUtil::getImagePath("ic_sidebar_right.gif"));
$this->setVariable("RIGHT", "Right");
}
}
else
{
if ($this->tree_flat_mode == "tree")
{
$this->setVariable("IMG_TREE",ilUtil::getImagePath("ic_sidebar_right.gif"));
}
else
{
$this->setVariable("IMG_TREE",ilUtil::getImagePath("ic_sidebar_left.gif"));
}
}
$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.gif"));
$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 1411 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 525 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"))
{
$sthtml = $ilTabs->getSubTabHTML();
$thtml = $ilTabs->getHTML((trim($sthtml) == ""));
$this->touchBlock("tabs_outer_start");
$this->touchBlock("tabs_outer_end");
$this->touchBlock("tabs_inner_start");
$this->touchBlock("tabs_inner_end");
if ($thtml != "")
{
$this->setVariable("TABS",$thtml);
}
$this->setVariable("SUB_TABS", $sthtml);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillToolbar ( )

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

References HTML_Template_IT\setVariable().

Referenced by get(), and show().

{
global $ilToolbar;
$this->setVariable("BUTTONS", $ilToolbar->getHTML());
}

+ 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 976 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 503 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 188 of file class.ilTemplate.php.

References addILIASFooter(), blockExists(), fillAdminPanel(), fillBodyClass(), fillContentLanguage(), fillContentStyle(), fillCssFiles(), fillHeader(), fillJavaScriptFiles(), fillLeftContent(), fillMainContent(), fillMainMenu(), fillMessage(), fillNewContentStyle(), fillOnLoadCode(), fillPageFormAction(), fillPermanentLink(), fillRightContent(), fillScreenReaderFocus(), fillSideIcons(), fillStopFloating(), fillTabs(), fillToolbar(), fillWindowTitle(), getMainMenu(), handleReferer(), HTML_Template_IT\parseCurrentBlock(), and setCurrentBlock().

Referenced by get().

{
if ($add_error_mess)
{
$this->fillMessage();
}
if ($add_ilias_footer)
{
$this->addILIASFooter();
}
// set standard parts (tabs and title icon)
if($add_standard_elements)
{
// to get also the js files for the main menu
$this->getMainMenu();
// these fill blocks in tpl.main.html
$this->fillCssFiles();
$this->fillContentStyle();
$this->fillBodyClass();
$this->fillOnLoadCode();
// 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->fillRightContent();
$this->fillAdminPanel();
$this->fillToolbar();
// late loading of javascipr files, since operations above may add files
// 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();
}
}
}
if ($handle_referer)
{
$this->handleReferer();
}
if ($part == "DEFAULT")
{
return parent::get();
}
else
{
return parent::get($part);
}
}

+ 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 456 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 166 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 176 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 367 of file class.ilTemplate.php.

References $contenttype.

Referenced by getAsynch(), and show().

{
}

+ Here is the caller graph for this function:

ilTemplate::getLoginTargetPar ( )

Get target parameter for login.

Definition at line 1545 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 667 of file class.ilTemplate.php.

References getLoginTargetPar().

Referenced by get(), and show().

{
global $ilMainMenu;
$ilMainMenu->setLoginTargetPar($this->getLoginTargetPar());
$this->main_menu = $ilMainMenu->getHTML();
}

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

References $lng, ilUtil\getImagePath(), 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->setVariable("ALT_IMAGE", $lng->txt("icon")." ".$lng->txt($a_type."_message"));
$mtpl->setVariable("SRC_IMAGE", ilUtil::getImagePath("mess_".$a_type.".gif"));
$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 346 of file class.ilTemplate.php.

References $lng, ilUtil\getImagePath(), 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->setVariable("ALT_IMAGE", $lng->txt("icon")." ".$lng->txt($a_type."_message"));
$mtpl->setVariable("SRC_IMAGE", ilUtil::getImagePath("mess_".$a_type.".gif"));
$mtpl->parseCurrentBlock();
return $mtpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::getStandardTemplate ( )

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

References addBlockFile().

{
$this->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$this->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
}

+ Here is the call 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 86 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 1231 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."/";
}
}
if ($ilias->account->skin != "default")
{
$fname = "./Customizing/global/skin/".
$ilias->account->skin."/".$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::handleReferer ( )

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

Definition at line 879 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::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 45 of file class.ilTemplate.php.

References $file, ilTemplateX\callConstructor(), getTemplatePath(), HTML_Template_IT\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 64 of file class.ilTemplate.php.

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

Referenced by addILIASFooter(), fillMainMenu(), 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);
// 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 1171 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 1181 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 106 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().

{
$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:

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

References $activeBlock, fillVars(), 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::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 1113 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 1135 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 1149 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 1079 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::setAddFooter (   $value)

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

{
$this->addFooter = $value;
}
ilTemplate::setBodyClass (   $a_class = "")

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

Referenced by ilTemplate().

{
$this->body_class = $a_class;
}

+ Here is the caller graph for this function:

ilTemplate::setContent (   $a_html)

sets content for standard template

Definition at line 1422 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 637 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 382 of file class.ilTemplate.php.

{
$this->contenttype = $a_content_type;
}
ilTemplate::setCreationSelector (   $a_form_action,
  $a_options,
  $a_command,
  $a_txt 
)

Set selection and create button for adding new objects.

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

References setPageFormAction().

{
$this->setPageFormAction($a_form_action);
$this->creation_selector =
array("form_action" => $a_form_action,
"options" => $a_options,
"command" => $a_command,
"txt" => $a_txt);
}

+ Here is the call graph for this function:

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 276 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::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 1003 of file class.ilTemplate.php.

Referenced by fillAdminPanel(), fillBodyClass(), fillContentStyle(), fillCssFiles(), fillHeader(), fillJavaScriptFiles(), fillLeftContent(), fillOnLoadCode(), fillPageFormAction(), fillRightContent(), fillSideIcons(), get(), replaceFromDatabase(), setCurrentBlock(), show(), and touchBlock().

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

+ Here is the caller graph for this function:

ilTemplate::setDescription (   $a_descr)

sets title in standard template

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

{
$this->title_desc = $a_descr;
// $this->setVariable("H_DESCRIPTION", $a_descr);
}
ilTemplate::setEditPageButton (   $a_link,
  $a_txt,
  $a_frame 
)

Show admin view button.

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

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

Definition at line 1279 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 1471 of file class.ilTemplate.php.

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

Insert locator.

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

References $lng, and HTML_Template_IT\setVariable().

{
global $ilLocator, $lng;
$this->setVariable("LOCATOR", $ilLocator->getHTML());
}

+ 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 1537 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 272 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 345 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::setMountWebfolderIcon (   $a_ref_id)

shows icon for mounting a webfolder

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

References $lng.

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

Definition at line 1290 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 1737 of file class.ilTemplate.php.

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

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

Referenced by setCreationSelector().

{
$this->page_form_action = $a_action;
}

+ Here is the caller graph for this function:

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

Definition at line 1854 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 1449 of file class.ilTemplate.php.

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

Definition at line 1285 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 1517 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 1502 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 1304 of file class.ilTemplate.php.

References ilUtil\stripScriptHTML().

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

+ Here is the call graph for this function:

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

set title icon

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

{
$this->icon_desc = $a_icon_desc;
$this->icon_path = $a_icon_path;
}
ilTemplate::setTreeFlatIcon (   $a_link,
  $a_mode 
)

set tree/flat icon

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

Definition at line 1674 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 1525 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 155 of file class.ilTemplate.php.

References $_GET, $_POST, $_SESSION, $out, $path, blockExists(), fillJavaScriptFiles(), getMessageHTML(), HTML_Template_IT\setVariable(), and show().

{
header('Content-type: text/html; charset=UTF-8');
// 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 = ($_SESSION[$m] != "")
? $_SESSION[$m]
: $this->message[$m];
if ($m == "mess_question")
{
$m = "question";
}
if ($txt != "")
{
$out.= $this->getMessageHTML($txt, $m);
}
if ($m == "question")
{
$m = "mess_question";
}
if ($_SESSION[$m])
{
session_unregister($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")))
{
$_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 (preg_match("/cmd=gateway/",$url_parts["query"]))
{
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
{
$_SESSION["referer"] = $_SERVER["REQUEST_URI"];
$_SESSION['referer_ref_id'] = (int) $_GET['ref_id'];
}
unset($_SESSION["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 392 of file class.ilTemplate.php.

References addILIASFooter(), blockExists(), fillAdminPanel(), fillBodyClass(), fillContentLanguage(), fillContentStyle(), fillCssFiles(), fillHeader(), fillJavaScriptFiles(), fillLeftContent(), fillMainContent(), fillMainMenu(), fillMessage(), fillNewContentStyle(), fillOnLoadCode(), fillPageFormAction(), fillPermanentLink(), fillRightContent(), fillScreenReaderFocus(), fillSideIcons(), fillStopFloating(), fillTabs(), fillToolbar(), fillWindowTitle(), getContentType(), getMainMenu(), handleReferer(), ilYuiUtil\initDom(), HTML_Template_IT\parseCurrentBlock(), and setCurrentBlock().

Referenced by show().

{
global $ilias;
// 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)
{
// to get also the js files for the main menu
if (!$a_skip_main_menu)
{
$this->getMainMenu();
}
// these fill blocks in tpl.main.html
$this->fillCssFiles();
//$this->fillJavaScriptFiles();
$this->fillContentStyle();
// these fill just plain placeholder variables in tpl.main.html
$this->setCurrentBlock("DEFAULT");
$this->fillWindowTitle();
$this->fillOnLoadCode();
// these fill blocks in tpl.adm_content.html
$this->fillHeader();
$this->fillSideIcons();
$this->fillStopFloating();
$this->fillLeftContent();
$this->fillRightContent();
$this->fillAdminPanel();
$this->fillToolbar();
// late loading of javascipr files, since operations above may add files
// 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();
}
}
if ($part == "DEFAULT" or is_bool($part))
{
}
else
{
parent::show($part);
}
$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 1403 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 296 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 1023 of file class.ilTemplate.php.

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

Referenced by fillLeftContent(), fillMainContent(), fillPageFormAction(), fillRightContent(), fillScreenReaderFocus(), fillStopFloating(), fillTabs(), 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 965 of file class.ilTemplate.php.

Referenced by fillMainMenu().

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

Referenced by getAddFooter().

ilTemplate::$admin_panel_commands = array()

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

ilTemplate::$adv_layout = false
protected

Definition at line 52 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::$creation_selector = false
protected

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

Referenced by fillAdminPanel().

ilTemplate::$css_files = array()

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

ilTemplate::$il_cache = array()
staticprotected

Definition at line 40 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::$message = ""
protected

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

ilTemplate::$mount_webfolder = ""
protected

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

Referenced by fillSideIcons().

ilTemplate::$page_actions = array()
protected

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

ilTemplate::$page_form_action = ""
protected

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

ilTemplate::$permanent_link = false
protected

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

ilTemplate::$stop_floating = ""
protected

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

ilTemplate::$title_desc = ""
protected

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

ilTemplate::$tree_flat_link = ""
protected

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

ilTemplate::$upper_icon = ""
protected

Definition at line 44 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: