16 public function __construct($wsp_access_handler = null, $wsp_node_id = null)
20 $this->tpl = $DIC[
'tpl'];
21 $this->ctrl = $DIC[
'ilCtrl'];
22 $this->lng = $DIC[
'lng'];
25 $this->wsp_access_handler = $wsp_access_handler;
26 $this->wsp_node_id = $wsp_node_id;
31 $forward_class = $this->ctrl->getNextClass($this);
33 switch ($forward_class) {
35 if (!($cmd = $this->ctrl->getCmd())) {
36 $cmd =
"initShareForm";
49 $this->tpl->setContent(
$form->getHTML());
54 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
57 $form->setTitle($this->lng->txt(
"share_content"));
58 $form->setId(
'share_usr');
60 $form->setFormAction($this->ctrl->getFormAction($this,
'saveShare'));
66 $form->addCommandButton(
'saveShare', $this->lng->txt(
"share"));
67 $form->addCommandButton(
'cancel', $this->lng->txt(
"cancel"));
76 if (
$form->checkInput()) {
78 $existing = $this->wsp_access_handler->getPermissions($this->wsp_node_id);
80 if (!in_array($user_id, $existing)) {
81 $this->wsp_access_handler->addPermission($this->wsp_node_id, $user_id);
82 ilUtil::sendSuccess($this->lng->txt(
"element_shared"),
true);
86 $this->ctrl->returnToParent($this);
91 $this->ctrl->redirect($this);
96 $this->ctrl->returnToParent($this);
initShareForm(ilPropertyFormGUI $form=null)
static _lookupId($a_user_str)
Lookup id by login.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(isset($_POST['submit'])) $form
setSize($a_size)
Set Size.
This class represents a text property in a property form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
__construct($wsp_access_handler=null, $wsp_node_id=null)