ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 $this->addMultiCommand('confirmDeleteCategories', $this->lng->txt('delete'));
42 } else {
43 $this->addMultiCommand('confirmImportGlobalCategories', $this->lng->txt('import'));
44 }
45
46 $this->populateTitle();
47
48 $this->setFormAction($ilCtrl->getFormAction($this->getParentObject(), $cmd));
49 $this->setSelectAllCheckbox('category_ids[]');
50 $this->setRowTemplate('tpl.unit_category_row.html', 'Modules/TestQuestionPool');
51 }
52
56 abstract protected function populateTitle();
57
61 public function fillRow($row)
62 {
66 global $ilCtrl;
67
68 $row['chb'] = ilUtil::formCheckbox(false, 'category_ids[]', $row['category_id']);
69
71 $action->setId('asl_content_' . $row['category_id']);
72 $action->setAsynch(false);
73 $action->setListTitle($this->lng->txt('actions'));
74 $ilCtrl->setParameter($this->getParentObject(), 'category_id', $row['category_id']);
75 $action->addItem($this->lng->txt('un_show_units'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'showUnitsOfCategory'));
76 if ($this->getParentObject()->isCRUDContext()) {
77 $action->addItem($this->lng->txt('edit'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'showUnitCategoryModificationForm'));
78 $action->addItem($this->lng->txt('delete'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'confirmDeleteCategory'));
79 } else {
80 $action->addItem($this->lng->txt('import'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'confirmImportGlobalCategory'));
81 }
82 $row['title_href'] = $ilCtrl->getLinkTarget($this->getParentObject(), 'showUnitsOfCategory');
83 $ilCtrl->setParameter($this->getParentObject(), 'category_id', '');
84 $row['actions'] = $action->getHtml();
85
86 parent::fillRow($row);
87 }
88}
An exception for terminatinating execution or to throw for unit testing.
User interface class for advanced drop-down selection lists.
Class ilTable2GUI.
getParentObject()
Get parent object.
fillRow($a_set)
Standard Version of Fill Row.
__construct($a_parent_obj, $a_parent_cmd="", $a_template_context="")
ilTable2GUI 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.
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.
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
$action
global $ilCtrl
Definition: ilias.php:18