ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 }
42
44 {
46 }
47
49 {
50 $this->originalPresentationTitle = $originalPresentationTitle;
51 }
52
53 protected function isPageContainerToBeRendered()
54 {
55 return $this->getRenderPageContainer();
56 }
57
58 public function showPage()
59 {
61
62 $this->setPresentationTitle(self::TEMP_PRESENTATION_TITLE_PLACEHOLDER);
63
64 // fau: testNav - enable page toc as placeholder for info and actions block (see self::insertPageToc)
65 $config = $this->getPageConfig();
66 $config->setEnablePageToc('y');
67 $this->setPageConfig($config);
68 // fau.
69 return parent::showPage();
70 }
71
72 public function postOutputProcessing($output)
73 {
74 $output = str_replace(
75 self::TEMP_PRESENTATION_TITLE_PLACEHOLDER,
77 $output
78 );
79
80 $output = preg_replace("/src=\"\\.\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $output);
81
82 return $output;
83 }
84
85 // fau: testNav - support the addition of question info and actions below the title
86
91 public function setQuestionInfoHTML($a_html)
92 {
93 $this->questionInfoHTML = $a_html;
94 }
95
100 public function setQuestionActionsHTML($a_html)
101 {
102 $this->questionActionsHTML = $a_html;
103 }
104
113 public function insertPageToc($a_output)
114 {
115 if (!empty($this->questionInfoHTML) || !empty($this->questionActionsHTML)) {
116 $tpl = new ilTemplate('tpl.tst_question_subtitle_blocks.html', true, true, 'Modules/TestQuestionPool');
117 $tpl->setVariable('QUESTION_INFO', $this->questionInfoHTML);
118 $tpl->setVariable('QUESTION_ACTIONS', $this->questionActionsHTML);
119 $a_output = str_replace("{{{{{PageTOC}}}}}", $tpl->get(), $a_output);
120 } else {
121 $a_output = str_replace("{{{{{PageTOC}}}}}", '', $a_output);
122 }
123 return $a_output;
124 }
125 // fau.
126}
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.
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