} // __construct()
- function process_ajax_request()
+ public function process_ajax_request()
{
require_once 'HTML/AJAX/Server.php';
$fspot = new PHPFSPOT();
+ /* if no action is specified, no need to further process this
+ * function here.
+ */
+ if(!isset($_GET['action']))
+ return;
+
switch($_GET['action']) {
case 'showphoto':
if(isset($_GET['id']) && is_numeric($_GET['id'])) {
break;
case 'show_available_tags':
- $fspot->getAvailableTags();
+ print $fspot->getAvailableTags();
break;
case 'show_selected_tags':
- $fspot->getSelectedTags();
+ print $fspot->getSelectedTags();
break;
case 'addtag':
break;
case 'search':
- $fspot->startSearch($_GET['for'], $_GET['sort_order'], $_GET['from'], $_GET['to']);
+ $fspot->startSearch($_GET['for'], $_GET['from'], $_GET['to']);
if((isset($_GET['from']) && $fspot->isValidDate($_GET['from'])) &&
(isset($_GET['to']) && $fspot->isValidDate($_GET['to']))) {
}
else {
- $fspot->startSearch($_GET['for'], $_GET['sort_order']);
+ $fspot->startSearch($_GET['for']);
+ }
+ break;
+
+ case 'update_sort_order':
+ if(isset($_POST['value']) && is_string($_POST['value'])) {
+ print $fspot->updateSortOrder($_POST['value']);
}
break;
} // process_ajax_request();
-}
+} // class PHPFSPOT_RPC
$rpc = new PHPFSPOT_RPC();
$rpc->process_ajax_request();