/** * Get list data (for flat list). */ function getListRowData() { global $ilUser, $lng, $ilCtrl; include_once "./Services/Bookmarks/classes/class.ilBookmarkFolder.php"; $data = array(); $sess_cur_bm_folder = ""; if (isset($_SESSION["ilCurBMFolder"])) { $sess_cur_bm_folder = $_SESSION["ilCurBMFolder"]; } $bm_items = ilBookmarkFolder::getObjects($sess_cur_bm_folder); if (!ilBookmarkFolder::isRootFolder($sess_cur_bm_folder) && !empty($_SESSION["ilCurBMFolder"])) { $ilCtrl->setParameter($this, "curBMFolder", ilBookmarkFolder::_getParentId($sess_cur_bm_folder)); $data[] = array("img" => ilUtil::getImagePath("icon_cat_s.png"), "alt" => $lng->txt("bmf"), "title" => "..", "link" => $ilCtrl->getLinkTarget($this, "setCurrentBookmarkFolder")); $this->setTitle($this->getTitle() . ": " . ilBookmarkFolder::_lookupTitle($sess_cur_bm_folder)); } foreach ($bm_items as $bm_item) { switch ($bm_item["type"]) { case "bmf": $ilCtrl->setParameter($this, "curBMFolder", $bm_item["obj_id"]); $data[] = array("img" => ilUtil::getImagePath("icon_cat_s.png"), "alt" => $lng->txt("bmf"), "title" => ilUtil::prepareFormOutput($bm_item["title"]), "desc" => ilUtil::prepareFormOutput($bm_item["desc"]), "link" => $ilCtrl->getLinkTarget($this, "setCurrentBookmarkFolder"), "target" => ""); break; case "bm": $data[] = array("img" => ilUtil::getImagePath("spacer.png"), "alt" => $lng->txt("bm"), "title" => ilUtil::prepareFormOutput($bm_item["title"]), "desc" => ilUtil::prepareFormOutput($bm_item["desc"]), "link" => ilUtil::prepareFormOutput($bm_item["target"]), "target" => "_blank"); break; } } $this->setData($data); }
/** * recursive methode generates bookmark output for export * * @param array node date * @param int depth of recursion * @param bool true for recursive export * @access private */ function __parseExport($object, $depth = 1, $recursive = true) { switch ($object['type']) { case 'bm': $result .= str_repeat("\t", $depth); $result .= '<DT><A HREF="' . ilUtil::prepareFormOutput($object['target']) . '" '; $result .= 'ADD_DATE="' . intval(0) . '" '; $result .= 'LAST_VISIT="' . intval(0) . '" '; $result .= 'LAST_MODIFIED="' . intval(0) . '">'; $result .= ilUtil::prepareFormOutput($object['title']) . '</A>' . "\n"; if ($object['description']) { $result .= '<DD>' . ilUtil::prepareFormOutput($object['description']) . "\n"; } break; case 'bmf': $result .= str_repeat("\t", $depth) . '<DT><H3 ADD_DATE="0">' . ilUtil::prepareFormOutput($object['title']) . '</H3>' . "\n"; if ($object['description']) { $result .= '<DD>' . ilUtil::prepareFormOutput($object['description']) . "\n"; } $result .= str_repeat("\t", $depth) . '<DL><p>' . "\n"; if ($recursive) { $depth++; $sub_objects = ilBookmarkFolder::getObjects($object['child']); foreach ($sub_objects as $sub_object) { $result .= ilBookmarkImportExport::__parseExport($sub_object, $depth, $recursive); } $depth--; } $result .= str_repeat("\t", $depth) . '</DL><p>' . "\n"; break; } return $result; }
function view() { if ($this->id > 0 && !$this->tree->isInTree($this->id)) { $this->ctrl->setParameter($this, 'bmf_id', ''); $this->ctrl->redirect($this); } $objects = ilBookmarkFolder::getObjects($this->id); include_once 'Services/Bookmarks/classes/class.ilBookmarkAdministrationTableGUI.php'; $table = new ilBookmarkAdministrationTableGUI($this); $table->setId('bookmark_adm_table'); $table->setData($objects); $this->tpl->setVariable("ADM_CONTENT", $table->getHTML()); }
function view() { global $ilToolbar; if ($this->id > 0 && !$this->tree->isInTree($this->id)) { $this->ctrl->setParameter($this, 'bmf_id', ''); $this->ctrl->redirect($this); } $ilToolbar->addButton($this->lng->txt("bookmark_new"), $this->ctrl->getLinkTarget($this, "newFormBookmark")); $ilToolbar->addButton($this->lng->txt("bookmark_folder_new"), $this->ctrl->getLinkTarget($this, "newFormBookmarkFolder")); $objects = ilBookmarkFolder::getObjects($this->id); include_once 'Services/Bookmarks/classes/class.ilBookmarkAdministrationTableGUI.php'; $table = new ilBookmarkAdministrationTableGUI($this); $table->setId('bookmark_adm_table'); $table->setData($objects); $this->tpl->setVariable("ADM_CONTENT", $table->getHTML()); }