git://git.iain.cx/iain
/
readifood.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into uat
[readifood.git]
/
lib
/
city.php
diff --git
a/lib/city.php
b/lib/city.php
index
dd60e36
..
94c556e
100644
(file)
--- a/
lib/city.php
+++ b/
lib/city.php
@@
-10,13
+10,14
@@
}
}
}
}
- function show_cities($offset, $per_page, $name = null) {
+ function show_cities($name = null) {
+ list($first_page, $per_page) = pagination();
echo "<p>Cities:";
$q = new CityQuery;
if (isset($name)) $q->filterByName($name);
echo "<p>Cities:";
$q = new CityQuery;
if (isset($name)) $q->filterByName($name);
- $
p = $q->paginate($offset
, $per_page);
- if (count($
p
)) {
- foreach ($
p
as $city) {
+ $
cities = $q->paginate($first_page
, $per_page);
+ if (count($
cities
)) {
+ foreach ($
cities
as $city) {
echo "<br>\nCity: " . $city->getStrongLink(get_city_displayname($city));
$n = $city->getName();
$i = $city->getId();
echo "<br>\nCity: " . $city->getStrongLink(get_city_displayname($city));
$n = $city->getName();
$i = $city->getId();
@@
-28,6
+29,7
@@
echo " " . $city->getDeleteLink();
}
}
echo " " . $city->getDeleteLink();
}
}
+ show_pagination($cities);
}
else echo " none";
echo "</p>\n";
}
else echo " none";
echo "</p>\n";
@@
-147,13
+149,13
@@
break;
default:
break;
default:
- show_cities(
0, 10,
$name);
+ show_cities($name);
show_new_city_form();
break;
}
}
else if (isset($name)) show_city($name, $id);
show_new_city_form();
break;
}
}
else if (isset($name)) show_city($name, $id);
- else show_cities(
0, 10
);
+ else show_cities();
if (count($parameters)) echo "<p class=\"noprint standout\">Show all <a href=\"/city\">cities</a></p>\n";
show_new_city_form();
if (count($parameters)) echo "<p class=\"noprint standout\">Show all <a href=\"/city\">cities</a></p>\n";
show_new_city_form();