Class ilForumModeratorsGUI.
More...
◆ addModerator()
ilForumModeratorsGUI::addModerator |
( |
|
$users = [] | ) |
|
Definition at line 97 of file class.ilForumModeratorsGUI.php.
References ilForumNotification\_isParentNodeGrpCrs(), ilObject\_lookupObjId(), ILIAS\Repository\ctrl(), ilForumProperties\getInstance(), ILIAS\Repository\lng(), and ILIAS\Repository\user().
100 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'frm_moderators_select_one'));
106 $frm_noti_type = $objFrmProps->getNotificationType();
108 foreach ($users as $user_id) {
109 $this->oForumModerators->addModeratorRole((
int) $user_id);
110 if ($isCrsGrp && $frm_noti_type !==
'default') {
112 $tmp_frm_noti->setUserId((
int) $user_id);
113 $tmp_frm_noti->setUserIdNoti($this->
user->getId());
114 $tmp_frm_noti->setUserToggle($objFrmProps->getUserToggleNoti());
115 $tmp_frm_noti->setAdminForce($objFrmProps->getAdminForceNoti());
117 $tmp_frm_noti->insertAdminForce();
121 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'frm_moderator_role_added_successfully'),
true);
122 $this->
ctrl->redirect($this,
'showModerators');
static _lookupObjId(int $ref_id)
static getInstance(int $a_obj_id=0)
static _isParentNodeGrpCrs(int $a_ref_id)
◆ detachModeratorRole()
ilForumModeratorsGUI::detachModeratorRole |
( |
| ) |
|
Definition at line 125 of file class.ilForumModeratorsGUI.php.
References $i, ilForumNotification\_isParentNodeGrpCrs(), ilParticipants\_isParticipant(), ilObject\_lookupObjId(), ILIAS\Repository\ctrl(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), ilLegacyFormElementsUtil\formCheckbox(), ilObjUser\getFirstname(), ilObject\getId(), ilForumProperties\getInstance(), ilObjectFactory\getInstanceByObjId(), ilObjUser\getLastname(), ilObjUser\getLogin(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\toolbar().
128 if ($this->http_wrapper->post()->has(
'usr_id')) {
129 $usr_ids = $this->http_wrapper->post()->retrieve(
135 if (!isset($usr_ids) || !is_array($usr_ids)) {
136 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'frm_moderators_select_at_least_one'));
137 $this->
ctrl->redirect($this,
'showModerators');
140 $entries = $this->oForumModerators->getCurrentModerators();
141 if (count($usr_ids) === count($entries)) {
142 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'frm_at_least_one_moderator'));
143 $this->
ctrl->redirect($this,
'showModerators');
149 $frm_noti_type = $objFrmProps->getNotificationType();
151 foreach ($usr_ids as $usr_id) {
152 $this->oForumModerators->detachModeratorRole((
int) $usr_id);
156 $tmp_frm_noti->setUserId((
int) $usr_id);
159 $tmp_frm_noti->deleteAdminForce();
163 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'frm_moderators_detached_role_successfully'),
true);
164 $this->
ctrl->redirect($this,
'showModerators');
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 75 of file class.ilForumModeratorsGUI.php.
References ILIAS\Repository\ctrl().
77 $next_class = $this->
ctrl->getNextClass($this);
78 $cmd = $this->
ctrl->getCmd();
80 switch (strtolower($next_class)) {
81 case strtolower(ilRepositorySearchGUI::class):
84 $this->
ctrl->setReturn($this,
'showModerators');
85 $this->
ctrl->forwardCommand($rep_search);
90 $cmd =
'showModerators';
setCallback(object $class, string $method, array $a_add_options=[], string $default_option='')
◆ $access
◆ $ctrl
◆ $error
◆ $http_wrapper
ILIAS HTTP Wrapper WrapperFactory ilForumModeratorsGUI::$http_wrapper |
|
private |
◆ $lng
◆ $oForumModerators
◆ $ref_id
int ilForumModeratorsGUI::$ref_id = 0 |
|
private |
◆ $refinery
ILIAS Refinery Factory ilForumModeratorsGUI::$refinery |
|
private |
◆ $tabs
◆ $toolbar
◆ $tpl
◆ $user
The documentation for this class was generated from the following file: