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'];
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';
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');
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');
148 public function showModerators()
154 'auto_complete_name' => $this->lng->txt(
'user'),
155 'submit_name' => $this->lng->txt(
'add'),
156 'add_search' =>
true,
157 'add_from_container' => $this->oForumModerators->getRefId()
163 $entries = $this->oForumModerators->getCurrentModerators();
164 $num = count($entries);
167 foreach ($entries as $usr_id) {
174 $this->oForumModerators->detachModeratorRole((
int) $usr_id);
190 $this->tpl->setContent(
$tbl->getHTML());
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.
Class ilForumModeratorsTableGUI.
static getInstance($a_obj_id=0)
Class ilForumModeratorsGUI.
addModerator($users=array())
static _lookupObjId($a_id)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public