/** * show mail */ protected function showMail() { global $lng, $ilCtrl; include_once "./Services/Mail/classes/class.ilPDMailGUI.php"; $mail_gui = new ilPDMailGUI(); include_once "./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php"; $content_block = new ilPDContentBlockGUI(); $content_block->setContent($mail_gui->getPDMailHTML($_GET["mail_id"], $_GET["mobj_id"])); $content_block->setTitle($lng->txt("message")); $content_block->setColSpan(2); $content_block->setImage(ilUtil::getImagePath("icon_mail.png")); $content_block->addHeaderCommand($ilCtrl->getLinkTargetByClass("ilpersonaldesktopgui", "show"), $lng->txt("selected_items_back")); if ($_GET["mail_mode"] != "system") { $content_block->addBlockCommand("ilias.php?baseClass=ilMailGUI&mail_id=" . $_GET["mail_id"] . "&mobj_id=" . $_GET["mobj_id"] . "&type=reply", $lng->txt("reply")); $content_block->addBlockCommand("ilias.php?baseClass=ilMailGUI&mail_id=" . $_GET["mail_id"] . "&mobj_id=" . $_GET["mobj_id"] . "&type=read", $lng->txt("inbox")); $ilCtrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']); $content_block->addBlockCommand($ilCtrl->getLinkTarget($this, 'deleteMail'), $lng->txt('delete')); } else { $ilCtrl->setParameter($this, "mail_id", $_GET["mail_id"]); $ilCtrl->setParameter($this, "mobj_id", $_GET["mobj_id"]); $content_block->addBlockCommand($ilCtrl->getLinkTarget($this, "deleteMail"), $lng->txt("delete")); $ilCtrl->clearParameters($this); } return $content_block->getHTML(); }
/** * Show feed URL. */ function showFeedUrl() { global $lng, $ilCtrl, $ilUser; include_once "./Services/News/classes/class.ilNewsItem.php"; $title = ilObject::_lookupTitle($this->block_id); $tpl = new ilTemplate("tpl.show_feed_url.html", true, true, "Services/News"); $tpl->setVariable("TXT_TITLE", sprintf($lng->txt("news_feed_url_for"), $title)); $tpl->setVariable("TXT_INFO", $lng->txt("news_get_feed_info")); $tpl->setVariable("TXT_FEED_URL", $lng->txt("news_feed_url")); $tpl->setVariable("VAL_FEED_URL", ILIAS_HTTP_PATH . "/feed.php?client_id=" . rawurlencode(CLIENT_ID) . "&user_id=" . $ilUser->getId() . "&obj_id=" . $this->block_id . "&hash=" . ilObjUser::_lookupFeedHash($ilUser->getId(), true)); $tpl->setVariable("VAL_FEED_URL_TXT", ILIAS_HTTP_PATH . "/feed.php?client_id=" . rawurlencode(CLIENT_ID) . "&<br />user_id=" . $ilUser->getId() . "&obj_id=" . $this->block_id . "&hash=" . ilObjUser::_lookupFeedHash($ilUser->getId(), true)); include_once "./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php"; $content_block = new ilPDContentBlockGUI(); $content_block->setContent($tpl->get()); $content_block->setTitle($lng->txt("news_internal_news")); $content_block->setImage(ilUtil::getImagePath("icon_news.png")); $content_block->addHeaderCommand($ilCtrl->getParentReturn($this), $lng->txt("close"), true); return $content_block->getHTML(); }
/** * Show Feed Item */ function showFeedItem() { global $lng, $ilCtrl; include_once "./Services/News/classes/class.ilNewsItem.php"; $this->feed->fetch(); foreach ($this->feed->getItems() as $item) { if ($item->getId() == $_GET["feed_item_id"]) { $c_item = $item; break; } } $tpl = new ilTemplate("tpl.show_feed_item.html", true, true, "Services/Feeds"); if (is_object($c_item)) { if (trim($c_item->getSummary()) != "") { $tpl->setCurrentBlock("content"); $tpl->setVariable("VAL_CONTENT", $c_item->getSummary()); $tpl->parseCurrentBlock(); } if (trim($c_item->getDate()) != "" || trim($c_item->getAuthor()) != "") { $tpl->setCurrentBlock("date_author"); if (trim($c_item->getAuthor()) != "") { $tpl->setVariable("VAL_AUTHOR", $c_item->getAuthor() . " - "); } $tpl->setVariable("VAL_DATE", $c_item->getDate()); $tpl->parseCurrentBlock(); } if (trim($c_item->getLink()) != "") { $tpl->setCurrentBlock("plink"); $tpl->setVariable("HREF_LINK", $c_item->getLink()); $tpl->setVariable("TXT_LINK", $lng->txt("feed_open_source_page")); $tpl->parseCurrentBlock(); } $tpl->setVariable("VAL_TITLE", $c_item->getTitle()); // title } include_once "./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php"; $content_block = new ilPDContentBlockGUI(); $content_block->setContent($tpl->get()); $content_block->setTitle($this->getTitle()); $content_block->setImage(ilUtil::getImagePath("icon_feed.png")); $content_block->addHeaderCommand($ilCtrl->getParentReturn($this), $lng->txt("close"), true); return $content_block->getHTML(); }
/** * show single note */ function showNote() { global $lng, $ilCtrl; include_once "./Services/Notes/classes/class.ilNoteGUI.php"; $note_gui = new ilNoteGUI(); $note_gui->enableTargets(); include_once "./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php"; $content_block = new ilPDContentBlockGUI(); $content_block->setContent($note_gui->getPDNoteHTML($_GET["note_id"])); $content_block->setTitle($lng->txt("note")); $content_block->setColSpan(2); $content_block->setImage(ilUtil::getImagePath("icon_note.png")); $content_block->addHeaderCommand($ilCtrl->getLinkTargetByClass("ilpersonaldesktopgui", "show"), $lng->txt("selected_items_back")); return $content_block->getHTML(); }
/** * List resources for tag */ function showResourcesForTag() { global $lng, $ilCtrl, $ilUser, $objDefinition; $_GET["tag"] = str_replace("-->", "", $_GET["tag"]); $tpl = new ilTemplate("tpl.resources_for_tag.html", true, true, "Services/Tagging"); include_once "./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php"; $content_block = new ilPDContentBlockGUI(); $content_block->setColSpan(2); $content_block->setTitle(sprintf($lng->txt("tagging_resources_for_tag"), "<i>" . $_GET["tag"] . "</i>")); $content_block->setImage(ilUtil::getImagePath("icon_tag.svg")); $content_block->addHeaderCommand($ilCtrl->getParentReturn($this), $lng->txt("selected_items_back")); // get resources include_once "./Services/Tagging/classes/class.ilTagging.php"; $objs = ilTagging::getObjectsForTagAndUser($ilUser->getId(), $_GET["tag"]); $unaccessible = false; foreach ($objs as $key => $obj) { $ref_ids = ilObject::_getAllReferences($obj["obj_id"]); foreach ($ref_ids as $ref_id) { $type = $obj["obj_type"]; if ($type == "") { $unaccessible = true; continue; } // get list gui class for each object type if (empty($this->item_list_gui[$type])) { $class = $objDefinition->getClassName($type); $location = $objDefinition->getLocation($type); $full_class = "ilObj" . $class . "ListGUI"; include_once $location . "/class." . $full_class . ".php"; $this->item_list_gui[$type] = new $full_class(); $this->item_list_gui[$type]->enableDelete(false); $this->item_list_gui[$type]->enablePath(true); $this->item_list_gui[$type]->enableCut(false); $this->item_list_gui[$type]->enableCopy(false); $this->item_list_gui[$type]->enableSubscribe(false); $this->item_list_gui[$type]->enablePayment(false); $this->item_list_gui[$type]->enableLink(false); $this->item_list_gui[$type]->enableIcon(true); } $html = $this->item_list_gui[$type]->getListItemHTML($ref_id, $obj["obj_id"], ilObject::_lookupTitle($obj["obj_id"]), ilObject::_lookupDescription($obj["obj_id"])); if ($html != "") { $css = $css != "tblrow1" ? "tblrow1" : "tblrow2"; $tpl->setCurrentBlock("res_row"); $tpl->setVariable("ROWCLASS", $css); $tpl->setVariable("RESOURCE_HTML", $html); $tpl->setVariable("ALT_TYPE", $lng->txt("obj_" . $type)); $tpl->setVariable("IMG_TYPE", ilUtil::getImagePath("icon_" . $type . ".svg")); $tpl->parseCurrentBlock(); } else { $unaccessible = true; } } } if ($unaccessible) { $tpl->setCurrentBlock("no_access"); $tpl->setVariable("SOME_OBJ_WITHOUT_ACCESS", $lng->txt("tag_some_obj_tagged_without_access")); $ilCtrl->saveParameter($this, "tag"); $tpl->setVariable("HREF_REMOVE_TAGS", $ilCtrl->getLinkTarget($this, "removeTagsWithoutAccess")); $tpl->setVariable("REMOVE_TAGS", $lng->txt("tag_remove_tags_of_obj_without_access")); $tpl->parseCurrentBlock(); } $content_block->setContent($tpl->get()); //$content_block->setContent("test"); return $content_block->getHTML(); }
/** * Show feed URL. */ function showFeedUrl() { global $lng, $ilCtrl, $ilUser, $ilSetting; $news_set = new ilSetting("news"); include_once "./Services/News/classes/class.ilNewsItem.php"; if ($news_set->get("enable_private_feed") && $ilUser->_getFeedPass($_SESSION["AccountId"])) { $tpl = new ilTemplate("tpl.show_priv_feed_url.html", true, true, "Services/News"); $tpl->setVariable("IMG_PRIV_RSS", ilUtil::getImagePath("privrss.png")); $tpl->setVariable("TXT_PRIV_TITLE", $lng->txt("news_get_priv_feed_title")); $tpl->setVariable("TXT_PRIV_INFO", $lng->txt("news_get_priv_feed_info")); $tpl->setVariable("TXT_PRIV_FEED_URL", $lng->txt("news_feed_url")); $tpl->setVariable("VAL_PRIV_FEED_URL", str_replace("://", "://" . $ilUser->getLogin() . ":-password-@", ILIAS_HTTP_PATH) . "/privfeed.php?client_id=" . rawurlencode(CLIENT_ID) . "&user_id=" . $ilUser->getId() . "&hash=" . ilObjUser::_lookupFeedHash($ilUser->getId(), true)); $tpl->setVariable("VAL_PRIV_FEED_URL_TXT", str_replace("://", "://" . $ilUser->getLogin() . ":-password-@", ILIAS_HTTP_PATH) . "/privfeed.php?client_id=" . rawurlencode(CLIENT_ID) . "&<br />user_id=" . $ilUser->getId() . "&hash=" . ilObjUser::_lookupFeedHash($ilUser->getId(), true)); } else { $tpl = new ilTemplate("tpl.show_feed_url.html", true, true, "Services/News"); } $tpl->setVariable("TXT_TITLE", $lng->txt("news_get_feed_title")); $tpl->setVariable("TXT_INFO", $lng->txt("news_get_feed_info")); $tpl->setVariable("TXT_FEED_URL", $lng->txt("news_feed_url")); $tpl->setVariable("VAL_FEED_URL", ILIAS_HTTP_PATH . "/feed.php?client_id=" . rawurlencode(CLIENT_ID) . "&user_id=" . $ilUser->getId() . "&hash=" . ilObjUser::_lookupFeedHash($ilUser->getId(), true)); $tpl->setVariable("VAL_FEED_URL_TXT", ILIAS_HTTP_PATH . "/feed.php?client_id=" . rawurlencode(CLIENT_ID) . "&<br />user_id=" . $ilUser->getId() . "&hash=" . ilObjUser::_lookupFeedHash($ilUser->getId(), true)); include_once "./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php"; $content_block = new ilPDContentBlockGUI(); $content_block->setContent($tpl->get()); $content_block->setTitle($lng->txt("news_internal_news")); $content_block->setImage(ilUtil::getImagePath("icon_news.png")); $content_block->addHeaderCommand($ilCtrl->getParentReturn($this), $lng->txt("selected_items_back")); return $content_block->getHTML(); }