ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilECSCategoryMappingTableGUI.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
24include_once './Services/Table/classes/class.ilTable2GUI.php';
25
36{
41 public function __construct($a_parent_obj,$a_parent_cmd)
42 {
43 global $lng,$ilCtrl;
44
45 $this->lng = $lng;
46 $this->ctrl = $ilCtrl;
47
48 parent::__construct($a_parent_obj,$a_parent_cmd);
49 $this->addColumn('','f','1px');
50 $this->addColumn($this->lng->txt('obj_cat'),'category','40%');
51 $this->addColumn($this->lng->txt('ecs_cat_mapping_type'),'kind','50%');
52 $this->addColumn('','edit','10%');
53 $this->setRowTemplate('tpl.rule_row.html','Services/WebServices/ECS');
54 $this->setDefaultOrderField('title');
55 $this->setDefaultOrderDirection('asc');
56 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
57 $this->setSelectAllCheckbox('rules');
58 $this->setTitle($this->lng->txt('ecs_tbl_active_rules'));
59 $this->addMultiCommand('deleteCategoryMappings',$this->lng->txt('delete'));
60 }
61
67 public function fillRow($a_set)
68 {
69 $this->tpl->setVariable('VAL_ID',$a_set['id']);
70 $this->tpl->setVariable('TXT_ID',$this->lng->txt('ecs_import_id'));
71 $this->tpl->setVariable('VAL_CAT_ID',$a_set['category_id']);
72 $this->tpl->setVariable('TXT_TITLE',$this->lng->txt('title'));
73 $this->tpl->setVariable('VAL_CAT_TITLE',$a_set['category']);
74 $this->tpl->setVariable('VAL_CONDITION',$a_set['kind']);
75 $this->tpl->setVariable('TXT_EDIT',$this->lng->txt('edit'));
76 $this->tpl->setVariable('PATH',$this->buildPath($a_set['category_id']));
77
78 $this->ctrl->setParameterByClass(get_class($this->getParentObject()),'rule_id',$a_set['id']);
79 $this->tpl->setVariable('EDIT_LINK',$this->ctrl->getLinkTargetByClass(get_class($this->getParentObject()),'editCategoryMapping'));
80 $this->ctrl->clearParametersByClass(get_class($this->getParentObject()));
81 }
82
88 public function parse($a_rules)
89 {
90 foreach($a_rules as $rule)
91 {
92 $tmp_arr['id'] = $rule->getMappingId();
93 $tmp_arr['category_id'] = $rule->getContainerId();
94 $tmp_arr['category'] = ilObject::_lookupTitle(ilObject::_lookupObjId($rule->getContainerId()));
95 $tmp_arr['kind'] = $rule->conditionToString();
96
97 $content[] = $tmp_arr;
98 }
99 $this->setData($content ? $content : array());
100 }
101
102 private function buildPath($a_ref_id)
103 {
104 $loc = new ilLocatorGUI();
105 $loc->setTextOnly(false);
106 $loc->addContextItems($a_ref_id);
107
108 return $loc->getHTML();
109 }
110
111}
112?>
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
locator handling class
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
Class ilTable2GUI.
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.
getParentObject()
Get parent object.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40