ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilObjQuestionPoolListGUI.php
Go to the documentation of this file.
1 <?php
2 
19 require_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  $this->commands = ilObjQuestionPoolAccess::_getCommands();
59  }
60 
61 
62 
66  public function getCommandFrame(string $cmd): string
67  {
68  $frame = '';
69  switch ($cmd) {
70  case "":
71  case "questions":
72  $frame = ilFrameTargetInfo::_getFrame("MainContent");
73  break;
74 
75  default:
76  }
77 
78  return $frame;
79  }
80 
81 
82 
91  public function getProperties(): array
92  {
93  global $DIC;
94  $lng = $DIC['lng'];
95  $ilUser = $DIC['ilUser'];
96 
97  $props = array();
98 
99  if (!$this->object_properties->getPropertyIsOnline()->getIsOnline()) {
100  $props[] = array("alert" => true, "property" => $lng->txt("status"),
101  "value" => $lng->txt("offline"));
102  }
103  return $props;
104  }
105 
106 
110  public function getCommandLink(string $cmd): string
111  {
112  global $DIC;
113  $ilCtrl = $DIC['ilCtrl'];
114 
115  $cmd = explode('::', $cmd);
116 
117  if (count($cmd) == 2) {
118  $cmd_link = $ilCtrl->getLinkTargetByClass(array('ilRepositoryGUI', 'ilObjQuestionPoolGUI', $cmd[0]), $cmd[1]);
119  } else {
120  $cmd_link = $ilCtrl->getLinkTargetByClass('ilObjQuestionPoolGUI', $cmd[0]);
121  }
122 
123  $params = array_merge(array('ref_id' => $this->ref_id), $this->command_link_params);
124 
125  foreach ($params as $param => $value) {
126  $cmd_link = ilUtil::appendUrlParameterString($cmd_link, "$param=$value", true);
127  }
128 
129  return $cmd_link;
130  }
131 } // END class.ilObjTestListGUI
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
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...
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
getCommandFrame(string $cmd)
Get command target frame.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
$param
Definition: xapitoken.php:46
__construct($a_context=self::CONTEXT_REPOSITORY)
constructor
getCommandLink(string $cmd)
Get command link url.
static _getFrame(string $a_class)