ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilObjLearningModuleListGUI.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  public function init()
23  {
24  $this->static_link_enabled = true;
25  $this->delete_enabled = true;
26  $this->cut_enabled = true;
27  $this->copy_enabled = true;
28  $this->subscribe_enabled = true;
29  $this->link_enabled = true;
30  $this->info_screen_enabled = true;
31  $this->type = "lm";
32  $this->gui_class_name = "ilobjlearningmodulegui";
33 
34  // general commands array
35  include_once('./Modules/LearningModule/classes/class.ilObjLearningModuleAccess.php');
36  $this->commands = ilObjLearningModuleAccess::_getCommands();
37  }
38 
39  public function setChildId($a_child_id)
40  {
41  $this->child_id = $a_child_id;
42  }
43  public function getChildId()
44  {
45  return $this->child_id;
46  }
47 
57  public function getCommandLink($a_cmd)
58  {
60 
61  switch ($a_cmd) {
62  case "continue":
63  $cmd_link = "ilias.php?baseClass=ilLMPresentationGUI&amp;ref_id=" . $this->ref_id .
64  "&amp;cmd=resume";
65  break;
66 
67  case "page":
68  // Used for presentation of single pages chapters in search results
69  $cmd_link = "ilias.php?baseClass=ilLMPresentationGUI&amp;ref_id=" . $this->ref_id .
70  "&amp;obj_id=" . $this->getChildId();
71  break;
72 
73  case "view":
74  $cmd_link = "ilias.php?baseClass=ilLMPresentationGUI&amp;ref_id=" . $this->ref_id;
75  break;
76 
77  case "edit":
78  $cmd_link = "ilias.php?baseClass=ilLMEditorGUI&amp;ref_id=" . $this->ref_id;
79  break;
80 
81  case "properties":
82  $cmd_link = "ilias.php?baseClass=ilLMEditorGUI&amp;ref_id=" . $this->ref_id . "&amp;to_props=1";
83  break;
84 
85  case "infoScreen":
86  $cmd_link = "ilias.php?baseClass=ilLMPresentationGUI&amp;ref_id=" . $this->ref_id .
87  "&amp;cmd=infoScreen&amp;file_id" . $this->getChildId();
88  break;
89 
90  case 'downloadFile':
91  $cmd_link = 'ilias.php?baseClass=ilLMPresentationGUI&amp;ref_id=' . $this->ref_id .
92  '&amp;cmd=downloadFile&amp;file_id=' . $this->getChildId();
93  break;
94 
95  default:
96  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
97  $cmd_link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", $a_cmd);
98  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
99  break;
100  }
101 
102  return $cmd_link;
103  }
104 
105 
113  public function getCommandFrame($a_cmd)
114  {
115  switch ($a_cmd) {
116  case "view":
117  case "continue":
118  case 'list':
119  $frame = ilFrameTargetInfo::_getFrame("MainContent");
120  break;
121 
122  case "edit":
123  case "properties":
124  $frame = ilFrameTargetInfo::_getFrame("MainContent");
125  break;
126 
127  case "infoScreen":
128  $frame = ilFrameTargetInfo::_getFrame("MainContent");
129  break;
130 
131  default:
132  $frame = "";
133  break;
134  }
135 
136  return $frame;
137  }
138 
139 
148  public function getProperties()
149  {
150  $lng = $this->lng;
151  $rbacsystem = $this->rbacsystem;
152 
153  $props = array();
154 
155  include_once("./Modules/LearningModule/classes/class.ilObjLearningModuleAccess.php");
156 
157  if (ilObjLearningModuleAccess::_isOffline($this->obj_id)) {
158  $props[] = array("alert" => true, "property" => $lng->txt("status"),
159  "value" => $lng->txt("offline"));
160  }
161 
162  if ($rbacsystem->checkAccess('write', $this->ref_id)) {
163  $props[] = array("alert" => false, "property" => $lng->txt("type"),
164  "value" => $lng->txt("lm"));
165  }
166 
167  return $props;
168  }
169 
173  public function getCommandImage($a_cmd)
174  {
175  switch ($a_cmd) {
176  default:
177  return "";
178  }
179  }
180 } // END class.ilObjCategoryGUI
getCommandFrame($a_cmd)
Get command target frame.
$_GET["client_id"]
Class ilObjLearningModuleListGUI.
global $ilCtrl
Definition: ilias.php:18
Class ilObjectListGUI.
getCommandImage($a_cmd)
Get command icon image.
Create styles array
The data for the language used.
static _getFrame($a_class, $a_type='')
Get content frame name.
static _isOffline($a_obj_id)
Type-specific implementation of general status.
getCommandLink($a_cmd)
Overwrite this method, if link target is not build by ctrl class (e.g.