aboutsummaryrefslogtreecommitdiff
path: root/Neutron-trunk/api/engine-cyclic/components/widgets.php
diff options
context:
space:
mode:
authorMinteck <nekostarfan@gmail.com>2021-08-24 15:38:16 +0200
committerMinteck <nekostarfan@gmail.com>2021-08-24 15:38:16 +0200
commit529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105 (patch)
tree8a50c30271b9b328cde0d907b1441f2dabdc341b /Neutron-trunk/api/engine-cyclic/components/widgets.php
parent15e4724761c50b30803df1811a525c85058f70bf (diff)
downloadelectrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.tar.gz
electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.tar.bz2
electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.zip
Update
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