本文整理汇总了PHP中XoopsModule::getByDirName方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsModule::getByDirName方法的具体用法?PHP XoopsModule::getByDirName怎么用?PHP XoopsModule::getByDirName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsModule
的用法示例。
在下文中一共展示了XoopsModule::getByDirName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: anchor
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;
}
示例2: array
// 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);