ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilObjCmiXapiListGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5
16{
17 public function init()
18 {
19 global $DIC; /* @var \ILIAS\DI\Container $DIC */
20
21 $this->static_link_enabled = true; // Create static links for default command (linked title) or not
22 $this->delete_enabled = true;
23 $this->cut_enabled = true;
24 $this->subscribe_enabled = false;
25 $this->link_enabled = true;
26 $this->copy_enabled = true;
27 $this->progress_enabled = true;
28 $this->notice_properties_enabled = true;
29 $this->info_screen_enabled = true;
30 $this->type = "cmix";
31 $this->gui_class_name = "ilObjCmiXapiGUI";
32
33 $this->commands = ilObjCmiXapiAccess::_getCommands();
34
35 $DIC->language()->loadLanguageModule('cmix');
36 }
37
38 public function getProperties()
39 {
40 global $DIC; /* @var \ILIAS\DI\Container $DIC */
41
42 $props = array();
43
44 if (ilObjCmiXapiAccess::_isOffline($this->obj_id)) {
45 $props[] = array("alert" => true, "property" => $DIC->language()->txt("status"),
46 "value" => $DIC->language()->txt("offline"));
47 }
48
49 $props[] = array(
50 'alert' => false, 'property' => $DIC->language()->txt('type'),
51 'value' => $DIC->language()->txt('obj_cmix')
52 );
53
54 $validator = new ilCertificateDownloadValidator();
55 if ($validator->isCertificateDownloadable((int) $DIC->user()->getId(), (int) $this->obj_id)) {
56 $DIC->ctrl()->setParameterByClass(ilCmiXapiSettingsGUI::class, 'ref_id', $this->ref_id);
57
58 $certLink = $DIC->ui()->factory()->link()->standard(
59 $DIC->language()->txt('download_certificate'),
60 $DIC->ctrl()->getLinkTargetByClass(
61 [ilObjCmiXapiGUI::class, ilCmiXapiSettingsGUI::class],
63 )
64 );
65
66 $props[] = array(
67 'alert' => false, 'property' => $DIC->language()->txt('certificate'),
68 'value' => $DIC->ui()->renderer()->render($certLink)
69 );
70 }
71
72 return $props;
73 }
74
75 public function getCommandLink($a_cmd)
76 {
77 global $ilCtrl;
78
79 $a_cmd = explode('::', $a_cmd);
80
81 if (count($a_cmd) == 2) {
82 $cmd_link = $ilCtrl->getLinkTargetByClass(array('ilRepositoryGUI', 'ilObjCmiXapiGUI', $a_cmd[0]), $a_cmd[1]);
83 } else {
84 $cmd_link = $ilCtrl->getLinkTargetByClass(array('ilRepositoryGUI', 'ilObjCmiXapiGUI'), $a_cmd[0]);
85 }
86
87 return $cmd_link;
88 }
89}
An exception for terminatinating execution or to throw for unit testing.
Validates if an active certificate is stored in the database and can be downloaded by the user.
static _getCommands()
get commands
getCommandLink($a_cmd)
Get command link url.
getProperties()
Get item properties.
static _isOffline($a_obj_id)
Type-specific implementation of general status, has to be overwritten if object type does not support...
Class ilObjectListGUI.
global $ilCtrl
Definition: ilias.php:18
$DIC
Definition: xapitoken.php:46