ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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", "Modules/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  {
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->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($a_set["type"]));
115 
116  if ($a_set["type"] == "file") {
117  $item_list_gui->enableRepositoryTransfer(true);
118  }
119 
120  $item_list_gui->setContainerObject($this->parent_obj);
121 
122  if (in_array($a_set["type"], array("file", "blog"))) {
123  // add "share" link
124  $ilCtrl->setParameterByClass("ilworkspaceaccessgui", "wsp_id", $a_set["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($a_set["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  $a_set["wsp_id"],
136  $a_set["obj_id"],
137  $a_set["title"],
138  $a_set["description"]
139  )) {
140  $this->tpl->setVariable("ITEM_LIST_NODE", $html);
141  }
142  }
143 }
setData(array $a_data)
getChilds(int $a_node_id, string $a_order="", string $a_direction="ASC")
get child nodes of given node
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setId(string $a_val)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
parses the objects.xml it handles the xml-description of all ilias objects
__construct(object $a_parent_obj, string $a_parent_cmd, int $a_node_id, ilWorkspaceAccessHandler $a_access_handler, bool $admin=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setEnableNumInfo(bool $a_val)
__construct(Container $dic, ilPlugin $plugin)
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)
$ilUser
Definition: imgupload.php:34
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)