Changeset 13090


Ignore:
Timestamp:
02/11/12 00:48:55 (8 years ago)
Author:
plg
Message:

feature added: pwg.images.add can perform an update on an existing photo.

Location:
trunk
Files:
2 edited

Legend:

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

    r13074 r13090  
    17461746  } 
    17471747 
     1748  $params['image_id'] = (int)$params['image_id']; 
     1749  if ($params['image_id'] > 0) 
     1750  { 
     1751    include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 
     1752 
     1753    $query=' 
     1754SELECT * 
     1755  FROM '.IMAGES_TABLE.' 
     1756  WHERE id = '.$params['image_id'].' 
     1757;'; 
     1758 
     1759    $image_row = pwg_db_fetch_assoc(pwg_query($query)); 
     1760    if ($image_row == null) 
     1761    { 
     1762      return new PwgError(404, "image_id not found"); 
     1763    } 
     1764  } 
     1765 
    17481766  // does the image already exists ? 
    17491767  if ($params['check_uniqueness']) 
     
    17981816    null, // categories 
    17991817    isset($params['level']) ? $params['level'] : null, 
    1800     null, // image_id 
     1818    $params['image_id'] > 0 ? $params['image_id'] : null, 
    18011819    $params['original_sum'] 
    18021820    ); 
  • trunk/ws.php

    r12922 r13090  
    261261        ), 
    262262      'check_uniqueness' => array('default' => true), 
     263      'image_id' => array('default' => null), 
    263264      ), 
    264265    'POST method only. 
Note: See TracChangeset for help on using the changeset viewer.