ILIAS  Release_4_4_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)
 setRefId ($ref_id)
 getRefId ()
 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 16 of file class.ilForumModerators.php.

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

Member Function Documentation

ilForumModerators::addModeratorRole (   $a_usr_id)

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

{
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 63 of file class.ilForumModerators.php.

{
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 87 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::getRefId ( )
Returns
int

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

References $ref_id.

{
return $this->ref_id;
}
ilForumModerators::getUsers ( )

Definition at line 105 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();
}
ilForumModerators::setRefId (   $ref_id)
Parameters
int$ref_id

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

References $ref_id.

{
$this->ref_id = $ref_id;
}

Field Documentation

ilForumModerators::$db = null
private

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

ilForumModerators::$ref_id = 0
private

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

Referenced by getRefId(), and setRefId().


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