本文整理汇总了PHP中RMPageNav::display方法的典型用法代码示例。如果您正苦于以下问题:PHP RMPageNav::display方法的具体用法?PHP RMPageNav::display怎么用?PHP RMPageNav::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RMPageNav
的用法示例。
在下文中一共展示了RMPageNav::display方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load_modules_page
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 = 10;
$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();
?>
<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">
<?php
for ($i = $start; $i < $end; $i++) {
?>
<?php
$mod = $available_mods[$i];
?>
<div class="<?php
echo tpl_cycle("even,odd");
?>
">
<a href="modules.php?action=install&dir=<?php
echo $mod->getInfo('dirname');
?>
" class="rmc_mod_img" style="background: url(<?php
echo XOOPS_URL;
?>
/modules/<?php
echo $mod->getInfo('dirname');
?>
/<?php
echo $mod->getInfo('image');
?>
) no-repeat center;"><span> </span></a>
<strong><a href="modules.php?action=install&dir=<?php
echo $mod->getInfo('dirname');
?>
"><?php
echo $mod->getInfo('name');
?>
</a></strong>
<span class="rmc_available_options">
<a href="modules.php?action=install&dir=<?php
echo $mod->getInfo('dirname');
?>
"><?php
_e('Install', 'rmcommon');
?>
</a> |
<a href="javascript:;" onclick="show_module_info('<?php
echo $mod->getInfo('dirname');
?>
');"><?php
_e('More info', 'rmcommon');
?>
</a>
//.........这里部分代码省略.........
示例2: rmc_available_mods
function rmc_available_mods()
{
global $available_mods, $xoopsSecurity;
$ret['title'] = __('Available Modules', 'rmcommon');
$ret['icon'] = RMCURL . '/images/modules.png';
$limit = 10;
$tpages = ceil(count($available_mods) / $limit);
$nav = new RMPageNav(count($available_mods), $limit, 1, 3);
$nav->target_url('javascript:;" 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">
<?php
foreach ($available_mods as $mod) {
?>
<?php
if ($i == $limit) {
break;
}
?>
<div class="<?php
echo tpl_cycle("even,odd");
?>
">
<a href="modules.php?action=install&dir=<?php
echo $mod->getInfo('dirname');
?>
" class="rmc_mod_img" style="background: url(<?php
echo XOOPS_URL;
?>
/modules/<?php
echo $mod->getInfo('dirname');
?>
/<?php
echo $mod->getInfo('image');
?>
) no-repeat center;"><span> </span></a>
<strong><a href="modules.php?action=install&dir=<?php
echo $mod->getInfo('dirname');
?>
"><?php
echo $mod->getInfo('name');
?>
</a></strong>
<span class="rmc_available_options">
<a href="modules.php?action=install&dir=<?php
echo $mod->getInfo('dirname');
?>
"><?php
_e('Install', 'rmcommon');
?>
</a> |
<a href="javascript:;" onclick="show_module_info('<?php
echo $mod->getInfo('dirname');
?>
');"><?php
_e('More info', 'rmcommon');
?>
</a>
</span>
<span class="rmc_mod_info" id="mod-<?php
echo $mod->getInfo('dirname');
?>
">
<?php
_e('Version:', 'rmcommon');
?>
<?php
if ($mod->getInfo('rmnative')) {
?>
<?php
echo RMUtilities::format_version($mod->getInfo('rmversion'));
?>
<?php
} else {
?>
<?php
echo $mod->getInfo('version');
?>
<?php
}
?>
<br />
<?php
_e('Author:', 'rmcommon');
?>
<?php
echo substr(strip_tags($mod->getInfo('author')), 0, 12);
?>
</span>
</div>
<?php
$i++;
}
?>
<?php
//.........这里部分代码省略.........
示例3: rmc_available_mods
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
//.........这里部分代码省略.........
示例4: rd_widget_figures
/**
* Shows the figures for a Document
*/
function rd_widget_figures()
{
global $res, $rmc_config;
$ret['title'] = __('Document Figures', 'docs');
$count = 0;
$figures = RDFunctions::figures($res->id(), &$count, '', 0, 6);
$nav = new RMPageNav($count, 6, 1, 3);
$nav->target_url('javascript:;" onclick="docsAjax.getFigures(' . $res->id() . ',6,{PAGE_NUM},\'rd-wd-figures\')');
RMTemplate::get()->add_script('../include/js/scripts.php?file=ajax.js');
ob_start();
?>
<div id="rd-wd-figures">
<ul>
<?php
if (count($figures) <= 0) {
_e('There are not exists figures for this Document yet!', 'docs');
}
foreach ($figures as $fig) {
?>
<li><a href="javascript:;" onclick="docsAjax.insertIntoEditor('[figure:<?php
echo $fig['id'];
?>
]','<?php
echo $rmc_config['editor_type'];
?>
');"><?php
echo $fig['title'];
?>
</a></li>
<?php
}
?>
</ul>
<?php
$nav->display(false);
?>
</div>
<?php
$ret['content'] = ob_get_clean();
return $ret;
}
示例5: load_modules_page
//.........这里部分代码省略.........
?>
<?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;
}