aboutsummaryrefslogtreecommitdiffstats
path: root/ws.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2008-07-30 21:53:00 +0000
committerplegall <plg@piwigo.org>2008-07-30 21:53:00 +0000
commit45960b4631e8d92a3ccd87fa4732dc1f74f1b017 (patch)
treeecbecf51825baa937bb960022d097b510a3ca542 /ws.php
parent4dcec5fb8a2c85a9292374672b887b46f2862a53 (diff)
feature 839, first step : early proof of concept, no error handling. A
remote client can add a photo in a category thanks to the web API. A new "upload" directory is created (write access required on the base directory). Uploaded photo have path such as upload/<year>/<month>/<day>/<datetime>-random.jpg. The thumbnail must come with the "web sized" photo. The photo has no storage_category_id. Bugs still need to be fixed and a discussion must occur before next steps. git-svn-id: http://piwigo.org/svn/trunk@2463 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--ws.php28
1 files changed, 23 insertions, 5 deletions
diff --git a/ws.php b/ws.php
index 4c37eeb6d..cf1e6ea2b 100644
--- a/ws.php
+++ b/ws.php
@@ -128,12 +128,16 @@ function ws_addDefaultMethods( $arr )
),
'Returns elements for the corresponding query search.'
);
- $service->addMethod('pwg.images.setPrivacyLevel', 'ws_images_setPrivacyLevel',
- array(
- 'image_id' => array('flags'=>WS_PARAM_FORCE_ARRAY),
- 'level' => array('maxValue'=>$conf['available_permission_levels']),
+
+ $service->addMethod(
+ 'pwg.images.setPrivacyLevel',
+ 'ws_images_setPrivacyLevel',
+ array(
+ 'image_id' => array('flags'=>WS_PARAM_FORCE_ARRAY),
+ 'level' => array('maxValue'=>$conf['available_permission_levels']),
),
- 'sets the privacy levels for the images' );
+ 'sets the privacy levels for the images'
+ );
$service->addMethod('pwg.session.getStatus', 'ws_session_getStatus', null, '' );
$service->addMethod('pwg.session.login', 'ws_session_login',
@@ -167,6 +171,20 @@ function ws_addDefaultMethods( $arr )
),
'Returns elements for the corresponding tags. Note that tag_id, tag_url_name, tag_name an be arrays. Fill at least one of them. '
);
+
+ $service->addMethod(
+ 'pwg.images.add',
+ 'ws_images_add',
+ array(
+ 'name',
+ 'category_id',
+ 'file_content',
+ 'file_sum',
+ 'thumbnail_content',
+ 'thumbnail_sum'
+ ),
+ 'POST method only'
+ );
}
add_event_handler('ws_add_methods', 'ws_addDefaultMethods');