aboutsummaryrefslogtreecommitdiff
path: root/Neutron-trunk/api/engine-cyclic/components/widgets.php
diff options
context:
space:
mode:
Diffstat (limited to 'Neutron-trunk/api/engine-cyclic/components/widgets.php')
-rw-r--r--Neutron-trunk/api/engine-cyclic/components/widgets.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/Neutron-trunk/api/engine-cyclic/components/widgets.php b/Neutron-trunk/api/engine-cyclic/components/widgets.php
new file mode 100644
index 0000000..c2a903c
--- /dev/null
+++ b/Neutron-trunk/api/engine-cyclic/components/widgets.php
@@ -0,0 +1,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 ?> \ No newline at end of file