本文整理汇总了PHP中RMPageNav::set_template方法的典型用法代码示例。如果您正苦于以下问题:PHP RMPageNav::set_template方法的具体用法?PHP RMPageNav::set_template怎么用?PHP RMPageNav::set_template使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RMPageNav
的用法示例。
在下文中一共展示了RMPageNav::set_template方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: eventRmcommonTextTodisplay
public function eventRmcommonTextTodisplay($text, $source)
{
if (defined("XOOPS_CPFUNC_LOADED")) {
return $text;
}
$search = "/\\[gallery (.*?)\\]/is";
$replace = "\$1";
$amatches = array();
$count = preg_match_all($search, $text, $amatches);
if ($count <= 0) {
return $text;
}
for ($ic = 0; $ic < $count; $ic++) {
$matches = array($amatches[0][$ic], $amatches[1][$ic]);
$search = explode(" ", strip_tags($matches[1]));
foreach ($search as $i) {
$t = explode("=", $i);
${$t}[0] = $t[1];
}
include_once XOOPS_ROOT_PATH . '/modules/galleries/class/gsfunctions.class.php';
$data = GSFunctions::load_images($id, $num, 1);
if (empty($data)) {
$text = str_replace($matches[0], '', $text);
continue;
}
$images = $data['images'];
if (!defined("GS_INCLUDED_GALS")) {
if (RMFunctions::plugin_installed("lightbox")) {
RMLightbox::get()->add_element('.gs_gsl_item a');
RMLightbox::get()->render();
}
RMTemplate::get()->add_xoops_style('inclusion.css', 'galleries');
RMTemplate::get()->add_local_script('inclusion.js', 'galleries');
RMTemplate::get()->add_head('<script type="text/javascript">var gsurl = "' . XOOPS_URL . '/modules/galleries";</script>');
define("GS_INCLUDED_GALS", 1);
}
// Pagination
$page = $data['current'];
$limit = $data['limit'];
$num = $data['total'];
$set = $data['set'];
if ($full == 'true') {
$nav = new RMPageNav($num, $limit, $page);
$nav->set_template(RMTemplate::get()->get_template("other/gs_nav_included.php", "module", "galleries"));
$nav->target_url($set['id'] . ',' . $limit);
}
$content = '';
ob_start();
echo '<div class="gals_loader">';
include RMTemplate::get()->get_template('other/gs_gals_inclusion.php', 'module', 'galleries');
echo '</div>';
$content = ob_get_clean();
$text = str_replace($matches[0], $content, $text);
}
return $text;
}
示例2: elseif
} elseif ($action == 'load_structure') {
include RMTemplate::get()->get_template('other/gs_for_editor.php', 'module', 'galleries');
die;
} elseif ($action == 'load_included') {
if (!$xoopsSecurity->checkReferer()) {
die;
}
$set = rmc_server_var($_POST, 'set', 0);
$page = rmc_server_var($_POST, 'page', 1);
$limit = rmc_server_var($_POST, 'limit', 0);
$full = true;
if ($set <= 0 || $limit <= 0) {
die;
}
include_once XOOPS_ROOT_PATH . '/modules/galleries/class/gsfunctions.class.php';
$data = GSFunctions::load_images($set, $limit, $page);
if (empty($data)) {
die;
}
$images = $data['images'];
// Pagination
$page = $data['current'];
$limit = $data['limit'];
$num = $data['total'];
$set = $data['set'];
$nav = new RMPageNav($num, $limit, $page);
$nav->set_template(RMTemplate::get()->get_template("other/gs_nav_included.php", "module", "galleries"));
$nav->target_url($set['id'] . ',' . $limit);
include RMTemplate::get()->get_template('other/gs_gals_inclusion.php', 'module', 'galleries');
die;
}