35 ?
int $wsp_node_id = null
39 $this->tpl = $DIC->ui()->mainTemplate();
40 $this->
ctrl = $DIC->ctrl();
41 $this->
lng = $DIC->language();
50 $forward_class = $this->
ctrl->getNextClass($this);
52 switch ($forward_class) {
54 if (!($cmd = $this->
ctrl->getCmd())) {
55 $cmd =
"initShareForm";
67 $this->tpl->setContent($form->getHTML());
74 $form->setTitle($this->
lng->txt(
"share_content"));
75 $form->setId(
'share_usr');
77 $form->setFormAction($this->
ctrl->getFormAction($this,
'saveShare'));
83 $form->addCommandButton(
'saveShare', $this->
lng->txt(
"share"));
84 $form->addCommandButton(
'cancel', $this->
lng->txt(
"cancel"));
93 if ($form->checkInput()) {
95 $existing = $this->wsp_access_handler->getPermissions($this->wsp_node_id);
97 if (!in_array($user_id, $existing)) {
98 $this->wsp_access_handler->addPermission($this->wsp_node_id, $user_id);
99 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"element_shared"),
true);
101 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"element_already_shared"),
true);
103 $this->
ctrl->returnToParent($this);
105 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'search_no_match'),
true);
108 $this->
ctrl->redirect($this);
113 $this->
ctrl->returnToParent($this);
initShareForm(ilPropertyFormGUI $form=null)
ilGlobalTemplateInterface $tpl
static _lookupId($a_user_str)
__construct( $wsp_access_handler=null, ?int $wsp_node_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...