forked from WWBN/AVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pluginsAvailable.json.php
30 lines (26 loc) · 850 Bytes
/
pluginsAvailable.json.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
<?php
global $global, $config;
if(!isset($global['systemRootPath'])){
require_once '../videos/configuration.php';
}
require_once $global['systemRootPath'] . 'objects/user.php';
header('Content-Type: application/json');
$row = Plugin::getAvailablePlugins();
$total = count($row);
if(!User::isAdmin()){
foreach ($row as $key => $value) {
if(!empty($row[$key]->installedPlugin['object_data'])){
$row[$key]->installedPlugin['object_data'] = "";
}
}
}
$json = json_encode($row);
if(empty($json)){
_error_log(print_r($row, true));
// remove object data
foreach ($row as $key => $value) {
$row[$key]->installedPlugin['object_data'] = "";
}
$json = json_encode($row);
}
echo '{ "current": 1,"rowCount": '.$total.', "total": '.$total.', "rows":'. $json.'}';