From eba00c2744a58d1fbfec3841d72e6fdff6be49f0 Mon Sep 17 00:00:00 2001 From: Haitem Date: Mon, 26 Oct 2020 16:45:45 +0100 Subject: [PATCH] Remake design for plugins buttons --- app/controllers/pluginsController.php | 13 +++--- app/views/templates/part/pluginButton.phtml | 46 ++++++++++++--------- app/views/templates/plugins.phtml | 17 ++------ 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/app/controllers/pluginsController.php b/app/controllers/pluginsController.php index c14ec9f..42b78fe 100644 --- a/app/controllers/pluginsController.php +++ b/app/controllers/pluginsController.php @@ -2,13 +2,16 @@ if (!empty ($_POST)){ if ( isset($_POST['name']) && - $_POST['name'] != '' && - isset($_POST['actualStatus']) + $_POST['name'] != '' ){ - if ($_POST['actualStatus']) { - rename($_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/' . $_POST['name'] . ".php", $_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/!' . $_POST['name'] . ".php"); + if ($_POST['status'] == "true") { + if (file_exists ($_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/!' . $_POST['name'] . ".php")) { + rename($_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/!' . $_POST['name'] . ".php", $_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/' . $_POST['name'] . ".php"); + } } else { - rename($_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/!' . $_POST['name'] . ".php", $_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/' . $_POST['name'] . ".php"); + if (file_exists ($_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/' . $_POST['name'] . ".php")) { + rename($_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/' . $_POST['name'] . ".php", $_SERVER['DOCUMENT_ROOT'] . BASEDIR . 'app/plugins/!' . $_POST['name'] . ".php"); + } } header('Location: ./plugins'); die(); diff --git a/app/views/templates/part/pluginButton.phtml b/app/views/templates/part/pluginButton.phtml index d840553..8acea49 100644 --- a/app/views/templates/part/pluginButton.phtml +++ b/app/views/templates/part/pluginButton.phtml @@ -1,21 +1,29 @@
-
-
-
-
-
- -
-
-
- -
-
+
+
+
+
+
+ +
+
+
+
+
+
+ + + echo('b_approve')?> +
+
+
+
+ + + echo('b_disable')?> +
+
+
+
+
diff --git a/app/views/templates/plugins.phtml b/app/views/templates/plugins.phtml index 6a59b5d..a002f96 100644 --- a/app/views/templates/plugins.phtml +++ b/app/views/templates/plugins.phtml @@ -27,27 +27,16 @@
- prepare('langMng',$LANGMNG); $partial->prepare('pluginName',$plugin['name']); $partial->prepare('pluginStatus',$plugin['status']); $partial->render(); - + ?> -
-
- - - -
-
-
-
-
-