ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilObjGroupListGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2008 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 
25 include_once "Services/Object/classes/class.ilObjectListGUI.php";
26 
36 {
37 
43  public function init()
44  {
45  $this->static_link_enabled = true;
46  $this->delete_enabled = true;
47  $this->cut_enabled = true;
48  $this->copy_enabled = true;
49  $this->subscribe_enabled = true;
50  $this->link_enabled = false;
51  $this->info_screen_enabled = true;
52  $this->type = "grp";
53  $this->gui_class_name = "ilobjgroupgui";
54 
55  // general commands array
56  include_once('./Modules/Group/classes/class.ilObjGroupAccess.php');
57  $this->commands = ilObjGroupAccess::_getCommands();
58  }
59 
69  public function getCommandLink($a_cmd)
70  {
71  global $ilCtrl;
72 
73  switch ($a_cmd) {
74  // BEGIN WebDAV: Mount Webfolder.
75  case 'mount_webfolder':
76  require_once('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
78  require_once('Services/WebDAV/classes/class.ilDAVServer.php');
79  $davServer = ilDAVServer::getInstance();
80 
81  // XXX: The following is a very dirty, ugly trick.
82  // To mount URI needs to be put into two attributes:
83  // href and folder. This hack returns both attributes
84  // like this: http://...mount_uri..." folder="http://...folder_uri...
85  $cmd_link = $davServer->getMountURI($this->ref_id) .
86  '" folder="' . $davServer->getFolderURI($this->ref_id);
87  break;
88  } // fall through if plugin is not active
89  // END Mount Webfolder.
90 
91  // no break
92  case "edit":
93  default:
94  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
95  $cmd_link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", $a_cmd);
96  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
97  break;
98  }
99 
100  return $cmd_link;
101  }
102 
103 
112  public function getProperties()
113  {
114  global $lng, $rbacsystem,$ilUser;
115 
116  // BEGIN WebDAV get parent properties
117  $props = parent::getProperties();
118  // END WebDAV get parent properties
119 
120  include_once './Modules/Group/classes/class.ilObjGroupAccess.php';
122  //var_dump($info);
123  if ($info['reg_info_list_prop']) {
124  $props[] = array(
125  'alert' => false,
126  'newline' => true,
127  'property' => $info['reg_info_list_prop']['property'],
128  'value' => $info['reg_info_list_prop']['value']
129  );
130  }
131  if ($info['reg_info_list_prop_limit']) {
132  $props[] = array(
133  'alert' => false,
134  'newline' => false,
135  'property' => $info['reg_info_list_prop_limit']['property'],
136  'propertyNameVisible' => strlen($info['reg_info_list_prop_limit']['property']) ? true : false,
137  'value' => $info['reg_info_list_prop_limit']['value']
138  );
139  }
140 
141 
142 
143  // waiting list
144  include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
145  if (ilGroupWaitingList::_isOnList($ilUser->getId(), $this->obj_id)) {
146  $props[] = array(
147  "alert" => true,
148  "property" => $lng->txt('member_status'),
149  "value" => $lng->txt('on_waiting_list')
150  );
151  }
152 
153  // course period
154  $info = ilObjGroupAccess::lookupPeriodInfo($this->obj_id);
155  if (is_array($info)) {
156  $props[] = array(
157  'alert' => false,
158  'newline' => true,
159  'property' => $info['property'],
160  'value' => $info['value']
161  );
162  }
163 
164 
165 
166  return $props;
167  }
168 
169  // BEGIN WebDAV mount_webfolder in _blank frame
179  public function getCommandFrame($a_cmd)
180  {
181  // begin-patch fm
182  return parent::getCommandFrame($a_cmd);
183  // end-patch fm
184  }
185 
186 
196  public function checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id = "")
197  {
198  if ($a_permission == 'grp_linked') {
199  return
200  parent::checkCommandAccess('read', '', $a_ref_id, $a_type, $a_obj_id) ||
201  parent::checkCommandAccess('join', 'join', $a_ref_id, $a_type, $a_obj_id);
202  }
203  return parent::checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id);
204  }
205 
206  // END WebDAV mount_webfolder in _blank frame
207 } // END class.ilObjGroupListGUI
$_GET["client_id"]
getCommandLink($a_cmd)
Overwrite this method, if link target is not build by ctrl class (e.g.
checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id="")
Workaround for course titles (linked if join or read permission is granted)
static _isActive()
Static getter.
Class ilObjGroupListGUI.
global $ilCtrl
Definition: ilias.php:18
$a_type
Definition: workflow.php:92
static _getCommands()
get commands
static lookupRegistrationInfo($a_obj_id)
Lookup registration info ilDB $ilDB ilObjUser $ilUser ilLanguage $lng.
static lookupPeriodInfo($a_obj_id)
Lookup course period info.
getProperties()
Get item properties.
Class ilObjectListGUI.
$ilUser
Definition: imgupload.php:18
static getInstance()
Get singelton instance.
static _isOnList($a_usr_id, $a_obj_id)
Check if a user on the waiting list.
Create styles array
The data for the language used.
getCommandFrame($a_cmd)
Get command target frame.
$info
Definition: index.php:5