dremjs-old/apps/widgets-settings/index.php
Innovation Inc 404026a4c2 Spring cleaning
Cleaned up the file structure a bit.
Also made the terminal portable.
2021-03-26 02:34:24 -05:00

38 lines
1.2 KiB
PHP

<html>
<head>
</head>
<body>
<script>
document.addEventListener('contextmenu', event => event.preventDefault());
</script>
<?php
echo "List of availible widgets:<br />";
$widgets = array_filter(glob(getenv('DOCUMENT_ROOT').'/widgets/*'), 'is_dir');
for($i = 0; $i<=sizeof($widgets)-1; $i++) {
$temp = explode("/", $widgets[$i]);
echo $temp[sizeof($temp)-1].' ';
}
echo "<br /><br />Currently enabled widgets:<br />";
$enabledWidgets = explode("\n", file_get_contents(getenv('DOCUMENT_ROOT')."/etc/enabled_widgets"));
for($i = 0; $i<=sizeof($enabledWidgets)-1; $i++)
echo $enabledWidgets[$i].' ';
echo "<br />";
if(array_key_exists('add', $_POST)) {
addWidgets();
} else if(array_key_exists('remove', $_POST)) {
removeWidgets();
}
function addWidgets() {
echo "Add";
}
function removeWidgets() {
echo "Remove";
}
?>
<a href="addwidget.php"><button type=button>Add Widget</button></a>
<a href="removewidget.php"><button type=button>Clear Widget List</button></a>
<p>Changes take effect after restart.</p>
</body>
</html>