Changeset 15850


Ignore:
Timestamp:
Jun 20, 2012, 5:41:31 PM (8 years ago)
Author:
mistic100
Message:

feature 2657: More options for pwg.categories.add

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/ws_functions.inc.php

    r15586 r15850  
    23032303    return new PwgError(500, $creation_output['error']);
    23042304  }
     2305 
     2306  $updates = array();
     2307  if ( !empty($params['status']) and in_array($params['status'], array('private','public')) )
     2308  {
     2309    $updates['status'] = $params['status'];
     2310  }
     2311  if ( !empty($params['visible']) and in_array($params['visible'], array('true','false')) )
     2312  {
     2313    $updates['visible'] = $params['visible'];
     2314  }
     2315  if ( !empty($params['commentable']) and in_array($params['commentable'], array('true','false')) )
     2316  {
     2317    $updates['commentable'] = $params['commentable'];
     2318  }
     2319  if ( !empty($params['comment']) )
     2320  {
     2321    $updates['comment'] = strip_tags($params['comment']);
     2322  }
     2323
     2324  if (!empty($updates))
     2325  {
     2326    single_update(
     2327      CATEGORIES_TABLE,
     2328      $updates,
     2329      array('id'=>$creation_output['id'])
     2330      );
     2331  }
    23052332
    23062333  invalidate_user_cache();
  • trunk/ws.php

    r13544 r15850  
    309309      'name' => array(),
    310310      'parent' => array('default' => null),
     311      'comment' => array('default' => null),
     312      'visible' => array('default' => boolean_to_string($conf['newcat_default_visible'])),
     313      'status' => array('default' => $conf['newcat_default_status']),
     314      'commentable' => array('default' => 'true'),
    311315      ),
    312316    'administration method only'
Note: See TracChangeset for help on using the changeset viewer.