34 protected \ILIAS\PersonalWorkspace\InternalGUIService
$gui;
59 bool $a_is_portfolio =
false,
64 $this->
tabs = $DIC->tabs();
65 $this->tpl =
$DIC->ui()->mainTemplate();
66 $this->
toolbar = $DIC->toolbar();
67 $this->
user = $DIC->user();
69 $ilCtrl =
$DIC->ctrl();
72 $this->
ctrl = $ilCtrl;
74 $this->node_id = $a_node_id;
75 $this->access_handler = $a_access_handler;
76 $this->is_portfolio = $a_is_portfolio;
77 $this->footer = $a_footer;
82 $this->gui =
$DIC->personalWorkspace()->internal()->gui();
88 $this->blocking_message = $a_val;
100 $next_class = $this->
ctrl->getNextClass($this);
101 $cmd = $this->
ctrl->getCmd();
103 switch ($next_class) {
104 case "ilmailsearchcoursesgui":
105 $ilTabs->setBackTarget(
106 $this->
lng->txt(
"back"),
107 $this->ctrl->getLinkTarget($this,
"share")
110 $this->
ctrl->setReturn($this,
'share');
111 $this->
ctrl->forwardCommand($csearch);
116 case "ilmailsearchgroupsgui":
117 $ilTabs->setBackTarget(
118 $this->
lng->txt(
"back"),
119 $this->ctrl->getLinkTarget($this,
"share")
122 $this->
ctrl->setReturn($this,
'share');
123 $this->
ctrl->forwardCommand($gsearch);
128 case "ilmailsearchgui":
129 $ilTabs->setBackTarget(
130 $this->
lng->txt(
"back"),
131 $this->ctrl->getLinkTarget($this,
"share")
134 $this->
ctrl->setReturn($this,
'share');
135 $this->
ctrl->forwardCommand($usearch);
140 case "ilsingleusersharegui":
141 $ilTabs->setBackTarget(
142 $this->
lng->txt(
"back"),
143 $this->ctrl->getLinkTarget($this,
"share")
146 $this->
ctrl->setReturn($this,
'share');
147 $this->
ctrl->forwardCommand($ushare);
152 case strtolower(PublicProfileGUI::class):
153 $ilTabs->clearTargets();
154 $ilTabs->setBackTarget(
155 $this->
lng->txt(
"back"),
156 $this->ctrl->getLinkTarget($this,
"share")
160 $this->std_request->getUser()
162 $prof->setBackUrl($this->
ctrl->getLinkTarget($this,
"share"));
181 if (!$this->is_portfolio) {
182 $obj_id = $this->access_handler->getTree()->lookupObjectId($this->node_id);
212 $options[
"user"] = $this->
lng->txt(
"wsp_set_permission_single_user");
215 if (
sizeof($grp_ids)) {
216 $options[
"group"] = $this->
lng->txt(
"wsp_set_permission_group");
220 if (
sizeof($crs_ids)) {
221 $options[
"course"] = $this->
lng->txt(
"wsp_set_permission_course");
225 $options[
"registered"] = $this->
lng->txt(
"wsp_set_permission_registered");
228 if (
$ilSetting->get(
"enable_global_profiles")) {
229 if (!$this->
getAccessHandler()->hasGlobalPasswordPermission($this->node_id)) {
230 $options[
"password"] = $this->
lng->txt(
"wsp_set_permission_all_password");
234 $options[
"all"] = $this->
lng->txt(
"wsp_set_permission_all");
239 $actions->setOptions($options);
240 $ilToolbar->addStickyItem($actions);
242 $ilToolbar->setFormAction($this->
ctrl->getFormAction($this));
245 $this->
lng->txt(
"add"),
246 "addpermissionhandler"
247 )->submit()->toToolbar(
true);
250 $tpl->
setContent($table->getHTML() . $this->footer);
255 switch ($this->std_request->getAction()) {
259 $this->
ctrl->redirectByClass(
"ilsingleusersharegui");
261 $this->
ctrl->setParameterByClass(
"ilmailsearchgui",
"ref",
"wsp");
262 $this->
ctrl->redirectByClass(
"ilmailsearchgui");
267 $this->
ctrl->setParameterByClass(
"ilmailsearchgroupsgui",
"ref",
"wsp");
268 $this->
ctrl->redirectByClass(
"ilmailsearchgroupsgui");
272 $this->
ctrl->setParameterByClass(
"ilmailsearchcoursesgui",
"ref",
"wsp");
273 $this->
ctrl->redirectByClass(
"ilmailsearchcoursesgui");
277 $this->
getAccessHandler()->addMissingPermissionForObjects($this->node_id, [self::PERMISSION_REGISTERED]);
278 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"wsp_share_success"),
true);
279 $this->
ctrl->redirect($this,
"share");
287 $this->
getAccessHandler()->addMissingPermissionForObjects($this->node_id, [self::PERMISSION_ALL]);
288 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"wsp_permission_all_info"),
true);
289 $this->
ctrl->redirect($this,
"share");
295 $obj_id = $this->std_request->getObjId();
298 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"wsp_permission_removed"),
true);
301 $this->
ctrl->redirect($this,
"share");
307 $form->setFormAction($this->
ctrl->getFormAction($this));
308 $form->setTitle($this->
lng->txt(
"wsp_set_permission_all_password"));
311 $password->setRequired(
true);
312 $form->addItem($password);
314 $form->addCommandButton(
'savepasswordform', $this->
lng->txt(
"save"));
315 $form->addCommandButton(
'share', $this->
lng->txt(
"cancel"));
333 if ($form->checkInput()) {
336 self::PERMISSION_ALL_PASSWORD,
337 md5($form->getInput(
"password"))
339 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"wsp_permission_all_pw_info"),
true);
340 $this->
ctrl->redirect($this,
"share");
343 $form->setValuesByPost();
GUI class for public user profile presentation.
Class ilCtrl provides processing control methods.
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
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(int $a_node_id, $a_access_handler, bool $a_is_portfolio=false, string $a_footer="")
showPasswordForm(?ilPropertyFormGUI $a_form=null)
const PERMISSION_REGISTERED
setBlockingMessage(string $a_val)
StandardGUIRequest $std_request
ILIAS PersonalWorkspace InternalGUIService $gui
ilGlobalTemplateInterface $tpl
const PERMISSION_ALL_PASSWORD
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
setContent(string $a_html)
Sets content for standard template.