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: * @package Class
16: * @subpackage Utils
17: * @since 1.0
18: * @author trabis <lusopoemas@gmail.com>
19: * @version $Id$
20: */
21:
22: class CodexMenusPlugin extends Xoops\Module\Plugin\PluginAbstract implements MenusPluginInterface
23: {
24: /**
25: * expects an array of array containing:
26: * name, Name of the submenu
27: * url, Url of the submenu relative to the module
28: * ex: return array(0 => array(
29: * 'name' => _MI_PUBLISHER_SUB_SMNAME3;
30: * 'url' => "search.php";
31: * ));
32: *
33: * @return array
34: */
35: public function subMenus()
36: {
37: $xoops = Xoops::getInstance();
38: $ret = array();
39: $files = \Xoops\Core\Lists\File::getList($xoops->path('modules/codex/'));
40: $i = 0;
41: foreach ($files as $file) {
42: if (!in_array($file, array('xoops_version.php', 'index.php'))) {
43: $fileName = ucfirst(str_replace('.php', '', $file));
44: $ret[$i]['name'] = $fileName;
45: $ret[$i]['url'] = $file;
46: ++$i;
47: }
48: }
49:
50: return $ret;
51: }
52: }
53: