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";
202 if ($part ==
"DEFAULT")
211 if (((substr(strrchr($_SERVER[
"PHP_SELF"],
"/"),1) !=
"error.php")
212 && (substr(strrchr($_SERVER[
"PHP_SELF"],
"/"),1) !=
"adm_menu.php")))
218 $url_parts = parse_url($_SERVER[
"REQUEST_URI"]);
221 $protocol = (isset($_SERVER[
'HTTPS']) ?
'https' :
'http').
'://';
222 $host = $_SERVER[
'HTTP_HOST'];
223 $path = $_SERVER[
'REQUEST_URI'];
224 $url_parts = @parse_url($protocol.$host.$path);
227 if (preg_match(
"/cmd=gateway/",$url_parts[
"query"]))
229 foreach (
$_POST as $key => $val)
236 $str .=
"&".$key.
"=".$val;
240 preg_replace(
"/cmd=gateway/",substr($str,1),$_SERVER[
"REQUEST_URI"]));
242 (
int)
$_GET[
'ref_id']);
248 (
int)
$_GET[
'ref_id']);
262 $mtpl =
new ilTemplate(
"tpl.message.html",
true,
true,
"Services/Utilities");
263 $mtpl->setCurrentBlock($a_type.
"_message");
264 $mtpl->setVariable(
"TEXT", $a_txt);
265 $mtpl->setVariable(
"MESSAGE_HEADING", $lng->txt($a_type.
"_message"));
266 $mtpl->setVariable(
"ALT_IMAGE", $lng->txt(
"icon").
" ".$lng->txt($a_type.
"_message"));
268 $mtpl->parseCurrentBlock();
281 $this->activeBlock = $part;
283 if ($part ==
"DEFAULT")
320 if ($part !=
"DEFAULT")
323 $this->activeBlock = $part;
326 if ($part !=
"DEFAULT")
328 $this->activeBlock = $tmp;
333 $this->activeBlock =
"__global__";
335 if ($part ==
"DEFAULT")
350 if (!in_array($a_type, array(
"info",
"success",
"failure",
"question")) || $a_txt ==
"")
354 if ($a_type ==
"question")
356 $a_type =
"mess_question";
360 $this->message[$a_type] = $a_txt;
372 $ms = array(
"info",
"success",
"failure",
"question");
377 if ($m ==
"question")
379 $m =
"mess_question";
384 : $this->message[$m];
386 if ($m ==
"mess_question")
393 $mtpl =
new ilTemplate(
"tpl.message.html",
true,
true,
"Services/Utilities");
394 $mtpl->setCurrentBlock($m.
"_message");
395 $mtpl->setVariable(
"TEXT", $txt);
396 $mtpl->setVariable(
"MESSAGE_HEADING", $lng->txt($m.
"_message"));
397 $mtpl->setVariable(
"ALT_IMAGE", $lng->txt(
"icon").
" ".$lng->txt($m.
"_message"));
399 $mtpl->parseCurrentBlock();
403 if ($m ==
"question")
405 $m =
"mess_question";
429 return (isset($this->blockvariables[
"content"][$a_blockname]) ?
true :
false) | (isset($this->blockvariables[$a_blockname]) ?
true :
false);
437 if (!in_array($a_js_file, $this->js_files))
439 $this->js_files[] = $a_js_file;
445 global $ilias,$ilTabs;
448 foreach($this->js_files as
$file)
450 if (is_file($file) || substr($file, 0, 4) ==
"http")
460 function get($part =
"DEFAULT")
462 if ($part ==
"DEFAULT")