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 CommentsPluginInterface
20: {
21: /**
22: * You must return the unique identifier for the item
23: * ex: return 'itemid';
24: *
25: * @return string
26: */
27: public function itemName();
28:
29: /**
30: * You must return the page where the comment form is displayed
31: * ex: return 'item.php';
32: *
33: * @return string
34: */
35: public function pageName();
36:
37: /**
38: * @return array
39: */
40: public function extraParams();
41:
42: /**
43: * This method will be executed upon successful post of an approved comment.
44: * This includes comment posts by administrators, and change of comment status from 'pending' to 'active' state.
45: * An CommentsComment object that has been approved will be passed as the first and only parameter.
46: * This should be useful for example notifying the item submitter of a comment post.
47: *
48: * @param CommentsComment $comment
49: *
50: * @return void
51: */
52: public function approve(CommentsComment $comment);
53:
54: /**
55: * This method will be executed whenever the total number of 'active' comments for an item is changed.
56: *
57: * @param int $item_id The unique ID of an item
58: * @param int $total_num The total number of active comments
59: *
60: * @return void
61: */
62: public function update($item_id, $total_num);
63:
64: /**
65: * This method will be executed whenever a new comment form is displayed.
66: * You can set a default title for the comment and a header to be displayed on top of the form
67: * ex: return array(
68: * 'title' => 'My Article Title',
69: * 'text' => 'Content of the article');
70: * 'timestamp' => time(); //Date of the article in unix format
71: * 'uid' => Id of the article author
72: *
73: * @param int $item_id The unique ID of an item
74: *
75: * @return array
76: */
77: public function itemInfo($item_id);
78:
79: }
80:
81: