ILIAS  release_8 Revision v8.24
class.ilObjQuestionPoolListGUI.php
Go to the documentation of this file.
1<?php
2
19include_once "./Modules/Test/classes/inc.AssessmentConstants.php";
20
32{
33 protected $command_link_params = array();
34
39 public function __construct($a_context = self::CONTEXT_REPOSITORY)
40 {
41 parent::__construct($a_context);
42 }
43
47 public function init(): void
48 {
49 $this->delete_enabled = true;
50 $this->cut_enabled = true;
51 $this->copy_enabled = true;
52 $this->subscribe_enabled = true;
53 $this->link_enabled = true;
54 $this->info_screen_enabled = true;
55 $this->type = "qpl";
56 $this->gui_class_name = "ilobjquestionpoolgui";
57
58 // general commands array
59 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPoolAccess.php";
60 $this->commands = ilObjQuestionPoolAccess::_getCommands();
61 }
62
63
64
68 public function getCommandFrame(string $cmd): string
69 {
70 $frame = '';
71 switch ($cmd) {
72 case "":
73 case "questions":
74 include_once "./Services/UICore/classes/class.ilFrameTargetInfo.php";
75 $frame = ilFrameTargetInfo::_getFrame("MainContent");
76 break;
77
78 default:
79 }
80
81 return $frame;
82 }
83
84
85
94 public function getProperties(): array
95 {
96 global $DIC;
97 $lng = $DIC['lng'];
98 $ilUser = $DIC['ilUser'];
99
100 $props = array();
101
102 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
103 if (!ilObjQuestionPool::_lookupOnline($this->obj_id)) {
104 $props[] = array("alert" => true, "property" => $lng->txt("status"),
105 "value" => $lng->txt("offline"));
106 }
107 return $props;
108 }
109
110
114 public function getCommandLink(string $cmd): string
115 {
116 global $DIC;
117 $ilCtrl = $DIC['ilCtrl'];
118
119 $cmd = explode('::', $cmd);
120
121 if (count($cmd) == 2) {
122 $cmd_link = $ilCtrl->getLinkTargetByClass(array('ilRepositoryGUI', 'ilObjQuestionPoolGUI', $cmd[0]), $cmd[1]);
123 } else {
124 $cmd_link = $ilCtrl->getLinkTargetByClass('ilObjQuestionPoolGUI', $cmd[0]);
125 }
126
127 $params = array_merge(array('ref_id' => $this->ref_id), $this->command_link_params);
128
129 foreach ($params as $param => $value) {
130 $cmd_link = ilUtil::appendUrlParameterString($cmd_link, "$param=$value", true);
131 }
132
133 return $cmd_link;
134 }
135} // END class.ilObjTestListGUI
static _getFrame(string $a_class)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getCommandFrame(string $cmd)
Get command target frame.
getCommandLink(string $cmd)
Get command link url.
__construct($a_context=self::CONTEXT_REPOSITORY)
constructor
static _lookupOnline($a_obj_id, $is_reference=false)
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$param
Definition: xapitoken.php:46