Added XML and JSON buttons whenever the format is available
git-svn-id: https://rosehill.googlecode.com/svn/branches/php@40 100bd78a-fc82-11de-b5bc-ffd2847a4b57
This commit is contained in:
parent
c55ee44134
commit
4abee49536
|
@ -18,7 +18,11 @@ if (userIsAllowed('Sections')) {
|
||||||
$name = View::escape($this->cemetery->getName());
|
$name = View::escape($this->cemetery->getName());
|
||||||
echo "
|
echo "
|
||||||
<h1>$name</h1>
|
<h1>$name</h1>
|
||||||
<h2>$addButton Sections</h2>
|
<h2>$addButton Sections
|
||||||
|
";
|
||||||
|
include APPLICATION_HOME.'/blocks/html/serviceButtons.inc';
|
||||||
|
echo "
|
||||||
|
</h2>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr><th></th>
|
<tr><th></th>
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
Cemeteries
|
Cemeteries
|
||||||
|
<?php include APPLICATION_HOME.'/blocks/html/serviceButtons.inc'; ?>
|
||||||
</h2>
|
</h2>
|
||||||
<ul><?php
|
<ul><?php
|
||||||
foreach ($this->cemeteryList as $cemetery) {
|
foreach ($this->cemeteryList as $cemetery) {
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
*/
|
*/
|
||||||
$previousSort = isset($_GET['sort']) ? $_GET['sort'] : 'deceasedDate';
|
$previousSort = isset($_GET['sort']) ? $_GET['sort'] : 'deceasedDate';
|
||||||
$url = new URL($_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
|
$url = new URL($_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
|
||||||
|
$url->purgeEmptyParameters();
|
||||||
$return_url = $url->__toString();
|
$return_url = $url->__toString();
|
||||||
?>
|
?>
|
||||||
<div class="interfaceBox">
|
<div class="interfaceBox">
|
||||||
|
@ -24,6 +25,7 @@ $return_url = $url->__toString();
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
Interments
|
Interments
|
||||||
|
<?php include APPLICATION_HOME.'/blocks/html/serviceButtons.inc'; ?>
|
||||||
</h2>
|
</h2>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Renders buttons for each of the known output formats, pointing to the current URL
|
||||||
|
*
|
||||||
|
* @copyright 2010 City of Bloomington, Indiana
|
||||||
|
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
|
||||||
|
* @author Cliff Ingham <inghamn@bloomington.in.gov>
|
||||||
|
*/
|
||||||
|
$serviceURL = new URL($_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
|
||||||
|
$serviceURL->purgeEmptyParameters();
|
||||||
|
$serviceURL->format = 'xml';
|
||||||
|
echo "
|
||||||
|
<button type=\"button\" class=\"xml\" onclick=\"window.open('$serviceURL');\">
|
||||||
|
XML
|
||||||
|
</button>
|
||||||
|
";
|
||||||
|
$serviceURL->format = 'json';
|
||||||
|
echo "
|
||||||
|
<button type=\"button\" class=\"json\" onclick=\"window.open('$serviceURL');\">
|
||||||
|
JSON
|
||||||
|
</button>
|
||||||
|
";
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @copyright 2010 City of Bloomington, Indiana
|
||||||
|
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
|
||||||
|
* @author Cliff Ingham <inghamn@bloomington.in.gov>
|
||||||
|
*/
|
||||||
|
$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]";
|
|
@ -0,0 +1,21 @@
|
||||||
|
<cemeteries>
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @copyright 2010 City of Bloomington, Indiana
|
||||||
|
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
|
||||||
|
* @author Cliff Ingham <inghamn@bloomington.in.gov>
|
||||||
|
*/
|
||||||
|
foreach ($this->cemeteryList as $cemetery) {
|
||||||
|
$name = View::escape($cemetery->getName());
|
||||||
|
$url = View::escape($cemetery->getURL());
|
||||||
|
$googleMapUrl = View::escape($cemetery->getGoogleMapURL());
|
||||||
|
echo "
|
||||||
|
<cemetery id=\"{$cemetery->getId()}\">
|
||||||
|
<name>$name</name>
|
||||||
|
<url>$url</url>
|
||||||
|
<googleMapUrl>$googleMapUrl</googleMapUrl>
|
||||||
|
</cemetery>
|
||||||
|
";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</cemeteries>
|
Loading…
Reference in New Issue