/**
  * Show list of portfolio pages
  */
 public function view()
 {
     global $ilToolbar, $ilSetting, $tree;
     if (!$this->checkPermissionBool("write")) {
         $this->ctrl->redirect($this, "infoScreen");
     }
     $this->tabs_gui->activateTab("pages");
     include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
     $button = ilLinkButton::getInstance();
     $button->setCaption("prtf_add_page");
     $button->setUrl($this->ctrl->getLinkTarget($this, "addPage"));
     $ilToolbar->addButtonInstance($button);
     if (!$ilSetting->get('disable_wsp_blogs')) {
         $button = ilLinkButton::getInstance();
         $button->setCaption("prtf_add_blog");
         $button->setUrl($this->ctrl->getLinkTarget($this, "addBlog"));
         $ilToolbar->addButtonInstance($button);
     }
     $ilToolbar->addSeparator();
     $button = ilLinkButton::getInstance();
     $button->setCaption("export_html");
     $button->setUrl($this->ctrl->getLinkTarget($this, "export"));
     $ilToolbar->addButtonInstance($button);
     include_once "Modules/Portfolio/classes/class.ilPortfolioPageTableGUI.php";
     $table = new ilPortfolioPageTableGUI($this, "view");
     // exercise portfolio?
     include_once "Modules/Exercise/classes/class.ilObjExercise.php";
     $exercises = ilObjExercise::findUserFiles($this->user_id, $this->object->getId());
     if ($exercises) {
         $info = array();
         foreach ($exercises as $exercise) {
             // #9988
             $active_ref = false;
             foreach (ilObject::_getAllReferences($exercise["obj_id"]) as $ref_id) {
                 if (!$tree->isSaved($ref_id)) {
                     $active_ref = true;
                     break;
                 }
             }
             if ($active_ref) {
                 $part = $this->getExerciseInfo($exercise["ass_id"], $table->dataExists());
                 if ($part) {
                     $info[] = $part;
                 }
             }
         }
         if (sizeof($info)) {
             ilUtil::sendInfo(implode("<br />", $info));
         }
     }
     $this->tpl->setContent($table->getHTML());
 }
 /**
  * Render object context
  */
 function render()
 {
     global $tpl, $ilTabs, $ilCtrl, $lng, $ilToolbar, $ilUser, $tree;
     if (!$this->checkPermissionBool("read")) {
         ilUtil::sendInfo($lng->txt("no_permission"));
         return;
     }
     $ilTabs->activateTab("content");
     // toolbar
     if ($this->mayContribute()) {
         $ilToolbar->setFormAction($ilCtrl->getFormAction($this, "createPosting"));
         include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
         $title = new ilTextInputGUI($lng->txt("title"), "title");
         $ilToolbar->addInputItem($title, $lng->txt("title"));
         $ilToolbar->addFormButton($lng->txt("blog_add_posting"), "createPosting");
         // exercise blog?
         include_once "Modules/Exercise/classes/class.ilObjExercise.php";
         $exercises = ilObjExercise::findUserFiles($ilUser->getId(), $this->node_id);
         if ($exercises) {
             $info = array();
             foreach ($exercises as $exercise) {
                 // #9988
                 $active_ref = false;
                 foreach (ilObject::_getAllReferences($exercise["obj_id"]) as $ref_id) {
                     if (!$tree->isSaved($ref_id)) {
                         $active_ref = true;
                         break;
                     }
                 }
                 if ($active_ref) {
                     $part = $this->getExerciseInfo($exercise["ass_id"]);
                     if ($part) {
                         $info[] = $part;
                     }
                 }
             }
             if (sizeof($info)) {
                 ilUtil::sendInfo(implode("<br />", $info));
             }
         }
     }
     $list_items = $this->getListItems();
     $list = $nav = "";
     if ($list_items) {
         // $is_owner = ($this->object->getOwner() == $ilUser->getId());
         $is_owner = $this->mayContribute();
         $list = $this->renderList($list_items, $this->month, "preview", null, $is_owner);
         $nav = $this->renderNavigation($this->items, "render", "preview", null, $is_owner);
     }
     $this->setContentStyleSheet();
     $tpl->setContent($list);
     $tpl->setRightContent($nav);
 }
 /**
  * Show list of portfolio pages
  */
 protected function pages()
 {
     global $tpl, $lng, $ilToolbar, $ilCtrl, $ilTabs, $ilUser, $ilSetting, $tree;
     if (!$this->checkAccess("write")) {
         return;
     }
     $ilTabs->clearTargets();
     $ilCtrl->setParameter($this, "prt_id", "");
     $ilTabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, "show"));
     $ilCtrl->setParameter($this, "prt_id", $this->portfolio->getId());
     $this->setPagesTabs();
     $ilTabs->activateTab("pages");
     $ilToolbar->addButton($lng->txt("prtf_add_page"), $ilCtrl->getLinkTarget($this, "addPage"));
     if (!$ilSetting->get('disable_wsp_blogs')) {
         $ilToolbar->addButton($lng->txt("prtf_add_blog"), $ilCtrl->getLinkTarget($this, "addBlog"));
     }
     $ilToolbar->addSeparator();
     $ilToolbar->addButton($lng->txt("export"), $ilCtrl->getLinkTarget($this, "export"));
     include_once "Services/Portfolio/classes/class.ilPortfolioPageTableGUI.php";
     $table = new ilPortfolioPageTableGUI($this, "pages", $this->portfolio);
     // exercise portfolio?
     include_once "Modules/Exercise/classes/class.ilObjExercise.php";
     $exercises = ilObjExercise::findUserFiles($ilUser->getId(), $this->portfolio->getId());
     if ($exercises) {
         $info = array();
         foreach ($exercises as $exercise) {
             // #9988
             $active_ref = false;
             foreach (ilObject::_getAllReferences($exercise["obj_id"]) as $ref_id) {
                 if (!$tree->isSaved($ref_id)) {
                     $active_ref = true;
                     break;
                 }
             }
             if ($active_ref) {
                 $part = $this->getExerciseInfo($exercise["ass_id"], $table->dataExists());
                 if ($part) {
                     $info[] = $part;
                 }
             }
         }
         if (sizeof($info)) {
             ilUtil::sendInfo(implode("<br />", $info));
         }
     }
     $tpl->setContent($table->getHTML());
 }