[vhffs-dev] [480] Use TMPL_LOOP for all table building.

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


Revision: 480
Author:   beuss
Date:     2007-02-18 14:39:36 +0000 (Sun, 18 Feb 2007)

Log Message:
-----------
Use TMPL_LOOP for all table building.
Code is much simpler to read, and will be much more when Vhffs::Panel::* will return hashes wich do not need post processing.
Fixed an internal server error in objects' list.

Modified Paths:
--------------
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Object.pm
    branches/vhffs_4.1/vhffs-panel/admin/group/list.pl
    branches/vhffs_4.1/vhffs-panel/admin/mailing/list.pl
    branches/vhffs_4.1/vhffs-panel/admin/mysql/list.pl
    branches/vhffs_4.1/vhffs-panel/admin/object/list.pl
    branches/vhffs_4.1/vhffs-panel/admin/pgsql/list.pl
    branches/vhffs_4.1/vhffs-panel/admin/repository/list.pl
    branches/vhffs_4.1/vhffs-panel/admin/svn/list.pl
    branches/vhffs_4.1/vhffs-panel/admin/user/list.pl
    branches/vhffs_4.1/vhffs-panel/admin/web/list.pl
    branches/vhffs_4.1/vhffs-panel/templates/admin/group/part-modo.tmpl
    branches/vhffs_4.1/vhffs-panel/templates/admin/group/part.tmpl
    branches/vhffs_4.1/vhffs-panel/templates/admin/mailing/part.tmpl
    branches/vhffs_4.1/vhffs-panel/templates/admin/mysql/part-modo.tmpl
    branches/vhffs_4.1/vhffs-panel/templates/admin/mysql/part.tmpl
    branches/vhffs_4.1/vhffs-panel/templates/admin/object/part.tmpl
    branches/vhffs_4.1/vhffs-panel/templates/admin/pgsql/part-modo.tmpl
    branches/vhffs_4.1/vhffs-panel/templates/admin/pgsql/part.tmpl
    branches/vhffs_4.1/vhffs-panel/templates/admin/repository/part-modo.tmpl
    branches/vhffs_4.1/vhffs-panel/templates/admin/repository/part.tmpl
    branches/vhffs_4.1/vhffs-panel/templates/admin/svn/part-modo.tmpl
    branches/vhffs_4.1/vhffs-panel/templates/admin/svn/part.tmpl
    branches/vhffs_4.1/vhffs-panel/templates/admin/user/part-modo.tmpl
    branches/vhffs_4.1/vhffs-panel/templates/admin/user/part.tmpl
    branches/vhffs_4.1/vhffs-panel/templates/admin/web/part-modo.tmpl
    branches/vhffs_4.1/vhffs-panel/templates/admin/web/part.tmpl


Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Object.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Object.pm	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Object.pm	2007-02-18 14:39:36 UTC (rev 480)
@@ -455,14 +455,14 @@
 	if( defined $name )
 	{
         $name = '%'.$name.'%';
-        $query = 'SELECT o.object_id, o.owner_uid, o.date_creation , o.state , o.description, o.type FROM vhffs_object o INNER JOIN vhffs_users u ON o.owner_uid = u.uid WHERE ( o.description LIKE ? ) OR ( o.object_id LIKE ? ) OR ( o.owner_uid LIKE ? ) OR ( state LIKE ? ) OR ( u.username LIKE ? )';
+        $query = 'SELECT o.object_id, o.owner_uid, o.date_creation , o.description, o.state, o.type FROM vhffs_object o INNER JOIN vhffs_users u ON o.owner_uid = u.uid WHERE ( o.description LIKE ? ) OR ( o.object_id LIKE ? ) OR ( o.owner_uid LIKE ? ) OR ( state LIKE ? ) OR ( u.username LIKE ? ) ORDER BY object_id';
         $request = $vhffs->get_db_object->prepare( $query ) or return -1;
 
         return undef if ( !$request->execute( $name, $name, $name, $name, $name ));
 	}
 	else
 	{
-		$query = 'SELECT o.object_id, o.owner_uid, o.date_creation , o.state , o.description, o.type FROM vhffs_object o';
+		$query = 'SELECT o.object_id, o.owner_uid, o.date_creation , o.description, o.state, o.type FROM vhffs_object o ORDER BY object_id';
 		$request = $vhffs->get_db_object->prepare( $query ) or return -1;
 
     	return undef if ( !$request->execute() );

Modified: branches/vhffs_4.1/vhffs-panel/admin/group/list.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/group/list.pl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/admin/group/list.pl	2007-02-18 14:39:36 UTC (rev 480)
@@ -96,32 +96,30 @@
 	my $group;
 	if( defined $groups )
 	{
-		my $output = "";
+        my $subtemplate;
+        my $tmplgroups;
+        my $send;
+        if( $user->is_admin == 1 )  {
+            $subtemplate = new HTML::Template( filename => $templatedir."/admin/group/part.tmpl" );
+            $send = gettext("Modify this group");
+        }  else  {
+            $subtemplate = new HTML::Template( filename => $templatedir."/admin/group/part-modo.tmpl" );
+            $send = gettext("Show this group");
+        }
+                                                                
 
 		foreach $group ( @{$groups} )
 		{
-			my $subtemplate;
-
-			if( $user->is_admin == 1 )  {
-				$subtemplate = new HTML::Template( filename => $templatedir."/admin/group/part.tmpl" );
-			}  else  {
-				$subtemplate = new HTML::Template( filename => $templatedir."/admin/group/part-modo.tmpl" );
-			}
-
-			$subtemplate->param( GROUPNAME => $group->get_groupname );
-			$subtemplate->param( USERNAME => $group->get_owner_username );
-			
-			$subtemplate->param( STATE => Vhffs::Functions::status_string_from_status_id( $group->get_status ) );
-		
-			if( $user->is_admin == 1 )  {
-				$subtemplate->param( SEND => gettext("Modify this group") );
-			}  else  {
-				$subtemplate->param( SEND => gettext("Show this group") );
-			}
-
-			$output .= $subtemplate->output;
+            
+			push(@$tmplgroups, {
+                GROUPNAME => $group->get_groupname,
+                USERNAME => $group->get_owner_username,
+                STATE => Vhffs::Functions::status_string_from_status_id( $group->get_status ),
+                SEND => $send
+            });
 		}
-		$template->param( LIST => $output );
+        $subtemplate->param( GROUPS => $tmplgroups );
+		$template->param( LIST => $subtemplate->output );
 	}
 }
 

Modified: branches/vhffs_4.1/vhffs-panel/admin/mailing/list.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/mailing/list.pl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/admin/mailing/list.pl	2007-02-18 14:39:36 UTC (rev 480)
@@ -94,38 +94,30 @@
 
     if( defined $lists )
     {
-	my $output = "";
-	foreach( @{$lists} )
-	{
-	    my $subtemplate;
-	    if( $user->is_admin == 1 )  
-	    {
-		$subtemplate = new HTML::Template( filename => $templatedir."/admin/mailing/part.tmpl" );
-	    }  
-	    else  
-	    {
-		$subtemplate = new HTML::Template( filename => $templatedir."/admin/mailing/part.tmpl" );
-	    }
+        my $subtemplate = new HTML::Template( filename => $templatedir."/admin/mailing/part.tmpl" );
+        my $send;
+        if( $user->is_admin == 1 )  {
+            $send = gettext("Modify this list");
+        }  else  {
+            $send = gettext("Show this list");
+        }
 
-
-	    $subtemplate->param( DOMAIN => $_->get_domain );
-	    $subtemplate->param( LPART => $_->get_localpart );
-	    $subtemplate->param( GROUP => Vhffs::Group::get_name_by_gid( $vhffs , $_->get_ownergid ));
-	    $subtemplate->param( OID => $_->get_oid );
+        my $tmpllists;
+                                                                                            
+    	foreach( @{$lists} )
+	    {
+            push(@$tmpllists, {
+                DOMAIN => $_->get_domain,
+                LPART => $_->get_localpart,
+                GROUP => Vhffs::Group::get_name_by_gid( $vhffs , $_->get_ownergid ),
+                OID => $_->get_oid,
+                STATE => Vhffs::Functions::status_string_from_status_id( $_->get_status ),
+                SEND => $send
+            });
 	    
-	    
-	    $subtemplate->param( STATE => Vhffs::Functions::status_string_from_status_id( $_->get_status ) );
-	    
-	    
-	    if( $user->is_admin == 1 )  {
-		$subtemplate->param( SEND => gettext("Modify this list") );
-	    }  else  {
-		$subtemplate->param( SEND => gettext("Show this list") );
-	    }
-	    
-	    $output .= $subtemplate->output;
-			     }
-	    $template->param( LIST => $output );
+	     }
+         $subtemplate->param( LISTS => $tmpllists );
+         $template->param( LIST => $subtemplate->output );
 	}
 	
 

Modified: branches/vhffs_4.1/vhffs-panel/admin/mysql/list.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/mysql/list.pl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/admin/mysql/list.pl	2007-02-18 14:39:36 UTC (rev 480)
@@ -94,46 +94,30 @@
 
 	if( defined $dbs )
 	{
-		my $output = "";
-		foreach( sort ( keys %{$dbs} ) )
-		{
-			my $subtemplate;
-			if( $user->is_admin == 1 )  {
-				$subtemplate = new HTML::Template( filename => $templatedir."/admin/mysql/part.tmpl" )
-			}  else  {
-				$subtemplate = new HTML::Template( filename => $templatedir."/admin/mysql/part-modo.tmpl" )
-			}
+        my $tmpldbs;
+        my $subtemplate;
+        my $send;
 
-			$subtemplate->param( DBNAME => $dbs->{$_}{'dbname'} ) if( defined $dbs->{$_}{'dbname'} );
-			$subtemplate->param( GROUP => Vhffs::Group::get_name_by_gid( $vhffs , $dbs->{$_}{'owner_gid'} ) ) if( defined $dbs->{$_}{'owner_gid'} );
-			$subtemplate->param( OID => $dbs->{$_}{'object_id'} ) if( defined $dbs->{$_}{'object_id'} );
+        if( $user->is_admin == 1 )  {
+            $subtemplate = new HTML::Template( filename => $templatedir.'/admin/mysql/part.tmpl' );
+            $send = gettext('Modify this MySQL area');
+        } else {
+            $subtemplate = new HTML::Template( filename => $templatedir.'/admin/mysql/part-modo.tmpl' );
+            $send = gettext('Show this MySQL area');
+        }
 
-			if( $dbs->{$_}{'state'} == Vhffs::Constants::WAITING_FOR_CREATION )
-			{
-				$subtemplate->param( STATE => gettext("Waiting for creation") );
-			}
-			elsif( $dbs->{$_}{'state'} == Vhffs::Constants::ACTIVATED )
-			{
-				$subtemplate->param( STATE => gettext("Activated") );
-			}
-			elsif( $dbs->{$_}{'state'} == Vhffs::Constants::TO_DELETE )
-			{
-				$subtemplate->param( STATE => gettext("Waiting for delete") );
-			}
-			elsif( $dbs->{$_}{'state'} == Vhffs::Constants::WAITING_FOR_VALIDATION )
-			{
-				$subtemplate->param( STATE => gettext("Waiting for validation") );
-			}
-			
-			if( $user->is_admin == 1 )  {
-				$subtemplate->param( SEND => gettext("Modify this MySQL area") );
-			}  else  {
-				$subtemplate->param( SEND => gettext("Show this MySQL area") );
-			}
-
-			$output .= $subtemplate->output;
+		foreach( sort ( keys %{$dbs} ) )
+		{
+            push(@$tmpldbs, {
+               DBNAME => $dbs->{$_}{'dbname'},
+               GROUP => Vhffs::Group::get_name_by_gid( $vhffs , $dbs->{$_}{'owner_gid'} ),
+               OID => $dbs->{$_}{'object_id'},
+               SEND => $send,
+               STATE => gettext(Vhffs::Functions::status_string_from_status_id($dbs->{$_}->{state}))
+            });
 		}
-		$template->param( LIST => $output );
+        $subtemplate->param(DBS => $tmpldbs);
+		$template->param( LIST => $subtemplate->output );
 	}
 	
 

Modified: branches/vhffs_4.1/vhffs-panel/admin/object/list.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/object/list.pl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/admin/object/list.pl	2007-02-18 14:39:36 UTC (rev 480)
@@ -92,40 +92,23 @@
 
 	my $objs = Vhffs::Object::getall( $vhffs , $name );
 
-	if( defined $objs )
-	{
-		my $output = "";
-		foreach( sort {$a - $b} ( keys %{$objs} ) )
+	if( defined $objs ) {
+        my $subtemplate = new HTML::Template( filename => "$templatesdir/admin/object/part.tmpl" );
+        my $tmplobjects;
+        my $send = gettext('Edit this object');
+        my $history = gettext('History');
+		foreach(@$objs)
 		{
-			my $subtemplate;
-			$subtemplate = new HTML::Template( filename => "$templatesdir/admin/object/part.tmpl" );
-
-			$subtemplate->param( USER => Vhffs::User::get_name_by_uid( $vhffs , $objs->{$_}{'owner_uid'} ) ) if( defined $objs->{$_}{'owner_uid'} );
-			$subtemplate->param( HISTORY => gettext("History") );
-			$subtemplate->param( OID => $objs->{$_}{'object_id'} ) if( defined $objs->{$_}{'object_id'} );
-
-			if( $objs->{$_}{'state'} == Vhffs::Constants::WAITING_FOR_CREATION )
-			{
-				$subtemplate->param( STATE => gettext("Waiting for creation") );
-			}
-			elsif( $objs->{$_}{'state'} == Vhffs::Constants::ACTIVATED )
-			{
-				$subtemplate->param( STATE => gettext("Activated") );
-			}
-			elsif( $objs->{$_}{'state'} == Vhffs::Constants::TO_DELETE )
-			{
-				$subtemplate->param( STATE => gettext("Waiting for delete") );
-			}
-			elsif( $objs->{$_}{'state'} == Vhffs::Constants::WAITING_FOR_VALIDATION )
-			{
-				$subtemplate->param( STATE => gettext("Waiting for validation") );
-			}
-			
-			$subtemplate->param( SEND => gettext("Edit this object") );
-
-			$output .= $subtemplate->output;
+			push(@$tmplobjects, {
+                USER => Vhffs::User::get_name_by_uid( $vhffs , $_->{owner_uid} ),
+                HISTORY => gettext('History'),
+                OID => $_->{object_id},
+                STATE => Vhffs::Functions::status_string_from_status_id($_->{state}),
+                SEND => $send
+            });
 		}
-		$template->param( LIST => $output );
+        $subtemplate->param(OBJECTS => $tmplobjects);
+		$template->param( LIST => $subtemplate->output );
 	}
 	
 

Modified: branches/vhffs_4.1/vhffs-panel/admin/pgsql/list.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/pgsql/list.pl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/admin/pgsql/list.pl	2007-02-18 14:39:36 UTC (rev 480)
@@ -95,46 +95,29 @@
 
 	if( defined $dbs )
 	{
-		my $output = "";
+        my $subtemplate;
+        my $send;
+        my $tmpldbs;
+        if( $user->is_admin == 1 )  {
+            $subtemplate = new HTML::Template( filename => $templatedir.'/admin/pgsql/part.tmpl' );
+            $send = gettext("Modify this PostgreSQL database");
+        }  else  {
+            $subtemplate = new HTML::Template( filename => $templatedir.'/admin/pgsql/part-modo.tmpl' );
+            $send = gettext("Show this PostgreSQL database");
+        }
+
 		foreach( sort ( keys %{$dbs} ) )
 		{
-			my $subtemplate;
-			if( $user->is_admin == 1 )  {
-				$subtemplate = new HTML::Template( filename => $templatedir."/admin/pgsql/part.tmpl" );
-			}  else  {
-				$subtemplate = new HTML::Template( filename => $templatedir."/admin/pgsql/part-modo.tmpl" );
-			}
-
-			$subtemplate->param( DBNAME => $dbs->{$_}{'dbname'} ) if( defined $dbs->{$_}{'dbname'} );
-			$subtemplate->param( GROUP => Vhffs::Group::get_name_by_gid( $vhffs , $dbs->{$_}{'owner_gid'} ) ) if( defined $dbs->{$_}{'owner_gid'} );
-			$subtemplate->param( OID => $dbs->{$_}{'object_id'} ) if( defined $dbs->{$_}{'object_id'} );
-
-			if( $dbs->{$_}{'state'} == Vhffs::Constants::WAITING_FOR_CREATION )
-			{
-				$subtemplate->param( STATE => gettext("Waiting for creation") );
-			}
-			elsif( $dbs->{$_}{'state'} == Vhffs::Constants::ACTIVATED )
-			{
-				$subtemplate->param( STATE => gettext("Activated") );
-			}
-			elsif( $dbs->{$_}{'state'} == Vhffs::Constants::TO_DELETE )
-			{
-				$subtemplate->param( STATE => gettext("Waiting for delete") );
-			}
-			elsif( $dbs->{$_}{'state'} == Vhffs::Constants::WAITING_FOR_VALIDATION )
-			{
-				$subtemplate->param( STATE => gettext("Waiting for validation") );
-			}
-			
-			if( $user->is_admin == 1 )  {
-				$subtemplate->param( SEND => gettext("Modify this PostgreSQL database") );
-			}  else  {
-				$subtemplate->param( SEND => gettext("Show this PostgreSQL database") );
-			}
-
-			$output .= $subtemplate->output;
+            push(@$tmpldbs, {
+                DBNAME => $dbs->{$_}{'dbname'},
+                GROUP => Vhffs::Group::get_name_by_gid( $vhffs , $dbs->{$_}{'owner_gid'} ),
+                OID => $dbs->{$_}{'object_id'},
+                STATE => gettext( Vhffs::Functions::status_string_from_status_id( $dbs->{$_}{'state'} ) ),
+                SEND => $send
+            });
 		}
-		$template->param( LIST => $output );
+        $subtemplate->param( DBS => $tmpldbs );
+		$template->param( LIST => $subtemplate->output );
 	}
 	
 

Modified: branches/vhffs_4.1/vhffs-panel/admin/repository/list.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/repository/list.pl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/admin/repository/list.pl	2007-02-18 14:39:36 UTC (rev 480)
@@ -96,29 +96,29 @@
 
 	if( defined $repos )
 	{
+        my $subtemplate;
+        my $send;
+        my $tmplrepos;
+        if( $user->is_admin == 1 )  {
+            $subtemplate = new HTML::Template( filename => "$templatesdir/admin/repository/part.tmpl" );
+            $send = gettext('Modify this Download repository');
+        }  else  {
+            $subtemplate = new HTML::Template( filename => "$templatesdir/admin/repository/part-modo.tmpl" );
+            $send = gettext('Show this Download repository');
+        }
+                                                                
 		foreach $repo ( @{$repos} )
 		{
-			my $subtemplate;
-			if( $user->is_admin == 1 )  {
-				$subtemplate = new HTML::Template( filename => "$templatesdir/admin/repository/part.tmpl" );
-			}  else  {
-				$subtemplate = new HTML::Template( filename => "$templatesdir/admin/repository/part-modo.tmpl" );
-			}
-
-			$subtemplate->param( NAME => $repo->get_name );
-			$subtemplate->param( GROUP => $repo->get_group->get_groupname );
-			$subtemplate->param( OID => $repo->get_oid );
-			$subtemplate->param( STATE => gettext( Vhffs::Functions::status_string_from_status_id( $repo->get_status ) ) );
-			
-			if( $user->is_admin == 1 )  {
-				$subtemplate->param( SEND => gettext("Modify this Download repository") );
-			}  else  {
-				$subtemplate->param( SEND => gettext("Show this Download repository") );
-			}
-
-			$output .= $subtemplate->output;
+            push( @$tmplrepos, {
+                NAME => $repo->get_name,
+                GROUP => $repo->get_group->get_groupname,
+                OID => $repo->get_oid,
+                STATE => gettext( Vhffs::Functions::status_string_from_status_id( $repo->get_status ) ),
+                SEND => $send
+            });
 		}
-		$template->param( LIST => $output );
+        $subtemplate->param( REPOSITORIES => $tmplrepos );
+		$template->param( LIST => $subtemplate->output );
 	}
 	
 

Modified: branches/vhffs_4.1/vhffs-panel/admin/svn/list.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/svn/list.pl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/admin/svn/list.pl	2007-02-18 14:39:36 UTC (rev 480)
@@ -88,28 +88,33 @@
 
 	if( defined $repos )
 	{
-		my $output = "";
-		foreach $svn ( @{$repos} )
+		my $subtemplate;
+        my $send;
+        my $tmplsvn;
+		if( $user->is_admin == 1 )  {
+			$subtemplate = new HTML::Template( filename => "$templatesdir/admin/svn/part.tmpl" );
+            $send =  gettext('Modify this Subversion repository');
+		}  else  {
+			$subtemplate = new HTML::Template( filename => "$templatesdir/admin/svn/part-modo.tmpl" );
+		}
+        foreach $svn ( @{$repos} )
 		{
-			my $subtemplate;
-			if( $user->is_admin == 1 )  {
-				$subtemplate = new HTML::Template( filename => "$templatesdir/admin/svn/part.tmpl" );
-			}  else  {
-				$subtemplate = new HTML::Template( filename => "$templatesdir/admin/svn/part-modo.tmpl" );
-			}
-			$subtemplate->param( SVNROOT => $svn->get_reponame );
-			$subtemplate->param( GROUP => $svn->get_group->get_groupname );
-			$subtemplate->param( OID => $svn->get_oid );
-			$subtemplate->param( STATE => Vhffs::Functions::status_string_from_status_id( $svn->get_status ) );
+            my $svnhash = {
+                SVNROOT => $svn->get_reponame,
+                GROUP => $svn->get_group->get_groupname,
+                OID => $svn->get_oid,
+                STATE => Vhffs::Functions::status_string_from_status_id( $svn->get_status )
+            };
 
 			if( $user->is_admin == 1 )  {
-				$subtemplate->param( CGIGROUP => $svn->get_group->get_groupname  );
-				$subtemplate->param( SEND => gettext("Modify this Subversion repository") );
+                $svnhash->{CGIGROUP} = $svn->get_group->get_groupname;
+                $svnhash->{SEND} = $send;
 			}
 
-			$output .= $subtemplate->output;
+            push( @$tmplsvn, $svnhash );
 		}
-		$template->param( LIST => $output );
+        $subtemplate->param( SVNREPOS => $tmplsvn);
+		$template->param( LIST => $subtemplate->output );
 	}
 	
 

Modified: branches/vhffs_4.1/vhffs-panel/admin/user/list.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/user/list.pl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/admin/user/list.pl	2007-02-18 14:39:36 UTC (rev 480)
@@ -97,32 +97,31 @@
 
 	if( defined $users )
 	{
-		my $output = "";
+		my $subtemplate;
+        my $tmplusers;
+        my $send;
+
+		if( $user->is_admin == 1 )  {
+			$subtemplate = new HTML::Template( filename => $templatedir.'/admin/user/part.tmpl' );
+            $send = gettext('Modify this user');
+		}  else  {
+			$subtemplate = new HTML::Template( filename => $templatedir.'/admin/user/part-modo.tmpl' );
+            $send = gettext('Show this user');
+		}
+
 		foreach $u ( @{$users} ) 
 		{
-			my $subtemplate;
+            push (@$tmplusers, {
+                NAME => $u->get_username,
+                FIRSTNAME => $u->get_firstname,
+                LASTNAME => $u->get_lastname,
+                STATE => gettext( Vhffs::Functions::status_string_from_status_id( $u->get_status ) ),
+                SEND => $send
+            });
 
-			if( $user->is_admin == 1 )  {
-				$subtemplate = new HTML::Template( filename => $templatedir."/admin/user/part.tmpl" );
-			}  else  {
-				$subtemplate = new HTML::Template( filename => $templatedir."/admin/user/part-modo.tmpl" );
-			}
-
-			$subtemplate->param( NAME => $u->get_username );
-			$subtemplate->param( FIRSTNAME => $u->get_firstname);
-			$subtemplate->param( LASTNAME => $u->get_lastname );
-
-			$subtemplate->param( STATE => gettext( Vhffs::Functions::status_string_from_status_id( $u->get_status ) ) );
-
-			if( $user->is_admin == 1 )  {
-				$subtemplate->param( SEND => gettext("Modify this user") );
-			} else  {
-				$subtemplate->param( SEND => gettext("Show this user") );
-			}
-
-			$output .= $subtemplate->output;
 		}
-		$template->param( LIST => $output );
+        $subtemplate->param( USERS => $tmplusers );
+		$template->param( LIST => $subtemplate->output );
 	}
 	
 

Modified: branches/vhffs_4.1/vhffs-panel/admin/web/list.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/admin/web/list.pl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/admin/web/list.pl	2007-02-18 14:39:36 UTC (rev 480)
@@ -95,26 +95,30 @@
 	my $web;
 	if( defined $webs )
 	{
-		my $output = "";
-		foreach $web ( @{$webs} )
-		{
-			my $subtemplate;
+		my $subtemplate;
+        my $send;
+        my $tmplwebs;
 
-			if( $user->is_admin == 1 )  {
-				$subtemplate = new HTML::Template( filename => $templatedir."/admin/web/part.tmpl" );
-			}  else   {
-				$subtemplate = new HTML::Template( filename => $templatedir."/admin/web/part-modo.tmpl" );
-			}
+    	if( $user->is_admin == 1 )  {
+			$subtemplate = new HTML::Template( filename => $templatedir."/admin/web/part.tmpl" );
+            $send = gettext('Change this Website');
+		}  else   {
+			$subtemplate = new HTML::Template( filename => $templatedir."/admin/web/part-modo.tmpl" );
+            $send = gettext('Show this Website');
+		}
 
-			$subtemplate->param( SERVERNAME => $web->get_servername );
-			$subtemplate->param( GROUP => $web->get_group->get_groupname );
-			$subtemplate->param( OID => $web->get_oid );
-			$subtemplate->param( STATE => Vhffs::Functions::status_string_from_status_id( $web->get_status ) );
-			$subtemplate->param( SEND => gettext("Change this Website") );
+	    foreach $web ( @{$webs} ) {
+            push( @$tmplwebs, {
+                SERVERNAME => $web->get_servername,
+                GROUP => $web->get_group->get_groupname,
+                OID => $web->get_oid,
+                STATE => Vhffs::Functions::status_string_from_status_id( $web->get_status ),
+                SEND => $send
+            });
 			
-			$output .= $subtemplate->output;
 		}
-		$template->param( LIST => $output );
+        $subtemplate->param( WEBS => $tmplwebs );
+		$template->param( LIST => $subtemplate->output );
 	}
 	
 

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/group/part-modo.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/group/part-modo.tmpl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/group/part-modo.tmpl	2007-02-18 14:39:36 UTC (rev 480)
@@ -1,4 +1,4 @@
-
+<TMPL_LOOP NAME="GROUPS">
 <tr>
 	<td>
 	<TMPL_VAR NAME="GROUPNAME">
@@ -17,4 +17,4 @@
 		</form>
 		</td>
 </tr>
-
+</TMPL_LOOP>

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/group/part.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/group/part.tmpl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/group/part.tmpl	2007-02-18 14:39:36 UTC (rev 480)
@@ -1,4 +1,4 @@
-
+<TMPL_LOOP NAME="GROUPS">
 <tr>
 	<td>
 	<TMPL_VAR NAME="GROUPNAME">
@@ -17,4 +17,4 @@
 		</form>
 		</td>
 </tr>
-
+</TMPL_LOOP>

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/mailing/part.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/mailing/part.tmpl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/mailing/part.tmpl	2007-02-18 14:39:36 UTC (rev 480)
@@ -1,4 +1,4 @@
-
+<TMPL_LOOP VAR="LISTS">
 <tr>
 	<td>
 		<TMPL_VAR NAME="LPART">@<TMPL_VAR NAME="DOMAIN">
@@ -19,4 +19,4 @@
 		</form>
 	</td>
 </tr>
-
+</TMPL_LOOP>

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/mysql/part-modo.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/mysql/part-modo.tmpl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/mysql/part-modo.tmpl	2007-02-18 14:39:36 UTC (rev 480)
@@ -1,4 +1,4 @@
-
+<TMPL_LOOP NAME="DBS">
 <tr>
 	<td>
 		<TMPL_VAR NAME="DBNAME">
@@ -17,4 +17,4 @@
 		</form>
 	</td>
 </tr>
-
+</TMPL_LOOP>

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/mysql/part.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/mysql/part.tmpl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/mysql/part.tmpl	2007-02-18 14:39:36 UTC (rev 480)
@@ -1,4 +1,4 @@
-
+<TMPL_LOOP NAME="DBS">
 <tr>
 	<td>
 		<TMPL_VAR NAME="DBNAME">
@@ -17,4 +17,4 @@
 		</form>
 	</td>
 </tr>
-
+</TMPL_LOOP>

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/object/part.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/object/part.tmpl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/object/part.tmpl	2007-02-18 14:39:36 UTC (rev 480)
@@ -1,4 +1,4 @@
-
+<TMPL_LOOP NAME="OBJECTS">
 <tr>
 	<td>
 		<TMPL_VAR NAME="OID">
@@ -19,4 +19,4 @@
 		</form>
 	</td>
 </tr>
-
+</TMPL_LOOP>

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/pgsql/part-modo.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/pgsql/part-modo.tmpl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/pgsql/part-modo.tmpl	2007-02-18 14:39:36 UTC (rev 480)
@@ -1,4 +1,4 @@
-
+<TMPL_LOOP NAME="DBS">
 <tr>
 	<td>
 		<TMPL_VAR NAME="DBNAME">
@@ -17,4 +17,4 @@
 		</form>
 	</td>
 </tr>
-
+</TMPL_LOOP>

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/pgsql/part.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/pgsql/part.tmpl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/pgsql/part.tmpl	2007-02-18 14:39:36 UTC (rev 480)
@@ -1,4 +1,4 @@
-
+<TMPL_LOOP NAME="DBS">
 <tr>
 	<td>
 		<TMPL_VAR NAME="DBNAME">
@@ -17,4 +17,4 @@
 		</form>
 	</td>
 </tr>
-
+</TMPL_LOOP>

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/repository/part-modo.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/repository/part-modo.tmpl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/repository/part-modo.tmpl	2007-02-18 14:39:36 UTC (rev 480)
@@ -1,4 +1,4 @@
-
+<TMPL_LOOP NAME="REPOSITORIES">
 <tr>
 	<td>
 		<TMPL_VAR NAME="NAME">
@@ -17,4 +17,4 @@
 		</form>
 	</td>
 </tr>
-
+</TMPL_LOOP>

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/repository/part.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/repository/part.tmpl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/repository/part.tmpl	2007-02-18 14:39:36 UTC (rev 480)
@@ -1,4 +1,4 @@
-
+<TMPL_LOOP NAME="REPOSITORIES">
 <tr>
 	<td>
 		<TMPL_VAR NAME="NAME">
@@ -17,4 +17,4 @@
 		</form>
 	</td>
 </tr>
-
+</TMPL_LOOP>

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/svn/part-modo.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/svn/part-modo.tmpl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/svn/part-modo.tmpl	2007-02-18 14:39:36 UTC (rev 480)
@@ -1,4 +1,4 @@
-
+<TMPL_LOOP NAME="SVNREPOS">
 <tr>
 	<td>
 		<TMPL_VAR NAME="SVNROOT">
@@ -10,4 +10,4 @@
 		<TMPL_VAR NAME="STATE"> 
 	</td>
 </tr>
-
+</TMPL_LOOP>

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/svn/part.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/svn/part.tmpl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/svn/part.tmpl	2007-02-18 14:39:36 UTC (rev 480)
@@ -1,4 +1,4 @@
-
+<TMPL_LOOP NAME="SVNREPOS">
 <tr>
 	<td>
 		<TMPL_VAR NAME="SVNROOT">
@@ -18,4 +18,4 @@
 		</form>
 	</td>
 </tr>
-
+</TMPL_LOOP>

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/user/part-modo.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/user/part-modo.tmpl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/user/part-modo.tmpl	2007-02-18 14:39:36 UTC (rev 480)
@@ -1,4 +1,4 @@
-
+<TMPL_LOOP NAME="USERS">
 <tr>
 	<td>
 	<TMPL_VAR NAME="NAME">
@@ -20,4 +20,4 @@
 		</form>
 	</td>
 </tr>
-
+</TMPL_LOOP>

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/user/part.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/user/part.tmpl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/user/part.tmpl	2007-02-18 14:39:36 UTC (rev 480)
@@ -1,4 +1,4 @@
-
+<TMPL_LOOP NAME="USERS">
 <tr>
 	<td>
 	<TMPL_VAR NAME="NAME">
@@ -17,4 +17,4 @@
 		</form>
 	</td>
 </tr>
-
+</TMPL_LOOP>

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/web/part-modo.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/web/part-modo.tmpl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/web/part-modo.tmpl	2007-02-18 14:39:36 UTC (rev 480)
@@ -1,4 +1,4 @@
-
+<TMPL_LOOP NAME="WEBS">
 <tr>
 	<td>
 		<a href="http://<TMPL_VAR NAME="SERVERNAME">"><TMPL_VAR NAME="SERVERNAME"></a>
@@ -17,4 +17,4 @@
 		</form>
 	</td>
 </tr>
-
+</TMPL_LOOP>

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/web/part.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/web/part.tmpl	2007-02-17 23:38:12 UTC (rev 479)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/web/part.tmpl	2007-02-18 14:39:36 UTC (rev 480)
@@ -1,4 +1,4 @@
-
+<TMPL_LOOP NAME="WEBS">
 <tr>
 	<td>
 		<a href="http://<TMPL_VAR NAME="SERVERNAME">"><TMPL_VAR NAME="SERVERNAME"></a>
@@ -17,4 +17,4 @@
 		</form>
 	</td>
 </tr>
-
+</TMPL_LOOP>


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