ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilObjWorkspaceFolderTableGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
14include_once "Services/Table/classes/class.ilTable2GUI.php";
15
17{
21 protected $user;
22
26 protected $obj_definition;
27
31 protected $admin = false;
32
33 public function __construct($a_parent_obj, $a_parent_cmd, $a_node_id, $a_access_handler, $admin = false)
34 {
35 global $DIC;
36
37 $this->ctrl = $DIC->ctrl();
38 $this->user = $DIC->user();
39 $this->obj_definition = $DIC["objDefinition"];
40 $ilCtrl = $DIC->ctrl();
41
42 $this->node_id = $a_node_id;
43 $this->setId("tbl_wfld");
44 $this->access_handler = $a_access_handler;
45 $this->admin = $admin;
46
47 parent::__construct($a_parent_obj, $a_parent_cmd);
48
49 // $this->setTitle(":TODO:");
50 $this->setLimit(999);
51
52 $this->addColumn($this->lng->txt("content"));
53
54 // $this->setEnableHeader(true);
55 // $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
56 $this->setRowTemplate("tpl.list_row.html", "Modules/WorkspaceFolder");
57 //$this->disable("footer");
58 // $this->setEnableTitle(true);
59 $this->setEnableNumInfo(false);
60
61 $this->getItems();
62 }
63
64 protected function getItems()
65 {
67
68 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
69 $tree = new ilWorkspaceTree($ilUser->getId());
70 $nodes = $tree->getChilds($this->node_id, "title");
71
72 if (sizeof($nodes)) {
73 include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
75 foreach ($nodes as $node) {
76 $preloader->addItem($node["obj_id"], $node["type"]);
77 }
78 $preloader->preload();
79 unset($preloader);
80 }
81
82 $this->shared_objects = $this->access_handler->getObjectsIShare();
83
84 $this->setData($nodes);
85 }
86
87 protected function fillRow($node)
88 {
89 $objDefinition = $this->obj_definition;
90 $ilCtrl = $this->ctrl;
91
92 $class = $objDefinition->getClassName($node["type"]);
93 $location = $objDefinition->getLocation($node["type"]);
94 $full_class = "ilObj" . $class . "ListGUI";
95
96 include_once($location . "/class." . $full_class . ".php");
97 $item_list_gui = new $full_class(ilObjectListGUI::CONTEXT_WORKSPACE);
98
99 $item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_ALL);
100 $item_list_gui->enableDelete(true);
101 $item_list_gui->enableCut(true);
102 $item_list_gui->enableSubscribe(false);
103 $item_list_gui->enableLink(false);
104 $item_list_gui->enablePath(false);
105 $item_list_gui->enableLinkedPath(false);
106 $item_list_gui->enableSearchFragments(true);
107 $item_list_gui->enableRelevance(false);
108 $item_list_gui->enableIcon(true);
109 $item_list_gui->enableTimings(false);
110 $item_list_gui->enableCheckbox($this->admin);
111 // $item_list_gui->setSeparateCommands(true);
112
113 $item_list_gui->enableNotes(true);
114 $item_list_gui->enableCopy($objDefinition->allowCopy($node["type"]));
115
116 if ($node["type"] == "file") {
117 $item_list_gui->enableRepositoryTransfer(true);
118 }
119
120 $item_list_gui->setContainerObject($this->parent_obj);
121
122 if (in_array($node["type"], array("file", "blog"))) {
123 // add "share" link
124 $ilCtrl->setParameterByClass("ilworkspaceaccessgui", "wsp_id", $node["wsp_id"]);
125 $share_link = $ilCtrl->getLinkTargetByClass(array("ilObj" . $class . "GUI", "ilworkspaceaccessgui"), "share");
126 $item_list_gui->addCustomCommand($share_link, "wsp_permissions");
127
128 // show "shared" status
129 if (in_array($node["obj_id"], $this->shared_objects)) {
130 $item_list_gui->addCustomProperty($this->lng->txt("status"), $this->lng->txt("wsp_status_shared"), true, true);
131 }
132 }
133
134 if ($html = $item_list_gui->getListItemHTML(
135 $node["wsp_id"],
136 $node["obj_id"],
137 $node["title"],
138 $node["description"]
139 )) {
140 $this->tpl->setVariable("ITEM_LIST_NODE", $html);
141 }
142 }
143}
user()
Definition: user.php:4
$location
Definition: buildRTE.php:44
An exception for terminatinating execution or to throw for unit testing.
Class ilObjWorkspaceFolderTableGUI.
fillRow($node)
Standard Version of Fill Row.
__construct($a_parent_obj, $a_parent_cmd, $a_node_id, $a_access_handler, $admin=false)
Preloader for object list GUIs.
Class ilTable2GUI.
setData($a_data)
set table data @access public
setEnableNumInfo($a_val)
Set enable num info.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
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.
Tree handler for personal workspace.
global $DIC
Definition: goto.php:24
$ilUser
Definition: imgupload.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc