Browse Source

Remove alert about complete fields after POST method

Diego Najar 6 years ago
parent
commit
7a2a8e85d6

+ 4 - 4
bl-kernel/abstract/plugin.class.php

@@ -265,11 +265,11 @@ class Plugin {
 	public function post()
 	{
 		$args = $_POST;
-		foreach($this->dbFields as $key=>$value) {
-			if( isset($args[$key]) ) {
+		foreach ($this->dbFields as $key=>$value) {
+			if (isset($args[$key])) {
 				$value = Sanitize::html( $args[$key] );
-				if($value==='false') { $value = false; }
-				elseif($value==='true') { $value = true; }
+				if ($value==='false') { $value = false; }
+				elseif ($value==='true') { $value = true; }
 				settype($value, gettype($this->dbFields[$key]));
 				$this->db[$key] = $value;
 			}

+ 3 - 6
bl-kernel/admin/controllers/configure-plugin.php

@@ -40,12 +40,9 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
 	));
 
 	// Call the method post of the plugin
-	if ($plugin->post()) {
-		Alert::set( $L->g('The changes have been saved') );
-		Redirect::page('configure-plugin/'.$plugin->className());
-	} else {
-		Alert::set( $L->g('Complete all fields') );
-	}
+	$plugin->post();
+	Alert::set( $L->g('The changes have been saved') );
+	Redirect::page('configure-plugin/'.$plugin->className());
 }
 
 // ============================================================================

+ 1 - 1
bl-plugins/backup/plugin.php

@@ -31,7 +31,7 @@ class pluginBackup extends Plugin {
 			return $this->deleteBackup($_POST['deleteBackup']);
 		}
 
-		return false;
+		return true;
 	}
 
 	public function adminSidebar()

+ 1 - 4
bl-plugins/rss/plugin.php

@@ -92,11 +92,8 @@ class pluginRSS extends Plugin {
 
 	public function post()
 	{
-		// Call the method
 		parent::post();
-
-		// After POST request
-		$this->createXML();
+		return $this->createXML();
 	}
 
 	public function afterPageCreate()

+ 1 - 1
bl-plugins/search/plugin.php

@@ -89,7 +89,7 @@ EOF;
 	public function post()
 	{
 		parent::post();
-		$this->createCache();
+		return $this->createCache();
 	}
 
 	public function afterPageCreate()

+ 1 - 4
bl-plugins/sitemap/plugin.php

@@ -105,11 +105,8 @@ class pluginSitemap extends Plugin {
 
 	public function post()
 	{
-		// Call the method
 		parent::post();
-
-		// After POST request
-		$this->createXML();
+		return $this->createXML();
 	}
 
 	public function afterPageCreate()