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 = "" |
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.
subscriptionsManager::subscriptionsManager | ( | ) |
The subscriptionsManager constructor
Definition at line 65 of file messages.php.
References $setup_folder, currentUser(), load(), subscribe(), and unsubscribe().
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
Definition at line 107 of file messages.php.
References array_export().
Referenced by handle(), removeGlobalID(), renameGlobalID(), subscribe(), unsubscribe(), and unsubscribeAll().
subscriptionsManager::isSubscribed | ( | $ | username, | |
$ | globalID | |||
) |
Checks wether the user is subscribed to a globalID
username | The user id to check subscription for | |
globalID | The globalID to check subscription for |
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
username | The user id of the user to check | |
globalID | The globalID to check the parent of |
Definition at line 147 of file messages.php.
References isSubscribed().
Referenced by notifySubscribers(), and renderSubscribeControl().
subscriptionsManager::subscribe | ( | $ | username, | |
$ | globalID, | |||
$ | subscriptiontype = "email" | |||
) |
Subscribe the user username to an item with the global ID globalID
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 |
Definition at line 168 of file messages.php.
References load(), lockableClass::lock(), save(), and lockableClass::unlock().
Referenced by subscriptionsManager().
subscriptionsManager::unsubscribe | ( | $ | username, | |
$ | globalID, | |||
$ | subscriptiontype = "" | |||
) |
Removes the user username's subscription to an item with the global ID globalID
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 |
Definition at line 191 of file messages.php.
References lockableClass::lock(), save(), and lockableClass::unlock().
Referenced by subscriptionsManager().
subscriptionsManager::unsubscribeAll | ( | $ | username | ) |
Clears all subscriptions from user username
username | The username you wish to remove all subscriptions from |
Definition at line 220 of file messages.php.
References lockableClass::lock(), save(), and lockableClass::unlock().
subscriptionsManager::listUserSubscriptions | ( | $ | username | ) |
Lists all subscriptions for the user username
username | The user id of the user you wish to receive a list of subscriptions for |
Definition at line 243 of file messages.php.
subscriptionsManager::renameGlobalID | ( | $ | renameFrom, | |
$ | renameTo | |||
) |
Renames a globalID
renameFrom | The existing globalID name | |
renameTo | The new name of the global ID |
Definition at line 269 of file messages.php.
References load(), lockableClass::lock(), save(), and lockableClass::unlock().
subscriptionsManager::removeGlobalID | ( | $ | globalID, | |
$ | notify = false | |||
) |
Remove a globalID, optionally notifying all users of the removal
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 |
Definition at line 301 of file messages.php.
References i18n(), lockableClass::lock(), save(), sendMessage(), and lockableClass::unlock().
subscriptionsManager::listSubscribers | ( | $ | globalID | ) |
Lists all users subscribed to an item with the global ID globalID
globalID | The global ID of the item you want all the users subscribed to |
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
globalID | The globalID to notify users of | |
subject | The subject of the message you are sending | |
message | The message to give to the users |
Definition at line 357 of file messages.php.
References $message, parentSubscribed(), and sendMessage().
Referenced by handle().
subscriptionsManager::handle | ( | $ | globalID, | |
$ | owner, | |||
$ | viewLevel, | |||
$ | subject = "" , |
|||
$ | message = "" | |||
) |
An event occured on the global ID globalID, optionally containing a subject and message
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 |
Definition at line 389 of file messages.php.
References $message, formatTime(), i18n(), load(), lockableClass::lock(), notifySubscribers(), save(), and lockableClass::unlock().
subscriptionsManager::renderSubscribeControl | ( | $ | globalID, | |
$ | dataOnly = false , |
|||
$ | extraClass = "" | |||
) |
Renders the command link for subscribing to a global ID
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 |
Definition at line 431 of file messages.php.
References currentUser(), drawCommand(), i18n(), isSubscribed(), parentSubscribed(), and thisPageURL().
subscriptionsManager::$filename = "" |
Definition at line 59 of file messages.php.
subscriptionsManager::$updatesFilename = "" |
Definition at line 60 of file messages.php.