ILIAS  release_8 Revision v8.24
ilWorkspaceContentGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilWorkspaceContentGUI:

Public Member Functions

 __construct (object $object_gui, int $node_id, bool $admin, ilWorkspaceAccessHandler $access_handler, \ILIAS\DI\UIServices $ui, ilLanguage $lng, ilObjUser $user, ilObjectDefinition $obj_definition, ilCtrl $ctrl, ilWorkspaceFolderUserSettings $user_folder_settings)
 
 render ()
 

Protected Member Functions

 getItems ()
 
 getItemHTML (array $node)
 

Protected Attributes

int $current_node
 
bool $admin
 
ilWorkspaceAccessHandler $access_handler
 
ILIAS DI UIServices $ui
 
ilLanguage $lng
 
ilObjUser $user
 
ilObjectDefinition $obj_definition
 
ilCtrl $ctrl
 
ilWorkspaceFolderSorting $folder_sorting = null
 

Private Attributes

object $object_gui
 
ilWorkspaceFolderUserSettings $user_folder_settings
 
array $shared_objects
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Workspace content renderer

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 24 of file class.ilWorkspaceContentGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilWorkspaceContentGUI::__construct ( object  $object_gui,
int  $node_id,
bool  $admin,
ilWorkspaceAccessHandler  $access_handler,
\ILIAS\DI\UIServices  $ui,
ilLanguage  $lng,
ilObjUser  $user,
ilObjectDefinition  $obj_definition,
ilCtrl  $ctrl,
ilWorkspaceFolderUserSettings  $user_folder_settings 
)

Definition at line 39 of file class.ilWorkspaceContentGUI.php.

50 {
51 $this->current_node = $node_id;
52 $this->admin = $admin;
53 $this->access_handler = $access_handler;
54 $this->object_gui = $object_gui;
55 $this->ui = $ui;
56 $this->lng = $lng;
57 $this->user = $user;
58 $this->obj_definition = $obj_definition;
59 $this->ctrl = $ctrl;
60 $this->user_folder_settings = $user_folder_settings;
61
62 $this->folder_sorting = new ilWorkspaceFolderSorting();
63 }
ilWorkspaceFolderUserSettings $user_folder_settings
ilWorkspaceAccessHandler $access_handler
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $access_handler, $admin, $ctrl, $lng, $obj_definition, $object_gui, $ui, $user, $user_folder_settings, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ getItemHTML()

ilWorkspaceContentGUI::getItemHTML ( array  $node)
protected

Definition at line 139 of file class.ilWorkspaceContentGUI.php.

139 : string
140 {
141 $objDefinition = $this->obj_definition;
142 $ilCtrl = $this->ctrl;
143 //bug ilCertificateVerificationClassMap in 6 beta was cmiv instead of cmxv
144 if ($node["type"] == "cmiv") {
145 return "";
146 }
147
148 $class = $objDefinition->getClassName($node["type"]);
149 $full_class = "ilObj" . $class . "ListGUI";
150
151 $item_list_gui = new $full_class(ilObjectListGUI::CONTEXT_WORKSPACE);
152
153 $item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_ALL);
154 $item_list_gui->enableDelete(true);
155 $item_list_gui->enableCut(true);
156 $item_list_gui->enableSubscribe(false);
157 $item_list_gui->enableLink(false);
158 $item_list_gui->enablePath(false);
159 $item_list_gui->enableLinkedPath(false);
160 $item_list_gui->enableSearchFragments(true);
161 $item_list_gui->enableRelevance(false);
162 $item_list_gui->enableIcon(true);
163 $item_list_gui->enableTimings(false);
164 $item_list_gui->enableCheckbox($this->admin);
165
166 $item_list_gui->enableNotes(true);
167 $item_list_gui->enableCopy($objDefinition->allowCopy($node["type"]));
168
169 if ($node["type"] == "file") {
170 $item_list_gui->enableRepositoryTransfer(true);
171 }
172
173 $item_list_gui->setContainerObject($this->object_gui);
174
175 if (in_array($node["type"], array("file", "blog"))) {
176 // add "share" link
177 $ilCtrl->setParameterByClass("ilworkspaceaccessgui", "wsp_id", $node["wsp_id"]);
178 $share_link = $ilCtrl->getLinkTargetByClass(array("ilObj" . $class . "GUI", "ilworkspaceaccessgui"), "share");
179 $item_list_gui->addCustomCommand($share_link, "wsp_permissions");
180
181 // show "shared" status
182 if (in_array($node["obj_id"], $this->shared_objects)) {
183 $item_list_gui->addCustomProperty($this->lng->txt("status"), $this->lng->txt("wsp_status_shared"), true, true);
184 }
185 }
186
187 $html = $item_list_gui->getListItemHTML(
188 $node["wsp_id"],
189 $node["obj_id"],
190 (string) $node["title"],
191 (string) $node["description"]
192 );
193
194 return $html;
195 }

References $ctrl, $obj_definition, ilObjectListGUI\CONTEXT_WORKSPACE, ilObjectListGUI\DETAILS_ALL, and ILIAS\Repository\lng().

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getItems()

ilWorkspaceContentGUI::getItems ( )
protected

Definition at line 116 of file class.ilWorkspaceContentGUI.php.

116 : array
117 {
119
120 $tree = new ilWorkspaceTree($user->getId());
121 $nodes = $tree->getChilds($this->current_node, "title");
122
123 if (sizeof($nodes)) {
125 foreach ($nodes as $node) {
126 $preloader->addItem($node["obj_id"], $node["type"]);
127 }
128 $preloader->preload();
129 unset($preloader);
130 }
131
132 $this->shared_objects = $this->access_handler->getObjectsIShare();
133
134 $nodes = $this->folder_sorting->sortNodes($nodes, $this->user_folder_settings->getEffectiveSortation($this->object_gui->getRefId()));
135
136 return $nodes;
137 }
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...

References $user, ilObjectListGUI\CONTEXT_WORKSPACE, and ilObject\getId().

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ render()

ilWorkspaceContentGUI::render ( )

Definition at line 65 of file class.ilWorkspaceContentGUI.php.

65 : string
66 {
67 $html = "";
68 $first = true;
69 foreach ($this->getItems() as $i) {
70 if ($first) {
71 $first = false;
72 } else {
73 $html .= $this->ui->renderer()->render($this->ui->factory()->divider()->horizontal());
74 }
75 $html .= $this->getItemHTML($i);
76 }
77
78 if ($this->admin) {
79 $tpl = new ilTemplate("tpl.admin_container.html", true, true, "Modules/WorkspaceFolder");
80 $tpl->setVariable("ITEMS", $html);
81 $tpl->setVariable("TXT_SELECT_ALL", $this->lng->txt("select_all"));
82 $html = $tpl->get();
83 }
84
85
86 // output sortation
87 $tree = new ilWorkspaceTree($this->user->getId());
88 $parent_id = $tree->getParentId($this->object_gui->getRefId());
89 $parent_effective = ($parent_id > 0)
90 ? $this->user_folder_settings->getEffectiveSortation($parent_id)
91 : 0;
92 $selected = $this->user_folder_settings->getSortation($this->object_gui->getObject()->getId());
93 $sort_options = $this->folder_sorting->getOptionsByType($this->object_gui->getObject()->getType(), $selected, $parent_effective);
94 $sortation = $this->ui->factory()->viewControl()->sortation($sort_options)
95 ->withTargetURL($this->ctrl->getLinkTarget($this->object_gui, "setSortation"), 'sortation')
96 ->withLabel($this->lng->txt("wfld_sortation"));
97
98
99 if ($first) {
100 return "";
101 }
102
103 $leg = $this->ui->factory()->legacy($html);
104
105 $panel = $this->ui->factory()->panel()->standard($this->lng->txt("content"), [$leg]);
106
107 if (method_exists($panel, "withViewControls")) {
108 $panel = $panel->withViewControls(array($sortation));
109 }
110
111
112
113 return $this->ui->renderer()->render($panel);
114 }
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
Definition: imgupload.php:198
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
$i
Definition: metadata.php:41

References $i, $panel, $tpl, ILIAS\Repository\ctrl(), getItemHTML(), getItems(), ILIAS\Repository\lng(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Field Documentation

◆ $access_handler

ilWorkspaceAccessHandler ilWorkspaceContentGUI::$access_handler
protected

Definition at line 31 of file class.ilWorkspaceContentGUI.php.

Referenced by __construct().

◆ $admin

bool ilWorkspaceContentGUI::$admin
protected

Definition at line 30 of file class.ilWorkspaceContentGUI.php.

Referenced by __construct().

◆ $ctrl

ilCtrl ilWorkspaceContentGUI::$ctrl
protected

Definition at line 36 of file class.ilWorkspaceContentGUI.php.

Referenced by __construct(), and getItemHTML().

◆ $current_node

int ilWorkspaceContentGUI::$current_node
protected

Definition at line 29 of file class.ilWorkspaceContentGUI.php.

◆ $folder_sorting

ilWorkspaceFolderSorting ilWorkspaceContentGUI::$folder_sorting = null
protected

Definition at line 37 of file class.ilWorkspaceContentGUI.php.

◆ $lng

ilLanguage ilWorkspaceContentGUI::$lng
protected

Definition at line 33 of file class.ilWorkspaceContentGUI.php.

Referenced by __construct().

◆ $obj_definition

ilObjectDefinition ilWorkspaceContentGUI::$obj_definition
protected

Definition at line 35 of file class.ilWorkspaceContentGUI.php.

Referenced by __construct(), and getItemHTML().

◆ $object_gui

object ilWorkspaceContentGUI::$object_gui
private

Definition at line 26 of file class.ilWorkspaceContentGUI.php.

Referenced by __construct().

◆ $shared_objects

array ilWorkspaceContentGUI::$shared_objects
private

Definition at line 28 of file class.ilWorkspaceContentGUI.php.

◆ $ui

ILIAS DI UIServices ilWorkspaceContentGUI::$ui
protected

Definition at line 32 of file class.ilWorkspaceContentGUI.php.

Referenced by __construct().

◆ $user

ilObjUser ilWorkspaceContentGUI::$user
protected

Definition at line 34 of file class.ilWorkspaceContentGUI.php.

Referenced by __construct(), and getItems().

◆ $user_folder_settings

ilWorkspaceFolderUserSettings ilWorkspaceContentGUI::$user_folder_settings
private

Definition at line 27 of file class.ilWorkspaceContentGUI.php.

Referenced by __construct().


The documentation for this class was generated from the following file: