ILIAS  release_8 Revision v8.24
class.ilObjGroupListGUI.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4/*
5 +-----------------------------------------------------------------------------+
6 | ILIAS open source |
7 +-----------------------------------------------------------------------------+
8 | Copyright (c) 1998-2008 ILIAS open source, University of Cologne |
9 | |
10 | This program is free software; you can redistribute it and/or |
11 | modify it under the terms of the GNU General Public License |
12 | as published by the Free Software Foundation; either version 2 |
13 | of the License, or (at your option) any later version. |
14 | |
15 | This program is distributed in the hope that it will be useful, |
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 | GNU General Public License for more details. |
19 | |
20 | You should have received a copy of the GNU General Public License |
21 | along with this program; if not, write to the Free Software |
22 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
23 +-----------------------------------------------------------------------------+
24*/
25
26
27
37{
39
40 public function __construct(int $a_context = self::CONTEXT_REPOSITORY)
41 {
42 global $DIC;
43
44 $this->rbacsystem = $DIC->rbac()->system();
45 parent::__construct($a_context);
46 }
47
51 public function init(): void
52 {
53 $this->static_link_enabled = true;
54 $this->delete_enabled = true;
55 $this->cut_enabled = true;
56 $this->copy_enabled = true;
57 $this->subscribe_enabled = true;
58 $this->link_enabled = false;
59 $this->info_screen_enabled = true;
60 $this->type = "grp";
61 $this->gui_class_name = "ilobjgroupgui";
62
63 $this->substitutions = ilAdvancedMDSubstitution::_getInstanceByObjectType($this->type);
64 $this->enableSubstitutions($this->substitutions->isActive());
65
66 // general commands array
67 $this->commands = ilObjGroupAccess::_getCommands();
68 }
69
73 public function getCommandLink(string $cmd): string
74 {
75 switch ($cmd) {
76 // BEGIN WebDAV: Mount Webfolder.
77 case 'mount_webfolder':
79 global $DIC;
80 $uri_builder = new ilWebDAVUriBuilder($DIC->http()->request());
81 $cmd_link = $uri_builder->getUriToMountInstructionModalByRef($this->ref_id);
82 break;
83 } // fall through if plugin is not active
84 // END Mount Webfolder.
85
86 // no break
87 case "edit":
88 default:
89 $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
90 $cmd_link = $this->ctrl->getLinkTargetByClass("ilrepositorygui", $cmd);
91 $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $this->requested_ref_id);
92 break;
93 }
94 return $cmd_link;
95 }
96
97
101 public function getProperties(): array
102 {
103 $props = parent::getProperties();
104 $info = ilObjGroupAccess::lookupRegistrationInfo($this->obj_id);
105 //var_dump($info);
106 if (isset($info['reg_info_list_prop'])) {
107 $props[] = array(
108 'alert' => false,
109 'newline' => true,
110 'property' => $info['reg_info_list_prop']['property'],
111 'value' => $info['reg_info_list_prop']['value']
112 );
113 }
114 if (isset($info['reg_info_list_prop_limit'])) {
115 $props[] = array(
116 'alert' => false,
117 'newline' => false,
118 'property' => $info['reg_info_list_prop_limit']['property'],
119 'propertyNameVisible' => strlen($info['reg_info_list_prop_limit']['property']) ? true : false,
120 'value' => $info['reg_info_list_prop_limit']['value']
121 );
122 }
123
124
125
126 // waiting list
127 if (ilGroupWaitingList::_isOnList($this->user->getId(), $this->obj_id)) {
128 $props[] = array(
129 "alert" => true,
130 "property" => $this->lng->txt('member_status'),
131 "value" => $this->lng->txt('on_waiting_list')
132 );
133 }
134
135 // course period
136 $info = ilObjGroupAccess::lookupPeriodInfo($this->obj_id);
137 if (is_array($info)) {
138 $props[] = array(
139 'alert' => false,
140 'newline' => true,
141 'property' => $info['property'],
142 'value' => $info['value']
143 );
144 }
145 return $props;
146 }
147
151 public function getCommandFrame(string $cmd): string
152 {
153 // begin-patch fm
154 return parent::getCommandFrame($cmd);
155 // end-patch fm
156 }
157
158
162 public function checkCommandAccess(
163 string $permission,
164 string $cmd,
165 int $ref_id,
166 string $type,
167 ?int $obj_id = null
168 ): bool {
169 if ($permission == 'grp_linked') {
170 return
171 parent::checkCommandAccess('read', '', $ref_id, $type, $obj_id) ||
172 parent::checkCommandAccess('join', 'join', $ref_id, $type, $obj_id);
173 }
174 return parent::checkCommandAccess($permission, $cmd, $ref_id, $type, $obj_id);
175 }
176} // END class.ilObjGroupListGUI
static _getInstanceByObjectType(string $a_type)
static lookupPeriodInfo(int $a_obj_id)
static _getCommands()
@inheritDoc
static lookupRegistrationInfo(int $a_obj_id)
Class ilObjGroupListGUI.
getCommandLink(string $cmd)
@inheritDoc
getCommandFrame(string $cmd)
@inheritDoc
__construct(int $a_context=self::CONTEXT_REPOSITORY)
checkCommandAccess(string $permission, string $cmd, int $ref_id, string $type, ?int $obj_id=null)
@inheritDoc
enableSubstitutions(bool $status)
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
static _isOnList(int $a_usr_id, int $a_obj_id)
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: confirmReg.php:20
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc