From 5f778043e478d52349c430940fdc41ff5e311647 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Tue, 17 Jun 2014 09:21:29 +0100 Subject: [PATCH] Now handles reloads on demand If we're installing and the plugin needs a reload, confirm that with the user and reload on OK, else reload iFrame only If a plugin needs a reload, display that text below the plugin name, so user is aware before installing A little more padding on the td that contains the name to look a little nicer and accomodate the possible extra line --- lib/plugins-manager.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/plugins-manager.php b/lib/plugins-manager.php index 88aa98d..da6b01a 100644 --- a/lib/plugins-manager.php +++ b/lib/plugins-manager.php @@ -151,9 +151,13 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset $fh = fopen($settingsFile, 'w'); fwrite($fh, $settingsContents); fclose($fh); - // Finally, reload the iFrame screen for the user - header("Location: plugins-manager.php?updatedPlugins&csrf=".$_SESSION["csrf"]); - echo ""; + // Finally, reload ICEcoder itself if plugin requires it or just the iFrame screen for the user if it doesn't + if ($_GET['action']=="install" && $pluginsData[$_GET['plugin']]['reload'] == "true") { + echo ""; + } else { + header("Location: plugins-manager.php?updatedPlugins&csrf=".$_SESSION["csrf"]); + echo ""; + } die('saving plugins...'); } else { echo ""; @@ -252,8 +256,9 @@ function deletePlugin($dir) { } } - echo ''.$pluginsData[$i]['name'].''; - echo ''.$pluginsData[$i]['name'].''; + $reloadExtra = $pluginsData[$i]['reload'] == 'true' ? '
Reload after install required' : ''; + echo ''.$pluginsData[$i]['name'].''; + echo ''.$pluginsData[$i]['name'].$reloadExtra.''; $styleExtra = ($i % 2 == 1 || $i == count($pluginsData)-1) ? "0" : "30px"; echo ''.$installUninstallButton.'';