ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjCourseReferenceGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 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/ContainerReference/classes/class.ilContainerReferenceGUI.php');
35 {
36  protected $target_type = 'crs';
37  protected $reference_type = 'crsr';
38 
44  public function __construct($a_data, $a_id, $a_call_by_reference = true, $a_prepare_output = true)
45  {
46  parent::__construct($a_data, $a_id,true,false);
47  }
48 
55  public function executeCommand()
56  {
57  global $rbacsystem,$ilErr,$ilAccess;
58 
59  $next_class = $this->ctrl->getNextClass($this);
60  $cmd = $this->ctrl->getCmd();
61 
62  $this->prepareOutput();
63 
64  switch($next_class)
65  {
66  case 'ilpermissiongui':
67  $this->tabs_gui->setTabActive('perm_settings');
68  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
69  $this->ctrl->forwardCommand(new ilPermissionGUI($this));
70  break;
71 
72  default:
73  if(!$cmd || $cmd == 'view')
74  {
75  $cmd = "edit";
76  }
77  $cmd .= "Object";
78  $this->$cmd();
79  break;
80  }
81  return true;
82  }
83 
84 
91  public function getTabs($tabs_gui)
92  {
93  global $ilAccess, $ilHelp;
94 
95  $ilHelp->setScreenIdComponent("crsr");
96 
97  if($ilAccess->checkAccess('write','',$this->object->getRefId()))
98  {
99  $tabs_gui->addTarget("edit",
100  $this->ctrl->getLinkTarget($this, "edit"),
101  array(),
102  "");
103  }
104  if ($ilAccess->checkAccess('edit_permission','',$this->object->getRefId()))
105  {
106  $tabs_gui->addTarget("perm_settings",
107  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
108  array("perm","info","owner"), 'ilpermissiongui');
109  }
110  }
111 
118  public static function _goto($a_target)
119  {
120  global $ilAccess, $ilErr, $lng;
121 
122  include_once('./Services/ContainerReference/classes/class.ilContainerReference.php');
124 
125  include_once('./Modules/Course/classes/class.ilObjCourseGUI.php');
126  ilObjCourseGUI::_goto($target_ref_id);
127  }
128 
129  }
130 ?>