ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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  $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  // BEGIN WebDAV get parent properties
120  $props = parent::getProperties();
121  // END WebDAV get parent properties
122 
123  include_once './Modules/Group/classes/class.ilObjGroupAccess.php';
124  $info = ilObjGroupAccess::lookupRegistrationInfo($this->obj_id);
125  //var_dump($info);
126  if ($info['reg_info_list_prop']) {
127  $props[] = array(
128  'alert' => false,
129  'newline' => true,
130  'property' => $info['reg_info_list_prop']['property'],
131  'value' => $info['reg_info_list_prop']['value']
132  );
133  }
134  if ($info['reg_info_list_prop_limit']) {
135  $props[] = array(
136  'alert' => false,
137  'newline' => false,
138  'property' => $info['reg_info_list_prop_limit']['property'],
139  'propertyNameVisible' => strlen($info['reg_info_list_prop_limit']['property']) ? true : false,
140  'value' => $info['reg_info_list_prop_limit']['value']
141  );
142  }
143 
144 
145 
146  // waiting list
147  include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
149  $props[] = array(
150  "alert" => true,
151  "property" => $lng->txt('member_status'),
152  "value" => $lng->txt('on_waiting_list')
153  );
154  }
155 
156  // course period
157  $info = ilObjGroupAccess::lookupPeriodInfo($this->obj_id);
158  if (is_array($info)) {
159  $props[] = array(
160  'alert' => false,
161  'newline' => true,
162  'property' => $info['property'],
163  'value' => $info['value']
164  );
165  }
166 
167 
168 
169  return $props;
170  }
171 
172  // BEGIN WebDAV mount_webfolder in _blank frame
182  public function getCommandFrame($a_cmd)
183  {
184  // begin-patch fm
185  return parent::getCommandFrame($a_cmd);
186  // end-patch fm
187  }
188 
189 
199  public function checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id = "")
200  {
201  if ($a_permission == 'grp_linked') {
202  return
203  parent::checkCommandAccess('read', '', $a_ref_id, $a_type, $a_obj_id) ||
204  parent::checkCommandAccess('join', 'join', $a_ref_id, $a_type, $a_obj_id);
205  }
206  return parent::checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id);
207  }
208 
209  // END WebDAV mount_webfolder in _blank frame
210 } // 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.
enableSubstitutions($a_status)
Enable substitutions.
static _getInstanceByObjectType($a_type)
Singleton: use this method to get an instance.
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 _isOnList($a_usr_id, $a_obj_id)
Check if a user on the waiting list.
getCommandFrame($a_cmd)
Get command target frame.
$DIC
Definition: xapitoken.php:46
getUriToMountInstructionModalByRef(int $a_ref_id)