function get_modules_list() { $db = XoopsDatabaseFactory::getDatabaseConnection(); $sql = 'SELECT * FROM ' . $db->prefix('modules') . " ORDER BY mid, weight"; $result = $db->query($sql); $installed_mods = array(); while ($row = $db->fetchArray($result)) { $mod = new XoopsModule(); $mod->assignVars($row); $module_icon = $mod->getInfo('icon48') != '' ? XOOPS_URL . '/modules/' . $mod->getVar('dirname') . '/' . $mod->getInfo('icon48') : ''; $module_logo = XOOPS_URL . '/modules/' . $mod->getVar('dirname') . '/' . $mod->getInfo('image'); if ($mod->hasconfig()) { $config_link = $mod->getInfo('rmnative') ? XOOPS_URL . '/modules/rmcommon/settings.php?action=configure&mod=' . $mod->mid() : XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->mid(); } $this_module = array('name' => $mod->getVar('name'), 'dirname' => $mod->getVar('dirname'), 'real_name' => $mod->getInfo('name'), 'version' => is_array($mod->getInfo('rmversion')) ? RMModules::format_module_version($mod->getInfo('rmversion')) : $mod->getVar('version') / 100, 'icon' => $module_icon, 'logo' => $module_logo, 'admin' => $mod->getVar('hasadmin') ? XOOPS_URL . '/modules/' . $mod->getVar('dirname') . '/' . $mod->getInfo('adminindex') : '', 'main' => RMUris::anchor($mod->getVar('dirname')), 'updated' => RMTimeFormatter::get()->format($mod->getVar('last_update'), __('%d% %T% %Y%', 'rmcommon')), 'config' => isset($config_link) ? $config_link : '', 'description' => $mod->getInfo('description')); $installed_mods[] = (object) $this_module; } return $installed_mods; }
?> </a> <?php } ?> </span> </td> <td> <span class="descriptions"><?php echo $plugin->get_info('description'); ?> </span> </td> <td align="center"> <strong><?php echo is_array($plugin->get_info('version')) ? RMModules::format_module_version($plugin->get_info('version')) : $plugin->get_info('version'); ?> </strong> </td> <td align="center"> <?php if ($plugin->get_info('web') != '') { ?> <strong><a href="<?php echo $plugin->get_info('web'); ?> "><?php echo $plugin->get_info('author'); ?> </a></strong> <?php
?> <?php echo $module->getInfo('name'); ?> <?php } ?> </td> </tr> <tr class="odd"> <td><strong><?php _e('Version:', 'rmcommon'); ?> </strong> <td><?php echo $module->getInfo('rmnative') ? RMModules::format_module_version($module->getInfo('rmversion')) : $module->getInfo('version'); ?> </td> </tr> <tr class="even"> <td><strong><?php _e('Author:', 'rmcommon'); ?> </strong></td> <td colspan="2"> <?php if ($module->getInfo('authorurl')) { ?> <a href="<?php echo $module->getInfo('authorurl'); ?>
function rmc_available_mods() { global $available_mods, $xoopsSecurity; $ret['title'] = __('Available Modules', 'rmcommon'); $ret['icon'] = RMCURL . '/images/modules.png'; $limit = 7; $tpages = ceil(count($available_mods) / $limit); $nav = new RMPageNav(count($available_mods), $limit, 1, 3); $nav->target_url('#" onclick="load_page({PAGE_NUM});'); ob_start(); $i = 0; ?> <div class="rmc_widget_content_reduced rmc-modules-widget"> <img id="img-load" src="images/loading.gif" style="display: none; margin: 15px auto;" /> <div id="mods-widget-container"> <ul class="list-unstyled"> <?php foreach ($available_mods as $mod) { ?> <?php if ($i == $limit) { break; } ?> <li> <div class="the-logo"> <?php if ($mod->getInfo('url') != '') { ?> <a href="modules.php?action=install&dir=<?php echo $mod->getInfo('dirname'); ?> "> <img src="<?php echo XOOPS_URL; ?> /modules/<?php echo $mod->getInfo('dirname'); ?> /<?php echo $mod->getInfo('image'); ?> " alt="<?php echo $mod->getInfo('dirname'); ?> "> </a> <?php } else { ?> <img src="<?php echo XOOPS_URL; ?> /modules/<?php echo $mod->getInfo('dirname'); ?> /<?php echo $mod->getInfo('image'); ?> " alt="<?php echo $mod->getInfo('dirname'); ?> "> <?php } ?> </div> <div class="the-info"> <ul> <li class="name"> <strong><a href="modules.php?action=install&dir=<?php echo $mod->getInfo('dirname'); ?> "><?php echo $mod->getInfo('name'); ?> </a></strong> <small><?php echo $mod->getInfo('rmversion') ? RMFormat::version($mod->getInfo('rmversion')) : $mod->getInfo('version'); ?> </small> </li> <li class="install"> <a href="modules.php?action=install&dir=<?php echo $mod->getInfo('dirname'); ?> "> <span class="fa fa-cog"></span> <span class="hidden-md"><?php _e('Install', 'rmcommon'); ?> </span> </a> </li> <li class="info"> <a href="javascript:;" onclick="show_module_info('<?php echo $mod->getInfo('dirname'); ?> ');"> <span class="fa fa-info-circle"></span> <span class="hidden-md"><?php _e('Info', 'rmcommon'); ?> </span> </a> </li> </ul> </div> <div class="rmc_mod_info" id="mod-<?php echo $mod->getInfo('dirname'); ?> "> <div class="header"> <div class="logo"> <img src="<?php echo XOOPS_URL; ?> /modules/<?php echo $mod->getInfo('dirname'); ?> /<?php echo $mod->getInfo('image'); ?> " alt="<?php echo $mod->getInfo('dirname'); ?> "> </div> <div class="name"> <h4><?php echo $mod->getInfo('name'); ?> </h4> <span class="help-block"> <?php echo $mod->getInfo('description'); ?> </span> </div> </div> <table class="table"> <tr> <td><?php _e('Version:', 'rmcommon'); ?> </td> <td> <?php if ($mod->getInfo('rmnative')) { ?> <strong><?php echo RMModules::format_module_version($mod->getInfo('rmversion')); ?> </strong> <?php } else { ?> <strong><?php echo $mod->getInfo('version'); ?> </strong> <?php } ?> </td> </tr> <tr> <td> <?php _e('Author:', 'rmcommon'); ?> </td> <td> <strong><?php echo strip_tags($mod->getInfo('author')); ?> </strong> </td> </tr> <tr> <td> <?php _e('Web site:', 'rmcommon'); ?> </td> <td> <a target="_blank" href="<?php echo $mod->getInfo('authorurl'); ?> "><?php echo $mod->getInfo('authorweb'); ?> </a> </td> </tr> <tr> <td><?php _e('Updatable:', 'rmcommon'); ?> </td> <td> <?php if ($mod->getInfo('updateurl') != '') { ?> <span class="fa fa-check"></span> <?php } else { ?> <span class="fa fa-times text-danger"></span> <?php } ?> </td> </tr> <tr> <td><?php _e('License:', 'rmcommon'); ?> </td> <td> <?php echo $mod->getInfo('license'); ?> </td> </tr> <tr> <td><?php _e('XOOPS Official:', 'rmcommon'); ?> </td> <td> <?php if ($mod->getInfo('official')) { ?> <span class="fa fa-check"></span> <?php } else { ?> <span class="fa fa-times text-danger"></span> <?php } ?> </td> </tr> <tr> <td><?php _e('C.U. Native:', 'rmcommon'); ?> </td> <td> <?php if ($mod->getInfo('rmnative')) { ?> <span class="fa fa-check"></span> <?php } else { ?> <span class="fa fa-times text-danger"></span> <?php } ?> </td> </tr> <tr> <td><?php _e('Directory:', 'rmcommon'); ?> </td> <td> <strong><?php echo $mod->getInfo('dirname'); ?> </strong> </td> </tr> <tr> <td><?php _e('Released:', 'rmcommon'); ?> </td> <td> <?php if ($mod->getInfo('releasedate') != '') { ?> <?php $time = strtotime($mod->getInfo('releasedate')); echo formatTimestamp($time, 's'); ?> <?php } ?> </td> </tr> <?php if ($mod->getInfo('help') != '' && $mod->getInfo('rmnative')) { ?> <tr> <td> </td> <td> <strong><a href="<?php echo $mod->getInfo('help'); ?> " target="_blank"><?php _e('Get Help', 'rmcommon'); ?> </a></strong> </td> </tr> <?php } ?> <tr> <td colspan="2" class="contact-options text-center"> <?php if ($mod->getInfo('authormail')) { ?> <?php if ($mod->getInfo('authormail') != '') { ?> <a target="_blank" href="mailto:<?php echo $mod->getInfo('authormail'); ?> "><span class="fa fa-envelope"></span></a> <?php } ?> <?php } ?> <?php if ($mod->getInfo('social')) { ?> <?php foreach ($mod->getInfo('social') as $social) { ?> <a target="_blank" href="<?php echo $social['url']; ?> "><span class="<?php echo parse_social_icons($social['type']); ?> "></span></a> <?php } ?> <?php } ?> </td> </tr> <tr> <td colspan="2" class="text-center"> <a href="modules.php?action=install&dir=<?php echo $mod->getInfo('dirname'); ?> " class="btn btn-success btn-sm"><?php _e('Install', 'rmcommon'); ?> </a> <a href="#" onclick="closeInfo();" class="btn btn-warning btn-sm"><?php _e('Close', 'rmcommon'); ?> </a> </td> </tr> </table> </div> </li> <?php $i++; } ?> </ul> <?php $nav->display(false); ?> <input type="hidden" id="token" value="<?php echo $xoopsSecurity->createToken(); ?> " /> </div> </div> <?php $ret['content'] = ob_get_clean(); return $ret; //print_r($available_mods); }
$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') : ''; //$deficon = XOOPS_ROOT_PATH.'/modules/rmcommon/themes/twop6/images/modules/'.$mod->dirname().'.png'; $modules[] = array('id' => $mod->getVar('mid'), 'name' => $mod->getVar('name'), 'realname' => $mod->getInfo('name'), 'version' => $mod->getInfo('rmnative') ? RMModules::format_module_version($mod->getInfo('rmversion')) : $mod->getInfo('version'), 'description' => $mod->getInfo('description'), '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')); } // Event for installed modules $modules = RMEvents::get()->run_event('rmcommon.installed.modules', $modules, $installed_dirs); //include dirname(dirname(__FILE__)).'/include/modules.php'; foreach ($modules as $mod) { ?> <a rel="tooltip" href="<?php echo $mod['admin_link']; ?> " title="<?php echo $mod['name']; ?> "> <img src="<?php echo $mod['image'];
/** * Format a module version. * Use RMModules::format_module_version() instead * @deprecated * @param $version * @param bool $name * @return string */ public function format_version($version, $name = false) { trigger_error(sprintf(__('Method %s is deprecated. Use %s::%s instead.', 'rmcommon'), __METHOD__, 'RMModules', 'format_module_version'), E_USER_DEPRECATED); return RMModules::format_module_version($version, $name); }
<img class="module-icon" src="../<?php echo $module->getInfo('dirname'); ?> /<?php echo $module->getInfo('icon48') != '' ? $module->getInfo('icon48') : $module->getInfo('image'); ?> " alt="<?php echo $module->getInfo('name'); ?> "> <strong><?php echo $module->getInfo('name'); ?> </strong> <small><?php echo is_array($module->getInfo('rmversion')) ? RMModules::format_module_version($module->getInfo('rmversion')) : $module->getInfo('version'); ?> </small><br /> <span class="help-block"><small><?php echo $module->getInfo('description'); ?> </small></span> <a href="modules.php?action=install&dir=<?php echo $module->getInfo('dirname'); ?> " class="btn btn-warning btn-sm"><?php _e('Install', 'rmcommon'); ?> </a> </li> <?php
<td><a href="<?php echo XOOPS_URL; ?> /modules/mywords/admin/tags.php"><?php _e('Tags', 'mywords'); ?> </a></td> </tr> </table><br /> </div> <div class="box-footer"> <?php _e('Current version:', 'mywords'); ?> <strong><?php echo RMModules::format_module_version($xoopsModule->getInfo('rmversion')); ?> </strong> </div> </div> <!-- / End quick overview --> </div> <div class="size-1" data-dashboard="item"> <!-- Drafts --> <div class="cu-box"> <div class="box-header"> <span class="fa fa-caret-up box-handler"></span> <h3 class="box-title"><?php _e('Recent Drafts', 'admin_mywords');
function load_modules_page() { global $xoopsLogger, $xoopsSecurity; error_reporting(0); $xoopsLogger->activated = false; if (!$xoopsSecurity->check(true, rmc_server_var($_POST, 'token', ''))) { echo __("Sorry, you don't have access to this page", 'rmcommon'); echo "<br /><a href='javascript:;' onclick='location.reload();'>" . __('Click here to refresh', 'rmcommon') . "</a>"; die; } $db = XoopsDatabaseFactory::getDatabaseConnection(); $sql = "SELECT * FROM " . $db->prefix("modules") . " ORDER BY `name`"; $result = $db->query($sql); $installed_dirs = array(); while ($row = $db->fetchArray($result)) { $installed_dirs[] = $row['dirname']; } 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); } } unset($dirlist); unset($module_handler); $limit = 7; $tpages = ceil(count($available_mods) / $limit); $page = rmc_server_var($_POST, 'page', 1); if ($page > $tpages) { $page = 1; } $start = ($page <= 0 ? 0 : $page - 1) * $limit; $nav = new RMPageNav(count($available_mods), $limit, $page, 3); $nav->target_url('javascript:;" onclick="load_page({PAGE_NUM});'); // Event for available modules $available_mods = RMEvents::get()->run_event('rmcommon.available.modules', $available_mods); $end = $page * $limit; if ($end > count($available_mods)) { $end = count($available_mods); } ob_start(); ?> <ul class="list-unstyled"> <?php for ($i = $start; $i < $end; $i++) { ?> <?php $mod = $available_mods[$i]; ?> <li> <div class="the-logo"> <?php if ($mod->getInfo('url') != '') { ?> <a href="modules.php?action=install&dir=<?php echo $mod->getInfo('dirname'); ?> "> <img src="<?php echo XOOPS_URL; ?> /modules/<?php echo $mod->getInfo('dirname'); ?> /<?php echo $mod->getInfo('image'); ?> " alt="<?php echo $mod->getInfo('dirname'); ?> "> </a> <?php } else { ?> <img src="<?php echo XOOPS_URL; ?> /modules/<?php echo $mod->getInfo('dirname'); ?> /<?php echo $mod->getInfo('image'); ?> " alt="<?php echo $mod->getInfo('dirname'); ?> "> <?php } ?> </div> <div class="the-info"> <ul> <li class="name"> <strong><a href="modules.php?action=install&dir=<?php echo $mod->getInfo('dirname'); ?> "><?php echo $mod->getInfo('name'); ?> </a></strong> <small><?php echo $mod->getInfo('rmversion') ? RMFormat::version($mod->getInfo('rmversion')) : $mod->getInfo('version'); ?> </small> </li> <li class="install"> <a href="modules.php?action=install&dir=<?php echo $mod->getInfo('dirname'); ?> "> <span class="fa fa-cog"></span> <?php _e('Install', 'rmcommon'); ?> </a> </li> <li class="info"> <a href="javascript:;" onclick="show_module_info('<?php echo $mod->getInfo('dirname'); ?> ');"> <span class="fa fa-info-circle"></span> <?php _e('Info', 'rmcommon'); ?> </a> </li> </ul> </div> <div class="rmc_mod_info" id="mod-<?php echo $mod->getInfo('dirname'); ?> "> <div class="header"> <div class="logo"> <img src="<?php echo XOOPS_URL; ?> /modules/<?php echo $mod->getInfo('dirname'); ?> /<?php echo $mod->getInfo('image'); ?> " alt="<?php echo $mod->getInfo('dirname'); ?> "> </div> <div class="name"> <h4><?php echo $mod->getInfo('name'); ?> </h4> <span class="help-block"> <?php echo $mod->getInfo('description'); ?> </span> </div> </div> <table class="table"> <tr> <td><?php _e('Version:', 'rmcommon'); ?> </td> <td> <?php if ($mod->getInfo('rmnative')) { ?> <strong><?php echo RMModules::format_module_version($mod->getInfo('rmversion')); ?> </strong> <?php } else { ?> <strong><?php echo $mod->getInfo('version'); ?> </strong> <?php } ?> </td> </tr> <tr> <td> <?php _e('Author:', 'rmcommon'); ?> </td> <td> <strong><?php echo strip_tags($mod->getInfo('author')); ?> </strong> </td> </tr> <tr> <td> <?php _e('Web site:', 'rmcommon'); ?> </td> <td> <a target="_blank" href="<?php echo $mod->getInfo('authorurl'); ?> "><?php echo $mod->getInfo('authorweb'); ?> </a> </td> </tr> <tr> <td><?php _e('Updatable:', 'rmcommon'); ?> </td> <td> <?php if ($mod->getInfo('updateurl') != '') { ?> <span class="fa fa-check"></span> <?php } else { ?> <span class="fa fa-times text-danger"></span> <?php } ?> </td> </tr> <tr> <td><?php _e('License:', 'rmcommon'); ?> </td> <td> <?php echo $mod->getInfo('license'); ?> </td> </tr> <tr> <td><?php _e('XOOPS Official:', 'rmcommon'); ?> </td> <td> <?php if ($mod->getInfo('official')) { ?> <span class="fa fa-check"></span> <?php } else { ?> <span class="fa fa-times text-danger"></span> <?php } ?> </td> </tr> <tr> <td><?php _e('C.U. Native:', 'rmcommon'); ?> </td> <td> <?php if ($mod->getInfo('rmnative')) { ?> <span class="fa fa-check"></span> <?php } else { ?> <span class="fa fa-times text-danger"></span> <?php } ?> </td> </tr> <tr> <td><?php _e('Directory:', 'rmcommon'); ?> </td> <td> <strong><?php echo $mod->getInfo('dirname'); ?> </strong> </td> </tr> <tr> <td><?php _e('Released:', 'rmcommon'); ?> </td> <td> <?php if ($mod->getInfo('releasedate') != '') { ?> <?php $time = strtotime($mod->getInfo('releasedate')); echo formatTimestamp($time, 's'); ?> <?php } ?> </td> </tr> <?php if ($mod->getInfo('help') != '' && $mod->getInfo('rmnative')) { ?> <tr> <td> </td> <td> <strong><a href="<?php echo $mod->getInfo('help'); ?> " target="_blank"><?php _e('Get Help', 'rmcommon'); ?> </a></strong> </td> </tr> <?php } ?> <tr> <td colspan="2" class="contact-options text-center"> <?php if ($mod->getInfo('authormail')) { ?> <?php if ($mod->getInfo('authormail') != '') { ?> <a target="_blank" href="mailto:<?php echo $mod->getInfo('authormail'); ?> "><span class="fa fa-envelope"></span></a> <?php } ?> <?php } ?> <?php if ($mod->getInfo('social')) { ?> <?php foreach ($mod->getInfo('social') as $social) { ?> <a target="_blank" href="<?php echo $social['url']; ?> "><span class="fa fa-<?php echo $social['type']; ?> -square"></span></a> <?php } ?> <?php } ?> </td> </tr> <tr> <td colspan="2" class="text-center"> <a href="modules.php?action=install&dir=<?php echo $mod->getInfo('dirname'); ?> " class="btn btn-success btn-sm"><?php _e('Install', 'rmcommon'); ?> </a> <a href="#" onclick="closeInfo();" class="btn btn-warning btn-sm"><?php _e('Close', 'rmcommon'); ?> </a> </td> </tr> </table> </div> </li> <?php } ?> </ul> <?php $nav->display(false); ?> <input type="hidden" id="token" value="<?php echo $xoopsSecurity->createToken(); ?> " /> <?php $ret = ob_get_clean(); echo $ret; }