$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; // add translations $_SERVER['REQUEST_URI'] = 'dashboard'; require_once "$docroot/webGui/include/Translations.php"; require_once "$docroot/webGui/include/Helpers.php"; extract(parse_plugin_cfg('dynamix',true)); $boot = "/boot/config/plugins/dynamix"; $file = unscript($_GET['file'] ?? $_POST['file']); $model = $_POST['model'] ?? false; $exist = file_exists("$boot/$file"); switch ($_POST['mode']) { case 'set': file_put_contents("$boot/$file",$model); exit; case 'get': if ($exist) echo file_get_contents("$boot/$file"); exit; case 'del': if ($exist) unlink("$boot/$file"); exit; case 'file': $name = 'case-model.png'; file_put_contents("$boot/$file",$name); file_put_contents("$boot/$name",base64_decode(str_replace('data:image/png;base64,','',$_POST['data']))); exit; } $casemodel = $exist ? file_get_contents("$boot/$file") : ''; ?> lang="=strtok($locale,'_')?:'en'?>">