ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilWorkspaceAccessGUI Class Reference

ACL access handler GUI. More...

+ Collaboration diagram for ilWorkspaceAccessGUI:

Public Member Functions

 __construct (int $a_node_id, ilPortfolioAccessHandler|ilWorkspaceAccessHandler $a_access_handler, bool $a_is_portfolio=false, string $a_footer="")
 
 setBlockingMessage (string $a_val)
 
 getBlockingMessage ()
 
 executeCommand ()
 
 addPermissionHandler ()
 
 removePermission (int $obj_id)
 

Data Fields

const PERMISSION_REGISTERED = -1
 
const PERMISSION_ALL_PASSWORD = -3
 
const PERMISSION_ALL = -5
 

Protected Member Functions

 setObjectTitle ()
 
 getAccessHandler ()
 
 share ()
 
 initPasswordForm ()
 
 showPasswordForm (?ilPropertyFormGUI $a_form=null)
 
 savePasswordForm ()
 

Protected Attributes

ILIAS PersonalWorkspace InternalGUIService $gui
 
bool $is_portfolio
 
ilTabsGUI $tabs
 
ilGlobalTemplateInterface $tpl
 
ilToolbarGUI $toolbar
 
ilObjUser $user
 
ilSetting $settings
 
ilCtrl $ctrl
 
ilLanguage $lng
 
int $node_id
 
ilPortfolioAccessHandler ilWorkspaceAccessHandler $access_handler
 
string $footer = ""
 
string $blocking_message = ""
 
StandardGUIRequest $std_request
 

Detailed Description

ACL access handler GUI.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om @ilCtrl_Calls ilWorkspaceAccessGUI: ilMailSearchCoursesGUI, ilMailSearchGroupsGUI @ilCtrl_Calls ilWorkspaceAccessGUI: ilMailSearchGUI, ILIAS\User\Profile\PublicProfileGUI, ilSingleUserShareGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilWorkspaceAccessGUI::__construct ( int  $a_node_id,
ilPortfolioAccessHandler|ilWorkspaceAccessHandler  $a_access_handler,
bool  $a_is_portfolio = false,
string  $a_footer = "" 
)

Definition at line 50 of file class.ilWorkspaceAccessGUI.php.

55 {
56 global $DIC;
57
58 $this->tabs = $DIC->tabs();
59 $this->tpl = $DIC->ui()->mainTemplate();
60 $this->toolbar = $DIC->toolbar();
61 $this->user = $DIC->user();
62 $this->settings = $DIC->settings();
63 $ilCtrl = $DIC->ctrl();
64 $lng = $DIC->language();
65
66 $this->ctrl = $ilCtrl;
67 $this->lng = $lng;
68 $this->node_id = $a_node_id;
69 $this->access_handler = $a_access_handler;
70 $this->is_portfolio = $a_is_portfolio;
71 $this->footer = $a_footer;
72 $this->std_request = new StandardGUIRequest(
73 $DIC->http(),
74 $DIC->refinery()
75 );
76 $this->gui = $DIC->personalWorkspace()->internal()->gui();
77 }
global $DIC
Definition: shib_login.php:26

References $DIC, $lng, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\settings(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addPermissionHandler()

ilWorkspaceAccessGUI::addPermissionHandler ( )

Definition at line 253 of file class.ilWorkspaceAccessGUI.php.

253 : void
254 {
255 switch ($this->std_request->getAction()) {
256 case "user":
257
258 if (ilUserAccountSettings::getInstance()->isUserAccessRestricted()) {
259 $this->ctrl->redirectByClass("ilsingleusersharegui");
260 } else {
261 $this->ctrl->setParameterByClass("ilmailsearchgui", "ref", "wsp");
262 $this->ctrl->redirectByClass("ilmailsearchgui");
263 }
264 break;
265
266 case "group":
267 $this->ctrl->setParameterByClass("ilmailsearchgroupsgui", "ref", "wsp");
268 $this->ctrl->redirectByClass("ilmailsearchgroupsgui");
269 break;
270
271 case "course":
272 $this->ctrl->setParameterByClass("ilmailsearchcoursesgui", "ref", "wsp");
273 $this->ctrl->redirectByClass("ilmailsearchcoursesgui");
274 break;
275
276 case "registered":
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");
280 break;
281
282 case "password":
283 $this->showPasswordForm();
284 break;
285
286 case "all":
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");
290 }
291 }
showPasswordForm(?ilPropertyFormGUI $a_form=null)

References ILIAS\Repository\ctrl(), getAccessHandler(), ilUserAccountSettings\getInstance(), ILIAS\Repository\lng(), and showPasswordForm().

+ Here is the call graph for this function:

◆ executeCommand()

ilWorkspaceAccessGUI::executeCommand ( )

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

90 : void
91 {
92 $ilTabs = $this->tabs;
94 $next_class = $this->ctrl->getNextClass($this);
95 $cmd = $this->ctrl->getCmd();
96
97 switch ($next_class) {
98 case "ilmailsearchcoursesgui":
99 $ilTabs->setBackTarget(
100 $this->lng->txt("back"),
101 $this->ctrl->getLinkTarget($this, "share")
102 );
103 $csearch = new ilMailSearchCoursesGUI($this->access_handler, $this->node_id);
104 $this->ctrl->setReturn($this, 'share');
105 $this->ctrl->forwardCommand($csearch);
106
107 $this->setObjectTitle();
108 break;
109
110 case "ilmailsearchgroupsgui":
111 $ilTabs->setBackTarget(
112 $this->lng->txt("back"),
113 $this->ctrl->getLinkTarget($this, "share")
114 );
115 $gsearch = new ilMailSearchGroupsGUI($this->access_handler, $this->node_id);
116 $this->ctrl->setReturn($this, 'share');
117 $this->ctrl->forwardCommand($gsearch);
118
119 $this->setObjectTitle();
120 break;
121
122 case "ilmailsearchgui":
123 $ilTabs->setBackTarget(
124 $this->lng->txt("back"),
125 $this->ctrl->getLinkTarget($this, "share")
126 );
127 $usearch = new ilMailSearchGUI($this->access_handler, $this->node_id);
128 $this->ctrl->setReturn($this, 'share');
129 $this->ctrl->forwardCommand($usearch);
130
131 $this->setObjectTitle();
132 break;
133
134 case "ilsingleusersharegui":
135 $ilTabs->setBackTarget(
136 $this->lng->txt("back"),
137 $this->ctrl->getLinkTarget($this, "share")
138 );
139 $ushare = new ilSingleUserShareGUI($this->access_handler, $this->node_id);
140 $this->ctrl->setReturn($this, 'share');
141 $this->ctrl->forwardCommand($ushare);
142
143 $this->setObjectTitle();
144 break;
145
146 case strtolower(PublicProfileGUI::class):
147 $ilTabs->clearTargets();
148 $ilTabs->setBackTarget(
149 $this->lng->txt("back"),
150 $this->ctrl->getLinkTarget($this, "share")
151 );
152
153 $prof = new PublicProfileGUI(
154 $this->std_request->getUser()
155 );
156 $prof->setBackUrl($this->ctrl->getLinkTarget($this, "share"));
157 $tpl->setContent($prof->getHTML());
158 break;
159
160 default:
161 // $this->prepareOutput();
162 if (!$cmd) {
163 $cmd = "share";
164 }
165 //return $this->$cmd();
166 $this->$cmd();
167 break;
168 }
169 }
GUI class for public user profile presentation.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.

References $tabs, $tpl, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\setContent(), and setObjectTitle().

+ Here is the call graph for this function:

◆ getAccessHandler()

ilWorkspaceAccessGUI::getAccessHandler ( )
protected

Definition at line 183 of file class.ilWorkspaceAccessGUI.php.

184 {
186 }
Access handler for portfolio NOTE: This file needs to stay in the classes directory,...
ilPortfolioAccessHandler ilWorkspaceAccessHandler $access_handler
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $access_handler.

Referenced by addPermissionHandler(), removePermission(), savePasswordForm(), and share().

+ Here is the caller graph for this function:

◆ getBlockingMessage()

ilWorkspaceAccessGUI::getBlockingMessage ( )

Definition at line 85 of file class.ilWorkspaceAccessGUI.php.

85 : string
86 {
88 }

References $blocking_message.

Referenced by share().

+ Here is the caller graph for this function:

◆ initPasswordForm()

ilWorkspaceAccessGUI::initPasswordForm ( )
protected

Definition at line 303 of file class.ilWorkspaceAccessGUI.php.

304 {
305 $form = new ilPropertyFormGUI();
306 $form->setFormAction($this->ctrl->getFormAction($this));
307 $form->setTitle($this->lng->txt("wsp_set_permission_all_password"));
308
309 $password = new ilPasswordInputGUI($this->lng->txt("password"), "password");
310 $password->setRequired(true);
311 $form->addItem($password);
312
313 $form->addCommandButton('savepasswordform', $this->lng->txt("save"));
314 $form->addCommandButton('share', $this->lng->txt("cancel"));
315
316 return $form;
317 }
This class represents a password property in a property form.
This class represents a property form user interface.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by savePasswordForm(), and showPasswordForm().

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

◆ removePermission()

ilWorkspaceAccessGUI::removePermission ( int  $obj_id)

Definition at line 293 of file class.ilWorkspaceAccessGUI.php.

293 : void
294 {
295 if ($obj_id !== 0) {
296 $this->getAccessHandler()->removePermission($this->node_id, $obj_id);
297 $this->tpl->setOnScreenMessage('success', $this->lng->txt("wsp_permission_removed"), true);
298 }
299
300 $this->ctrl->redirect($this, "share");
301 }

References ILIAS\Repository\ctrl(), getAccessHandler(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ savePasswordForm()

ilWorkspaceAccessGUI::savePasswordForm ( )
protected

Definition at line 329 of file class.ilWorkspaceAccessGUI.php.

329 : void
330 {
331 $form = $this->initPasswordForm();
332 if ($form->checkInput()) {
333 $this->getAccessHandler()->addPermission(
334 $this->node_id,
335 self::PERMISSION_ALL_PASSWORD,
336 md5($form->getInput("password"))
337 );
338 $this->tpl->setOnScreenMessage('success', $this->lng->txt("wsp_permission_all_pw_info"), true);
339 $this->ctrl->redirect($this, "share");
340 }
341
342 $form->setValuesByPost();
343 $this->showPasswordForm($form);
344 }

References ILIAS\Repository\ctrl(), getAccessHandler(), initPasswordForm(), ILIAS\Repository\lng(), and showPasswordForm().

+ Here is the call graph for this function:

◆ setBlockingMessage()

ilWorkspaceAccessGUI::setBlockingMessage ( string  $a_val)

Definition at line 80 of file class.ilWorkspaceAccessGUI.php.

80 : void
81 {
82 $this->blocking_message = $a_val;
83 }

◆ setObjectTitle()

ilWorkspaceAccessGUI::setObjectTitle ( )
protected

Definition at line 171 of file class.ilWorkspaceAccessGUI.php.

171 : void
172 {
174
175 if (!$this->is_portfolio) {
176 $obj_id = $this->access_handler->getTree()->lookupObjectId($this->node_id);
177 } else {
178 $obj_id = $this->node_id;
179 }
181 }
static _lookupTitle(int $obj_id)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.

References $node_id, $tpl, ilObject\_lookupTitle(), and ILIAS\UICore\GlobalTemplate\setTitle().

Referenced by executeCommand().

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

◆ share()

ilWorkspaceAccessGUI::share ( )
protected

Definition at line 188 of file class.ilWorkspaceAccessGUI.php.

188 : void
189 {
190 $ilToolbar = $this->toolbar;
192 $ilUser = $this->user;
194
195
196 // blocking message
197 if ($this->getBlockingMessage() != "") {
199 return;
200 }
201
202 $options = array();
203 $options["user"] = $this->lng->txt("wsp_set_permission_single_user");
204
205 $grp_ids = ilGroupParticipants::_getMembershipByType($ilUser->getId(), ['grp']);
206 if (sizeof($grp_ids)) {
207 $options["group"] = $this->lng->txt("wsp_set_permission_group");
208 }
209
210 $crs_ids = ilCourseParticipants::_getMembershipByType($ilUser->getId(), ['crs']);
211 if (sizeof($crs_ids)) {
212 $options["course"] = $this->lng->txt("wsp_set_permission_course");
213 }
214
215 if (!$this->getAccessHandler()->hasRegisteredPermission($this->node_id)) {
216 $options["registered"] = $this->lng->txt("wsp_set_permission_registered");
217 }
218
219 if ($ilSetting->get("enable_global_profiles")) {
220 if (!$this->getAccessHandler()->hasGlobalPasswordPermission($this->node_id)) {
221 $options["password"] = $this->lng->txt("wsp_set_permission_all_password");
222 }
223
224 if (!$this->getAccessHandler()->hasGlobalPermission($this->node_id)) {
225 $options["all"] = $this->lng->txt("wsp_set_permission_all");
226 }
227 }
228
229 $actions = new ilSelectInputGUI("", "action");
230 $actions->setOptions($options);
231 $ilToolbar->addStickyItem($actions);
232
233 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
234
235 $this->gui->button(
236 $this->lng->txt("add"),
237 "addpermissionhandler"
238 )->submit()->toToolbar(true);
239
240 $table = $this->gui->workspaceAccessTableBuilder(
241 $this->getAccessHandler(),
242 $this->node_id,
243 $this,
244 "share"
245 )->getTable();
246 if ($table->handleCommand()) {
247 return;
248 }
249
250 $tpl->setContent($table->render() . $this->footer);
251 }
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 class represents a selection list property in a property form.
global $ilSetting
Definition: privfeed.php:26

References $ilSetting, ILIAS\UI\Implementation\Component\Input\Field\$options, $settings, $toolbar, $tpl, $user, ilParticipants\_getMembershipByType(), ILIAS\Repository\ctrl(), getAccessHandler(), getBlockingMessage(), ILIAS\Repository\lng(), and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ showPasswordForm()

ilWorkspaceAccessGUI::showPasswordForm ( ?ilPropertyFormGUI  $a_form = null)
protected

Definition at line 319 of file class.ilWorkspaceAccessGUI.php.

319 : void
320 {
322
323 if (!$a_form) {
324 $a_form = $this->initPasswordForm();
325 }
326 $tpl->setContent($a_form->getHTML());
327 }

References $tpl, initPasswordForm(), and ILIAS\UICore\GlobalTemplate\setContent().

Referenced by addPermissionHandler(), and savePasswordForm().

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

Field Documentation

◆ $access_handler

ilPortfolioAccessHandler ilWorkspaceAccessHandler ilWorkspaceAccessGUI::$access_handler
protected

Definition at line 44 of file class.ilWorkspaceAccessGUI.php.

Referenced by getAccessHandler().

◆ $blocking_message

string ilWorkspaceAccessGUI::$blocking_message = ""
protected

Definition at line 47 of file class.ilWorkspaceAccessGUI.php.

Referenced by getBlockingMessage().

◆ $ctrl

ilCtrl ilWorkspaceAccessGUI::$ctrl
protected

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

◆ $footer

string ilWorkspaceAccessGUI::$footer = ""
protected

Definition at line 45 of file class.ilWorkspaceAccessGUI.php.

◆ $gui

ILIAS PersonalWorkspace InternalGUIService ilWorkspaceAccessGUI::$gui
protected

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

◆ $is_portfolio

bool ilWorkspaceAccessGUI::$is_portfolio
protected

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

◆ $lng

ilLanguage ilWorkspaceAccessGUI::$lng
protected

Definition at line 42 of file class.ilWorkspaceAccessGUI.php.

Referenced by __construct().

◆ $node_id

int ilWorkspaceAccessGUI::$node_id
protected

Definition at line 43 of file class.ilWorkspaceAccessGUI.php.

Referenced by setObjectTitle().

◆ $settings

ilSetting ilWorkspaceAccessGUI::$settings
protected

Definition at line 40 of file class.ilWorkspaceAccessGUI.php.

Referenced by share().

◆ $std_request

StandardGUIRequest ilWorkspaceAccessGUI::$std_request
protected

Definition at line 48 of file class.ilWorkspaceAccessGUI.php.

◆ $tabs

ilTabsGUI ilWorkspaceAccessGUI::$tabs
protected

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

Referenced by executeCommand().

◆ $toolbar

ilToolbarGUI ilWorkspaceAccessGUI::$toolbar
protected

Definition at line 38 of file class.ilWorkspaceAccessGUI.php.

Referenced by share().

◆ $tpl

ilGlobalTemplateInterface ilWorkspaceAccessGUI::$tpl
protected

◆ $user

ilObjUser ilWorkspaceAccessGUI::$user
protected

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

Referenced by share().

◆ PERMISSION_ALL

◆ PERMISSION_ALL_PASSWORD

◆ PERMISSION_REGISTERED


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