Public Member Functions | Data Fields

ilTemplate Class Reference

Inheritance diagram for ilTemplate:
Collaboration diagram for ilTemplate:

Public Member Functions

 ilTemplate ($file, $flag1, $flag2, $in_module=false, $vars="DEFAULT")
 constructor
 get ($part="DEFAULT", $add_error_mess=false, $handle_referer=false, $add_ilias_footer=false, $add_standard_elements=false)
 ??? public
 addErrorMessage ()
 getContentType ()
 Get the content type for the template output.
 setContentType ($a_content_type="text/html")
 Set the content type for the template output.
 show ($part="DEFAULT", $a_fill_tabs=true)
 public
 fillTabs ()
 setContentStyle ()
 fillMainMenu ()
 fillHeaderIcon ()
 addILIASFooter ()
 add ILIAS footer
 handleReferer ()
 TODO: this is nice, but shouldn't be done here (-> maybe at the end of ilias.php!?, alex).
 blockExists ($a_blockname)
 check if block exists in actual template private
 fillVars ()
 all template vars defined in $vars will be replaced automatically without setting and parsing them with setVariable & parseCurrentBlock private
 setCurrentBlock ($part="DEFAULT")
 Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
 touchBlock ($block)
 overwrites ITX::touchBlock.
 parseCurrentBlock ($part="DEFAULT")
 Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt public.
 replaceFromDatabase (&$DB, $block, $conv, $select="default")
 ??? TODO: Adjust var names to ilias.
 prepareForFormular ($vars)
 Wird angewendet, wenn die Daten in ein Formular replaced werden sollen, Dann wird erst noch ein htmlspecialchars drumherum gemacht.
 replace ()
 ??? public
 replaceDefault ()
 ??? public
 checkTopic ($a_block, $a_topic)
 checks for a topic in the template private
 includeNavigation ()
 check if there is a NAVIGATION-topic public
 includeTree ()
 check if there is a TREE-topic public
 fileExists ($filename)
 check if a file exists public
 addBlockFile ($var, $block, $tplname, $in_module=false)
 overwrites ITX::addBlockFile public
 getTemplatePath ($a_tplname, $a_in_module=false)
 builds a full template path with template and module name
 setHeaderPageTitle ($a_title)
 setStyleSheetLocation ($a_stylesheet)
 setNewContentStyleSheetLocation ($a_stylesheet)
 getStandardTemplate ()
 setTitle ($a_title)
 sets title in standard template
 setTitleIcon ($a_icon_path, $a_icon_desc="")
 set title icon
 setDescription ($a_descr)
 sets title in standard template
 stopTitleFloating ()
 stop floating (if no tabs are used)
 setContent ($a_html)
 sets content for standard template
 setLocator ()
 insert locator (add
 setTabs ($a_tabs_html)
 sets tabs in standard template
 setSubTabs ($a_tabs_html)
 sets subtabs in standard template
 setUpperIcon ($a_link, $a_frame="")
 sets icon to upper level
 setTreeFlatIcon ($a_link, $a_mode)
 set tree/flat icon
 ilTemplate ($root)
 constructor
 show ($part="DEFAULT")
 public
 blockExists ($a_blockname)
 check if block exists in actual template private

Data Fields

 $contenttype
 $vars
 $activeBlock

Detailed Description

Definition at line 34 of file class.ilTemplate.php.


Member Function Documentation

ilTemplate::addBlockFile ( var,
block,
tplname,
in_module = false 
)

overwrites ITX::addBlockFile public

Parameters:
string 
string 
string $tplname template name
boolean $in_module should be set to true, if template file is in module subdirectory
Returns:
boolean/string

Definition at line 655 of file class.ilTemplate.php.

References getTemplatePath().

Referenced by addErrorMessage(), addILIASFooter(), getStandardTemplate(), setLocator(), and show().

        {
                if (DEBUG)
                {
                        echo "<br/>Template '".$this->tplPath."/".$tplname."'";
                }

                $tplfile = $this->getTemplatePath($tplname, $in_module);
                if (file_exists($tplfile) == false)
                {
                        echo "<br/>Template '".$tplfile."' doesn't exist! aborting...";
                        return false;
                }

                return parent::addBlockFile($var, $block, $tplfile);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilTemplate::addErrorMessage (  ) 

Definition at line 159 of file class.ilTemplate.php.

References $_SESSION, addBlockFile(), and blockExists().

Referenced by get(), and show().

        {
                // ERROR HANDLER SETS $_GET["message"] IN CASE OF $error_obj->MESSAGE
                if ($_SESSION["message"] || $_SESSION["info"])
                {
                        if($this->blockExists("MESSAGE"))
                        {
                                $this->addBlockFile("MESSAGE", "message", "tpl.message.html");
#                       $this->setCurrentBlock("message");

                                $this->setVariable("MSG", $_SESSION["message"]);
                                $this->setVariable("INFO", $_SESSION["info"]);

                                session_unregister("message");
                                session_unregister("info");

#                       $this->parseCurrentBlock();
                        }
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilTemplate::addILIASFooter (  ) 

add ILIAS footer

Definition at line 297 of file class.ilTemplate.php.

References $_GET, $_SESSION, $exp, $ilias, addBlockFile(), ilUtil::appendUrlParameterString(), ilPHP::cloneObject(), parseCurrentBlock(), setCurrentBlock(), and ilValidatorAdapter::validate().

Referenced by get(), and show().

        {
                global $ilias, $ilClientIniFile;

                $this->addBlockFile("FOOTER", "footer", "tpl.footer.html");
                $this->setVariable("ILIAS_VERSION", $ilias->getSetting("ilias_version"));
                if (DEVMODE)
                {
                        $mem_usage = "";
                        if(function_exists("memory_get_usage"))
                        {
                                $mem_usage.=
                                        "<br /> Memory Usage: ".memory_get_usage()." Bytes";
                        }
                        if(function_exists("xdebug_peak_memory_usage"))
                        {
                                $mem_usage.=
                                        "<br /> XDebug Peak Memory Usage: ".xdebug_peak_memory_usage()." Bytes";
                        }
                        if ($mem_usage != "")
                        {
                                $this->setVariable("MEMORY_USAGE", $mem_usage);
                        }

                        $this->setVariable("SESS_INFO", "<br />maxlifetime: ".
                                ini_get("session.gc_maxlifetime")." (".
                                (ini_get("session.gc_maxlifetime")/60)."), id: ".session_id()."<br />".
                                "timestamp: ".date("Y-m-d H:i:s", $_SESSION["_authsession"]["timestamp"]).
                                ", idle: ".date("Y-m-d H:i:s", $_SESSION["_authsession"]["idle"]).
                                "<br />expire: ".($exp = $ilClientIniFile->readVariable("session","expire")).
                                " (".($exp/60)."), session ends at: ".
                                date("Y-m-d H:i:s", $_SESSION["_authsession"]["idle"] + $exp));
                        
                        if (version_compare(PHP_VERSION,'5','>='))
                        {
                                $this->setVariable("VALIDATION_LINKS",
                                        '<br /><a href="'.
                                        ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=xhtml").
                                        '">Validate</a> | <a href="'.
                                        ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=accessibility").
                                        '">Accessibility</a>');
                        }
                        if (!empty($_GET["do_dev_validate"]))
                        {
                                require_once("Services/XHTMLValidator/classes/class.ilValidatorAdapter.php");
                                $template2 = ilPHP::cloneObject($this);
//echo "-".ilValidatorAdapter::validate($template2->get(), $_GET["do_dev_validate"])."-";
                                $this->setCurrentBlock("xhtml_validation");
                                $this->setVariable("VALIDATION",
                                        ilValidatorAdapter::validate($template2->get("DEFAULT",
                                        false, false, false, true), $_GET["do_dev_validate"]));
                                $this->parseCurrentBlock();
                        }
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilTemplate::blockExists ( a_blockname  ) 

check if block exists in actual template private

Parameters:
string blockname
Returns:
boolean

Definition at line 140 of file class.ilTemplate.php.

        {
                return $this->blockvariables["content"][$a_blockname] ? true : false;
        }

ilTemplate::blockExists ( a_blockname  ) 

check if block exists in actual template private

Parameters:
string blockname
Returns:
boolean

Definition at line 413 of file class.ilTemplate.php.

Referenced by addErrorMessage(), and show().

        {
                return $this->blockvariables["content"][$a_blockname] ? true : false;
        }

Here is the caller graph for this function:

ilTemplate::checkTopic ( a_block,
a_topic 
)

checks for a topic in the template private

Parameters:
string 
string 
Returns:
boolean

Definition at line 610 of file class.ilTemplate.php.

Referenced by includeNavigation(), and includeTree().

        {
                return array_key_exists($a_topic, $this->blockvariables[$a_block]);
        }

Here is the caller graph for this function:

ilTemplate::fileExists ( filename  ) 

check if a file exists public

Returns:
boolean

Definition at line 640 of file class.ilTemplate.php.

        {
                return file_exists($this->tplPath."/".$filename);
        }

ilTemplate::fillHeaderIcon (  ) 

Definition at line 277 of file class.ilTemplate.php.

References parseCurrentBlock(), and setCurrentBlock().

Referenced by get(), and show().

        {
                if ($this->icon_path != "")
                {
                        if ($this->icon_desc != "")
                        {
                                $this->setCurrentBlock("header_image_desc");
                                $this->setVariable("IMAGE_DESC", $this->icon_desc);
                                $this->parseCurrentBlock();
                        }
                        $this->setCurrentBlock("header_image");
                        $this->setVariable("IMG_HEADER", $this->icon_path);
                        $this->parseCurrentBlock();
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilTemplate::fillMainMenu (  ) 

Definition at line 266 of file class.ilTemplate.php.

References $tpl.

Referenced by get(), and show().

        {
                global $tpl, $ilMainMenu;
                
                //$ilMainMenu->setTemplate($tpl);
                //$ilMainMenu->addMenuBlock("MAINMENU", "navigation");
                //$ilMainMenu->setTemplateVars();
//echo "-".htmlentities($ilMainMenu->getHTML())."-";
                $tpl->setVariable("MAINMENU", $ilMainMenu->getHTML());
        }

Here is the caller graph for this function:

ilTemplate::fillTabs (  ) 

Definition at line 250 of file class.ilTemplate.php.

References $ilias.

Referenced by get(), and show().

        {
                global $ilias,$ilTabs;
                
                $this->setVariable("TABS",$ilTabs->getHTML());
                $this->setVariable("SUB_TABS",$ilTabs->getSubTabHTML());
        }

Here is the caller graph for this function:

ilTemplate::fillVars (  ) 

all template vars defined in $vars will be replaced automatically without setting and parsing them with setVariable & parseCurrentBlock private

Returns:
integer

Definition at line 425 of file class.ilTemplate.php.

References $key.

Referenced by parseCurrentBlock(), and touchBlock().

        {
                $count = 0;
                reset($this->vars);

                while(list($key, $val) = each($this->vars))
                {
                        if (is_array($this->blockvariables[$this->activeBlock]))
                        {
                                if  (array_key_exists($key, $this->blockvariables[$this->activeBlock]))
                                {
                                        $count++;

                                        $this->setVariable($key, $val);
                                }
                        }
                }
                
                return $count;
        }

Here is the caller graph for this function:

ilTemplate::get ( part = "DEFAULT",
add_error_mess = false,
handle_referer = false,
add_ilias_footer = false,
add_standard_elements = false 
)

??? public

Parameters:
string 
Returns:
string

Definition at line 120 of file class.ilTemplate.php.

References addErrorMessage(), addILIASFooter(), fillHeaderIcon(), fillMainMenu(), fillTabs(), handleReferer(), and setContentStyle().

        {
                if ($add_error_mess)
                {
                        $this->addErrorMessage();
                }

                // set standard parts (tabs and title icon)
                if($add_standard_elements)
                {
                        $this->setContentStyle();
                        $this->fillMainMenu();
                        $this->fillTabs();
                        $this->fillHeaderIcon();
                }

                if ($add_ilias_footer)
                {
                        $this->addILIASFooter();
                }

                if ($handle_referer)
                {
                        $this->handleReferer();
                }

                if ($part == "DEFAULT")
                {
                        return parent::get();
                }
                else
                {
                        return parent::get($part);
                }

        }

Here is the call graph for this function:

ilTemplate::getContentType (  ) 

Get the content type for the template output.

Returns:
string Content type public

Definition at line 186 of file class.ilTemplate.php.

Referenced by show().

        {
                return $this->contenttype;
        }

Here is the caller graph for this function:

ilTemplate::getStandardTemplate (  ) 

Definition at line 736 of file class.ilTemplate.php.

References addBlockFile().

        {
                $this->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
                $this->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
        }

Here is the call graph for this function:

ilTemplate::getTemplatePath ( a_tplname,
a_in_module = false 
)

builds a full template path with template and module name

Parameters:
string $a_tplname template name
boolean $in_module should be set to true, if template file is in module subdirectory
Returns:
string full template path

Definition at line 680 of file class.ilTemplate.php.

References $_GET, $ilCtrl, and $ilias.

Referenced by addBlockFile(), and ilTemplate().

        {
                global $ilias, $ilCtrl;
                
                // if baseClass functionality is used (ilias.php):
                // get template directory from ilCtrl
                if (!empty($_GET["baseClass"]) && $a_in_module === true)
                {
                        $a_in_module = $ilCtrl->getModuleDir();
                }

                if (strpos($a_tplname,"/") === false)
                {
                        //$fname = $ilias->tplPath;
                        $base = "./";
                        if ($a_in_module)
                        {
                                if ($a_in_module === true)
                                {
                                        $base.= ILIAS_MODULE."/";
                                }
                                else
                                {
                                        $base.= $a_in_module."/";
                                }
                        }
                        $base .= "templates/";
                        $fname = $base.$ilias->account->skin."/".basename($a_tplname);
                        //echo "looking for :$fname:<br>";
                        if(!file_exists($fname))
                        {
                                $fname = $base."default/".basename($a_tplname);
                        }
                }
                else
                {
                        $fname = $a_tplname;
                }
                return $fname;
        }

Here is the caller graph for this function:

ilTemplate::handleReferer (  ) 

TODO: this is nice, but shouldn't be done here (-> maybe at the end of ilias.php!?, alex).

Definition at line 358 of file class.ilTemplate.php.

References $_POST, $_SESSION, and $key.

Referenced by get(), and show().

        {
                if (((substr(strrchr($_SERVER["PHP_SELF"],"/"),1) != "error.php")
                        && (substr(strrchr($_SERVER["PHP_SELF"],"/"),1) != "adm_menu.php")
                        && (substr(strrchr($_SERVER["PHP_SELF"],"/"),1) != "chat.php")))
                {
                        $_SESSION["post_vars"] = $_POST;

                        // referer is modified if query string contains cmd=gateway and $_POST is not empty.
                        // this is a workaround to display formular again in case of error and if the referer points to another page
                        $url_parts = parse_url($_SERVER["REQUEST_URI"]);

                        if (preg_match("/cmd=gateway/",$url_parts["query"]) && (isset($_POST["cmd"]["create"])))
                        {
                                foreach ($_POST as $key => $val)
                                {
                                        if (is_array($val))
                                        {
                                                $val = key($val);
                                        }

                                        $str .= "&".$key."=".$val;
                                }

                                $_SESSION["referer"] = preg_replace("/cmd=gateway/",substr($str,1),$_SERVER["REQUEST_URI"]);
                        }
                        else if (preg_match("/cmd=post/",$url_parts["query"]) && (isset($_POST["cmd"]["create"])))
                        {
                                foreach ($_POST as $key => $val)
                                {
                                        if (is_array($val))
                                        {
                                                $val = key($val);
                                        }

                                        $str .= "&".$key."=".$val;
                                }

                                $_SESSION["referer"] = preg_replace("/cmd=post/",substr($str,1),$_SERVER["REQUEST_URI"]);
                        }
                        else
                        {
                                $_SESSION["referer"] = $_SERVER["REQUEST_URI"];
                        }

                        unset($_SESSION["error_post_vars"]);
                }
        }

Here is the caller graph for this function:

ilTemplate::ilTemplate ( file,
flag1,
flag2,
in_module = false,
vars = "DEFAULT" 
)

constructor

Parameters:
string $file templatefile (mit oder ohne pfad)
boolean $flag1 remove unknown variables
boolean $flag2 remove empty blocks
boolean $in_module should be set to true, if template file is in module subdirectory
array $vars variables to replace public

Definition at line 64 of file class.ilTemplate.php.

References $file, $ilias, ilTemplateX::callConstructor(), and getTemplatePath().

        {
                global $ilias;

                $this->activeBlock = "__global__";
                $this->vars = array();

                /*
                if (strpos($file,"/") === false)
                {
                        //$fname = $ilias->tplPath;
                        $base = "./";
                        if ($module != "")
                        {
                                $base.= $module."/";
                        }
                        $base .= "templates/";
                        $fname = $base.$ilias->account->skin."/".basename($file);
                        if(!file_exists($fname))
                        {
                                $fname .= $base."default/".basename($file);
                        }
                }
                else
                {
                        $fname = $file;
                }*/
                $fname = $this->getTemplatePath($file, $in_module);

                $this->tplName = basename($fname);
                $this->tplPath = dirname($fname);
                // set default content-type to text/html
                $this->contenttype = "text/html";
                if (!file_exists($fname))
                {
                        $ilias->raiseError("template ".$fname." was not found.", $ilias->error_obj->FATAL);
                        return false;
                }

                //$this->IntegratedTemplateExtension(dirname($fname));
                $this->callConstructor();
                //$this->loadTemplatefile(basename($fname), $flag1, $flag2);
                $this->loadTemplatefile($fname, $flag1, $flag2);

                //add tplPath to replacevars
                $this->vars["TPLPATH"] = $this->tplPath;

                return true;
        }

Here is the call graph for this function:

ilTemplate::ilTemplate ( root  ) 

constructor

Parameters:
string $file templatefile (mit oder ohne pfad)
boolean $flag1 remove unknown variables
boolean $flag2 remove empty blocks
boolean $in_module should be set to true, if template file is in module subdirectory
array $vars variables to replace public

Definition at line 59 of file class.ilTemplate.php.

References ilTemplateX::callConstructor().

        {
                $this->callConstructor();
                
                $this->setRoot($root);

                return true;
        }

Here is the call graph for this function:

ilTemplate::includeNavigation (  ) 

check if there is a NAVIGATION-topic public

Returns:
boolean

Definition at line 620 of file class.ilTemplate.php.

References checkTopic().

        {
                return $this->checkTopic("__global__", "NAVIGATION");
        }

Here is the call graph for this function:

ilTemplate::includeTree (  ) 

check if there is a TREE-topic public

Returns:
boolean

Definition at line 630 of file class.ilTemplate.php.

References checkTopic().

        {
                return $this->checkTopic("__global__", "TREE");
        }

Here is the call graph for this function:

ilTemplate::parseCurrentBlock ( part = "DEFAULT"  ) 

Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt public.

Parameters:
string 
Returns:
string

Definition at line 490 of file class.ilTemplate.php.

References fillVars().

Referenced by addILIASFooter(), fillHeaderIcon(), replaceFromDatabase(), setLocator(), setTreeFlatIcon(), setUpperIcon(), and touchBlock().

        {
                // Hier erst noch ein replace aufrufen
                if ($part != "DEFAULT")
                {
                        $tmp = $this->activeBlock;
                        $this->activeBlock = $part;
                }

                if ($part != "DEFAULT")
                {
                        $this->activeBlock = $tmp;
                }

                $this->fillVars();

                $this->activeBlock = "__global__";

                if ($part == "DEFAULT")
                {
                        return parent::parseCurrentBlock();
                }
                else
                {
                        return parent::parseCurrentBlock($part);
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilTemplate::prepareForFormular ( vars  ) 

Wird angewendet, wenn die Daten in ein Formular replaced werden sollen, Dann wird erst noch ein htmlspecialchars drumherum gemacht.

public

Parameters:
string 

Definition at line 562 of file class.ilTemplate.php.

References $vars.

        {
                if (!is_array($vars))
                {
                        return;
                }

                reset($vars);

                while (list($i) = each($vars))
                {
                        $vars[$i] = stripslashes($vars[$i]);
                        $vars[$i] = htmlspecialchars($vars[$i]);
                }

                return($vars);
        }

ilTemplate::replace (  ) 

??? public

Definition at line 584 of file class.ilTemplate.php.

References $key.

Referenced by replaceDefault(), and replaceFromDatabase().

        {
                reset($this->vars);

                while(list($key, $val) = each($this->vars))
                {
                        $this->setVariable($key, $val);
                }
        }

Here is the caller graph for this function:

ilTemplate::replaceDefault (  ) 

??? public

Definition at line 598 of file class.ilTemplate.php.

References replace().

        {
                $this->replace($this->vars);
        }

Here is the call graph for this function:

ilTemplate::replaceFromDatabase ( &$  DB,
block,
conv,
select = "default" 
)

??? TODO: Adjust var names to ilias.

This method wasn't used so far and isn't translated yet public

Parameters:
string 
string 
string 
string 

Definition at line 528 of file class.ilTemplate.php.

References $DB, $key, $res, $result, parseCurrentBlock(), replace(), and setCurrentBlock().

        {
                $res = $DB->selectDbAll();

                while ($DB->getDbNextElement($res))
                {
                        $this->setCurrentBlock($block);
                        $result = array();
                        reset($conv);

                        while (list ($key,$val) = each ($conv))
                        {
                                $result[$val]=$DB->element->data[$key];
                        }

                        if (($select != "default")
                                && ($DB->element->data[$select["id"]]==$select["value"]
                                || (strtolower($select["text"]) == "checked"
                                && strpos( ",,".$select["value"].",," , ",".$DB->element->data[$select["id"]]."," )!=false)))
                        {
                                $result[$select["field"]] = $select["text"];
                        }

                        $this->replace($result);
                        $this->parseCurrentBlock($block);
                }
        }

Here is the call graph for this function:

ilTemplate::setContent ( a_html  ) 

sets content for standard template

Definition at line 778 of file class.ilTemplate.php.

        {
                $this->setVariable("ADM_CONTENT", $a_html);
        }

ilTemplate::setContentStyle (  ) 

Definition at line 258 of file class.ilTemplate.php.

References ilUtil::getNewContentStyleSheetLocation().

Referenced by get(), and show().

        {
                $this->setVariable("LOCATION_NEWCONTENT_STYLESHEET_TAG",
                        '<link rel="stylesheet" type="text/css" href="'.
                        ilUtil::getNewContentStyleSheetLocation()
                        .'" />');
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilTemplate::setContentType ( a_content_type = "text/html"  ) 

Set the content type for the template output.

Set the content type for the template output Usually this is text/html. For MathML output the content type should be set to text/xml

Parameters:
string $a_content_type Content type public

Definition at line 201 of file class.ilTemplate.php.

        {
                $this->contenttype = $a_content_type;
        }

ilTemplate::setCurrentBlock ( part = "DEFAULT"  ) 

Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.

public

Parameters:
string 
Returns:
???

Definition at line 452 of file class.ilTemplate.php.

Referenced by addILIASFooter(), fillHeaderIcon(), replaceFromDatabase(), setLocator(), setTreeFlatIcon(), setUpperIcon(), and touchBlock().

        {
                $this->activeBlock = $part;

                if ($part == "DEFAULT")
                {
                        return parent::setCurrentBlock();
                }
                else
                {
                        return parent::setCurrentBlock($part);
                }
        }

Here is the caller graph for this function:

ilTemplate::setDescription ( a_descr  ) 

sets title in standard template

Definition at line 762 of file class.ilTemplate.php.

        {
                $this->setVariable("H_DESCRIPTION", $a_descr);
        }

ilTemplate::setHeaderPageTitle ( a_title  ) 

Definition at line 721 of file class.ilTemplate.php.

        {
                $this->setVariable("PAGETITLE", $a_title);
        }

ilTemplate::setLocator (  ) 

insert locator (add

Definition at line 787 of file class.ilTemplate.php.

References addBlockFile(), parseCurrentBlock(), setCurrentBlock(), and touchBlock().

        {
                global $ilLocator;
                
                $this->addBlockFile("LOCATOR", "locator", "tpl.locator.html");
                
                $items = $ilLocator->getItems();
                $first = true;
                if (is_array($items))
                {
                        //$this->touchBlock("locator_separator");
                        //$this->touchBlock("locator_item");

                        foreach($items as $item)
                        {
                                if (!$first)
                                {
                                        $this->touchBlock("locator_separator_prefix");
                                }
                                
                                $this->setCurrentBlock("locator_item");
                                if ($item["link"] != "")
                                {
                                        $this->setVariable("LINK_ITEM", $item["link"]);
                                        if ($item["frame"] != "")
                                        {
                                                $this->setVariable("LINK_TARGET", ' target="'.$item["frame"].'" ');
                                        }
                                        $this->setVariable("ITEM", $item["title"]);
                                }
                                else
                                {
                                        $this->setVariable("PREFIX", $item["title"]);
                                }
                                $this->parseCurrentBlock();
                                
                                $first = false;
                        }
                }
                else
                {
                        $this->setVariable("NOITEM", "&nbsp;");
                        $this->touchBlock("locator");
                }
        }

Here is the call graph for this function:

ilTemplate::setNewContentStyleSheetLocation ( a_stylesheet  ) 

Definition at line 731 of file class.ilTemplate.php.

        {
                $this->setVariable("LOCATION_NEWCONTENT_STYLESHEET", $a_stylesheet);
        }

ilTemplate::setStyleSheetLocation ( a_stylesheet  ) 

Definition at line 726 of file class.ilTemplate.php.

        {
                $this->setVariable("LOCATION_STYLESHEET", $a_stylesheet);
        }

ilTemplate::setSubTabs ( a_tabs_html  ) 

sets subtabs in standard template

Definition at line 844 of file class.ilTemplate.php.

        {
                $this->setVariable("SUB_TABS", $a_tabs_html);
        }

ilTemplate::setTabs ( a_tabs_html  ) 

sets tabs in standard template

Definition at line 836 of file class.ilTemplate.php.

        {
                $this->setVariable("TABS", $a_tabs_html);
        }

ilTemplate::setTitle ( a_title  ) 

sets title in standard template

Definition at line 745 of file class.ilTemplate.php.

        {
                $this->setVariable("HEADER", $a_title);
        }

ilTemplate::setTitleIcon ( a_icon_path,
a_icon_desc = "" 
)

set title icon

Definition at line 753 of file class.ilTemplate.php.

        {
                $this->icon_desc = $a_icon_desc;
                $this->icon_path = $a_icon_path;
        }

ilTemplate::setTreeFlatIcon ( a_link,
a_mode 
)

set tree/flat icon

Parameters:
string link target
strong mode ("tree" | "flat")

Definition at line 876 of file class.ilTemplate.php.

References $lng, ilFrameTargetInfo::_getFrame(), ilUtil::getImagePath(), parseCurrentBlock(), and setCurrentBlock().

        {
                global $lng;
                
                $this->setCurrentBlock("tree_mode");
                $this->setVariable("LINK_MODE", $a_link);
                $this->setVariable("IMG_TREE",ilUtil::getImagePath("ic_".$a_mode."view.gif"));
                $this->setVariable("ALT_TREE",$lng->txt($a_mode."view"));
                $this->setVariable("TARGET_TREE", ilFrameTargetInfo::_getFrame("MainContent"));
//echo ":".ilFrameTargetInfo::_getFrame("MainContent").":";
                $this->parseCurrentBlock();
        }

Here is the call graph for this function:

ilTemplate::setUpperIcon ( a_link,
a_frame = "" 
)

sets icon to upper level

Definition at line 852 of file class.ilTemplate.php.

References $lng, ilUtil::getImagePath(), parseCurrentBlock(), and setCurrentBlock().

        {
                global $lng;

                if ($a_frame != "")
                {
                        $this->setCurrentBlock("target_top");
                        $this->setVariable("TARGET_TOP", $a_frame);
                        $this->parseCurrentBlock();
                }

                $this->setVariable("ALT_TOP", $lng->txt("up"));

                $this->setCurrentBlock("top");
                $this->setVariable("LINK_TOP", $a_link);
                $this->setVariable("IMG_TOP",ilUtil::getImagePath("ic_top.gif"));
                $this->parseCurrentBlock();
        }

Here is the call graph for this function:

ilTemplate::show ( part = "DEFAULT",
a_fill_tabs = true 
)

public

Parameters:
string 
bool fill template variable {TABS} with content of ilTabs

Definition at line 211 of file class.ilTemplate.php.

References $ilias, addErrorMessage(), addILIASFooter(), fillHeaderIcon(), fillMainMenu(), fillTabs(), getContentType(), handleReferer(), and setContentStyle().

Referenced by show().

        {
                global $ilias;
//echo "-".ilUtil::getP3PLocation()."-";
                //header('P3P: policyref="'.ilUtil::getP3PLocation().
                //      '", CP="CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa OUR BUS IND UNI COM NAV INT CNT STA PRE"');
                header('P3P: CP="CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa OUR BUS IND UNI COM NAV INT CNT STA PRE"');
                header("Content-type: " . $this->getContentType() . "; charset=UTF-8");

                $this->addErrorMessage();
                
                // display ILIAS footer
                if ($part !== false)
                {
                        $this->addILIASFooter();
                }

                // set standard parts (tabs and title icon)
                if($a_fill_tabs)
                {
                        $this->setContentStyle();
                        $this->fillMainMenu();
                        $this->fillTabs();
                        $this->fillHeaderIcon();
                }
                
                if ($part == "DEFAULT" or is_bool($part))
                {
                        parent::show();
                }
                else
                {
                        parent::show($part);
                }
                

                $this->handleReferer();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilTemplate::show ( part = "DEFAULT"  ) 

public

Parameters:
string 

Definition at line 72 of file class.ilTemplate.php.

References $_POST, $_SESSION, $key, addBlockFile(), blockExists(), and show().

        {
                header('Content-type: text/html; charset=UTF-8');

                // ERROR HANDLER SETS $_GET["message"] IN CASE OF $error_obj->MESSAGE
                if ($_SESSION["message"] || $_SESSION["info"])
                {
                        if ($this->blockExists("MESSAGE"))
                        {
                                $this->addBlockFile("MESSAGE", "message", "tpl.message.html");
#                       $this->setCurrentBlock("message");

                                $this->setVariable("MSG", $_SESSION["message"]);
                                $this->setVariable("INFO", $_SESSION["info"]);

                                session_unregister("message");
                                session_unregister("info");

#                       $this->parseCurrentBlock();
                        }
                }
                if ($part == "DEFAULT")
                {
                        parent::show();
                }
                else
                {
                        parent::show($part);
                }

                if (((substr(strrchr($_SERVER["PHP_SELF"],"/"),1) != "error.php")
                        && (substr(strrchr($_SERVER["PHP_SELF"],"/"),1) != "adm_menu.php")))
                {
                        $_SESSION["post_vars"] = $_POST;

                        // referer is modified if query string contains cmd=gateway and $_POST is not empty.
                        // this is a workaround to display formular again in case of error and if the referer points to another page
                        $url_parts = parse_url($_SERVER["REQUEST_URI"]);

                        if (preg_match("/cmd=gateway/",$url_parts["query"]))
                        {
                                foreach ($_POST as $key => $val)
                                {
                                        if (is_array($val))
                                        {
                                                $val = key($val);
                                        }

                                        $str .= "&".$key."=".$val;
                                }

                                $_SESSION["referer"] = preg_replace("/cmd=gateway/",substr($str,1),$_SERVER["REQUEST_URI"]);
                        }
                        else
                        {
                                $_SESSION["referer"] = $_SERVER["REQUEST_URI"];
                        }

                        unset($_SESSION["error_post_vars"]);
                }
        }

Here is the call graph for this function:

ilTemplate::stopTitleFloating (  ) 

stop floating (if no tabs are used)

Definition at line 770 of file class.ilTemplate.php.

References touchBlock().

        {
                $this->touchBlock("stop_floating");
        }

Here is the call graph for this function:

ilTemplate::touchBlock ( block  ) 

overwrites ITX::touchBlock.

public

Parameters:
string 
Returns:
???

Definition at line 472 of file class.ilTemplate.php.

References fillVars(), parseCurrentBlock(), and setCurrentBlock().

Referenced by setLocator(), and stopTitleFloating().

        {
                $this->setCurrentBlock($block);
                $count = $this->fillVars();
                $this->parseCurrentBlock();

                if ($count == 0)
                {
                        parent::touchBlock($block);
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

ilTemplate::$activeBlock

Definition at line 53 of file class.ilTemplate.php.

ilTemplate::$contenttype

Definition at line 40 of file class.ilTemplate.php.

ilTemplate::$vars

Definition at line 45 of file class.ilTemplate.php.

Referenced by prepareForFormular().


The documentation for this class was generated from the following files: