Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 include_once "classes/class.ilObjectListGUI.php";
00025
00034 class ilObjDlBookListGUI extends ilObjectListGUI
00035 {
00040 function ilObjDlBookListGUI()
00041 {
00042 $this->ilObjectListGUI();
00043 }
00044
00050 function init()
00051 {
00052 $this->delete_enabled = true;
00053 $this->cut_enabled = true;
00054 $this->subscribe_enabled = true;
00055 $this->link_enabled = true;
00056 $this->payment_enabled = true;
00057 $this->type = "dbk";
00058 $this->gui_class_name = "ilobjdlbookgui";
00059
00060
00061 include_once('class.ilObjDlBookAccess.php');
00062 $this->commands = ilObjDLBookAccess::_getCommands();
00063 }
00064
00065 function initItem($a_ref_id, $a_obj_id, $a_title = "", $a_description = "")
00066 {
00067 global $ilUser;
00068
00069 parent::initItem($a_ref_id, $a_obj_id, $a_title, $a_description);
00070
00071 include_once("content/classes/class.ilObjLearningModuleAccess.php");
00072 $this->last_accessed_page =
00073 ilObjLearningModuleAccess::_getLastAccessedPage($a_ref_id, $ilUser->getId());
00074
00075 }
00076
00086 function getCommandLink($a_cmd)
00087 {
00088 switch($a_cmd)
00089 {
00090 case "continue":
00091 $cmd_link = "ilias.php?baseClass=ilLMPresentationGUI&ref_id=".$this->ref_id.
00092 "&obj_ud=".$this->last_accessed_page;
00093 break;
00094
00095 case "view":
00096 $cmd_link = "ilias.php?baseClass=ilLMPresentationGUI&ref_id=".$this->ref_id;
00097 break;
00098
00099 case "edit":
00100 $cmd_link = "ilias.php?baseClass=ilLMEditorGUI&ref_id=".$this->ref_id;
00101 break;
00102
00103 default:
00104 $cmd_link = "repository.php?ref_id=".$this->ref_id."&cmd=$a_cmd";
00105 break;
00106 }
00107
00108 return $cmd_link;
00109 }
00110
00111
00119 function getCommandFrame($a_cmd)
00120 {
00121 global $ilias;
00122
00123 switch($a_cmd)
00124 {
00125 case "view":
00126
00127 $showViewInFrameset = true;
00128
00129 include_once 'payment/classes/class.ilPaymentObject.php';
00130 $isBuyable = ilPaymentObject::_isBuyable($this->ref_id);
00131 if (($isBuyable && ilPaymentObject::_hasAccess($this->ref_id) == false) ||
00132 $showViewInFrameset)
00133 {
00134 $frame = ilFrameTargetInfo::_getFrame("MainContent");
00135 }
00136 else
00137 {
00138 $frame = "ilContObj".$this->obj_id;
00139 }
00140 break;
00141
00142 case "edit":
00143 $frame = ilFrameTargetInfo::_getFrame("MainContent");
00144 break;
00145
00146 default:
00147 $frame = "";
00148 break;
00149 }
00150
00151 return $frame;
00152 }
00153
00154
00163 function getProperties()
00164 {
00165 global $lng, $rbacsystem;
00166
00167 $props = array();
00168
00169 include_once("content/classes/class.ilObjDlBookAccess.php");
00170
00171 if (!ilObjDlBookAccess::_lookupOnline($this->obj_id))
00172 {
00173 $props[] = array("alert" => true, "property" => $lng->txt("status"),
00174 "value" => $lng->txt("offline"));
00175 }
00176
00177 if ($rbacsystem->checkAccess($this->ref_id, "write"))
00178 {
00179 $props[] = array("alert" => false, "property" => $lng->txt("type"),
00180 "value" => $lng->txt("dbk"));
00181 }
00182
00183 return $props;
00184 }
00185
00186
00187 }
00188 ?>