ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilTrashTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Table/classes/class.ilTable2GUI.php");
5 require_once('./Services/Repository/classes/class.ilObjectPlugin.php');
6 
16 {
20  protected $ctrl;
21 
25  protected $access;
26 
30  protected $obj_definition;
31 
32 
36  public function __construct($a_parent_obj, $a_parent_cmd)
37  {
38  global $DIC;
39 
40  $this->ctrl = $DIC->ctrl();
41  $this->lng = $DIC->language();
42  $this->access = $DIC->access();
43  $this->obj_definition = $DIC["objDefinition"];
44  $ilCtrl = $DIC->ctrl();
45  $lng = $DIC->language();
46  $ilAccess = $DIC->access();
47  $lng = $DIC->language();
48 
49  $this->ref_id = $a_ref_id;
50 
51  parent::__construct($a_parent_obj, $a_parent_cmd);
52  //$this->setTitle($lng->txt(""));
53 
54  $this->addColumn($this->lng->txt(""), "", "1", 1);
55  $this->addColumn($this->lng->txt("type"), "", "1");
56  $this->addColumn($this->lng->txt("title"), "title");
57  $this->addColumn($this->lng->txt("last_change"), "last_update");
58  $this->setDefaultOrderField("title");
59  $this->setDefaultOrderDirection("asc");
60 
61 
62  $this->setEnableHeader(true);
63  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
64  $this->setRowTemplate("tpl.trash_list_row.html", "Services/Repository");
65  //$this->disable("footer");
66  $this->setEnableTitle(true);
67  $this->setSelectAllCheckbox("trash_id[]");
68 
69  $this->addMultiCommand("undelete", $lng->txt("btn_undelete"));
70  $this->addMultiCommand("confirmRemoveFromSystem", $lng->txt("btn_remove_system"));
71  }
72 
76  protected function fillRow($a_set)
77  {
78  $lng = $this->lng;
79  $objDefinition = $this->obj_definition;
80 
81  $img = ilObject::_getIcon($a_set["obj_id"], "small", $a_set["type"]);
82  if (strlen($img) > 0) {
83  $alt = ($objDefinition->isPlugin($a_set["type"]))
84  ? $lng->txt("icon") . " " . ilObjectPlugin::lookupTxtById($a_set["type"], "obj_" . $a_set["type"])
85  : $lng->txt("icon") . " " . $lng->txt("obj_" . $a_set["type"]);
86 
87  $this->tpl->setVariable("IMG_TYPE", ilUtil::img($img, $alt));
88  }
89  $this->tpl->setVariable("ID", $a_set["ref_id"]);
90  $this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
91  $this->tpl->setVariable("VAL_LAST_CHANGE", $a_set["last_update"]);
92  }
93 }
TableGUI class for.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
static lookupTxtById($plugin_id, $lang_var)
global $DIC
Definition: saml.php:7
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
fillRow($a_set)
Fill table row.
Class ilTable2GUI.
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.
addMultiCommand($a_cmd, $a_text)
Add Command button.
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
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.
setEnableHeader($a_enableheader)
Set Enable Header.
setEnableTitle($a_enabletitle)
Set Enable Title.