mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-07 01:03:31 +02:00
new: WebService method pwg.categories.add so that pLoader can create a
virtual category. git-svn-id: http://piwigo.org/svn/trunk@2583 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -1335,4 +1335,26 @@ LIMIT '.$params['per_page']*$params['page'].','.$params['per_page'];
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function ws_categories_add($params, &$service)
|
||||
{
|
||||
if (!is_admin())
|
||||
{
|
||||
return new PwgError(401, 'Access denied');
|
||||
}
|
||||
|
||||
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
|
||||
|
||||
$creation_output = create_virtual_category(
|
||||
$params['name'],
|
||||
$params['parent']
|
||||
);
|
||||
|
||||
if (isset($creation_output['error']))
|
||||
{
|
||||
return new PwgError(500, $creation_output['error']);
|
||||
}
|
||||
|
||||
return $creation_output;
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user