ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
4 require_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("ALT_MARKED", $this->lng->txt("tst_question_marked"));
104  $this->tpl->setVariable("HREF_MARKED", ilUtil::getImagePath("marked.png"));
105  $this->tpl->parseCurrentBlock();
106 
107  $this->tpl->setCurrentBlock('marker');
108  $this->tpl->parseCurrentBlock();
109  }
110  else
111  {
112  $this->tpl->setCurrentBlock('marker');
113  $this->tpl->touchBlock('marker');
114  $this->tpl->parseCurrentBlock();
115  }
116  }
117 
118  // obligatory icon
119  if( $data["obligatory"] )
120  {
121  $OBLIGATORY = "<img src=\"".ilUtil::getImagePath("obligatory.gif", "Modules/Test").
122  "\" alt=\"".$this->lng->txt("question_obligatory").
123  "\" title=\"".$this->lng->txt("question_obligatory")."\" />";
124  }
125  else $OBLIGATORY = '';
126 
127 
128  $this->tpl->setVariable("QUESTION_OBLIGATORY", $OBLIGATORY);
129 
130  $this->tpl->setVariable("ORDER", $data['order']);
131  $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($data['title']));
132  $this->tpl->setVariable("HREF", $data['href']);
133  }
134 
135  private function getPostponedLabel($isPostponed)
136  {
137  if(!$isPostponed)
138  {
139  return '';
140  }
141 
142  return ;
143  }
144 }
145 ?>