/[drupal]/contributions/modules/notifications/API.txt
ViewVC logotype

Contents of /contributions/modules/notifications/API.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Sat Jan 26 12:57:38 2008 UTC (22 months ago) by jareyero
Branch: MAIN
CVS Tags: DRUPAL-5--1-0-ALPHA1, DRUPAL-5--1-0-ALPHA2, HEAD
Branch point for: DRUPAL-5
File MIME type: text/plain
New modules/features and multiple fixes
- Added notifications_feed, integration with FeedAPI
- Added raw node body and teaser to tokens.
- Added generic access checking for subscriptions/events
- Added access control for nodes and comments
- Added reset queue option.Removed run queue debug option.
- Fixed group user subscriptions page. To be improved
- Fixed bug in notifications_content:notifications:'event load'
- Added: node links can now handle other event_types than 'node', I.e. 'feed'
- Multiple changes in notifications.admin.inc. Moved functions around.
- Added generic form for user subscriptions. Will replace some notifications_content forms
- Added support for message customization for event types
- Reworked displayed tokens for message configuration
- Implemented hook_messaging() in notifications_content()
In sync with latest messaging commits.
1 Developer doocumentation for subscriptions framework.
2
3 [TO DO]
4
5 The notifications hook
6 ----------------------
7 This hook must be implemented by modules defining event and subscription types
8
9 function hook_notifications($op, &$arg0 = NULL, $arg1 = NULL, $arg2 = NULL)
10
11 Depending on the first parameter, this function will have different parameters and return values
12
13 * 'names', Adds names to the subscriptions types for display
14 $arg1 will be a $subscriptions object.
15 It should populate the 'type_name' and the 'names' elements for subscriptions handled by the module
16 implementing it. A single subscription may join different conditions so we keep multiple names
17 in the 'names' element array.
18
19 Example:
20 $subs = &$arg0;
21 if ($subs->event_type == 'node') {
22 $subs->type_name = t('Content');
23 if (!empty($subs->fields['type'])) {
24 $subs->names['type'] = t('Content type: %type', array('%type' => node_get_types('name', $subs->fields['type'])));
25 }
26 if (!empty($subs->fields['author'])) {
27 $author = user_load(array('uid' => $subs->fields['author']));
28 $subs->names['author'] = t('Author: %name', array('%name' => $author->name));
29 }
30 }
31
32 * 'subscription types', Defines subscription types provided by this module
33 The return value will be an array of elements with the form:
34 'type name' => array(
35 'event_type' => type of event,
36 'title' => Name to display to the user,
37 'access' => Permission for using this subscription type,
38 'page' => Callback to display the user subscriptions page,
39 'fields' => Array of fields that define this subscription type. I.e. for node subscriptions,
40 )
41
42 Example:
43 $types['thread'] = array(
44 'event_type' => 'node',
45 'title' => t('Threads'),
46 'access' => 'subscribe to content',
47 'page' => 'notifications_content_page_thread',
48 'fields' => array('nid'),
49 );
50
51 * 'query', Returns query conditions for finding subscribed users
52
53 Example:
54 $query[] = array(
55 'fields' => array(
56 'nid' => $node->nid,
57 'type' => $node->type,
58 'author' => $node->uid,
59 ),
60 );
61
62 - 'event types', Event types supported by this module
63 - 'event load', Add objects to the event for message composing
64 - 'node options', Returns subscriptions status and options for a node object
65 See
66 - notifications_content_notifications()
67 - notifications_taxonomy_notifications()

  ViewVC Help
Powered by ViewVC 1.1.2