36 $this->tpl =
$DIC->ui()->mainTemplate();
37 $this->
ctrl = $DIC->ctrl();
38 $this->
lng = $DIC->language();
47 $forward_class = $this->
ctrl->getNextClass($this);
49 switch ($forward_class) {
51 if (!($cmd = $this->
ctrl->getCmd())) {
52 $cmd =
"initShareForm";
64 $this->tpl->setContent($form->getHTML());
71 $form->setTitle($this->
lng->txt(
"share_content"));
72 $form->setId(
'share_usr');
74 $form->setFormAction($this->
ctrl->getFormAction($this,
'saveShare'));
80 $form->addCommandButton(
'saveShare', $this->
lng->txt(
"share"));
81 $form->addCommandButton(
'cancel', $this->
lng->txt(
"cancel"));
90 if ($form->checkInput()) {
92 $existing = $this->wsp_access_handler->getPermissions($this->wsp_node_id);
94 if (!in_array(
$user_id, $existing)) {
95 $this->wsp_access_handler->addPermission($this->wsp_node_id,
$user_id);
96 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"element_shared"),
true);
98 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"element_already_shared"),
true);
100 $this->
ctrl->returnToParent($this);
102 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'search_no_match'),
true);
105 $this->
ctrl->redirect($this);
110 $this->
ctrl->returnToParent($this);
Class ilCtrl provides processing control methods.
static _lookupId(string|array $a_user_str)
Access handler for portfolio NOTE: This file needs to stay in the classes directory,...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(ilPortfolioAccessHandler|ilWorkspaceAccessHandler|null $wsp_access_handler=null, ?int $wsp_node_id=null)
initShareForm(?ilPropertyFormGUI $form=null)
ilPortfolioAccessHandler ilWorkspaceAccessHandler $wsp_access_handler
ilGlobalTemplateInterface $tpl
This class represents a text property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...