32 var
$js_files = array(0 =>
"Services/JavaScript/js/Basic.js");
33 var
$js_files_vp = array(
"Services/JavaScript/js/Basic.js" =>
true);
65 $plugin =
false, $a_use_cache =
false)
69 $this->activeBlock =
"__global__";
70 $this->vars = array();
71 $this->addFooter = TRUE;
73 $this->il_use_cache = $a_use_cache;
74 $this->il_cur_key =
$file.
"/".$in_module;
78 $this->tplName = basename($fname);
79 $this->tplPath = dirname($fname);
81 $this->contenttype =
"text/html";
82 if (!file_exists($fname))
84 $ilias->raiseError(
"template ".$fname.
" was not found.", $ilias->error_obj->FATAL);
93 $this->vars[
"TPLPATH"] = $this->tplPath;
96 if (method_exists($this,
"setOption"))
112 if ($this->il_use_cache)
115 if (isset(self::$il_cache[$this->il_cur_key]) && is_array(self::$il_cache[$this->il_cur_key]))
119 $this->err = self::$il_cache[$this->il_cur_key][
"err"];
120 $this->flagBlocktrouble = self::$il_cache[$this->il_cur_key][
"flagBlocktrouble"];
121 $this->blocklist = self::$il_cache[$this->il_cur_key][
"blocklist"];
122 $this->blockdata = self::$il_cache[$this->il_cur_key][
"blockdata"];
123 $this->blockinner = self::$il_cache[$this->il_cur_key][
"blockinner"];
124 $this->blockparents = self::$il_cache[$this->il_cur_key][
"blockparents"];
125 $this->blockvariables = self::$il_cache[$this->il_cur_key][
"blockvariables"];
132 $this->
template =
'';
134 if ($this->il_use_cache)
136 self::$il_cache[$this->il_cur_key][
"err"] =
$this->err;
141 self::$il_cache[$this->il_cur_key][
"blockparents"] = $this->blockparents;
147 $this->
template =
'';
158 $this->addFooter = $value;
178 header(
"Content-type: " . $this->
getContentType() .
"; charset=UTF-8");
188 function get($part =
"DEFAULT", $add_error_mess =
false,
189 $handle_referer =
false, $add_ilias_footer =
false,
190 $add_standard_elements =
false, $a_main_menu =
true, $a_tabs =
true)
197 if ($add_ilias_footer)
203 if($add_standard_elements)
258 if ($part ==
"DEFAULT")
275 if (!in_array($a_type, array(
"info",
"success",
"failure",
"question")) || $a_txt ==
"")
279 if ($a_type ==
"question")
281 $a_type =
"mess_question";
285 $this->message[$a_type] = $a_txt;
297 $ms = array(
"info",
"success",
"failure",
"question");
303 if ($m ==
"question")
305 $m =
"mess_question";
312 else if (isset($this->message[$m]))
314 $txt = $this->message[$m];
317 if ($m ==
"mess_question")
327 if ($m ==
"question")
329 $m =
"mess_question";
352 $mtpl =
new ilTemplate(
"tpl.message.html",
true,
true,
"Services/Utilities");
353 $mtpl->setCurrentBlock($a_type.
"_message");
354 $mtpl->setVariable(
"TEXT", $a_txt);
355 $mtpl->setVariable(
"MESSAGE_HEADING", $lng->txt($a_type.
"_message"));
356 $mtpl->setVariable(
"ALT_IMAGE", $lng->txt(
"icon").
" ".$lng->txt($a_type.
"_message"));
358 $mtpl->parseCurrentBlock();
386 $this->contenttype = $a_content_type;
394 function show($part =
"DEFAULT", $a_fill_tabs =
true, $a_skip_main_menu =
false)
398 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
404 header(
'P3P: CP="CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa OUR BUS IND UNI COM NAV INT CNT STA PRE"');
405 header(
"Content-type: " . $this->
getContentType() .
"; charset=UTF-8");
420 if (!$a_skip_main_menu)
465 if ($part ==
"DEFAULT" or is_bool($part))
487 if(is_object($ilUser))
489 if($ilUser->getLanguage())
491 $this->
setVariable(
'META_CONTENT_LANGUAGE',$ilUser->getLanguage());
496 $this->
setVariable(
'META_CONTENT_LANGUAGE',$lng->getDefaultLanguage());
508 if ($this->header_page_title !=
"")
514 if ($ilSetting->get(
'short_inst_name') !=
"")
517 $ilSetting->get(
'short_inst_name'));
528 global $ilias,$ilTabs;
532 $sthtml = $ilTabs->getSubTabHTML();
533 $thtml = $ilTabs->getHTML((trim($sthtml) ==
""));
553 $this->adv_layout =
true;
554 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
562 $this->
setVariable(
"BUTTONS", $ilToolbar->getHTML());
567 if ($this->page_form_action !=
"")
570 $this->
setVariable(
"PAGE_FORM_ACTION", $this->page_form_action);
580 if (is_object($ilSetting))
582 $vers =
"vers=".str_replace(array(
".",
" "),
"-", $ilSetting->get(
"ilias_version"));
587 for ($i=1; $i<=3; $i++)
589 reset($this->js_files);
590 foreach($this->js_files as
$file)
592 if (is_file($file) || substr($file, 0, 4) ==
"http" || $a_force)
594 if ($this->js_files_batch[$file] == $i)
598 if ($this->js_files_vp[$file])
621 foreach($this->css_files as $css)
640 $this->content_style_sheet = $a_style;
648 if ($this->content_style_sheet !=
"")
652 $this->content_style_sheet);
662 $this->
setVariable(
"LOCATION_NEWCONTENT_STYLESHEET_TAG",
663 '<link rel="stylesheet" type="text/css" href="'.
673 $this->main_menu = $ilMainMenu->getHTML();
679 $tpl->setVariable(
"MAINMENU", $this->main_menu);
682 global $ilAuth,
$lng,
$tpl, $ilClientIniFile, $ilUser;
684 if((
int)$ilSetting->get(
'session_handling_type') == 0 &&
685 (int)$ilSetting->get(
'session_reminder_enabled') &&
686 $ilUser->getId() != ANONYMOUS_USER_ID &&
687 (int)$ilUser->getPref(
'session_reminder_enabled'))
689 $leadTime = (float)$ilUser->getPref(
'session_reminder_lead_time') * 60;
690 $expiresTime = $ilAuth->sessionValidThru();
694 if($leadTime > $expiresInXSeconds)
return;
696 $tplSR =
new ilTemplate(
'tpl.SessionReminder.js',
true,
true);
698 $tplSR->setVariable(
'ILIAS_SESSION_COUNTDOWN', ($expiresInXSeconds - $leadTime) * 1000);
699 $tplSR->setVariable(
'ILIAS_SESSION_EXTENDER_URL',
'./ilias.php?baseClass=ilPersonalDesktopGUI');
700 $tplSR->setVariable(
'ILIAS_SESSION_CHECKER_URL',
701 './sessioncheck.php'.
702 '?lang='.$lng->getLangKey().
703 '&client_id='.CLIENT_ID.
704 '&session_id='.session_id().
705 '&lead_time='.$leadTime.
706 '&timezone='.urlencode($ilUser->getTimeZone()).
707 '&countDownTime='.($expiresInXSeconds - $leadTime));
708 $tplSR->setVariable(
'CONFIRM_TXT', $lng->txt(
'session_reminder_alert'));
710 $tpl->setVariable(
'SESSION_REMINDER', $tplSR->get());
725 $ftpl =
new ilTemplate(
"tpl.footer.html",
true,
true);
727 $ftpl->setVariable(
"ILIAS_VERSION", $ilias->getSetting(
"ilias_version"));
730 if ($ilSetting->get(
"lang_ext_maintenance") ==
"1")
732 include_once(
"Services/Language/classes/class.ilObjLanguageAccess.php");
735 include_once(
"Services/Language/classes/class.ilObjLanguageExtGUI.php");
736 $ftpl->setVariable(
"TRANSLATION_LINK",
744 $t1 = explode(
" ",
$GLOBALS[
'ilGlobalStartTime']);
745 $t2 = explode(
" ", microtime());
746 $diff = $t2[0] - $t1[0] + $t2[1] - $t1[1];
749 if(function_exists(
"memory_get_usage"))
752 "<br /> Memory Usage: ".memory_get_usage().
" Bytes";
754 if(function_exists(
"xdebug_peak_memory_usage"))
757 "<br /> XDebug Peak Memory Usage: ".xdebug_peak_memory_usage().
" Bytes";
759 $mem_usage.=
"<br>".round(
$diff, 4).
" Seconds";
761 if ($mem_usage !=
"")
763 $ftpl->setVariable(
"MEMORY_USAGE", $mem_usage);
766 if (is_object($ilAuth) && isset(
$_SESSION[$ilAuth->_sessionName]) &&
767 isset(
$_SESSION[$ilAuth->_sessionName][
"timestamp"]))
769 $ftpl->setVariable(
"SESS_INFO",
"<br />maxlifetime: ".
770 ini_get(
"session.gc_maxlifetime").
" (".
771 (ini_get(
"session.gc_maxlifetime")/60).
"), id: ".session_id().
"<br />".
772 "timestamp: ".date(
"Y-m-d H:i:s",
$_SESSION[$ilAuth->_sessionName][
"timestamp"]).
773 ", idle: ".date(
"Y-m-d H:i:s",
$_SESSION[$ilAuth->_sessionName][
"idle"]).
774 "<br />expire: ".($exp = $ilClientIniFile->readVariable(
"session",
"expire")).
775 " (".($exp/60).
"), session ends at: ".
776 date(
"Y-m-d H:i:s",
$_SESSION[$ilAuth->_sessionName][
"idle"] + $exp));
779 if (version_compare(PHP_VERSION,
'5',
'>='))
781 $ftpl->setVariable(
"VALIDATION_LINKS",
784 '">Validate</a> | <a href="'.
786 '">Accessibility</a>');
788 if (!empty(
$_GET[
"do_dev_validate"]) && $ftpl->blockExists(
"xhtml_validation"))
790 require_once(
"Services/XHTMLValidator/classes/class.ilValidatorAdapter.php");
793 $ftpl->setCurrentBlock(
"xhtml_validation");
794 $ftpl->setVariable(
"VALIDATION",
796 false,
false,
false,
true),
$_GET[
"do_dev_validate"]));
797 $ftpl->parseCurrentBlock();
801 if (is_object($ilCtrl) && $ftpl->blockExists(
"c_entry") &&
802 $ftpl->blockExists(
"call_history"))
804 $hist = $ilCtrl->getCallHistory();
805 foreach($hist as $entry)
807 $ftpl->setCurrentBlock(
"c_entry");
808 $ftpl->setVariable(
"C_ENTRY", $entry[
"class"]);
809 if (is_object($ilDB))
811 $file = $ilCtrl->lookupClassPath($entry[
"class"]);
812 $add = $entry[
"mode"].
" - ".$entry[
"cmd"];
817 $ftpl->setVariable(
"C_FILE", $add);
819 $ftpl->parseCurrentBlock();
821 $ftpl->setCurrentBlock(
"call_history");
822 $ftpl->parseCurrentBlock();
825 $debug = $ilCtrl->getDebug();
826 foreach($debug as
$d)
828 $ftpl->setCurrentBlock(
"c_entry");
829 $ftpl->setVariable(
"C_ENTRY", $d);
830 $ftpl->parseCurrentBlock();
832 $ftpl->setCurrentBlock(
"call_history");
833 $ftpl->parseCurrentBlock();
837 if (is_object($ilCtrl) && $ftpl->blockExists(
"i_entry") &&
838 $ftpl->blockExists(
"included_files"))
840 $fs = get_included_files();
845 $ifiles[] = array(
"file" => $f,
"size" => filesize($f));
849 foreach($ifiles as $f)
851 $ftpl->setCurrentBlock(
"i_entry");
852 $ftpl->setVariable(
"I_ENTRY", $f[
"file"].
" (".$f[
"size"].
" Bytes, ".round(100 /
$total * $f[
"size"], 2).
"%)");
853 $ftpl->parseCurrentBlock();
855 $ftpl->setCurrentBlock(
"i_entry");
856 $ftpl->setVariable(
"I_ENTRY",
"Total (".
$total.
" Bytes, 100%)");
857 $ftpl->parseCurrentBlock();
858 $ftpl->setCurrentBlock(
"included_files");
859 $ftpl->parseCurrentBlock();
867 $ilBench->stop(
"Core",
"ElapsedTimeUntilFooter");
868 $ftpl->setVariable(
"ELAPSED_TIME",
869 ", ".number_format($ilBench->getMeasuredTime(
"Core",
"ElapsedTimeUntilFooter"),1).
' seconds');
882 if ((substr(strrchr($_SERVER[
"PHP_SELF"],
"/"),1) !=
"error.php")
883 && (substr(strrchr($_SERVER[
"PHP_SELF"],
"/"),1) !=
"adm_menu.php"))
889 $url_parts = @parse_url($_SERVER[
"REQUEST_URI"]);
892 $protocol = (isset($_SERVER[
'HTTPS']) ?
'https' :
'http').
'://';
893 $host = $_SERVER[
'HTTP_HOST'];
894 $path = $_SERVER[
'REQUEST_URI'];
895 $url_parts = @parse_url($protocol.$host.$path);
898 if (isset($url_parts[
"query"]) && preg_match(
"/cmd=gateway/",$url_parts[
"query"]) && (isset(
$_POST[
"cmd"][
"create"])))
900 foreach (
$_POST as $key => $val)
907 $str .=
"&".$key.
"=".$val;
910 $_SESSION[
"referer"] = preg_replace(
"/cmd=gateway/",substr($str,1),$_SERVER[
"REQUEST_URI"]);
914 else if (isset($url_parts[
"query"]) && preg_match(
"/cmd=post/",$url_parts[
"query"]) && (isset(
$_POST[
"cmd"][
"create"])))
916 foreach (
$_POST as $key => $val)
923 $str .=
"&".$key.
"=".$val;
926 $_SESSION[
"referer"] = preg_replace(
"/cmd=post/",substr($str,1),$_SERVER[
"REQUEST_URI"]);
927 if (isset(
$_GET[
'ref_id']))
938 $_SESSION[
"referer"] = $_SERVER[
"REQUEST_URI"];
939 if (isset(
$_GET[
'ref_id']))
962 return (isset($this->blockvariables[
"content"][$a_blockname]) ?
true :
false) | (isset($this->blockvariables[$a_blockname]) ?
true :
false);
967 return (isset($this->blockvariables[
"content"][$a_variablename]) ?
true :
false);
981 while(list($key, $val) = each($this->vars))
983 if (is_array($this->blockvariables[$this->activeBlock]))
985 if (array_key_exists($key, $this->blockvariables[$this->activeBlock]))
1005 $this->activeBlock = $part;
1007 if ($part ==
"DEFAULT")
1044 if ($part !=
"DEFAULT")
1047 $this->activeBlock = $part;
1050 if ($part !=
"DEFAULT")
1052 $this->activeBlock = $tmp;
1057 $this->activeBlock =
"__global__";
1059 if ($part ==
"DEFAULT")
1081 $res = $DB->selectDbAll();
1083 while ($DB->getDbNextElement(
$res))
1089 while (list ($key,$val) = each ($conv))
1091 $result[$val]=$DB->element->data[$key];
1094 if (($select !=
"default")
1095 && ($DB->element->data[$select[
"id"]]==$select[
"value"]
1096 || (strtolower($select[
"text"]) ==
"checked"
1097 && strpos(
",,".$select[
"value"].
",," ,
",".$DB->element->data[$select[
"id"]].
"," )!=
false)))
1099 $result[$select[
"field"]] = $select[
"text"];
1115 if (!is_array(
$vars))
1122 while (list($i) = each(
$vars))
1139 while(list($key, $val) = each($this->vars))
1163 return array_key_exists($a_topic, $this->blockvariables[$a_block]);
1173 return $this->
checkTopic(
"__global__",
"NAVIGATION");
1183 return $this->
checkTopic(
"__global__",
"TREE");
1193 return file_exists($this->tplPath.
"/".
$filename);
1210 echo
"<br/>Template '".$this->tplPath.
"/".$tplname.
"'";
1214 if (file_exists($tplfile) ==
false)
1216 echo
"<br/>Template '".$tplfile.
"' doesn't exist! aborting...";
1239 if (!empty(
$_GET[
"baseClass"]) && $a_in_module ===
true)
1241 $a_in_module = $ilCtrl->getModuleDir();
1244 if (strpos($a_tplname,
"/") ===
false)
1251 if ($a_in_module ===
true)
1257 $module_path = $a_in_module.
"/";
1261 if ($ilias->account->skin !=
"default")
1263 $fname =
"./Customizing/global/skin/".
1264 $ilias->account->skin.
"/".$module_path.basename($a_tplname);
1266 if($fname ==
"" || !file_exists($fname))
1268 $fname =
"./".$module_path.
"templates/default/".basename($a_tplname);
1273 $fname = $a_tplname;
1282 $this->header_page_title = $a_title;
1287 $this->
setVariable(
"LOCATION_STYLESHEET", $a_stylesheet);
1292 $this->
setVariable(
"LOCATION_NEWCONTENT_STYLESHEET", $a_stylesheet);
1297 $this->
addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
1298 $this->
addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
1307 $this->header_page_title = $a_title;
1317 if ($this->icon_path !=
"")
1319 if ($this->icon_desc !=
"")
1322 $this->
setVariable(
"IMAGE_DESC", $lng->txt(
"icon").
" ".$this->icon_desc);
1326 if ($this->icon_desc !=
"")
1328 $this->
setVariable(
"IMAGE_ALT", $lng->txt(
"icon").
" ".$this->icon_desc);
1336 $this->
setVariable(
"IMG_HEADER", $this->icon_path);
1341 if ($this->title !=
"")
1354 if ($this->title_desc !=
"")
1357 $this->
setVariable(
"H_DESCRIPTION", $this->title_desc);
1367 $this->icon_desc = $a_icon_desc;
1368 $this->icon_path = $a_icon_path;
1373 $this->body_class = $a_class;
1378 if ($this->body_class !=
"" && $this->
blockExists(
"body_class"))
1381 $this->
setVariable(
"BODY_CLASS", $this->body_class);
1388 $this->page_form_action = $a_action;
1396 $this->title_desc = $a_descr;
1405 $this->stop_floating =
true;
1413 if ($this->stop_floating)
1426 $this->main_content = $a_html;
1435 if (trim($this->main_content) !=
"")
1437 $this->
setVariable(
"ADM_CONTENT", $this->main_content);
1439 if($this->adv_layout)
1442 $this->
setVariable(
"COL_LAY_SKIN",
" yui-skin-sam");
1451 $this->right_content = $a_html;
1459 if (trim($this->right_content) !=
"")
1462 $this->
setVariable(
"RIGHT_CONTENT", $this->right_content);
1473 $this->left_content = $a_html;
1481 if (trim($this->left_content) !=
"")
1484 $this->
setVariable(
"LEFT_CONTENT", $this->left_content);
1495 if (KIOSK_MODE)
return true;
1496 global $ilLocator,
$lng;
1497 $this->
setVariable(
"LOCATOR", $ilLocator->getHTML());
1505 if ($a_tabs_html !=
"" && $this->
blockExists(
"tabs_outer_start"))
1530 $this->upper_icon = $a_link;
1531 $this->upper_icon_frame = $a_frame;
1540 $this->login_target_par = $a_val;
1548 return $this->login_target_par;
1558 if (is_object($ilUser) && $ilUser->getPref(
"screen_reader_optimization"))
1571 if ($this->upper_icon ==
"" && $this->tree_flat_link ==
""
1572 && $this->mount_webfolder ==
"")
1578 if ($this->upper_icon !=
"")
1580 if ($this->upper_icon_frame !=
"")
1583 $this->
setVariable(
"TARGET_TOP", $this->upper_icon_frame);
1592 $this->
setVariable(
"LINK_TOP", $this->upper_icon);
1598 if ($this->tree_flat_link !=
"")
1601 $this->
setVariable(
"LINK_MODE", $this->tree_flat_link);
1602 if ($ilSetting->get(
"tree_frame") ==
"right")
1604 if ($this->tree_flat_mode ==
"tree")
1617 if ($this->tree_flat_mode ==
"tree")
1626 $this->
setVariable(
"ALT_TREE",$lng->txt($this->tree_flat_mode.
"view"));
1628 include_once(
"./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
1637 if ($this->mount_webfolder !=
"")
1639 require_once(
'Services/WebDAV/classes/class.ilDAVServer.php');
1642 $a_link = $davServer->getMountURI($a_ref_id);
1643 $a_folder = $davServer->getFolderURI($a_ref_id);
1646 $this->
setVariable(
"LINK_MOUNT_WEBFOLDER", $a_link);
1647 $this->
setVariable(
"FOLDER_MOUNT_WEBFOLDER", $a_folder);
1649 $this->
setVariable(
"ALT_MOUNT_WEBFOLDER",$lng->txt(
"mount_webfolder"));
1650 $this->
setVariable(
"TARGET_MOUNT_WEBFOLDER",
'_blank');
1666 $this->mount_webfolder = $a_ref_id;
1679 $this->tree_flat_link = $a_link;
1680 $this->tree_flat_mode = $a_mode;
1686 function addJavaScript($a_js_file, $a_add_version_parameter =
true, $a_batch = 2)
1689 if ($a_batch < 1 || $a_batch > 3)
1693 if (!in_array($a_js_file, $this->js_files))
1695 $this->js_files[] = $a_js_file;
1696 $this->js_files_vp[$a_js_file] = $a_add_version_parameter;
1697 $this->js_files_batch[$a_js_file] = $a_batch;
1706 $this->on_load_code[] = $a_code;
1712 function addCss($a_css_file, $media =
"screen")
1714 if (!array_key_exists($a_css_file . $media, $this->css_files))
1716 $this->css_files[$a_css_file . $media] = array(
"file" => $a_css_file,
"media" => $media);
1728 $this->creation_selector =
1729 array(
"form_action" => $a_form_action,
1730 "options" => $a_options,
1731 "command" => $a_command,
1740 $this->page_actions = $a_page_actions_html;
1748 $this->edit_page_button =
1749 array(
"link" => $a_link,
"txt" => $a_txt,
"frame" => $a_frame);
1757 $this->admin_panel_commands[] =
1758 array(
"cmd" => $a_cmd,
"txt" => $a_txt);
1761 $this->admin_panel_arrow =
true;
1779 if ((count($this->admin_panel_commands) > 0))
1781 foreach($this->admin_panel_commands as
$cmd)
1783 $toolb->addFormButton($cmd[
"txt"], $cmd[
"cmd"]);
1791 if ($this->admin_panel_arrow)
1795 $this->
setVariable(
"ADM_PANEL1", $toolb->getHTML());
1797 $adm_view_cmp =
true;
1801 if ($this->page_actions !=
"")
1803 $this->
setVariable(
"PAGE_ACTIONS", $this->page_actions);
1808 if (is_array($this->creation_selector))
1816 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
1818 $selection->setFormSelectMode(
"new_type",
"",
false,
1820 "", $this->creation_selector[
"txt"],
"", $this->creation_selector[
"command"]);
1821 $selection->setListTitle($lng->txt(
"cntr_add_new_item"));
1822 $selection->setId(
"item_creation");
1825 $selection->setItemLinkClass(
"xsmall");
1827 $selection->setUseImages(
true);
1830 foreach ($this->creation_selector[
"options"] as $item)
1832 $selection->addItem($item[
"title"], $item[
"value"],
"",
1833 $item[
"img"], $item[
"title"],
"");
1836 $selection->getHTML());
1845 if ($this->admin_panel_arrow)
1849 $this->
setVariable(
"ADM_PANEL2", $toolb->getHTML());
1857 $this->permanent_link = array(
1860 "append" => $a_append,
1861 "target" => $a_target);
1869 if (is_array($this->permanent_link))
1871 include_once(
"./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
1873 $this->permanent_link[
"type"],
1874 $this->permanent_link[
"id"],
1875 $this->permanent_link[
"append"],
1876 $this->permanent_link[
"target"]);
1877 $this->
setVariable(
"PRMLINK", $plinkgui->getHTML());
1886 if (is_array($this->on_load_code))
1889 foreach ($this->on_load_code as $code)