aboutsummaryrefslogtreecommitdiff
path: root/Neutron-trunk/api/engine-cyclic/components/widgets.php
blob: c2a903c9ca86d064f51d8d3330cd841c11a76717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
rlgps("Loading widgets");
$json = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/widgets.json"));
$widgets = $json->list;
foreach ($widgets as $widget): ?>
<?php $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/widgets/" . $widget . "/feature.json")); ?>
<h6 class="widgets-header"><?= getName($data) ?></h6>
<?php

if (isset($data->class) && is_string($data->class)) {
    $class = $data->class;
    new $class();
} else {
    require $_SERVER['DOCUMENT_ROOT'] . "/widgets/" . $widget . "/source.php";
}

?>
<?php endforeach ?>