ILIAS  release_7 Revision v7.30-3-g800a261c036
ilWorkspaceContentGUI Class Reference

Workspace content renderer. More...

+ Collaboration diagram for ilWorkspaceContentGUI:

Public Member Functions

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

Protected Member Functions

 getItems ()
 
 getItemHTML ($node)
 Get item HTML. More...
 

Protected Attributes

 $current_node
 
 $admin
 
 $access_handler
 
 $ui
 
 $lng
 
 $user
 
 $obj_definition
 
 $ctrl
 
 $folder_sorting
 

Detailed Description

Workspace content renderer.

Author
@leifos.de

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

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

72 {
73 $this->current_node = $node_id;
74 $this->admin = $admin;
75 $this->access_handler = $access_handler;
76 $this->object_gui = $object_gui;
77 $this->ui = $ui;
78 $this->lng = $lng;
79 $this->user = $user;
80 $this->obj_definition = $obj_definition;
81 $this->ctrl = $ctrl;
82 $this->user_folder_settings = $user_folder_settings;
83
84 $this->folder_sorting = new ilWorkspaceFolderSorting();
85 }
user()
Definition: user.php:4
ui()
Definition: ui.php:5

References $access_handler, $admin, $ctrl, $lng, $obj_definition, $ui, $user, ui(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ getItemHTML()

ilWorkspaceContentGUI::getItemHTML (   $node)
protected

Get item HTML.

Parameters

return

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

176 {
177 $objDefinition = $this->obj_definition;
178 $ilCtrl = $this->ctrl;
179 //bug ilCertificateVerificationClassMap in 6 beta was cmiv instead of cmxv
180 if ($node["type"] == "cmiv") {
181 return "";
182 }
183
184 $class = $objDefinition->getClassName($node["type"]);
185 $location = $objDefinition->getLocation($node["type"]);
186 $full_class = "ilObj" . $class . "ListGUI";
187
188 include_once($location . "/class." . $full_class . ".php");
189 $item_list_gui = new $full_class(ilObjectListGUI::CONTEXT_WORKSPACE);
190
191 $item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_ALL);
192 $item_list_gui->enableDelete(true);
193 $item_list_gui->enableCut(true);
194 $item_list_gui->enableSubscribe(false);
195 $item_list_gui->enableLink(false);
196 $item_list_gui->enablePath(false);
197 $item_list_gui->enableLinkedPath(false);
198 $item_list_gui->enableSearchFragments(true);
199 $item_list_gui->enableRelevance(false);
200 $item_list_gui->enableIcon(true);
201 $item_list_gui->enableTimings(false);
202 $item_list_gui->enableCheckbox($this->admin);
203 // $item_list_gui->setSeparateCommands(true);
204
205 $item_list_gui->enableNotes(true);
206 $item_list_gui->enableCopy($objDefinition->allowCopy($node["type"]));
207
208 if ($node["type"] == "file") {
209 $item_list_gui->enableRepositoryTransfer(true);
210 }
211
212 $item_list_gui->setContainerObject($this->object_gui);
213
214 if (in_array($node["type"], array("file", "blog"))) {
215 // add "share" link
216 $ilCtrl->setParameterByClass("ilworkspaceaccessgui", "wsp_id", $node["wsp_id"]);
217 $share_link = $ilCtrl->getLinkTargetByClass(array("ilObj" . $class . "GUI", "ilworkspaceaccessgui"), "share");
218 $item_list_gui->addCustomCommand($share_link, "wsp_permissions");
219
220 // show "shared" status
221 if (in_array($node["obj_id"], $this->shared_objects)) {
222 $item_list_gui->addCustomProperty($this->lng->txt("status"), $this->lng->txt("wsp_status_shared"), true, true);
223 }
224 }
225
226 $html = $item_list_gui->getListItemHTML(
227 $node["wsp_id"],
228 $node["obj_id"],
229 $node["title"],
230 $node["description"]
231 );
232
233 return $html;
234 }
$location
Definition: buildRTE.php:44

References $ctrl, $location, $obj_definition, ilObjectListGUI\CONTEXT_WORKSPACE, and ilObjectListGUI\DETAILS_ALL.

Referenced by render().

+ Here is the caller graph for this function:

◆ getItems()

ilWorkspaceContentGUI::getItems ( )
protected

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

145 {
147
148 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
149 $tree = new ilWorkspaceTree($user->getId());
150 $nodes = $tree->getChilds($this->current_node, "title");
151
152 if (sizeof($nodes)) {
153 include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
155 foreach ($nodes as $node) {
156 $preloader->addItem($node["obj_id"], $node["type"]);
157 }
158 $preloader->preload();
159 unset($preloader);
160 }
161
162 $this->shared_objects = $this->access_handler->getObjectsIShare();
163
164 $nodes = $this->folder_sorting->sortNodes($nodes, $this->user_folder_settings->getEffectiveSortation($this->object_gui->ref_id));
165
166 return $nodes;
167 }
Preloader for object list GUIs.
Tree handler for personal workspace.

References $user, and ilObjectListGUI\CONTEXT_WORKSPACE.

Referenced by render().

+ Here is the caller graph for this function:

◆ render()

ilWorkspaceContentGUI::render ( )

Render.

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

91 {
92 $html = "";
93 $first = true;
94 foreach ($this->getItems() as $i) {
95 if ($first) {
96 $first = false;
97 } else {
98 $html .= $this->ui->renderer()->render($this->ui->factory()->divider()->horizontal());
99 }
100 $html .= $this->getItemHTML($i);
101 }
102
103 if ($this->admin) {
104 $tpl = new ilTemplate("tpl.admin_container.html", true, true, "Modules/WorkspaceFolder");
105 $tpl->setVariable("ITEMS", $html);
106 $tpl->setVariable("TXT_SELECT_ALL", $this->lng->txt("select_all"));
107 $html = $tpl->get();
108 }
109
110
111 // output sortation
112 $tree = new ilWorkspaceTree($this->user->getId());
113 $parent_id = $tree->getParentId($this->object_gui->ref_id);
114 $parent_effective = ($parent_id > 0)
115 ? $this->user_folder_settings->getEffectiveSortation($parent_id)
116 : 0;
117 $selected = $this->user_folder_settings->getSortation($this->object_gui->object->getId());
118 $sort_options = $this->folder_sorting->getOptionsByType($this->object_gui->object->getType(), $selected, $parent_effective);
119 $sortation = $this->ui->factory()->viewControl()->sortation($sort_options)
120 ->withTargetURL($this->ctrl->getLinkTarget($this->object_gui, "setSortation"), 'sortation')
121 ->withLabel($this->lng->txt("wfld_sortation"));
122
123
124 if ($first) {
125 return "";
126 }
127
128 $leg = $this->ui->factory()->legacy($html);
129
130 $panel = $this->ui->factory()->panel()->standard($this->lng->txt("content"), [$leg]);
131
132 if (method_exists($panel, "withViewControls")) {
133 $panel = $panel->withViewControls(array($sortation));
134 }
135
136
137
138 return $this->ui->renderer()->render($panel);
139 }
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
Definition: imgupload.php:138
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
$i
Definition: metadata.php:24

References $i, $panel, $tpl, getItemHTML(), getItems(), ui(), and user().

+ Here is the call graph for this function:

Field Documentation

◆ $access_handler

ilWorkspaceContentGUI::$access_handler
protected

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

Referenced by __construct().

◆ $admin

ilWorkspaceContentGUI::$admin
protected

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

Referenced by __construct().

◆ $ctrl

ilWorkspaceContentGUI::$ctrl
protected

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

Referenced by __construct(), and getItemHTML().

◆ $current_node

ilWorkspaceContentGUI::$current_node
protected

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

◆ $folder_sorting

ilWorkspaceContentGUI::$folder_sorting
protected

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

◆ $lng

ilWorkspaceContentGUI::$lng
protected

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

Referenced by __construct().

◆ $obj_definition

ilWorkspaceContentGUI::$obj_definition
protected

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

Referenced by __construct(), and getItemHTML().

◆ $ui

ilWorkspaceContentGUI::$ui
protected

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

Referenced by __construct().

◆ $user

ilWorkspaceContentGUI::$user
protected

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

Referenced by __construct(), and getItems().


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