Adding pagination links to list

This commit is contained in:
Will Bradley 2014-02-26 14:26:01 -07:00
parent 703a2d196f
commit 980437bc9c

View File

@ -73,6 +73,7 @@ if ( !class_exists( 'Simple_Map' ) ) {
$to_display .= '<div id="simplemap" style="' . $hidemap . 'width: ' . $map_width . '; height: ' . $map_height . ';"></div>'; $to_display .= '<div id="simplemap" style="' . $hidemap . 'width: ' . $map_width . '; height: ' . $map_height . ';"></div>';
$to_display .= '<div id="results" style="' . $hidelist . 'width: ' . $map_width . ';"></div>'; $to_display .= '<div id="results" style="' . $hidelist . 'width: ' . $map_width . ';"></div>';
$to_display .= '<div id="pagination"></div>';
$to_display .= '<script type="text/javascript">'; $to_display .= '<script type="text/javascript">';
$to_display .= '(function($) { '; $to_display .= '(function($) { ';
@ -1085,6 +1086,15 @@ if ( !class_exists( 'Simple_Map' ) ) {
var results = document.getElementById('results'); var results = document.getElementById('results');
results.innerHTML = ''; results.innerHTML = '';
// Create page links
page_links = "";
for(i=1;i<=5;i++){
page_links += '<a href="?location_search_page='+i+'">'+i+'</a> ';
}
jQuery( "#pagination" ).html( page_links );
var markers = jQuery( eval( data ) ); var markers = jQuery( eval( data ) );
if (markers.length == 0) { if (markers.length == 0) {
results.innerHTML = '<h3>' + noresults_text + '</h3>'; results.innerHTML = '<h3>' + noresults_text + '</h3>';
@ -1106,6 +1116,7 @@ if ( !class_exists( 'Simple_Map' ) ) {
bounds.extend(locationData.point); bounds.extend(locationData.point);
}); });
// Make centeral marker on search // Make centeral marker on search
if ( 'search' == searchData.source && <?php echo apply_filters( 'sm-show-search-marker-image', 'true' ); ?>) { if ( 'search' == searchData.source && <?php echo apply_filters( 'sm-show-search-marker-image', 'true' ); ?>) {
var searchMarkerOptions = {}; var searchMarkerOptions = {};