[Fusionforge-commits] r10406 - trunk/src/plugins/blocks/www

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Fri Sep 3 12:31:49 CEST 2010


Author: nerville
Date: 2010-09-03 12:31:49 +0200 (Fri, 03 Sep 2010)
New Revision: 10406

Modified:
   trunk/src/plugins/blocks/www/index.php
Log:
initial feedback message

Modified: trunk/src/plugins/blocks/www/index.php
===================================================================
--- trunk/src/plugins/blocks/www/index.php	2010-09-03 07:57:47 UTC (rev 10405)
+++ trunk/src/plugins/blocks/www/index.php	2010-09-03 10:31:49 UTC (rev 10406)
@@ -156,6 +156,7 @@
 $name = getStringFromRequest('name');
 $body = getStringFromRequest('body');
 $activate = getArrayFromRequest('activate');
+$feedback = htmlspecialchars(getStringFromRequest('feedback'));
 
 $blocks_text = array(
 	'forum' => _('Forums'),
@@ -232,7 +233,7 @@
 		$blocks = getAvailableBlocks($group);
 		foreach ($blocks as $b => $help) {
 			
-			$class = ($class == 'even') ? "odd" : "even";
+			$class = (! isset($class) || $class == 'bgcolor-white') ? "bgcolor-grey" : "bgcolor-white";
 			
 			$match = '';
 			if (preg_match('/(.*) index$/', $b, $match)) {
@@ -298,8 +299,8 @@
 							array($activate[$b], $id, $b));
 				}
 		}
-		header("Location: /plugins/blocks/index.php?id=$id&type=admin&pluginname=blocks");
-		exit;
+        $msg = _('Block Saved');
+		session_redirect('/plugins/blocks/index.php?id='.$id.'&type=admin&pluginname=blocks&feedback='.urlencode($msg));
 	} elseif ($type == 'configure') {
 		$group = group_get_object($id);
 		if ( !$group) {
@@ -313,6 +314,7 @@
 		blocks_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));    
 		// DO THE STUFF FOR THE PROJECT ADMINISTRATION PART HERE
 			
+		$blocks = getAvailableBlocks($group);
 		$res = db_query_params('SELECT content FROM plugin_blocks WHERE group_id=$1 AND name=$2',
 				       array($id, $name));
 		$body = db_result($res,0,"content");
@@ -380,8 +382,8 @@
 					WHERE group_id=$2 AND name=$3',
 					array($body, $id, $name));
 		}
-		header("Location: /plugins/blocks/index.php?id=$id&type=admin&pluginname=blocks");
-		exit;
+        $msg = $name .' : '. _('Block configuration saved');
+		session_redirect('/plugins/blocks/index.php?id='.$id.'&type=admin&pluginname=blocks&feedback='.urlencode($msg));
 	}
 }
 	




More information about the Fusionforge-commits mailing list