The following proposed patch for stable 3.1, corrects the redirection logic
used when navigating to different grids from the main page using either the
pulldown or the links to each grid.

It obsoletes the hacks pulled from trunk when the 3.1 branch was created and
that are identified by changes r1200, r1226 and r1227 and that were using
invalid HTML and a partial template for redirection and as explained in :

  
http://www.mail-archive.com/ganglia-developers@lists.sourceforge.net/msg04052.html

Contains changes from r1253

Carlo
---
Index: web/templates/default/header.tpl
===================================================================
--- web/templates/default/header.tpl    (revision 1439)
+++ web/templates/default/header.tpl    (working copy)
@@ -3,12 +3,11 @@
 <HEAD>
 <TITLE>Ganglia:: {page_title}</TITLE>
 <META http-equiv="Content-type" content="text/html; charset=utf-8">
-<META http-equiv="refresh" content="{refresh}{redirect}">
+<META http-equiv="refresh" content="{refresh}">
 <LINK rel="stylesheet" href="./styles.css" type="text/css">
 </HEAD>
 <BODY BGCOLOR="#FFFFFF">
 
-<!-- START BLOCK : ganglia_header -->
 <FORM ACTION="{page}" METHOD="GET" NAME="ganglia_form">
 <TABLE WIDTH="100%">
 <TR>
@@ -50,4 +49,3 @@
 {node_menu}
 </FONT>
 <HR SIZE="1" NOSHADE>
-<!-- END BLOCK : ganglia_header -->
Index: web/header.php
===================================================================
--- web/header.php      (revision 1439)
+++ web/header.php      (working copy)
@@ -17,16 +17,6 @@
 else
       $header = "header";
 
-$tpl = new TemplatePower( template("$header.tpl") );
-$tpl->prepare();
-$tpl->assign( "page_title", $title );
-$tpl->assign("refresh", $default_refresh);
-
-# Skip the "ganglia_header" block (Logo + "Grid Report for ...") when 
redirecting
-if ( !strstr($clustername, "http://";) && $header == "header" ) {
-   $tpl->newBlock("ganglia_header");
-}
-
 #
 # sacerdoti: beginning of Grid tree state handling
 #
@@ -56,6 +46,10 @@
 $gridstack_str = join(">", $gridstack);
 $gridstack_url = rawurlencode($gridstack_str);
 
+if (strstr($clustername, "http://";)) {
+   header("Location: $clustername?gw=fwd&amp;gs=$gridstack_url");
+}
+
 if ($initgrid or $gridwalk)
    {
       # Use cookie so we dont have to pass gridstack around within this site.
@@ -73,23 +67,16 @@
   list($parentgrid, $parentlink) = explode("@", 
$gridstack[count($gridstack)-2]);
 }
 
+$tpl = new TemplatePower( template("$header.tpl") );
+$tpl->prepare();
+$tpl->assign("page_title", $title);
+$tpl->assign("refresh", $default_refresh);
+
 # Templated Logo image
 $tpl->assign("images","./templates/$template_name/images");
 
 $tpl->assign( "date", date("r"));
-$tpl->assign( "page_title", $title );
 
-# Setup a redirect to a remote server if you choose a grid from pulldown menu.
-# Tell destination server that we're walking foward in the grid tree.
-if (strstr($clustername, "http://";)) 
-   {
-      $tpl->assign("refresh", "0");
-      $tpl->assign("redirect", 
";URL=$clustername?gw=fwd&amp;gs=$gridstack_url");
-      echo "<h2>Redirecting, please wait...</h2>";
-      $tpl->printToScreen();
-      exit;
-   }
-
 # The page to go to when "Get Fresh Data" is pressed.
 if (isset($page))
       $tpl->assign("page",$page);
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to