[vhffs-dev] [709] Moved all template filling stuff in the display method so that changes made by current pages can be applied .

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 709
Author:   beuss
Date:     2007-07-11 08:50:34 +0000 (Wed, 11 Jul 2007)

Log Message:
-----------
Moved all template filling stuff in the display method so that changes made by current pages can be applied.

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Panel/Main.pm


Modified: trunk/vhffs-api/src/Vhffs/Panel/Main.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2007-07-11 08:39:18 UTC (rev 708)
+++ trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2007-07-11 08:50:34 UTC (rev 709)
@@ -364,26 +364,7 @@
 
 
 	my $maintemplate = new HTML::Template( filename => $templatedir."/main/panel.tmpl" );
-	$maintemplate->param( PANEL_TITLE => sprintf( gettext( "%s's Panel" ), $config->get_host_name ) );
-	$maintemplate->param( THEME => $theme );
 
-    # Allows each theme to have its own Jscripts
-
-    my $jsglob = File::Spec->catfile($config->get_themesdir(), $theme, '/js/*.js');
-    my $jswebpath = "/themes/$theme/js/";
-    my @jscripts;
-    # Common scripts
-    push @jscripts, {SCRIPT => '/js/prototype.js'};
-    push @jscripts, {SCRIPT => '/js/commons.js'};
-    push @jscripts, {SCRIPT => '/js/tooltip.js'};
-    while(glob($jsglob)) {
-        use File::Basename;
-        push @jscripts, {SCRIPT => $jswebpath.basename( $_ )};
-    }
-    $maintemplate->param( JSCRIPTS => \@jscripts );
-    $maintemplate->param( TEXT_HELP => gettext('Help') );
-    $maintemplate->param( TEXT_HELP_CONTENT => gettext('Stay over an icon to see its description.') );
-
 	$this->{session} = $session;
 	$this->{template} = $maintemplate;
 	$this->{user} = $user;
@@ -392,9 +373,6 @@
 		$this->{'groupname'} = $projectname;
 	}
 
-    $this->add_info( $cgi->param('msg') ) if(defined $cgi->param('msg'));
-	$maintemplate->param( HEADER => $this->generate_header );
-
 	return $this;
 }
 
@@ -608,6 +586,33 @@
 	}
 
 	my $maintemplate = $panel->{'template'};
+    my $cgi = $panel->{cgi};
+    my $theme = $panel->{theme};
+    my $config = $panel->{config};
+
+	$maintemplate->param( PANEL_TITLE => sprintf( gettext( "%s's Panel" ), $config->get_host_name ) );
+	$maintemplate->param( THEME => $theme );
+
+    # Allows each theme to have its own Jscripts
+
+    my $jsglob = File::Spec->catfile($config->get_themesdir(), $theme, '/js/*.js');
+    my $jswebpath = "/themes/$theme/js/";
+    my @jscripts;
+    # Common scripts
+    push @jscripts, {SCRIPT => '/js/prototype.js'};
+    push @jscripts, {SCRIPT => '/js/commons.js'};
+    push @jscripts, {SCRIPT => '/js/tooltip.js'};
+    while(glob($jsglob)) {
+        use File::Basename;
+        push @jscripts, {SCRIPT => $jswebpath.basename( $_ )};
+    }
+    $maintemplate->param( JSCRIPTS => \@jscripts );
+    $maintemplate->param( TEXT_HELP => gettext('Help') );
+    $maintemplate->param( TEXT_HELP_CONTENT => gettext('Stay over an icon to see its description.') );
+    $panel->add_info( $cgi->param('msg') ) if(defined $cgi->param('msg'));
+	$maintemplate->param( HEADER => $panel->generate_header );
+
+
 	$maintemplate->param( CENTRE => $content );
     if(@{$panel->{errors}} > 0) {
         my $tmplerrors = new HTML::Template( filename => $panel->{templatedir}.'/misc/errors.tmpl' );


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/