mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
feature 874 added: new Web API method pwg.tags.add.
git-svn-id: http://piwigo.org/svn/trunk@2634 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -1397,4 +1397,23 @@ function ws_categories_add($params, &$service)
|
||||
|
||||
return $creation_output;
|
||||
}
|
||||
|
||||
function ws_tags_add($params, &$service)
|
||||
{
|
||||
if (!is_admin() or is_adviser())
|
||||
{
|
||||
return new PwgError(401, 'Access denied');
|
||||
}
|
||||
|
||||
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
|
||||
|
||||
$creation_output = create_tag($params['name']);
|
||||
|
||||
if (isset($creation_output['error']))
|
||||
{
|
||||
return new PwgError(500, $creation_output['error']);
|
||||
}
|
||||
|
||||
return $creation_output;
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user