ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLicenseGUI Class Reference
+ Collaboration diagram for ilLicenseGUI:

Public Member Functions

 ilLicenseGUI (&$a_parent_gui)
 Constructor public.
executeCommand ()
 Execute a command (main entry point) public.
 editLicense (ilPropertyFormGUI $a_form=null)
 Show the license form public.
 updateLicense ()
 Save the license form public.

Protected Member Functions

 initLicenseForm ()

Detailed Description

Definition at line 17 of file class.ilLicenseGUI.php.

Member Function Documentation

ilLicenseGUI::editLicense ( ilPropertyFormGUI  $a_form = null)

Show the license form public.

Definition at line 102 of file class.ilLicenseGUI.php.

References initLicenseForm().

Referenced by updateLicense().

{
if(!$a_form)
{
$a_form = $this->initLicenseForm();
}
$this->tpl->setContent($a_form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilLicenseGUI::executeCommand ( )

Execute a command (main entry point) public.

Definition at line 39 of file class.ilLicenseGUI.php.

References $cmd, and $ilErr.

{
global $rbacsystem, $ilErr;
// access to all functions in this class are only allowed if edit_permission is granted
if (!$rbacsystem->checkAccess("edit_permission",$this->parent_gui->object->getRefId()))
{
$ilErr->raiseError($this->lng->txt("permission_denied"),$ilErr->MESSAGE);
}
$cmd = $this->ctrl->getCmd("editLicense");
$this->$cmd();
return true;
}
ilLicenseGUI::ilLicenseGUI ( $a_parent_gui)

Constructor public.

Definition at line 23 of file class.ilLicenseGUI.php.

References $ilCtrl, $lng, and $tpl.

{
global $ilCtrl, $tpl, $lng;
$this->ctrl =& $ilCtrl;
$this->tpl =& $tpl;
$this->lng =& $lng;
$this->lng->loadLanguageModule("license");
$this->parent_gui =& $a_parent_gui;
$this->license =& new ilLicense($this->parent_gui->object->getId());
}
ilLicenseGUI::initLicenseForm ( )
protected

Definition at line 55 of file class.ilLicenseGUI.php.

References ilNonEditableValueGUI\setInfo(), ilFormPropertyGUI\setInfo(), and ilTextAreaInputGUI\setRows().

Referenced by editLicense(), and updateLicense().

{
include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, "updateLicense"));
$form->setTitle($this->lng->txt('edit_license'));
$exist = new ilNumberInputGUI($this->lng->txt("existing_licenses"), "licenses");
$exist->setInfo($this->lng->txt("zero_licenses_explanation"));
$exist->setMaxLength(10);
$exist->setSize(10);
$exist->setValue($this->license->getLicenses());
$form->addItem($exist);
$info_used = new ilNonEditableValueGUI($this->lng->txt("used_licenses"));
$info_used->setInfo($this->lng->txt("used_licenses_explanation"));
$info_used->setValue($this->license->getAccesses());
$form->addItem($info_used);
$remaining_licenses = ($this->license->getLicenses() == "0")
? $this->lng->txt("arbitrary")
: $this->license->getRemainingLicenses();
$info_remain = new ilNonEditableValueGUI($this->lng->txt("remaining_licenses"));
$info_remain->setInfo($this->lng->txt("remaining_licenses_explanation"));
$info_remain->setValue($remaining_licenses);
$form->addItem($info_remain);
$info_potential = new ilNonEditableValueGUI($this->lng->txt("potential_accesses"));
$info_potential->setInfo($this->lng->txt("potential_accesses_explanation"));
$info_potential->setValue($this->license->getPotentialAccesses());
$form->addItem($info_potential);
$comm = new ilTextAreaInputGUI($this->lng->txt("comment"), "remarks");
$comm->setRows(5);
$comm->setValue($this->license->getRemarks());
$form->addItem($comm);
$form->addCommandButton('updateLicense', $this->lng->txt('save'));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLicenseGUI::updateLicense ( )

Save the license form public.

Definition at line 116 of file class.ilLicenseGUI.php.

References editLicense(), initLicenseForm(), and ilUtil\sendSuccess().

{
$form = $this->initLicenseForm();
if($form->checkInput())
{
$this->license->setLicenses($form->getInput("licenses"));
$this->license->setRemarks($form->getInput("remarks"));
$this->license->update();
ilUtil::sendSuccess($this->lng->txt('license_updated'), true);
$this->ctrl->redirect($this,"editLicense");
}
$form->setValuesByPost();
$this->editLicense($form);
}

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: