From: Artem Daniliants Date: Wed, 21 Apr 2010 08:06:39 +0000 (+0300) Subject: Added optional parameter to show units in results request X-Git-Tag: help~10 X-Git-Url: http://git.maemo.org/git/?a=commitdiff_plain;h=1114c341c18ca536973fe5d0e2492a7413377024;p=speedfreak Added optional parameter to show units in results request --- diff --git a/Server/application/controllers/api.php b/Server/application/controllers/api.php index 0b95e41..fe8a5f7 100644 --- a/Server/application/controllers/api.php +++ b/Server/application/controllers/api.php @@ -108,12 +108,13 @@ class Api_Controller extends Controller{ * Get results * */ - public function results($category, $limit){ + public function results($category, $limit, $show_unit=false){ $results = New Result_Model(); $cat = New Category_Model(); if ($cat->category_exists($category) AND $this->is_authorized() AND isset($limit)){ $view = new View('api/results'); $view->results = $results->get_results($category, $limit); + $view->show_unit=$show_unit; $view->render(true); } else diff --git a/Server/application/views/api/results.php b/Server/application/views/api/results.php index d823be0..01ab1a8 100644 --- a/Server/application/views/api/results.php +++ b/Server/application/views/api/results.php @@ -1,5 +1,5 @@ xml version="1.0" encoding="utf-8" "; ?> - + value="value; ?>" /> \ No newline at end of file