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: * Publisher class
14: *
15: * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/
16: * @license GNU GPL V2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
17: * @package Class
18: * @subpackage Utils
19: * @since 1.0
20: * @author trabis <lusopoemas@gmail.com>
21: * @version $Id$
22: */
23:
24: class PublisherMenusPlugin extends Xoops\Module\Plugin\PluginAbstract implements MenusPluginInterface
25: {
26: /**
27: * expects an array of array containing:
28: * name, Name of the submenu
29: * url, Url of the submenu relative to the module
30: * ex: return array(0 => array(
31: * 'name' => _MI_PUBLISHER_SUB_SMNAME3;
32: * 'url' => "search.php";
33: * ));
34: *
35: * @return array
36: */
37: public function subMenus()
38: {
39: $ret = array();
40: $helper = Publisher::getInstance();
41:
42: // Add the Submit new item button
43: if ($helper->isUserAdmin() || ($helper->getConfig('perm_submit') && ($helper->xoops()->isUser() || $helper->getConfig('permissions_anon_post')))) {
44: $ret[] = array(
45: 'name' => _MI_PUBLISHER_SUB_SMNAME1,
46: 'url' => "submit.php?op=add",
47: );
48: }
49:
50: // DISABLED since the internal search doesn't work
51: // Add the Search button
52: if (false && $helper->getConfig('perm_search')) {
53: $ret[] = array(
54: 'name' => _MI_PUBLISHER_SUB_SMNAME3,
55: 'url' => "search.php",
56: );
57: }
58:
59: // Add the Archive button
60: $ret[] = array(
61: 'name' => _MI_PUBLISHER_SUB_ARCHIVE,
62: 'url' => "archive.php",
63: );
64: return $ret;
65: }
66: }
67: