Class ilForumModeratorsGUI.
More...
◆ __construct()
ilForumModeratorsGUI::__construct |
( |
| ) |
|
Definition at line 27 of file class.ilForumModeratorsGUI.php.
References $_GET, $DIC, and user().
30 $this->ctrl = $DIC->ctrl();
31 $this->tpl = $DIC->ui()->mainTemplate();
32 $this->lng = $DIC->language();
33 $this->access = $DIC->access();
34 $this->tabs = $DIC->tabs();
35 $this->error = $DIC[
'ilErr'];
36 $this->
user = $DIC->user();
37 $this->toolbar = $DIC->toolbar();
39 $this->tabs->activateTab(
'frm_moderators');
40 $this->lng->loadLanguageModule(
'search');
42 if (!$this->access->checkAccess(
'write',
'', (
int)
$_GET[
'ref_id'])) {
43 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
47 $this->ref_id = (int) $_GET[
'ref_id'];
◆ addModerator()
ilForumModeratorsGUI::addModerator |
( |
|
$users = array() | ) |
|
Definition at line 78 of file class.ilForumModeratorsGUI.php.
References $users, ilForumNotification\_isParentNodeGrpCrs(), ilObject\_lookupObjId(), ilForumProperties\getInstance(), ilUtil\sendFailure(), and user().
87 $frm_noti_type = $objFrmProps->getNotificationType();
89 foreach (
$users as $user_id) {
90 $this->oForumModerators->addModeratorRole((
int) $user_id);
91 if ($isCrsGrp && $frm_noti_type !=
'default') {
93 $tmp_frm_noti->setUserId((
int) $user_id);
94 $tmp_frm_noti->setUserIdNoti($this->
user->getId());
95 $tmp_frm_noti->setUserToggle((
int) $objFrmProps->getUserToggleNoti());
96 $tmp_frm_noti->setAdminForce((
int) $objFrmProps->getAdminForceNoti());
98 $tmp_frm_noti->insertAdminForce();
102 ilUtil::sendSuccess($this->lng->txt(
'frm_moderator_role_added_successfully'),
true);
103 $this->ctrl->redirect($this,
'showModerators');
static _isParentNodeGrpCrs($a_ref_id)
Class ilForumNotification.
static getInstance($a_obj_id=0)
static _lookupObjId($a_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
◆ detachModeratorRole()
ilForumModeratorsGUI::detachModeratorRole |
( |
| ) |
|
Definition at line 109 of file class.ilForumModeratorsGUI.php.
References $_GET, $_POST, $i, $result, $tbl, $user, ilForumNotification\_isParentNodeGrpCrs(), ilParticipants\_isParticipant(), ilObject\_lookupObjId(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), ilUtil\formCheckbox(), ilForumProperties\getInstance(), ilObjectFactory\getInstanceByObjId(), and ilUtil\sendFailure().
111 if (!isset(
$_POST[
'usr_id']) || !is_array(
$_POST[
'usr_id'])) {
113 return $this->showModerators();
116 $entries = $this->oForumModerators->getCurrentModerators();
117 if (count(
$_POST[
'usr_id']) == count($entries)) {
119 return $this->showModerators();
125 $frm_noti_type = $objFrmProps->getNotificationType();
127 foreach (
$_POST[
'usr_id'] as $usr_id) {
128 $this->oForumModerators->detachModeratorRole((
int) $usr_id);
130 if ($isCrsGrp && $frm_noti_type !=
'default') {
133 $tmp_frm_noti->setUserId((
int) $usr_id);
136 $tmp_frm_noti->deleteAdminForce();
141 ilUtil::sendSuccess($this->lng->txt(
'frm_moderators_detached_role_successfully'),
true);
142 $this->ctrl->redirect($this,
'showModerators');
static _isParentNodeGrpCrs($a_ref_id)
static _isParticipant($a_ref_id, $a_usr_id)
Static function to check if a user is a participant of the container object.
Class ilForumNotification.
static getInstance($a_obj_id=0)
static _lookupObjId($a_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
◆ executeCommand()
ilForumModeratorsGUI::executeCommand |
( |
| ) |
|
Definition at line 53 of file class.ilForumModeratorsGUI.php.
55 $next_class = $this->ctrl->getNextClass($this);
56 $cmd = $this->ctrl->getCmd();
58 switch ($next_class) {
59 case 'ilrepositorysearchgui':
61 $rep_search->setCallback($this,
'addModerator');
62 $this->ctrl->setReturn($this,
'showModerators');
63 $this->ctrl->forwardCommand($rep_search);
68 $cmd =
'showModerators';
◆ $ctrl
ilForumModeratorsGUI::$ctrl |
|
private |
◆ $error
ilForumModeratorsGUI::$error |
|
private |
◆ $lng
ilForumModeratorsGUI::$lng |
|
private |
◆ $oForumModerators
ilForumModeratorsGUI::$oForumModerators |
|
private |
◆ $ref_id
ilForumModeratorsGUI::$ref_id = 0 |
|
private |
◆ $tabs
ilForumModeratorsGUI::$tabs |
|
private |
◆ $toolbar
ilForumModeratorsGUI::$toolbar |
|
private |
◆ $tpl
ilForumModeratorsGUI::$tpl |
|
private |
◆ $user
ilForumModeratorsGUI::$user |
|
private |
The documentation for this class was generated from the following file: