1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-16 19:44:09 +02:00

Removed unused np_class.php and added $frm->pagination() method for simple use of the nextprev shortcode, without having to parse {NEXTPREV} text.

This commit is contained in:
Cameron
2015-06-16 13:31:58 -07:00
parent 8a22d10325
commit a07dcdcb8f
2 changed files with 27 additions and 89 deletions

View File

@@ -1186,6 +1186,33 @@ class e_form
}
/**
* Render Pagination using 'nextprev' shortcode.
* @param string $url eg. e_REQUEST_SELF.'?from=[FROM]'
* @param int $total total records
* @param int $from value to replace [FROM] with in the URL
* @param int $perPage number of items per page
* @param array $options template, type, glyphs
* @return string
*/
public function pagination($url='', $total=0, $from=0, $perPage=10, $options=array())
{
require_once(e_CORE."shortcodes/single/nextprev.php");
$nextprev = array(
'tmpl_prefix' => varset($options['template'],'default'),
'total' => intval($total),
'amount' => intval($perPage),
'current' => intval($from),
'url' => urldecode($url),
'type' => varset($options['type'],'record'), // page|record
'glyphs' => vartrue($options['glyphs'],false) // 1|0
);
return nextprev_shortcode($nextprev);
}
/**
* Render a bootStrap ProgressBar.