ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLicenseGUI Class Reference
+ Collaboration diagram for ilLicenseGUI:

Public Member Functions

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

Detailed Description

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

Member Function Documentation

◆ editLicense()

ilLicenseGUI::editLicense ( )

Show the license form public.

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

60  {
61  $licenses = strval($this->license->getLicenses());
62  $used_licenses = strval($this->license->getAccesses());
63  $remaining_licenses = $licenses == "0" ? $this->lng->txt("arbitrary") : strval($this->license->getRemainingLicenses());
64  $potential_accesses = strval($this->license->getPotentialAccesses());
65 
66  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.lic_edit_license.html',"Services/License");
67  $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
68  $this->tpl->setVariable("TXT_EDIT_LICENSE", $this->lng->txt("edit_license"));
69  $this->tpl->setVariable("TXT_EXISTING_LICENSES", $this->lng->txt("existing_licenses"));
70  $this->tpl->setVariable("LICENSES", $licenses);
71  $this->tpl->setVariable("TXT_ZERO_LICENSES_EXPLANATION", $this->lng->txt("zero_licenses_explanation"));
72  $this->tpl->setVariable("TXT_USED_LICENSES", $this->lng->txt("used_licenses"));
73  $this->tpl->setVariable("USED_LICENSES", $used_licenses);
74  $this->tpl->setVariable("TXT_USED_LICENSES_EXPLANATION", $this->lng->txt("used_licenses_explanation"));
75  $this->tpl->setVariable("TXT_REMAINING_LICENSES", $this->lng->txt("remaining_licenses"));
76  $this->tpl->setVariable("REMAINING_LICENSES", $remaining_licenses);
77  $this->tpl->setVariable("TXT_REMAINING_LICENSES_EXPLANATION", $this->lng->txt("remaining_licenses_explanation"));
78  $this->tpl->setVariable("TXT_POTENTIAL_ACCESSES", $this->lng->txt("potential_accesses"));
79  $this->tpl->setVariable("POTENTIAL_ACCESSES", $potential_accesses);
80  $this->tpl->setVariable("TXT_POTENTIAL_ACCESSES_EXPLANATION", $this->lng->txt("potential_accesses_explanation"));
81  $this->tpl->setVariable("TXT_REMARKS", $this->lng->txt("comment"));
82  $this->tpl->setVariable("REMARKS", $this->license->getRemarks());
83  $this->tpl->setVariable("BTN_UPDATE", $this->lng->txt("save"));
84  }

◆ executeCommand()

& ilLicenseGUI::executeCommand ( )

Execute a command (main entry point) public.

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

References $cmd, and $ilErr.

40  {
41  global $rbacsystem, $ilErr;
42 
43  // access to all functions in this class are only allowed if edit_permission is granted
44  if (!$rbacsystem->checkAccess("edit_permission",$this->parent_gui->object->getRefId()))
45  {
46  $ilErr->raiseError($this->lng->txt("permission_denied"),$ilErr->MESSAGE);
47  }
48 
49  $cmd = $this->ctrl->getCmd("editLicense");
50  $this->$cmd();
51 
52  return true;
53  }
$cmd
Definition: sahs_server.php:35

◆ ilLicenseGUI()

ilLicenseGUI::ilLicenseGUI ( $a_parent_gui)

Constructor public.

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

References $ilCtrl, $lng, and $tpl.

24  {
25  global $ilCtrl, $tpl, $lng;
26 
27  $this->ctrl =& $ilCtrl;
28  $this->tpl =& $tpl;
29  $this->lng =& $lng;
30  $this->lng->loadLanguageModule("license");
31  $this->parent_gui =& $a_parent_gui;
32  $this->license =& new ilLicense($this->parent_gui->object->getId());
33  }
global $ilCtrl
Definition: ilias.php:18
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $lng
Definition: privfeed.php:40

◆ updateLicense()

ilLicenseGUI::updateLicense ( )

Save the license form public.

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

References $_REQUEST, and ilUtil\sendInfo().

91  {
92  $this->license->setLicenses((int) $_REQUEST["licenses"]);
93  $this->license->setRemarks($_REQUEST["remarks"]);
94  $this->license->update();
95  ilUtil::sendInfo($this->lng->txt('license_updated'), true);
96  $this->ctrl->redirect($this,"editLicense");
97  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

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