[vhffs-dev] [1794] No more HTML::Template in admin/*/index.pl

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


Revision: 1794
Author:   beuss
Date:     2011-05-22 16:13:42 +0200 (Sun, 22 May 2011)
Log Message:
-----------
No more HTML::Template in admin/*/index.pl

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Panel/Admin.pm
    trunk/vhffs-panel/admin/bazaar/index.pl
    trunk/vhffs-panel/admin/cron/index.pl
    trunk/vhffs-panel/admin/cvs/index.pl
    trunk/vhffs-panel/admin/dns/index.pl
    trunk/vhffs-panel/admin/git/index.pl
    trunk/vhffs-panel/admin/group/index.pl
    trunk/vhffs-panel/admin/index.pl
    trunk/vhffs-panel/admin/mail/index.pl
    trunk/vhffs-panel/admin/mailinglist/index.pl
    trunk/vhffs-panel/admin/mercurial/index.pl
    trunk/vhffs-panel/admin/mysql/index.pl
    trunk/vhffs-panel/admin/pgsql/index.pl
    trunk/vhffs-panel/admin/repository/index.pl
    trunk/vhffs-panel/admin/svn/index.pl
    trunk/vhffs-panel/admin/tag/index.pl
    trunk/vhffs-panel/admin/user/index.pl
    trunk/vhffs-panel/admin/web/index.pl
    trunk/vhffs-panel/templates/Makefile.am

Added Paths:
-----------
    trunk/vhffs-panel/templates/admin/index.tt

Modified: trunk/vhffs-api/src/Vhffs/Panel/Admin.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Admin.pm	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-api/src/Vhffs/Panel/Admin.pm	2011-05-22 14:13:42 UTC (rev 1794)
@@ -75,40 +75,40 @@
 
     Vhffs::Panel::Admin::get_modo_category;
 
-Returns a hashref (CATNAME, ITEMS) where catname is the name of the
-general category for moderation and ITEMS the corresponding menu
+Returns a hashref (name, items) where catname is the name of the
+general category for moderation and items the corresponding menu
 items.
 
 =cut
 
 sub get_modo_category {
     my $items = [
-        { LINK => '/admin/stats.pl',            LABEL => gettext( 'Get Statistics' ) },
-        { LINK => '/admin/moderation.pl',       LABEL => gettext( 'Moderation' ) }
+        { link => '/admin/stats.pl',            label => gettext( 'Get Statistics' ) },
+        { link => '/admin/moderation.pl',       label => gettext( 'Moderation' ) }
     ];
-    return { CATNAME => gettext( 'General' ),   ITEMS => $items, CATTYPE => 'general' };
+    return { name => gettext( 'General' ),   items => $items, type => 'general' };
 }
 
 =head2 get_admin_category
 
     Vhffs::Panel::Admin::get_admin_category;
 
-Returns a hashref (CATNAME, ITEMS) containing general administration
+Returns a hashref (name, items) containing general administration
 items.
 
 =cut
 
 sub get_admin_category {
     my $items = [
-        { LINK => '/admin/stats.pl',            LABEL => gettext( 'Get Statistics' ) },
-        { LINK => '/admin/su.pl',               LABEL => gettext( 'Change user-id' ) },
-        { LINK => '/admin/moderation.pl',       LABEL => gettext( 'Moderation' ) },
-        { LINK => '/admin/object/list.pl',      LABEL => gettext( 'List all objects' ) },
-        { LINK => '/admin/object/search.pl',    LABEL => gettext( 'Search for an object' ) },
-        { LINK => '/admin/broadcast.pl',        LABEL => gettext( 'Mail to all hosted people' ) },
-        { LINK => '/admin/broadcast_list.pl',   LABEL => gettext( 'Manage mailings' ) }
+        { link => '/admin/stats.pl',            label => gettext( 'Get Statistics' ) },
+        { link => '/admin/su.pl',               label => gettext( 'Change user-id' ) },
+        { link => '/admin/moderation.pl',       label => gettext( 'Moderation' ) },
+        { link => '/admin/object/list.pl',      label => gettext( 'List all objects' ) },
+        { link => '/admin/object/search.pl',    label => gettext( 'Search for an object' ) },
+        { link => '/admin/broadcast.pl',        label => gettext( 'Mail to all hosted people' ) },
+        { link => '/admin/broadcast_list.pl',   label => gettext( 'Manage mailings' ) }
     ];
-    return { CATNAME => gettext( 'General' ),   ITEMS => $items, CATTYPE => 'general' };
+    return { name => gettext( 'General' ),   items => $items, type => 'general' };
 }
 
 
@@ -116,51 +116,51 @@
 
     Vhffs::Panel::Admin::get_bazaar_category;
 
-Returns a hashref (CATNAME, ITEM) containing bazaar's administration
+Returns a hashref (name, ITEM) containing bazaar's administration
 items.
 
 =cut
 
 sub get_bazaar_category {
     my $items = [
-        { LINK => '/admin/bazaar/list.pl',        LABEL => gettext( 'List all Bazaar repos' ) },
-        { LINK => '/admin/bazaar/search.pl',      LABEL => gettext( 'Search for a Bazaar repository' ) }
+        { link => '/admin/bazaar/list.pl',        label => gettext( 'List all Bazaar repos' ) },
+        { link => '/admin/bazaar/search.pl',      label => gettext( 'Search for a Bazaar repository' ) }
     ];
-    return { CATNAME => gettext( 'Bazaar Admin' ),    ITEMS => $items, CATTYPE => 'bazaar'  };
+    return { name => gettext( 'Bazaar Admin' ),    items => $items, type => 'bazaar'  };
 }
 
 =head2 get_user_category
 
     Vhffs::Panel::Admin::get_user_category;
 
-Returns a hashref (CATNAME, ITEM) containing users' administration
+Returns a hashref (name, ITEM) containing users' administration
 items.
 
 =cut
 
 sub get_user_category {
     my $items = [
-        { LINK => '/admin/user/list.pl',        LABEL => gettext( 'List all users' ) },
-        { LINK => '/admin/user/search.pl',      LABEL => gettext( 'Search for an user' ) }
+        { link => '/admin/user/list.pl',        label => gettext( 'List all users' ) },
+        { link => '/admin/user/search.pl',      label => gettext( 'Search for an user' ) }
     ];
-    return { CATNAME => gettext( 'User Admin' ),    ITEMS => $items, CATTYPE => 'user'  };
+    return { name => gettext( 'User Admin' ),    items => $items, type => 'user'  };
 }
 
 =head2 get_user_category
 
     Vhffs::Panel::Admin::get_group_category;
 
-Returns a hashref (CATNAME, ITEM) containing groups' administration
+Returns a hashref (name, ITEM) containing groups' administration
 items.
 
 =cut
 
 sub get_group_category {
     my $items = [
-        { LINK => '/admin/group/list.pl',        LABEL => gettext( 'List all groups' ) },
-        { LINK => '/admin/group/search.pl',      LABEL => gettext( 'Search for a group' ) }
+        { link => '/admin/group/list.pl',        label => gettext( 'List all groups' ) },
+        { link => '/admin/group/search.pl',      label => gettext( 'Search for a group' ) }
     ];
-    return { CATNAME => gettext( 'Group Admin' ),    ITEMS => $items, CATTYPE => 'group'  };
+    return { name => gettext( 'Group Admin' ),    items => $items, type => 'group'  };
 }
 
 
@@ -168,54 +168,54 @@
 
 	Vhffs::Panel::Admin::get_tag_cagtegory
 	
-Returns a hashref (CATNAME, ITEM, CATTYPE) containing tags'
+Returns a hashref (name, ITEM, type) containing tags'
 administration items
 
 =cut
 
 sub get_tag_category {
 	my $items = [
-		{ LINK => '/admin/tag/create.pl',			LABEL => gettext( 'Create new tag' ) },
-		{ LINK => '/admin/tag/list.pl',	LABEL => gettext( 'Manage existing tags' )},
-		{ LINK => '/admin/tag/category/create.pl',	LABEL => gettext( 'Create new category' )},
-		{ LINK => '/admin/tag/category/list.pl',	LABEL => gettext( 'Manage existing categories' )},
-		{ LINK => '/admin/tag/request/list.pl',			LABEL => gettext('Manage requests')}
+		{ link => '/admin/tag/create.pl',			label => gettext( 'Create new tag' ) },
+		{ link => '/admin/tag/list.pl',	label => gettext( 'Manage existing tags' )},
+		{ link => '/admin/tag/category/create.pl',	label => gettext( 'Create new category' )},
+		{ link => '/admin/tag/category/list.pl',	label => gettext( 'Manage existing categories' )},
+		{ link => '/admin/tag/request/list.pl',			label => gettext('Manage requests')}
 	];
-	return { CATNAME => gettext( 'Tags Admin'),		ITEMS => $items, CATTYPE => 'tags' };
+	return { name => gettext( 'Tags Admin'),		items => $items, type => 'tags' };
 }
 
 =head2 get_web_category
 
     Vhffs::Panel::Admin::get_web_category;
 
-Returns a hashref (CATNAME, ITEM) containing webareas' administration
+Returns a hashref (name, ITEM) containing webareas' administration
 items.
 
 =cut
 
 sub get_web_category {
     my $items = [
-        { LINK => '/admin/web/list.pl',        LABEL => gettext( 'List all webareas' ) },
-        { LINK => '/admin/web/search.pl',      LABEL => gettext( 'Search for a webarea' ) }
+        { link => '/admin/web/list.pl',        label => gettext( 'List all webareas' ) },
+        { link => '/admin/web/search.pl',      label => gettext( 'Search for a webarea' ) }
     ];
-    return { CATNAME => gettext( 'Web Admin' ),    ITEMS => $items, CATTYPE => 'web'  };
+    return { name => gettext( 'Web Admin' ),    items => $items, type => 'web'  };
 }
 
 =head2 get_svn_category
 
     Vhffs::Panel::Admin::get_svn_category;
 
-Returns a hashref (CATNAME, ITEM) containing svn's administration
+Returns a hashref (name, ITEM) containing svn's administration
 items.
 
 =cut
 
 sub get_svn_category {
     my $items = [
-        { LINK => '/admin/svn/list.pl',        LABEL => gettext( 'List all SVN repos' ) },
-        { LINK => '/admin/svn/search.pl',      LABEL => gettext( 'Search for a SVN repository' ) }
+        { link => '/admin/svn/list.pl',        label => gettext( 'List all SVN repos' ) },
+        { link => '/admin/svn/search.pl',      label => gettext( 'Search for a SVN repository' ) }
     ];
-    return { CATNAME => gettext( 'SVN Admin' ),    ITEMS => $items, CATTYPE => 'svn'  };
+    return { name => gettext( 'SVN Admin' ),    items => $items, type => 'svn'  };
 }
 
 
@@ -223,17 +223,17 @@
 
     Vhffs::Panel::Admin::get_cvs_category;
 
-Returns a hashref (CATNAME, ITEM) containing cvs' administration
+Returns a hashref (name, ITEM) containing cvs' administration
 items.
 
 =cut
 
 sub get_cvs_category {
     my $items = [
-        { LINK => '/admin/cvs/list.pl',        LABEL => gettext( 'List all CVS repos' ) },
-        { LINK => '/admin/cvs/search.pl',      LABEL => gettext( 'Search for a CVS repository' ) }
+        { link => '/admin/cvs/list.pl',        label => gettext( 'List all CVS repos' ) },
+        { link => '/admin/cvs/search.pl',      label => gettext( 'Search for a CVS repository' ) }
     ];
-    return { CATNAME => gettext( 'CVS Admin' ),    ITEMS => $items, CATTYPE => 'cvs'  };
+    return { name => gettext( 'CVS Admin' ),    items => $items, type => 'cvs'  };
 }
 
 
@@ -241,17 +241,17 @@
 
     Vhffs::Panel::Admin::get_git_category;
 
-Returns a hashref (CATNAME, ITEM) containing git's administration
+Returns a hashref (name, ITEM) containing git's administration
 items.
 
 =cut
 
 sub get_git_category {
     my $items = [
-        { LINK => '/admin/git/list.pl',        LABEL => gettext( 'List all Git repos' ) },
-        { LINK => '/admin/git/search.pl',      LABEL => gettext( 'Search for a Git repository' ) }
+        { link => '/admin/git/list.pl',        label => gettext( 'List all Git repos' ) },
+        { link => '/admin/git/search.pl',      label => gettext( 'Search for a Git repository' ) }
     ];
-    return { CATNAME => gettext( 'Git Admin' ),    ITEMS => $items, CATTYPE => 'git'  };
+    return { name => gettext( 'Git Admin' ),    items => $items, type => 'git'  };
 }
 
 
@@ -259,68 +259,68 @@
 
     Vhffs::Panel::Admin::get_mercurial_category;
 
-Returns a hashref (CATNAME, ITEM) containing mercurial's administration
+Returns a hashref (name, ITEM) containing mercurial's administration
 items.
 
 =cut
 
 sub get_mercurial_category {
     my $items = [
-        { LINK => '/admin/mercurial/list.pl',        LABEL => gettext( 'List all Mercurial repos' ) },
-        { LINK => '/admin/mercurial/search.pl',      LABEL => gettext( 'Search for a Mercurial repository' ) }
+        { link => '/admin/mercurial/list.pl',        label => gettext( 'List all Mercurial repos' ) },
+        { link => '/admin/mercurial/search.pl',      label => gettext( 'Search for a Mercurial repository' ) }
     ];
-    return { CATNAME => gettext( 'Mercurial Admin' ),    ITEMS => $items, CATTYPE => 'mercurial'  };
+    return { name => gettext( 'Mercurial Admin' ),    items => $items, type => 'mercurial'  };
 }
 
 =head2 get_mysql_category
 
     Vhffs::Panel::Admin::get_mysql_category;
 
-Returns a hashref (CATNAME, ITEM) containing mysql's administration
+Returns a hashref (name, ITEM) containing mysql's administration
 items.
 
 =cut
 
 sub get_mysql_category {
     my $items = [
-        { LINK => '/admin/mysql/list.pl',        LABEL => gettext( 'List all MySQL databases' ) },
-        { LINK => '/admin/mysql/search.pl',      LABEL => gettext( 'Search for a MySQL database' ) }
+        { link => '/admin/mysql/list.pl',        label => gettext( 'List all MySQL databases' ) },
+        { link => '/admin/mysql/search.pl',      label => gettext( 'Search for a MySQL database' ) }
     ];
-    return { CATNAME => gettext( 'MySQL Admin' ),    ITEMS => $items, CATTYPE => 'mysql'  };
+    return { name => gettext( 'MySQL Admin' ),    items => $items, type => 'mysql'  };
 }
 
 =head2 get_pgsql_category
 
     Vhffs::Panel::Admin::get_pgsql_category;
 
-Returns a hashref (CATNAME, ITEM) containing PostgreSQL's administration
+Returns a hashref (name, ITEM) containing PostgreSQL's administration
 items.
 
 =cut
 
 sub get_pgsql_category {
     my $items = [
-        { LINK => '/admin/pgsql/list.pl',        LABEL => gettext( 'List all Pg databases' ) },
-        { LINK => '/admin/pgsql/search.pl',      LABEL => gettext( 'Search for a Pg database' ) }
+        { link => '/admin/pgsql/list.pl',        label => gettext( 'List all Pg databases' ) },
+        { link => '/admin/pgsql/search.pl',      label => gettext( 'Search for a Pg database' ) }
     ];
-    return { CATNAME => gettext( 'PostgreSQL Admin' ),    ITEMS => $items, CATTYPE => 'pgsql'  };
+    return { name => gettext( 'PostgreSQL Admin' ),    items => $items, type => 'pgsql'  };
 }
 
 =head2 get_mail_category
 
     Vhffs::Panel::Admin::get_mail_category;
 
-Returns a hashref (CATNAME, ITEM) containing mail domains' administration
+Returns a hashref (name, ITEM) containing mail domains' administration
 items.
 
 =cut
 
 sub get_mail_category {
     my $items = [
-        { LINK => '/admin/mail/list.pl',        LABEL => gettext( 'List all mail domains' ) },
-        { LINK => '/admin/mail/search.pl',      LABEL => gettext( 'Search for a mail domain' ) }
+        { link => '/admin/mail/list.pl',        label => gettext( 'List all mail domains' ) },
+        { link => '/admin/mail/search.pl',      label => gettext( 'Search for a mail domain' ) }
     ];
-    return { CATNAME => gettext( 'Mail domains Admin' ),    ITEMS => $items, CATTYPE => 'mail'  };
+    return { name => gettext( 'Mail domains Admin' ),    items => $items, type => 'mail'  };
 }
 
 
@@ -328,17 +328,17 @@
 
     Vhffs::Panel::Admin::get_mailing_category;
 
-Returns a hashref (CATNAME, ITEM) containing mailing lists' administration
+Returns a hashref (name, ITEM) containing mailing lists' administration
 items.
 
 =cut
 
 sub get_mailing_category {
     my $items = [
-        { LINK => '/admin/mailinglist/list.pl',        LABEL => gettext( 'List all mailing lists' ) },
-        { LINK => '/admin/mailinglist/search.pl',      LABEL => gettext( 'Search for a mailing list' ) }
+        { link => '/admin/mailinglist/list.pl',        label => gettext( 'List all mailing lists' ) },
+        { link => '/admin/mailinglist/search.pl',      label => gettext( 'Search for a mailing list' ) }
     ];
-    return { CATNAME => gettext( 'Mailing lists Admin' ),    ITEMS => $items, CATTYPE => 'mailing'  };
+    return { name => gettext( 'Mailing lists Admin' ),    items => $items, type => 'mailing'  };
 }
 
 
@@ -346,17 +346,17 @@
 
     Vhffs::Panel::Admin::get_dns_category;
 
-Returns a hashref (CATNAME, ITEM) containing DNS' administration
+Returns a hashref (name, ITEM) containing DNS' administration
 items.
 
 =cut
 
 sub get_dns_category {
     my $items = [
-        { LINK => '/admin/dns/list.pl',        LABEL => gettext( 'List all domain names' ) },
-        { LINK => '/admin/dns/search.pl',      LABEL => gettext( 'Search for a domain name' ) }
+        { link => '/admin/dns/list.pl',        label => gettext( 'List all domain names' ) },
+        { link => '/admin/dns/search.pl',      label => gettext( 'Search for a domain name' ) }
     ];
-    return { CATNAME => gettext( 'DNS Admin' ),    ITEMS => $items, CATTYPE => 'dns'  };
+    return { name => gettext( 'DNS Admin' ),    items => $items, type => 'dns'  };
 }
 
 
@@ -364,41 +364,41 @@
 
     Vhffs::Panel::Admin::get_repo_category;
 
-Returns a hashref (CATNAME, ITEM) containing download repositories' administration
+Returns a hashref (name, ITEM) containing download repositories' administration
 items.
 
 =cut
 
 sub get_repo_category {
     my $items = [
-        { LINK => '/admin/repository/list.pl',        LABEL => gettext( 'List all download repositories' ) },
-        { LINK => '/admin/repository/search.pl',      LABEL => gettext( 'Search for a download repository' ) }
+        { link => '/admin/repository/list.pl',        label => gettext( 'List all download repositories' ) },
+        { link => '/admin/repository/search.pl',      label => gettext( 'Search for a download repository' ) }
     ];
-    return { CATNAME => gettext( 'Download repositories Admin' ),    ITEMS => $items, CATTYPE => 'repository'  };
+    return { name => gettext( 'Download repositories Admin' ),    items => $items, type => 'repository'  };
 }
 
 =head2 get_cron_category
 
     Vhffs::Panel::Admin::get_cron_category;
 
-Returns a hashref (CATNAME, ITEM) containing cron jobs administration
+Returns a hashref (name, ITEM) containing cron jobs administration
 items.
 
 =cut
 
 sub get_cron_category {
     my $items = [
-        { LINK => '/admin/cron/list.pl',        LABEL => gettext( 'List all cron jobs' ) },
-        { LINK => '/admin/cron/search.pl',      LABEL => gettext( 'Search for a cron job' ) }
+        { link => '/admin/cron/list.pl',        label => gettext( 'List all cron jobs' ) },
+        { link => '/admin/cron/search.pl',      label => gettext( 'Search for a cron job' ) }
     ];
-    return { CATNAME => gettext( 'Crons Admin' ),    ITEMS => $items, CATTYPE => 'cron'  };
+    return { name => gettext( 'Crons Admin' ),    items => $items, type => 'cron'  };
 }
 
 =head2 get_all_admin_categories
 
     Vhffs::Panel::Admin::get_all_admin_categories($vhffs);
 
-Return an arrayref of hashrefs (CATNAME, ITEM) containing all administration
+Return an arrayref of hashrefs (name, ITEM) containing all administration
 categories and items based on configuration of $vhffs.
 
 =cut
@@ -434,7 +434,7 @@
 
     Vhffs::Panel::Admin::get_all_modo_categories($vhffs);
 
-Return an arrayref of hashrefs (CATNAME, ITEM) containing all administration
+Return an arrayref of hashrefs (name, ITEM) containing all administration
 categories and items based on configuration of $vhffs.
 
 =cut

Modified: trunk/vhffs-panel/admin/bazaar/index.pl
===================================================================
--- trunk/vhffs-panel/admin/bazaar/index.pl	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/admin/bazaar/index.pl	2011-05-22 14:13:42 UTC (rev 1794)
@@ -32,30 +32,15 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use strict;
 
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
 use Vhffs::Panel::Admin;
 
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Admin();
 
-$panel->check_admin;
-
-my $templatedir = $panel->{templatedir};
-
-my $template = new HTML::Template(filename => $templatedir.'/panel/admin/index.tmpl');
-
 $panel->set_title( gettext('Bazaar repositories\' administration') );
-
-$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_bazaar_category ] );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('admin/index.tt', { categories => [ Vhffs::Panel::Admin::get_bazaar_category ] } );

Modified: trunk/vhffs-panel/admin/cron/index.pl
===================================================================
--- trunk/vhffs-panel/admin/cron/index.pl	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/admin/cron/index.pl	2011-05-22 14:13:42 UTC (rev 1794)
@@ -32,30 +32,15 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use strict;
 
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
 use Vhffs::Panel::Admin;
 
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Admin();
 
-$panel->check_admin;
-
-my $templatedir = $panel->{templatedir};
-
-my $template = new HTML::Template(filename => $templatedir.'/panel/admin/index.tmpl');
-
 $panel->set_title(gettext('Cron jobs\' administration'));
-
-$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_cron_category ] );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('admin/index.tt', { categories => [ Vhffs::Panel::Admin::get_cron_category ] } );

Modified: trunk/vhffs-panel/admin/cvs/index.pl
===================================================================
--- trunk/vhffs-panel/admin/cvs/index.pl	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/admin/cvs/index.pl	2011-05-22 14:13:42 UTC (rev 1794)
@@ -32,30 +32,15 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use strict;
 
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
 use Vhffs::Panel::Admin;
 
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Admin();
 
-$panel->check_admin;
-
-my $templatedir = $panel->{templatedir};
-
-my $template = new HTML::Template(filename => $templatedir.'/panel/admin/index.tmpl');
-
 $panel->set_title(gettext('CVS repositories\' administration'));
-
-$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_cvs_category ] );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('admin/index.tt', { categories => [ Vhffs::Panel::Admin::get_cvs_category ] } );

Modified: trunk/vhffs-panel/admin/dns/index.pl
===================================================================
--- trunk/vhffs-panel/admin/dns/index.pl	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/admin/dns/index.pl	2011-05-22 14:13:42 UTC (rev 1794)
@@ -32,7 +32,6 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use strict;
@@ -42,20 +41,7 @@
 use Vhffs::Panel::Main;
 use Vhffs::Panel::Admin;
 
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Admin();
 
-$panel->check_admin;
-
-my $templatedir = $panel->{templatedir};
-
-my $template = new HTML::Template(filename => $templatedir.'/panel/admin/index.tmpl');
-
 $panel->set_title(gettext('DNS\' administration'));
-
-$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_dns_category ] );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('admin/index.tt', { categories => [ Vhffs::Panel::Admin::get_dns_category ] } );

Modified: trunk/vhffs-panel/admin/git/index.pl
===================================================================
--- trunk/vhffs-panel/admin/git/index.pl	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/admin/git/index.pl	2011-05-22 14:13:42 UTC (rev 1794)
@@ -33,30 +33,15 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use strict;
 
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
 use Vhffs::Panel::Admin;
 
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Admin();
 
-$panel->check_admin;
-
-my $templatedir = $panel->{templatedir};
-
-my $template = new HTML::Template(filename => $templatedir.'/panel/admin/index.tmpl');
-
 $panel->set_title( gettext('GIT repositories\' administration') );
-
-$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_git_category ] );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('admin/index.tt', { categories =>[ Vhffs::Panel::Admin::get_git_category ] } );

Modified: trunk/vhffs-panel/admin/group/index.pl
===================================================================
--- trunk/vhffs-panel/admin/group/index.pl	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/admin/group/index.pl	2011-05-22 14:13:42 UTC (rev 1794)
@@ -32,30 +32,15 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use strict;
 
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
 use Vhffs::Panel::Admin;
 
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Admin();
 
-$panel->check_admin;
-
-my $templatedir = $panel->{templatedir};
-
-my $template = new HTML::Template(filename => $templatedir.'/panel/admin/index.tmpl');
-
 $panel->set_title(gettext('Groups\' administration'));
-
-$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_group_category ] );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('admin/index.tt', { categories => [ Vhffs::Panel::Admin::get_group_category ] } );

Modified: trunk/vhffs-panel/admin/index.pl
===================================================================
--- trunk/vhffs-panel/admin/index.pl	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/admin/index.pl	2011-05-22 14:13:42 UTC (rev 1794)
@@ -32,22 +32,17 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use strict;
 
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
+use Vhffs::Panel::Admin;
+use Vhffs::Panel::Modo;
 
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Modo();
 
-$panel->check_modo;
-
 my $templatedir = $panel->{templatedir};
 my $user = $panel->{user};
 my $template = new HTML::Template(filename => $templatedir.'/panel/admin/index.tmpl');
@@ -55,15 +50,12 @@
 $panel->set_title(gettext('Administration'));
 
 my $categories = [];
-my $items;
-my $c;
 if( $user->is_moderator ) { 
     $categories = Vhffs::Panel::Admin::get_all_modo_categories($panel->{vhffs});
 } else {
     $categories = Vhffs::Panel::Admin::get_all_admin_categories($panel->{vhffs});
 }
 
-$template->param( CATEGORIES => $categories );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('admin/index.tt', {
+    categories => $categories
+});

Modified: trunk/vhffs-panel/admin/mail/index.pl
===================================================================
--- trunk/vhffs-panel/admin/mail/index.pl	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/admin/mail/index.pl	2011-05-22 14:13:42 UTC (rev 1794)
@@ -32,30 +32,15 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use strict;
 
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
 use Vhffs::Panel::Admin;
 
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Admin();
 
-$panel->check_admin;
-
-my $templatedir = $panel->{templatedir};
-
-my $template = new HTML::Template(filename => $templatedir.'/panel/admin/index.tmpl');
-
 $panel->set_title(gettext('Mail domains\' administration'));
-
-$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_mail_category ] );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('admin/index.tt', { categories => [ Vhffs::Panel::Admin::get_mail_category ] } );

Modified: trunk/vhffs-panel/admin/mailinglist/index.pl
===================================================================
--- trunk/vhffs-panel/admin/mailinglist/index.pl	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/admin/mailinglist/index.pl	2011-05-22 14:13:42 UTC (rev 1794)
@@ -32,30 +32,15 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use strict;
 
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
 use Vhffs::Panel::Admin;
 
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Admin();
 
-$panel->check_admin;
-
-my $templatedir = $panel->{templatedir};
-
-my $template = new HTML::Template(filename => $templatedir.'/panel/admin/index.tmpl');
-
 $panel->set_title(gettext('Mailing lists\' administration'));
-
-$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_mailing_category ] );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('admin/index.tt', { categories => [ Vhffs::Panel::Admin::get_mailing_category ] } );

Modified: trunk/vhffs-panel/admin/mercurial/index.pl
===================================================================
--- trunk/vhffs-panel/admin/mercurial/index.pl	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/admin/mercurial/index.pl	2011-05-22 14:13:42 UTC (rev 1794)
@@ -32,30 +32,15 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use strict;
 
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
 use Vhffs::Panel::Admin;
 
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Admin();
 
-$panel->check_admin;
-
-my $templatedir = $panel->{templatedir};
-
-my $template = new HTML::Template(filename => $templatedir.'/panel/admin/index.tmpl');
-
 $panel->set_title( gettext('Mercurial repositories\' administration') );
-
-$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_mercurial_category ] );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('admin/index.tt', { categories => [ Vhffs::Panel::Admin::get_mercurial_category ] } );

Modified: trunk/vhffs-panel/admin/mysql/index.pl
===================================================================
--- trunk/vhffs-panel/admin/mysql/index.pl	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/admin/mysql/index.pl	2011-05-22 14:13:42 UTC (rev 1794)
@@ -32,30 +32,15 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use strict;
 
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
 use Vhffs::Panel::Admin;
 
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Admin();
 
-$panel->check_admin;
-
-my $templatedir = $panel->{templatedir};
-
-my $template = new HTML::Template(filename => $templatedir.'/panel/admin/index.tmpl');
-
 $panel->set_title(gettext('MySQL databases\' administration'));
-
-$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_mysql_category ] );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('admin/index.tt', { categories => [ Vhffs::Panel::Admin::get_mysql_category ] } );

Modified: trunk/vhffs-panel/admin/pgsql/index.pl
===================================================================
--- trunk/vhffs-panel/admin/pgsql/index.pl	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/admin/pgsql/index.pl	2011-05-22 14:13:42 UTC (rev 1794)
@@ -32,30 +32,15 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use strict;
 
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
 use Vhffs::Panel::Admin;
 
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Admin();
 
-$panel->check_admin;
-
-my $templatedir = $panel->{templatedir};
-
-my $template = new HTML::Template(filename => $templatedir.'/panel/admin/index.tmpl');
-
 $panel->set_title(gettext('PostgreSQL databases\' administration'));
-
-$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_pgsql_category ] );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('admin/index.tt', { categories => [ Vhffs::Panel::Admin::get_pgsql_category ] } );

Modified: trunk/vhffs-panel/admin/repository/index.pl
===================================================================
--- trunk/vhffs-panel/admin/repository/index.pl	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/admin/repository/index.pl	2011-05-22 14:13:42 UTC (rev 1794)
@@ -32,30 +32,15 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use strict;
 
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
 use Vhffs::Panel::Admin;
 
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Admin();
 
-$panel->check_admin;
-
-my $templatedir = $panel->{templatedir};
-
-my $template = new HTML::Template(filename => $templatedir.'/panel/admin/index.tmpl');
-
 $panel->set_title(gettext('Download repositories\' administration'));
-
-$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_repo_category ] );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('admin/index.tt', { categories => [ Vhffs::Panel::Admin::get_repo_category ] } );

Modified: trunk/vhffs-panel/admin/svn/index.pl
===================================================================
--- trunk/vhffs-panel/admin/svn/index.pl	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/admin/svn/index.pl	2011-05-22 14:13:42 UTC (rev 1794)
@@ -32,30 +32,15 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use strict;
 
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
 use Vhffs::Panel::Admin;
 
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Admin();
 
-$panel->check_admin;
-
-my $templatedir = $panel->{templatedir};
-
-my $template = new HTML::Template(filename => $templatedir.'/panel/admin/index.tmpl');
-
 $panel->set_title(gettext('SVN repositories\' administration'));
-
-$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_svn_category ] );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('admin/index.tt', { categories => [ Vhffs::Panel::Admin::get_svn_category ] } );

Modified: trunk/vhffs-panel/admin/tag/index.pl
===================================================================
--- trunk/vhffs-panel/admin/tag/index.pl	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/admin/tag/index.pl	2011-05-22 14:13:42 UTC (rev 1794)
@@ -32,30 +32,16 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use strict;
 
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
+use Vhffs::Panel::Modo;
 use Vhffs::Panel::Admin;
 
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Modo();
 
-$panel->check_modo;
-
-my $templatedir = $panel->{templatedir};
-
-my $template = new HTML::Template(filename => $templatedir.'/panel/admin/index.tmpl');
-
 $panel->set_title(gettext('Tags\' administration'));
-
-$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_tag_category ] );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('admin/index.tt', { categories => [ Vhffs::Panel::Admin::get_tag_category ] } );

Modified: trunk/vhffs-panel/admin/user/index.pl
===================================================================
--- trunk/vhffs-panel/admin/user/index.pl	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/admin/user/index.pl	2011-05-22 14:13:42 UTC (rev 1794)
@@ -32,30 +32,15 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use strict;
 
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
 use Vhffs::Panel::Admin;
 
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Admin();
 
-$panel->check_admin;
-
-my $templatedir = $panel->{templatedir};
-
-my $template = new HTML::Template(filename => $templatedir.'/panel/admin/index.tmpl');
-
 $panel->set_title(gettext('Users\' administration'));
-
-$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_user_category ] );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('admin/index.tt', { categories => [ Vhffs::Panel::Admin::get_user_category ] } );

Modified: trunk/vhffs-panel/admin/web/index.pl
===================================================================
--- trunk/vhffs-panel/admin/web/index.pl	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/admin/web/index.pl	2011-05-22 14:13:42 UTC (rev 1794)
@@ -32,30 +32,15 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use strict;
 
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
 use Vhffs::Panel::Admin;
 
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Admin();
 
-$panel->check_admin;
-
-my $templatedir = $panel->{templatedir};
-
-my $template = new HTML::Template(filename => $templatedir.'/panel/admin/index.tmpl');
-
 $panel->set_title(gettext('Webareas\' administration'));
-
-$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_web_category ] );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('admin/index.tt', { categories => [ Vhffs::Panel::Admin::get_web_category ] } );

Modified: trunk/vhffs-panel/templates/Makefile.am
===================================================================
--- trunk/vhffs-panel/templates/Makefile.am	2011-05-22 14:13:33 UTC (rev 1793)
+++ trunk/vhffs-panel/templates/Makefile.am	2011-05-22 14:13:42 UTC (rev 1794)
@@ -72,6 +72,7 @@
 	misc/simplemsg.tmpl \
 	acl/form.tt \
 	acl/view.tt \
+	admin/index.tt \
 	admin/object/edit.tt \
 	anonymous/account_created.tt \
 	anonymous/login.tt \

Added: trunk/vhffs-panel/templates/admin/index.tt
===================================================================
--- trunk/vhffs-panel/templates/admin/index.tt	                        (rev 0)
+++ trunk/vhffs-panel/templates/admin/index.tt	2011-05-22 14:13:42 UTC (rev 1794)
@@ -0,0 +1,10 @@
+[% FOREACH c IN categories %]
+    <fieldset>
+        <legend>[% c.name | html %]</legend>
+        <ul class="[% c.type | html %]List">
+[% FOREACH i IN c.items %]
+            <li><a href="[% i.link | html %]">[% i.label %]</a></li>
+[% END %]
+        </ul>
+    </fieldset>
+[% END # c IN categories %]


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