From 5379d7bb1efb1bffc427a1b6a265d2a2b6964bed Mon Sep 17 00:00:00 2001 From: inghamn Date: Wed, 6 Jan 2010 17:23:37 +0000 Subject: [PATCH] The interments service now lets you download the entire data set git-svn-id: https://rosehill.googlecode.com/svn/branches/php@30 100bd78a-fc82-11de-b5bc-ffd2847a4b57 --- html/interments/home.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/html/interments/home.php b/html/interments/home.php index 14816c2..9b4a212 100644 --- a/html/interments/home.php +++ b/html/interments/home.php @@ -16,9 +16,9 @@ foreach ($_GET as $field=>$value) { } - -// Only the HTML version will include the findForm, addForm, and about page. $template = isset($_GET['format']) ? new Template('default',$_GET['format']) : new Template(); + +// Only the HTML version will include the findForm, addForm, and the about page. if ($template->outputFormat=='html') { $template->blocks[] = new Block('interments/findForm.inc'); @@ -33,18 +33,25 @@ if ($template->outputFormat=='html') { // All output formats will include the list of interments +$order = isset($_GET['sort']) ? $_GET['sort'] : null; if (count($search)) { - $order = isset($_GET['sort']) ? $_GET['sort'] : null; if ($template->outputFormat=='html') { $currentPage = isset($_GET['page']) ? (int)$_GET['page'] : 1; $intermentList = new IntermentList($search,$order,50,$currentPage); } else { $intermentList = new IntermentList(); - $intermentList->find(); + $intermentList->find($search,$order); } $template->blocks[] = new Block('interments/intermentList.inc', array('intermentList'=>$intermentList)); } +elseif ($template->outputFormat!='html') { + // Since they're using the service, allow them to download the entire data set + $intermentList = new IntermentList(); + $intermentList->find(null,$order); + $template->blocks[] = new Block('interments/intermentList.inc', + array('intermentList'=>$intermentList)); +} echo $template->render(); \ No newline at end of file