ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.SurveyMaterialsSourceTableGUI.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 
36 {
37  public function __construct($a_parent_obj, $a_parent_cmd, $a_cancel_cmd)
38  {
39  global $DIC;
40 
41  $this->ctrl = $DIC->ctrl();
42  $this->lng = $DIC->language();
43  $ilCtrl = $DIC->ctrl();
44  $lng = $DIC->language();
45 
46  parent::__construct($a_parent_obj, $a_parent_cmd);
47 
48  $this->addColumn($lng->txt("title"), "title");
49  $this->addColumn($lng->txt("action"), "");
50  $this->setTitle($this->lng->txt('select_object_to_link'));
51 
52  $this->setLimit(9999);
53  $this->disable("numinfo");
54 
55  $this->setRowTemplate("tpl.il_svy_qpl_material_source_row.html", "Modules/SurveyQuestionPool");
56 
57  $this->setFormAction($ilCtrl->getFormAction($this->getParentObject(), $this->getParentCmd()));
58  $this->addCommandButton($a_cancel_cmd, $this->lng->txt('cancel'));
59 
60  $this->setDefaultOrderField("title");
61  $this->setDefaultOrderDirection("asc");
62  }
63 
67  protected function fillRow($data)
68  {
70  $lng = $this->lng;
71 
72  $url_cmd = "add" . strtoupper($data["item_type"]);
73  $url_type = strtolower($data["item_type"]);
74 
75  $ilCtrl->setParameter($this->getParentObject(), $url_type, $data["item_id"]);
76  $url = $ilCtrl->getLinkTarget($this->getParentObject(), $url_cmd) .
77  $ilCtrl->setParameter($this->getParentObject(), $url_type, "");
78 
79  $this->tpl->setVariable("TITLE", $data['title']);
80  $this->tpl->setVariable("URL_ADD", $url);
81  $this->tpl->setVariable("TXT_ADD", $lng->txt("add"));
82  }
83 }
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
global $DIC
Definition: saml.php:7
TableGUI class for survey question source materials.
getParentCmd()
Get parent command.
getParentObject()
Get parent object.
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
__construct($a_parent_obj, $a_parent_cmd, $a_cancel_cmd)
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
$url
setLimit($a_limit=0, $a_default_limit=0)