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...";
148 return parent::addBlockFile($var, $block, $tplfile);
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")
285 return parent::setCurrentBlock();
289 return parent::setCurrentBlock($part);
307 parent::touchBlock($block);
320 if ($part !=
"DEFAULT")
323 $this->activeBlock = $part;
326 if ($part !=
"DEFAULT")
328 $this->activeBlock = $tmp;
333 $this->activeBlock =
"__global__";
335 if ($part ==
"DEFAULT")
337 return parent::parseCurrentBlock();
341 return parent::parseCurrentBlock($part);
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")
464 return parent::get();
468 return parent::get($part);
getTemplatePath($a_tplname, $a_in_module=false, $a_plugin=false)
builds a full template path with template and module name
setMessage($a_type, $a_txt, $a_keep=false)
Set message.
ilTemplate($file, $flag1, $flag2, $in_module=false, $vars="DEFAULT")
constructor
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
loadTemplatefile( $filename, $removeUnknownVariables=true, $removeEmptyBlocks=true)
Reads a template file from the disk.
setVariable($variable, $value='')
Sets a variable value.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
touchBlock($block)
overwrites ITX::touchBlock.
special template class to simplify handling of ITX/PEAR
static clear($a_var)
Unset a value.
addJavaScript($a_js_file)
Add a javascript file that should be included in the header.
addBlockFile($var, $block, $tplname, $in_module=false)
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
ilTemplate($file, $flag1, $flag2, $in_module=false, $vars="DEFAULT", $plugin=false, $a_use_cache=false)
constructor
getMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
blockExists($a_blockname)
check if block exists in actual template private
setOption($option, $value)
Sets the option for the template class.
Dummy class that inherits from new ITX PEAR Class (see header.inc)
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt public...
show($part="DEFAULT")
public