ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjTestListGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 
37 include_once "Services/Object/classes/class.ilObjectListGUI.php";
38 include_once "./Modules/Test/classes/inc.AssessmentConstants.php";
39 
41 {
42  protected $command_link_params = array();
43 
48  function ilObjTestListGUI()
49  {
50  $this->ilObjectListGUI();
51  $this->info_screen_enabled = true;
52  }
53 
57  function init()
58  {
59  $this->static_link_enabled = true;
60  $this->delete_enabled = true;
61  $this->cut_enabled = true;
62  $this->copy_enabled = true;
63  $this->subscribe_enabled = true;
64  $this->link_enabled = true;
65  $this->payment_enabled = true;
66  $this->type = "tst";
67  $this->gui_class_name = "ilobjtestgui";
68 
69  // general commands array
70  include_once "./Modules/Test/classes/class.ilObjTestAccess.php";
71  $this->commands = ilObjTestAccess::_getCommands();
72  }
73 
74 
83  function initItem($a_ref_id, $a_obj_id, $a_title = "", $a_description = "")
84  {
85  parent::initItem($a_ref_id, $a_obj_id, $a_title, $a_description);
86  }
87 
88 
96  function getCommandFrame($a_cmd)
97  {
98  switch($a_cmd)
99  {
100  case "":
101  case "infoScreen":
102  case "eval_a":
103  case "eval_stat":
104  include_once "./classes/class.ilFrameTargetInfo.php";
105  $frame = ilFrameTargetInfo::_getFrame("MainContent");
106  break;
107 
108  default:
109  }
110 
111  return $frame;
112  }
113 
114 
115 
124  function getProperties()
125  {
126  global $lng, $ilUser;
127 
128  $props = array();
129  include_once "./Modules/Test/classes/class.ilObjTestAccess.php";
130  if (!ilObjTestAccess::_lookupCreationComplete($this->obj_id))
131  {
132  $props[] = array("alert" => true, "property" => $lng->txt("status"),
133  "value" => $lng->txt("tst_warning_test_not_complete"));
134  }
135  $onlineaccess = ilObjTestAccess::_lookupOnlineTestAccess($this->obj_id, $ilUser->id);
136  if ($onlineaccess !== true)
137  {
138  $props[] = array("alert" => true, "property" => $lng->txt("status"),
139  "value" => $onlineaccess);
140  }
141 
142  return $props;
143  }
144 
145 
153  function getCommandLink($a_cmd)
154  {
155  // separate method for this line
156  $cmd_link = "ilias.php?baseClass=ilObjTestGUI&amp;ref_id=".$this->ref_id."&amp;cmd=$a_cmd";
157 
158  foreach($this->command_link_params as $param => $value)
159  {
160  $cmd_link .= '&'.$param.'='.$value;
161  }
162 
163  return $cmd_link;
164  }
165 
173  public function createDefaultCommand($a_command)
174  {
175  return $a_command;
176  }
177 
178 
186  public function addCommandLinkParameter($a_param)
187  {
188  $this->command_link_params = $a_param;
189  }
190 
194  function getCommandImage($a_cmd)
195  {
196  switch ($a_cmd)
197  {
198  case "outEvaluation":
199  return ilUtil::getImagePath("cmd_evaluation_s.gif");
200 
201  default:
202  return "";
203  }
204  }
205 
206 } // END class.ilObjTestListGUI
207 ?>