XOOPS  2.6.0
main.php
Go to the documentation of this file.
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 
14 
26 {
28  $block = array();
29  $block['lang_home'] = XoopsLocale::HOME;
30  $block['lang_close'] = XoopsLocale::A_CLOSE;
31  $module_handler = $xoops->getHandlerModule();
32  $criteria = new CriteriaCompo(new Criteria('hasmain', 1));
33  $criteria->add(new Criteria('isactive', 1));
34  $criteria->add(new Criteria('weight', 0, '>'));
35  $modules = $module_handler->getObjectsArray($criteria, true);
36  $moduleperm_handler = $xoops->getHandlerGroupperm();
37  $groups = $xoops->getUserGroups();
38  $read_allowed = $moduleperm_handler->getItemIds('module_read', $groups);
39  /* @var $module XoopsModule */
40  foreach ($modules as $i => $module) {
41  if (in_array($i, $read_allowed)) {
42  $block['modules'][$i]['name'] = $module->getVar('name');
43  $block['modules'][$i]['dirname'] = $module->getVar('dirname');
44  if (XoopsLoad::fileExists($xoops->path('modules/' . $module->getVar('dirname') . '/icons/logo_small.png'))) {
45  $block['modules'][$i]['image'] = $xoops->url('modules/' . $module->getVar('dirname') . '/icons/logo_small.png');
46  }
47  if ($xoops->isModule() && ($i == $xoops->module->getVar('mid'))) {
48  $block['modules'][$i]['highlight'] = true;
49  $block['nothome'] = true;
50  }
51  if ($xoops->module && ($i == $xoops->module->getVar('mid'))) {
52  $block['modules'][$i]['highlight'] = true;
53  $block['nothome'] = true;
54  }
55  /* @var $plugin MenusPluginInterface */
56  if ($xoops->isModule() && $module->getVar('dirname') == $xoops->module->getVar('dirname') && $plugin = \Xoops\Module\Plugin::getPlugin($module->getVar('dirname'), 'menus')) {
57  $sublinks = $plugin->subMenus();
58  foreach ($sublinks as $sublink) {
59  $block['modules'][$i]['sublinks'][] = array(
60  'name' => $sublink['name'],
61  'url' => \XoopsBaseConfig::get('url') . '/modules/' . $module->getVar('dirname') . '/' . $sublink['url']
62  );
63  }
64  }
65 
66  }
67  }
68  return $block;
69 }
70 
72 {
76  $admin_page = new \Xoops\Module\Admin();
77 
78  // Define Stylesheet
79  $xoops->theme()->addStylesheet('media/xoops/css/icons.css');
80  $xoops->theme()->addStylesheet('modules/system/css/admin.css');
81  // Define scripts
82  $xoops->theme()->addScript('media/jquery/plugins/jquery.jeditable.js');
83  $xoops->theme()->addScript('modules/system/js/module.js');
84 
86  $admin_page->renderTips();
87  $list = $system_module->getModuleList();
88  $xoops->tpl()->assign('modules_list', $list);
89  return $xoops->tpl()->fetch('admin:system/system_modules_menu.tpl');
90 }
$i
Definition: dialog.php:68
$system
Definition: main.php:26
static getInstance()
Definition: system.php:46
static getInstance()
Definition: Xoops.php:160
b_system_main_edit($options)
Definition: main.php:71
$read_allowed
Definition: userinfo.php:188
$options['editor']
$admin_page
Definition: main.php:34
const MENU_TIPS
Definition: en_US.php:339
const A_CLOSE
Definition: en_US.php:87
static fileExists($file)
Definition: xoopsload.php:506
static get($name)
$module
Definition: main.php:52
b_system_main_show()
Definition: main.php:25
$groups
$modules
Definition: userinfo.php:185
$criteria
$module_handler
Definition: main.php:55
$xoops
Definition: main.php:25
$moduleperm_handler
Definition: cp_header.php:31