aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2008-10-01 21:08:51 +0000
committerplegall <plg@piwigo.org>2008-10-01 21:08:51 +0000
commit600e2d87ecc359b3bd202c4b471c042f319e1e2b (patch)
treee3c09337a0e31213fa12b6233ec74a4f01259852 /include
parent610e5ada6e8e5876a7275e827abf45b849dba06b (diff)
feature 874 added: new Web API method pwg.tags.add.
git-svn-id: http://piwigo.org/svn/trunk@2634 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/ws_functions.inc.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php
index 82635a213..2462832e5 100644
--- a/include/ws_functions.inc.php
+++ b/include/ws_functions.inc.php
@@ -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;
+}
?>