Ignore:
Timestamp:
Aug 30, 2012, 2:54:29 PM (12 years ago)
Author:
plg
Message:

merge r17668 from branch 2.4 to trunk

bug 2733 fixed: when creating a sub-album in a private album with
pwg.categories.add, it is automatically private too.

File:
1 edited

Legend:

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

    r17469 r17669  
    23032303  include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
    23042304
     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
    23052327  $creation_output = create_virtual_category(
    23062328    $params['name'],
    2307     $params['parent']
     2329    $params['parent'],
     2330    $options
    23082331    );
    23092332
     
    23112334  {
    23122335    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());
    23452336  }
    23462337
Note: See TracChangeset for help on using the changeset viewer.