ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSurveyQuestionblockbrowserTableGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 include_once('./Services/Table/classes/class.ilTable2GUI.php');
25 
35 {
36  protected $editable = true;
37  protected $writeAccess = false;
38  protected $browsercolumns = array();
39 
47  public function __construct($a_parent_obj, $a_parent_cmd, $a_write_access = false)
48  {
49  parent::__construct($a_parent_obj, $a_parent_cmd);
50 
51  global $lng, $ilCtrl;
52 
53  $this->lng = $lng;
54  $this->ctrl = $ilCtrl;
55 
56  $this->setWriteAccess($a_write_access);
57 
58  $this->setFormName('surveyquestionblockbrowser');
59  $this->setStyle('table', 'fullwidth');
60  $this->addColumn('','f','1%');
61  $this->addColumn($this->lng->txt("title"),'title', '');
62  $this->addColumn($this->lng->txt("contains"),'contains', '');
63  $this->addColumn($this->lng->txt("obj_svy"),'svy', '');
64 
65  $this->setPrefix('cb');
66  $this->setSelectAllCheckbox('cb');
67 
68  $this->addMultiCommand('insertQuestionblocks', $this->lng->txt('insert'));
69 
70  $this->setRowTemplate("tpl.il_svy_svy_questionblockbrowser_row.html", "Modules/Survey");
71 
72  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
73  $this->setDefaultOrderField("title");
74  $this->setDefaultOrderDirection("asc");
75 
76  $this->enable('sort');
77  $this->enable('header');
78  $this->enable('select_all');
79  $this->setFilterCommand('filterQuestionblockBrowser');
80  $this->setResetCommand('resetfilterQuestionblockBrowser');
81 
82  $this->initFilter();
83  }
84 
88  function initFilter()
89  {
90  global $lng, $rbacreview, $ilUser;
91 
92  // title
93  include_once("./Services/Form/classes/class.ilTextInputGUI.php");
94  $ti = new ilTextInputGUI($lng->txt("title"), "title");
95  $ti->setMaxLength(64);
96  $ti->setValidationRegexp('/^[^%]+$/is');
97  $ti->setSize(20);
98  $this->addFilterItem($ti);
99  $ti->readFromSession();
100  $this->filter["title"] = $ti->getValue();
101  }
102 
110  public function fillRow($data)
111  {
112  global $ilUser,$ilAccess;
113 
114  $this->tpl->setVariable('QUESTIONBLOCK_ID', $data["questionblock_id"]);
115  $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($data["title"]));
116  $this->tpl->setVariable("CONTAINS", ilUtil::prepareFormOutput($data["contains"]));
117  $this->tpl->setVariable("SVY", ilUtil::prepareFormOutput($data['svy']));
118  }
119 
120  public function setEditable($value)
121  {
122  $this->editable = $value;
123  }
124 
125  public function getEditable()
126  {
127  return $this->editable;
128  }
129 
130  public function setWriteAccess($value)
131  {
132  $this->writeAccess = $value;
133  }
134 
135  public function getWriteAccess()
136  {
137  return $this->writeAccess;
138  }
139 }
140 ?>