subscriptionsManager Class Reference

Inheritance diagram for subscriptionsManager:

Inheritance graph
[legend]
Collaboration diagram for subscriptionsManager:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 subscriptionsManager ()
 load ()
 save ()
 isSubscribed ($username, $globalID)
 parentSubscribed ($username, $globalID)
 subscribe ($username, $globalID, $subscriptiontype="email")
 unsubscribe ($username, $globalID, $subscriptiontype="")
 unsubscribeAll ($username)
 listUserSubscriptions ($username)
 renameGlobalID ($renameFrom, $renameTo)
 removeGlobalID ($globalID, $notify=false)
 listSubscribers ($globalID)
 notifySubscribers ($globalID, $subject, $message)
 handle ($globalID, $owner, $viewLevel, $subject="", $message="")
 renderSubscribeControl ($globalID, $dataOnly=false, $extraClass="")

Public Attributes

 $filename = ""
 $updatesFilename = ""


Detailed Description

The subscription handler

Global IDs should be in the form contenttype/internalID/internalSubID

For example: discuss/sectionID/forumID/threadID gallery/galleryname/subgalleryname/imagename gallery/galleryname/subgalleryname user/username user/username/blog

This format is used to see, if a parent is subscribed to, and reacted to in the renderSubscribeControl function

Definition at line 54 of file messages.php.


Member Function Documentation

subscriptionsManager::subscriptionsManager (  ) 

The subscriptionsManager constructor

Definition at line 65 of file messages.php.

References $setup_folder, currentUser(), load(), subscribe(), and unsubscribe().

Here is the call graph for this function:

subscriptionsManager::load (  ) 

Definition at line 83 of file messages.php.

References $subscriptions, and $updates.

Referenced by handle(), renameGlobalID(), subscribe(), and subscriptionsManager().

subscriptionsManager::save (  ) 

Saves the subscriptions

Returns:
bool Wether the subscriptions were saved successfully

Definition at line 107 of file messages.php.

References array_export().

Referenced by handle(), removeGlobalID(), renameGlobalID(), subscribe(), unsubscribe(), and unsubscribeAll().

Here is the call graph for this function:

subscriptionsManager::isSubscribed ( username,
globalID 
)

Checks wether the user is subscribed to a globalID

Parameters:
username The user id to check subscription for
globalID The globalID to check subscription for
Returns:
bool Wether the user is subscribed

Definition at line 130 of file messages.php.

Referenced by parentSubscribed(), and renderSubscribeControl().

subscriptionsManager::parentSubscribed ( username,
globalID 
)

Check wether the user is subscribed to the parent

Parameters:
username The user id of the user to check
globalID The globalID to check the parent of
Returns:
bool Returns true if the parent is subscribed to

Definition at line 147 of file messages.php.

References isSubscribed().

Referenced by notifySubscribers(), and renderSubscribeControl().

Here is the call graph for this function:

subscriptionsManager::subscribe ( username,
globalID,
subscriptiontype = "email" 
)

Subscribe the user username to an item with the global ID globalID

Parameters:
username The user id of the user who wishes to subscribe
globalID The global ID of the item the user wishes to subscribe to
subscriptiontype Optional. The type of subscription. If nothing is defined, default is email subscription
Returns:
bool Wether the subscription succeeded or not

Definition at line 168 of file messages.php.

References load(), lockableClass::lock(), save(), and lockableClass::unlock().

Referenced by subscriptionsManager().

Here is the call graph for this function:

subscriptionsManager::unsubscribe ( username,
globalID,
subscriptiontype = "" 
)

Removes the user username's subscription to an item with the global ID globalID

Parameters:
username The user id of the user who wishes to unsubscribe
globalID The global ID of the item the user wishes to subscribe to
subscriptiontype The type of subscription. If undefined, all subscriptions for this user will be removed for this globalID
Returns:
bool Wether the information was successfully unsubscribed

Definition at line 191 of file messages.php.

References lockableClass::lock(), save(), and lockableClass::unlock().

Referenced by subscriptionsManager().

Here is the call graph for this function:

subscriptionsManager::unsubscribeAll ( username  ) 

Clears all subscriptions from user username

Parameters:
username The username you wish to remove all subscriptions from
Returns:
bool Wether

Definition at line 220 of file messages.php.

References lockableClass::lock(), save(), and lockableClass::unlock().

Here is the call graph for this function:

subscriptionsManager::listUserSubscriptions ( username  ) 

Lists all subscriptions for the user username

Parameters:
username The user id of the user you wish to receive a list of subscriptions for
Returns:
array An array containing the global IDs for all the user username's subscribed items, in the format [globalID][subscriptiontype]

Definition at line 243 of file messages.php.

subscriptionsManager::renameGlobalID ( renameFrom,
renameTo 
)

Renames a globalID

Parameters:
renameFrom The existing globalID name
renameTo The new name of the global ID
Returns:
bool Wether the renaming was successful

Definition at line 269 of file messages.php.

References load(), lockableClass::lock(), save(), and lockableClass::unlock().

Here is the call graph for this function:

subscriptionsManager::removeGlobalID ( globalID,
notify = false 
)

Remove a globalID, optionally notifying all users of the removal

Parameters:
globalID The globalID to remove everything of
notify Wether to notify users of the removal - if it is undefined, no message is sent, otherwise, if it is a string, that string is sent as a message to all the subscribed users
Returns:
bool Wether the removal was successful

Definition at line 301 of file messages.php.

References i18n(), lockableClass::lock(), save(), sendMessage(), and lockableClass::unlock().

Here is the call graph for this function:

subscriptionsManager::listSubscribers ( globalID  ) 

Lists all users subscribed to an item with the global ID globalID

Parameters:
globalID The global ID of the item you want all the users subscribed to
Returns:
array An array containing all the usernames of the users subscribed to the item with the global ID globalID

Definition at line 334 of file messages.php.

subscriptionsManager::notifySubscribers ( globalID,
subject,
message 
)

Sends a message to all users subscribed to an item with the global ID globalID This function should not be used, in stead use the handle function

Parameters:
globalID The globalID to notify users of
subject The subject of the message you are sending
message The message to give to the users
Returns:
bool Wether the message was sent or not

Definition at line 357 of file messages.php.

References $message, parentSubscribed(), and sendMessage().

Referenced by handle().

Here is the call graph for this function:

subscriptionsManager::handle ( globalID,
owner,
viewLevel,
subject = "",
message = "" 
)

An event occured on the global ID globalID, optionally containing a subject and message

Parameters:
globalID The global ID of the item that has had an event occur
owner Who owns the data being processed
viewLevel Who does the owner allow to view the data
subject Optional. The subject of the message to send about the globalID
message Optional. The message body
Returns:
bool Wether or not the messages were sent successfully

Definition at line 389 of file messages.php.

References $message, formatTime(), i18n(), load(), lockableClass::lock(), notifySubscribers(), save(), and lockableClass::unlock().

Here is the call graph for this function:

subscriptionsManager::renderSubscribeControl ( globalID,
dataOnly = false,
extraClass = "" 
)

Renders the command link for subscribing to a global ID

Parameters:
globalID The global ID of the item to show a subscription command link for
dataOnly Optional, If true, return only the title, description and url in an array This is used for example for making tabbar commands
extraClass Optional, Extra classes to add to the command
Returns:
mixed A string containing the rendered control, or an array containing the information

Definition at line 431 of file messages.php.

References currentUser(), drawCommand(), i18n(), isSubscribed(), parentSubscribed(), and thisPageURL().

Here is the call graph for this function:


Member Data Documentation

subscriptionsManager::$filename = ""

Definition at line 59 of file messages.php.

subscriptionsManager::$updatesFilename = ""

Definition at line 60 of file messages.php.


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

Generated on Sun Oct 26 20:33:15 2008 for The Travelsized Content Management System by  doxygen 1.5.5