ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilMStListCertificatesGUI Class Reference

Class ilMStListCertificatesGUI. More...

+ Collaboration diagram for ilMStListCertificatesGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 index ()
 
 listUsers ()
 
 applyFilter ()
 
 resetFilter ()
 
 getId ()
 
 cancel ()
 

Data Fields

const string CMD_APPLY_FILTER = 'applyFilter'
 
const string CMD_INDEX = 'index'
 
const string CMD_GET_ACTIONS = "getActions"
 
const string CMD_RESET_FILTER = 'resetFilter'
 

Protected Member Functions

 checkAccessOrFail ()
 
 getCertificateIDFromQuery ()
 
 checkAccessToCertificateOrFail ()
 
 hasAccessToCertificate (int $certificate_id)
 

Protected Attributes

ilTable2GUI $table
 
ilMyStaffAccess $access
 

Private Attributes

ilGlobalTemplateInterface $main_tpl
 
ilCtrlInterface $ctrl
 
ilLanguage $language
 
HTTP $http
 
Refinery $refinery
 
ilMStListCertificates $certificates_fetcher
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMStListCertificatesGUI::__construct ( )

Definition at line 47 of file class.ilMStListCertificatesGUI.php.

48 {
49 global $DIC;
50 $this->main_tpl = $DIC->ui()->mainTemplate();
51 $this->ctrl = $DIC->ctrl();
52 $this->language = $DIC->language();
53 $this->access = ilMyStaffAccess::getInstance();
54 $this->http = $DIC->http();
55 $this->refinery = $DIC->refinery();
56 $this->certificates_fetcher = new ilMStListCertificates($DIC);
57 }
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Member Function Documentation

◆ applyFilter()

ilMStListCertificatesGUI::applyFilter ( )
final

Definition at line 148 of file class.ilMStListCertificatesGUI.php.

148 : void
149 {
150 $this->table = new ilMStListCertificatesTableGUI($this, self::CMD_APPLY_FILTER);
151 $this->table->writeFilterToSession();
152 $this->table->resetOffset();
153 $this->index();
154 }

References index().

+ Here is the call graph for this function:

◆ cancel()

ilMStListCertificatesGUI::cancel ( )
final

Definition at line 171 of file class.ilMStListCertificatesGUI.php.

171 : void
172 {
173 $this->ctrl->redirect($this);
174 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ checkAccessOrFail()

ilMStListCertificatesGUI::checkAccessOrFail ( )
protected

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

59 : void
60 {
61 if ($this->access->hasCurrentUserAccessToCertificates()) {
62 return;
63 } else {
64 $this->main_tpl->setOnScreenMessage('failure', $this->language->txt("permission_denied"), true);
65 $this->ctrl->redirectByClass(ilDashboardGUI::class, "");
66 }
67 }

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), and ILIAS\UI\examples\Symbol\Glyph\Language\language().

Referenced by executeCommand(), and listUsers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkAccessToCertificateOrFail()

ilMStListCertificatesGUI::checkAccessToCertificateOrFail ( )
protected

Definition at line 84 of file class.ilMStListCertificatesGUI.php.

84 : void
85 {
86 $certificate_id = $this->getCertificateIDFromQuery();
87 if ($certificate_id === null || !$this->hasAccessToCertificate($certificate_id)) {
88 $this->main_tpl->setOnScreenMessage('failure', $this->language->txt("permission_denied"), true);
89 $this->ctrl->redirectByClass(ilDashboardGUI::class, "");
90 }
91 }

References ILIAS\Repository\ctrl(), getCertificateIDFromQuery(), hasAccessToCertificate(), and ILIAS\UI\examples\Symbol\Glyph\Language\language().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilMStListCertificatesGUI::executeCommand ( )
final

Definition at line 99 of file class.ilMStListCertificatesGUI.php.

99 : void
100 {
101 $cmd = $this->ctrl->getCmd();
102 $next_class = $this->ctrl->getNextClass();
103
104 switch ($next_class) {
105 case strtolower(ilFormPropertyDispatchGUI::class):
106 $this->checkAccessOrFail();
107
108 $this->ctrl->setReturn($this, self::CMD_INDEX);
109 $this->table = new ilMStListCertificatesTableGUI($this, self::CMD_INDEX);
110 $this->table->executeCommand();
111 break;
112 case strtolower(ilUserCertificateApiGUI::class):
113 $this->checkAccessOrFail();
115 $this->ctrl->forwardCommand(new ilUserCertificateApiGUI());
116 break;
117 default:
118 switch ($cmd) {
121 case self::CMD_INDEX:
123 $this->$cmd();
124 break;
125 default:
126 $this->index();
127 break;
128 }
129 break;
130 }
131 }

References checkAccessOrFail(), checkAccessToCertificateOrFail(), CMD_APPLY_FILTER, CMD_GET_ACTIONS, CMD_INDEX, CMD_RESET_FILTER, ILIAS\Repository\ctrl(), and index().

+ Here is the call graph for this function:

◆ getCertificateIDFromQuery()

ilMStListCertificatesGUI::getCertificateIDFromQuery ( )
protected

Definition at line 69 of file class.ilMStListCertificatesGUI.php.

69 : ?int
70 {
71 /*
72 * The parameter certificate_id is handled by the certificate component,
73 * but at this point we can only get to it via the query.
74 */
75 if (!$this->http->wrapper()->query()->has('certificate_id')) {
76 return null;
77 }
78 return $this->http->wrapper()->query()->retrieve(
79 'certificate_id',
80 $this->refinery->kindlyTo()->int()
81 );
82 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by checkAccessToCertificateOrFail().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getId()

ilMStListCertificatesGUI::getId ( )
final

Definition at line 164 of file class.ilMStListCertificatesGUI.php.

164 : string
165 {
166 $this->table = new ilMStListCertificatesTableGUI($this, self::CMD_INDEX);
167
168 return $this->table->getId();
169 }

◆ hasAccessToCertificate()

ilMStListCertificatesGUI::hasAccessToCertificate ( int  $certificate_id)
protected

Definition at line 93 of file class.ilMStListCertificatesGUI.php.

93 : bool
94 {
95 $valid_certificates = $this->certificates_fetcher->getData();
96 return key_exists($certificate_id, $valid_certificates);
97 }

Referenced by checkAccessToCertificateOrFail().

+ Here is the caller graph for this function:

◆ index()

ilMStListCertificatesGUI::index ( )
final

Definition at line 133 of file class.ilMStListCertificatesGUI.php.

133 : void
134 {
135 $this->listUsers();
136 }

References listUsers().

Referenced by applyFilter(), executeCommand(), and resetFilter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listUsers()

ilMStListCertificatesGUI::listUsers ( )
final

Definition at line 138 of file class.ilMStListCertificatesGUI.php.

138 : void
139 {
140 $this->checkAccessOrFail();
141
142 $this->table = new ilMStListCertificatesTableGUI($this, self::CMD_INDEX);
143 $this->main_tpl->setTitle($this->language->txt('mst_list_certificates'));
144 $this->main_tpl->setTitleIcon(ilUtil::getImagePath('standard/icon_cert.svg'));
145 $this->main_tpl->setContent($this->table->getHTML());
146 }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References checkAccessOrFail(), ilUtil\getImagePath(), and ILIAS\UI\examples\Symbol\Glyph\Language\language().

Referenced by index().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetFilter()

ilMStListCertificatesGUI::resetFilter ( )
final

Definition at line 156 of file class.ilMStListCertificatesGUI.php.

156 : void
157 {
158 $this->table = new ilMStListCertificatesTableGUI($this, self::CMD_RESET_FILTER);
159 $this->table->resetOffset();
160 $this->table->resetFilter();
161 $this->index();
162 }

References index().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilMyStaffAccess ilMStListCertificatesGUI::$access
protected

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

◆ $certificates_fetcher

ilMStListCertificates ilMStListCertificatesGUI::$certificates_fetcher
private

Definition at line 45 of file class.ilMStListCertificatesGUI.php.

◆ $ctrl

ilCtrlInterface ilMStListCertificatesGUI::$ctrl
private

Definition at line 41 of file class.ilMStListCertificatesGUI.php.

◆ $http

HTTP ilMStListCertificatesGUI::$http
private

Definition at line 43 of file class.ilMStListCertificatesGUI.php.

◆ $language

ilLanguage ilMStListCertificatesGUI::$language
private

Definition at line 42 of file class.ilMStListCertificatesGUI.php.

◆ $main_tpl

ilGlobalTemplateInterface ilMStListCertificatesGUI::$main_tpl
private

Definition at line 40 of file class.ilMStListCertificatesGUI.php.

◆ $refinery

Refinery ilMStListCertificatesGUI::$refinery
private

Definition at line 44 of file class.ilMStListCertificatesGUI.php.

◆ $table

ilTable2GUI ilMStListCertificatesGUI::$table
protected

Definition at line 38 of file class.ilMStListCertificatesGUI.php.

◆ CMD_APPLY_FILTER

const string ilMStListCertificatesGUI::CMD_APPLY_FILTER = 'applyFilter'

Definition at line 34 of file class.ilMStListCertificatesGUI.php.

Referenced by executeCommand().

◆ CMD_GET_ACTIONS

const string ilMStListCertificatesGUI::CMD_GET_ACTIONS = "getActions"

Definition at line 36 of file class.ilMStListCertificatesGUI.php.

Referenced by executeCommand().

◆ CMD_INDEX

const string ilMStListCertificatesGUI::CMD_INDEX = 'index'

◆ CMD_RESET_FILTER

const string ilMStListCertificatesGUI::CMD_RESET_FILTER = 'resetFilter'

Definition at line 37 of file class.ilMStListCertificatesGUI.php.

Referenced by executeCommand().


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