ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilUnitCategoryTableGUI.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/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
5require_once 'Services/Table/classes/class.ilTable2GUI.php';
6
11abstract class ilUnitCategoryTableGUI extends ilTable2GUI
12{
16 protected $parent_obj;
17
22 public function __construct(ilUnitConfigurationGUI $controller, $cmd)
23 {
27 global $ilCtrl;
28
29 $this->setId('ucats_' . $controller->getUniqueId());
30
31 parent::__construct($controller, $cmd);
32
33 $this->addColumn('', '', '1%', true);
34 $this->addColumn($this->lng->txt('title'), 'category', '99%');
35 $this->addColumn('', '', '1%', true);
36
37 $this->setDefaultOrderDirection('category');
38 $this->setDefaultOrderDirection('ASC');
39
40 if($this->getParentObject()->isCRUDContext())
41 {
42 $this->addMultiCommand('confirmDeleteCategories', $this->lng->txt('delete'));
43 }
44 else
45 {
46 $this->addMultiCommand('confirmImportGlobalCategories', $this->lng->txt('import'));
47 }
48
49 $this->populateTitle();
50
51 $this->setFormAction($ilCtrl->getFormAction($this->getParentObject(), $cmd));
52 $this->setSelectAllCheckbox('category_ids[]');
53 $this->setRowTemplate('tpl.unit_category_row.html', 'Modules/TestQuestionPool');
54 }
55
59 protected abstract function populateTitle();
60
64 public function fillRow(array $row)
65 {
69 global $ilCtrl;
70
71 $row['chb'] = ilUtil::formCheckbox(false, 'category_ids[]', $row['category_id']);
72
73 $action = new ilAdvancedSelectionListGUI();
74 $action->setId('asl_content_' . $row['category_id']);
75 $action->setAsynch(false);
76 $action->setListTitle($this->lng->txt('actions'));
77 $ilCtrl->setParameter($this->getParentObject(), 'category_id', $row['category_id']);
78 $action->addItem($this->lng->txt('un_show_units'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'showUnitsOfCategory'));
79 if($this->getParentObject()->isCRUDContext())
80 {
81 $action->addItem($this->lng->txt('edit'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'showUnitCategoryModificationForm'));
82 $action->addItem($this->lng->txt('delete'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'confirmDeleteCategory'));
83 }
84 else
85 {
86 $action->addItem($this->lng->txt('import'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'confirmImportGlobalCategory'));
87 }
88 $row['title_href'] = $ilCtrl->getLinkTarget($this->getParentObject(), 'showUnitsOfCategory');
89 $ilCtrl->setParameter($this->getParentObject(), 'category_id', '');
90 $row['actions'] = $action->getHtml();
91
92 parent::fillRow($row);
93 }
94}
User interface class for advanced drop-down selection lists.
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.
fillRow($a_set)
Standard Version of Fill Row.
__construct($a_parent_obj, $a_parent_cmd="", $a_template_context="")
Constructor.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
Class ilUnitCategoryTableGUI @abstract.
Class ilUnitConfigurationGUI @abstract.
static formCheckbox($checked, $varname, $value, $disabled=false)
??? @access public
global $ilCtrl
Definition: ilias.php:18
$cmd
Definition: sahs_server.php:35