ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjFileBasedLMListGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once "Services/Object/classes/class.ilObjectListGUI.php";
6 
16 {
22  {
23  $this->ilObjectListGUI();
24  }
25 
31  function init()
32  {
33  $this->copy_enabled = true;
34  $this->delete_enabled = true;
35  $this->cut_enabled = true;
36  $this->subscribe_enabled = true;
37  $this->link_enabled = true;
38  $this->payment_enabled = true;
39  $this->info_screen_enabled = true;
40  $this->type = "htlm";
41  $this->gui_class_name = "ilobjfilebasedlmgui";
42 
43  // general commands array
44  include_once('Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php');
45  $this->commands = ilObjFileBasedLMAccess::_getCommands();
46  }
47 
57  function getCommandLink($a_cmd)
58  {
59  global $ilCtrl;
60 
61  switch($a_cmd)
62  {
63  case "view":
64  $cmd_link = "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->ref_id;
65  break;
66 
67  case "edit":
68  $cmd_link = "ilias.php?baseClass=ilHTLMEditorGUI&ref_id=".$this->ref_id;
69  break;
70 
71  default:
72  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
73  $cmd_link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", $a_cmd);
74  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
75  break;
76  }
77 
78  return $cmd_link;
79  }
80 
81 
89  function getCommandFrame($a_cmd)
90  {
91  global $ilias;
92 
93  switch($a_cmd)
94  {
95  case "view":
96  include_once 'Services/Payment/classes/class.ilPaymentObject.php';
97 
98  //$showViewInFrameset = $ilias->ini->readVariable("layout","view_target") == "frame";
99  $showViewInFrameset = true;
100  $isBuyable = ilPaymentObject::_isBuyable($this->ref_id);
101  if (($isBuyable && ilPaymentObject::_hasAccess($this->ref_id) == false) ||
102  $showViewInFrameset)
103  {
104  //$frame = ilFrameTargetInfo::_getFrame("MainContent");
105  $frame = "ilContObj".$this->obj_id;
106  }
107  else
108  {
109  $frame = "ilContObj".$this->obj_id;
110  }
111  break;
112 
113  case "edit":
114  $frame = ilFrameTargetInfo::_getFrame("MainContent");
115  break;
116 
117  default:
118  $frame = "";
119  break;
120  }
121 
122  return $frame;
123  }
124 
125 
134  function getProperties()
135  {
136  global $lng, $rbacsystem;
137 
138  $props = array();
139 
140  include_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
141 
142  if (ilObjFileBasedLMAccess::_isOffline($this->obj_id))
143  {
144  $props[] = array("alert" => true, "property" => $lng->txt("status"),
145  "value" => $lng->txt("offline"));
146  }
147  else if (!ilObjFileBasedLMAccess::_determineStartUrl($this->obj_id))
148  {
149  $props[] = array("alert" => true, "property" => $lng->txt("status"),
150  "value" => $lng->txt("no_start_file"));
151  }
152 
153  if ($rbacsystem->checkAccess("write",$this->ref_id))
154  {
155  $props[] = array("alert" => false, "property" => $lng->txt("type"),
156  "value" => $lng->txt("htlm"));
157  }
158 
159  return $props;
160  }
161 
162 
163 } // END class.ilObjCategoryGUI
164 ?>