◆ __construct()
ilSingleUserShareGUI::__construct |
( |
|
$wsp_access_handler = null , |
|
|
|
$wsp_node_id = null |
|
) |
| |
Definition at line 16 of file class.ilSingleUserShareGUI.php.
17 {
19
20 $this->tpl =
$DIC[
'tpl'];
21 $this->ctrl =
$DIC[
'ilCtrl'];
22 $this->lng =
$DIC[
'lng'];
23
24
25 $this->wsp_access_handler = $wsp_access_handler;
26 $this->wsp_node_id = $wsp_node_id;
27 }
References $DIC.
◆ cancel()
ilSingleUserShareGUI::cancel |
( |
| ) |
|
◆ executeCommand()
ilSingleUserShareGUI::executeCommand |
( |
| ) |
|
Definition at line 29 of file class.ilSingleUserShareGUI.php.
30 {
31 $forward_class = $this->ctrl->getNextClass($this);
32
33 switch ($forward_class) {
34 default:
35 if (!($cmd = $this->ctrl->getCmd())) {
36 $cmd = "initShareForm";
37 }
38 $this->$cmd();
39 break;
40 }
41 return true;
42 }
◆ getShareForm()
ilSingleUserShareGUI::getShareForm |
( |
| ) |
|
Definition at line 52 of file class.ilSingleUserShareGUI.php.
53 {
54 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
56
57 $form->setTitle($this->lng->txt(
"share_content"));
58 $form->setId(
'share_usr');
59
60 $form->setFormAction($this->ctrl->getFormAction($this,
'saveShare'));
61
63 $inp->setSize(20);
65
66 $form->addCommandButton(
'saveShare', $this->lng->txt(
"share"));
67 $form->addCommandButton(
'cancel', $this->lng->txt(
"cancel"));
68
70 }
This class represents a text property in a property form.
if(isset($_POST['submit'])) $form
References $form.
Referenced by initShareForm(), and saveShare().
◆ initShareForm()
◆ saveShare()
ilSingleUserShareGUI::saveShare |
( |
| ) |
|
|
protected |
Definition at line 72 of file class.ilSingleUserShareGUI.php.
73 {
75
76 if (
$form->checkInput()) {
78 $existing = $this->wsp_access_handler->getPermissions($this->wsp_node_id);
79
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);
83 } else {
85 }
86 $this->ctrl->returnToParent($this);
87 } else {
89 }
90 }
91 $this->ctrl->redirect($this);
92 }
static _lookupId($a_user_str)
Lookup id by login.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
References $form, ilObjUser\_lookupId(), getShareForm(), ilUtil\sendFailure(), and ilUtil\sendInfo().
◆ $ctrl
ilSingleUserShareGUI::$ctrl |
|
protected |
◆ $lng
ilSingleUserShareGUI::$lng |
|
protected |
◆ $tpl
ilSingleUserShareGUI::$tpl |
|
protected |
The documentation for this class was generated from the following file: