ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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  require_once('Services/WebDAV/classes/class.ilWebDAVUtil.php');
84  $dav_util = ilWebDAVUtil::getInstance();
85 
86  // XXX: The following is a very dirty, ugly trick.
87  // To mount URI needs to be put into two attributes:
88  // href and folder. This hack returns both attributes
89  // like this: http://...mount_uri..." folder="http://...folder_uri...
90  $cmd_link = $dav_util->getMountURI($this->ref_id) .
91  '" folder="' . $dav_util->getFolderURI($this->ref_id);
92  break;
93  } // fall through if plugin is not active
94  // END Mount Webfolder.
95 
96  // no break
97  case "edit":
98  default:
99  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
100  $cmd_link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", $a_cmd);
101  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
102  break;
103  }
104 
105  return $cmd_link;
106  }
107 
108 
117  public function getProperties()
118  {
119  global $DIC;
120 
121  $lng = $DIC['lng'];
122  $rbacsystem = $DIC['rbacsystem'];
123  $ilUser = $DIC['ilUser'];
124 
125  // BEGIN WebDAV get parent properties
126  $props = parent::getProperties();
127  // END WebDAV get parent properties
128 
129  include_once './Modules/Group/classes/class.ilObjGroupAccess.php';
131  //var_dump($info);
132  if ($info['reg_info_list_prop']) {
133  $props[] = array(
134  'alert' => false,
135  'newline' => true,
136  'property' => $info['reg_info_list_prop']['property'],
137  'value' => $info['reg_info_list_prop']['value']
138  );
139  }
140  if ($info['reg_info_list_prop_limit']) {
141  $props[] = array(
142  'alert' => false,
143  'newline' => false,
144  'property' => $info['reg_info_list_prop_limit']['property'],
145  'propertyNameVisible' => strlen($info['reg_info_list_prop_limit']['property']) ? true : false,
146  'value' => $info['reg_info_list_prop_limit']['value']
147  );
148  }
149 
150 
151 
152  // waiting list
153  include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
155  $props[] = array(
156  "alert" => true,
157  "property" => $lng->txt('member_status'),
158  "value" => $lng->txt('on_waiting_list')
159  );
160  }
161 
162  // course period
163  $info = ilObjGroupAccess::lookupPeriodInfo($this->obj_id);
164  if (is_array($info)) {
165  $props[] = array(
166  'alert' => false,
167  'newline' => true,
168  'property' => $info['property'],
169  'value' => $info['value']
170  );
171  }
172 
173 
174 
175  return $props;
176  }
177 
178  // BEGIN WebDAV mount_webfolder in _blank frame
188  public function getCommandFrame($a_cmd)
189  {
190  // begin-patch fm
191  return parent::getCommandFrame($a_cmd);
192  // end-patch fm
193  }
194 
195 
205  public function checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id = "")
206  {
207  if ($a_permission == 'grp_linked') {
208  return
209  parent::checkCommandAccess('read', '', $a_ref_id, $a_type, $a_obj_id) ||
210  parent::checkCommandAccess('join', 'join', $a_ref_id, $a_type, $a_obj_id);
211  }
212  return parent::checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id);
213  }
214 
215  // END WebDAV mount_webfolder in _blank frame
216 } // END class.ilObjGroupListGUI
global $DIC
Definition: saml.php:7
$_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.
static getInstance()
Get singleton instance.
$info
Definition: index.php:5