Last change
on this file since 30364 was
28872,
checked in by plg, 10 years ago
|
new plugin write_metadata to write IPTC from Piwigo photo properties
|
File size:
648 bytes
|
Line | |
---|
1 | <?php |
---|
2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
3 | |
---|
4 | $service = &$arr[0]; |
---|
5 | $service->addMethod( |
---|
6 | 'pwg.images.writeMetadata', |
---|
7 | 'ws_images_writeMetadata', |
---|
8 | array( |
---|
9 | 'image_id' => array('type'=>WS_TYPE_ID), |
---|
10 | 'pwg_token' => array(), |
---|
11 | ), |
---|
12 | 'Write metadata (IPTC) based on photo properties in Piwigo', |
---|
13 | null, |
---|
14 | array( |
---|
15 | 'admin_only' => true, |
---|
16 | 'post_only' => true |
---|
17 | ) |
---|
18 | ); |
---|
19 | |
---|
20 | function ws_images_writeMetadata($params, &$service) |
---|
21 | { |
---|
22 | global $conf; |
---|
23 | |
---|
24 | if (get_pwg_token() != $params['pwg_token']) |
---|
25 | { |
---|
26 | return new PwgError(403, 'Invalid security token'); |
---|
27 | } |
---|
28 | |
---|
29 | wm_write_metadata($params['image_id']); |
---|
30 | |
---|
31 | return true; |
---|
32 | } |
---|
33 | |
---|
34 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.