ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilForumModeratorsGUI Class Reference

Class ilForumModeratorsGUI. More...

+ Collaboration diagram for ilForumModeratorsGUI:

Public Member Functions

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

Private Member Functions

 parseQueryString ($query_string)

Private Attributes

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

Detailed Description

Member Function Documentation

ilForumModeratorsGUI::addModerator ( )

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

References $_POST, $_SESSION, $ilUser, ilForumNotification\_isParentNodeGrpCrs(), ilObject\_lookupObjId(), ilForumProperties\getInstance(), ilUtil\sendInfo(), and showModeratorsSearchResult().

{
global $ilUser;
if(!$_POST['user'])
{
ilUtil::sendInfo($this->lng->txt('frm_moderators_select_one'));
return $this->showModeratorsSearchResult($_SESSION['frm']['moderators']['search_result']);
}
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();
unset($_SESSION['frm']['moderators']['search_result']);
foreach($_POST['user'] 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::sendInfo($this->lng->txt('frm_moderator_role_added_successfully'));
return $this->showModerators();
}

+ Here is the call graph for this function:

ilForumModeratorsGUI::detachModeratorRole ( )

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

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

{
$entries = $this->oForumModerators->getCurrentModerators();
if(count($_POST['usr_id']) == count($entries))
{
ilUtil::sendInfo($this->lng->txt('frm_at_least_one_moderator'));
return $this->showModerators();
}
if(!is_array($_POST['usr_id']))
{
ilUtil::sendInfo($this->lng->txt('frm_moderators_select_at_least_one'));
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')
{
//IMPORTANT!! delete this forced notification ONLY if the user is NOT a crs/grp member!!
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::sendInfo($this->lng->txt('frm_moderators_detached_role_successfully'));
return $this->showModerators();
}

+ Here is the call graph for this function:

ilForumModeratorsGUI::executeCommand ( )

Definition at line 55 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');
// Set tabs
$this->ctrl->setReturn($this,'showModerators');
$this->ctrl->forwardCommand($rep_search);
break;
default:
if(!$cmd)
{
$cmd = 'showModerators';
}
$this->$cmd();
break;
}
return true;
}
ilForumModeratorsGUI::parseQueryString (   $query_string)
private

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

{
$oQueryParser = new ilQueryParser($query_string);
$oQueryParser->setCombination('or');
$oQueryParser->parse();
if(!$oQueryParser->validate())
{
return $oQueryParser->getMessage();
}
return $oQueryParser;
}
ilForumModeratorsGUI::showModeratorsSearchResult (   $users = array())

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

Referenced by addModerator().

{
}

+ Here is the caller graph for this function:

Field Documentation

ilForumModeratorsGUI::$ctrl = null
private

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

ilForumModeratorsGUI::$lng = null
private

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

ilForumModeratorsGUI::$oForumModerators = null
private

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

ilForumModeratorsGUI::$ref_id = 0
private

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

ilForumModeratorsGUI::$tpl = null
private

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


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