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 V2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
15: * @author Laurent JEN (aka DuGris)
16: * @version $Id$
17: */
18:
19: class PublisherSystemPlugin extends Xoops\Module\Plugin\PluginAbstract implements SystemPluginInterface
20: {
21: /**
22: * @param int $uid
23: *
24: * @return int
25: */
26: public function userPosts($uid)
27: {
28: $criteria = new CriteriaCompo();
29: $criteria->add(new Criteria('status', 2));
30: $criteria->add(new Criteria('uid', (int)$uid));
31: return Publisher::getInstance()->getItemHandler()->getCount($criteria);
32: }
33:
34: /**
35: * @return array
36: */
37: public function waiting()
38: {
39: $publisher = Publisher::getInstance();
40: $ret = array();
41: $criteria = new CriteriaCompo();
42: $criteria->add(new Criteria('status', 1));
43: $count = $publisher->getItemHandler()->getCount($criteria);
44: if ($count) {
45: $ret['count'] = $count;
46: $ret['name'] = _MI_PUBLISHER_WAITING;
47: $ret['link'] = $publisher->url('admin/item.php');
48: }
49: return $ret;
50: }
51:
52: /**
53: * Used to populate backend
54: *
55: * @param int $limit : Number of item for backend
56: * Expects an array containing:
57: * title : Title for the backend items
58: * link : Link for the backend items
59: * content : content for the backend items
60: * date : Date of the backend items
61: *
62: * @return array
63: */
64: public function backend($limit)
65: {
66: // TODO: Implement backend() method.
67: }
68:
69: /**
70: * Used to populate the User Block
71: * Expects an array containing:
72: * name : Name for the Link
73: * link : Link relative to module
74: * image : Url of image to display, please use 16px*16px image
75: *
76: * @return array
77: */
78: public function userMenus()
79: {
80: // TODO: Implement userMenus() method.
81: }
82: }
83: