ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjGroupListGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
29{
31
32 public function __construct(int $a_context = self::CONTEXT_REPOSITORY)
33 {
34 global $DIC;
35
36 $this->rbacsystem = $DIC->rbac()->system();
37 parent::__construct($a_context);
38 }
39
43 public function init(): void
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 $this->commands = ilObjGroupAccess::_getCommands();
60 }
61
65 public function getCommandLink(string $cmd): string
66 {
67 switch ($cmd) {
68 // BEGIN WebDAV: Mount Webfolder.
69 case 'mount_webfolder':
71 global $DIC;
72 $uri_builder = new ilWebDAVUriBuilder($DIC->http()->request());
73 $cmd_link = $uri_builder->getUriToMountInstructionModalByRef($this->ref_id);
74 break;
75 } // fall through if plugin is not active
76 // END Mount Webfolder.
77
78 // no break
79 case "edit":
80 default:
81 $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
82 $cmd_link = $this->ctrl->getLinkTargetByClass("ilrepositorygui", $cmd);
83 $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $this->requested_ref_id);
84 break;
85 }
86 return $cmd_link;
87 }
88
89
93 public function getProperties(): array
94 {
95 $props = parent::getProperties();
97 //var_dump($info);
98 if (isset($info['reg_info_list_prop'])) {
99 $props[] = array(
100 'alert' => false,
101 'newline' => true,
102 'property' => $info['reg_info_list_prop']['property'],
103 'value' => $info['reg_info_list_prop']['value']
104 );
105 }
106 if (isset($info['reg_info_list_prop_limit'])) {
107 $props[] = array(
108 'alert' => false,
109 'newline' => false,
110 'property' => $info['reg_info_list_prop_limit']['property'],
111 'propertyNameVisible' => strlen($info['reg_info_list_prop_limit']['property']) ? true : false,
112 'value' => $info['reg_info_list_prop_limit']['value']
113 );
114 }
115
116
117
118 // waiting list
119 if (ilGroupWaitingList::_isOnList($this->user->getId(), $this->obj_id)) {
120 $props[] = array(
121 "alert" => true,
122 "property" => $this->lng->txt('member_status'),
123 "value" => $this->lng->txt('on_waiting_list')
124 );
125 }
126
127 // course period
129 if (is_array($info)) {
130 $props[] = array(
131 'alert' => false,
132 'newline' => true,
133 'property' => $info['property'],
134 'value' => $info['value']
135 );
136 }
137 return $props;
138 }
139
143 public function getCommandFrame(string $cmd): string
144 {
145 // begin-patch fm
146 return parent::getCommandFrame($cmd);
147 // end-patch fm
148 }
149
150
154 public function checkCommandAccess(
155 string $permission,
156 string $cmd,
157 int $ref_id,
158 string $type,
159 ?int $obj_id = null
160 ): bool {
161 if ($permission == 'grp_linked') {
162 return
163 parent::checkCommandAccess('read', '', $ref_id, $type, $obj_id) ||
164 parent::checkCommandAccess('join', 'join', $ref_id, $type, $obj_id);
165 }
166 return parent::checkCommandAccess($permission, $cmd, $ref_id, $type, $obj_id);
167 }
168} // 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)
$info
Definition: entry_point.php:21
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
if(!file_exists('../ilias.ini.php'))
global $DIC
Definition: shib_login.php:26