ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 $DIC;
28 $ilCtrl = $DIC['ilCtrl'];
29
30 $this->setId('ucats_' . $controller->getUniqueId());
31
32 parent::__construct($controller, $cmd);
33
34 $this->addColumn('', '', '1%', true);
35 $this->addColumn($this->lng->txt('title'), 'category', '99%');
36 $this->addColumn('', '', '1%', true);
37
38 $this->setDefaultOrderDirection('category');
39 $this->setDefaultOrderDirection('ASC');
40
41 if ($this->getParentObject()->isCRUDContext()) {
42 $this->addMultiCommand('confirmDeleteCategories', $this->lng->txt('delete'));
43 } else {
44 $this->addMultiCommand('confirmImportGlobalCategories', $this->lng->txt('import'));
45 }
46
47 $this->populateTitle();
48
49 $this->setFormAction($ilCtrl->getFormAction($this->getParentObject(), $cmd));
50 $this->setSelectAllCheckbox('category_ids[]');
51 $this->setRowTemplate('tpl.unit_category_row.html', 'Modules/TestQuestionPool');
52 }
53
57 abstract protected function populateTitle();
58
62 public function fillRow($row)
63 {
67 global $DIC;
68 $ilCtrl = $DIC['ilCtrl'];
69
70 $row['chb'] = ilUtil::formCheckbox(false, 'category_ids[]', $row['category_id']);
71
72 $action = new ilAdvancedSelectionListGUI();
73 $action->setId('asl_content_' . $row['category_id']);
74 $action->setAsynch(false);
75 $action->setListTitle($this->lng->txt('actions'));
76 $ilCtrl->setParameter($this->getParentObject(), 'category_id', $row['category_id']);
77 $action->addItem($this->lng->txt('un_show_units'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'showUnitsOfCategory'));
78 if ($this->getParentObject()->isCRUDContext()) {
79 $action->addItem($this->lng->txt('edit'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'showUnitCategoryModificationForm'));
80 $action->addItem($this->lng->txt('delete'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'confirmDeleteCategory'));
81 } else {
82 $action->addItem($this->lng->txt('import'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'confirmImportGlobalCategory'));
83 }
84 $row['title_href'] = $ilCtrl->getLinkTarget($this->getParentObject(), 'showUnitsOfCategory');
85 $ilCtrl->setParameter($this->getParentObject(), 'category_id', '');
86 $row['actions'] = $action->getHtml();
87
88 parent::fillRow($row);
89 }
90}
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.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
__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.
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
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46