ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
class.ilAdminSubItemsTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/Table/classes/class.ilTable2GUI.php");
5
15{
16
20 function __construct($a_parent_obj, $a_parent_cmd, $a_ref_id)
21 {
22 global $ilCtrl, $lng, $ilAccess, $lng;
23
24 $this->ref_id = $a_ref_id;
25
26 parent::__construct($a_parent_obj, $a_parent_cmd);
27// $this->setTitle($lng->txt("items"));
28 $this->setSelectAllCheckbox("id[]");
29
30 $this->addColumn("", "", "1", 1);
31 $this->addColumn($this->lng->txt("type"), "", "1");
32 $this->addColumn($this->lng->txt("title"), "title");
33 $this->addColumn($this->lng->txt("last_change"), "last_update", "25%");
34
35 $this->setEnableHeader(true);
36 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
37 $this->setRowTemplate("tpl.admin_sub_items_row.html", "Services/Repository");
38 //$this->disable("footer");
39 $this->setEnableTitle(true);
40 $this->setDefaultOrderField("title");
41 $this->setDefaultOrderDirection("asc");
42
43 // TODO: Needs other solution
44 if(ilObject::_lookupType((int) $_GET['ref_id'],true) == 'chac')
45 {
46 $this->getItems();
47 return true;
48 }
49
50
51 if (ilObject::_lookupType($_GET["ref_id"], true) != "recf")
52 {
53 if ($_SESSION["clipboard"])
54 {
55 $this->addCommandButton("paste", $lng->txt("paste"));
56 $this->addCommandButton("clear", $lng->txt("clear"));
57 }
58 else
59 {
60 $this->addMultiCommand("cut", $lng->txt("cut"));
61 $this->addMultiCommand("delete", $lng->txt("delete"));
62 $this->addMultiCommand("link", $lng->txt("link"));
63 }
64 }
65 else
66 {
67 if ($_SESSION["clipboard"])
68 {
69 $this->addCommandButton("clear", $lng->txt("clear"));
70 }
71 else
72 {
73 $this->addMultiCommand("cut", $lng->txt("cut"));
74 $this->addMultiCommand("removeFromSystem", $lng->txt("btn_remove_system"));
75 }
76 }
77 $this->getItems();
78 }
79
83 function getItems()
84 {
85 global $rbacsystem, $objDefinition, $tree;
86
87 $items = array();
88 $childs = $tree->getChilds($this->ref_id);
89 foreach ($childs as $key => $val)
90 {
91 // visible
92 if (!$rbacsystem->checkAccess("visible",$val["ref_id"]))
93 {
94 continue;
95 }
96
97 // hide object types in devmode
98 if ($objDefinition->getDevMode($val["type"]))
99 {
100 continue;
101 }
102
103 // don't show administration in root node list
104 if ($val["type"] == "adm")
105 {
106 continue;
107 }
108 if (!$this->parent_obj->isVisible($val["ref_id"], $val["type"]))
109 {
110 continue;
111 }
112 $items[] = $val;
113 }
114 $this->setData($items);
115 }
116
117
121 protected function fillRow($a_set)
122 {
123 global $lng, $objDefinition, $ilCtrl;
124
125// $this->tpl->setVariable("", );
126
127 // surpress checkbox for particular object types AND the system role
128 if (!$objDefinition->hasCheckbox($a_set["type"]) ||
129 $a_set["obj_id"] == SYSTEM_ROLE_ID ||
130 $a_set["obj_id"] == SYSTEM_USER_ID ||
131 $a_set["obj_id"] == ANONYMOUS_ROLE_ID)
132 {
133 $this->tpl->touchBlock("no_checkbox");
134 }
135 else
136 {
137 $this->tpl->setCurrentBlock("checkbox");
138 $this->tpl->setVariable("ID", $a_set["ref_id"]);
139 $this->tpl->parseCurrentBlock();
140 }
141
142 //build link
143 $class_name = $objDefinition->getClassName($a_set["type"]);
144 $class = strtolower("ilObj".$class_name."GUI");
145 $ilCtrl->setParameterByClass($class, "ref_id", $a_set["ref_id"]);
146 $this->tpl->setVariable("HREF_TITLE", $ilCtrl->getLinkTargetByClass($class, "view"));
147 $ilCtrl->setParameterByClass($class, "ref_id", $_GET["ref_id"]);
148
149 // TODO: broken! fix me
150 $title = $a_set["title"];
151 if (is_array($_SESSION["clipboard"]["ref_ids"]))
152 {
153 if (in_array($a_set["ref_id"], $_SESSION["clipboard"]["ref_ids"]))
154 {
155 switch($_SESSION["clipboard"]["cmd"])
156 {
157 case "cut":
158 $title = "<del>".$title."</del>";
159 break;
160
161 case "copy":
162 $title = "<font color=\"green\">+</font> ".$title;
163 break;
164
165 case "link":
166 $title = "<font color=\"black\"><</font> ".$title;
167 break;
168 }
169 }
170 }
171 $this->tpl->setVariable("VAL_TITLE", $title);
172 $this->tpl->setVariable("VAL_DESC", ilUtil::shortenText($a_set["desc"] ,ilObject::DESC_LENGTH, true));
173 $this->tpl->setVariable("VAL_LAST_CHANGE", ilDatePresentation::formatDate(new ilDateTime($a_set["last_update"],IL_CAL_DATETIME)));
174 $alt = ($objDefinition->isPlugin($a_set["type"]))
175 ? $lng->txt("icon")." ".ilPlugin::lookupTxt("rep_robj", $a_set["type"], "obj_".$a_set["type"])
176 : $lng->txt("icon")." ".$lng->txt("obj_".$a_set["type"]);
177 $this->tpl->setVariable("IMG_TYPE", ilUtil::img(ilObject::_getIcon($a_set["obj_id"], "small"), $alt));
178 //$this->tpl->setVariable("IMG_TYPE", ilObject::_getIcon($a_set["obj_id"], "small", $this->getIconImageType()),
179 // $lng->txt("icon")." ".$lng->txt("obj_".$a_set["type"])));
180 }
181
182}
183?>
$_GET["client_id"]
const IL_CAL_DATETIME
TableGUI class for sub items listed in repository administration.
__construct($a_parent_obj, $a_parent_cmd, $a_ref_id)
Constructor.
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
const DESC_LENGTH
static _lookupType($a_id, $a_reference=false)
lookup object type
static lookupTxt($a_mod_prefix, $a_pl_id, $a_lang_var)
Lookup language text.
Class ilTable2GUI.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
setEnableHeader($a_enableheader)
Set Enable Header.
setData($a_data)
set table data @access public
setEnableTitle($a_enabletitle)
Set Enable Title.
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.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40