4 include_once
'Modules/Forum/classes/class.ilForumModerators.php';
5 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
6 include_once
'Services/Table/classes/class.ilTable2GUI.php';
7 include_once
'Services/Search/classes/class.ilQueryParser.php';
8 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
36 $this->ctrl = $DIC->ctrl();
37 $this->tpl = $DIC->ui()->mainTemplate();
38 $this->lng = $DIC->language();
39 $this->access = $DIC->access();
40 $this->tabs = $DIC->tabs();
41 $this->error = $DIC[
'ilErr'];
42 $this->
user = $DIC->user();
43 $this->toolbar = $DIC->toolbar();
45 $this->tabs->activateTab(
'frm_moderators');
46 $this->lng->loadLanguageModule(
'search');
48 if (!$this->access->checkAccess(
'write',
'', (
int)
$_GET[
'ref_id'])) {
49 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
53 $this->ref_id = (int) $_GET[
'ref_id'];
61 $next_class = $this->ctrl->getNextClass($this);
62 $cmd = $this->ctrl->getCmd();
64 switch ($next_class) {
65 case 'ilrepositorysearchgui':
66 include_once
'Services/Search/classes/class.ilRepositorySearchGUI.php';
68 $rep_search->setCallback($this,
'addModerator');
69 $this->ctrl->setReturn($this,
'showModerators');
70 $this->ctrl->forwardCommand($rep_search);
75 $cmd =
'showModerators';
92 include_once
"Modules/Forum/classes/class.ilForumNotification.php";
94 include_once
"Modules/Forum/classes/class.ilForumProperties.php";
96 $frm_noti_type = $objFrmProps->getNotificationType();
98 foreach (
$users as $user_id) {
99 $this->oForumModerators->addModeratorRole((
int) $user_id);
100 if ($isCrsGrp && $frm_noti_type !=
'default') {
102 $tmp_frm_noti->setUserId((
int) $user_id);
103 $tmp_frm_noti->setUserIdNoti($this->
user->getId());
104 $tmp_frm_noti->setUserToggle((
int) $objFrmProps->getUserToggleNoti());
105 $tmp_frm_noti->setAdminForce((
int) $objFrmProps->getAdminForceNoti());
107 $tmp_frm_noti->insertAdminForce();
112 $this->ctrl->redirect($this,
'showModerators');
120 if (!isset(
$_POST[
'usr_id']) || !is_array(
$_POST[
'usr_id'])) {
122 return $this->showModerators();
125 $entries = $this->oForumModerators->getCurrentModerators();
126 if (count(
$_POST[
'usr_id']) == count($entries)) {
128 return $this->showModerators();
131 include_once
"Modules/Forum/classes/class.ilForumNotification.php";
135 include_once
"Services/Membership/classes/class.ilParticipants.php";
138 include_once
"Modules/Forum/classes/class.ilForumProperties.php";
140 $frm_noti_type = $objFrmProps->getNotificationType();
142 foreach (
$_POST[
'usr_id'] as $usr_id) {
143 $this->oForumModerators->detachModeratorRole((
int) $usr_id);
145 if ($isCrsGrp && $frm_noti_type !=
'default') {
148 $tmp_frm_noti->setUserId((
int) $usr_id);
151 $tmp_frm_noti->deleteAdminForce();
157 $this->ctrl->redirect($this,
'showModerators');
163 public function showModerators()
165 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
170 'auto_complete_name' => $this->lng->txt(
'user'),
171 'submit_name' => $this->lng->txt(
'add'),
172 'add_search' =>
true,
173 'add_from_container' => $this->oForumModerators->getRefId()
177 require_once
'Modules/Forum/classes/class.ilForumModeratorsTableGUI.php';
180 $entries = $this->oForumModerators->getCurrentModerators();
181 $num = count($entries);
184 foreach ($entries as $usr_id) {
191 $this->oForumModerators->detachModeratorRole((
int) $usr_id);
207 $this->tpl->setContent(
$tbl->getHTML());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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
Create styles array
The data for the language used.
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