44 ?
int $a_parent_node_id =
null,
45 bool $a_load_data =
false
50 $this->ui_factory =
$DIC->ui()->factory();
51 $this->
renderer = $DIC->ui()->renderer();
53 $this->
ctrl = $DIC->ctrl();
54 $this->
lng = $DIC->language();
56 $this->
user = $DIC->user();
57 $ilCtrl =
$DIC->ctrl();
59 $this->handler = $a_handler;
65 $this->parent_node_id = 0;
67 if (stristr(get_class($a_parent_obj),
"portfolio")) {
68 $this->parent_node_id = (
int) $a_parent_node_id;
69 $this->portfolio_mode =
true;
74 $this->
setId(
"il_tbl_wspsh" . (
int) $this->portfolio_mode);
78 $this->
addColumn($this->
lng->txt(
"lastname"),
"lastname");
79 $this->
addColumn($this->
lng->txt(
"firstname"),
"firstname");
82 if (!$this->portfolio_mode) {
83 $this->
addColumn($this->
lng->txt(
"wsp_shared_object_type"),
"obj_type");
86 $this->
addColumn($this->
lng->txt(
"wsp_shared_date"),
"acl_date");
87 $this->
addColumn($this->
lng->txt(
"wsp_shared_title"),
"title");
98 $this->
setRowTemplate(
"tpl.shared_row.html",
"components/ILIAS/PersonalWorkspace");
101 $this->
setResetCommand(
"resetsharefilter", $this->
lng->txt(
"wsp_shared_filter_reset_button"));
107 if ($this->portfolio_mode &&
108 !$this->
filter[
"obj_type"]) {
109 $this->
filter[
"obj_type"] =
"prtf";
113 if ((isset($this->
filter[
"user"]) && $this->
filter[
"user"] !==
"") ||
114 (isset($this->
filter[
"title"]) && $this->
filter[
"title"] !==
"") ||
115 (isset($this->
filter[
"acl_type"]) && $this->
filter[
"acl_type"] !==
"") ||
116 (isset($this->
filter[
"acl_date"]) && $this->
filter[
"acl_date"] !==
"")) {
156 $this->
filter[
"user"] = $item->getValue();
160 if ($this->std_request->getShareId() &&
161 !is_array($form_sess) &&
165 $item->setValue($this->
filter[
"user"]);
169 $this->
filter[
"title"] = $item->getValue();
172 $this->
filter[
"acl_date"] = $item->getDate();
174 if (!$this->portfolio_mode) {
177 $settings_map = array(
"blog" =>
"blogs",
180 foreach (array(
"file",
"blog") as $type) {
181 if (isset($settings_map[$type]) &&
$ilSetting->get(
"disable_wsp_" . $settings_map[$type])) {
193 $this->
filter[
"obj_type"] = $item->getValue();
200 if (
sizeof($this->grp_ids)) {
204 if (
sizeof($this->crs_ids)) {
208 if (!$this->handler->hasRegisteredPermission($this->parent_node_id)) {
212 if (
$ilSetting->get(
"enable_global_profiles")) {
213 if (!$this->handler->hasGlobalPasswordPermission($this->parent_node_id)) {
214 $options[
"password"] = $this->
lng->txt(
"wsp_set_permission_all_password");
217 if (!$this->handler->hasGlobalPermission($this->parent_node_id)) {
218 $options[
"all"] = $this->
lng->txt(
"wsp_set_permission_all");
225 $this->
filter[
"acl_type"] = $item->getValue();
228 if (
sizeof($this->crs_ids) ||
sizeof($this->grp_ids)) {
230 foreach ($this->crs_ids as $crs_id) {
233 foreach ($this->grp_ids as $grp_id) {
239 $this->
filter[
"crsgrp"] = $item->getValue();
249 $user_data = array();
251 $objects = $this->handler->findSharedObjects($this->
filter, $this->crs_ids, $this->grp_ids);
253 foreach ($objects as $wsp_id => $item) {
254 if (!isset($user_data[$item[
"owner"]])) {
259 if (!$user_data[$item[
"owner"]][
"login"]) {
264 "obj_id" => $item[
"obj_id"],
265 "type" => $item[
"type"] ??
"",
266 "obj_type" =>
$lng->
txt(
"wsp_type_" . ($item[
"type"] ??
"")),
267 "title" => $item[
"title"],
268 "owner_id" => $item[
"owner"],
269 "lastname" => $user_data[$item[
"owner"]][
"lastname"],
270 "firstname" => $user_data[$item[
"owner"]][
"firstname"],
271 "login" => $user_data[$item[
"owner"]][
"login"],
272 "acl_type" => $item[
"acl_type"],
273 "acl_date" => $item[
"acl_date"]
284 protected function fillRow(array $a_set): void
288 $this->tpl->setVariable(
"LASTNAME", $a_set[
"lastname"]);
289 $this->tpl->setVariable(
"FIRSTNAME", $a_set[
"firstname"]);
290 $this->tpl->setVariable(
"LOGIN", $a_set[
"login"]);
292 $this->tpl->setVariable(
"TITLE", $a_set[
"title"]);
294 if (!$this->portfolio_mode) {
295 $icon = $this->ui_factory->symbol()->icon()->standard($a_set[
"type"],
"");
296 $this->tpl->setVariable(
"ICON", $this->
renderer->render(
$icon));
297 $this->tpl->setVariable(
"TYPE", $a_set[
"obj_type"]);
298 $url = $this->handler->getGotoLink($a_set[
"wsp_id"], $a_set[
"obj_id"]);
302 $this->tpl->setVariable(
"URL_TITLE",
$url);
304 $this->tpl->setVariable(
309 asort($a_set[
"acl_type"]);
310 foreach ($a_set[
"acl_type"] as $obj_id) {
315 $type =
"registered";
320 $type =
"all_password";
325 $type =
"all_password";
330 if ($type !=
"usr") {
338 $this->tpl->setCurrentBlock(
"acl_type_bl");
339 $this->tpl->setVariable(
"ACL_TYPE",
$title);
340 $this->tpl->parseCurrentBlock();
343 if (!$this->portfolio_mode) {
345 if ($a_set[
"type"] ==
"file") {
346 $ilCtrl->setParameter(
349 $this->parent_node_id
351 $ilCtrl->setParameter(
356 $url = $ilCtrl->getLinkTarget($this->parent_obj,
"copyshared");
358 $this->tpl->setCurrentBlock(
"action_bl");
359 $this->tpl->setVariable(
"URL_ACTION",
$url);
360 $this->tpl->setVariable(
"ACTION",
$lng->
txt(
"copy"));
361 $this->tpl->parseCurrentBlock();
363 $this->tpl->touchBlock(
"action_col_bl");
366 $ilCtrl->setParameter($this->parent_obj,
"owner_id", $a_set[
"owner_id"]);
367 $ilCtrl->setParameter($this->parent_obj,
"prt_id", $a_set[
"obj_id"]);
368 $b = $this->ui_factory->button()->shy(
369 $this->
lng->txt(
"wsp_send_mail"),
370 $ilCtrl->getLinkTarget($this->parent_obj,
"redirectSendMailToSharer")
372 $dd = $this->ui_factory->dropdown()->standard([
$b]);
373 $this->tpl->setCurrentBlock(
"action_bl");
374 $this->tpl->setVariable(
"ACTION_DD", $this->
renderer->render($dd));
375 $this->tpl->parseCurrentBlock();
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
static _lookupName(int $a_user_id)
static _lookupType(int $id, bool $reference=false)
static _lookupTitle(int $obj_id)
static _getMembershipByType(int $a_usr_id, array $a_type, bool $a_only_member_role=false)
get membership by type Get course or group membership
Access handler for portfolio NOTE: This file needs to stay in the classes directory,...
static get(string $a_var)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFilterCommand(string $a_val, string $a_caption="")
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
setDefaultOrderField(string $a_defaultorderfield)
ilGlobalTemplateInterface $main_tpl
setDisableFilterHiding(bool $a_val=true)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
setResetCommand(string $a_val, string $a_caption="")
setData(array $a_data)
Set table data.
disable(string $a_module_name)
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:
const PERMISSION_REGISTERED
const PERMISSION_ALL_PASSWORD
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Workspace share handler table GUI class.
ilWorkspaceAccessHandler ilPortfolioAccessHandler $handler
ILIAS UI Renderer $renderer
__construct(object $a_parent_obj, string $a_parent_cmd, ilWorkspaceAccessHandler|ilPortfolioAccessHandler $a_handler, ?int $a_parent_node_id=null, bool $a_load_data=false)
ILIAS UI Factory $ui_factory
StandardGUIRequest $std_request
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
filter(string $filter_id, array $class_path, string $cmd, bool $activated=true, bool $expanded=true)