Class ilForumModeratorsGUI.
More...
◆ addModerator()
ilForumModeratorsGUI::addModerator |
( |
|
$users = [] | ) |
|
Definition at line 103 of file class.ilForumModeratorsGUI.php.
References $user_id, ilForumNotification\_isParentNodeGrpCrs(), ilObject\_lookupObjId(), ILIAS\Repository\ctrl(), ilForumProperties\getInstance(), ILIAS\Repository\lng(), and ILIAS\Repository\user().
106 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'frm_moderators_select_one'));
112 $frm_noti_type = $objFrmProps->getNotificationType();
115 $this->oForumModerators->addModeratorRole((
int) $user_id);
116 if ($isCrsGrp && $frm_noti_type !==
'default') {
118 $tmp_frm_noti->setUserId((
int) $user_id);
119 $tmp_frm_noti->setUserIdNoti($this->
user->getId());
120 $tmp_frm_noti->setUserToggle($objFrmProps->getUserToggleNoti());
121 $tmp_frm_noti->setAdminForce($objFrmProps->getAdminForceNoti());
123 $tmp_frm_noti->insertAdminForce();
127 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'frm_moderator_role_added_successfully'),
true);
128 $this->
ctrl->redirect($this,
'showModerators');
Class ilForumNotification.
static _lookupObjId(int $ref_id)
static getInstance(int $a_obj_id=0)
static _isParentNodeGrpCrs(int $a_ref_id)
◆ detachModeratorRole()
ilForumModeratorsGUI::detachModeratorRole |
( |
| ) |
|
Definition at line 131 of file class.ilForumModeratorsGUI.php.
References ilForumNotification\_isParentNodeGrpCrs(), ilParticipants\_isParticipant(), ilObject\_lookupObjId(), ILIAS\Repository\ctrl(), ilForumProperties\getInstance(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().
Referenced by handleModeratorActions().
134 if ($this->http_wrapper->query()->has(
'frm_moderators_table_usr_ids')) {
135 $usr_ids = $this->http_wrapper->query()->retrieve(
136 'frm_moderators_table_usr_ids',
141 if (!isset($usr_ids) || !is_array($usr_ids)) {
142 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'frm_moderators_select_at_least_one'));
143 $this->
ctrl->redirect($this,
'showModerators');
146 $entries = $this->oForumModerators->getCurrentModerators();
147 if (count($usr_ids) === count($entries)) {
148 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'frm_at_least_one_moderator'),
true);
149 $this->
ctrl->redirect($this,
'showModerators');
155 $frm_noti_type = $objFrmProps->getNotificationType();
157 foreach ($usr_ids as $usr_id) {
158 $this->oForumModerators->detachModeratorRole((
int) $usr_id);
162 $tmp_frm_noti->setUserId((
int) $usr_id);
165 $tmp_frm_noti->deleteAdminForce();
169 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'frm_moderators_detached_role_successfully'),
true);
170 $this->
ctrl->redirect($this,
'showModerators');
Class ilForumNotification.
static _lookupObjId(int $ref_id)
static getInstance(int $a_obj_id=0)
static _isParentNodeGrpCrs(int $a_ref_id)
static _isParticipant(int $a_ref_id, int $a_usr_id)
Static function to check if a user is a participant of the container object.
◆ executeCommand()
ilForumModeratorsGUI::executeCommand |
( |
| ) |
|
Definition at line 81 of file class.ilForumModeratorsGUI.php.
References ILIAS\Repository\ctrl().
83 $next_class = $this->
ctrl->getNextClass($this) ??
'';
84 $cmd = $this->
ctrl->getCmd() ??
'';
86 switch (strtolower($next_class)) {
87 case strtolower(ilRepositorySearchGUI::class):
90 $this->
ctrl->setReturn($this,
'showModerators');
91 $this->
ctrl->forwardCommand($rep_search);
96 $cmd =
'showModerators';
setCallback(object $class, string $method, array $a_add_options=[], string $default_option='')
◆ handleModeratorActions()
ilForumModeratorsGUI::handleModeratorActions |
( |
| ) |
|
|
private |
◆ showModerators()
ilForumModeratorsGUI::showModerators |
( |
| ) |
|
Definition at line 173 of file class.ilForumModeratorsGUI.php.
References ILIAS\Repository\ctrl(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\toolbar().
179 'auto_complete_name' => $this->
lng->txt(
'user'),
180 'submit_name' => $this->
lng->txt(
'add'),
181 'add_search' =>
true,
182 'add_from_container' => $this->oForumModerators->getRefId()
185 if ($this->http_wrapper->query()->has(
'ref_id')) {
186 $this->ref_id = $this->http_wrapper->query()->retrieve(
192 $tbl = new \ILIAS\Forum\Moderation\ForumModeratorsTable(
193 $this->oForumModerators,
200 $this->tpl->setContent($this->ui_renderer->render($tbl->getComponent()));
static http()
Fetches the global http state from ILIAS.
static fillAutoCompleteToolbar(object $parent_object, ?ilToolbarGUI $toolbar=null, array $a_options=[], bool $a_sticky=false)
array( auto_complete_name = $lng->txt('user'), auto_complete_size = 15, user_type = array(ilCoursePar...
◆ $access
◆ $ctrl
◆ $error
◆ $http
readonly ILIAS HTTP Services ilForumModeratorsGUI::$http |
|
private |
◆ $http_wrapper
readonly ILIAS HTTP Wrapper WrapperFactory ilForumModeratorsGUI::$http_wrapper |
|
private |
◆ $lng
◆ $oForumModerators
◆ $ref_id
int ilForumModeratorsGUI::$ref_id = 0 |
|
private |
◆ $refinery
readonly ILIAS Refinery Factory ilForumModeratorsGUI::$refinery |
|
private |
◆ $tabs
readonly ilTabsGUI ilForumModeratorsGUI::$tabs |
|
private |
◆ $toolbar
◆ $tpl
◆ $ui_factory
readonly ILIAS UI Factory ilForumModeratorsGUI::$ui_factory |
|
private |
◆ $ui_renderer
ILIAS UI Renderer ilForumModeratorsGUI::$ui_renderer |
|
protected |
◆ $user
readonly ilObjUser ilForumModeratorsGUI::$user |
|
private |
The documentation for this class was generated from the following file: