ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
4 require_once('./Services/COPage/classes/class.ilPageObjectGUI.php');
5 require_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 = '';
26  private $questionActionsHTML = '';
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 
43  public function getOriginalPresentationTitle()
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 }
$config
Definition: bootstrap.php:15
Class ilPageObjectGUI.
Question page GUI class.
setEnabledPageFocus($a_enabledpagefocus)
Set Enable page focus.
insertPageToc($a_output)
Replace page toc placeholder with question info and actions.
getPageConfig()
Get page config object.
special template class to simplify handling of ITX/PEAR
setPresentationTitle($a_title="")
__construct($a_id=0, $a_old_nr=0)
Constructor.
setPageConfig($a_val)
Set page config object.
setQuestionActionsHTML($a_html)
Set the HTML of a question actions block below the title.
getRenderPageContainer()
Get render page container.
setOriginalPresentationTitle($originalPresentationTitle)
setQuestionInfoHTML($a_html)
Set the HTML of a question info block below the title (number, status, ...)