diff options
Diffstat (limited to '')
-rw-r--r-- | include/ws_functions.inc.php | 27 |
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(); |