1: <?php
2: /*
3: You may not change or alter any portion of this comment or credits
4: of supporting developers from this source code or any supporting source code
5: which is considered copyrighted (c) material of the original comment or credit authors.
6:
7: This program is distributed in the hope that it will be useful,
8: but WITHOUT ANY WARRANTY; without even the implied warranty of
9: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: */
11:
12: /**
13: * @copyright XOOPS Project (http://xoops.org)
14: * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
15: * @author trabis <lusopoemas@gmail.com>
16: * @version $Id$
17: */
18:
19: interface NotificationsPluginInterface
20: {
21: /**
22: * @param string $category
23: * @param int $itemId
24: * expects an array containing:
25: * name, Name of the Item
26: * url, Url of the Item
27: *
28: * @return array
29: */
30: public function item($category, $itemId);
31:
32: /**
33: * Expects array of arrays containing:
34: *
35: * 'name' => 'thread';
36: * 'title' => _MI_NEWBB_THREAD_NOTIFY;
37: * 'description' => _MI_NEWBB_THREAD_NOTIFYDSC;
38: * 'subscribe_from' => 'viewtopic.php';
39: * 'item_name' => 'topic_id';
40: * 'allow_bookmark' => 1;
41: *
42: * name: the name of the category
43: * title: the title of the category (use language strings)
44: * description: a description of the category (use language strings)
45: * subscribe_from: an array of all scripts where user is permitted to subscribe(Use '*' for all scripts. Omit this line for no scripts.
46: * Note: you would specify no scripts only if your module provides other ways for users to subscribe, e.g. custom checkboxes within forms.)
47: * item_name: the HTTP //get// parameter to watch, which specifies the ID of the specific item in the category (e.g. forum ID or thread ID).
48: * If set, the //get// parameter must be submitted via HTTP call, otherwise, the notification categories remain hidden.
49: * allow_bookmark: set to 1 if you want the system to allow this item to be bookmarked by users
50: *
51: * @return array
52: */
53: public function categories();
54:
55: /**
56: * Expects array of arrays containing:
57: *
58: * 'name' => 'new_post';
59: * 'category' => 'thread';
60: * 'title' => _MI_NEWBB_THREAD_NEWPOST_NOTIFY;
61: * 'caption' => _MI_NEWBB_THREAD_NEWPOST_NOTIFYCAP;
62: * 'description' => _MI_NEWBB_THREAD_NEWPOST_NOTIFYDSC;
63: * 'mail_template' => 'thread_newpost_notify';
64: * 'mail_subject' => _MI_NEWBB_THREAD_NEWPOST_NOTIFYSBJ;
65: *
66: * name: the name of the event
67: * category: the category of the event
68: * title: title of event (use language strings)
69: * caption: description in form "Notify me when..." (use language strings)
70: * description: description of event (use language strings)
71: * mail_template: mail template in ##language/<language>/mail_template## directory of module (omit the '.tpl' suffix)
72: * mail_subject: subject of email (use language strings)
73: *
74: * The following are optional:
75: * admin_only: set to 1 if you wish the event to be visible only to module administrators
76: * invisible: set to 1 if you wish the event to be invisible... i.e. won't show up in module preferences or in notification blocks.
77: * It is used for 'custom' notifications: e.g. in 'mylinks', you can sign up (on the submit form)
78: * for a one-time notification when your link submission is approved. The 'approve' event is invisible.
79: *
80: * @return array
81: */
82: public function events();
83:
84: /**
85: * Expects array containing tags to use in mail template
86: *
87: * ex: return array('X_SOME_NEW_TAG' => 'Some New Content');
88: * note: Using tags is optional, you can return an empty array if you like
89: *
90: * @param string $category
91: * @param int $item_id
92: * @param string $event
93: *
94: * @return mixed
95: */
96: public function tags($category, $item_id, $event);
97: }
98:
99: