forked from arildb/tiki-azure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist-file_backlinks_ajax.php
37 lines (36 loc) · 1.13 KB
/
list-file_backlinks_ajax.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
32
33
34
35
36
37
<?php
/**
* @package tikiwiki
*/
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id: list-file_backlinks_ajax.php 44444 2013-01-05 21:24:24Z changi67 $
require_once('tiki-setup.php');
if ( $prefs['feature_file_galleries'] != 'y' || $prefs['feature_jquery'] != 'y' || $prefs['feature_jquery_autocomplete'] != 'y') {
/* echo '{}'; */
exit;
}
global $filegallib; include_once('lib/filegals/filegallib.php');
if (empty($_REQUEST['fileId'])) {
/* echo '{}'; */
exit;
}
$info = $filegallib->get_file($_REQUEST['fileId']);
if (empty($info)) {
/* echo '{}'; */
exit;
}
$perms = Perms::get(array('type'=>'file gallery', 'object'=>$info['galleryId']));
if (!$perms->list_file_gallery) {
/* echo '{}'; */
exit;
}
$backlinks = $filegallib->getFileBacklinks($_REQUEST['fileId']);
$smarty->assign_by_ref('backlinks', $backlinks);
echo $smarty->fetch('file_backlinks.tpl');
/*
header( 'Content-Type: application/json' );
echo json_encode( $backlinks );
*/