/** * Get rendered html of sub object list * * @return string */ protected function getHTML() { global $ilCtrl; if ($this->mode != ilObjectDefinition::MODE_WORKSPACE && !isset($this->url_creation)) { $base_url = "ilias.php?baseClass=ilRepositoryGUI&ref_id=" . $this->parent_ref_id . "&cmd=create"; } else { $base_url = $this->url_creation; } $base_url = $ilCtrl->appendRequestTokenParameterString($base_url); if ($this->url_creation_callback) { $base_url .= "&crtcb=" . $this->url_creation_callback; } include_once "./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php"; $gl = new ilGroupedListGUI(); $gl->setAsDropDown(true, true); foreach ($this->sub_objects as $item) { switch ($item["type"]) { case "column_separator": $gl->nextColumn(); break; /* case "separator": $gl->addSeparator(); break; */ /* case "separator": $gl->addSeparator(); break; */ case "group": $gl->addGroupHeader($item["title"]); break; case "object": $type = $item["value"]; $path = ilObject::_getIcon('', 'tiny', $type); $icon = $path != "" ? ilUtil::img($path) . " " : ""; $url = $base_url . "&new_type=" . $type; $ttip = ilHelp::getObjCreationTooltipText($type); $gl->addEntry($icon . $item["title"], $url, "_top", "", "", $type, $ttip, "bottom center", "top center", false); break; } } $this->gl = $gl; return $gl->getHTML(); }
/** * Put admin panel into template: * - creation selector * - admin view on/off button */ function fillAdminPanel() { global $lng, $ilHelp; $adm_view_cmp = $adm_cmds = $creation_selector = $adm_view = false; $toolb = new ilToolbarGUI(); // admin panel commands if (count($this->admin_panel_commands) > 0) { foreach ($this->admin_panel_commands as $cmd) { $toolb->addFormButton($cmd["txt"], $cmd["cmd"]); } $adm_cmds = true; } elseif ($this->admin_panel_commands_toolbar instanceof ilToolbarGUI) { $toolb = $this->admin_panel_commands_toolbar; $adm_cmds = true; } // Add arrow if desired if ($this->admin_panel_arrow) { $toolb->setLeadingImage(ilUtil::getImagePath("arrow_upright.png"), $lng->txt("actions")); } if ($adm_cmds) { $this->fillPageFormAction(); $this->setCurrentBlock("adm_view_components"); $this->setVariable("ADM_PANEL1", $toolb->getHTML()); $this->parseCurrentBlock(); $adm_view_cmp = true; } // admin view button if ($this->page_actions != "") { $this->setVariable("PAGE_ACTIONS", $this->page_actions); $adm_view = true; } // creation selector if (is_array($this->creation_selector)) { $this->setCurrentBlock("add_commands"); if ($adm_cmds) { $this->setVariable("ADD_COM_WIDTH", 'width="1"'); } include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php"; $selection = new ilAdvancedSelectionListGUI(); $selection->setListTitle($lng->txt("cntr_add_new_item")); $selection->setId("item_creation"); $selection->setHeaderIcon(ilUtil::getImagePath("cmd_add_s.png")); $selection->setItemLinkClass("xsmall"); $selection->setUseImages(true); foreach ($this->creation_selector["options"] as $item) { $link = $this->page_form_action . "&new_type=" . $item["value"]; $link = str_replace("cmd=post", "cmd=" . $this->creation_selector["command"], $link); $ttip = ilHelp::getObjCreationTooltipText($item["value"]); $selection->addItem($item["title"], $item["value"], $link, $item["img"], $item["title"], "", "", false, "", $ttip, "right center", "left center", false); } $this->setVariable("SELECT_OBJTYPE_REPOS", $selection->getHTML()); $this->setVariable("CENTER_COL_CLASS", trim($this->right_content) != "" ? "one_side_col" : ""); $this->parseCurrentBlock(); $creation_selector = true; } if ($adm_cmds and $this->admin_panel_bottom) { $this->setCurrentBlock("adm_view_components2"); if ($this->admin_panel_arrow) { $toolb->setLeadingImage(ilUtil::getImagePath("arrow_downright.png"), $lng->txt("actions")); } $this->setVariable("ADM_PANEL2", $toolb->getHTML()); $this->parseCurrentBlock(); } }