mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-27 19:59:56 +03:00
bug:2845
added 'tags' as potential array for pwg.images.addSimple git-svn-id: http://piwigo.org/svn/trunk@20814 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
75fa687b88
commit
d02cc8f1d8
2 changed files with 16 additions and 5 deletions
|
@ -1977,11 +1977,22 @@ SELECT *
|
||||||
if (isset($params['tags']) and !empty($params['tags']))
|
if (isset($params['tags']) and !empty($params['tags']))
|
||||||
{
|
{
|
||||||
$tag_ids = array();
|
$tag_ids = array();
|
||||||
$tag_names = preg_split('~(?<!\\\),~', $params['tags']);
|
if (is_array($params[tags]))
|
||||||
foreach ($tag_names as $tag_name)
|
|
||||||
{
|
{
|
||||||
$tag_id = tag_id_from_tag_name(preg_replace('#\\\\*,#', ',', $tag_name));
|
foreach ($params[tags] as $tag_name)
|
||||||
array_push($tag_ids, $tag_id);
|
{
|
||||||
|
$tag_id = tag_id_from_tag_name($tag_name);
|
||||||
|
array_push($tag_ids, $tag_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tag_names = preg_split('~(?<!\\\),~', $params['tags']);
|
||||||
|
foreach ($tag_names as $tag_name)
|
||||||
|
{
|
||||||
|
$tag_id = tag_id_from_tag_name(preg_replace('#\\\\*,#', ',', $tag_name));
|
||||||
|
array_push($tag_ids, $tag_id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
add_tags($tag_ids, array($image_id));
|
add_tags($tag_ids, array($image_id));
|
||||||
|
|
2
ws.php
2
ws.php
|
@ -279,7 +279,7 @@ function ws_addDefaultMethods( $arr )
|
||||||
'default' => 0,
|
'default' => 0,
|
||||||
'maxValue' => $conf['available_permission_levels']
|
'maxValue' => $conf['available_permission_levels']
|
||||||
),
|
),
|
||||||
'tags' => array('default' => null),
|
'tags' => array('default' => null, 'flags' => WS_PARAM_ACCEPT_ARRAY),
|
||||||
'image_id' => array('default' => null),
|
'image_id' => array('default' => null),
|
||||||
),
|
),
|
||||||
'POST method only.<br>Use the <b>image</b> field for uploading file.<br>Set the form encoding to "form-data"<br><b>category</b> is the numeric identifier of the destination category.<br>You can update an existing photo if you define an existing image_id.'
|
'POST method only.<br>Use the <b>image</b> field for uploading file.<br>Set the form encoding to "form-data"<br><b>category</b> is the numeric identifier of the destination category.<br>You can update an existing photo if you define an existing image_id.'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue