forked from zikula-modules/Mediashare
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpnajax.php
31 lines (26 loc) · 928 Bytes
/
pnajax.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/**
* Mediashare AJAX handler
*
* @copyright (C) 2007, Jorn Wildt
* @link http://www.elfisk.dk
* @version $Id$
* @license See license.txt
*/
function mediashare_ajax_getitems($args)
{
$items = pnModAPIFunc('mediashare', 'user', 'getMediaItems',
array('albumId' => FormUtil::getPassedValue('aid')));
if ($items === false) {
AjaxUtil::error(LogUtil::getErrorMessagesText(' - '), '403 Forbidden');
}
$mediaItems = array();
foreach ($items as $item) {
$mediaItems[] = array('id' => $item['id'],
'isExternal' => $item['mediaHandler'] == 'extapp',
'thumbnailRef' => $item['thumbnailRef'],
'previewRef' => $item['previewRef'],
'title' => $item['title']);
}
return array('mediaItems' => $mediaItems);
}