ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  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  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  function getCommandFrame($a_cmd)
74  {
75  switch($a_cmd)
76  {
77  case "":
78  case "questions":
79  include_once "./Services/UICore/classes/class.ilFrameTargetInfo.php";
80  $frame = ilFrameTargetInfo::_getFrame("MainContent");
81  break;
82 
83  default:
84  }
85 
86  return $frame;
87  }
88 
89 
90 
99  function getProperties()
100  {
101  global $lng, $ilUser;
102 
103  $props = array();
104 
105  include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
106  if (!ilObjQuestionPool::_lookupOnline($this->obj_id))
107  {
108  $props[] = array("alert" => true, "property" => $lng->txt("status"),
109  "value" => $lng->txt("offline"));
110  }
111  return $props;
112  }
113 
114 
122  function getCommandLink($a_cmd)
123  {
124  global $ilCtrl;
125 
126  $a_cmd = explode('::', $a_cmd);
127 
128  if( count($a_cmd) == 2 )
129  {
130  $cmd_link = $ilCtrl->getLinkTargetByClass(array('ilRepositoryGUI', 'ilObjQuestionPoolGUI', $a_cmd[0]), $a_cmd[1]);
131  }
132  else
133  {
134  $cmd_link = $ilCtrl->getLinkTargetByClass('ilObjQuestionPoolGUI', $a_cmd[0]);
135  }
136 
137  $params = array_merge(array('ref_id' => $this->ref_id), $this->command_link_params);
138 
139  foreach($params as $param => $value)
140  {
141  $cmd_link = ilUtil::appendUrlParameterString($cmd_link, "$param=$value", true);
142  }
143 
144  return $cmd_link;
145  }
146 
147 
148 
149 } // END class.ilObjTestListGUI
150 ?>
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
static _lookupOnline($a_obj_id, $is_reference=FALSE)
Class ilObjectListGUI.
$ilUser
Definition: imgupload.php:18
__construct($a_context=self::CONTEXT_REPOSITORY)
constructor
getCommandFrame($a_cmd)
Get command target frame.
Create styles array
The data for the language used.
static _getFrame($a_class, $a_type='')
Get content frame name.
global $lng
Definition: privfeed.php:17
getCommandLink($a_cmd)
Get command link url.
$params
Definition: example_049.php:96