Replace deprecated HTML5 tags <big> <center> <font>

This commit is contained in:
bergware
2016-10-24 09:42:55 +02:00
parent bba74f4cf1
commit 594db1b286
3 changed files with 27 additions and 19 deletions

View File

@@ -13,8 +13,12 @@
*/
?>
<?
$docroot = @$docroot ?: $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
ignore_user_abort(true);
require_once '/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php';
require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php";
$DockerClient = new DockerClient();
$DockerUpdate = new DockerUpdate();
$DockerTemplates = new DockerTemplates();
@@ -473,7 +477,7 @@ if (isset($_POST['contName'])) {
// Get the command line
list($cmd, $Name, $Repository) = xmlToCommand($postXML, $create_paths);
readfile("/usr/local/emhttp/plugins/dynamix.docker.manager/log.htm");
readfile("$docroot/plugins/dynamix.docker.manager/log.htm");
@flush();
// Saving the generated configuration file.
@@ -492,8 +496,8 @@ if (isset($_POST['contName'])) {
echo "<pre>".htmlentities($postXML)."</pre>";
echo "<h2>COMMAND:</h2>";
echo "<pre>".htmlentities($cmd)."</pre>";
echo "<center><input type='button' value='Back' onclick='window.location=window.location.pathname+window.location.hash+\"?xmlTemplate=edit:${filename}\"'>";
echo "<input type='button' value='Done' onclick='done()'></center><br>";
echo "<div style='text-align:center'><input type='button' value='Back' onclick='window.location=window.location.pathname+window.location.hash+\"?xmlTemplate=edit:${filename}\"'>";
echo "<input type='button' value='Done' onclick='done()'></div><br>";
goto END;
}
@@ -501,7 +505,7 @@ if (isset($_POST['contName'])) {
if (!$DockerClient->doesImageExist($Repository)) {
// Pull image
if (!pullImage($Name, $Repository)) {
echo '<center><input type="button" value="Done" onclick="done()"></center><br>';
echo '<div style="text-align:center"><input type="button" value="Done" onclick="done()"></div><br>';
goto END;
}
}
@@ -546,7 +550,7 @@ if (isset($_POST['contName'])) {
$_GET['cmd'] = $cmd;
include($dockerManPaths['plugin'] . "/include/Exec.php");
echo '<center><input type="button" value="Done" onclick="done()"></center><br>';
echo '<div style="text-align:center"><input type="button" value="Done" onclick="done()"></div><br>';
goto END;
}
@@ -554,7 +558,7 @@ if (isset($_POST['contName'])) {
## UPDATE CONTAINER
##
if ($_GET['updateContainer']){
readfile("/usr/local/emhttp/plugins/dynamix.docker.manager/log.htm");
readfile("$docroot/plugins/dynamix.docker.manager/log.htm");
@flush();
foreach ($_GET['ct'] as $value) {
@@ -602,7 +606,7 @@ if ($_GET['updateContainer']){
}
}
echo '<center><input type="button" value="Done" onclick="window.parent.jQuery(\'#iframe-popup\').dialog(\'close\');"></center><br>';
echo '<div style="text-align:center"><input type="button" value="Done" onclick="window.parent.jQuery(\'#iframe-popup\').dialog(\'close\');"></div><br>';
goto END;
}

View File

@@ -11,7 +11,8 @@
*/
?>
<?
require_once("/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php");
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php";
// Autostart file
global $dockerManPaths;
@@ -22,27 +23,27 @@ $template_repos = $dockerManPaths['template-repos'];
if ($_POST['action'] == "autostart" ){
$json = ($_POST['response'] == 'json') ? true : false;
if (! $json) readfile("/usr/local/emhttp/update.htm");
if (!$json) readfile("$docroot/update.htm");
$container = urldecode(($_POST['container']));
unset($_POST['container']);
$allAutoStart = @file($autostart_file, FILE_IGNORE_NEW_LINES);
if ($allAutoStart===FALSE) $allAutoStart = array();
if ($allAutoStart===FALSE) $allAutoStart = [];
$key = array_search($container, $allAutoStart);
if ($key===FALSE) {
array_push($allAutoStart, $container);
if ($json) echo json_encode(array( 'autostart' => true ));
if ($json) echo json_encode(['autostart' => true]);
}
else {
unset($allAutoStart[$key]);
if ($json) echo json_encode(array( 'autostart' => false ));
if ($json) echo json_encode(['autostart' => false]);
}
file_put_contents($autostart_file, implode(PHP_EOL, $allAutoStart).(count($allAutoStart)? PHP_EOL : ""));
}
if ($_POST['#action'] == "templates" ){
readfile("/usr/local/emhttp/update.htm");
readfile("$docroot/update.htm");
$repos = $_POST['template_repos'];
file_put_contents($template_repos, $repos);
$DockerTemplates = new DockerTemplates();
@@ -50,6 +51,6 @@ if ($_POST['#action'] == "templates" ){
}
if ( isset($_GET['is_dir'] )) {
echo json_encode( array( 'is_dir' => is_dir( $_GET['is_dir'] )));
echo json_encode(['is_dir' => is_dir($_GET['is_dir'])]);
}
?>

View File

@@ -12,10 +12,13 @@
*/
?>
<?
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
exec("pgrep docker", $pid);
if (count($pid) == 1) exit(0);
require_once '/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php';
require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php";
$DockerClient = new DockerClient();
$DockerTemplates = new DockerTemplates();
@@ -32,8 +35,8 @@ if (!isset($check)) {
$DockerTemplates->getAllInfo(true);
echo " Done.";
} else {
require_once '/usr/local/emhttp/webGui/include/Wrappers.php';
$notify = "/usr/local/emhttp/webGui/scripts/notify";
require_once "$docroot/webGui/include/Wrappers.php";
$notify = "$docroot/webGui/scripts/notify";
$unraid = parse_plugin_cfg("dynamix",true);
$server = strtoupper($var['NAME']);
$output = $unraid['notify']['docker_notify'];
@@ -43,7 +46,7 @@ if (!isset($check)) {
$name = $ct['Name'];
$image = $ct['Image'];
if ($info[$name]['updated'] == "false") {
$updateStatus = (is_file($dockerManPaths['update-status'])) ? json_decode(file_get_contents($dockerManPaths['update-status']), TRUE) : array();
$updateStatus = (is_file($dockerManPaths['update-status'])) ? json_decode(file_get_contents($dockerManPaths['update-status']), TRUE) : [];
$new = str_replace('sha256:', '', $updateStatus[$image]['remote']);
$new = substr($new, 0, 4).'..'.substr($new, -4, 4);