diff --git a/blocks/html/cemeteries/cemeteryInfo.inc b/blocks/html/cemeteries/cemeteryInfo.inc index 64ec062..6af5a8b 100644 --- a/blocks/html/cemeteries/cemeteryInfo.inc +++ b/blocks/html/cemeteries/cemeteryInfo.inc @@ -18,7 +18,11 @@ if (userIsAllowed('Sections')) { $name = View::escape($this->cemetery->getName()); echo "

$name

-

$addButton Sections

+

$addButton Sections +"; + include APPLICATION_HOME.'/blocks/html/serviceButtons.inc'; +echo " +

diff --git a/blocks/html/cemeteries/cemeteryList.inc b/blocks/html/cemeteries/cemeteryList.inc index c7c7200..513fa45 100644 --- a/blocks/html/cemeteries/cemeteryList.inc +++ b/blocks/html/cemeteries/cemeteryList.inc @@ -17,6 +17,7 @@ } ?> Cemeteries +
diff --git a/blocks/html/serviceButtons.inc b/blocks/html/serviceButtons.inc new file mode 100644 index 0000000..149d9d8 --- /dev/null +++ b/blocks/html/serviceButtons.inc @@ -0,0 +1,22 @@ + + */ +$serviceURL = new URL($_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']); +$serviceURL->purgeEmptyParameters(); +$serviceURL->format = 'xml'; +echo " + +"; +$serviceURL->format = 'json'; +echo " + +"; diff --git a/blocks/json/cemeteries/cemeteryList.inc b/blocks/json/cemeteries/cemeteryList.inc new file mode 100644 index 0000000..16233f0 --- /dev/null +++ b/blocks/json/cemeteries/cemeteryList.inc @@ -0,0 +1,21 @@ + + */ +$cemeteries = array(); +foreach ($this->cemeteryList as $cemetery) { + $name = addslashes($cemetery->getName()); + $url = addslashes($cemetery->getURL()); + $googleMapUrl = addslashes($cemetery->getGoogleMapURL()); + $cemeteries[] = " + { \"id\":\"{$cemetery->getId()}\", + \"name\":\"$name\", + \"url\":\"$url\", + \"googleMapUrl\":\"$googleMapUrl\" + } + "; +} +$cemeteries = implode(',',$cemeteries); +echo "[$cemeteries]"; diff --git a/blocks/xml/cemeteries/cemeteryList.inc b/blocks/xml/cemeteries/cemeteryList.inc new file mode 100644 index 0000000..b5d02e5 --- /dev/null +++ b/blocks/xml/cemeteries/cemeteryList.inc @@ -0,0 +1,21 @@ + + + */ +foreach ($this->cemeteryList as $cemetery) { + $name = View::escape($cemetery->getName()); + $url = View::escape($cemetery->getURL()); + $googleMapUrl = View::escape($cemetery->getGoogleMapURL()); + echo " + getId()}\"> + $name + $url + $googleMapUrl + + "; +} +?> + \ No newline at end of file