ILIAS  Release_3_10_x_branch Revision 61812
 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)
 constructor
 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)
 ??? public
 addErrorMessage ()
 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)
 public
 fillContentLanguage ()
 Add current user language to meta tags.
 fillWindowTitle ()
 fillTabs ()
 fillPageFormAction ()
 fillJavaScriptFiles ()
 fillCssFiles ()
 setContentStyleSheet ($a_style)
 Set content style (used for page content editor)
 fillContentStyle ()
 Fill Content Style.
 getMainMenu ()
 fillMainMenu ()
 fillHeaderIcon ()
 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
 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
 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)
 Add a javascript file that should be included in the header.
 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.
 setAdminViewButton ($a_link, $a_txt)
 Show admin view button.
 setEditPageButton ($a_link, $a_txt, $a_frame)
 Show admin view button.
 addAdminPanelCommand ($a_cmd, $a_txt)
 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.
 ilTemplate ($root)
 constructor
 show ($part="DEFAULT")
 public
 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 ()
- Public Member Functions inherited from ilTemplateX
 callConstructor ()
 callConstructor ()

Data Fields

 $contenttype
 $vars
 $activeBlock
 $js_files = array(0 => "Services/JavaScript/js/Basic.js")
 $js_files_vp = array("Services/JavaScript/js/Basic.js" => true)
 $css_files = array()
 $admin_panel_commands = array()

Private Member Functions

 fillNewContentStyle ()
 Fill Content Style.
 fillTitle ()
 Fill title.
 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 22106 2009-10-13 20:35:20Z akill
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 15047 2007-10-20 10:11:42Z akill

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

Member Function Documentation

ilTemplate::addAdminPanelCommand (   $a_cmd,
  $a_txt 
)

Add a command to the admin panel.

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

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

References getTemplatePath().

Referenced by addErrorMessage(), addILIASFooter(), getStandardTemplate(), and show().

{
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 1345 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::addErrorMessage ( )

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

References $_SESSION, addBlockFile(), and blockExists().

Referenced by get(), and show().

{
// ERROR HANDLER SETS $_GET["message"] IN CASE OF $error_obj->MESSAGE
if ($_SESSION["message"] || $_SESSION["info"])
{
if($this->blockExists("MESSAGE"))
{
$this->addBlockFile("MESSAGE", "message", "tpl.message.html");
# $this->setCurrentBlock("message");
$this->setVariable("MSG", $_SESSION["message"]);
$this->setVariable("INFO", $_SESSION["info"]);
session_unregister("message");
session_unregister("info");
# $this->parseCurrentBlock();
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::addILIASFooter ( )

add ILIAS footer

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

References $_GET, $_SESSION, $d, $GLOBALS, $ilBench, $ilCtrl, $ilSetting, $total, ilObjLanguageAccess\_checkTranslate(), ilObjLanguageExtGUI\_getTranslationLink(), addBlockFile(), ilUtil\appendUrlParameterString(), blockExists(), ilPHP\cloneObject(), DB_FETCHMODE_ASSOC, getAddFooter(), parseCurrentBlock(), setCurrentBlock(), ilUtil\sortArray(), and ilValidatorAdapter\validate().

Referenced by get(), and show().

{
if (!$this->getAddFooter()) return;
global $ilias, $ilClientIniFile, $ilCtrl, $ilDB, $ilSetting;
$this->addBlockFile("FOOTER", "footer", "tpl.footer.html");
$this->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");
$this->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 != "")
{
$this->setVariable("MEMORY_USAGE", $mem_usage);
}
$this->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["_authsession"]["timestamp"]).
", idle: ".date("Y-m-d H:i:s", $_SESSION["_authsession"]["idle"]).
"<br />expire: ".($exp = $ilClientIniFile->readVariable("session","expire")).
" (".($exp/60)."), session ends at: ".
date("Y-m-d H:i:s", $_SESSION["_authsession"]["idle"] + $exp));
if (version_compare(PHP_VERSION,'5','>='))
{
$this->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"]) && $this->blockExists("xhtml_validation"))
{
require_once("Services/XHTMLValidator/classes/class.ilValidatorAdapter.php");
$template2 = ilPHP::cloneObject($this);
//echo "-".ilValidatorAdapter::validate($template2->get(), $_GET["do_dev_validate"])."-";
$this->setCurrentBlock("xhtml_validation");
$this->setVariable("VALIDATION",
ilValidatorAdapter::validate($template2->get("DEFAULT",
false, false, false, true), $_GET["do_dev_validate"]));
}
// controller history
if (is_object($ilCtrl) && $this->blockExists("c_entry") &&
$this->blockExists("call_history"))
{
$hist = $ilCtrl->getCallHistory();
foreach($hist as $entry)
{
$this->setCurrentBlock("c_entry");
$this->setVariable("C_ENTRY", $entry["class"]);
if (is_object($ilDB))
{
$set = $ilDB->query("SELECT file FROM ctrl_classfile WHERE LOWER(class) ".
" = ".$ilDB->quote(strtolower($entry["class"])));
$rec = $set->fetchRow(DB_FETCHMODE_ASSOC);
$add = $entry["mode"]." - ".$entry["cmd"];
if ($rec["file"] != "")
{
$add.= " - ".$rec["file"];
}
$this->setVariable("C_FILE", $add);
}
}
$this->setCurrentBlock("call_history");
// debug hack
$debug = $ilCtrl->getDebug();
foreach($debug as $d)
{
$this->setCurrentBlock("c_entry");
$this->setVariable("C_ENTRY", $d);
}
$this->setCurrentBlock("call_history");
}
// included files
if (is_object($ilCtrl) && $this->blockExists("i_entry") &&
$this->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)
{
$this->setCurrentBlock("i_entry");
$this->setVariable("I_ENTRY", $f["file"]." (".$f["size"]." Bytes, ".round(100 / $total * $f["size"], 2)."%)");
}
$this->setCurrentBlock("i_entry");
$this->setVariable("I_ENTRY", "Total (".$total." Bytes, 100%)");
$this->setCurrentBlock("included_files");
$this->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");
$this->setVariable("ELAPSED_TIME",
", ".number_format($ilBench->getMeasuredTime("Core", "ElapsedTimeUntilFooter"),1).' seconds');
// END Usability: Non-Delos Skins can display the elapsed time in the footer
}

+ 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 150 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 
)

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

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

{
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;
}
}
ilTemplate::blockExists (   $a_blockname)

check if block exists in actual template private

Parameters
stringblockname
Returns
boolean

Definition at line 142 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

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

Referenced by addErrorMessage(), addILIASFooter(), fillJavaScriptFiles(), get(), 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 ($this->blockvariables["content"][$a_blockname] ? true : false) | ($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 940 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::fileExists (   $filename)

check if a file exists public

Returns
boolean

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

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

Referenced by get(), and show().

{
global $lng;
$adm_view_cmp = $adm_cmds = $creation_selector = $adm_view = false;
// admin panel commands
if ((count($this->admin_panel_commands) > 0))
{
foreach($this->admin_panel_commands as $cmd)
{
$this->setCurrentBlock("admin_panel_cmd");
$this->setVariable("PANEL_CMD", $cmd["cmd"]);
$this->setVariable("TXT_PANEL_CMD", $cmd["txt"]);
}
$adm_cmds = true;
}
if ($adm_cmds)
{
$this->setCurrentBlock("adm_view_components");
$this->setVariable("ADM_IMG_ARROW", ilUtil::getImagePath("arrow_upright.gif"));
$this->setVariable("ADM_ALT_ARROW", $lng->txt("actions"));
$adm_view_cmp = true;
}
// admin view button
if (is_array($this->admin_view_button))
{
if (is_array($this->edit_page_button))
{
$this->setCurrentBlock("edit_cmd");
$this->setVariable("TXT_EDIT_PAGE", $this->edit_page_button["txt"]);
$this->setVariable("LINK_EDIT_PAGE", $this->edit_page_button["link"]);
$this->setVariable("FRAME_EDIT_PAGE", $this->edit_page_button["frame"]);
}
if (is_array($this->admin_view_button))
{
$this->setCurrentBlock("admin_button");
$this->setVariable("ADMIN_MODE_LINK",
$this->admin_view_button["link"]);
$this->setVariable("TXT_ADMIN_MODE",
$this->admin_view_button["txt"]);
}
$this->setCurrentBlock("admin_view");
$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"');
}
$this->setVariable("SELECT_OBJTYPE_REPOS",
$this->creation_selector["options"]);
$this->setVariable("BTN_NAME_REPOS",
$this->creation_selector["command"]);
$this->setVariable("TXT_ADD_REPOS",
$this->creation_selector["txt"]);
$creation_selector = true;
}
if ($adm_view || $creation_selector)
{
$this->setCurrentBlock("adm_panel");
if ($adm_view_cmp)
{
$this->setVariable("ADM_TBL_WIDTH", 'width:"100%";');
}
}
// lower part of admin panel
if ((count($this->admin_panel_commands) > 0))
{
foreach($this->admin_panel_commands as $cmd)
{
$this->setCurrentBlock("admin_panel_cmd2");
$this->setVariable("PANEL_CMD2", $cmd["cmd"]);
$this->setVariable("TXT_PANEL_CMD2", $cmd["txt"]);
}
$adm_cmds2 = true;
}
if ($adm_cmds2)
{
$this->setCurrentBlock("adm_view_components2");
$this->setVariable("ADM_IMG_ARROW2", ilUtil::getImagePath("arrow_downright.gif"));
$this->setVariable("ADM_ALT_ARROW2", $lng->txt("actions"));
}
}

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

References $lng.

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 caller graph for this function:

ilTemplate::fillContentStyle ( )

Fill Content Style.

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

References parseCurrentBlock(), and setCurrentBlock().

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

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

References $filename, parseCurrentBlock(), and setCurrentBlock().

Referenced by get(), and show().

{
foreach($this->css_files as $css)
{
$filename = $css["file"];
if (strpos($filename, "?") > 0) $filename = substr($filename, 0, strpos($filename, "?"));
if (is_file($filename))
{
$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::fillHeaderIcon ( )

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

References parseCurrentBlock(), and setCurrentBlock().

Referenced by get(), and show().

{
if ($this->icon_path != "")
{
if ($this->icon_desc != "")
{
$this->setCurrentBlock("header_image_desc");
$this->setVariable("IMAGE_DESC", $this->icon_desc);
}
$this->setCurrentBlock("header_image");
$this->setVariable("IMG_HEADER", $this->icon_path);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTemplate::fillJavaScriptFiles ( )

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

References $file, blockExists(), parseCurrentBlock(), and setCurrentBlock().

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

ilTemplate::fillJavaScriptFiles ( )

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

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

Referenced by get(), and show().

{
global $ilias,$ilTabs,$ilSetting;
if (is_object($ilSetting)) // maybe this one can be removed
{
$vers = "vers=".str_replace(array(".", " "), "-", $ilSetting->get("ilias_version"));
}
if ($this->blockExists("js_file"))
{
foreach($this->js_files as $file)
{
if (is_file($file) || substr($file, 0, 4) == "http")
{
$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::fillLeftContent ( )
private

Fill left content.

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

References parseCurrentBlock(), and setCurrentBlock().

Referenced by get(), and show().

{
if (trim($this->left_content) != "")
{
$this->setCurrentBlock("left_column");
$this->setVariable("LEFT_CONTENT", $this->left_content);
}
}

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

Referenced by get(), and show().

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

+ Here is the caller graph for this function:

ilTemplate::fillMainMenu ( )

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

References $tpl.

Referenced by get(), and show().

{
global $tpl, $ilMainMenu;
$tpl->setVariable("MAINMENU", $this->main_menu);
}

+ Here is the caller graph for this function:

ilTemplate::fillNewContentStyle ( )
private

Fill Content Style.

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

References ilUtil\getNewContentStyleSheetLocation().

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

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

References parseCurrentBlock(), setCurrentBlock(), 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 1514 of file class.ilTemplate.php.

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 caller graph for this function:

ilTemplate::fillRightContent ( )
private

Fill right content.

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

References parseCurrentBlock(), and setCurrentBlock().

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

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

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

References $lng, ilFrameTargetInfo\_getFrame(), ilUtil\getImagePath(), parseCurrentBlock(), and setCurrentBlock().

Referenced by get(), and show().

{
global $lng;
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);
$this->setVariable("IMG_TREE",ilUtil::getImagePath("ic_".$this->tree_flat_mode."view.gif"));
$this->setVariable("ALT_TREE",$lng->txt($this->tree_flat_mode."view"));
$this->setVariable("TARGET_TREE", ilFrameTargetInfo::_getFrame("MainContent"));
}
// mount webfolder
if ($this->mount_webfolder != "")
{
require_once('Services/WebDAV/classes/class.ilDAVServer.php');
$davServer = new ilDAVServer();
$a_ref_id = $this->mount_webfolder;
$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 1130 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 401 of file class.ilTemplate.php.

Referenced by get(), and show().

{
global $ilias,$ilTabs;
$this->setVariable("TABS",$ilTabs->getHTML());
$this->setVariable("SUB_TABS",$ilTabs->getSubTabHTML());
}

+ Here is the caller graph for this function:

ilTemplate::fillTitle ( )
private

Fill title.

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

Referenced by get(), and show().

{
if ($this->title != "")
{
$this->setVariable("HEADER", $this->title);
}
}

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

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 caller graph for this function:

ilTemplate::fillWindowTitle ( )

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

References $ilSetting.

Referenced by get(), and show().

{
global $ilSetting;
if ($this->header_page_title != "")
{
$this->setVariable("PAGETITLE", "- ".$this->header_page_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 caller graph for this function:

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

??? public

Parameters
string
Returns
string

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

References addErrorMessage(), addILIASFooter(), blockExists(), fillAdminPanel(), fillContentLanguage(), fillContentStyle(), fillCssFiles(), fillHeaderIcon(), fillJavaScriptFiles(), fillLeftContent(), fillMainContent(), fillMainMenu(), fillNewContentStyle(), fillPageFormAction(), fillPermanentLink(), fillRightContent(), fillSideIcons(), fillStopFloating(), fillTabs(), fillTitle(), fillWindowTitle(), getMainMenu(), handleReferer(), parseCurrentBlock(), and setCurrentBlock().

{
if ($add_error_mess)
{
$this->addErrorMessage();
}
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();
// these fill just plain placeholder variables in tpl.main.html
$this->setCurrentBlock("DEFAULT");
$this->fillWindowTitle();
// these fill blocks in tpl.adm_content.html
$this->fillHeaderIcon();
$this->fillSideIcons();
$this->fillStopFloating();
$this->fillLeftContent();
$this->fillRightContent();
$this->fillAdminPanel();
// these fill just plain placeholder variables in tpl.adm_content.html
if ($this->blockExists("content"))
{
$this->setCurrentBlock("content");
$this->fillTabs();
$this->fillMainContent();
$this->fillTitle();
$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:

ilTemplate::getAddFooter ( )

Definition at line 140 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 150 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 258 of file class.ilTemplate.php.

References $contenttype.

Referenced by getAsynch(), and show().

{
}

+ Here is the caller graph for this function:

ilTemplate::getMainMenu ( )

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

Referenced by get(), and show().

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

+ Here is the caller graph for this function:

ilTemplate::getStandardTemplate ( )

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

References $_GET, $ilCtrl, and ILIAS_MODULE.

Referenced by addBlockFile(), and ilTemplate().

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

References $_SESSION.

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 (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"]);
}
else if (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"]);
}
else
{
$_SESSION["referer"] = $_SERVER["REQUEST_URI"];
}
unset($_SESSION["error_post_vars"]);
}
}

+ Here is the caller graph for this function:

ilTemplate::ilTemplate (   $root)

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

References ilTemplateX\callConstructor().

{
$this->callConstructor();
$this->setRoot($root);
return true;
}

+ Here is the call graph for this function:

ilTemplate::ilTemplate (   $file,
  $flag1,
  $flag2,
  $in_module = false,
  $vars = "DEFAULT",
  $plugin = 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 68 of file class.ilTemplate.php.

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

{
global $ilias;
$this->activeBlock = "__global__";
$this->vars = array();
$this->addFooter = TRUE;
/*
if (strpos($file,"/") === false)
{
//$fname = $ilias->tplPath;
$base = "./";
if ($module != "")
{
$base.= $module."/";
}
$base .= "templates/";
$fname = $base.$ilias->account->skin."/".basename($file);
if(!file_exists($fname))
{
$fname .= $base."default/".basename($file);
}
}
else
{
$fname = $file;
}*/
$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);
}
return true;
}

+ Here is the call graph for this function:

ilTemplate::includeNavigation ( )

check if there is a NAVIGATION-topic public

Returns
boolean

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

References checkTopic().

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

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

References $activeBlock, and fillVars().

Referenced by addILIASFooter(), fillAdminPanel(), fillContentStyle(), fillCssFiles(), fillHeaderIcon(), fillJavaScriptFiles(), fillLeftContent(), fillPageFormAction(), fillRightContent(), fillSideIcons(), get(), replaceFromDatabase(), show(), and touchBlock().

{
// 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 892 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 914 of file class.ilTemplate.php.

Referenced by replaceDefault(), and replaceFromDatabase().

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

+ Here is the caller graph for this function:

ilTemplate::replaceDefault ( )

??? public

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

References $res, $result, 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 130 of file class.ilTemplate.php.

{
$this->addFooter = $value;
}
ilTemplate::setAdminViewButton (   $a_link,
  $a_txt 
)

Show admin view button.

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

{
$this->admin_view_button =
array("link" => $a_link, "txt" => $a_txt);
}
ilTemplate::setContent (   $a_html)

sets content for standard template

Definition at line 1141 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 470 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 273 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 1356 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
???

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

Referenced by addILIASFooter(), fillAdminPanel(), fillContentStyle(), fillCssFiles(), fillHeaderIcon(), fillJavaScriptFiles(), fillLeftContent(), fillPageFormAction(), fillRightContent(), fillSideIcons(), get(), replaceFromDatabase(), 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 1114 of file class.ilTemplate.php.

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

Show admin view button.

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

{
$this->header_page_title = $a_title;
}
ilTemplate::setLeftContent (   $a_html)

sets content of left column

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

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

Insert locator.

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

References $lng.

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

shows icon for mounting a webfolder

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

References $lng.

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

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

{
$this->setVariable("LOCATION_NEWCONTENT_STYLESHEET", $a_stylesheet);
}
ilTemplate::setPageFormAction (   $a_action)

Definition at line 1106 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 1502 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 1163 of file class.ilTemplate.php.

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

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

{
$this->setVariable("LOCATION_STYLESHEET", $a_stylesheet);
}
ilTemplate::setSubTabs (   $a_tabs_html)

sets subtabs in standard template

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

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

sets tabs in standard template

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

{
$this->setVariable("TABS", $a_tabs_html);
}
ilTemplate::setTitle (   $a_title)

sets title in standard template

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

{
$this->title = $a_title;
$this->header_page_title = $a_title;
}
ilTemplate::setTitleIcon (   $a_icon_path,
  $a_icon_desc = "" 
)

set title icon

Definition at line 1100 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 1322 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 1231 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

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

References $_SESSION, addBlockFile(), blockExists(), fillJavaScriptFiles(), and show().

{
header('Content-type: text/html; charset=UTF-8');
// ERROR HANDLER SETS $_GET["message"] IN CASE OF $error_obj->MESSAGE
if ($_SESSION["message"] || $_SESSION["info"])
{
if ($this->blockExists("MESSAGE"))
{
$this->addBlockFile("MESSAGE", "message", "tpl.message.html");
# $this->setCurrentBlock("message");
$this->setVariable("MSG", $_SESSION["message"]);
$this->setVariable("INFO", $_SESSION["info"]);
session_unregister("message");
session_unregister("info");
# $this->parseCurrentBlock();
}
}
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 (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"]);
}
else
{
$_SESSION["referer"] = $_SERVER["REQUEST_URI"];
}
unset($_SESSION["error_post_vars"]);
}
}

+ Here is the call graph for this function:

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

public

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

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

References addErrorMessage(), addILIASFooter(), blockExists(), fillAdminPanel(), fillContentLanguage(), fillContentStyle(), fillCssFiles(), fillHeaderIcon(), fillJavaScriptFiles(), fillLeftContent(), fillMainContent(), fillMainMenu(), fillNewContentStyle(), fillPageFormAction(), fillPermanentLink(), fillRightContent(), fillSideIcons(), fillStopFloating(), fillTabs(), fillTitle(), fillWindowTitle(), getContentType(), getMainMenu(), handleReferer(), parseCurrentBlock(), and setCurrentBlock().

Referenced by show().

{
global $ilias;
//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->addErrorMessage();
// display ILIAS footer
if ($part !== false)
{
$this->addILIASFooter();
}
// set standard parts (tabs and title icon)
if ($a_fill_tabs)
{
// to get also the js files for the main menu
$this->getMainMenu();
// these fill blocks in tpl.main.html
$this->fillCssFiles();
$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->fillHeaderIcon();
$this->fillSideIcons();
$this->fillStopFloating();
$this->fillLeftContent();
$this->fillRightContent();
$this->fillAdminPanel();
// 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->fillTitle();
$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 1122 of file class.ilTemplate.php.

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

overwrites ITX::touchBlock.

public

Parameters
string
Returns
???

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

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

Referenced by fillPageFormAction(), and fillStopFloating().

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

Field Documentation

ilTemplate::$activeBlock

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

Referenced by parseCurrentBlock().

ilTemplate::$addFooter
private

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

Referenced by getAddFooter().

ilTemplate::$admin_panel_commands = array()

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

ilTemplate::$contenttype

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

Referenced by getContentType().

ilTemplate::$css_files = array()

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

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

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

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

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

ilTemplate::$vars

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

Referenced by prepareForFormular().


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