ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
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':
70 global $DIC;
72 $webdav = $DIC[ILIAS\WebDAV\Environment::class];
73 if ($webdav->isActive()) {
74 $cmd_link = $webdav->getUriToMountInstructionModalByRef($this->ref_id);
75 } else {
76 $cmd_link = "";
77 }
78 break;
79 // fall through if plugin is not active
80 // END Mount Webfolder.
81
82 case "edit":
83 default:
84 $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
85 $cmd_link = $this->ctrl->getLinkTargetByClass("ilrepositorygui", $cmd);
86 $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $this->requested_ref_id);
87 break;
88 }
89 return $cmd_link;
90 }
91
92
96 public function getProperties(): array
97 {
98 $props = parent::getProperties();
100 //var_dump($info);
101 if (isset($info['reg_info_list_prop'])) {
102 $props[] = array(
103 'alert' => false,
104 'newline' => true,
105 'property' => $info['reg_info_list_prop']['property'],
106 'value' => $info['reg_info_list_prop']['value']
107 );
108 }
109 if (isset($info['reg_info_list_prop_limit'])) {
110 $props[] = array(
111 'alert' => false,
112 'newline' => false,
113 'property' => $info['reg_info_list_prop_limit']['property'],
114 'propertyNameVisible' => strlen($info['reg_info_list_prop_limit']['property']) ? true : false,
115 'value' => $info['reg_info_list_prop_limit']['value']
116 );
117 }
118
119
120
121 // waiting list
122 if (ilGroupWaitingList::_isOnList($this->user->getId(), $this->obj_id)) {
123 $props[] = array(
124 "alert" => true,
125 "property" => $this->lng->txt('member_status'),
126 "value" => $this->lng->txt('on_waiting_list')
127 );
128 }
129
130 // course period
132 if (is_array($info)) {
133 $props[] = array(
134 'alert' => false,
135 'newline' => true,
136 'property' => $info['property'],
137 'value' => $info['value']
138 );
139 }
140 return $props;
141 }
142
146 public function getCommandFrame(string $cmd): string
147 {
148 // begin-patch fm
149 return parent::getCommandFrame($cmd);
150 // end-patch fm
151 }
152
153
157 public function checkCommandAccess(
158 string $permission,
159 string $cmd,
160 int $ref_id,
161 string $type,
162 ?int $obj_id = null
163 ): bool {
164 if ($permission == 'grp_linked') {
166 return
167 parent::checkCommandAccess('read', '', $ref_id, $type, $obj_id) ||
168 parent::checkCommandAccess('join', 'join', $ref_id, $type, $obj_id);
169 }
170 return parent::checkCommandAccess($permission, $cmd, $ref_id, $type, $obj_id);
171 }
172} // 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.
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)
static _lookupType(int $id, bool $reference=false)
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