17 var
$js_files = array(0 =>
"./Services/JavaScript/js/Basic.js");
47 $this->activeBlock =
"__global__";
48 $this->vars = array();
52 $this->tplName = basename($fname);
53 $this->tplPath = dirname($fname);
55 $this->contenttype =
"text/html";
56 if (!file_exists($fname))
58 die(
"template ".$fname.
" was not found.");
67 $this->vars[
"TPLPATH"] = $this->tplPath;
70 if (method_exists($this,
"setOption"))
92 if (!empty(
$_GET[
"baseClass"]) && $a_in_module ===
true)
94 $a_in_module = $ilCtrl->getModuleDir();
97 if (strpos($a_tplname,
"/") ===
false)
104 if ($a_in_module ===
true)
110 $module_path = $a_in_module.
"/";
114 if($fname ==
"" || !file_exists($fname))
116 if ($a_in_module ==
"setup")
118 $fname =
"./".$module_path.
"templates/".basename($a_tplname);
122 $fname =
"./".$module_path.
"templates/default/".basename($a_tplname);
138 echo
"<br/>Template '".$this->tplPath.
"/".$tplname.
"'";
142 if (file_exists($tplfile) ==
false)
144 echo
"<br/>Template '".$tplfile.
"' doesn't exist! aborting...";
155 function show($part =
"DEFAULT")
157 header(
'Content-type: text/html; charset=UTF-8');
162 $ms = array(
"info",
"success",
"failure",
"question");
167 if ($m ==
"question")
169 $m =
"mess_question";
174 : $this->message[$m];
176 if ($m ==
"mess_question")
186 if ($m ==
"question")
188 $m =
"mess_question";
203 if ($part ==
"DEFAULT")
212 if (((substr(strrchr($_SERVER[
"PHP_SELF"],
"/"),1) !=
"error.php")
213 && (substr(strrchr($_SERVER[
"PHP_SELF"],
"/"),1) !=
"adm_menu.php")))
219 $url_parts = parse_url($_SERVER[
"REQUEST_URI"]);
222 $protocol = (isset($_SERVER[
'HTTPS']) ?
'https' :
'http').
'://';
223 $host = $_SERVER[
'HTTP_HOST'];
224 $path = $_SERVER[
'REQUEST_URI'];
225 $url_parts = @parse_url($protocol.$host.$path);
228 if (preg_match(
"/cmd=gateway/",$url_parts[
"query"]))
230 foreach (
$_POST as $key => $val)
237 $str .=
"&".$key.
"=".$val;
240 $_SESSION[
"referer"] = preg_replace(
"/cmd=gateway/",substr($str,1),$_SERVER[
"REQUEST_URI"]);
245 $_SESSION[
"referer"] = $_SERVER[
"REQUEST_URI"];
260 $mtpl =
new ilTemplate(
"tpl.message.html",
true,
true,
"Services/Utilities");
261 $mtpl->setCurrentBlock($a_type.
"_message");
262 $mtpl->setVariable(
"TEXT", $a_txt);
263 $mtpl->setVariable(
"MESSAGE_HEADING", $lng->txt($a_type.
"_message"));
264 $mtpl->setVariable(
"ALT_IMAGE", $lng->txt(
"icon").
" ".$lng->txt($a_type.
"_message"));
266 $mtpl->parseCurrentBlock();
279 $this->activeBlock = $part;
281 if ($part ==
"DEFAULT")
318 if ($part !=
"DEFAULT")
321 $this->activeBlock = $part;
324 if ($part !=
"DEFAULT")
326 $this->activeBlock = $tmp;
331 $this->activeBlock =
"__global__";
333 if ($part ==
"DEFAULT")
348 if (!in_array($a_type, array(
"info",
"success",
"failure",
"question")) || $a_txt ==
"")
352 if ($a_type ==
"question")
354 $a_type =
"mess_question";
358 $this->message[$a_type] = $a_txt;
370 $ms = array(
"info",
"success",
"failure",
"question");
375 if ($m ==
"question")
377 $m =
"mess_question";
382 : $this->message[$m];
384 if ($m ==
"mess_question")
391 $mtpl =
new ilTemplate(
"tpl.message.html",
true,
true,
"Services/Utilities");
392 $mtpl->setCurrentBlock($m.
"_message");
393 $mtpl->setVariable(
"TEXT", $txt);
394 $mtpl->setVariable(
"MESSAGE_HEADING", $lng->txt($m.
"_message"));
395 $mtpl->setVariable(
"ALT_IMAGE", $lng->txt(
"icon").
" ".$lng->txt($m.
"_message"));
397 $mtpl->parseCurrentBlock();
401 if ($m ==
"question")
403 $m =
"mess_question";
427 return $this->blockvariables[
"content"][$a_blockname] ?
true :
false;
435 if (!in_array($a_js_file, $this->js_files))
437 $this->js_files[] = $a_js_file;
443 global $ilias,$ilTabs;
446 foreach($this->js_files as
$file)
448 if (is_file($file) || substr($file, 0, 4) ==
"http")
458 function get($part =
"DEFAULT")
460 if ($part ==
"DEFAULT")