ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilForumModeratorsGUI Class Reference

Class ilForumModeratorsGUI. More...

+ Collaboration diagram for ilForumModeratorsGUI:

Public Member Functions

 executeCommand ()
 addModerator ($users=array())
 detachModeratorRole ()

Private Attributes

 $ctrl
 $tpl
 $lng
 $oForumModerators
 $ref_id = 0

Detailed Description

Member Function Documentation

ilForumModeratorsGUI::addModerator (   $users = array())

Definition at line 99 of file class.ilForumModeratorsGUI.php.

References $ilUser, ilForumNotification\_isParentNodeGrpCrs(), ilObject\_lookupObjId(), ilForumProperties\getInstance(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $ilUser;
if(!$users)
{
ilUtil::sendFailure($this->lng->txt('frm_moderators_select_one'));
return;
}
include_once "Modules/Forum/classes/class.ilForumNotification.php";
$isCrsGrp = ilForumNotification::_isParentNodeGrpCrs($this->ref_id);
include_once "Modules/Forum/classes/class.ilForumProperties.php";
$frm_noti_type = $objFrmProps->getNotificationType();
foreach($users as $user_id)
{
$this->oForumModerators->addModeratorRole((int)$user_id);
if($isCrsGrp && $frm_noti_type != 'default')
{
$tmp_frm_noti = new ilForumNotification($this->ref_id);
$tmp_frm_noti->setUserId((int)$user_id);
$tmp_frm_noti->setUserIdNoti($ilUser->getId());
$tmp_frm_noti->setUserToggle((int)$objFrmProps->getUserToggleNoti());
$tmp_frm_noti->setAdminForce((int)$objFrmProps->getAdminForceNoti());
$tmp_frm_noti->insertAdminForce();
}
}
ilUtil::sendSuccess($this->lng->txt('frm_moderator_role_added_successfully'), true);
$this->ctrl->redirect($this, 'showModerators');
}

+ Here is the call graph for this function:

ilForumModeratorsGUI::detachModeratorRole ( )

Definition at line 137 of file class.ilForumModeratorsGUI.php.

References $_POST, $usr_id, ilForumNotification\_isParentNodeGrpCrs(), ilParticipants\_isParticipant(), ilObject\_lookupObjId(), ilForumProperties\getInstance(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
if(!isset($_POST['usr_id']) || !is_array($_POST['usr_id']))
{
ilUtil::sendFailure($this->lng->txt('frm_moderators_select_at_least_one'));
return $this->showModerators();
}
$entries = $this->oForumModerators->getCurrentModerators();
if(count($_POST['usr_id']) == count($entries))
{
ilUtil::sendFailure($this->lng->txt('frm_at_least_one_moderator'));
return $this->showModerators();
}
include_once "Modules/Forum/classes/class.ilForumNotification.php";
$isCrsGrp = ilForumNotification::_isParentNodeGrpCrs($this->ref_id);
if($isCrsGrp)
{
global $tree;
$parent_ref_id = $tree->getParentId($this->ref_id);
include_once "Services/Membership/classes/class.ilParticipants.php";
}
include_once "Modules/Forum/classes/class.ilForumProperties.php";
$frm_noti_type = $objFrmProps->getNotificationType();
foreach($_POST['usr_id'] as $usr_id)
{
$this->oForumModerators->detachModeratorRole((int)$usr_id);
if($isCrsGrp && $frm_noti_type != 'default')
{
if(!ilParticipants::_isParticipant($this->ref_id, $usr_id))
{
$tmp_frm_noti = new ilForumNotification($this->ref_id);
$tmp_frm_noti->setUserId((int)$usr_id);
$tmp_frm_noti->setForumId(ilObject::_lookupObjId($this->ref_id));
$tmp_frm_noti->deleteAdminForce();
}
}
}
ilUtil::sendSuccess($this->lng->txt('frm_moderators_detached_role_successfully'));
return $this->showModerators();
}

+ Here is the call graph for this function:

ilForumModeratorsGUI::executeCommand ( )

Definition at line 71 of file class.ilForumModeratorsGUI.php.

References $cmd.

{
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
switch($next_class)
{
case 'ilrepositorysearchgui':
include_once 'Services/Search/classes/class.ilRepositorySearchGUI.php';
$rep_search = new ilRepositorySearchGUI();
$rep_search->setCallback($this, 'addModerator');
$this->ctrl->setReturn($this, 'showModerators');
$this->ctrl->forwardCommand($rep_search);
break;
default:
if(!$cmd)
{
$cmd = 'showModerators';
}
$this->$cmd();
break;
}
}

Field Documentation

ilForumModeratorsGUI::$ctrl
private

Definition at line 21 of file class.ilForumModeratorsGUI.php.

ilForumModeratorsGUI::$lng
private

Definition at line 31 of file class.ilForumModeratorsGUI.php.

ilForumModeratorsGUI::$oForumModerators
private

Definition at line 36 of file class.ilForumModeratorsGUI.php.

ilForumModeratorsGUI::$ref_id = 0
private

Definition at line 38 of file class.ilForumModeratorsGUI.php.

ilForumModeratorsGUI::$tpl
private

Definition at line 26 of file class.ilForumModeratorsGUI.php.


The documentation for this class was generated from the following file: