4 include_once(
"./Services/UICore/lib/html-it/IT.php");
5 include_once(
"./Services/UICore/lib/html-it/ITX.php");
50 public function __construct($file, $flag1, $flag2, $in_module =
false,
$vars =
"DEFAULT")
52 $this->activeBlock =
"__global__";
53 $this->vars = array();
57 $this->tplName = basename($fname);
58 $this->tplPath = dirname($fname);
60 $this->contenttype =
"text/html";
61 if (!file_exists($fname)) {
62 die(
"template " . $fname .
" was not found.");
74 if (method_exists($this,
"setOption")) {
98 public function getTemplatePath($a_tplname, $a_in_module =
false, $a_plugin =
false)
104 if (!empty(
$_GET[
"baseClass"]) && $a_in_module ===
true) {
105 $a_in_module = $ilCtrl->getModuleDir();
108 if (strpos($a_tplname,
"/") ===
false) {
113 if ($a_in_module ===
true) {
116 $module_path = $a_in_module .
"/";
120 if ($fname ==
"" || !file_exists($fname)) {
121 if ($a_in_module ==
"setup") {
122 $fname =
"./" . $module_path .
"templates/" . basename($a_tplname);
124 $fname =
"./" . $module_path .
"templates/default/" . basename($a_tplname);
134 public function addBlockFile($var, $block, $tplname, $in_module =
false)
137 echo
"<br/>Template '" . $this->tplPath .
"/" . $tplname .
"'";
141 if (file_exists($tplfile) ==
false) {
142 echo
"<br/>Template '" . $tplfile .
"' doesn't exist! aborting...";
146 return parent::addBlockFile($var, $block, $tplfile);
153 public function show($part =
"DEFAULT")
155 header(
'Content-type: text/html; charset=UTF-8');
161 $ms = array(
"info",
"success",
"failure",
"question");
164 foreach ($ms as $m) {
165 if ($m ==
"question") {
166 $m =
"mess_question";
171 : $this->message[$m];
173 if ($m ==
"mess_question") {
181 if ($m ==
"question") {
182 $m =
"mess_question";
194 if ($part ==
"DEFAULT") {
200 if (((substr(strrchr(
$_SERVER[
"PHP_SELF"],
"/"), 1) !=
"error.php")
201 && (substr(strrchr(
$_SERVER[
"PHP_SELF"],
"/"), 1) !=
"adm_menu.php"))) {
206 $url_parts = parse_url(
$_SERVER[
"REQUEST_URI"]);
208 $protocol = (isset(
$_SERVER[
'HTTPS']) ?
'https' :
'http') .
'://';
211 $url_parts = @parse_url($protocol . $host . $path);
214 if (preg_match(
"/cmd=gateway/", $url_parts[
"query"])) {
215 foreach (
$_POST as $key => $val) {
216 if (is_array($val)) {
220 $str .=
"&" . $key .
"=" . $val;
225 preg_replace(
"/cmd=gateway/", substr($str, 1),
$_SERVER[
"REQUEST_URI"])
229 (
int)
$_GET[
'ref_id']
235 (
int)
$_GET[
'ref_id']
250 $mtpl =
new ilTemplate(
"tpl.message.html",
true,
true,
"Services/Utilities");
251 $mtpl->setCurrentBlock(
$a_type .
"_message");
252 $mtpl->setVariable(
"TEXT", $a_txt);
253 $mtpl->setVariable(
"MESSAGE_HEADING", $lng->txt(
$a_type .
"_message"));
254 $mtpl->parseCurrentBlock();
267 $this->activeBlock = $part;
269 if ($part ==
"DEFAULT") {
270 return parent::setCurrentBlock();
272 return parent::setCurrentBlock($part);
289 parent::touchBlock($block);
302 if ($part !=
"DEFAULT") {
304 $this->activeBlock = $part;
307 if ($part !=
"DEFAULT") {
308 $this->activeBlock = $tmp;
313 $this->activeBlock =
"__global__";
315 if ($part ==
"DEFAULT") {
316 return parent::parseCurrentBlock();
318 return parent::parseCurrentBlock($part);
327 if (!in_array(
$a_type, array(
"info",
"success",
"failure",
"question")) || $a_txt ==
"") {
334 $this->message[
$a_type] = $a_txt;
344 $ms = array(
"info",
"success",
"failure",
"question");
347 foreach ($ms as $m) {
348 if ($m ==
"question") {
349 $m =
"mess_question";
354 : $this->message[$m];
356 if ($m ==
"mess_question") {
361 $mtpl =
new ilTemplate(
"tpl.message.html",
true,
true,
"Services/Utilities");
362 $mtpl->setCurrentBlock($m .
"_message");
363 $mtpl->setVariable(
"TEXT",
$txt);
364 $mtpl->setVariable(
"MESSAGE_HEADING", $lng->txt($m .
"_message"));
365 $mtpl->parseCurrentBlock();
366 $out .= $mtpl->get();
369 if ($m ==
"question") {
370 $m =
"mess_question";
392 return (isset($this->blockvariables[
"content"][$a_blockname]) ?
true :
false) | (isset($this->blockvariables[$a_blockname]) ? true :
false);
398 public function addJavaScript($a_js_file, $a_add_version_parameter =
true, $a_batch = 2)
400 if (!in_array($a_js_file, $this->js_files)) {
401 $this->js_files[] = $a_js_file;
407 global $ilias,$ilTabs;
409 foreach ($this->js_files as $file) {
410 if (is_file($file) || substr($file, 0, 4) ==
"http") {
422 public function addCss($a_css_file, $media =
"screen")
424 if (!array_key_exists($a_css_file . $media, $this->css_files)) {
425 $this->css_files[$a_css_file . $media] = array(
"file" => $a_css_file,
"media" => $media);
439 foreach ($this->css_files as $css) {
454 public function get($part =
"DEFAULT")
456 if ($part ==
"DEFAULT") {
530 public function setTitle($a_title, $hidden =
false)
671 public function getSpecial($part =
"DEFAULT", $add_error_mess =
false, $handle_referer =
false, $add_ilias_footer =
false, $add_standard_elements =
false, $a_main_menu =
true, $a_tabs =
true)
680 public function printToStdout($part =
"DEFAULT", $a_fill_tabs =
true, $a_skip_main_menu =
false)
getTemplatePath($a_tplname, $a_in_module=false, $a_plugin=false)
builds a full template path with template and module name
setTitleIcon($a_icon_path, $a_icon_desc="")
addLightbox($a_html, $a_id)
setLoginTargetPar($a_val)
resetHeaderBlock($a_reset_header_action=true)
__construct($file, $flag1, $flag2, $in_module=false, $vars="DEFAULT")
constructor
setAlertProperties(array $a_props)
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
setLeftNavContent($a_content)
addAdminPanelToolbar(ilToolbarGUI $toolb, $a_bottom_panel=true, $a_arrow=false)
addInlineCss($a_css, $media="screen")
setHeaderActionMenu($a_header)
setPageFormAction($a_action)
setBodyClass($a_class="")
loadTemplatefile( $filename, $removeUnknownVariables=true, $removeEmptyBlocks=true)
Reads a template file from the disk.
setPermanentLink($a_type, $a_id, $a_append="", $a_target="", $a_title="")
addJavaScript($a_js_file, $a_add_version_parameter=true, $a_batch=2)
Add a javascript file that should be included in the header.
setTitle($a_title, $hidden=false)
touchBlock($block)
overwrites ITX::touchBlock.
printToStdout($part="DEFAULT", $a_fill_tabs=true, $a_skip_main_menu=false)
setOnScreenMessage($a_type, $a_txt, $a_keep=false)
Set message.
static clear($a_var)
Unset a value.
setVariable($variable, $value='')
addOnLoadCode($a_code, $a_batch=2)
fillJavaScriptFiles($force=true)
addBlockFile($var, $block, $tplname, $in_module=false)
overwrites ITX::addBlockFile
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock()
Parses the current block.
getMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
getSpecial($part="DEFAULT", $add_error_mess=false, $handle_referer=false, $add_ilias_footer=false, $add_standard_elements=false, $a_main_menu=true, $a_tabs=true)
fillCssFiles($a_force=false)
Fill in the css file tags.
blockExists($a_blockname)
check if block exists in actual template private
__construct(Container $dic, ilPlugin $plugin)
setTreeFlatIcon($a_link, $a_mode)
setOption($option, $value)
Sets the option for the template class.
enableDragDropFileUpload($a_ref_id)
addCss($a_css_file, $media="screen")
Add a css file that should be included in the header.
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt public...
show($part="DEFAULT")
public
setHeaderPageTitle($a_title)