ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
16 include_once "Services/Object/classes/class.ilObjectListGUI.php";
17 include_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 $DIC;
101  $lng = $DIC['lng'];
102  $ilUser = $DIC['ilUser'];
103 
104  $props = array();
105 
106  include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
107  if (!ilObjQuestionPool::_lookupOnline($this->obj_id)) {
108  $props[] = array("alert" => true, "property" => $lng->txt("status"),
109  "value" => $lng->txt("offline"));
110  }
111  return $props;
112  }
113 
114 
122  public function getCommandLink($a_cmd)
123  {
124  global $DIC;
125  $ilCtrl = $DIC['ilCtrl'];
126 
127  $a_cmd = explode('::', $a_cmd);
128 
129  if (count($a_cmd) == 2) {
130  $cmd_link = $ilCtrl->getLinkTargetByClass(array('ilRepositoryGUI', 'ilObjQuestionPoolGUI', $a_cmd[0]), $a_cmd[1]);
131  } else {
132  $cmd_link = $ilCtrl->getLinkTargetByClass('ilObjQuestionPoolGUI', $a_cmd[0]);
133  }
134 
135  $params = array_merge(array('ref_id' => $this->ref_id), $this->command_link_params);
136 
137  foreach ($params as $param => $value) {
138  $cmd_link = ilUtil::appendUrlParameterString($cmd_link, "$param=$value", true);
139  }
140 
141  return $cmd_link;
142  }
143 } // END class.ilObjTestListGUI
global $DIC
Definition: saml.php:7
static _lookupOnline($a_obj_id, $is_reference=false)
Class ilObjQuestionPoolListGUI.
global $ilCtrl
Definition: ilias.php:18
initItem($a_ref_id, $a_obj_id, $a_title="", $a_description="")
inititialize new item
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
Class ilObjectListGUI.
$ilUser
Definition: imgupload.php:18
__construct($a_context=self::CONTEXT_REPOSITORY)
constructor
getCommandFrame($a_cmd)
Get command target frame.
static _getFrame($a_class, $a_type='')
Get content frame name.
getCommandLink($a_cmd)
Get command link url.