- Optimized cycle generation
[haanga.git] / tests / tmp / assert_templates / load.tpl.php
blob6fc84a94f4236fc2cf11f4dc6efcac68371e6243
1 <?php
2 /* Generated from /home/crodas/projects/playground/haanga/tests/assert_templates/load.tpl */
3 function haanga_8d56a9a504af63b0aa1f9e966ad860de9c65c99b($vars, $return=FALSE, $blocks=array())
5 extract($vars);
6 if ($return == TRUE) {
7 ob_start();
9 echo "\n";
10 $mnm_current = $page;
11 $mnm_total = ceil($total / $results_per_page);
12 $mnm_start = max($mnm_current - intval(5 / 2), 1);
13 $mnm_end = $mnm_start + 5 - 1;
14 $mnm_prev = (1 == $mnm_current ? FALSE : $mnm_current - 1);
15 $mnm_next = ($total < 0 || $mnm_current < $mnm_total ? $mnm_current + 1 : FALSE);
16 $mnm_pages = range($mnm_start, ($mnm_end < $mnm_total ? $mnm_end : $mnm_total));
17 echo "\n";
18 if (empty($mnm_prev) === FALSE) {
19 echo "\n <span class=\"nextprev\">&#171; Previous</span>\n";
20 } else {
21 echo "\n <a href=\"?page".htmlentities($mnm_prev)."\">&#171; Previous</a>\n";
23 echo "\n\n";
24 if ($mnm_start > 1) {
25 echo "\n <a href=\"?page=1\">1</a>';\n <span>...</span>\n";
27 echo "\n\n";
28 foreach ($mnm_pages as $page) {
29 echo "\n ";
30 if ($mnm_current == $page) {
31 echo "\n <span class=\"current\">".htmlentities($page)."</span>\n ";
32 } else {
33 echo "\n <a href=\"?page=".htmlentities($page)."\">".htmlentities($page)."</a>\n ";
35 echo "\n";
37 echo "\n\n";
38 if ($mnm_total > $mnm_end) {
39 echo "\n <span>...</span>\n <a href=\"?page=".htmlentities($mnm_total)."\">".htmlentities($mnm_total)."</a>\n";
41 echo "\n\n";
42 if (empty($mnm_next) === FALSE) {
43 echo "\n <a href=\"?page=".htmlentities($mnm_next)."\">&#187; Next</a>\n";
44 } else {
45 echo "\n <span class=\"nextprev\">&#187; Next</span>\n";
47 echo "\n";
48 if ($return == TRUE) {
49 return ob_get_clean();