Overview

Packages

  • Auth
    • Ads
    • Ldap
    • Xoops
  • Autotasks
  • Config
    • Category
    • Item
    • Option
  • Core
    • Filesystem
    • Filters
    • Logger
    • Mail
    • Message
    • Password
    • Security
    • StopSpammer
    • Template
    • Textsanitizer
    • VersionChecker
  • Data
    • Avatar
    • Comment
  • Database
    • Connection
    • Criteria
    • Legacy
    • MySQL
    • PDO
    • Updater
  • Feeds
    • RSS
  • File
  • Form
    • Base
    • Elements
  • ICMS
    • IPF
      • View
  • Image
    • Category
  • Ipf
    • Category
    • Controller
    • Export
    • form
    • Keyhighlighter
    • Member
    • Object
    • Permission
    • richfile
    • Tree
    • urllink
    • View
  • kernel
    • Set
  • Member
    • Group
    • GroupMembership
    • GroupPermission
    • User
  • Messaging
  • Module
  • None
  • Notification
  • Page
  • Plugins
    • Editor
  • Preload
    • Libraries
  • Privmessage
  • Session
  • SmartObject
  • View
    • Block
    • Breadcrumb
    • PageNav
    • PrinterFriendly
    • Template
    • Templates
    • Theme
    • Tree

Classes

  • icms_data_notification_Handler
  • icms_data_notification_Object
  • Overview
  • Package
  • Class

Class icms_data_notification_Handler

Notification handler class.

This class is responsible for providing data access mechanisms to the data source of notification class objects.

icms_core_ObjectHandler
Extended by icms_data_notification_Handler
Package: Notification
Category: ICMS
Copyright: copyright (c) 2000-2007 XOOPS.org
License: LICENSE.txt
Author: Michael van Dam mvandam@caltech.edu
Located at data/notification/Handler.php
Methods summary
public object &
# create( boolean $isNew = true )

Create a icms_data_notification_Object

Create a icms_data_notification_Object

Parameters

$isNew
Flag the object as "new"?

Returns

object
public object &
# get( integer $id )

Retrieve a icms_data_notification_Object

Retrieve a icms_data_notification_Object

Parameters

$id
ID

Returns

object
icms_data_notification_Object, FALSE on fail
public boolean
# insert( object & $notification )

Inserts a notification(subscription) into database

Inserts a notification(subscription) into database

Parameters

$notification
$notification

Returns

boolean
public boolean
# delete( object & $notification )

Delete a icms_data_notification_Object from the database

Delete a icms_data_notification_Object from the database

Parameters

$notification
$notification icms_data_notification_Object

Returns

boolean
public array
# getObjects( object $criteria = null, boolean $id_as_key = false )

Get some icms_data_notification_Objects

Get some icms_data_notification_Objects

Parameters

$criteria
$id_as_key
Use IDs as keys into the array?

Returns

array
Array of icms_data_notification_Object objects
public integer
# getCount( object $criteria = null )

Count Notifications

Count Notifications

Parameters

$criteria
icms_db_criteria_Element

Returns

integer
Count
public boolean
# deleteAll( object $criteria = null )

Delete multiple notifications

Delete multiple notifications

Parameters

$criteria
icms_db_criteria_Element

Returns

boolean
public mixed &
# getNotification( integer $module_id, string $category, integer $item_id, string $event, integer $user_id )

Change a value in multiple notifications

Change a value in multiple notifications

Parameters

$module_id
module ID to get notification for
$category
category to get notification for
$item_id
item ID to get notification for
$event
module ID to get notification for
$user_id
user ID to get notification for

Returns

mixed
array of objects or false
public
# isSubscribed( string $category, integer $item_id, string $event, integer $module_id, integer $user_id )

Determine if a user is subscribed to a particular event in a particular module.

Determine if a user is subscribed to a particular event in a particular module.

Parameters

$category
Category of notification event
$item_id
Item ID of notification event
$event
Event
$module_id
ID of module (default current module)
$user_id

ID of user (default current user) return int 0 if not subscribe; non-zero if subscribed (boolean... sort of)

public
# subscribe( string $category, integer $item_id, mixed $events, integer $mode = null, integer $module_id = null, integer $user_id = null )

Subscribe for notification for an event(s)

Subscribe for notification for an event(s)

Parameters

$category
category of notification
$item_id
ID of the item
$events
event string or array of events
$mode

force a particular notification mode (e.g. once_only) (default to current user preference)

$module_id
ID of the module (default to current module)
$user_id
ID of the user (default to current user)
public array
# getByUser( integer $user_id )

Get a list of notifications by user ID

Get a list of notifications by user ID

Parameters

$user_id
ID of the user

Returns

array
Array of icms_data_notification_Object objects
public array
# getSubscribedEvents( string $category, integer $item_id, integer $module_id, integer $user_id )

Get a list of notification events for the current item/mod/user

Get a list of notification events for the current item/mod/user

Parameters

$category
category for the subscribed events
$item_id
ID of the subscribed items
$module_id
ID of the module of the subscribed items
$user_id
ID of the user of the subscribed items

Returns

array
Array of icms_data_notification_Object objects
public array
# getByItemId( integer $module_id, integer $item_id, string $order = null, string $status = null )

Retrieve items by their ID

Retrieve items by their ID

Parameters

$module_id
Module ID
$item_id
Item ID
$order
Sort order
$status
status

Returns

array
Array of icms_data_notification_Object objects
public
# triggerEvents( $category, $item_id, $events, $extra_tags = array(), $user_list = array(), $module_id = null, $omit_user_id = null )
public
# triggerEvent( string $category, integer $item_id, string $event, array $extra_tags = array(), array $user_list = array(), integer $module_id = null, integer $omit_user_id = null )

Send notifications to users

Send notifications to users

Parameters

$category
notification category
$item_id
ID of the item
$event
notification event
$extra_tags

array of substitutions for template to be merged with the one from function..

$user_list
only notify the selected users
$module_id
ID of the module
$omit_user_id
ID of the user to omit from notifications. (default to current user). set to 0 for all users to receive notification.
public boolean
# unsubscribeByUser( integer $user_id )

Delete all notifications for one user

Delete all notifications for one user

Parameters

$user_id
ID of the user

Returns

boolean
public boolean
# unsubscribe( string $category, integer $item_id, mixed $events, integer $module_id = null, integer $user_id = null )

Unsubscribe notifications for an event(s).

Unsubscribe notifications for an event(s).

Parameters

$category
category of the events
$item_id
ID of the item
$events
event string or array of events
$module_id
ID of the module (default current module)
$user_id
UID of the user (default current user)

Returns

boolean
public boolean
# unsubscribeByModule( integer $module_id )

Delete all notifications for a particular module

Delete all notifications for a particular module

Parameters

$module_id
ID of the module

Returns

boolean
public boolean
# unsubscribeByItem( integer $module_id, string $category, integer $item_id )

Delete all subscriptions for a particular item.

Delete all subscriptions for a particular item.

Parameters

$module_id
ID of the module to which item belongs
$category
Notification category of the item
$item_id
ID of the item

Returns

boolean
public
# doLoginMaintenance( integer $user_id )

Perform notification maintenance activites at login time. In particular, any notifications for the newly logged-in user with mode XOOPS_NOTIFICATION_MODE_WAITFORLOGIN are switched to mode XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT.

Perform notification maintenance activites at login time. In particular, any notifications for the newly logged-in user with mode XOOPS_NOTIFICATION_MODE_WAITFORLOGIN are switched to mode XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT.

Parameters

$user_id
ID of the user being logged in
public boolean
# updateByField( object & $notification, string $field_name, mixed $field_value )

Update

Update

Parameters

$notification
$notification icms_data_notification_Object object
$field_name
Name of the field
$field_value
Value to write

Returns

boolean
public static boolean
# isEnabled( string $style, integer $module_id = null )

Determine if notification is enabled for the selected module.

Determine if notification is enabled for the selected module.

Replaces function notificationEnabled()

Parameters

$style
Subscription style: 'block' or 'inline'
$module_id
ID of the module (default current module)

Returns

boolean
public static mixed &
# categoryInfo( string $category_name = '', integer $module_id = null )

Replaces function &notificationCategoryInfo()

Replaces function &notificationCategoryInfo()

Get an associative array of info for a particular notification category in the selected module. If no category is selected, return an array of info for all categories.

Parameters

$category_name
$name Category name (default all categories)
$module_id
ID of the module (default current module)

Returns

mixed
public static mixed &
# commentCategoryInfo( integer $module_id = null )

Replaces function &notificationCommentCategoryInfo()

Replaces function &notificationCommentCategoryInfo()

Get associative array of info for the category to which comment events belong.

Parameters

$module_id
ID of the module (default current module)

Returns

mixed
Associative array of category info
public static mixed &
# categoryEvents( string $category_name, boolean $enabled_only, integer $module_id = null )

Replaces function &notificationEvents()

Replaces function &notificationEvents()

Get an array of info for all events (each event has associative array) in the selected category of the selected module.

Parameters

$category_name
Category name
$enabled_only
If true, return only enabled events
$module_id
ID of the module (default current module)

Returns

mixed
public static boolean
# eventEnabled( array & $category, array & $event, object & $module )

Replaces function notificationEventEnabled()

Replaces function notificationEventEnabled()

Determine whether a particular notification event is enabled. Depends on module config options.

Parameters

$category
Category info array
$event
Event info array
$module
Module

Returns

boolean
public static mixed &
# eventInfo( string $category_name, string $event_name, integer $module_id = null )

Replaces function &notificationEventInfo()

Replaces function &notificationEventInfo()

Get associative array of info for the selected event in the selected category (for the selected module).

Parameters

$category_name
Notification category
$event_name
Notification event
$module_id
ID of the module (default current module)

Returns

mixed
public static mixed &
# subscribableCategoryInfo( integer $module_id = null )

Replaces function &notificationSubscribableCategoryInfo()

Replaces function &notificationSubscribableCategoryInfo()

Get an array of associative info arrays for subscribable categories for the selected module.

Parameters

$module_id
ID of the module

Returns

mixed
public static
# generateConfig( array & $category, array & $event, string $type )

Replaces function notificationGenerateConfig()

Replaces function notificationGenerateConfig()

Generate module config info for a particular category, event pair. The selectable config options are given names depending on the category and event names, and the text depends on the category and event titles. These are pieced together in this function in case we wish to alter the syntax.

Parameters

$category
Array of category info
$event
Array of event info
$type

The particular name to generate return string

Methods inherited from icms_core_ObjectHandler
__construct()
Properties inherited from icms_core_ObjectHandler
$db
API documentation generated by ApiGen