ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilPortfolioTemplatePageGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
14{
15 public function getParentType()
16 {
17 return "prtt";
18 }
19
20 protected function getPageContentUserId($a_user_id)
21 {
23
24 // user
25 if (!$this->may_write) {
26 return $ilUser->getId();
27 }
28 // author
29 else {
30 return $a_user_id;
31 }
32 }
33
34 public function showPage()
35 {
36 if (!$this->getPageObject()) {
37 return;
38 }
39
40 switch ($this->getPageObject()->getType()) {
42 return $this->renderPageElement("BlogTemplate", $this->renderBlogTemplate());
43
44 default:
45
46 // needed for placeholders
47 $this->tpl->addCss(ilObjStyleSheet::getPlaceHolderStylePath());
48
49 return parent::showPage();
50 }
51 }
52
53 protected function renderPageElement($a_type, $a_html)
54 {
55 return parent::renderPageElement($a_type, $this->addPlaceholderInfo($a_html));
56 }
57
58 protected function addPlaceholderInfo($a_html)
59 {
60 return '<fieldset style="border: 1px dashed red; padding: 3px; margin: 5px;">' .
61 '<legend style="color: red; font-style: italic;" class="small">' .
62 $this->lng->txt("prtf_template_editor_placeholder_info") .
63 '</legend>' .
64 trim($a_html) .
65 '</fieldset>';
66 }
67
68 protected function renderBlogTemplate()
69 {
70 return $this->renderTeaser("blog_template", $this->lng->txt("obj_blog"));
71 }
72
79 public function getViewPageLink()
80 {
81 global $DIC;
82
83 $ctrl = $DIC->ctrl();
84
85 $ctrl->setParameterByClass("ilobjportfoliotemplategui", "user_page", $this->requested_ppage);
86 return $ctrl->getLinkTargetByClass("ilobjportfoliotemplategui", "preview");
87 }
88
92 protected function getCourseSortAction($ctrl)
93 {
94 return $ctrl->getFormActionByClass("ilobjportfoliotemplategui", "preview");
95 }
96}
An exception for terminatinating execution or to throw for unit testing.
static getPlaceHolderStylePath()
get placeholder style path (for Page Layouts)
getPageObject()
Get Page Object.
Portfolio page gui class.
renderTeaser($a_type, $a_title, $a_options=null)
Portfolio template page gui class.
getCourseSortAction($ctrl)
Get course sort action.string
$ilUser
Definition: imgupload.php:18
$a_type
Definition: workflow.php:92
$DIC
Definition: xapitoken.php:46