本文整理汇总了PHP中XoopsModule::dirname方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsModule::dirname方法的具体用法?PHP XoopsModule::dirname怎么用?PHP XoopsModule::dirname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsModule
的用法示例。
在下文中一共展示了XoopsModule::dirname方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_modules_list
function show_modules_list()
{
global $xoopsSecurity;
$installed_modules = array();
$limit = rmc_server_var($_SESSION, 'mods_limit', 4);
include_once XOOPS_ROOT_PATH . '/kernel/module.php';
$db = XoopsDatabaseFactory::getDatabaseConnection();
$sql = "SELECT * FROM " . $db->prefix("modules") . " ORDER BY `name`";
$result = $db->query($sql);
$installed_dirs = array();
while ($row = $db->fetchArray($result)) {
$mod = new XoopsModule();
$mod->assignVars($row);
$installed_dirs[] = $mod->dirname();
if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $mod->getVar('dirname') . '/class/' . strtolower($mod->getVar('dirname') . 'controller') . '.php')) {
include_once XOOPS_ROOT_PATH . '/modules/' . $mod->getVar('dirname') . '/class/' . strtolower($mod->getVar('dirname') . 'controller') . '.php';
$class = ucfirst($mod->getVar('dirname')) . 'Controller';
$class = new $class();
if (method_exists($class, 'get_main_link')) {
$main_link = $class->get_main_link();
} else {
if ($mod->getVar('hasmain')) {
$main_link = XOOPS_URL . '/modules/' . $mod->dirname();
} else {
$main_link = "#";
}
}
} else {
if ($mod->getVar('hasmain')) {
$main_link = XOOPS_URL . '/modules/' . $mod->dirname();
} else {
$main_link = "#";
}
}
// Admin section
$admin_link = $mod->getVar('hasadmin') ? XOOPS_URL . '/modules/' . $mod->dirname() . '/' . $mod->getInfo('adminindex') : '';
$modules[] = array('id' => $mod->getVar('mid'), 'name' => $mod->getVar('name'), 'realname' => $mod->getInfo('name'), 'version' => $mod->getInfo('rmnative') ? RMUtilities::format_version($mod->getInfo('rmversion')) : $mod->getInfo('version'), 'description' => $mod->getInfo('description'), 'icon' => XOOPS_URL . '/modules/' . $mod->getVar('dirname') . '/' . ($mod->getInfo('icon48') ? $mod->getInfo('icon48') : $mod->getInfo('image')), 'image' => XOOPS_URL . '/modules/' . $mod->getVar('dirname') . '/' . $mod->getInfo('image'), 'link' => $main_link, 'admin_link' => $admin_link, 'updated' => formatTimestamp($mod->getVar('last_update'), 's'), 'author' => $mod->getInfo('author'), 'author_mail' => $mod->getInfo('authormail'), 'author_web' => $mod->getInfo('authorweb'), 'author_url' => $mod->getInfo('authorurl'), 'license' => $mod->getInfo('license'), 'dirname' => $mod->getInfo('dirname'), 'active' => $mod->getVar('isactive'), 'help' => $mod->getInfo('help'));
}
// Event for installed modules
$modules = RMEvents::get()->run_event('rmcommon.installed.modules', $modules, $installed_dirs);
require_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
$dirlist = XoopsLists::getModulesList();
$available_mods = array();
$module_handler = xoops_gethandler('module');
foreach ($dirlist as $file) {
clearstatcache();
$file = trim($file);
if (!in_array($file, $installed_dirs)) {
$module =& $module_handler->create();
if (!$module->loadInfo($file, false)) {
continue;
}
$available_mods[] = $module;
unset($module);
}
}
// Event for available modules
$available_mods = RMEvents::get()->run_event('rmcommon.available.modules', $available_mods);
$GLOBALS['available_mods'] = $available_mods;
RMFunctions::create_toolbar();
RMTemplate::get()->assign('xoops_pagetitle', __('Modules Management', 'rmcommon'));
RMTemplate::get()->add_style('modules.css', 'rmcommon');
RMTemplate::get()->add_local_script('modules.js', 'rmcommon', 'include');
RMTemplate::get()->set_help('http://www.redmexico.com.mx/docs/common-utilities/uso-de-common-utilities/standalone/1/#administrador-de-modulos');
xoops_cp_header();
include RMTemplate::get()->get_template('rmc_modules.php', 'module', 'rmcommon');
xoops_cp_footer();
}
示例2: dirname
require dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))) . '/mainfile.php';
$xoopsLogger->renderingEnabled = false;
$xoopsLogger->activated = false;
/*if (!$xoopsSecurity->check()) {
die('Session token expired');
}*/
$installed_modules = array();
include_once XOOPS_ROOT_PATH . '/kernel/module.php';
$db = XoopsDatabaseFactory::getDatabaseConnection();
$sql = "SELECT * FROM " . $db->prefix("modules") . " WHERE isactive='1' ORDER BY `name`";
$result = $db->query($sql);
$installed_dirs = array();
while ($row = $db->fetchArray($result)) {
$mod = new XoopsModule();
$mod->assignVars($row);
$installed_dirs[] = $mod->dirname();
if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $mod->getVar('dirname') . '/class/' . strtolower($mod->getVar('dirname') . 'controller') . '.php')) {
include_once XOOPS_ROOT_PATH . '/modules/' . $mod->getVar('dirname') . '/class/' . strtolower($mod->getVar('dirname') . 'controller') . '.php';
$class = ucfirst($mod->getVar('dirname')) . 'Controller';
$class = new $class();
if (method_exists($class, 'get_main_link')) {
$main_link = $class->get_main_link();
} else {
if ($mod->getVar('hasmain')) {
$main_link = XOOPS_URL . '/modules/' . $mod->dirname();
} else {
$main_link = "#";
}
}
} else {
if ($mod->getVar('hasmain')) {
示例3: die
$xoopsLogger->renderingEnabled = false;
$xoopsLogger->activated = false;
if(!$xoopsSecurity->check()){
die('Session token expired');
}*/
$installed_modules = array();
include_once XOOPS_ROOT_PATH . '/kernel/module.php';
$db = XoopsDatabaseFactory::getDatabaseConnection();
$sql = "SELECT * FROM " . $db->prefix("modules") . " WHERE isactive='1' ORDER BY `name`";
$result = $db->query($sql);
$installed_dirs = array();
while ($row = $db->fetchArray($result)) {
$mod = new XoopsModule();
$mod->assignVars($row);
$installed_dirs[] = $mod->dirname();
if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $mod->getVar('dirname') . '/class/' . strtolower($mod->getVar('dirname') . 'controller') . '.php')) {
include_once XOOPS_ROOT_PATH . '/modules/' . $mod->getVar('dirname') . '/class/' . strtolower($mod->getVar('dirname') . 'controller') . '.php';
$class = ucfirst($mod->getVar('dirname')) . 'Controller';
$class = new $class();
if (method_exists($class, 'get_main_link')) {
$main_link = $class->get_main_link();
} else {
if ($mod->getVar('hasmain')) {
$main_link = XOOPS_URL . '/modules/' . $mod->dirname();
} else {
$main_link = "#";
}
}
} else {
if ($mod->getVar('hasmain')) {
示例4: array
$urls = array();
$modNames = array();
/**
* Load existing modules and fetch data to request remote server information
*/
while ($row = $xoopsDB->fetchArray($result)) {
$mod = new XoopsModule();
$mod->assignVars($row);
$info = $mod->getInfo();
if (!isset($info['rmversion'])) {
continue;
}
if (!isset($info['updateurl'])) {
continue;
}
$modNames[$mod->dirname()] = $info['name'];
$v = $info['rmversion'];
if (isset($v['major'])) {
$version = $v['major'] . '.' . $v['minor'] . '.' . $v['revision'] . '.' . $v['stage'];
} else {
$version = $v['number'] . '.' . $v['revision'] / 10 . '.' . $v['status'];
}
$urls[$mod->dirname()] = $info['updateurl'] . (strpos($info['updateurl'], '?') === false ? '?' : '&') . 'action=check&id=' . $mod->dirname() . '&version=' . $version;
}
/**
* Load remote information and fetch it
* for each module
*/
$total = 0;
$upds = array();
foreach ($urls as $dir => $url) {