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

Class ilForumNotification. More...

+ Collaboration diagram for ilForumNotification:

Public Member Functions

 __construct ($ref_id)
 Constructor public.
 setNotificationId ($a_notification_id)
 getNotificationId ()
 setUserId ($a_user_id)
 getUserId ()
 setForumId ($a_forum_id)
 getForumId ()
 setThreadId ($a_thread_id)
 getThreadId ()
 setAdminForce ($a_admin_force)
 getAdminForce ()
 setUserToggle ($a_user_toggle)
 getUserToggle ()
 setForumRefId ($a_ref_id)
 getForumRefId ()
 setUserIdNoti ($a_user_id_noti)
 getUserIdNoti ()
 isAdminForceNotification ()
 isUserToggleNotification ()
 insertAdminForce ()
 deleteAdminForce ()
 deleteUserToggle ()
 updateUserToggle ()
 getCrsGrpMemberToNotify ()
 _getModerators ($a_ref_id)
 get all users assigned to local role il_frm_moderator_<frm_ref_id> (static)
 update ()
 deleteNotificationAllUsers ()
 read ()
 existsNotification ()

Static Public Member Functions

static checkForumsExistsInsert ($ref_id, $user_id=0)
static checkForumsExistsDelete ($ref_id, $user_id=0)
static _isParentNodeGrpCrs ($a_ref_id)
static _clearForcedForumNotifications ($a_parameter)
static checkParentNodeTree ($ref_id)

Private Attributes

 $notification_id
 $user_id
 $forum_id
 $thread_id
 $admin_force
 $user_toggle
 $ref_id

Detailed Description

Class ilForumNotification.

Author
Nadia Ahmad nahma.nosp@m.d@da.nosp@m.tabay.nosp@m..de
Version
$Id:$

Definition at line 15 of file class.ilForumNotification.php.

Constructor & Destructor Documentation

ilForumNotification::__construct (   $ref_id)

Constructor public.

Definition at line 32 of file class.ilForumNotification.php.

References $lng, and $ref_id.

{
global $ilObjDataCache,$lng,$ilias;
$this->lng = $lng;
$this->ilias = $ilias;
$this->ref_id = $ref_id;
$this->forum_id = $ilObjDataCache->lookupObjId($ref_id);
}

Member Function Documentation

static ilForumNotification::_clearForcedForumNotifications (   $a_parameter)
static

Definition at line 299 of file class.ilForumNotification.php.

References $forum_id, $ref_id, and _isParentNodeGrpCrs().

Referenced by ilForumAppEventListener\handleEvent().

{
global $ilDB, $ilObjDataCache;
if(!$a_parameter['tree'] == 'tree')
{
return;
}
$ref_id = $a_parameter['source_id'];
if($is_parent)
{
$forum_id = $ilObjDataCache->lookupObjId($ref_id);
$ilDB->manipulateF('
DELETE FROM frm_notification
WHERE frm_id = %s
AND admin_force_noti = %s',
array('integer','integer'),
array($forum_id, 1));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilForumNotification::_getModerators (   $a_ref_id)

get all users assigned to local role il_frm_moderator_<frm_ref_id> (static)

Parameters
int$a_ref_idreference id
Returns
array user_ids public

Definition at line 361 of file class.ilForumNotification.php.

References $title, and ilObject\_lookupTitle().

Referenced by checkParentNodeTree(), and ilObjForumGUI\updateUserNotifications().

{
global $rbacreview;
$rolf = $rbacreview->getRoleFolderOfObject($a_ref_id);
$role_arr = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"]);
foreach ($role_arr as $role_id)
{
//$roleObj = $this->ilias->obj_factory->getInstanceByObjId($role_id);
if ($title == "il_frm_moderator_".$a_ref_id)
{
#return $rbacreview->assignedUsers($roleObj->getId());
return $title = $rbacreview->assignedUsers($role_id);
}
}
return array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilForumNotification::_isParentNodeGrpCrs (   $a_ref_id)
static

Definition at line 286 of file class.ilForumNotification.php.

References ilObjectFactory\getInstanceByRefId().

Referenced by _clearForcedForumNotifications(), ilForumModeratorsGUI\addModerator(), and ilForumModeratorsGUI\detachModeratorRole().

{
global $tree;
$parent_ref_id = $tree->getParentId($a_ref_id);
$parent_obj = ilObjectFactory::getInstanceByRefId($parent_ref_id);
if($parent_obj->getType() == 'crs' || $parent_obj->getType() == 'grp')
return $parent_obj->getType();
else return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilForumNotification::checkForumsExistsDelete (   $ref_id,
  $user_id = 0 
)
static

Definition at line 257 of file class.ilForumNotification.php.

References $data, $ilUser, $ref_id, and $user_id.

Referenced by ilObjGroupGUI\deleteMembersObject(), ilObjCourseGUI\performUnsubscribeObject(), ilCourseParticipantsGroupsGUI\remove(), ilObjCourseGUI\removeMembersObject(), and ilObjGroupGUI\unsubscribeObject().

{
global $tree, $ilUser;
$node_data = $tree->getChildsByType($ref_id, 'frm');
include_once 'Modules/Forum/classes/class.ilForumModerators.php';
foreach($node_data as $data)
{
//check frm_properties if frm_noti is enabled
$frm_noti = new ilForumNotification($data['ref_id']);
$objFrmMods = new ilForumModerators($data['ref_id']);
$moderator_ids = $objFrmMods->getCurrentModerators();
if($user_id != 0)
{
$frm_noti->setUserId($user_id);
}
else $frm_noti->setUserId($ilUser->getId());
$frm_noti->setForumId($data['obj_id']);
if(!in_array($frm_noti->getUserId(), $moderator_ids))
{
$frm_noti->deleteAdminForce();
}
}
}

+ Here is the caller graph for this function:

static ilForumNotification::checkForumsExistsInsert (   $ref_id,
  $user_id = 0 
)
static

Definition at line 222 of file class.ilForumNotification.php.

References $admin_force, $data, $ilUser, $ref_id, $user_id, $user_toggle, ilForumProperties\_isAdminForceNoti(), and ilForumProperties\_isUserToggleNoti().

Referenced by ilCourseParticipantsGroupsGUI\add(), ilGroupRegistrationGUI\add(), ilCourseRegistrationGUI\add(), ilObjGroupGUI\addUserObject(), ilObjGroupGUI\assignFromWaitingListObject(), ilObjCourseGUI\assignFromWaitingListObject(), ilObjCourseGUI\assignMembersObject(), ilObjGroupGUI\assignSubscribersObject(), ilObjCourseGUI\assignSubscribersObject(), and ilObjCourse\register().

{
global $tree, $ilUser;
include_once 'Modules/Forum/classes/class.ilForumProperties.php';
$node_data = $tree->getChildsByType($ref_id, 'frm');
foreach($node_data as $data)
{
//check frm_properties if frm_noti is enabled
$frm_noti = new ilForumNotification($data['ref_id']);
if($user_id != 0)
{
$frm_noti->setUserId($user_id);
}
else $frm_noti->setUserId($ilUser->getId());
$frm_noti->setAdminForce($admin_force);
if($user_toggle) $frm_noti->setAdminForce(1);
if($admin_force == 1 || $user_toggle == 1)
{
$frm_noti->setUserToggle($user_toggle);
$frm_noti->setForumId($data['obj_id']);
if($frm_noti->existsNotification() == false)
{
$frm_noti->insertAdminForce();
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilForumNotification::checkParentNodeTree (   $ref_id)
static

Definition at line 324 of file class.ilForumNotification.php.

References $ref_id, $result, ilGroupParticipants\_getInstanceByObjId(), ilCourseParticipants\_getInstanceByObjId(), _getModerators(), and ilObjectFactory\getInstanceByRefId().

{
global $tree;
$parent_ref_id = $tree->getParentId($ref_id);
$parent_obj = ilObjectFactory::getInstanceByRefId($parent_ref_id);
if($parent_obj->getType() == 'crs')
{
include_once 'Modules/Course/classes/class.ilCourseParticipants.php';
$oParticipants = ilCourseParticipants::_getInstanceByObjId($parent_obj->getId());
}
else if($parent_obj->getType() == 'grp')
{
include_once 'Modules/Group/classes/class.ilGroupParticipants.php';
$oParticipants = ilGroupParticipants::_getInstanceByObjId($parent_obj->getId());
}
$result = array();
if($parent_obj->getType() == 'crs' || $parent_obj->getType() == 'grp')
{
$moderator_ids = self::_getModerators($ref_id);
$admin_ids = $oParticipants->getAdmins();
$tutor_ids = $oParticipants->getTutors();
$result = array_unique(array_merge($moderator_ids,$admin_ids,$tutor_ids));
}
return $result;
}

+ Here is the call graph for this function:

ilForumNotification::deleteAdminForce ( )

Definition at line 167 of file class.ilForumNotification.php.

References $res, getForumId(), and getUserId().

{
global $ilDB;
$res = $ilDB->manipulateF('
DELETE FROM frm_notification
WHERE user_id = %s
AND frm_id = %s
AND admin_force_noti = %s
AND user_id_noti > %s' ,
array('integer', 'integer','integer', 'integer'),
array($this->getUserId(), $this->getForumId(), 1, 0));
}

+ Here is the call graph for this function:

ilForumNotification::deleteNotificationAllUsers ( )

Definition at line 396 of file class.ilForumNotification.php.

References $res, and getForumId().

{
global $ilDB;
$res = $ilDB->manipulateF('
DELETE FROM frm_notification
WHERE frm_id = %s
AND user_id_noti > %s',
array('integer', 'integer'),
array($this->getForumId(), 0));
}

+ Here is the call graph for this function:

ilForumNotification::deleteUserToggle ( )

Definition at line 181 of file class.ilForumNotification.php.

References $ilUser, $res, getForumId(), and getUserId().

{
global $ilDB, $ilUser;
$res = $ilDB->manipulateF('
DELETE FROM frm_notification
WHERE user_id = %s
AND frm_id = %s
AND admin_force_noti = %s
AND user_toggle_noti = %s
AND user_id_noti > %s' ,
array('integer', 'integer','integer','integer', 'integer'),
array($this->getUserId(),$this->getForumId(),1,1, 0 ));
}

+ Here is the call graph for this function:

ilForumNotification::existsNotification ( )
Returns
bool

Definition at line 430 of file class.ilForumNotification.php.

References $res, $row, getAdminForce(), getForumId(), and getUserId().

{
global $ilDB;
$res = $ilDB->queryF('
SELECT * FROM frm_notification
WHERE user_id = %s
AND frm_id = %s
AND admin_force_noti = %s',
array('integer', 'integer', 'integer'),
array($this->getUserId(), $this->getForumId(), $this->getAdminForce()));
if($row = $ilDB->numRows($res) > 0)
{
return true;
}
return false;
}

+ Here is the call graph for this function:

ilForumNotification::getAdminForce ( )

Definition at line 83 of file class.ilForumNotification.php.

References $admin_force.

Referenced by existsNotification(), insertAdminForce(), and update().

{
}

+ Here is the caller graph for this function:

ilForumNotification::getCrsGrpMemberToNotify ( )

Definition at line 211 of file class.ilForumNotification.php.

{
global $ilDB;
}
ilForumNotification::getForumId ( )
ilForumNotification::getForumRefId ( )

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

References $ref_id.

{
return $this->ref_id;
}
ilForumNotification::getNotificationId ( )

Definition at line 47 of file class.ilForumNotification.php.

References $notification_id.

ilForumNotification::getThreadId ( )

Definition at line 73 of file class.ilForumNotification.php.

References $thread_id.

{
}
ilForumNotification::getUserId ( )
ilForumNotification::getUserIdNoti ( )

Definition at line 113 of file class.ilForumNotification.php.

{
return $this->user_id_noti;
}
ilForumNotification::getUserToggle ( )

Definition at line 93 of file class.ilForumNotification.php.

References $user_toggle.

Referenced by insertAdminForce(), update(), and updateUserToggle().

{
}

+ Here is the caller graph for this function:

ilForumNotification::insertAdminForce ( )

Definition at line 154 of file class.ilForumNotification.php.

References $ilUser, $res, getAdminForce(), getForumId(), getUserId(), and getUserToggle().

{
global $ilDB, $ilUser;
$next_id = $ilDB->nextId('frm_notification');
$res = $ilDB->manipulateF('
INSERT INTO frm_notification
(notification_id, user_id, frm_id, admin_force_noti, user_toggle_noti, user_id_noti)
VALUES(%s,%s,%s,%s,%s,%s)',
array('integer', 'integer', 'integer', 'integer', 'integer', 'integer'),
array($next_id, $this->getUserId(), $this->getForumId(), $this->getAdminForce(), $this->getUserToggle(), $ilUser->getId()));
}

+ Here is the call graph for this function:

ilForumNotification::isAdminForceNotification ( )

Definition at line 118 of file class.ilForumNotification.php.

References $res, $row, getForumId(), and getUserId().

{
global $ilDB;
$res = $ilDB->queryF('
SELECT admin_force_noti FROM frm_notification
WHERE user_id = %s
AND frm_id = %s
AND user_id_noti > %s ',
array('integer','integer', 'integer'),
array($this->getUserId(), $this->getForumId(), 0));
while($row = $ilDB->fetchAssoc($res))
{
return $row['admin_force_noti'];
}
}

+ Here is the call graph for this function:

ilForumNotification::isUserToggleNotification ( )

Definition at line 135 of file class.ilForumNotification.php.

References $res, $row, getForumId(), and getUserId().

Referenced by ilObjForumGUI\getUserNotificationTableData().

{
global $ilDB;
$res = $ilDB->queryF('
SELECT user_toggle_noti FROM frm_notification
WHERE user_id = %s
AND frm_id = %s
AND user_id_noti > %s',
array('integer', 'integer', 'integer'),
array($this->getUserId(), $this->getForumId(), 0 ));
while($row = $ilDB->fetchAssoc($res))
{
return $row['user_toggle_noti'];
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilForumNotification::read ( )

Definition at line 408 of file class.ilForumNotification.php.

References $query, $result, $row, and getForumId().

{
global $ilDB;
$result = array();
$query = $ilDB->queryF('
SELECT * FROM frm_notification WHERE
frm_id = %s',
array('integer'),
array($this->getForumId()));
while($row = $ilDB->fetchAssoc($query))
{
$result[$row['user_id']] = $row;
}
return $result;
}

+ Here is the call graph for this function:

ilForumNotification::setAdminForce (   $a_admin_force)

Definition at line 79 of file class.ilForumNotification.php.

{
$this->admin_force = $a_admin_force;
}
ilForumNotification::setForumId (   $a_forum_id)

Definition at line 60 of file class.ilForumNotification.php.

{
$this->forum_id = $a_forum_id;
}
ilForumNotification::setForumRefId (   $a_ref_id)

Definition at line 98 of file class.ilForumNotification.php.

{
$this->ref_id = $a_ref_id;
}
ilForumNotification::setNotificationId (   $a_notification_id)

Definition at line 43 of file class.ilForumNotification.php.

{
$this->notification_id = $a_notification_id;
}
ilForumNotification::setThreadId (   $a_thread_id)

Definition at line 69 of file class.ilForumNotification.php.

{
$this->thread_id = $a_thread_id;
}
ilForumNotification::setUserId (   $a_user_id)

Definition at line 51 of file class.ilForumNotification.php.

Referenced by ilObjForumGUI\getUserNotificationTableData().

{
$this->user_id = $a_user_id;
}

+ Here is the caller graph for this function:

ilForumNotification::setUserIdNoti (   $a_user_id_noti)

Definition at line 108 of file class.ilForumNotification.php.

{
$this->user_id_noti = $a_user_id_noti;
}
ilForumNotification::setUserToggle (   $a_user_toggle)

Definition at line 89 of file class.ilForumNotification.php.

{
$this->user_toggle = $a_user_toggle;
}
ilForumNotification::update ( )

Definition at line 382 of file class.ilForumNotification.php.

References $res, getAdminForce(), getForumId(), getUserId(), and getUserToggle().

{
global $ilDB;
$res = $ilDB->manipulateF('
UPDATE frm_notification
SET admin_force_noti = %s,
user_toggle_noti = %s
WHERE user_id = %s
AND frm_id = %s',
array('integer','integer','integer','integer'),
array($this->getAdminForce(), $this->getUserToggle(), $this->getUserId(), $this->getForumId()));
}

+ Here is the call graph for this function:

ilForumNotification::updateUserToggle ( )

Definition at line 197 of file class.ilForumNotification.php.

References $res, getForumId(), getUserId(), and getUserToggle().

{
global $ilDB;
$res = $ilDB->manipulateF('
UPDATE frm_notification
SET user_toggle_noti = %s
WHERE user_id = %s
AND frm_id = %s
AND admin_force_noti = %s',
array('integer','integer','integer','integer'),
array($this->getUserToggle(), $this->getUserId(),$this->getForumId(), 1));
}

+ Here is the call graph for this function:

Field Documentation

ilForumNotification::$admin_force
private

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

Referenced by checkForumsExistsInsert(), and getAdminForce().

ilForumNotification::$forum_id
private

Definition at line 19 of file class.ilForumNotification.php.

Referenced by _clearForcedForumNotifications(), and getForumId().

ilForumNotification::$notification_id
private

Definition at line 17 of file class.ilForumNotification.php.

Referenced by getNotificationId().

ilForumNotification::$thread_id
private

Definition at line 20 of file class.ilForumNotification.php.

Referenced by getThreadId().

ilForumNotification::$user_id
private
ilForumNotification::$user_toggle
private

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

Referenced by checkForumsExistsInsert(), and getUserToggle().


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