aboutsummaryrefslogtreecommitdiffstats
path: root/include/ws_functions.inc.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2008-09-24 20:25:39 +0000
committerplegall <plg@piwigo.org>2008-09-24 20:25:39 +0000
commit6df515a54ff63812076dfbf8dc6514fa9416b08a (patch)
tree2ab3c894bcecfea01767794c5eee9646b3f1c4e2 /include/ws_functions.inc.php
parent0d70e80ad8fcd2966c07c936d45f9752b91e5d8d (diff)
new: WebService method pwg.categories.add so that pLoader can create a
virtual category. git-svn-id: http://piwigo.org/svn/trunk@2583 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/ws_functions.inc.php')
-rw-r--r--include/ws_functions.inc.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php
index 09f6440d4..203367356 100644
--- a/include/ws_functions.inc.php
+++ b/include/ws_functions.inc.php
@@ -1335,4 +1335,26 @@ LIMIT '.$params['per_page']*$params['page'].','.$params['per_page'];
)
);
}
+
+function ws_categories_add($params, &$service)
+{
+ if (!is_admin())
+ {
+ return new PwgError(401, 'Access denied');
+ }
+
+ include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+
+ $creation_output = create_virtual_category(
+ $params['name'],
+ $params['parent']
+ );
+
+ if (isset($creation_output['error']))
+ {
+ return new PwgError(500, $creation_output['error']);
+ }
+
+ return $creation_output;
+}
?>