aboutsummaryrefslogtreecommitdiffstats
path: root/include/ws_functions.inc.php
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2012-06-20 15:41:31 +0000
committermistic100 <mistic@piwigo.org>2012-06-20 15:41:31 +0000
commit07c7470584c11c2a20792f123299c79aebcad6da (patch)
treed5d83057729e957c145ba957e6d296ed1463de97 /include/ws_functions.inc.php
parentd355647796af5b1d76820cb5a5d64eacf28aa925 (diff)
feature 2657: More options for pwg.categories.add
git-svn-id: http://piwigo.org/svn/trunk@15850 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/ws_functions.inc.php')
-rw-r--r--include/ws_functions.inc.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php
index 0ecd8b930..f628cf520 100644
--- a/include/ws_functions.inc.php
+++ b/include/ws_functions.inc.php
@@ -2302,6 +2302,33 @@ function ws_categories_add($params, &$service)
{
return new PwgError(500, $creation_output['error']);
}
+
+ $updates = array();
+ if ( !empty($params['status']) and in_array($params['status'], array('private','public')) )
+ {
+ $updates['status'] = $params['status'];
+ }
+ if ( !empty($params['visible']) and in_array($params['visible'], array('true','false')) )
+ {
+ $updates['visible'] = $params['visible'];
+ }
+ if ( !empty($params['commentable']) and in_array($params['commentable'], array('true','false')) )
+ {
+ $updates['commentable'] = $params['commentable'];
+ }
+ if ( !empty($params['comment']) )
+ {
+ $updates['comment'] = strip_tags($params['comment']);
+ }
+
+ if (!empty($updates))
+ {
+ single_update(
+ CATEGORIES_TABLE,
+ $updates,
+ array('id'=>$creation_output['id'])
+ );
+ }
invalidate_user_cache();