ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilForumModerators Class Reference

Class ilForumModerators. More...

+ Collaboration diagram for ilForumModerators:

Public Member Functions

 __construct ($a_ref_id)
 addModeratorRole ($a_usr_id)
 detachModeratorRole ($a_usr_id)
 getCurrentModerators ()
 getUsers ()

Private Attributes

 $db = null
 $ref_id = 0

Detailed Description

Constructor & Destructor Documentation

ilForumModerators::__construct (   $a_ref_id)

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

References $ilDB.

{
global $ilDB;
$this->db = $ilDB;
$this->ref_id = $a_ref_id;
}

Member Function Documentation

ilForumModerators::addModeratorRole (   $a_usr_id)

Definition at line 44 of file class.ilForumModerators.php.

References $user.

{
global $rbacreview, $rbacadmin;
$role_folder_id = $rbacreview->getRoleFolderIdOfObject($this->ref_id);
$role_list = $rbacreview->getRoleListByObject($role_folder_id);
foreach ($role_list as $role)
{
if(strpos($role['title'], 'il_frm_moderator') !== false)
{
$a_rol_id = $role['obj_id'];
break;
}
}
if((int)$a_rol_id)
{
$user = $rbacadmin->assignUser($a_rol_id, $a_usr_id);
return true;
}
return false;
}
ilForumModerators::detachModeratorRole (   $a_usr_id)

Definition at line 68 of file class.ilForumModerators.php.

References $user.

{
global $rbacreview, $rbacadmin;
$role_folder_id = $rbacreview->getRoleFolderIdOfObject($this->ref_id);
$role_list = $rbacreview->getRoleListByObject($role_folder_id);
foreach ($role_list as $role)
{
if(strpos($role['title'], 'il_frm_moderator') !== false)
{
$a_rol_id = $role['obj_id'];
break;
}
}
if((int)$a_rol_id)
{
$user = $rbacadmin->deassignUser($a_rol_id, $a_usr_id);
return true;
}
return false;
}
ilForumModerators::getCurrentModerators ( )

Definition at line 92 of file class.ilForumModerators.php.

{
global $rbacreview;
$role_folder = $rbacreview->getRoleFolderOfObject($this->ref_id);
$roles = $rbacreview->getRoleListByObject($role_folder['child']);
foreach($roles as $role)
{
if(strpos($role['title'], 'il_frm_moderator') !== false)
{
$assigned_users = $rbacreview->assignedUsers($role['rol_id']);
break;
}
}
return is_array($assigned_users) ? $assigned_users : array();
}
ilForumModerators::getUsers ( )

Definition at line 110 of file class.ilForumModerators.php.

{
global $rbacreview;
$role_folder = $rbacreview->getRoleFolderOfObject($this->ref_id);
$roles = $rbacreview->getRoleListByObject($role_folder['child']);
foreach($roles as $role)
{
if(strpos($role['title'], 'il_frm_moderator') !== false)
{
$assigned_users = $rbacreview->assignedUsers($role['rol_id']);
//vd($assigned_users);
break;
}
}
return is_array($assigned_users) ? $assigned_users : array();
}

Field Documentation

ilForumModerators::$db = null
private

Definition at line 33 of file class.ilForumModerators.php.

ilForumModerators::$ref_id = 0
private

Definition at line 34 of file class.ilForumModerators.php.


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