Changeset 17668 for branches/2.4/include/ws_functions.inc.php
- Timestamp:
- Aug 30, 2012, 2:52:40 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.4/include/ws_functions.inc.php
r17470 r17668 2303 2303 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 2304 2304 2305 $options = array(); 2306 if (!empty($params['status']) and in_array($params['status'], array('private','public'))) 2307 { 2308 $options['status'] = $params['status']; 2309 } 2310 2311 if (!empty($params['visible']) and in_array($params['visible'], array('true','false'))) 2312 { 2313 $options['visible'] = get_boolean($params['visible']); 2314 } 2315 2316 if (!empty($params['commentable']) and in_array($params['commentable'], array('true','false')) ) 2317 { 2318 $options['commentable'] = get_boolean($params['commentable']); 2319 } 2320 2321 if (!empty($params['comment'])) 2322 { 2323 $options['comment'] = $params['comment']; 2324 } 2325 2326 2305 2327 $creation_output = create_virtual_category( 2306 2328 $params['name'], 2307 $params['parent'] 2329 $params['parent'], 2330 $options 2308 2331 ); 2309 2332 … … 2311 2334 { 2312 2335 return new PwgError(500, $creation_output['error']); 2313 }2314 2315 $updates = array();2316 if ( !empty($params['status']) and in_array($params['status'], array('private','public')) )2317 {2318 $updates['status'] = $params['status'];2319 }2320 if ( !empty($params['visible']) and in_array($params['visible'], array('true','false')) )2321 {2322 $updates['visible'] = $params['visible'];2323 }2324 if ( !empty($params['commentable']) and in_array($params['commentable'], array('true','false')) )2325 {2326 $updates['commentable'] = $params['commentable'];2327 }2328 if ( !empty($params['comment']) )2329 {2330 $updates['comment'] = strip_tags($params['comment']);2331 }2332 2333 if (!empty($updates))2334 {2335 single_update(2336 CATEGORIES_TABLE,2337 $updates,2338 array('id'=>$creation_output['id'])2339 );2340 }2341 2342 if ( isset($updates['status']) and 'private' == $updates['status'] )2343 {2344 add_permission_on_category($creation_output['id'], get_admins());2345 2336 } 2346 2337
Note: See TracChangeset
for help on using the changeset viewer.