ability to set album order with web API

* add method pwg.categories.setRank in Piwigo web API
This commit is contained in:
Teatek
2019-02-13 15:00:22 +01:00
committed by Pierrick Le Gall
parent 325a30b4b5
commit 61b7974a8d
4 changed files with 145 additions and 42 deletions
+20 -1
View File
@@ -737,7 +737,26 @@ function ws_addDefaultMethods( $arr )
$ws_functions_root . 'pwg.categories.php',
array('admin_only'=>true, 'post_only'=>true)
);
$service->addMethod(
'pwg.categories.setRank',
'ws_categories_setRank',
array(
'category_id' => array('type'=>WS_TYPE_ID,
'flags'=>WS_PARAM_FORCE_ARRAY),
'rank' => array('type'=>WS_TYPE_INT|WS_TYPE_POSITIVE|WS_TYPE_NOTNULL,
'flags'=>WS_PARAM_OPTIONAL),
),
'Changes the rank of an album
<br><br>If you provide a list for category_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 categories_ids belonging to the album.
</ul>.',
$ws_functions_root . 'pwg.categories.php',
array('admin_only'=>true, 'post_only'=>true)
);
$service->addMethod(
'pwg.plugins.getList',
'ws_plugins_getList',