$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
require_once "$docroot/webGui/include/Helpers.php";
extract(parse_plugin_cfg('dynamix',true));
// add translations
$_SERVER['REQUEST_URI'] = '';
require_once "$docroot/webGui/include/Translations.php";
$var = parse_ini_file("/var/local/emhttp/var.ini");
/**
* Just like DefaultPageLayout.php
*/
require_once "$docroot/plugins/dynamix/include/ThemeHelper.php";
$themeHelper = new ThemeHelper($display['theme']);
$themeName = $themeHelper->getThemeName();
$onload_function = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$safemode = '/boot/unraidsafemode';
$progress = (_var($var,'fsProgress')!='') ? "
{$var['fsProgress']}" : "
";
// Determine the onload function and execute system command
switch (_var($_POST,'cmd','shutdown')) {
case 'reboot':
if (isset($_POST['safemode'])) touch($safemode); else @unlink($safemode);
$onload_function = 'reboot_now()';
exec('/sbin/reboot -n');
break;
case 'shutdown':
if (isset($_POST['safemode'])) touch($safemode); else @unlink($safemode);
$onload_function = 'shutdown_now()';
exec('/sbin/poweroff -n');
break;
}
// Determine array status display
$array_status = '';
switch (_var($var,'fsState')) {
case 'Stopped':
$array_status = "" . _('Array Stopped') . "$progress";
break;
case 'Starting':
$array_status = "" . _('Array Starting') . "$progress";
break;
case 'Stopping':
$array_status = "" . _('Array Stopping') . "$progress";
break;
default:
$array_status = "" . _('Array Started') . "$progress";
break;
}
} else {
$onload_function = 'redirectToMainPage()';
}
?>
lang="=strtok($locale,'_')?:'en'?>" class="= $themeHelper->getThemeHtmlClass() ?>">