ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilObjQuestionPoolListGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
16include_once "Services/Object/classes/class.ilObjectListGUI.php";
17include_once "./Modules/Test/classes/inc.AssessmentConstants.php";
18
20{
21 protected $command_link_params = array();
22
27 public function __construct($a_context = self::CONTEXT_REPOSITORY)
28 {
29 parent::__construct($a_context);
30 }
31
35 public function init()
36 {
37 $this->delete_enabled = true;
38 $this->cut_enabled = true;
39 $this->copy_enabled = true;
40 $this->subscribe_enabled = true;
41 $this->link_enabled = true;
42 $this->info_screen_enabled = true;
43 $this->type = "qpl";
44 $this->gui_class_name = "ilobjquestionpoolgui";
45
46 // general commands array
47 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPoolAccess.php";
48 $this->commands = ilObjQuestionPoolAccess::_getCommands();
49 }
50
51
60 public function initItem($a_ref_id, $a_obj_id, $a_title = "", $a_description = "")
61 {
62 parent::initItem($a_ref_id, $a_obj_id, $a_title, $a_description);
63 }
64
65
73 public function getCommandFrame($a_cmd)
74 {
75 switch ($a_cmd) {
76 case "":
77 case "questions":
78 include_once "./Services/UICore/classes/class.ilFrameTargetInfo.php";
79 $frame = ilFrameTargetInfo::_getFrame("MainContent");
80 break;
81
82 default:
83 }
84
85 return $frame;
86 }
87
88
89
98 public function getProperties()
99 {
100 global $lng, $ilUser;
101
102 $props = array();
103
104 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
105 if (!ilObjQuestionPool::_lookupOnline($this->obj_id)) {
106 $props[] = array("alert" => true, "property" => $lng->txt("status"),
107 "value" => $lng->txt("offline"));
108 }
109 return $props;
110 }
111
112
120 public function getCommandLink($a_cmd)
121 {
122 global $ilCtrl;
123
124 $a_cmd = explode('::', $a_cmd);
125
126 if (count($a_cmd) == 2) {
127 $cmd_link = $ilCtrl->getLinkTargetByClass(array('ilRepositoryGUI', 'ilObjQuestionPoolGUI', $a_cmd[0]), $a_cmd[1]);
128 } else {
129 $cmd_link = $ilCtrl->getLinkTargetByClass('ilObjQuestionPoolGUI', $a_cmd[0]);
130 }
131
132 $params = array_merge(array('ref_id' => $this->ref_id), $this->command_link_params);
133
134 foreach ($params as $param => $value) {
135 $cmd_link = ilUtil::appendUrlParameterString($cmd_link, "$param=$value", true);
136 }
137
138 return $cmd_link;
139 }
140} // END class.ilObjTestListGUI
An exception for terminatinating execution or to throw for unit testing.
static _getFrame($a_class, $a_type='')
Get content frame name.
Class ilObjQuestionPoolListGUI.
getCommandFrame($a_cmd)
Get command target frame.
initItem($a_ref_id, $a_obj_id, $a_title="", $a_description="")
inititialize new item
__construct($a_context=self::CONTEXT_REPOSITORY)
constructor
getCommandLink($a_cmd)
Get command link url.
static _lookupOnline($a_obj_id, $is_reference=false)
Class ilObjectListGUI.
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
$params
Definition: disable.php:11