• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

content/classes/class.ilObjDlBookListGUI.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
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                 // general commands array
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&amp;ref_id=".$this->ref_id.
00092                                         "&amp;obj_ud=".$this->last_accessed_page;
00093                                 break;
00094 
00095                         case "view":
00096                                 $cmd_link = "ilias.php?baseClass=ilLMPresentationGUI&amp;ref_id=".$this->ref_id;
00097                                 break;
00098 
00099                         case "edit":
00100                                 $cmd_link = "ilias.php?baseClass=ilLMEditorGUI&amp;ref_id=".$this->ref_id;
00101                                 break;
00102 
00103                         default:
00104                                 $cmd_link = "repository.php?ref_id=".$this->ref_id."&amp;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                                 //$showViewInFrameset = $ilias->ini->readVariable("layout","view_target") == "frame";
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 } // END class.ilObjCategoryGUI
00188 ?>

Generated on Fri Dec 13 2013 13:52:09 for ILIAS Release_3_7_x_branch .rev 46817 by  doxygen 1.7.1