ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilAssQuestionPageGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once('./Services/COPage/classes/class.ilPageObjectGUI.php');
5require_once('./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php');
6
19{
20 const TEMP_PRESENTATION_TITLE_PLACEHOLDER = '___TEMP_PRESENTATION_TITLE_PLACEHOLDER___';
21
23
24 // fau: testNav - variables for info and actions HTML
25 private $questionInfoHTML = '';
27 // fau.
28
37 public function __construct($a_id = 0, $a_old_nr = 0)
38 {
39 parent::__construct('qpl', $a_id, $a_old_nr);
40 $this->setEnabledPageFocus(false);
41 if (strtolower($_GET['cmdClass']) === 'ilassquestionpreviewgui') {
42 $this->setFileDownloadLink($this->ctrl->getLinkTargetByClass(ilObjQuestionPoolGUI::class, 'downloadFile'));
43 } else {
44 $this->setFileDownloadLink($this->ctrl->getLinkTargetByClass(ilObjTestGUI::class, 'downloadFile'));
45 }
46 }
47
49 {
51 }
52
54 {
55 $this->originalPresentationTitle = $originalPresentationTitle;
56 }
57
58 protected function isPageContainerToBeRendered()
59 {
60 return $this->getRenderPageContainer();
61 }
62
63 public function showPage()
64 {
65 if ($this->getPresentationTitle() !== null) {
67 $this->setPresentationTitle(self::TEMP_PRESENTATION_TITLE_PLACEHOLDER);
68 }
69
70 // fau: testNav - enable page toc as placeholder for info and actions block (see self::insertPageToc)
71 $config = $this->getPageConfig();
72 $config->setEnablePageToc('y');
73 $this->setPageConfig($config);
74 // fau.
75 return parent::showPage();
76 }
77
78 public function finishEditing()
79 {
80 $this->ctrl->redirectByClass('ilAssQuestionPreviewGUI', ilAssQuestionPreviewGUI::CMD_SHOW);
81 }
82
83 public function postOutputProcessing($output)
84 {
85 $output = str_replace(
86 self::TEMP_PRESENTATION_TITLE_PLACEHOLDER,
88 $output
89 );
90
91 $output = preg_replace("/src=\"\\.\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $output);
92
93 return $output;
94 }
95
96 // fau: testNav - support the addition of question info and actions below the title
97
102 public function setQuestionInfoHTML($a_html)
103 {
104 $this->questionInfoHTML = $a_html;
105 }
106
111 public function setQuestionActionsHTML($a_html)
112 {
113 $this->questionActionsHTML = $a_html;
114 }
115
124 public function insertPageToc($a_output)
125 {
126 if (!empty($this->questionInfoHTML) || !empty($this->questionActionsHTML)) {
127 $tpl = new ilTemplate('tpl.tst_question_subtitle_blocks.html', true, true, 'Modules/TestQuestionPool');
128 $tpl->setVariable('QUESTION_INFO', $this->questionInfoHTML);
129 $tpl->setVariable('QUESTION_ACTIONS', $this->questionActionsHTML);
130 $a_output = str_replace("{{{{{PageTOC}}}}}", $tpl->get(), $a_output);
131 } else {
132 $a_output = str_replace("{{{{{PageTOC}}}}}", '', $a_output);
133 }
134 return $a_output;
135 }
136 // fau.
137}
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
Question page GUI class.
postOutputProcessing($output)
Finalizing output processing.
setQuestionInfoHTML($a_html)
Set the HTML of a question info block below the title (number, status, ...)
__construct($a_id=0, $a_old_nr=0)
Constructor.
insertPageToc($a_output)
Replace page toc placeholder with question info and actions.
setQuestionActionsHTML($a_html)
Set the HTML of a question actions block below the title.
setOriginalPresentationTitle($originalPresentationTitle)
showPage()
display content of page
Class ilPageObjectGUI.
setPresentationTitle($a_title="")
setPageConfig($a_val)
Set page config object.
getPageConfig()
Get page config object.
setFileDownloadLink($a_download_link)
Set file download link.
setEnabledPageFocus($a_enabledpagefocus)
Set Enable page focus.
getRenderPageContainer()
Get render page container.
special template class to simplify handling of ITX/PEAR
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc