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 The XUUPS Project http://sourceforge.net/projects/xuups/
14: * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
15: * @since 1.0
16: * @author trabis <lusopoemas@gmail.com>
17: * @version $Id$
18: */
19:
20: class UserconfigsMenusPlugin extends Xoops\Module\Plugin\PluginAbstract implements MenusPluginInterface
21: {
22: /**
23: * expects an array of array containing:
24: * name, Name of the submenu
25: * url, Url of the submenu relative to the module
26: * ex: return array(0 => array(
27: * 'name' => _MI_PUBLISHER_SUB_SMNAME3;
28: * 'url' => "search.php";
29: * ));
30: *
31: * @return array
32: */
33: public function subMenus()
34: {
35: $ret = array();
36: $xoops = \Xoops::getInstance();
37: if ($plugins = \Xoops\Module\Plugin::getPlugins('userconfigs')) {
38: foreach (array_keys($plugins) as $dirname) {
39: $mHelper = $xoops->getModuleHelper($dirname);
40: $ret[$dirname]['name'] = $mHelper->getModule()->getVar('name');
41: $ret[$dirname]['url'] = 'index.php?op=showmod&mid=' . $mHelper->getModule()->getVar('mid');
42: }
43: }
44:
45: return $ret;
46: }
47: }
48: