Public Member Functions | |
ilPublicSectionSelector ($a_target, &$a_lm_obj, $a_gui_class) | |
Constructor public. | |
formatHeader ($tpl, $a_obj_id, $a_option) | |
overwritten method from base class public | |
getOutput () | |
Creates output recursive method public. | |
formatObject (&$tpl, $a_node_id, $a_option, $a_obj_id=0) | |
Creates output recursive method private. | |
Data Fields | |
$root_id | |
$output | |
$ctrl | |
$selectable_type | |
$ref_id |
Definition at line 35 of file class.ilPublicSectionSelector.php.
ilPublicSectionSelector::formatHeader | ( | $ | tpl, | |
$ | a_obj_id, | |||
$ | a_option | |||
) |
overwritten method from base class public
integer | obj_id | |
integer | array options |
Definition at line 75 of file class.ilPublicSectionSelector.php.
References ilExplorer::$ilias, $lng, $tpl, and ilUtil::shortenText().
Referenced by getOutput().
{ global $lng, $ilias; //$tpl = new ilTemplate("tpl.tree_form.html", true, true); return; $tpl->setCurrentBlock("link"); $tpl->setVariable("TITLE", ilUtil::shortenText($this->lm_obj->getTitle(), $this->textwidth, true)); $tpl->setVariable("LINK_TARGET", $this->target); $tpl->setVariable("TARGET", " target=\"".$this->frame_target."\""); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("element"); $tpl->parseCurrentBlock(); //$this->output[] = $tpl->get(); }
ilPublicSectionSelector::formatObject | ( | &$ | tpl, | |
$ | a_node_id, | |||
$ | a_option, | |||
$ | a_obj_id = 0 | |||
) |
Creates output recursive method private.
integer | ||
array |
Reimplemented from ilExplorer.
Definition at line 162 of file class.ilPublicSectionSelector.php.
References $lng, $tpl, ilLMObject::_isPagePublic(), ilUtil::array_php2js(), ilUtil::getImagePath(), and ilUtil::shortenText().
Referenced by getOutput().
{ global $lng; if (!isset($a_node_id) or !is_array($a_option)) { $this->ilias->raiseError(get_class($this)."::formatObject(): Missing parameter or wrong datatype! ". "node_id: ".$a_node_id." options:".var_dump($a_option),$this->ilias->error_obj->WARNING); } //$tpl = new ilTemplate("tpl.tree_form.html", true, true); // build structurs without any icons or lines /* foreach ($a_option["tab"] as $picture) { $picture = "blank"; $tpl->setCurrentBlock("lines"); $tpl->setVariable("IMGPATH_LINES", ilUtil::getImagePath("browser/".$picture.".gif")); $tpl->parseCurrentBlock(); }*/ if ($this->output_icons) { $tpl->setCurrentBlock("icon"); $tpl->setVariable("ICON_IMAGE" ,ilUtil::getImagePath("icon_".$a_option["type"].".gif")); $tpl->setVariable("PAGE_ID" , $a_node_id); //$this->iconList[] = "iconid_".$a_node_id; $tpl->setVariable("TXT_ALT_IMG", $lng->txt($a_option["desc"])); $tpl->parseCurrentBlock(); } if (!$a_option["container"]) { $tpl->setCurrentBlock("checkbox"); $tpl->setVariable("PAGE_ID", $a_node_id); if (ilLMObject::_isPagePublic($a_node_id)) { $tpl->setVariable("CHECKED","checked=\"checked\""); } $tpl->parseCurrentBlock(); } else { $childs = $this->tree->getChilds($a_node_id); foreach ($childs as $node) { if ($node["type"] == "pg") { $pages[] = $node["child"]; } } $js_pages = ilUtil::array_php2js($pages); $tpl->setVariable("ONCLICK", " onclick=\"alterCheckboxes('PublicSelector','page_',$js_pages); return false;\""); } $tpl->setCurrentBlock("text"); $tpl->setVariable("PAGE_ID", $a_node_id); $tpl->setVariable("OBJ_TITLE", ilUtil::shortenText($a_option["title"], $this->textwidth, true)); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("element"); $tpl->parseCurrentBlock(); //$this->output[] = $tpl->get(); }
ilPublicSectionSelector::getOutput | ( | ) |
Creates output recursive method public.
Reimplemented from ilExplorer.
Definition at line 99 of file class.ilPublicSectionSelector.php.
References $ilBench, $key, $tpl, ilExplorer::createLines(), formatHeader(), formatObject(), ilExplorer::handleListEndTags(), and ilExplorer::handleListStartTags().
{ global $ilBench, $tpl; $ilBench->start("Explorer", "getOutput"); $this->format_options[0]["tab"] = array(); $depth = $this->tree->getMaximumDepth(); for ($i=0;$i<$depth;++$i) { $this->createLines($i); } // set global body class $tpl->setVariable("BODY_CLASS", "il_Explorer"); $tpl_tree = new ilTemplate("tpl.tree_form.html", true, true); $cur_depth = -1; foreach ($this->format_options as $key => $options) { //echo "-".$options["depth"]."-"; if (!$options["visible"]) { continue; } // end tags $this->handleListEndTags($tpl_tree, $cur_depth, $options["depth"]); // start tags $this->handleListStartTags($tpl_tree, $cur_depth, $options["depth"]); $cur_depth = $options["depth"]; if ($options["visible"] and $key != 0) { $this->formatObject($tpl_tree, $options["child"],$options,$options['obj_id']); } if ($key == 0) { $this->formatHeader($tpl_tree, $options["child"],$options); } } $this->handleListEndTags($tpl_tree, $cur_depth, -1); $ilBench->stop("Explorer", "getOutput"); return $tpl_tree->get(); }
ilPublicSectionSelector::ilPublicSectionSelector | ( | $ | a_target, | |
&$ | a_lm_obj, | |||
$ | a_gui_class | |||
) |
Constructor public.
string | scriptname | |
object | lm object | |
string | gui class name |
Definition at line 56 of file class.ilPublicSectionSelector.php.
References $ilCtrl, ilExplorer::forceExpandAll(), ilLMExplorer::ilLMExplorer(), and ilExplorer::setSessionExpandVariable().
{ global $ilCtrl; $this->ctrl =& $ilCtrl; $this->gui_class = $a_gui_class; parent::ilLMExplorer($a_target, $a_lm_obj); $this->forceExpandAll(true); $this->setSessionExpandVariable("lmpublicselectorexpand"); }
ilPublicSectionSelector::$ctrl |
Definition at line 44 of file class.ilPublicSectionSelector.php.
ilPublicSectionSelector::$output |
Reimplemented from ilLMExplorer.
Definition at line 43 of file class.ilPublicSectionSelector.php.
ilPublicSectionSelector::$ref_id |
Definition at line 47 of file class.ilPublicSectionSelector.php.
ilPublicSectionSelector::$root_id |
Reimplemented from ilLMExplorer.
Definition at line 42 of file class.ilPublicSectionSelector.php.
ilPublicSectionSelector::$selectable_type |
Definition at line 46 of file class.ilPublicSectionSelector.php.