projects
/
phpfspot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
issue59, remove HTML table from main skeleton
[phpfspot.git]
/
rpc.php
diff --git
a/rpc.php
b/rpc.php
index bdb7004ad6de1d6a03ec68c1760077517aa8e67d..6c94e8f72653a0e6715bd09fe0ee04519c66576e 100644
(file)
--- a/
rpc.php
+++ b/
rpc.php
@@
-31,7
+31,7
@@
class PHPFSPOT_RPC {
} // __construct()
} // __construct()
- function process_ajax_request()
+
public
function process_ajax_request()
{
require_once 'HTML/AJAX/Server.php';
{
require_once 'HTML/AJAX/Server.php';
@@
-40,6
+40,12
@@
class PHPFSPOT_RPC {
$fspot = new PHPFSPOT();
$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'])) {
switch($_GET['action']) {
case 'showphoto':
if(isset($_GET['id']) && is_numeric($_GET['id'])) {
@@
-48,11
+54,11
@@
class PHPFSPOT_RPC {
break;
case 'show_available_tags':
break;
case 'show_available_tags':
- $fspot->getAvailableTags();
+
print
$fspot->getAvailableTags();
break;
case 'show_selected_tags':
break;
case 'show_selected_tags':
- $fspot->getSelectedTags();
+
print
$fspot->getSelectedTags();
break;
case 'addtag':
break;
case 'addtag':
@@
-95,13
+101,19
@@
class PHPFSPOT_RPC {
break;
case 'search':
break;
case 'search':
-
$fspot->startSearch($_GET['for'], $_GET['sort_orde
r'], $_GET['from'], $_GET['to']);
+
$fspot->startSearch($_GET['fo
r'], $_GET['from'], $_GET['to']);
if((isset($_GET['from']) && $fspot->isValidDate($_GET['from'])) &&
(isset($_GET['to']) && $fspot->isValidDate($_GET['to']))) {
}
else {
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;
}
break;
@@
-142,7
+154,7
@@
class PHPFSPOT_RPC {
} // process_ajax_request();
} // process_ajax_request();
-}
+}
// class PHPFSPOT_RPC
$rpc = new PHPFSPOT_RPC();
$rpc->process_ajax_request();
$rpc = new PHPFSPOT_RPC();
$rpc->process_ajax_request();