ILIAS  release_7 Revision v7.30-3-g800a261c036
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
25include_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 $this->substitutions = ilAdvancedMDSubstitution::_getInstanceByObjectType($this->type);
56 $this->enableSubstitutions($this->substitutions->isActive());
57
58 // general commands array
59 include_once('./Modules/Group/classes/class.ilObjGroupAccess.php');
60 $this->commands = ilObjGroupAccess::_getCommands();
61 }
62
72 public function getCommandLink($a_cmd)
73 {
74 global $DIC;
75
76 $ilCtrl = $DIC['ilCtrl'];
77
78 switch ($a_cmd) {
79 // BEGIN WebDAV: Mount Webfolder.
80 case 'mount_webfolder':
81 require_once('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
83 global $DIC;
84 $uri_builder = new ilWebDAVUriBuilder($DIC->http()->request());
85 $cmd_link = $uri_builder->getUriToMountInstructionModalByRef($this->ref_id);
86 break;
87 } // fall through if plugin is not active
88 // END Mount Webfolder.
89
90 // no break
91 case "edit":
92 default:
93 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
94 $cmd_link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", $a_cmd);
95 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
96 break;
97 }
98
99 return $cmd_link;
100 }
101
102
111 public function getProperties()
112 {
113 global $DIC;
114
115 $lng = $DIC['lng'];
116 $rbacsystem = $DIC['rbacsystem'];
117 $ilUser = $DIC['ilUser'];
118
119 $props = parent::getProperties();
120
121 include_once './Modules/Group/classes/class.ilObjGroupAccess.php';
122 $info = ilObjGroupAccess::lookupRegistrationInfo($this->obj_id);
123 //var_dump($info);
124 if ($info['reg_info_list_prop']) {
125 $props[] = array(
126 'alert' => false,
127 'newline' => true,
128 'property' => $info['reg_info_list_prop']['property'],
129 'value' => $info['reg_info_list_prop']['value']
130 );
131 }
132 if ($info['reg_info_list_prop_limit']) {
133 $props[] = array(
134 'alert' => false,
135 'newline' => false,
136 'property' => $info['reg_info_list_prop_limit']['property'],
137 'propertyNameVisible' => strlen($info['reg_info_list_prop_limit']['property']) ? true : false,
138 'value' => $info['reg_info_list_prop_limit']['value']
139 );
140 }
141
142
143
144 // waiting list
145 include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
146 if (ilGroupWaitingList::_isOnList($ilUser->getId(), $this->obj_id)) {
147 $props[] = array(
148 "alert" => true,
149 "property" => $lng->txt('member_status'),
150 "value" => $lng->txt('on_waiting_list')
151 );
152 }
153
154 // course period
155 $info = ilObjGroupAccess::lookupPeriodInfo($this->obj_id);
156 if (is_array($info)) {
157 $props[] = array(
158 'alert' => false,
159 'newline' => true,
160 'property' => $info['property'],
161 'value' => $info['value']
162 );
163 }
164
165
166
167 return $props;
168 }
169
170 // BEGIN WebDAV mount_webfolder in _blank frame
180 public function getCommandFrame($a_cmd)
181 {
182 // begin-patch fm
183 return parent::getCommandFrame($a_cmd);
184 // end-patch fm
185 }
186
187
197 public function checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id = "")
198 {
199 if ($a_permission == 'grp_linked') {
200 return
201 parent::checkCommandAccess('read', '', $a_ref_id, $a_type, $a_obj_id) ||
202 parent::checkCommandAccess('join', 'join', $a_ref_id, $a_type, $a_obj_id);
203 }
204 return parent::checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id);
205 }
206
207 // END WebDAV mount_webfolder in _blank frame
208} // END class.ilObjGroupListGUI
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
static _getInstanceByObjectType($a_type)
Singleton: use this method to get an instance.
static lookupPeriodInfo($a_obj_id)
Lookup course period info.
static _getCommands()
get commands
static lookupRegistrationInfo($a_obj_id)
Lookup registration info @global ilDB $ilDB @global ilObjUser $ilUser @global ilLanguage $lng.
Class ilObjGroupListGUI.
getCommandLink($a_cmd)
Overwrite this method, if link target is not build by ctrl class (e.g.
getCommandFrame($a_cmd)
Get command target frame.
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)
getProperties()
Get item properties.
Class ilObjectListGUI.
enableSubstitutions($a_status)
Enable substitutions.
static _isOnList($a_usr_id, $a_obj_id)
Check if a user on the waiting list.
global $DIC
Definition: goto.php:24
$ilUser
Definition: imgupload.php:18