ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilLicenseOverviewGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once "./Services/License/classes/class.ilLicense.php";
5 
17 
23  protected $mode;
27  protected $ctrl;
31  protected $tpl;
35  protected $lng;
36 
37 
44  public function __construct(ilObjectGUI $a_parent_gui, $a_mode = self::LIC_MODE_REPOSITORY) {
45  global $ilCtrl, $tpl, $lng;
46 
47  $this->mode = $a_mode;
48  $this->ctrl = $ilCtrl;
49  $this->tpl = $tpl;
50  $this->lng = $lng;
51  $this->lng->loadLanguageModule("license");
52  $this->parent_gui = $a_parent_gui;
53  }
54 
55 
59  public function executeCommand() {
60  global $rbacsystem, $ilErr;
61 
62  // access to all functions in this class are only allowed if read is granted
63  if (!$rbacsystem->checkAccess("read", $this->parent_gui->object->getRefId())) {
64  $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
65  }
66 
67  $cmd = $this->ctrl->getCmd("showLicenses");
68  $this->$cmd();
69 
70  return true;
71  }
72 
73 
74  protected function showLicenses() {
75  include_once './Services/License/classes/class.ilLicenseOverviewTableGUI.php';
76  $tbl = new ilLicenseOverviewTableGUI($this, "showLicenses", $this->mode, $this->parent_gui);
77 
78  include_once "Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
79  $panel = ilPanelGUI::getInstance();
80  $panel->setPanelStyle(ilPanelGUI::PANEL_STYLE_SECONDARY);
81  $panel->setBody('<div class="small">' . $this->lng->txt("used_licenses_explanation") . "<br/>"
82  . $this->lng->txt("remaining_licenses_explanation") . "<br/>" . $this->lng->txt("potential_accesses_explanation") . "</div>");
83 
84  $this->tpl->setContent($tbl->getHTML() . "<br />" . $panel->getHTML());
85  }
86 }
global $ilErr
Definition: raiseError.php:16
$tbl
Definition: example_048.php:81
$cmd
Definition: sahs_server.php:35
__construct(ilObjectGUI $a_parent_gui, $a_mode=self::LIC_MODE_REPOSITORY)
ilLicenseOverviewGUI constructor.
global $ilCtrl
Definition: ilias.php:18
Class ilObjectGUI Basic methods of all Output classes.
static getInstance()
Get instance.
const PANEL_STYLE_SECONDARY