ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjWorkspaceFolderTableGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 private int $node_id;
28 private array $shared_objects;
29 protected ilObjUser $user;
31 protected bool $admin = false;
32
33 public function __construct(
34 object $a_parent_obj,
35 string $a_parent_cmd,
36 int $a_node_id,
37 ilWorkspaceAccessHandler $a_access_handler,
38 bool $admin = false
39 ) {
40 global $DIC;
41
42 $this->ctrl = $DIC->ctrl();
43 $this->user = $DIC->user();
44 $this->obj_definition = $DIC["objDefinition"];
45
46 $this->node_id = $a_node_id;
47 $this->setId("tbl_wfld");
48 $this->access_handler = $a_access_handler;
49 $this->admin = $admin;
50
51 parent::__construct($a_parent_obj, $a_parent_cmd);
52
53 // $this->setTitle(":TODO:");
54 $this->setLimit(999);
55
56 $this->addColumn($this->lng->txt("content"));
57
58 // $this->setEnableHeader(true);
59 // $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
60 $this->setRowTemplate("tpl.list_row.html", "components/ILIAS/WorkspaceFolder");
61 //$this->disable("footer");
62 // $this->setEnableTitle(true);
63 $this->setEnableNumInfo(false);
64
65 $this->getItems();
66 }
67
68 protected function getItems(): void
69 {
70 $ilUser = $this->user;
71
72 $tree = new ilWorkspaceTree($ilUser->getId());
73 $nodes = $tree->getChilds($this->node_id, "title");
74
75 if (sizeof($nodes)) {
77 foreach ($nodes as $node) {
78 $preloader->addItem($node["obj_id"], $node["type"]);
79 }
80 $preloader->preload();
81 unset($preloader);
82 }
83
84 $this->shared_objects = $this->access_handler->getObjectsIShare();
85
86 $this->setData($nodes);
87 }
88
89 protected function fillRow(array $a_set): void
90 {
91 $objDefinition = $this->obj_definition;
92 $ilCtrl = $this->ctrl;
93
94 $class = $objDefinition->getClassName($a_set["type"]);
95 $full_class = "ilObj" . $class . "ListGUI";
96
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->enableIcon(true);
108 $item_list_gui->enableTimings(false);
109 $item_list_gui->enableCheckbox($this->admin);
110 // $item_list_gui->setSeparateCommands(true);
111
112 $item_list_gui->enableNotes(true);
113 $item_list_gui->enableCopy($objDefinition->allowCopy($a_set["type"]));
114
115 if ($a_set["type"] == "file") {
116 $item_list_gui->enableRepositoryTransfer(true);
117 }
118
119 $item_list_gui->setContainerObject($this->parent_obj);
120
121 if (in_array($a_set["type"], array("file", "blog"))) {
122 // add "share" link
123 $ilCtrl->setParameterByClass("ilworkspaceaccessgui", "wsp_id", $a_set["wsp_id"]);
124 $share_link = $ilCtrl->getLinkTargetByClass(array("ilObj" . $class . "GUI", "ilworkspaceaccessgui"), "share");
125 $item_list_gui->addCustomCommand($share_link, "wsp_permissions");
126
127 // show "shared" status
128 if (in_array($a_set["obj_id"], $this->shared_objects)) {
129 $item_list_gui->addCustomProperty($this->lng->txt("status"), $this->lng->txt("wsp_status_shared"), true, true);
130 }
131 }
132
133 if ($html = $item_list_gui->getListItemHTML(
134 $a_set["wsp_id"],
135 $a_set["obj_id"],
136 $a_set["title"],
137 $a_set["description"]
138 )) {
139 $this->tpl->setVariable("ITEM_LIST_NODE", $html);
140 }
141 }
142}
User class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(object $a_parent_obj, string $a_parent_cmd, int $a_node_id, ilWorkspaceAccessHandler $a_access_handler, bool $admin=false)
fillRow(array $a_set)
Standard Version of Fill Row.
parses the objects.xml it handles the xml-description of all ilias objects
Preloader for object list GUIs.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setLimit(int $a_limit=0, int $a_default_limit=0)
set max.
setEnableNumInfo(bool $a_val)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
setData(array $a_data)
Set table data.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26