/**
  * @param bool $show_upload
  * @param bool $show_create_folders
  *
  * @return ilCloudGroupedListGUI
  */
 public function getGroupedListItems($show_upload = false, $show_create_folders = false)
 {
     global $lng;
     $this->gl = new ilCloudGroupedListGUI();
     $this->addItemsBefore();
     $this->gl->setAsDropDown(true);
     if ($show_upload) {
         ilFileUploadGUI::initFileUpload();
         $icon_path = './Modules/Cloud/templates/images/icon_file_s.svg';
         $icon_path = ilUtil::getImagePath('icon_file.svg');
         $img = ilUtil::img($icon_path);
         $a_ttip = $lng->txt('cld_info_add_file_to_current_directory');
         $this->gl->addEntry($img . ' ' . $lng->txt('cld_add_file'), 'javascript:il.CloudFileList.uploadFile();', '_top', '', '', 'il_cld_add_file', $a_ttip, 'bottom center', 'top center', false);
     }
     if ($show_create_folders) {
         $icon_path = './Modules/Cloud/templates/images/icon_folder_s.svg';
         $icon_path = ilUtil::getImagePath('icon_fold.svg');
         $img1 = ilUtil::img($icon_path);
         $a_ttip1 = $lng->txt('cld_info_add_folder_to_current_directory');
         $this->gl->addEntry($img1 . ' ' . $lng->txt('cld_add_folder'), 'javascript:il.CloudFileList.createFolder();', '_top', '', '', 'il_cld_add_file', $a_ttip1, 'bottom center', 'top center', false);
     }
     $this->addItemsAfter();
     return $this->gl;
 }
 /**
  * Render help button
  *
  * @param
  * @return
  */
 function renderHelpButtons()
 {
     global $ilHelp, $lng, $ilCtrl, $tpl, $ilSetting, $ilUser;
     // screen id
     if (defined("OH_REF_ID") && OH_REF_ID > 0) {
         if ($ilHelp->getScreenId() != "") {
             if ($this->getMode() == self::MODE_FULL) {
                 $this->tpl->setCurrentBlock("screen_id");
                 $this->tpl->setVariable("SCREEN_ID", $ilHelp->getScreenId());
                 $this->tpl->parseCurrentBlock();
             }
         }
     }
     $help_active = false;
     include_once "./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php";
     $helpl = new ilGroupedListGUI();
     $helpl->setAsDropDown(true, true);
     if ($ilHelp->hasSections()) {
         $help_active = true;
         $lng->loadLanguageModule("help");
         //$this->tpl->setCurrentBlock("help_icon");
         // add javascript needed by help (to do: move to help class)
         $tpl->addJavascript("./Services/Help/js/ilHelp.js");
         include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
         $acc = new ilAccordionGUI();
         $acc->addJavascript();
         $acc->addCss();
         include_once "./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php";
         ilTooltipGUI::addTooltip("help_tr", $lng->txt("help_open_online_help"), "", "bottom center", "top center", false);
         $helpl->addEntry("<span>&nbsp;</span> " . $lng->txt("help_topcis"), "#", "", "il.Help.listHelp(event, false);");
     }
     $module_id = (int) $ilSetting->get("help_module");
     if ((OH_REF_ID > 0 || $module_id > 0) && $ilUser->getLanguage() == "de" && $ilSetting->get("help_mode") != "1") {
         $help_active = true;
         $lng->loadLanguageModule("help");
         $tpl->addJavascript("./Services/Help/js/ilHelp.js");
         include_once "./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php";
         ilTooltipGUI::addTooltip("help_tt", $lng->txt("help_toggle_tooltips"), "", "bottom center", "top center", false);
         $helpl->addEntry('<span id="help_tt_switch_on" class="glyphicon glyphicon-ok"></span> ' . $lng->txt("help_tooltips"), "#", "", "return il.Help.switchTooltips(event);");
     }
     if ($help_active) {
         $this->tpl->setCurrentBlock("help");
         $this->tpl->setVariable("TXT_HELP", $lng->txt("help"));
         $this->tpl->setVariable("HELP_SELECT", $helpl->getHTML());
         $this->tpl->parseCurrentBlock();
         // always set ajax url
         $ts = $ilCtrl->getTargetScript();
         $ilCtrl->setTargetScript("ilias.php");
         $ilHelp->setCtrlPar();
         $tpl->addOnLoadCode("il.Help.setAjaxUrl('" . $ilCtrl->getLinkTargetByClass("ilhelpgui", "", "", true) . "');");
         $ilCtrl->setTargetScript($ts);
     }
 }
 /**
  * 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();
 }
 /**
  * Get drop down
  */
 function getDropDown()
 {
     global $tree, $rbacsystem, $lng, $ilSetting, $objDefinition;
     $tpl = new ilTemplate("tpl.admin_drop_down.html", true, true, "Services/Administration");
     $objects = $tree->getChilds(SYSTEM_FOLDER_ID);
     foreach ($objects as $object) {
         $new_objects[$object["title"] . ":" . $object["child"]] = $object;
         //have to set it manually as translation type of main node cannot be "sys" as this type is a orgu itself.
         if ($object["type"] == "orgu") {
             $new_objects[$object["title"] . ":" . $object["child"]]["title"] = $lng->txt("obj_orgu");
         }
     }
     // add entry for switching to repository admin
     // note: please see showChilds methods which prevents infinite look
     $new_objects[$lng->txt("repository_admin") . ":" . ROOT_FOLDER_ID] = array("tree" => 1, "child" => ROOT_FOLDER_ID, "ref_id" => ROOT_FOLDER_ID, "depth" => 3, "type" => "root", "title" => $lng->txt("repository_admin"), "description" => $lng->txt("repository_admin_desc"), "desc" => $lng->txt("repository_admin_desc"));
     //$nd = $tree->getNodeData(SYSTEM_FOLDER_ID);
     //var_dump($nd);
     $new_objects[$lng->txt("general_settings") . ":" . SYSTEM_FOLDER_ID] = array("tree" => 1, "child" => SYSTEM_FOLDER_ID, "ref_id" => SYSTEM_FOLDER_ID, "depth" => 2, "type" => "adm", "title" => $lng->txt("general_settings"));
     ksort($new_objects);
     // determine items to show
     $items = array();
     foreach ($new_objects as $c) {
         // check visibility
         if ($tree->getParentId($c["ref_id"]) == ROOT_FOLDER_ID && $c["type"] != "adm" && $_GET["admin_mode"] != "repository") {
             continue;
         }
         // these objects may exist due to test cases that didnt clear
         // data properly
         if ($c["type"] == "" || $c["type"] == "objf" || $c["type"] == "xxx") {
             continue;
         }
         $accessible = $rbacsystem->checkAccess('visible,read', $c["ref_id"]);
         if (!$accessible) {
             continue;
         }
         if ($c["ref_id"] == ROOT_FOLDER_ID && !$rbacsystem->checkAccess('write', $c["ref_id"])) {
             continue;
         }
         if ($c["type"] == "rolf" && $c["ref_id"] != ROLE_FOLDER_ID) {
             continue;
         }
         $items[] = $c;
     }
     $cnt = 0;
     $titems = array();
     foreach ($items as $i) {
         $titems[$i["type"]] = $i;
     }
     // admin menu layout
     $layout = array(1 => array("basic" => array("adm", "stys", "adve", "lngf", "cmps", "accs", "hlps", "trac"), "users" => array("usrf", 'tos', "rolf", "auth", "ps", "orgu")), 2 => array("services" => array("pdts", "nwss", "tags", "prfa", "skmg", "cals", "mail", "---", "seas", "mds", "taxs", "cert", 'ecss', "pays", "extt")), 3 => array("objects" => array("reps", "---", "bibs", "blga", "chta", "crss", "excs", "facs", "frma", "grps", "lrss", "mcts", "mobs", "svyf", "assf", "wbrs", "wiks", "---", 'otpl', "root", "recf")));
     // now get all items and groups that are accessible
     $groups = array();
     for ($i = 1; $i <= 3; $i++) {
         $groups[$i] = array();
         foreach ($layout[$i] as $group => $entries) {
             $groups[$i][$group] = array();
             $entries_since_last_sep = false;
             foreach ($entries as $e) {
                 if ($e == "---" || $titems[$e]["type"] != "") {
                     if ($e == "---" && $entries_since_last_sep) {
                         $groups[$i][$group][] = $e;
                         $entries_since_last_sep = false;
                     } else {
                         if ($e != "---") {
                             $groups[$i][$group][] = $e;
                             $entries_since_last_sep = true;
                         }
                     }
                 }
             }
         }
     }
     include_once "./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php";
     $gl = new ilGroupedListGUI();
     $gl->setAsDropDown(true);
     for ($i = 1; $i <= 3; $i++) {
         if ($i > 1) {
             $gl->nextColumn();
         }
         foreach ($groups[$i] as $group => $entries) {
             if (count($entries) > 0) {
                 $gl->addGroupHeader($lng->txt("adm_" . $group));
                 foreach ($entries as $e) {
                     if ($e == "---") {
                         $gl->addSeparator();
                     } else {
                         $path = ilObject::_getIcon("", "tiny", $titems[$e]["type"]);
                         $icon = $path != "" ? ilUtil::img($path) . " " : "";
                         if ($_GET["admin_mode"] == "settings" && $titems[$e]["ref_id"] == ROOT_FOLDER_ID) {
                             $gl->addEntry($icon . $titems[$e]["title"], "ilias.php?baseClass=ilAdministrationGUI&amp;ref_id=" . $titems[$e]["ref_id"] . "&amp;admin_mode=repository", "_top", "", "", "mm_adm_rep", ilHelp::getMainMenuTooltip("mm_adm_rep"), "bottom center", "top center", false);
                         } else {
                             $gl->addEntry($icon . $titems[$e]["title"], "ilias.php?baseClass=ilAdministrationGUI&amp;ref_id=" . $titems[$e]["ref_id"] . "&amp;cmd=jump", "_top", "", "", "mm_adm_" . $titems[$e]["type"], ilHelp::getMainMenuTooltip("mm_adm_" . $titems[$e]["type"]), "bottom center", "top center", false);
                         }
                     }
                 }
             }
         }
     }
     //$gl->addSeparator();
     echo $gl->getHTML();
     exit;
 }