This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
More...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.
If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilObjGroupAccess
- Author
- Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
- Version
- $Id$
Definition at line 30 of file class.ilObjGroupAccess.php.
◆ _checkAccess()
ilObjGroupAccess::_checkAccess |
( |
string |
$cmd, |
|
|
string |
$permission, |
|
|
int |
$ref_id, |
|
|
int |
$obj_id, |
|
|
?int |
$user_id = null |
|
) |
| |
Definition at line 37 of file class.ilObjGroupAccess.php.
References $DIC, $ilUser, $lng, ilWaitingList\_isOnList(), ilGroupParticipants\_isParticipant(), ilDatePresentation\formatDate(), ilAccessInfo\IL_STATUS_INFO, and ilObjGroup\mayLeave().
43 $ilAccess = $DIC[
'ilAccess'];
45 if (is_null($user_id)) {
61 if (!self::_registrationEnabled($obj_id)) {
76 if ($permission ==
'leave') {
79 $ilAccess->addInfoItem(
94 if ($permission ==
'join') {
103 switch ($permission) {
static _isParticipant(int $a_ref_id, int $a_usr_id)
Static function to check if a user is a participant of the container object.
static mayLeave(int $a_group_id, int $a_user_id=null, ?ilDate &$a_date=null)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static _isOnList(int $a_usr_id, int $a_obj_id)
◆ _checkGoto()
static ilObjGroupAccess::_checkGoto |
( |
string |
$target | ) |
|
|
static |
Definition at line 140 of file class.ilObjGroupAccess.php.
References $DIC, $ilUser, and ANONYMOUS_USER_ID.
144 $ilAccess = $DIC->access();
147 $t_arr = explode(
"_", $target);
150 self::$using_code =
true;
154 if ($t_arr[0] !=
"grp" || ((
int) $t_arr[1]) <= 0) {
158 if ($ilAccess->checkAccess(
"read",
"", (
int) $t_arr[1]) ||
159 $ilAccess->checkAccess(
"visible",
"", (
int) $t_arr[1])) {
◆ _getCommands()
static ilObjGroupAccess::_getCommands |
( |
| ) |
|
|
static |
Definition at line 113 of file class.ilObjGroupAccess.php.
References ilDAVActivationChecker\_isActive().
Referenced by ilObjGroupReferenceAccess\_getCommands(), and ilObjGroupListGUI\init().
116 $commands[] = array(
"permission" =>
"grp_linked",
"cmd" =>
"",
"lang_var" =>
"show",
"default" =>
true);
118 $commands[] = array(
"permission" =>
"join",
"cmd" =>
"join",
"lang_var" =>
"join");
121 $commands[] = array(
'permission' =>
"join",
"cmd" =>
"leaveWaitList",
"lang_var" =>
"leave_waiting_list");
124 $commands[] = array(
'permission' =>
"leave",
"cmd" =>
"leave",
"lang_var" =>
"grp_btn_unsubscribe");
128 $commands[] = $webdav_obj->retrieveWebDAVCommandArrayForActionMenu();
131 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"enableAdministrationPanel",
"lang_var" =>
"edit_content");
132 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"settings");
◆ _preloadData()
static ilObjGroupAccess::_preloadData |
( |
array |
$obj_ids, |
|
|
array |
$ref_ids |
|
) |
| |
|
static |
◆ _registrationEnabled()
static ilObjGroupAccess::_registrationEnabled |
( |
int |
$a_obj_id | ) |
|
|
static |
Definition at line 165 of file class.ilObjGroupAccess.php.
References $DIC, ILIAS\LTI\ToolProvider\$enabled, $ilDB, $query, $res, ilDateTime\_after(), ilDateTime\_before(), ilDBConstants\FETCHMODE_OBJECT, IL_CAL_DATETIME, and IL_CAL_UNIX.
169 $ilDB = $DIC->database();
170 $query =
"SELECT * FROM grp_settings " .
171 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" ";
178 $enabled = $row->registration_enabled;
179 $unlimited = $row->registration_unlimited;
180 $start = $row->registration_start;
181 $end = $row->registration_end;
static _before(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
static _after(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
◆ _usingRegistrationCode()
static ilObjGroupAccess::_usingRegistrationCode |
( |
| ) |
|
|
static |
◆ lookupPeriodInfo()
static ilObjGroupAccess::lookupPeriodInfo |
( |
int |
$a_obj_id | ) |
|
|
static |
- Parameters
-
- Returns
- array<{property: string, value: string}> | null
- Exceptions
-
Definition at line 291 of file class.ilObjGroupAccess.php.
References $DIC, $ilDB, $lng, $query, $res, ilDBConstants\FETCHMODE_OBJECT, ilDatePresentation\formatPeriod(), IL_CAL_DATETIME, ilDBConstants\T_INTEGER, and ilTimeZone\UTC.
Referenced by ilObjGroupListGUI\getProperties().
295 $ilDB = $DIC->database();
296 $lng = $DIC->language();
298 $start = $end = null;
299 $query =
'SELECT period_start, period_end, period_time_indication FROM grp_settings ' .
304 if (!$row->period_time_indication) {
305 $start = ($row->period_start
308 $end = ($row->period_end
312 $start = ($row->period_start
315 $end = ($row->period_end
320 if ($start && $end) {
321 $lng->loadLanguageModule(
'grp');
325 'property' =>
$lng->txt(
'grp_period'),
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false)
Format a period of two dates Shows: 14.
◆ lookupRegistrationInfo()
static ilObjGroupAccess::lookupRegistrationInfo |
( |
int |
$a_obj_id | ) |
|
|
static |
Definition at line 210 of file class.ilObjGroupAccess.php.
References $DIC, $ilDB, $lng, $query, $res, ilDateTime\_before(), ilGroupParticipants\_getInstanceByObjId(), ilDBConstants\FETCHMODE_OBJECT, ilDatePresentation\formatDate(), IL_CAL_DATETIME, IL_CAL_UNIX, ilWaitingList\lookupListSize(), and ilDBConstants\T_INTEGER.
Referenced by ilGroupRegistrationGUI\fillMaxMembers(), ilObjGroupListGUI\getProperties(), and ilObjGroupGUI\infoScreen().
214 $ilDB = $DIC->database();
215 $lng = $DIC->language();
217 $query =
'SELECT registration_type, registration_enabled, registration_unlimited, registration_start, ' .
218 'registration_end, registration_mem_limit, registration_max_members FROM grp_settings ' .
226 $info[
'reg_info_type'] = $row->registration_type;
227 $info[
'reg_info_mem_limit'] = $row->registration_mem_limit;
228 $info[
'reg_info_unlimited'] = $row->registration_unlimited;
230 $info[
'reg_info_max_members'] = 0;
231 if ($info[
'reg_info_mem_limit']) {
232 $info[
'reg_info_max_members'] = $row->registration_max_members;
235 $info[
'reg_info_enabled'] = $row->registration_enabled;
238 $registration_possible = $info[
'reg_info_enabled'];
241 if (!$info[
'reg_info_unlimited'] && $registration_possible) {
244 $info[
'reg_info_list_prop'][
'property'] =
$lng->txt(
'grp_list_reg_start');
247 $info[
'reg_info_list_prop'][
'property'] =
$lng->txt(
'grp_list_reg_end');
250 $registration_possible =
false;
251 $info[
'reg_info_list_prop'][
'property'] =
$lng->txt(
'grp_list_reg_period');
252 $info[
'reg_info_list_prop'][
'value'] =
$lng->txt(
'grp_list_reg_noreg');
256 if (!$registration_possible) {
257 $registration_possible =
false;
258 $info[
'reg_info_list_prop'][
'property'] =
$lng->txt(
'grp_list_reg');
259 $info[
'reg_info_list_prop'][
'value'] =
$lng->txt(
'grp_list_reg_noreg');
263 if ($info[
'reg_info_mem_limit'] && $info[
'reg_info_max_members'] && $registration_possible) {
268 if ($info[
'reg_info_list_size']) {
269 $info[
'reg_info_free_places'] = 0;
271 $info[
'reg_info_free_places'] = max(0, $info[
'reg_info_max_members'] - $part->getCountMembers());
274 if ($info[
'reg_info_free_places']) {
275 $info[
'reg_info_list_prop_limit'][
'property'] =
$lng->txt(
'grp_list_reg_limit_places');
276 $info[
'reg_info_list_prop_limit'][
'value'] = $info[
'reg_info_free_places'];
278 $info[
'reg_info_list_prop_limit'][
'property'] =
'';
279 $info[
'reg_info_list_prop_limit'][
'value'] =
$lng->txt(
'grp_list_reg_limit_full');
static _before(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
static lookupListSize(int $a_obj_id)
◆ $using_code
bool ilObjGroupAccess::$using_code = false |
|
staticprotected |
The documentation for this class was generated from the following file: