/**
  * Add new item selection to current page incl. toolbar (trigger) and overlay
  */
 public function render()
 {
     global $ilToolbar, $tpl, $lng;
     if ($this->mode == ilObjectDefinition::MODE_WORKSPACE) {
         if (!$this->parsePersonalWorkspace()) {
             return;
         }
     } else {
         if (!$this->parseRepository()) {
             return;
         }
     }
     $ov_id = "il_add_new_item_ov";
     $ov_trigger_id = $ov_id . "_tr";
     include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     $adv = new ilAdvancedSelectionListGUI();
     $adv->setListTitle($lng->txt("cntr_add_new_item"));
     $this->getHTML();
     $adv->setGroupedList($this->gl);
     $adv->setStyle(ilAdvancedSelectionListGUI::STYLE_EMPH);
     $tpl->setVariable("SELECT_OBJTYPE_REPOS", $adv->getHTML());
     //$ilToolbar->addDropDown($lng->txt("cntr_add_new_item"), $this->getHTML());
     return;
     // toolbar
     include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
     $button = ilLinkButton::getInstance();
     $button->setId($ov_trigger_id);
     $button->setCaption("cntr_add_new_item");
     $button->setPrimary(true);
     $ilToolbar->addButtonInstance($button);
     // css?
     $tpl->setVariable("SELECT_OBJTYPE_REPOS", '<div id="' . $ov_id . '" style="display:none;" class="ilOverlay">' . $this->getHTML() . '</div>');
 }
 /**
  * @param $root_node
  */
 public function addToolbar($root_node)
 {
     global $lng, $ilToolbar, $ilLog;
     $create_list_gui = ilCloudConnector::getItemCreationListGUIClass($this->getService());
     $list_gui_html = $create_list_gui->getGroupedListItemsHTML($this->getPermUploadItems(), $this->getPermCreateFolders());
     if ($list_gui_html) {
         //toolbar
         $toolbar_locator = new ilLocatorGUI();
         $toolbar_locator->addItem($this->getGuiClass()->object->getTitle(), ilCloudPluginFileTreeGUI::getLinkToFolder($root_node));
         $ilToolbar->setId('xcld_toolbar');
         $ilToolbar->addText("<div class='xcld_locator'>" . $toolbar_locator->getHtml() . "</div>");
         $ilToolbar->addSeparator();
         include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
         $adv = new ilAdvancedSelectionListGUI();
         $adv->setListTitle($lng->txt("cld_add_new_item"));
         $ilCloudGroupedListGUI = $create_list_gui->getGroupedListItems($this->getPermUploadItems(), $this->getPermCreateFolders());
         if ($ilCloudGroupedListGUI->hasItems()) {
             $adv->setGroupedList($ilCloudGroupedListGUI);
         }
         $adv->setStyle(ilAdvancedSelectionListGUI::STYLE_EMPH);
         $ilToolbar->addText($adv->getHTML());
     }
 }