ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
28 public function __construct($a_parent_obj, $a_parent_cmd, $a_node_id, $a_access_handler)
29 {
30 global $DIC;
31
32 $this->ctrl = $DIC->ctrl();
33 $this->user = $DIC->user();
34 $this->obj_definition = $DIC["objDefinition"];
35 $ilCtrl = $DIC->ctrl();
36
37 $this->node_id = $a_node_id;
38 $this->setId("tbl_wfld");
39 $this->access_handler = $a_access_handler;
40
41 parent::__construct($a_parent_obj, $a_parent_cmd);
42
43 // $this->setTitle(":TODO:");
44 $this->setLimit(999);
45
46 $this->addColumn($this->lng->txt("content"));
47
48 // $this->setEnableHeader(true);
49 // $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
50 $this->setRowTemplate("tpl.list_row.html", "Modules/WorkspaceFolder");
51 //$this->disable("footer");
52 // $this->setEnableTitle(true);
53 $this->setEnableNumInfo(false);
54
55 $this->getItems();
56 }
57
58 protected function getItems()
59 {
61
62 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
63 $tree = new ilWorkspaceTree($ilUser->getId());
64 $nodes = $tree->getChilds($this->node_id, "title");
65
66 if (sizeof($nodes)) {
67 include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
69 foreach ($nodes as $node) {
70 $preloader->addItem($node["obj_id"], $node["type"]);
71 }
72 $preloader->preload();
73 unset($preloader);
74 }
75
76 $this->shared_objects = $this->access_handler->getObjectsIShare();
77
78 $this->setData($nodes);
79 }
80
81 protected function fillRow($node)
82 {
83 $objDefinition = $this->obj_definition;
85
86 $class = $objDefinition->getClassName($node["type"]);
87 $location = $objDefinition->getLocation($node["type"]);
88 $full_class = "ilObj" . $class . "ListGUI";
89
90 include_once($location . "/class." . $full_class . ".php");
91 $item_list_gui = new $full_class(ilObjectListGUI::CONTEXT_WORKSPACE);
92
93 $item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_ALL);
94 $item_list_gui->enableDelete(true);
95 $item_list_gui->enableCut(true);
96 $item_list_gui->enableSubscribe(false);
97 $item_list_gui->enableLink(false);
98 $item_list_gui->enablePath(false);
99 $item_list_gui->enableLinkedPath(false);
100 $item_list_gui->enableSearchFragments(true);
101 $item_list_gui->enableRelevance(false);
102 $item_list_gui->enableIcon(true);
103 $item_list_gui->enableTimings(false);
104 // $item_list_gui->enableCheckbox(false);
105 // $item_list_gui->setSeparateCommands(true);
106
107 $item_list_gui->enableNotes(true);
108 $item_list_gui->enableCopy($objDefinition->allowCopy($node["type"]));
109
110 if ($node["type"] == "file") {
111 $item_list_gui->enableRepositoryTransfer(true);
112 }
113
114 $item_list_gui->setContainerObject($this->parent_obj);
115
116 if (in_array($node["type"], array("file", "blog"))) {
117 // add "share" link
118 $ilCtrl->setParameterByClass("ilworkspaceaccessgui", "wsp_id", $node["wsp_id"]);
119 $share_link = $ilCtrl->getLinkTargetByClass(array("ilObj" . $class . "GUI", "ilworkspaceaccessgui"), "share");
120 $item_list_gui->addCustomCommand($share_link, "wsp_permissions");
121
122 // show "shared" status
123 if (in_array($node["obj_id"], $this->shared_objects)) {
124 $item_list_gui->addCustomProperty($this->lng->txt("status"), $this->lng->txt("wsp_status_shared"), true, true);
125 }
126 }
127
128 if ($html = $item_list_gui->getListItemHTML(
129 $node["wsp_id"],
130 $node["obj_id"],
131 $node["title"],
132 $node["description"]
133 )) {
134 $this->tpl->setVariable("ITEM_LIST_NODE", $html);
135 }
136 }
137}
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)
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.
$html
Definition: example_001.php:87
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18