mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
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.
This commit is contained in:
11
ws.php
11
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)
|
||||
'rank' => array('type'=>WS_TYPE_INT|WS_TYPE_POSITIVE|WS_TYPE_NOTNULL, 'default'=>null)
|
||||
),
|
||||
'Sets the rank of a photo for a given album.',
|
||||
'Sets the rank of a photo for a given album.
|
||||
<br><br>If you provide a list for image_id:
|
||||
<ul>
|
||||
<li>rank becomes useless, only the order of the image_id list matters</li>
|
||||
<li>you are supposed to provide the list of all image_ids belonging to the album.
|
||||
</ul>',
|
||||
$ws_functions_root . 'pwg.images.php',
|
||||
array('admin_only'=>true, 'post_only'=>true)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user