From 45960b4631e8d92a3ccd87fa4732dc1f74f1b017 Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 30 Jul 2008 21:53:00 +0000 Subject: 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////-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 --- ws.php | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'ws.php') 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'); -- cgit v1.2.3