Definition at line 16 of file class.ilLicenseGUI.php.
◆ __construct()
ilLicenseGUI constructor.
- Parameters
-
\ilObjectGUI | $a_parent_gui | |
Definition at line 43 of file class.ilLicenseGUI.php.
References $ilCtrl, $lng, and $tpl.
50 $this->lng->loadLanguageModule(
"license");
51 $this->parent_gui = $a_parent_gui;
52 $this->license =
new ilLicense($this->parent_gui->object->getId());
◆ editLicense()
◆ executeCommand()
ilLicenseGUI::executeCommand |
( |
| ) |
|
Definition at line 56 of file class.ilLicenseGUI.php.
References $ilErr.
58 global $rbacsystem,
$ilErr;
61 if (!$rbacsystem->checkAccess(
"edit_permission", $this->parent_gui->object->getRefId())) {
62 $ilErr->raiseError($this->lng->txt(
"permission_denied"), $ilErr->MESSAGE);
65 $cmd = $this->ctrl->getCmd(
"editLicense");
◆ initLicenseForm()
ilLicenseGUI::initLicenseForm |
( |
| ) |
|
|
protected |
Definition at line 72 of file class.ilLicenseGUI.php.
References $form, ilNonEditableValueGUI\setInfo(), ilFormPropertyGUI\setInfo(), and ilTextAreaInputGUI\setRows().
Referenced by editLicense(), and updateLicense().
74 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
76 $form->setFormAction($this->ctrl->getFormAction($this,
"updateLicense"));
77 $form->setTitle($this->lng->txt(
'edit_license'));
79 $exist =
new ilNumberInputGUI($this->lng->txt(
"existing_licenses"),
"licenses");
80 $exist->
setInfo($this->lng->txt(
"zero_licenses_explanation"));
81 $exist->setMaxLength(10);
83 $exist->setValue($this->license->getLicenses());
84 $form->addItem($exist);
87 $info_used->
setInfo($this->lng->txt(
"used_licenses_explanation"));
88 $info_used->setValue($this->license->getAccesses());
89 $form->addItem($info_used);
91 $remaining_licenses = ($this->license->getLicenses() ==
"0") ? $this->lng->txt(
"arbitrary") : $this->license->getRemainingLicenses();
94 $info_remain->
setInfo($this->lng->txt(
"remaining_licenses_explanation"));
95 $info_remain->setValue($remaining_licenses);
96 $form->addItem($info_remain);
99 $info_potential->
setInfo($this->lng->txt(
"potential_accesses_explanation"));
100 $info_potential->setValue($this->license->getPotentialAccesses());
101 $form->addItem($info_potential);
105 $comm->setValue($this->license->getRemarks());
106 $form->addItem($comm);
108 $form->addCommandButton(
'updateLicense', $this->lng->txt(
'save'));
setInfo($a_info)
Set Information Text.
if(isset($_POST['submit'])) $form
This class represents a non editable value in a property form.
setRows($a_rows)
Set Rows.
This class represents a text area property in a property form.
◆ updateLicense()
ilLicenseGUI::updateLicense |
( |
| ) |
|
Save the license form.
Definition at line 130 of file class.ilLicenseGUI.php.
References $form, editLicense(), initLicenseForm(), and ilUtil\sendSuccess().
133 if (
$form->checkInput()) {
134 $this->license->setLicenses(
$form->getInput(
"licenses"));
135 $this->license->setRemarks(
$form->getInput(
"remarks"));
136 $this->license->update();
139 $this->ctrl->redirect($this,
"editLicense");
142 $form->setValuesByPost();
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
editLicense(ilPropertyFormGUI $a_form=null)
if(isset($_POST['submit'])) $form
◆ $ctrl
◆ $license
◆ $lng
◆ $tpl
The documentation for this class was generated from the following file: