From bc7316639f9208089ed3ab3debf313aca8ff986a Mon Sep 17 00:00:00 2001 From: plegall Date: Thu, 28 Jan 2016 16:03:39 +0100 Subject: fixes #349, API set ranks of all album photos at once on pwg.images.setRank, ability to provide a list of image_id (and no rank). This way you can set the order of all photos of a given album, at once. --- ws.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'ws.php') diff --git a/ws.php b/ws.php index 25066b0d8..66e6a707d 100644 --- a/ws.php +++ b/ws.php @@ -293,11 +293,16 @@ function ws_addDefaultMethods( $arr ) 'pwg.images.setRank', 'ws_images_setRank', array( - 'image_id' => array('type'=>WS_TYPE_ID), + 'image_id' => array('type'=>WS_TYPE_ID,'flags'=>WS_PARAM_FORCE_ARRAY), 'category_id' => array('type'=>WS_TYPE_ID), - 'rank' => array('type'=>WS_TYPE_INT|WS_TYPE_POSITIVE|WS_TYPE_NOTNULL) - ), - 'Sets the rank of a photo for a given album.', + 'rank' => array('type'=>WS_TYPE_INT|WS_TYPE_POSITIVE|WS_TYPE_NOTNULL, 'default'=>null) + ), + 'Sets the rank of a photo for a given album. +

If you provide a list for image_id: +', $ws_functions_root . 'pwg.images.php', array('admin_only'=>true, 'post_only'=>true) ); -- cgit v1.2.3