/**
  * 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();
 }
 /**
  * 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();
 }
Ejemplo n.º 3
0
 /**
  * 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();
 }