ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjDlBookListGUI.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 include_once "Services/Object/classes/class.ilObjectListGUI.php";
25 
35 {
40  function ilObjDlBookListGUI()
41  {
42  $this->ilObjectListGUI();
43  }
44 
50  function init()
51  {
52  $this->copy_enabled = false;
53  $this->delete_enabled = true;
54  $this->cut_enabled = true;
55  $this->subscribe_enabled = true;
56  $this->link_enabled = true;
57  $this->payment_enabled = true;
58  $this->type = "dbk";
59  $this->gui_class_name = "ilobjdlbookgui";
60  $this->info_screen_enabled = true;
61 
62  // general commands array
63  include_once('./Modules/LearningModule/classes/class.ilObjDlBookAccess.php');
64  $this->commands = ilObjDLBookAccess::_getCommands();
65  }
66 
67  function initItem($a_ref_id, $a_obj_id, $a_title = "", $a_description = "")
68  {
69  global $ilUser;
70 
71  parent::initItem($a_ref_id, $a_obj_id, $a_title, $a_description);
72 
73  include_once("./Modules/LearningModule/classes/class.ilObjLearningModuleAccess.php");
74  $this->last_accessed_page =
75  ilObjLearningModuleAccess::_getLastAccessedPage($a_ref_id, $ilUser->getId());
76 
77  }
78 
88  function getCommandLink($a_cmd)
89  {
90  switch($a_cmd)
91  {
92  case "continue":
93  $cmd_link = "ilias.php?baseClass=ilLMPresentationGUI&amp;ref_id=".$this->ref_id.
94  "&amp;obj_ud=".$this->last_accessed_page;
95  break;
96 
97  case "view":
98  $cmd_link = "ilias.php?baseClass=ilLMPresentationGUI&amp;ref_id=".$this->ref_id;
99  break;
100 
101  case "edit":
102  $cmd_link = "ilias.php?baseClass=ilLMEditorGUI&amp;ref_id=".$this->ref_id;
103  break;
104 
105  case "infoScreen":
106  $cmd_link = "ilias.php?baseClass=ilLMPresentationGUI&amp;ref_id=".$this->ref_id.
107  "&amp;cmd=infoScreen";
108  break;
109 
110 
111  default:
112  $cmd_link = "repository.php?ref_id=".$this->ref_id."&amp;cmd=$a_cmd";
113  break;
114  }
115 
116  return $cmd_link;
117  }
118 
119 
127  function getCommandFrame($a_cmd)
128  {
129  global $ilias;
130 
131  switch($a_cmd)
132  {
133  case "view":
134  //$showViewInFrameset = $ilias->ini->readVariable("layout","view_target") == "frame";
135  $showViewInFrameset = true;
136 
137  include_once 'Services/Payment/classes/class.ilPaymentObject.php';
138  $isBuyable = ilPaymentObject::_isBuyable($this->ref_id);
139  if (($isBuyable && ilPaymentObject::_hasAccess($this->ref_id) == false) ||
140  $showViewInFrameset)
141  {
142  $frame = ilFrameTargetInfo::_getFrame("MainContent");
143  }
144  else
145  {
146  $frame = ilFrameTargetInfo::_getFrame("MainContent");
147  //$frame = "ilContObj".$this->obj_id;
148  }
149  break;
150 
151  case "edit":
152  $frame = ilFrameTargetInfo::_getFrame("MainContent");
153  break;
154 
155  default:
156  $frame = "";
157  break;
158  }
159 
160  return $frame;
161  }
162 
163 
172  function getProperties()
173  {
174  global $lng, $rbacsystem;
175 
176  $props = array();
177 
178  include_once("./Modules/LearningModule/classes/class.ilObjDlBookAccess.php");
179 
180  if (!ilObjDlBookAccess::_lookupOnline($this->obj_id))
181  {
182  $props[] = array("alert" => true, "property" => $lng->txt("status"),
183  "value" => $lng->txt("offline"));
184  }
185 
186  if ($rbacsystem->checkAccess("write", $this->ref_id))
187  {
188  $props[] = array("alert" => false, "property" => $lng->txt("type"),
189  "value" => $lng->txt("dbk"));
190  }
191 
192  return $props;
193  }
194 
195 
196 } // END class.ilObjCategoryGUI
197 ?>