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
Filter area and city searches.
[readifood.git]
/
lib
/
hub.php
diff --git
a/lib/hub.php
b/lib/hub.php
index
79051f8
..
4e34c17
100644
(file)
--- a/
lib/hub.php
+++ b/
lib/hub.php
@@
-108,9
+108,16
@@
return;
}
return;
}
+ $candidates = array();
+ foreach ($areas as $area) {
+ if (! count(get_area_hubs($area->getId()))) continue;
+ $candidates[] = $area;
+ }
+ if (! count($candidates)) return;
+
echo "<p>Show hubs in area\n";
echo "<select name=\"area_id\">\n";
echo "<p>Show hubs in area\n";
echo "<select name=\"area_id\">\n";
- foreach ($
area
s as $area) {
+ foreach ($
candidate
s as $area) {
option("area_id", $area->getId(), get_area_displayname($area));
}
echo "</select>\n";
option("area_id", $area->getId(), get_area_displayname($area));
}
echo "</select>\n";
@@
-126,9
+133,16
@@
return;
}
return;
}
+ $candidates = array();
+ foreach ($cities as $city) {
+ if (! count(get_city_hubs($city->getId()))) continue;
+ $candidates[] = $city;
+ }
+ if (! count($candidates)) return;
+
echo "<p>Show hubs in city\n";
echo "<select name=\"city_id\">\n";
echo "<p>Show hubs in city\n";
echo "<select name=\"city_id\">\n";
- foreach ($c
iti
es as $city) {
+ foreach ($c
andidat
es as $city) {
option("city_id", $city->getId(), get_city_displayname($city), $city_id);
}
echo "</select>\n";
option("city_id", $city->getId(), get_city_displayname($city), $city_id);
}
echo "</select>\n";