true]); } else { unset($allAutoStart[$key]); if ($json) echo json_encode(['autostart' => false]); } // sort containers for start-up if (file_exists($user_prefs)) { $prefs = parse_ini_file($user_prefs); $sort = []; foreach ($allAutoStart as $ct) $sort[] = array_search($ct,$prefs) ?? 999; array_multisort($sort,SORT_NUMERIC,$allAutoStart); } else { natcasesort($allAutoStart); } $allAutoStart ? file_put_contents($autostart_file, implode(PHP_EOL, $allAutoStart).PHP_EOL) : @unlink($autostart_file); } if ($_POST['#action'] == 'templates' ){ readfile("$docroot/update.htm"); $repos = $_POST['template_repos']; file_put_contents($template_repos, $repos); $DockerTemplates = new DockerTemplates(); $DockerTemplates->downloadTemplates(); } if ( isset($_GET['is_dir'] )) { echo json_encode(['is_dir' => is_dir($_GET['is_dir'])]); } ?>