diff --git a/web/zm_html_view_events.php b/web/zm_html_view_events.php
index 7463432be..8f26087b7 100644
--- a/web/zm_html_view_events.php
+++ b/web/zm_html_view_events.php
@@ -51,6 +51,106 @@ if ( $filter['sql'] )
$events_sql .= $filter['sql'];
}
$events_sql .= " order by $sort_column $sort_order";
+
+function getPagination( $pages, $page )
+{
+ global $view, $filter, $sort_query, $limit;
+
+ $max_shortcuts = 5;
+
+ ob_start();
+ if ( $pages <= 1 )
+ {
+ // Nothing
+ }
+ else
+ {
+ if ( $page )
+ {
+ if ( $page < 0 )
+ $page = 1;
+ if ( $page > $pages )
+ $page = $pages;
+
+ if ( $page > 1 )
+ {
+ if ( false && $page > 2 )
+ {
+?>
+<<
+
+<
+
+= $new_page ?>
+
+- = $page ?> -
+ $pages )
+ break;
+ $pages_used[$new_page] = true;
+ array_push( $new_pages, $new_page );
+ }
+ if ( !isset($pages_used[$pages]) )
+ array_push( $new_pages, $pages );
+
+ foreach ( $new_pages as $new_page )
+ {
+?>
+ = $new_page ?>
+
+>
+
+>>
+
@@ -286,11 +386,14 @@ function viewEvents( form, name )
= sprintf( $zmClangEventCount, $n_events, zmVlang( $zmVlangEvent, $n_events ) ) ?> |
+= $pagination?$pagination:' ' ?> |
+
- |
|
-
- $pages )
- $page = $pages;
-
- if ( $page > 1 )
- {
- if ( false && $page > 2 )
- {
-?>
-<<
-
-<
-
-= $new_page ?>
-
-- = $page ?> -
- $pages )
- break;
- $pages_used[$new_page] = true;
- array_push( $new_pages, $new_page );
- }
- if ( !isset($pages_used[$pages]) )
- array_push( $new_pages, $pages );
-
- foreach ( $new_pages as $new_page )
- {
-?>
- = $new_page ?>
-
->
-
->>
-
- |
= $zmSlangViewAll ?> |
- |
= $zmSlangViewPaged ?> |
= $zmSlangClose ?> |
- |
+
+ |
+
+ |