$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; require_once "$docroot/webGui/include/Helpers.php"; $boot = "/boot/config/plugins/dynamix"; $file = $_GET['file'] ?? $_POST['file']; $model = $_POST['model'] ?? false; $exist = file_exists("$boot/$file"); if ($_POST['mode']=='set') { if ($model) file_put_contents("$boot/$file",$model); elseif ($exist) unlink("$boot/$file"); exit; } if ($_POST['mode']=='get') { if ($exist) echo file_get_contents("$boot/$file"); exit; } if ($_POST['mode']=='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']))); symlink("$boot/$name","/usr/local/emhttp/webGui/images/$name"); exit; } $casemodel = $exist ? file_get_contents("$boot/$file") : ''; ?> "> "> "> ">