ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilPortfolioTemplatePageGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Modules/Portfolio/classes/class.ilPortfolioPageGUI.php");
5
19{
20 public function getParentType()
21 {
22 return "prtt";
23 }
24
25 protected function getPageContentUserId($a_user_id)
26 {
28
29 // user
30 if (!$this->may_write) {
31 return $ilUser->getId();
32 }
33 // author
34 else {
35 return $a_user_id;
36 }
37 }
38
39 public function showPage()
40 {
41 if (!$this->getPageObject()) {
42 return;
43 }
44
45 switch ($this->getPageObject()->getType()) {
47 return $this->renderPageElement("BlogTemplate", $this->renderBlogTemplate());
48
49 default:
50
51 // needed for placeholders
52 include_once "Services/Style/Content/classes/class.ilObjStyleSheet.php";
53 $this->tpl->addCss(ilObjStyleSheet::getPlaceHolderStylePath());
54
55 return parent::showPage();
56 }
57 }
58
59 protected function renderPageElement($a_type, $a_html)
60 {
61 return parent::renderPageElement($a_type, $this->addPlaceholderInfo($a_html));
62 }
63
64 protected function addPlaceholderInfo($a_html)
65 {
66 return '<fieldset style="border: 1px dashed red; padding: 3px; margin: 5px;">' .
67 '<legend style="color: red; font-style: italic;" class="small">' .
68 $this->lng->txt("prtf_template_editor_placeholder_info") .
69 '</legend>' .
70 trim($a_html) .
71 '</fieldset>';
72 }
73
74 protected function renderBlogTemplate()
75 {
76 return $this->renderTeaser("blog_template", $this->lng->txt("obj_blog"));
77 }
78
85 public function getViewPageLink()
86 {
87 global $DIC;
88
89 $ctrl = $DIC->ctrl();
90
91 $ctrl->setParameterByClass("ilobjportfoliotemplategui", "user_page", $_GET["ppage"]);
92 return $ctrl->getLinkTargetByClass("ilobjportfoliotemplategui", "preview");
93 }
94
98 protected function getCourseSortAction($ctrl)
99 {
100 return $ctrl->getFormActionByClass("ilobjportfoliotemplategui", "preview");
101 }
102}
$_GET["client_id"]
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
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
$a_type
Definition: workflow.php:92