Beispiel #1
0
 static function anchor($module, $controller = '', $action = '', $parameters = array())
 {
     global $cuSettings;
     if ($module == '') {
         return null;
     }
     $url = XOOPS_URL;
     $paths = isset($cuSettings->modules_path) ? $cuSettings->modules_path : array();
     $path = isset($paths[$module]) ? $paths[$module] : '/' . $module;
     if (defined('XOOPS_CPFUNC_LOADED')) {
         if ($cuSettings->permalinks && isset($paths[$module])) {
             $url .= '/admin' . $path;
         } else {
             $objModule = XoopsModule::getByDirName($module);
             $url .= '/modules/' . $module . '/' . $objModule->getInfo('adminindex');
         }
     } else {
         $url .= $cuSettings->permalinks ? $path : '/modules/' . $module;
     }
     if ($controller == '') {
         return $url;
     }
     $url .= $cuSettings->permalinks ? '/' . $controller . '/' : '/' . $controller . '/';
     $url .= $action != '' ? $action . '/' : '';
     $query = '';
     foreach ($parameters as $name => $value) {
         $query .= $name . '/' . urlencode($value) . '/';
     }
     return $url . $query;
 }
Beispiel #2
0
// System module menu
$mod = RMModules::load_module('system');
$system_menu = array('name' => $mod->getVar('name'), 'directory' => $mod->getVar('dirname'), 'menu' => $xoFunc->moduleMenu('system'), 'native' => $mod->getInfo('rmnative'), 'rewrite' => $mod->getInfo('rewrite'));
// Current Module Menu
$currentModule = array('name' => $xoopsModule->getVar('name'), 'directory' => $xoopsModule->getVar('dirname'), 'menu' => $xoFunc->moduleMenu($xoopsModule->getVar('dirname')), 'native' => $xoopsModule->getInfo('rmnative'), 'rewrite' => $xoopsModule->getInfo('rewrite'));
$currentModule = (object) $currentModule;
/**
 * Load modules and their menus
 */
$modulesList = \XoopsLists::getModulesList();
$activeModules = array();
foreach ($modulesList as $item) {
    if ($item == 'rmcommon' || $item == 'system' || $item == $xoopsModule->getVar('dirname')) {
        continue;
    }
    if (false == ($module = \XoopsModule::getByDirName($item))) {
        continue;
    }
    if (!$module->getVar('isactive')) {
        continue;
    }
    $activeModules[] = (object) array('name' => $module->getVar('name'), 'directory' => $module->getVar('dirname'), 'menu' => $module->getAdminMenu(), 'native' => $module->getInfo('rmnative'), 'rewrite' => $module->getInfo('rewrite'), 'icon' => false === $module->getInfo('icon') ? XOOPS_URL . '/modules/' . $module->getInfo('dirname') . '/' . $module->getInfo('image') : $module->getInfo('icon'));
}
// Other Menus
$other_menu = RMEvents::get()->run_event('helium.other.menu');
// Left Widgets
$left_widgets = array();
$left_widgets = RMEvents::get()->run_event('rmcommon.load.left.widgets', $left_widgets);
// Right widgets
$right_widgets = array();
$right_widgets = RMEvents::get()->run_event('rmcommon.load.right.widgets', $right_widgets);