ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
class.ilTrackedQuestionsTableGUI.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/Table/classes/class.ilTable2GUI.php';
5
14{
15 protected $show_postponed;
16 protected $show_marker;
17
25 public function __construct($a_parent_obj, $a_parent_cmd, $show_postponed, $show_marker)
26 {
27 parent::__construct($a_parent_obj, $a_parent_cmd);
28
29 global $lng, $ilCtrl;
30
31 $this->lng = $lng;
32 $this->ctrl = $ilCtrl;
33 $this->show_postponed = $show_postponed;
34 $this->show_marker = $show_marker;
35
36 $this->setFormName('trackedquestions');
37 $this->setStyle('table', 'fullwidth');
38
39 $this->addColumn($this->lng->txt("tst_question_title"),'title', '');
40
41 if ($this->show_postponed)
42 {
43 $this->addColumn($this->lng->txt("postpone_status") ,'postponed', '');
44 }
45
46 if ($this->show_marker)
47 {
48 $this->addColumn($this->lng->txt("tst_question_marker"),'marked', '');
49 }
50
51 $this->setTitle($this->lng->txt('tst_tracked_question_list'));
52
53 $this->setRowTemplate("tpl.il_as_tst_tracked_questions_row.html", "Modules/Test");
54
55 $this->addCommandButton('showQuestion', $this->lng->txt('back'));
56
57 $this->setLimit(PHP_INT_MAX);
58
59 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
60
61 $this->enable('header');
62 $this->disable('sort');
63 $this->disable('select_all');
64 }
65
73 public function fillRow($data)
74 {
75 if (strlen($data['description']))
76 {
77 $this->tpl->setCurrentBlock('description');
78 $this->tpl->setVariable("DESCRIPTION", ilUtil::prepareFormOutput($data['description']));
79 $this->tpl->parseCurrentBlock();
80 }
81
82 if( $this->show_postponed )
83 {
84 if($data['postponed'])
85 {
86 $this->tpl->setCurrentBlock('postponed');
87 $this->tpl->setVariable('POSTPONED', $this->lng->txt('postponed'));
88 $this->tpl->parseCurrentBlock();
89 }
90 else
91 {
92 $this->tpl->setCurrentBlock('postponed');
93 $this->tpl->touchBlock('postponed');
94 $this->tpl->parseCurrentBlock();
95 }
96 }
97
98 if ($this->show_marker)
99 {
100 if ($data['marked'])
101 {
102 $this->tpl->setCurrentBlock('marked_img');
103 $this->tpl->setVariable("HREF_MARKED", ilUtil::img('./templates/default/images/marked.svg', $this->lng->txt("tst_question_marked"), '24px', '24px'));
104 $this->tpl->parseCurrentBlock();
105
106 $this->tpl->setCurrentBlock('marker');
107 $this->tpl->parseCurrentBlock();
108 }
109 else
110 {
111 $this->tpl->setCurrentBlock('marker');
112 $this->tpl->touchBlock('marker');
113 $this->tpl->parseCurrentBlock();
114 }
115 }
116
117 // obligatory icon
118 if( $data["obligatory"] )
119 {
120 $OBLIGATORY = "<img src=\"".ilUtil::getImagePath("obligatory.gif", "Modules/Test").
121 "\" alt=\"".$this->lng->txt("question_obligatory").
122 "\" title=\"".$this->lng->txt("question_obligatory")."\" />";
123 }
124 else $OBLIGATORY = '';
125
126
127 $this->tpl->setVariable("QUESTION_OBLIGATORY", $OBLIGATORY);
128
129 $this->tpl->setVariable("ORDER", $data['order']);
130 $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($data['title']));
131 $this->tpl->setVariable("HREF", $data['href']);
132 }
133
134 private function getPostponedLabel($isPostponed)
135 {
136 if(!$isPostponed)
137 {
138 return '';
139 }
140
141 return ;
142 }
143}
144?>
Class ilTable2GUI.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormName($a_formname)
Set Form name.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
disable($a_module_name)
diesables particular modules of table
setStyle($a_element, $a_style)
setLimit($a_limit=0, $a_default_limit=0)
set max.
enable($a_module_name)
enables particular modules of table
__construct($a_parent_obj, $a_parent_cmd, $show_postponed, $show_marker)
Constructor.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40