ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
4require_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 {
46 global $ilCtrl, $tpl, $lng;
47
48 $this->mode = $a_mode;
49 $this->ctrl = $ilCtrl;
50 $this->tpl = $tpl;
51 $this->lng = $lng;
52 $this->lng->loadLanguageModule("license");
53 $this->parent_gui = $a_parent_gui;
54 }
55
56
60 public function executeCommand()
61 {
62 global $rbacsystem, $ilErr;
63
64 // access to all functions in this class are only allowed if read is granted
65 if (!$rbacsystem->checkAccess("read", $this->parent_gui->object->getRefId())) {
66 $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
67 }
68
69 $cmd = $this->ctrl->getCmd("showLicenses");
70 $this->$cmd();
71
72 return true;
73 }
74
75
76 protected function showLicenses()
77 {
78 include_once './Services/License/classes/class.ilLicenseOverviewTableGUI.php';
79 $tbl = new ilLicenseOverviewTableGUI($this, "showLicenses", $this->mode, $this->parent_gui);
80
81 include_once "Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
82 $panel = ilPanelGUI::getInstance();
83 $panel->setPanelStyle(ilPanelGUI::PANEL_STYLE_SECONDARY);
84 $panel->setBody('<div class="small">' . $this->lng->txt("used_licenses_explanation") . "<br/>"
85 . $this->lng->txt("remaining_licenses_explanation") . "<br/>" . $this->lng->txt("potential_accesses_explanation") . "</div>");
86
87 $this->tpl->setContent($tbl->getHTML() . "<br />" . $panel->getHTML());
88 }
89}
An exception for terminatinating execution or to throw for unit testing.
__construct(ilObjectGUI $a_parent_gui, $a_mode=self::LIC_MODE_REPOSITORY)
ilLicenseOverviewGUI constructor.
Class ilObjectGUI Basic methods of all Output classes.
const PANEL_STYLE_SECONDARY
static getInstance()
Get instance.
$tbl
Definition: example_048.php:81
global $ilCtrl
Definition: ilias.php:18
global $ilErr
Definition: raiseError.php:16