ILIAS  release_4-3 Revision
 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 "./Services/UICore/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 
131 // if (!ilObjTestAccess::_lookupCreationComplete($this->obj_id))
132 // {
133 // $props[] = array("alert" => true, "property" => $lng->txt("status"),
134 // "value" => $lng->txt("tst_warning_test_not_complete"));
135 // }
136  if (!ilObjTestAccess::_isOnline($this->obj_id))
137  {
138  $props[] = array("alert" => true, "property" => $lng->txt("status"),
139  "value" => $lng->txt("offline"));
140  }
141 
142 
143  // we cannot use ilObjTestAccess::_isOffline() because of text messages
144  $onlineaccess = ilObjTestAccess::_lookupOnlineTestAccess($this->obj_id, $ilUser->id);
145  if ($onlineaccess !== true)
146  {
147  $props[] = array("alert" => true, "property" => $lng->txt("status"),
148  "value" => $onlineaccess);
149  }
150 
151  return $props;
152  }
153 
154 
162  function getCommandLink($a_cmd)
163  {
164  // separate method for this line
165  $cmd_link = "ilias.php?baseClass=ilObjTestGUI&amp;ref_id=".$this->ref_id."&amp;cmd=$a_cmd";
166 
167  foreach($this->command_link_params as $param => $value)
168  {
169  $cmd_link .= '&'.$param.'='.$value;
170  }
171 
172  return $cmd_link;
173  }
174 
182  public function createDefaultCommand($a_command)
183  {
184  return $a_command;
185  }
186 
187 
195  public function addCommandLinkParameter($a_param)
196  {
197  $this->command_link_params = $a_param;
198  }
199 
203  function getCommandImage($a_cmd)
204  {
205  switch ($a_cmd)
206  {
207  case "outEvaluation":
208  return ilUtil::getImagePath("cmd_evaluation_s.png");
209 
210  default:
211  return "";
212  }
213  }
214 
215 } // END class.ilObjTestListGUI
216 ?>