ILIAS  Release_5_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)
 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.

References $ilDB.

{
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.

References getRefId().

{
global $rbacreview, $rbacadmin;
$role_list = $rbacreview->getRoleListByObject($this->getRefId());
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;
}

+ Here is the call graph for this function:

ilForumModerators::detachModeratorRole (   $a_usr_id)

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

References getRefId().

{
global $rbacreview, $rbacadmin;
$role_list = $rbacreview->getRoleListByObject($this->getRefId());
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;
}

+ Here is the call graph for this function:

ilForumModerators::getCurrentModerators ( )

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

References getRefId().

{
global $rbacreview;
$roles = $rbacreview->getRoleListByObject($this->getRefId());
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();
}

+ Here is the call graph for this function:

ilForumModerators::getRefId ( )
Returns
int

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

References $ref_id.

Referenced by addModeratorRole(), detachModeratorRole(), getCurrentModerators(), and getUsers().

{
return $this->ref_id;
}

+ Here is the caller graph for this function:

ilForumModerators::getUsers ( )

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

References getRefId().

{
global $rbacreview;
$roles = $rbacreview->getRoleListByObject($this->getRefId());
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();
}

+ Here is the call graph for this function:

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: