ILIAS  release_8 Revision v8.24
class.ilPortfolioTemplatePageGUI.php
Go to the documentation of this file.
1<?php
2
28{
29 protected bool $may_write = false;
30
31 public function getParentType(): string
32 {
33 return "prtt";
34 }
35
36 protected function getPageContentUserId(int $a_user_id): int
37 {
39
40 // user
41 if (!$this->may_write) {
42 return $ilUser->getId();
43 }
44 // author
45 return $a_user_id;
46 }
47
48 public function showPage(): string
49 {
50 if (!$this->getPageObject()) {
51 return "";
52 }
53
54 switch ($this->getPageObject()->getType()) {
56 return $this->renderPageElement("BlogTemplate", $this->renderBlogTemplate());
57
58 default:
59
60 // needed for placeholders
61 $this->tpl->addCss(ilObjStyleSheet::getPlaceHolderStylePath());
62
63 return parent::showPage();
64 }
65 }
66
67 protected function renderPageElement(
68 string $a_type,
69 string $a_html
70 ): string {
71 return parent::renderPageElement($a_type, $this->addPlaceholderInfo($a_html));
72 }
73
74 protected function addPlaceholderInfo(string $a_html): string
75 {
76 return '<fieldset style="border: 1px dashed red; padding: 3px; margin: 5px;">' .
77 '<legend style="color: red; font-style: italic;" class="small">' .
78 $this->lng->txt("prtf_template_editor_placeholder_info") .
79 '</legend>' .
80 trim($a_html) .
81 '</fieldset>';
82 }
83
84 protected function renderBlogTemplate(): string
85 {
86 return $this->renderTeaser("blog_template", $this->lng->txt("obj_blog"));
87 }
88
89 public function getViewPageLink(): string
90 {
91 global $DIC;
92
93 $ctrl = $DIC->ctrl();
94
95 $ctrl->setParameterByClass("ilobjportfoliotemplategui", "user_page", $this->requested_ppage);
96 return $ctrl->getLinkTargetByClass("ilobjportfoliotemplategui", "preview");
97 }
98
99 protected function getCourseSortAction(ilCtrl $ctrl): string
100 {
101 return $ctrl->getFormActionByClass("ilobjportfoliotemplategui", "preview");
102 }
103
104 public function finishEditing(): void
105 {
106 $this->ctrl->redirectByClass("ilObjPortfolioTemplateGUI", "view");
107 }
108}
Class ilCtrl provides processing control methods.
getFormActionByClass( $a_class, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
renderPageElement(string $a_type, string $a_html)
getCourseSortAction(ilCtrl $ctrl)
Get course sort action.
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34