ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjFileBasedLMListGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 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 
35 include_once "Services/Object/classes/class.ilObjectListGUI.php";
36 
38 {
44  {
45  $this->ilObjectListGUI();
46  }
47 
53  function init()
54  {
55  #$this->static_link_enabled = true;
56  $this->copy_enabled = false;
57  $this->delete_enabled = true;
58  $this->cut_enabled = true;
59  $this->subscribe_enabled = true;
60  $this->link_enabled = true;
61  $this->payment_enabled = true;
62  $this->info_screen_enabled = true;
63  $this->type = "htlm";
64  $this->gui_class_name = "ilobjfilebasedlmgui";
65 
66  // general commands array
67  include_once('class.ilObjFileBasedLMAccess.php');
68  $this->commands = ilObjFileBasedLMAccess::_getCommands();
69  }
70 
80  function getCommandLink($a_cmd)
81  {
82  switch($a_cmd)
83  {
84  case "view":
85  $cmd_link = "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->ref_id;
86  break;
87 
88  case "edit":
89  $cmd_link = "ilias.php?baseClass=ilHTLMEditorGUI&ref_id=".$this->ref_id;
90  break;
91 
92  default:
93  $cmd_link = "repository.php?ref_id=".$this->ref_id."&cmd=$a_cmd";
94  break;
95  }
96 
97  return $cmd_link;
98  }
99 
100 
108  function getCommandFrame($a_cmd)
109  {
110  global $ilias;
111 
112  switch($a_cmd)
113  {
114  case "view":
115  include_once 'Services/Payment/classes/class.ilPaymentObject.php';
116 
117  //$showViewInFrameset = $ilias->ini->readVariable("layout","view_target") == "frame";
118  $showViewInFrameset = true;
119  $isBuyable = ilPaymentObject::_isBuyable($this->ref_id);
120  if (($isBuyable && ilPaymentObject::_hasAccess($this->ref_id) == false) ||
121  $showViewInFrameset)
122  {
123  //$frame = ilFrameTargetInfo::_getFrame("MainContent");
124  $frame = "ilContObj".$this->obj_id;
125  }
126  else
127  {
128  $frame = "ilContObj".$this->obj_id;
129  }
130  break;
131 
132  case "edit":
133  $frame = ilFrameTargetInfo::_getFrame("MainContent");
134  break;
135 
136  default:
137  $frame = "";
138  break;
139  }
140 
141  return $frame;
142  }
143 
144 
153  function getProperties()
154  {
155  global $lng, $rbacsystem;
156 
157  $props = array();
158 
159  include_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
160 
161  if (!ilObjFileBasedLMAccess::_lookupOnline($this->obj_id))
162  {
163  $props[] = array("alert" => true, "property" => $lng->txt("status"),
164  "value" => $lng->txt("offline"));
165  }
166  else if (!ilObjFileBasedLMAccess::_determineStartUrl($this->obj_id))
167  {
168  $props[] = array("alert" => true, "property" => $lng->txt("status"),
169  "value" => $lng->txt("no_start_file"));
170  }
171 
172  if ($rbacsystem->checkAccess("write",$this->ref_id))
173  {
174  $props[] = array("alert" => false, "property" => $lng->txt("type"),
175  "value" => $lng->txt("htlm"));
176  }
177 
178  return $props;
179  }
180 
181 
182 } // END class.ilObjCategoryGUI
183 ?>