[vhffs-dev] [1362] Merging vhffs-design into trunk. |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1362
Author: beuss
Date: 2009-03-10 09:08:59 +0100 (Tue, 10 Mar 2009)
Log Message:
-----------
Merging vhffs-design into trunk. Some hacks are hidden in this commit to ensure panel function
Modified Paths:
--------------
trunk/vhffs-api/src/Vhffs/Functions.pm
trunk/vhffs-api/src/Vhffs/Makefile.am
trunk/vhffs-api/src/Vhffs/Panel/Commons.pm
trunk/vhffs-api/src/Vhffs/Panel/Group.pm
trunk/vhffs-api/src/Vhffs/Panel/Main.pm
trunk/vhffs-api/src/Vhffs/Panel/Tag.pm
trunk/vhffs-api/src/Vhffs/Panel/User.pm
trunk/vhffs-intl/POTFILES.in
trunk/vhffs-intl/update-POTFILES.in.sh
trunk/vhffs-panel/Makefile.am
trunk/vhffs-public/Makefile.am
trunk/vhffs-public/allgroups.pl
trunk/vhffs-public/group.pl
trunk/vhffs-public/groupsearch.pl
trunk/vhffs-public/index.pl
trunk/vhffs-public/lastusers.pl
trunk/vhffs-public/templates/Makefile.am
trunk/vhffs-public/usersearch.pl
trunk/vhffs-themes/Makefile.am
Added Paths:
-----------
trunk/vhffs-api/src/Vhffs/Panel/Public.pm
trunk/vhffs-panel/js/dijit/
trunk/vhffs-panel/js/dojo/
trunk/vhffs-panel/js/public.js
trunk/vhffs-panel/js/vhffs/
trunk/vhffs-public/avatar.pl
trunk/vhffs-public/groupsearch_form.pl
trunk/vhffs-public/templates/common/
trunk/vhffs-public/templates/content/
trunk/vhffs-public/templates/layouts/
trunk/vhffs-public/templates/parts/
trunk/vhffs-public/usersearch_form.pl
trunk/vhffs-themes/light-grey/
Removed Paths:
-------------
trunk/vhffs-public/allwebsites.pl
trunk/vhffs-public/getavatar.pl
trunk/vhffs-public/tagsearch.pl
trunk/vhffs-public/templates/banner.tmpl
trunk/vhffs-public/templates/group.tmpl
trunk/vhffs-public/templates/group_part.tmpl
trunk/vhffs-public/templates/groupslist.tmpl
trunk/vhffs-public/templates/index.tmpl
trunk/vhffs-public/templates/misc/
trunk/vhffs-public/templates/simplemsg.tmpl
trunk/vhffs-public/templates/user.tmpl
trunk/vhffs-public/templates/user_part.tmpl
trunk/vhffs-public/templates/userslist.tmpl
trunk/vhffs-public/templates/websiteslist.tmpl
trunk/vhffs-public/user.pl
trunk/vhffs-public/websitesearch.pl
Modified: trunk/vhffs-api/src/Vhffs/Functions.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Functions.pm 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-api/src/Vhffs/Functions.pm 2009-03-10 08:08:59 UTC (rev 1362)
@@ -323,11 +323,10 @@
}
if($tech eq 'swap') {
my @both = split /@/, $mail;
- $mail = ${@both}[1].'/'.${@both}[0];
+ return $both[1].'/'.$both[0];
}
- warn("Unsupported email obfuscation method !\n");
- return $mail;
+ return "Unsupported email obfuscation method !\n";
}
=head2 js_encode_mail
Modified: trunk/vhffs-api/src/Vhffs/Makefile.am
===================================================================
--- trunk/vhffs-api/src/Vhffs/Makefile.am 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-api/src/Vhffs/Makefile.am 2009-03-10 08:08:59 UTC (rev 1362)
@@ -34,6 +34,7 @@
Panel/Mysql.pm \
Panel/Object.pm \
Panel/Pgsql.pm \
+ Panel/Public.pm \
Panel/Repository.pm \
Panel/Svn.pm \
Panel/Tag.pm \
Modified: trunk/vhffs-api/src/Vhffs/Panel/Commons.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Commons.pm 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-api/src/Vhffs/Panel/Commons.pm 2009-03-10 08:08:59 UTC (rev 1362)
@@ -136,6 +136,46 @@
}
}
+=head2 get_pager
+ get_pager($current_page, $total, $item_per_page, $url, $url_params)
+=cut
+
+sub get_pager {
+ my ($current_page, $total, $ipp, $slider_size, $url, $url_params) = @_;
+ my $last_page = int( ($total + $ipp - 1 ) / $ipp);
+ my $pager = {};
+
+ if($last_page > 1) {
+ $pager->{last_page} = $last_page;
+ $pager->{current_page} = $current_page;
+ $pager->{url} = $url;
+
+ my @params = ();
+ foreach my $key (keys %$url_params) {
+ my $value = $url_params->{$key};
+ if(ref($value) eq 'ARRAY') {
+ push @params, $key.'='.$_ foreach(@$value);
+ } else {
+ push @params, $key.'='.$value unless($value =~ /^\s*$/);
+ }
+ }
+ $pager->{query_string} = join('&', @params);
+ my $pages = [];
+ for( ( ($current_page - $slider_size > 0) ? $current_page - $slider_size : 1 )..($current_page - 1) ) {
+ push @$pages, $_;
+ }
+ $pager->{previous_pages} = $pages;
+
+ $pages = [];
+ for( ($current_page + 1)..(($current_page + $slider_size <= $last_page) ? $current_page + $slider_size : $last_page ) ) {
+ push @$pages, $_;
+ }
+ $pager->{next_pages} = $pages;
+ }
+
+ return $pager;
+}
+
=head2
fetch_slice_and_count($main, $select, $conditions, $order, $start, $count, $params, $select_callback);
Modified: trunk/vhffs-api/src/Vhffs/Panel/Group.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Group.pm 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-api/src/Vhffs/Panel/Group.pm 2009-03-10 08:08:59 UTC (rev 1362)
@@ -80,7 +80,7 @@
my $main = shift;
my @groups;
- my $sql = 'SELECT g.gid, g.groupname, g.realname, o.description FROM vhffs_groups g LEFT OUTER JOIN vhffs_users u ON u.username=g.groupname INNER JOIN vhffs_object o ON o.object_id=g.object_id WHERE o.state=? AND u.username IS NULL ORDER BY o.date_creation DESC LIMIT 10';
+ my $sql = 'SELECT g.gid, g.groupname, g.realname, o.description, owner.username AS owner_name FROM vhffs_groups g LEFT OUTER JOIN vhffs_users u ON u.username=g.groupname INNER JOIN vhffs_object o ON o.object_id=g.object_id INNER JOIN vhffs_users owner ON owner.uid = o.owner_uid WHERE o.state=? AND u.username IS NULL ORDER BY o.date_creation DESC LIMIT 10';
return fetch_groups_and_users($main, $sql, Vhffs::Constants::ACTIVATED);
}
@@ -113,26 +113,58 @@
sub public_search {
- my ($main, $groupname, $description, $start, $count) = @_;
+ my ($main, $groupname, $description, $included_tags, $excluded_tags, $start) = @_;
- my $select_clause = 'SELECT g.gid, g.groupname, g.realname, o.description';
- my $restriction = ' FROM vhffs_groups g LEFT OUTER JOIN vhffs_users u ON u.username=g.groupname INNER JOIN vhffs_object o ON o.object_id=g.object_id WHERE o.state = ? AND u.username IS NULL';
- my @params;
+ my $sql =
+' FROM vhffs_groups g
+ LEFT OUTER JOIN vhffs_users u ON u.username=g.groupname
+ INNER JOIN vhffs_object o ON o.object_id=g.object_id
+ INNER JOIN vhffs_users owner ON owner.uid = o.owner_uid
+ WHERE o.state=? AND u.username IS NULL';
+
+ my @params;
push @params, Vhffs::Constants::ACTIVATED;
-
- if(defined $groupname) {
- # groupnames are enforced in lowercase
- $restriction .= ' AND g.groupname LIKE ?';
- push @params, '%'.lc($groupname).'%';
- }
-
- if(defined $description) {
- $restriction .= ' AND description ILIKE ?';
- push @params, '%'.$description.'%';
- }
-
- return Vhffs::Panel::Commons::fetch_slice_and_count($main, $select_clause, $restriction,
- ' ORDER BY g.groupname', $start, $count, \@params, \&Vhffs::Panel::Group::fetch_groups_and_users);
+
+ if($groupname =~ /\S/) {
+ $sql .= ' AND g.groupname ILIKE ?';
+ push @params, '%'.$groupname.'%';
+ }
+
+ if($description =~ /\S/) {
+ $sql .= ' AND o.description ILIKE ? ';
+ push @params, '%'.$description.'%';
+ }
+
+ if(scalar(@$included_tags)) {
+ $sql .= ' AND o.object_id IN (SELECT ot.object_id from vhffs_object_tag ot WHERE ot.tag_id IN(?';
+ $sql .= ', ?' x (scalar(@$included_tags) - 1);
+ $sql .= '))';
+ push @params, @$included_tags;
+ }
+
+ if(scalar(@$excluded_tags)) {
+ $sql .= ' AND o.object_id NOT IN (SELECT ot.object_id from vhffs_object_tag ot WHERE ot.tag_id IN(?';
+ $sql .= ', ?' x (scalar(@$excluded_tags) - 1);
+ $sql .= '))';
+ push @params, @$excluded_tags;
+ }
+
+ my $limit = ' LIMIT 10';
+ $limit .= ' OFFSET '.($start * 10) if(defined $start);
+
+ my $dbh = $main->get_db_object();
+ my $sth = $dbh->prepare('SELECT g.gid, g.groupname, g.realname, o.description, owner.username AS owner_name'.$sql.' ORDER BY groupname '.$limit);
+
+ return undef unless ( $sth->execute(@params) );
+
+ my $groups = $sth->fetchall_arrayref({});
+
+ $sth = $dbh->prepare('SELECT COUNT(*)'.$sql);
+ return undef unless ( $sth->execute(@params) );
+
+ my ($count) = $sth->fetchrow_array();
+
+ return ($groups, $count);
}
sub getall_groups_per_user
@@ -190,8 +222,12 @@
my ($main, $letter, $starting, $count) = @_;
my @params;
- my $select_clause = 'SELECT g.gid, g.groupname, g.realname, o.description';
- my $sql = ' FROM vhffs_groups g LEFT OUTER JOIN vhffs_users u ON u.username=g.groupname INNER JOIN vhffs_object o ON o.object_id=g.object_id WHERE o.state=? AND u.username IS NULL';
+ my $select_clause = 'SELECT g.gid, g.groupname, g.realname, o.description, owner.username as owner_name';
+ my $sql = ' FROM vhffs_groups g '.
+ 'LEFT OUTER JOIN vhffs_users u ON u.username=g.groupname '.
+ 'INNER JOIN vhffs_object o ON o.object_id=g.object_id '.
+ 'INNER JOIN vhffs_users owner ON owner.uid = o.owner_uid '.
+ 'WHERE o.state=? AND u.username IS NULL';
push @params, Vhffs::Constants::ACTIVATED;
if(defined $letter) {
$sql .= ' AND SUBSTR(g.groupname, 1, 1) = ?';
@@ -214,7 +250,6 @@
$sth->execute(@params);
while(my $row = $sth->fetchrow_hashref) {
$ssth->execute($row->{gid});
- $row->{description} = Vhffs::Panel::Main::format_description($row->{description});
$row->{users} = $ssth->fetchall_arrayref({});
push @groups, $row;
}
Modified: trunk/vhffs-api/src/Vhffs/Panel/Main.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Main.pm 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-api/src/Vhffs/Panel/Main.pm 2009-03-10 08:08:59 UTC (rev 1362)
@@ -272,6 +272,7 @@
my $cgi = new CGI;
$cgi->charset('UTF-8');
$this->{cgi} = $cgi;
+ $this->{url} = CGI::url();
my $vhffs = init Vhffs::Main;
$this->{vhffs} = $vhffs;
@@ -303,7 +304,7 @@
$theme = CGI->cookie('theme') unless defined $theme;
$theme = $config->get_panel->{'default_theme'} unless defined $theme;
$theme = 'vhffs' unless( defined $theme && -f $config->get_panel->{'themesdir'}.'/'.$theme.'/main.css' );
- $this->{theme} = $theme;
+ $this->{theme} = 'vhffs';
my $template = new HTML::Template( filename => $templatedir.'/panel/main/main.tmpl' );
$this->{template} = $template;
@@ -329,6 +330,9 @@
$this->display;
exit 0;
}
+
+ $this->{is_ajax_request} = (defined $this->{cgi}->http('X-Requested-With')
+ and $this->{cgi}->http('X-Requested-With') eq 'XMLHttpRequest');
return $this;
}
Copied: trunk/vhffs-api/src/Vhffs/Panel/Public.pm (from rev 1361, branches/vhffs-design/vhffs-api/src/Vhffs/Panel/Public.pm)
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Public.pm (rev 0)
+++ trunk/vhffs-api/src/Vhffs/Panel/Public.pm 2009-03-10 08:08:59 UTC (rev 1362)
@@ -0,0 +1,112 @@
+#!%PERL%
+# Copyright (c) vhffs project and its contributors
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+#3. Neither the name of vhffs nor the names of its contributors
+# may be used to endorse or promote products derived from this
+# software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+use strict;
+use utf8;
+
+package Vhffs::Panel::Public;
+
+use base qw(Vhffs::Panel::Main);
+
+use locale;
+use Locale::gettext;
+use POSIX qw(locale_h);
+
+use Template;
+
+use lib '%VHFFS_LIB_DIR%';
+use Vhffs::Tag;
+
+sub new {
+ my $class = shift;
+ my $panel = $class->SUPER::new(@_);
+ $panel->check_public();
+ return $panel;
+}
+
+sub render {
+ my ($self, $file, $vars) = @_;
+ my $conf = $self->{vhffs}->get_config;
+
+ # TODO Should be in parent class when Template::Toolkit switch is over
+ my $create_vars = {
+ INCLUDE_PATH => $self->{templatedir}.'/public/',
+ FILTERS => {
+ i18n => \&gettext,
+ mail => sub {
+ return Vhffs::Functions::obfuscate_email($self->{vhffs}, $_[0]);
+ },
+ # Format filter accept only one argument
+ # pretty_print can 'sprintf' anything, use it as
+ # [% '%s is €%d' | pretty_print(article, price)]
+ pretty_print => [sub {
+ my $context = shift;
+ my @args = @_;
+ return sub {
+ my $format = shift;
+ return sprintf($format, @args);
+ }
+ }, 1]
+ }
+ };
+
+
+ $vars = {} unless(defined $vars);
+
+ #TODO Read theme from config file
+ $vars->{theme} = $conf->get_panel->{default_theme} unless(defined $vars->{theme});
+ $vars->{left} = 'parts/left-menu.tt' unless(defined $vars->{left});
+ $vars->{right} = 'parts/tags-cloud.tt' unless(defined $vars->{right});
+ $vars->{top} = 'parts/top-menu.tt' unless(defined $vars->{top});
+ $vars->{panel_url} = $conf->get_panel->{url};
+ $vars->{help_url} = $conf->get_panel->{url_help};
+
+ # Handling ajax stuff
+ if($self->{is_ajax_request}) {
+
+ } else {
+ $create_vars->{PROCESS} = 'layouts/public.tt';
+ $vars->{popular_tags} = Vhffs::Tag::get_most_popular_tags($self->{vhffs});
+ $vars->{random_tags} = Vhffs::Tag::get_random_tags($self->{vhffs});
+ }
+
+ my $template = new Template($create_vars);
+
+ binmode STDOUT , ':utf8';
+
+ print CGI->header( -cookie=>[ @{$self->{cookies}} ], -type=>'text/html', -charset=>'utf-8' );
+
+ $template->process($file, $vars)
+ || die('Error while processing template: '.$template->error());
+
+}
+
+1;
\ No newline at end of file
Modified: trunk/vhffs-api/src/Vhffs/Panel/Tag.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Tag.pm 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-api/src/Vhffs/Panel/Tag.pm 2009-03-10 08:08:59 UTC (rev 1362)
@@ -54,6 +54,15 @@
=cut
+=head2 get_groups
+
+ Vhffs::Panel::Tag::get_groups($main, $tag_id, $start, $count)
+
+Fetches C<$count> groups associated to tag #C<$tag_id> starting
+at index C<$start>
+
+=cut
+
sub get_groups {
my ($main, $tag_id, $start, $count) = @_;
@@ -71,4 +80,40 @@
' ORDER BY g.groupname', $start, $count, \@params, \&Vhffs::Panel::Group::fetch_groups_and_users);
}
+sub get_by_tag_ids {
+
+ my $main = shift;
+ my @ids = @_;
+ return _get_by_tag_ids($main, 0, @ids);
+}
+
+sub get_all_excluding {
+ my $main = shift;
+ my @ids = @_;
+ return _get_by_tag_ids($main, 1, @ids);
+}
+
+sub _get_by_tag_ids {
+ my $main = shift;
+ my $exclude = shift;
+ my @ids = @_;
+
+ # There can be no ID if we are in exclude mode (meaning
+ # that we want all tags)
+
+ return undef unless($exclude || scalar(@ids) > 0);
+
+ my $sql = 'SELECT c.tag_category_id AS category_id, c.label AS category_label, t.tag_id, t.label AS tag_label '.
+ 'FROM vhffs_tag t INNER JOIN vhffs_tag_category c ON c.tag_category_id = t.category_id ';
+
+ if(scalar(@ids)) {
+ $sql .= 'WHERE tag_id '.($exclude ? 'NOT ' : '').'IN(?';
+ $sql .= ', ?' x (scalar(@ids) - 1);
+ $sql .= ') ORDER BY c.label, t.label';
+ }
+
+ my $dbh = $main->get_db_object;
+ return $dbh->selectall_arrayref($sql, { Slice => {} }, @ids);
+}
+
1;
Modified: trunk/vhffs-api/src/Vhffs/Panel/User.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/User.pm 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-api/src/Vhffs/Panel/User.pm 2009-03-10 08:08:59 UTC (rev 1362)
@@ -84,12 +84,22 @@
sub get_last_users
{
- my $main = shift;
+ my ($main) = @_;
- return if ( !defined $main );
-
- my $sql = 'SELECT u.uid, u.username, u.firstname, u.lastname FROM vhffs_users u INNER JOIN vhffs_object o ON o.object_id=u.object_id WHERE o.state=? ORDER BY o.date_creation DESC LIMIT 10';
- return fetch_users_and_groups($main, $sql, Vhffs::Constants::ACTIVATED);
+ my $sql = 'SELECT u.uid, u.username, u.firstname, u.lastname '.
+ 'FROM vhffs_users u '.
+ 'INNER JOIN vhffs_object o ON o.object_id=u.object_id '.
+ 'WHERE o.state=? ORDER BY o.date_creation DESC LIMIT 10';
+
+ my $dbh = $main->get_db_object();
+
+ my $users = $dbh->selectall_hashref($sql, 'uid', undef, Vhffs::Constants::ACTIVATED);
+
+ fill_groups($main, $users);
+
+ my @val = values(%$users);
+
+ return \@val;
}
sub search {
@@ -119,34 +129,88 @@
return $users;
}
+=head2 public_search
+
+ $users = Vhffs::Panel::User::public_search($vhffs, $username, $start);
+
+Returns all users whose username contains C<$username>.
+
+=cut
+
sub public_search {
- my ($main, $username, $firstname, $lastname, $start, $count) = @_;
+ my ($main, $username, $start) = @_;
my $result = {};
- my $select_clause = 'SELECT u.uid, u.username, u.firstname, u.lastname';
- my $restriction = ' FROM vhffs_users u INNER JOIN vhffs_object o ON o.object_id = u.object_id WHERE o.state = ?';
+ my $select_clause = 'SELECT u.uid, u.username, u.firstname, u.lastname ';
+ my $sql =
+ 'FROM vhffs_users u '.
+ 'INNER JOIN vhffs_object o ON o.object_id = u.object_id '.
+ 'WHERE o.state = ? ';
my @params;
push @params, Vhffs::Constants::ACTIVATED;
if(defined $username) {
# usernames are enforced in lowercase
- $restriction .= ' AND username LIKE ?';
- push @params, '%'.lc($username).'%';
+ $sql .= ' AND username ILIKE ?';
+ push @params, '%'.$username.'%';
}
- if(defined $firstname) {
- $restriction .= ' AND firstname ILIKE ?';
- push @params, '%'.$firstname.'%';
- }
+ my $limit = ' LIMIT 10';
+ $limit .= ' OFFSET '.($start * 10) if(defined $start);
+
+ my $dbh = $main->get_db_object();
+
+ my $users = $dbh->selectall_hashref($select_clause.$sql.' ORDER BY u.username '.$limit, 'uid', undef, @params);
+
+ my ($count) = $dbh->selectrow_array('SELECT COUNT(*) '.$sql, undef, @params);
+
+ fill_groups($main, $users);
+
+ my @val = values(%$users);
+
+ # We've to sort manualy since we use a hash
+ @val = sort { $a->{username} cmp $b->{username}} @val;
+
+ return (\@val, $count);
+}
- if(defined $lastname) {
- $restriction .= ' AND lastname ILIKE ?';
- push @params, '%'.$lastname.'%';
- }
+=head2 fill_groups
- my $order = ' ORDER BY u.username';
+ Vhffs::Panel::User::fill_groups($main, $users);
- return Vhffs::Panel::Commons::fetch_slice_and_count($main, $select_clause, $restriction, $order, $start, $count, \@params, \&fetch_users_and_groups);
+C<$users> is a HASHREF indexed by uid containing at least
+the C<uid> field. It is modified inplace to add a field
+C<groups> containing the names of the groups the user belongs
+to.
+
+=cut
+
+sub fill_groups {
+ my ($main, $users) =@_;
+
+ my $dbh = $main->get_db_object();
+ my @uids = ();
+
+ foreach my $uid(keys(%$users)) {
+ push @uids, $uid;
+ }
+
+ # Fetch all groups in one shot
+ my $sql = 'SELECT g.groupname, u.uid FROM vhffs_groups g '.
+ 'INNER JOIN vhffs_user_group ug ON ug.gid = g.gid '.
+ 'INNER JOIN vhffs_users u ON u.uid = ug.uid '.
+ 'WHERE g.groupname != u.username AND u.uid IN ( '.join(', ', @uids).') '.
+ 'ORDER BY g.groupname';
+
+ my $groups = $dbh->selectall_arrayref($sql, { Slice => {}});
+ my $i = 0;
+
+ foreach my $g(@$groups) {
+ if(!exists $users->{$g->{uid}}{groups}) {
+ $users->{$g->{uid}}{groups} = [];
+ }
+ push(@{$users->{$g->{uid}}{groups}}, $g->{groupname});
+ }
}
sub fetch_users_and_groups {
Modified: trunk/vhffs-intl/POTFILES.in
===================================================================
--- trunk/vhffs-intl/POTFILES.in 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-intl/POTFILES.in 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,287 +1,318 @@
-vhffs-intl/extra_strings.pl
-vhffs-intl/template_strings.pl
+vhffs-public/tt-test.pl
+vhffs-public/index.pl
+vhffs-public/allgroups.pl
+vhffs-public/group.pl
+vhffs-public/groupsearch.pl
+vhffs-public/allwebsites.pl
+vhffs-public/lastgroups.pl
+vhffs-public/getavatar.pl
+vhffs-public/websitesearch.pl
+vhffs-public/usersearch.pl
+vhffs-public/user.pl
+vhffs-public/tagsearch.pl
+vhffs-public/lastusers.pl
+vhffs-public/extern/newusersrss.pl
+vhffs-public/extern/newgroupsrss.pl
+vhffs-public/extern/stats.pl
+vhffs-jabber/vhffspipe.pl
+vhffs-robots/src/mysql_delete.pl
+vhffs-robots/src/mail_delete.pl
+vhffs-robots/src/dns_delete.pl
vhffs-robots/src/git_delete.pl
+vhffs-robots/src/object_cleanup.pl
+vhffs-robots/src/user_cleanup.pl
vhffs-robots/src/group_getquota.pl
-vhffs-robots/src/dns_create.pl
-vhffs-robots/src/pgsql_delete.pl
-vhffs-robots/src/cvs_fixperms.pl
-vhffs-robots/src/pgsql_dump.pl
-vhffs-robots/src/cvs_create.pl
-vhffs-robots/src/group_create.pl
-vhffs-robots/src/group_setquota.pl
-vhffs-robots/src/cvs_viewvcconf.pl
-vhffs-robots/src/listengine_publicarchives.pl
-vhffs-robots/src/mysql_delete.pl
-vhffs-robots/src/svn_create.pl
-vhffs-robots/src/mysql_dump.pl
vhffs-robots/src/web_stats.pl
-vhffs-robots/src/pgsql_modify.pl
-vhffs-robots/src/mailinglist_create.pl
-vhffs-robots/src/svn_viewvcconf.pl
-vhffs-robots/src/user_delete.pl
-vhffs-robots/src/web_create.pl
-vhffs-robots/src/repository_delete.pl
-vhffs-robots/src/svn_public.pl
+vhffs-robots/src/user_create.pl
+vhffs-robots/src/mail_create.pl
+vhffs-robots/src/user_getquota.pl
+vhffs-robots/src/cron_create.pl
+vhffs-robots/src/svn_delete.pl
vhffs-robots/src/mail_deleteboxes.pl
-vhffs-robots/src/mail_create.pl
-vhffs-robots/src/dns_delete.pl
-vhffs-robots/src/git_create.pl
-vhffs-robots/src/mail_createboxes.pl
-vhffs-robots/src/pgsql_create.pl
+vhffs-robots/src/svn_websvn.pl
vhffs-robots/src/mysql_modify.pl
-vhffs-robots/src/object_cleanup.pl
+vhffs-robots/src/svn_public.pl
vhffs-robots/src/cvs_delete.pl
vhffs-robots/src/group_delete.pl
+vhffs-robots/src/user_group.pl
+vhffs-robots/src/pgsql_dump.pl
+vhffs-robots/src/dns_create.pl
+vhffs-robots/src/user_delete.pl
+vhffs-robots/src/cron_delete.pl
+vhffs-robots/src/listengine_publicarchives.pl
+vhffs-robots/src/pgsql_create.pl
+vhffs-robots/src/web_create.pl
+vhffs-robots/src/mailinglist_create.pl
+vhffs-robots/src/mailinglist_delete.pl
vhffs-robots/src/mailing.pl
+vhffs-robots/src/mail_createboxes.pl
+vhffs-robots/src/svn_create.pl
+vhffs-robots/src/web_delete.pl
+vhffs-robots/src/git_create.pl
+vhffs-robots/src/user_setquota.pl
vhffs-robots/src/git_public.pl
-vhffs-robots/src/user_cleanup.pl
-vhffs-robots/src/user_getquota.pl
-vhffs-robots/src/mysql_create.pl
-vhffs-robots/src/repository_getquota.pl
-vhffs-robots/src/svn_delete.pl
-vhffs-robots/src/svn_websvn.pl
-vhffs-robots/src/user_group.pl
vhffs-robots/src/repository_stats.pl
-vhffs-robots/src/mailinglist_delete.pl
-vhffs-robots/src/web_delete.pl
-vhffs-robots/src/user_create.pl
vhffs-robots/src/repository_create.pl
-vhffs-robots/src/user_setquota.pl
-vhffs-robots/src/mail_delete.pl
+vhffs-robots/src/svn_viewvcconf.pl
vhffs-robots/src/repository_setquota.pl
+vhffs-robots/src/mysql_create.pl
+vhffs-robots/src/repository_delete.pl
+vhffs-robots/src/pgsql_modify.pl
+vhffs-robots/src/repository_getquota.pl
+vhffs-robots/src/cvs_fixperms.pl
+vhffs-robots/src/group_setquota.pl
+vhffs-robots/src/cvs_create.pl
+vhffs-robots/src/mysql_dump.pl
+vhffs-robots/src/cvs_viewvcconf.pl
+vhffs-robots/src/group_create.pl
+vhffs-robots/src/pgsql_delete.pl
vhffs-robots/misc/svn_post-commit.pl
-vhffs-public/extern/stats.pl
-vhffs-public/extern/newgroupsrss.pl
-vhffs-public/extern/newusersrss.pl
-vhffs-public/lastusers.pl
-vhffs-public/index.pl
-vhffs-public/allgroups.pl
-vhffs-public/websitesearch.pl
-vhffs-public/group.pl
-vhffs-public/allwebsites.pl
-vhffs-public/getavatar.pl
-vhffs-public/user.pl
-vhffs-public/groupsearch.pl
-vhffs-public/lastgroups.pl
-vhffs-public/usersearch.pl
-vhffs-packages/oldbuildwithdput.pl
-vhffs-compat/updatedb.pl
-vhffs-api/src/Vhffs/Services/DNS.pm
-vhffs-api/src/Vhffs/Services/Mysql.pm
-vhffs-api/src/Vhffs/Services/Pgsql.pm
-vhffs-api/src/Vhffs/Services/Svn.pm
-vhffs-api/src/Vhffs/Services/Cvs.pm
-vhffs-api/src/Vhffs/Services/MailingList.pm
-vhffs-api/src/Vhffs/Services/Web.pm
-vhffs-api/src/Vhffs/Services/MailGroup.pm
-vhffs-api/src/Vhffs/Services/Repository.pm
-vhffs-api/src/Vhffs/Services/MailUser.pm
-vhffs-api/src/Vhffs/Services/Mail.pm
-vhffs-api/src/Vhffs/Services/Git.pm
+vhffs-listengine/src/listengine.pl
+vhffs-api/src/Vhffs/Panel/Mail.pm
+vhffs-api/src/Vhffs/Panel/Template.pm
vhffs-api/src/Vhffs/Panel/Menu.pm
-vhffs-api/src/Vhffs/Panel/Mysql.pm
+vhffs-api/src/Vhffs/Panel/Group.pm
+vhffs-api/src/Vhffs/Panel/Public.pm
+vhffs-api/src/Vhffs/Panel/Repository.pm
+vhffs-api/src/Vhffs/Panel/Admin.pm
+vhffs-api/src/Vhffs/Panel/Git.pm
+vhffs-api/src/Vhffs/Panel/Cvs.pm
vhffs-api/src/Vhffs/Panel/Svn.pm
+vhffs-api/src/Vhffs/Panel/Pgsql.pm
+vhffs-api/src/Vhffs/Panel/Web.pm
+vhffs-api/src/Vhffs/Panel/MailingList.pm
+vhffs-api/src/Vhffs/Panel/Cron.pm
vhffs-api/src/Vhffs/Panel/Object.pm
+vhffs-api/src/Vhffs/Panel/Mysql.pm
+vhffs-api/src/Vhffs/Panel/Main.pm
+vhffs-api/src/Vhffs/Panel/Avatar.pm
vhffs-api/src/Vhffs/Panel/Commons.pm
-vhffs-api/src/Vhffs/Panel/Template.pm
-vhffs-api/src/Vhffs/Panel/MailingList.pm
-vhffs-api/src/Vhffs/Panel/Web.pm
-vhffs-api/src/Vhffs/Panel/Avatar.pm
+vhffs-api/src/Vhffs/Panel/Tag.pm
vhffs-api/src/Vhffs/Panel/User.pm
-vhffs-api/src/Vhffs/Panel/Repository.pm
-vhffs-api/src/Vhffs/Panel/Mail.pm
-vhffs-api/src/Vhffs/Panel/Git.pm
-vhffs-api/src/Vhffs/Panel/Main.pm
vhffs-api/src/Vhffs/Panel/DNS.pm
-vhffs-api/src/Vhffs/Panel/Pgsql.pm
-vhffs-api/src/Vhffs/Panel/Admin.pm
-vhffs-api/src/Vhffs/Panel/Cvs.pm
-vhffs-api/src/Vhffs/Panel/Group.pm
-vhffs-api/src/Vhffs/Robots/Mysql.pm
+vhffs-api/src/Vhffs/Conf.pm
+vhffs-api/src/Vhffs/Mailings.pm
+vhffs-api/src/Vhffs/ObjectFactory.pm
+vhffs-api/src/Vhffs/Group.pm
+vhffs-api/src/Vhffs/Functions.pm
+vhffs-api/src/Vhffs/Listengine.pm
+vhffs-api/src/Vhffs/Services/Mail.pm
+vhffs-api/src/Vhffs/Services/Repository.pm
+vhffs-api/src/Vhffs/Services/MailGroup.pm
+vhffs-api/src/Vhffs/Services/Git.pm
+vhffs-api/src/Vhffs/Services/Cvs.pm
+vhffs-api/src/Vhffs/Services/Svn.pm
+vhffs-api/src/Vhffs/Services/Pgsql.pm
+vhffs-api/src/Vhffs/Services/MailUser.pm
+vhffs-api/src/Vhffs/Services/Web.pm
+vhffs-api/src/Vhffs/Services/MailingList.pm
+vhffs-api/src/Vhffs/Services/Cron.pm
+vhffs-api/src/Vhffs/Services/Mysql.pm
+vhffs-api/src/Vhffs/Services/DNS.pm
+vhffs-api/src/Vhffs/Acl.pm
+vhffs-api/src/Vhffs/Object.pm
+vhffs-api/src/Vhffs/Main.pm
+vhffs-api/src/Vhffs/Robots/Mail.pm
+vhffs-api/src/Vhffs/Robots/Group.pm
+vhffs-api/src/Vhffs/Robots/Repository.pm
+vhffs-api/src/Vhffs/Robots/Git.pm
+vhffs-api/src/Vhffs/Robots/Cvs.pm
+vhffs-api/src/Vhffs/Robots/Svn.pm
vhffs-api/src/Vhffs/Robots/Pgsql.pm
-vhffs-api/src/Vhffs/Robots/Svn.pm
-vhffs-api/src/Vhffs/Robots/Cvs.pm
-vhffs-api/src/Vhffs/Robots/Group.pm
vhffs-api/src/Vhffs/Robots/Web.pm
+vhffs-api/src/Vhffs/Robots/Mailing.pm
+vhffs-api/src/Vhffs/Robots/Mysql.pm
vhffs-api/src/Vhffs/Robots/User.pm
-vhffs-api/src/Vhffs/Robots/Repository.pm
-vhffs-api/src/Vhffs/Robots/Mailing.pm
-vhffs-api/src/Vhffs/Robots/Mail.pm
-vhffs-api/src/Vhffs/Robots/Git.pm
-vhffs-api/src/Vhffs/Object.pm
+vhffs-api/src/Vhffs/Constants.pm
+vhffs-api/src/Vhffs/Tag.pm
vhffs-api/src/Vhffs/Robots.pm
-vhffs-api/src/Vhffs/Functions.pm
-vhffs-api/src/Vhffs/Constants.pm
+vhffs-api/src/Vhffs/Tag/Request.pm
+vhffs-api/src/Vhffs/Tag/Category.pm
vhffs-api/src/Vhffs/User.pm
vhffs-api/src/Vhffs/Services.pm
-vhffs-api/src/Vhffs/Main.pm
-vhffs-api/src/Vhffs/Conf.pm
vhffs-api/src/Vhffs/Debug.pm
-vhffs-api/src/Vhffs/Group.pm
-vhffs-api/src/Vhffs/ObjectFactory.pm
vhffs-api/src/Vhffs/Stats.pm
-vhffs-api/src/Vhffs/Acl.pm
-vhffs-api/src/Vhffs/Listengine.pm
-vhffs-api/src/Vhffs/Mailings.pm
-vhffs-api/src/examples/create_mail.pl
-vhffs-api/src/examples/add_acl.pl
-vhffs-api/src/examples/create_dns.pl
-vhffs-api/src/examples/create_mysql_panel.pl
-vhffs-api/src/examples/perm_for_user.pl
-vhffs-api/src/examples/show_dumper_group.pl
-vhffs-api/src/examples/show_members_from_list.pl
-vhffs-api/src/examples/get_list.pl
-vhffs-api/src/examples/hashdomain.pl
-vhffs-api/src/examples/add_acl_dns.pl
-vhffs-api/src/examples/generate_password.pl
-vhffs-api/src/examples/create_group.pl
+vhffs-api/src/examples/show_dns_per_user.pl
+vhffs-api/src/examples/create_repository.pl
+vhffs-api/src/examples/create_web_panel.pl
vhffs-api/src/examples/delete_acl.pl
-vhffs-api/src/examples/create_panel_mail.pl
-vhffs-api/src/examples/show_last_users.pl
vhffs-api/src/examples/modify_user.pl
-vhffs-api/src/examples/create_mysql.pl
-vhffs-api/src/examples/show_dns_per_user.pl
-vhffs-api/src/examples/show_acl_per_object.pl
-vhffs-api/src/examples/create_cvs_panel.pl
-vhffs-api/src/examples/create_list.pl
-vhffs-api/src/examples/stats.pl
-vhffs-api/src/examples/create_user.pl
-vhffs-api/src/examples/create_dir.pl
+vhffs-api/src/examples/show_mail_per_group.pl
+vhffs-api/src/examples/hashdomain.pl
vhffs-api/src/examples/modify_acl.pl
+vhffs-api/src/examples/create_forward.pl
+vhffs-api/src/examples/create_mail.pl
vhffs-api/src/examples/show_dns_per_group.pl
-vhffs-api/src/examples/hashhome_example.pl
-vhffs-api/src/examples/show_dumper_cvs.pl
-vhffs-api/src/examples/join_group.pl
-vhffs-api/src/examples/create_box.pl
-vhffs-api/src/examples/delbox.pl
vhffs-api/src/examples/create_cvs.pl
+vhffs-api/src/examples/create_dir.pl
+vhffs-api/src/examples/hashpopuser.pl
+vhffs-api/src/examples/show_groups_per_user.pl
+vhffs-api/src/examples/show_dumper_group.pl
+vhffs-api/src/examples/create_panel_mail.pl
+vhffs-api/src/examples/show_mail_conf.pl
+vhffs-api/src/examples/mailuser_add_box.pl
+vhffs-api/src/examples/create_mysql_panel.pl
vhffs-api/src/examples/hash_webdir.pl
-vhffs-api/src/examples/create_web_panel.pl
+vhffs-api/src/examples/create_group_by_panel.pl
+vhffs-api/src/examples/create_group.pl
+vhffs-api/src/examples/delbox.pl
+vhffs-api/src/examples/perm_for_user.pl
+vhffs-api/src/examples/mailuser.pl
+vhffs-api/src/examples/hashhome_example.pl
vhffs-api/src/examples/list_themes.pl
-vhffs-api/src/examples/mailuser.pl
-vhffs-api/src/examples/show_dumper_object.pl
vhffs-api/src/examples/print_domain.pl
-vhffs-api/src/examples/show_groups_per_user.pl
-vhffs-api/src/examples/create_forward.pl
-vhffs-api/src/examples/show_mail_conf.pl
-vhffs-api/src/examples/create_group_by_panel.pl
+vhffs-api/src/examples/show_dumper_cvs.pl
vhffs-api/src/examples/create_postgres.pl
+vhffs-api/src/examples/get_list.pl
+vhffs-api/src/examples/create_user.pl
+vhffs-api/src/examples/create_box.pl
+vhffs-api/src/examples/create_mysql.pl
+vhffs-api/src/examples/stats.pl
+vhffs-api/src/examples/generate_password.pl
+vhffs-api/src/examples/create_list.pl
+vhffs-api/src/examples/show_acl_per_object.pl
+vhffs-api/src/examples/create_dns.pl
+vhffs-api/src/examples/show_dumper_object.pl
+vhffs-api/src/examples/add_acl_dns.pl
+vhffs-api/src/examples/join_group.pl
+vhffs-api/src/examples/show_members_from_list.pl
+vhffs-api/src/examples/create_cvs_panel.pl
+vhffs-api/src/examples/show_last_users.pl
vhffs-api/src/examples/show_dumper_user.pl
+vhffs-api/src/examples/add_acl.pl
vhffs-api/src/examples/create_web.pl
-vhffs-api/src/examples/hashpopuser.pl
-vhffs-api/src/examples/mailuser_add_box.pl
-vhffs-api/src/examples/create_repository.pl
-vhffs-api/src/examples/show_mail_per_group.pl
vhffs-irc/modobot.pl
-vhffs-jabber/vhffspipe.pl
-vhffs-backend/src/mirror/nss-mirror.pl
-vhffs-backend/src/mirror/mx1-mirror.pl
-vhffs-backend/src/mirror/mx2-mirror.pl
-vhffs-backend/src/mirror/mydns-mirror.pl
-vhffs-panel/repository/index.pl
-vhffs-panel/repository/prefs.pl
-vhffs-panel/repository/delete.pl
-vhffs-panel/repository/create.pl
+vhffs-compat/updatedb.pl
+vhffs-intl/extra_strings.pl
+vhffs-intl/template_strings.pl
+vhffs-panel/history.pl
+vhffs-panel/object/resubmit.pl
+vhffs-panel/object/quickdelete.pl
+vhffs-panel/object/upavatar.pl
+vhffs-panel/lost_ack.pl
+vhffs-panel/lost.pl
+vhffs-panel/web/index.pl
+vhffs-panel/web/delete.pl
+vhffs-panel/web/prefs.pl
+vhffs-panel/web/create.pl
+vhffs-panel/git/index.pl
+vhffs-panel/git/delete.pl
+vhffs-panel/git/prefs.pl
+vhffs-panel/git/create.pl
+vhffs-panel/svn/index.pl
+vhffs-panel/svn/delete.pl
+vhffs-panel/svn/prefs.pl
+vhffs-panel/svn/create.pl
vhffs-panel/mail/index.pl
+vhffs-panel/mail/delete.pl
vhffs-panel/mail/prefs.pl
-vhffs-panel/mail/delete.pl
vhffs-panel/mail/create.pl
-vhffs-panel/git/index.pl
-vhffs-panel/git/prefs.pl
-vhffs-panel/git/delete.pl
-vhffs-panel/git/create.pl
-vhffs-panel/ajax/help.pl
-vhffs-panel/dns/index.pl
-vhffs-panel/dns/prefs.pl
-vhffs-panel/dns/delete.pl
-vhffs-panel/dns/create.pl
-vhffs-panel/pgsql/index.pl
-vhffs-panel/pgsql/prefs.pl
-vhffs-panel/pgsql/delete.pl
-vhffs-panel/pgsql/create.pl
-vhffs-panel/admin/repository/search.pl
-vhffs-panel/admin/repository/index.pl
-vhffs-panel/admin/repository/list.pl
-vhffs-panel/admin/mail/search.pl
-vhffs-panel/admin/mail/index.pl
-vhffs-panel/admin/mail/list.pl
-vhffs-panel/admin/git/search.pl
-vhffs-panel/admin/git/index.pl
-vhffs-panel/admin/git/list.pl
-vhffs-panel/admin/dns/search.pl
-vhffs-panel/admin/dns/index.pl
-vhffs-panel/admin/dns/list.pl
-vhffs-panel/admin/pgsql/search.pl
-vhffs-panel/admin/pgsql/index.pl
-vhffs-panel/admin/pgsql/list.pl
-vhffs-panel/admin/cvs/search.pl
-vhffs-panel/admin/cvs/index.pl
-vhffs-panel/admin/cvs/list.pl
-vhffs-panel/admin/group/search.pl
-vhffs-panel/admin/group/index.pl
-vhffs-panel/admin/group/list.pl
-vhffs-panel/admin/mysql/search.pl
-vhffs-panel/admin/mysql/index.pl
-vhffs-panel/admin/mysql/list.pl
+vhffs-panel/admin/broadcast_submit.pl
+vhffs-panel/admin/index.pl
vhffs-panel/admin/object/edit.pl
vhffs-panel/admin/object/search.pl
vhffs-panel/admin/object/edit_submit.pl
vhffs-panel/admin/object/list.pl
vhffs-panel/admin/object/delete_avatar.pl
+vhffs-panel/admin/web/index.pl
+vhffs-panel/admin/web/search.pl
+vhffs-panel/admin/web/list.pl
+vhffs-panel/admin/su.pl
+vhffs-panel/admin/git/index.pl
+vhffs-panel/admin/git/search.pl
+vhffs-panel/admin/git/list.pl
+vhffs-panel/admin/svn/index.pl
vhffs-panel/admin/svn/search.pl
-vhffs-panel/admin/svn/index.pl
vhffs-panel/admin/svn/list.pl
+vhffs-panel/admin/mail/index.pl
+vhffs-panel/admin/mail/search.pl
+vhffs-panel/admin/mail/list.pl
+vhffs-panel/admin/pgsql/index.pl
+vhffs-panel/admin/pgsql/search.pl
+vhffs-panel/admin/pgsql/list.pl
+vhffs-panel/admin/dns/index.pl
+vhffs-panel/admin/dns/search.pl
+vhffs-panel/admin/dns/list.pl
+vhffs-panel/admin/broadcast_delete.pl
+vhffs-panel/admin/mysql/index.pl
+vhffs-panel/admin/mysql/search.pl
+vhffs-panel/admin/mysql/list.pl
+vhffs-panel/admin/mailinglist/index.pl
vhffs-panel/admin/mailinglist/search.pl
-vhffs-panel/admin/mailinglist/index.pl
vhffs-panel/admin/mailinglist/list.pl
-vhffs-panel/admin/web/search.pl
-vhffs-panel/admin/web/index.pl
-vhffs-panel/admin/web/list.pl
+vhffs-panel/admin/moderation_submit.pl
+vhffs-panel/admin/moderation.pl
+vhffs-panel/admin/repository/index.pl
+vhffs-panel/admin/repository/search.pl
+vhffs-panel/admin/repository/list.pl
+vhffs-panel/admin/user/index.pl
vhffs-panel/admin/user/search.pl
-vhffs-panel/admin/user/index.pl
vhffs-panel/admin/user/list.pl
-vhffs-panel/admin/index.pl
-vhffs-panel/admin/moderation_submit.pl
-vhffs-panel/admin/broadcast_delete.pl
-vhffs-panel/admin/broadcast_submit.pl
-vhffs-panel/admin/su.pl
+vhffs-panel/admin/stats.pl
+vhffs-panel/admin/group/index.pl
+vhffs-panel/admin/group/search.pl
+vhffs-panel/admin/group/list.pl
+vhffs-panel/admin/cron/index.pl
+vhffs-panel/admin/cron/search.pl
+vhffs-panel/admin/cron/list.pl
vhffs-panel/admin/broadcast_view.pl
+vhffs-panel/admin/cvs/index.pl
+vhffs-panel/admin/cvs/search.pl
+vhffs-panel/admin/cvs/list.pl
+vhffs-panel/admin/tag/index.pl
+vhffs-panel/admin/tag/request/list.pl
+vhffs-panel/admin/tag/request/details.pl
+vhffs-panel/admin/tag/edit.pl
+vhffs-panel/admin/tag/list.pl
+vhffs-panel/admin/tag/create.pl
+vhffs-panel/admin/tag/category/edit.pl
+vhffs-panel/admin/tag/category/list.pl
+vhffs-panel/admin/tag/category/create.pl
+vhffs-panel/admin/broadcast.pl
vhffs-panel/admin/broadcast_list.pl
-vhffs-panel/admin/stats.pl
-vhffs-panel/admin/moderation.pl
-vhffs-panel/admin/broadcast.pl
-vhffs-panel/cvs/index.pl
-vhffs-panel/cvs/prefs.pl
-vhffs-panel/cvs/delete.pl
-vhffs-panel/cvs/create.pl
-vhffs-panel/group/index.pl
-vhffs-panel/group/view.pl
-vhffs-panel/group/prefs.pl
-vhffs-panel/group/history.pl
-vhffs-panel/group/delete.pl
-vhffs-panel/group/create.pl
-vhffs-panel/acl/view.pl
+vhffs-panel/pgsql/index.pl
+vhffs-panel/pgsql/delete.pl
+vhffs-panel/pgsql/prefs.pl
+vhffs-panel/pgsql/create.pl
+vhffs-panel/show_code.pl
+vhffs-panel/dns/index.pl
+vhffs-panel/dns/delete.pl
+vhffs-panel/dns/prefs.pl
+vhffs-panel/dns/create.pl
+vhffs-panel/subscribe.pl
vhffs-panel/mysql/index.pl
+vhffs-panel/mysql/delete.pl
vhffs-panel/mysql/prefs.pl
-vhffs-panel/mysql/delete.pl
vhffs-panel/mysql/create.pl
-vhffs-panel/object/resubmit.pl
-vhffs-panel/object/quickdelete.pl
-vhffs-panel/object/upavatar.pl
-vhffs-panel/svn/index.pl
-vhffs-panel/svn/prefs.pl
-vhffs-panel/svn/delete.pl
-vhffs-panel/svn/create.pl
+vhffs-panel/panel.pl
vhffs-panel/mailinglist/index.pl
+vhffs-panel/mailinglist/delete.pl
vhffs-panel/mailinglist/prefs.pl
-vhffs-panel/mailinglist/delete.pl
vhffs-panel/mailinglist/create.pl
-vhffs-panel/web/index.pl
-vhffs-panel/web/prefs.pl
-vhffs-panel/web/delete.pl
-vhffs-panel/web/create.pl
+vhffs-panel/getavatar.pl
+vhffs-panel/ajax/help.pl
+vhffs-panel/repository/index.pl
+vhffs-panel/repository/delete.pl
+vhffs-panel/repository/prefs.pl
+vhffs-panel/repository/create.pl
+vhffs-panel/user/delete.pl
vhffs-panel/user/prefs.pl
-vhffs-panel/user/delete.pl
+vhffs-panel/group/history.pl
+vhffs-panel/group/index.pl
+vhffs-panel/group/delete.pl
+vhffs-panel/group/prefs.pl
+vhffs-panel/group/create.pl
+vhffs-panel/group/view.pl
+vhffs-panel/acl/view.pl
+vhffs-panel/cron/index.pl
+vhffs-panel/cron/delete.pl
+vhffs-panel/cron/prefs.pl
+vhffs-panel/cron/create.pl
+vhffs-panel/cvs/index.pl
+vhffs-panel/cvs/delete.pl
+vhffs-panel/cvs/prefs.pl
+vhffs-panel/cvs/create.pl
+vhffs-panel/auth.pl
vhffs-panel/alert.pl
vhffs-panel/show_code.pl
vhffs-panel/play_code.pl
@@ -289,11 +320,11 @@
vhffs-panel/lost.pl
vhffs-panel/subscribe.pl
vhffs-panel/alert_submit.pl
-vhffs-panel/lost_ack.pl
-vhffs-panel/panel.pl
-vhffs-panel/history.pl
-vhffs-panel/auth.pl
-vhffs-listengine/src/listengine.pl
+vhffs-backend/src/mirror/mx1-mirror.pl
+vhffs-backend/src/mirror/mx2-mirror.pl
+vhffs-backend/src/mirror/nss-mirror.pl
+vhffs-backend/src/mirror/mydns-mirror.pl
+vhffs-packages/oldbuildwithdput.pl
+vhffs-tests/src/Vhffs/Tests/Utils.pm
vhffs-tests/src/Vhffs/Tests/Main.pm
-vhffs-tests/src/Vhffs/Tests/Utils.pm
vhffs-tests/src/Functions.pl
Modified: trunk/vhffs-intl/update-POTFILES.in.sh
===================================================================
--- trunk/vhffs-intl/update-POTFILES.in.sh 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-intl/update-POTFILES.in.sh 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,4 +1,4 @@
#!/bin/bash
find .. -name '*.tmpl' | xargs perl -ne 'if(/<TMPL_I18N\s+KEY="([^"]+)/i) { print "gettext(\"$1\");\n"; }' > template_strings.pl
+find .. -name '*.tt' | xargs perl -ne 'print "gettext(\"$1\");\n" if(/\[%\s+'\''([^|]+?)'\''\s*|\s*i18n\b/);' >> template_strings.pl
find .. -name '*.p[ml]' | sed s!^../!! > 'POTFILES.in'
-
Modified: trunk/vhffs-panel/Makefile.am
===================================================================
--- trunk/vhffs-panel/Makefile.am 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-panel/Makefile.am 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,8 +1,12 @@
javascripts = js/prototype.js \
- js/commons.js \
- js/tooltip.js
+ js/commons.js \
+ js/dijit/dijit.js \
+ js/dojo/dojo.js \
+ js/public.js \
+ js/tooltip.js \
+ js/vhffs/Common.js \
+ js/vhffs/Menu.js
-
if INSTALL_PANEL
SUBDIRS = templates
Copied: trunk/vhffs-panel/js/dijit (from rev 1361, branches/vhffs-design/vhffs-panel/js/dijit)
Copied: trunk/vhffs-panel/js/dojo (from rev 1361, branches/vhffs-design/vhffs-panel/js/dojo)
Copied: trunk/vhffs-panel/js/public.js (from rev 1361, branches/vhffs-design/vhffs-panel/js/public.js)
===================================================================
--- trunk/vhffs-panel/js/public.js (rev 0)
+++ trunk/vhffs-panel/js/public.js 2009-03-10 08:08:59 UTC (rev 1362)
@@ -0,0 +1,196 @@
+/*
+ * Copyright (c) vhffs project and its contributors
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name of vhffs nor the names of its contributors
+ * may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * JS functions used in all the public part
+ */
+
+dojo.require('vhffs.Menu');
+dojo.require('vhffs.Common');
+
+dojo.addOnLoad(function() {
+ new vhffs.Menu(dojo.byId('left-menu'));
+ vhffs.Common.ajaxizeLinks(dojo.byId('public-content'));
+});
+
+var Public = {};
+
+Public.SearchGroup = {};
+
+Public.SearchGroup.onLoad = function() {
+ Public.SearchGroup.setUpTagsList();
+ Public.SearchGroup.ajaxizeForm();
+}
+
+Public.SearchGroup.ajaxizeForm = function() {
+ var form = dojo.byId('AdvancedSearchGroupForm');
+ dojo.connect(form, 'onsubmit', function(e) {
+ dojo.stopEvent(e);
+ dojo.xhrPost({
+ url: dojo.attr(form, 'action'),
+ 'form': form,
+ load: function(response) {
+ vhffs.Common.loadContent(dojo.byId('public-content'), response);
+ vhffs.Common.ajaxizeLinks(dojo.byId('public-content'));
+ }
+ });
+ });
+}
+
+/**
+ * Adds the event listeners on +/- beside each tags.
+ */
+Public.SearchGroup.setUpTagsList = function() {
+ dojo.forEach(dojo.query('#searchTagsList span'), function(el, index) {
+ var id = dojo.attr(el, 'id');
+ if(!id) return;
+
+ // We're only interrested in tag container's spans
+ if(/^tag\d+$/.test(id) == false) return;
+
+ // Strips tag part (tag1 => 1)
+ var tagId = id.substring(3);
+ var include = dojo.query('a.include', el);
+ if(include.length > 0) {
+ include = include[0];
+ dojo.connect(include, 'onclick', function(e) { dojo.stopEvent(e); Public.SearchGroup.includeTag(tagId); });
+ }
+ var exclude = dojo.query('a.exclude', el);
+ if(exclude.length > 0) {
+ exclude = exclude[0];
+ dojo.connect(exclude, 'onclick', function(e) { dojo.stopEvent(e); Public.SearchGroup.excludeTag(tagId); });
+ }
+ });
+}
+
+/**
+ * Adds a tag to the exclusion list. Put the tag in
+ * the "Doesn't matches" section and add an hidden field
+ * to reflect this.
+ */
+Public.SearchGroup.excludeTag = function(tagId) {
+ Public.SearchGroup.addToList(tagId, 'searchTagExclude');
+ Public.SearchGroup.addHiddenField('excluded_tags', tagId);
+}
+
+/**
+ * Adds a tag to the inclusion list. Put the tag in
+ * the "Matches" section and add an hidden field
+ * to reflect this.
+ */
+Public.SearchGroup.includeTag = function(tagId) {
+ Public.SearchGroup.addToList(tagId, 'searchTagInclude');
+ Public.SearchGroup.addHiddenField('included_tags', tagId);
+}
+
+/**
+ * Adds an hidden field to the search form to reflect tag's
+ * inclusion/exclusion.
+ * @param name Name of the hidden field (included_tags or
+ * excluded_tags.
+ * @param tagId The hidden field will have tagId as its value
+ * and hidden[tagId] as its ID.
+ */
+Public.SearchGroup.addHiddenField = function(name, tagId) {
+ var h = document.createElement('input');
+ dojo.attr(h, {
+ type: 'hidden',
+ name: name,
+ value: tagId,
+ id: 'hidden' + tagId
+ });
+ dojo.place(h, 'AdvancedSearchGroupForm', 'first');
+}
+
+/**
+ * Removes the hidden field including or excluding
+ *
+ */
+Public.SearchGroup.removeHiddenField = function(tagId) {
+ var h = dojo.byId('hidden' + tagId);
+ h.parentNode.removeChild(h);
+}
+
+Public.SearchGroup.removeTag = function(tagId, span) {
+ span.parentNode.removeChild(span);
+ Public.SearchGroup.removeHiddenField(tagId);
+ dojo.style(dojo.byId('tag' + tagId), 'display', '');
+}
+
+Public.SearchGroup.addToList = function(tagId, list) {
+ var tagContainer = dojo.byId('tag' + tagId);
+ if(tagContainer == null) return;
+ var list = dojo.byId(list);
+ var label = dojo.query('span.label', tagContainer);
+ if(label.length > 0) {
+ label = dojo.string.trim(label[0].innerHTML);
+ } else {
+ label = dojo.string.trim(tagContainer.innerHTML);
+ }
+ var span = document.createElement('span');
+ span.innerHTML = (label + ' ');
+ var remove = document.createElement('a');
+ dojo.attr(remove, 'href', '#');
+ remove.innerHTML = ' X';
+
+ dojo.place(remove, span, 'last');
+ // Don't use += ' ' since remove will be lost...
+ dojo.place(document.createTextNode(' '), span, 'last');
+ dojo.place(span, list, 'last');
+
+ dojo.connect(remove, 'onclick', function(e) {
+ dojo.stopEvent(e); Public.SearchGroup.removeTag(tagId, span);
+ });
+
+ dojo.style(tagContainer, 'display', 'none');
+}
+
+Public.SearchUser = {};
+
+Public.SearchUser.onLoad = function() {
+ Public.SearchUser.ajaxizeForm();
+}
+
+Public.SearchUser.ajaxizeForm = function() {
+ var form = dojo.byId('SearchUserForm');
+ dojo.connect(form, 'onsubmit', function(e) {
+ dojo.stopEvent(e);
+ dojo.xhrPost({
+ url: dojo.attr(form, 'action'),
+ 'form': form,
+ load: function(response) {
+ vhffs.Common.loadContent(dojo.byId('public-content'), response);
+ vhffs.Common.ajaxizeLinks(dojo.byId('public-content'));
+ }
+ });
+ });
+}
Copied: trunk/vhffs-panel/js/vhffs (from rev 1361, branches/vhffs-design/vhffs-panel/js/vhffs)
Modified: trunk/vhffs-public/Makefile.am
===================================================================
--- trunk/vhffs-public/Makefile.am 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/Makefile.am 2009-03-10 08:08:59 UTC (rev 1362)
@@ -4,17 +4,15 @@
publicdir = @PUBLICDIR@
nobase_dist_public_SCRIPTS = \
allgroups.pl \
- allwebsites.pl \
- getavatar.pl \
+ avatar.pl \
group.pl \
groupsearch.pl \
+ groupsearch_form.pl \
index.pl \
lastgroups.pl \
lastusers.pl \
- tagsearch.pl \
- user.pl \
usersearch.pl \
- websitesearch.pl \
+ usersearch_form.pl \
extern/newgroupsrss.pl \
extern/newusersrss.pl \
extern/stats.pl
Modified: trunk/vhffs-public/allgroups.pl
===================================================================
--- trunk/vhffs-public/allgroups.pl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/allgroups.pl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -33,46 +33,36 @@
use utf8;
use POSIX qw(locale_h);
-use CGI;
use locale;
use Locale::gettext;
use lib '%VHFFS_LIB_DIR%';
use Vhffs::Panel::Commons;
use Vhffs::Panel::Group;
-use Vhffs::Panel::Main;
-use Vhffs::Panel::Template;
+use Vhffs::Panel::Public;
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
+my $panel = new Vhffs::Panel::Public();
+my $vhffs = $panel->{vhffs};
+my $cgi = $panel->{cgi};
-my $vhffs = $panel->{'vhffs'};
-my $cgi = $panel->{'cgi'};
-my $templatedir = $panel->{'templatedir'};
-
-$panel->check_public();
-
my $letter = $cgi->param('letter');
my $used_letters = Vhffs::Panel::Group::get_used_letters($vhffs);
-$letter = $used_letters->[0]{letter} unless(defined $letter || !defined $used_letters->[0]);
-undef $letter if( $letter eq 'all');
+$letter = $used_letters->[0]{letter} unless(defined $letter || !defined $used_letters->[0]{letter});
+undef $letter if( defined $letter && $letter eq 'all');
my $page = $cgi->param('page');
$page = 1 unless(defined $page && int($page) > 0);
my $per_page_count = 10;
my $result = Vhffs::Panel::Group::get_groups_starting_with( $vhffs , $letter, ($page - 1) * $per_page_count, $per_page_count);
-my $template = new Vhffs::Panel::Template( filename => $templatedir."/public/groupslist.tmpl", die_on_bad_params => 0, loop_context_vars => 1 );
+my $pager = Vhffs::Panel::Commons::get_pager($page, $result->{total_count}, $per_page_count, 5, $panel->{url}, {
+ 'letter' => defined($letter) ? $letter : 'all'
+});
-my $hostname = $vhffs->get_config->get_host_name;
+my $vars = {
+ pager => $pager,
+ groups => $result->{data},
+ letters => $used_letters
+};
-Vhffs::Panel::Commons::paginate($template, $page, $result->{total_count}, $per_page_count, { letter => (defined($letter) ? $letter : 'all') });
-
-$template->param( URL_PANEL => $vhffs->get_config->get_panel->{'url'} );
-$template->param( TEXT_TITLE => sprintf( gettext("All groups on %s") , $hostname ) );
-$template->param( LETTERS => $used_letters );
-$template->param( ALL => gettext('All') );
-$template->param( GROUPS => $result->{data} );
-
-$panel->light( $template );
-$panel->display;
+$panel->render('content/all-groups.tt', $vars);
Deleted: trunk/vhffs-public/allwebsites.pl
===================================================================
--- trunk/vhffs-public/allwebsites.pl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/allwebsites.pl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,79 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-#3. Neither the name of vhffs nor the names of its contributors
-# may be used to endorse or promote products derived from this
-# software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use utf8;
-
-use POSIX qw(locale_h);
-use locale;
-use Locale::gettext;
-use CGI;
-
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Commons;
-use Vhffs::Panel::Main;
-use Vhffs::Panel::Template;
-use Vhffs::Panel::Web;
-
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-
-my $vhffs = $panel->{'vhffs'};
-my $cgi = $panel->{'cgi'};
-my $templatedir = $panel->{'templatedir'};
-
-$panel->check_public();
-
-my $letters = Vhffs::Panel::Web::get_used_letters($vhffs);
-my $letter = ( defined $cgi->param('letter') ? $cgi->param('letter') : (defined $letters->[0] ? $letters->[0]->{letter} : undef) );
-undef $letter if ( $letter eq 'all' );
-
-my $page = $cgi->param('page');
-$page = 1 unless(defined $page && int($page) > 0);
-my $per_page_count = 20;
-
-my $res = Vhffs::Panel::Web::get_websites_starting_with( $vhffs, $letter, ($page - 1) * $per_page_count, $per_page_count);
-
-my $hostname = $vhffs->get_config->get_host_name;
-
-my $template = new Vhffs::Panel::Template( filename => $templatedir."/public/websiteslist.tmpl" );
-
-Vhffs::Panel::Commons::paginate($template, $page, $res->{total_count}, $per_page_count, {'letter' => (defined($letter) ? $letter : 'all') });
-
-
-$template->param( TEXT_TITLE => sprintf( gettext("All websites on %s") , $hostname ) );
-$template->param( LETTERS => $letters );
-$template->param( ALL => gettext('All') );
-$template->param( URL_PANEL => $vhffs->get_config->get_panel->{'url'} );
-$template->param( WEBSITES => $res->{data} );
-
-$panel->light( $template );
-$panel->display;
Copied: trunk/vhffs-public/avatar.pl (from rev 1361, branches/vhffs-design/vhffs-public/avatar.pl)
===================================================================
--- trunk/vhffs-public/avatar.pl (rev 0)
+++ trunk/vhffs-public/avatar.pl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -0,0 +1,129 @@
+#!%PERL% -w
+# Copyright (c) vhffs project and its contributors
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+#3. Neither the name of vhffs nor the names of its contributors
+# may be used to endorse or promote products derived from this
+# software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+use strict;
+use utf8;
+use CGI;
+use GD;
+use GD::Text::Wrap;
+use lib '%VHFFS_LIB_DIR%';
+use Vhffs::Main;
+use Vhffs::Object;
+use Vhffs::Panel::Avatar;
+
+#Get some basics informations with CGI
+my $cgi;
+my $oid;
+my $code;
+my $vhffs;
+my $gd;
+my $wp;
+my $black;
+my $white;
+my $blue;
+my $path;
+my $buf;
+my $object;
+
+$cgi = new CGI;
+$cgi->charset('utf-8');
+$vhffs = init Vhffs::Main;
+$oid = $cgi->param( "oid" );
+
+$object = Vhffs::Object::get_by_oid( $vhffs , $oid );
+
+$path = Vhffs::Panel::Avatar::exists_avatar( $vhffs , $object );
+
+if( ! ( defined $oid ) )
+{
+ print CGI->header( -type=>"text/html", -charset=>"utf-8" );
+ print "oid error";
+ exit 1;
+}
+
+$gd = GD::Image->new(70,100);
+$white = $gd->colorAllocate(255,255,255);
+$black = $gd->colorAllocate( 0, 0, 0);
+$blue = $gd->colorAllocate(127,127,255);
+
+#print "No colours: $black ", $gd->colorsTotal, "\n";
+
+
+# Assume the user has set FONT_PATH or TTF_FONT_PATH
+#$wp->font_path('/usr/share/fonts/ttfonts');
+print CGI->header( -type=>"image/png" );
+
+binmode STDOUT ;
+
+# TODO user pregenerated images
+
+if( $vhffs->get_config->get_panel->{'users_avatars'} ne 'yes' && $vhffs->get_config->get_panel->{'groups_avatars'} ne 'yes' )
+{
+ $wp = GD::Text::Wrap->new($gd,
+ width => 70,
+ line_space => 0,
+ color => $black,
+ text => "This platform does not support avatar",
+ );
+ $wp->set_font(gdLargeFont, 14);
+ $wp->set(align => 'center');
+ $wp->draw(0,5);
+ $wp->set(para_space => 10, preserve_nl => 0);
+ print STDOUT $gd->png();
+}
+else
+{
+ if( defined $path )
+ {
+ open FORIG , "$path";
+ while( read( FORIG , $buf , 1024 ) )
+ {
+ print STDOUT $buf;
+ }
+ close( FORIG );
+ }
+ else
+ {
+ $wp = GD::Text::Wrap->new($gd,
+ width => 70,
+ line_space => 0,
+ color => $black,
+ text => "No avatar",
+ );
+ $wp->set_font(gdLargeFont, 14);
+ $wp->set(align => 'center');
+ $wp->draw(0,5);
+ $wp->set(para_space => 10, preserve_nl => 0);
+ print STDOUT $gd->png();
+ }
+}
+
+close STDOUT;
Deleted: trunk/vhffs-public/getavatar.pl
===================================================================
--- trunk/vhffs-public/getavatar.pl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/getavatar.pl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,127 +0,0 @@
-#!%PERL% -w
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-#3. Neither the name of vhffs nor the names of its contributors
-# may be used to endorse or promote products derived from this
-# software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use utf8;
-use CGI;
-use GD;
-use GD::Text::Wrap;
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Main;
-use Vhffs::Object;
-use Vhffs::Panel::Avatar;
-
-#Get some basics informations with CGI
-my $cgi;
-my $oid;
-my $code;
-my $vhffs;
-my $gd;
-my $wp;
-my $black;
-my $white;
-my $blue;
-my $path;
-my $buf;
-my $object;
-
-$cgi = new CGI;
-$cgi->charset('utf-8');
-$vhffs = init Vhffs::Main;
-$oid = $cgi->param( "oid" );
-
-$object = Vhffs::Object::get_by_oid( $vhffs , $oid );
-
-$path = Vhffs::Panel::Avatar::exists_avatar( $vhffs , $object );
-
-if( ! ( defined $oid ) )
-{
- print CGI->header( -type=>"text/html", -charset=>"utf-8" );
- print "oid error";
- exit 1;
-}
-
-$gd = GD::Image->new(70,100);
-$white = $gd->colorAllocate(255,255,255);
-$black = $gd->colorAllocate( 0, 0, 0);
-$blue = $gd->colorAllocate(127,127,255);
-
-#print "No colours: $black ", $gd->colorsTotal, "\n";
-
-
-# Assume the user has set FONT_PATH or TTF_FONT_PATH
-#$wp->font_path('/usr/share/fonts/ttfonts');
-print CGI->header( -type=>"image/png" );
-
-binmode STDOUT ;
-
-if( $vhffs->get_config->get_panel->{'users_avatars'} ne 'yes' && $vhffs->get_config->get_panel->{'groups_avatars'} ne 'yes' )
-{
- $wp = GD::Text::Wrap->new($gd,
- width => 70,
- line_space => 0,
- color => $black,
- text => "This platform does not support avatar",
- );
- $wp->set_font(gdLargeFont, 14);
- $wp->set(align => 'center');
- $wp->draw(0,5);
- $wp->set(para_space => 10, preserve_nl => 0);
- print STDOUT $gd->png();
-}
-else
-{
- if( defined $path )
- {
- open FORIG , "$path";
- while( read( FORIG , $buf , 1024 ) )
- {
- print STDOUT $buf;
- }
- close( FORIG );
- }
- else
- {
- $wp = GD::Text::Wrap->new($gd,
- width => 70,
- line_space => 0,
- color => $black,
- text => "No avatar",
- );
- $wp->set_font(gdLargeFont, 14);
- $wp->set(align => 'center');
- $wp->draw(0,5);
- $wp->set(para_space => 10, preserve_nl => 0);
- print STDOUT $gd->png();
- }
-}
-
-close STDOUT;
Modified: trunk/vhffs-public/group.pl
===================================================================
--- trunk/vhffs-public/group.pl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/group.pl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -35,103 +35,79 @@
use POSIX qw(locale_h);
use locale;
use Locale::gettext;
-use CGI;
-use CGI::Session;
use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Constants;
-use Vhffs::Functions;
-use Vhffs::Main;
-use Vhffs::Panel::Main;
-use Vhffs::Panel::Template;
+use Vhffs::Group;
+use Vhffs::Panel::Public;
use Vhffs::Tag;
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
+my $panel = new Vhffs::Panel::Public();
+my $cgi = $panel->{cgi};
+my $vhffs = $panel->{vhffs};
+my $config = $vhffs->get_config();
-my $vhffs = $panel->{'vhffs'};
-my $cgi = $panel->{'cgi'};
-my $templatedir = $panel->{'templatedir'};
+my $groupname = $cgi->param('name');
-$panel->check_public();
+unless(defined $groupname) {
+ $panel->render('common/error.tt', {
+ message => gettext('CGI Error')
+ });
+ exit(0);
+}
-my $template;
-my $subtemplate;
-my $repos;
-my $files;
-my $objs;
+my $group = Vhffs::Group::get_by_groupname($panel->{vhffs}, $groupname);
-my $name = $cgi->param("name");
+unless(defined $group) {
+ $panel->render('common/error.tt', {
+ message => gettext('Group not found')
+ });
+ exit(0);
+}
+my $tag_categories = $group->get_tags(Vhffs::Constants::TAG_VISIBILITY_PUBLIC);
-my $group;
-my $message;
+my $vars = {
+ group => $group,
+ tag_categories => $tag_categories
+};
-if( ! defined $name )
-{
- $template = new HTML::Template( filename => $templatedir.'/public/simplemsg.tmpl' );
- $message = gettext( "CGI Error !");
- $template->param( MESSAGE => $message );
+# Services filling... Really boring
+if( $config->get_service_availability('web') == 1 ) {
+ use Vhffs::Panel::Web;
+ $vars->{websites} = Vhffs::Panel::Web::get_websites_per_group($vhffs, $group->get_gid);
}
-elsif( ! defined ($group= Vhffs::Group::get_by_groupname( $vhffs , $name ) ) )
-{
- $template = new HTML::Template( filename => $templatedir.'/public/simplemsg.tmpl' );
- $message = gettext( "No such group");
- $template->param( MESSAGE => $message );
-
+if( $vhffs->get_config->get_service_availability('cvs') == 1 ) {
+ use Vhffs::Panel::Cvs;
+ $vars->{cvs} = {
+ cvs_web_url => $config->get_service('cvs')->{'cvsweb_url'},
+ repositories => Vhffs::Panel::Cvs::get_repos_per_group($vhffs, $group->get_gid )
+ };
}
-else
-{
- $name = Vhffs::Functions::check_arg( $name );
- $template = new Vhffs::Panel::Template( filename => $templatedir."/public/group.tmpl",
- die_on_bad_params => 0,
- loop_context_vars => 1,
- global_var => 1,
- functions => { obfuscate_email => \&obfuscate_email } );
- $template->param( URL_PANEL => $vhffs->get_config->get_panel->{'url'} );
- $template->param( VALUE_REALNAME => $group->get_realname );
- $template->param( VALUE_GROUPNAME => $group->get_groupname );
- $template->param( VALUE_DESCRIPTION => Vhffs::Panel::Main::format_description($group->get_description));
- $template->param( USERS => $group->get_users );
- $template->param( TAG_CATEGORIES => $group->get_tags(Vhffs::Constants::TAG_VISIBILITY_PUBLIC) );
- if( $vhffs->get_config->get_service_availability('web') == 1 ) {
- use Vhffs::Panel::Web;
- $template->param( WEBSITES_TITLE => gettext('Websites for this group') );
- $template->param( WEBSITES => Vhffs::Panel::Web::get_websites_per_group($vhffs, $group->get_gid) );
- }
-
- if( $vhffs->get_config->get_service_availability('cvs') == 1 ) {
- use Vhffs::Panel::Cvs;
- $template->param( WEBCVS => $vhffs->get_config->get_service('cvs')->{'cvsweb_url'} );
- $template->param( CVSREPOS => Vhffs::Panel::Cvs::get_repos_per_group($vhffs, $group->get_gid ) );
- }
-
- if( $vhffs->get_config->get_service_availability('svn') == 1 ) {
- use Vhffs::Panel::Svn;
- $template->param( WEBSVN => $vhffs->get_config->get_service('svn')->{'svnweb_url'} );
- $template->param( SVNREPOS => Vhffs::Panel::Svn::get_repos_per_group($vhffs, $group->get_gid) );
- }
-
- if( $vhffs->get_config->get_service_availability('git') == 1 ) {
- use Vhffs::Panel::Git;
- $template->param( WEBGIT => $vhffs->get_config->get_service('git')->{'gitweb_url'} );
- $template->param( GITREPOS => Vhffs::Panel::Git::get_repos_per_group($vhffs, $group->get_gid) );
- }
-
- if( $vhffs->get_config->get_service_availability('mailinglist') == 1 ) {
- use Vhffs::Panel::MailingList;
- $template->param( ARCHIVESURL => $vhffs->get_config->get_service('mailinglist')->{'url_archives'} );
- $template->param( LISTS => Vhffs::Panel::MailingList::get_lists_per_group($vhffs, $group->get_gid) );
- }
+if( $vhffs->get_config->get_service_availability('svn') == 1 ) {
+ use Vhffs::Panel::Svn;
+ $vars->{svn} = {
+ svn_web_url => $config->get_service('svn')->{'svnweb_url'},
+ repositories => Vhffs::Panel::Svn::get_repos_per_group($vhffs, $group->get_gid )
+ };
}
-# We've to wrap the function since $vhffs isn't reachable from templates
-sub obfuscate_email {
- return Vhffs::Functions::obfuscate_email($vhffs, $_[0]);
+if( $vhffs->get_config->get_service_availability('git') == 1 ) {
+ use Vhffs::Panel::Git;
+ $vars->{git} = {
+ git_web_url => $config->get_service('git')->{'gitweb_url'},
+ repositories => Vhffs::Panel::Git::get_repos_per_group($vhffs, $group->get_gid )
+ };
}
-$panel->light( $template );
-$panel->display;
+if( $vhffs->get_config->get_service_availability('mailinglist') == 1 ) {
+ use Vhffs::Panel::MailingList;;
+ $vars->{ml} = {
+ archives_url => $config->get_service('mailinglist')->{'url_archives'},
+ lists => Vhffs::Panel::MailingList::get_lists_per_group($vhffs, $group->get_gid )
+ };
+}
+
+$panel->render('content/group-details.tt', $vars);
Modified: trunk/vhffs-public/groupsearch.pl
===================================================================
--- trunk/vhffs-public/groupsearch.pl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/groupsearch.pl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -29,57 +29,63 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+# Public search page for groups.
+# Parameters:
+# either
+# - included_tags: ID of the tags that should be matched
+# by results (logical OR)
+# - excluded_tags: ID of the tags that shouldn't be matched
+# by results (logical AND)
+# - groupname: (partial) name of the group
+# - description: (partial) description of the group
+# - start (optional): start page of the search
+
use strict;
use utf8;
use POSIX qw(locale_h);
use locale;
use Locale::gettext;
-use CGI;
-use Encode;
use lib '%VHFFS_LIB_DIR%';
+
+use Vhffs::Panel::Group;
+use Vhffs::Panel::Public;
use Vhffs::Panel::Commons;
-use Vhffs::Panel::Group;
-use Vhffs::Panel::Main;
-use Vhffs::Panel::Template;
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
+my $panel = new Vhffs::Panel::Public();
-my $vhffs = $panel->{'vhffs'};
-my $templatedir = $panel->{'templatedir'};
-my $cgi = $panel->{'cgi'};
+my $cgi = $panel->{cgi};
-$panel->check_public();
+# Tags in "matches" section
+my @included_tags_ids = map{ int($_); } $cgi->param('included_tags');
+# Tags in "does not match" section
+my @excluded_tags_ids = map{ int($_); } $cgi->param('excluded_tags');
-my $template = new Vhffs::Panel::Template( filename => $templatedir.'/public/groupslist.tmpl', die_on_bad_params => 0 );
-my $groupname = $cgi->param('groupname') || '';
-my $description = Encode::decode_utf8( $cgi->param('description') ) || '';
-my $page = $cgi->param('page');
-my $per_page_count = 5;
-$page = 1 unless(defined $page && int($page) > 0);
+my $groupname = Encode::decode_utf8($cgi->param('groupname'));
+$groupname = '' unless(defined $groupname); # Direct tag click brings us here without without groupname ...
+my $description = Encode::decode_utf8($cgi->param('description'));
+$description = '' unless(defined $description); # ... and without description
-my $result = Vhffs::Panel::Group::public_search(
- $vhffs,
- ( $groupname =~ /^\s*$/ ? undef : $groupname ),
- ( $description =~ /^\s*$/ ? undef : $description ),
- ($page -1) * $per_page_count,
- $per_page_count
-);
-$template->param( URL_PANEL => $vhffs->get_config->get_panel->{'url'} );
+# current page
+my $page = defined($cgi->param('page')) ? int($cgi->param('page')) : 1;
-if($result->{total_count} == 0) {
- $template->param( TEXT_TITLE => gettext('No group found') );
-} else {
- Vhffs::Panel::Commons::paginate($template, $page, $result->{total_count}, $per_page_count,
- { groupname => $groupname, description => $description });
- $template->param( USE_AVATAR => $panel->use_groups_avatars );
- $template->param( TEXT_TITLE => sprintf( gettext('%d group(s) found'), $result->{total_count} ) );
- $template->param( GROUPS => $result->{data} );
+my ($groups, $count) = Vhffs::Panel::Group::public_search($panel->{vhffs}, $groupname, $description, \@included_tags_ids, \@excluded_tags_ids, $page - 1);
+
+if(scalar(@$groups) == 0) {
+ $panel->render('common/error.tt', {
+ message => gettext('No group found')
+ });
+ exit(0);
}
-$panel->light( $template );
-$panel->display;
+my $pager = Vhffs::Panel::Commons::get_pager($page, $count, 10, 5, $panel->{url}, { groupname => $groupname, description => $description, included_tags => \@included_tags_ids, excluded_tags => \@excluded_tags_ids});
+my $vars = {
+ groups => $groups,
+ gs_title => gettext( 'Search results' ),
+ gs_pager => $pager
+};
+
+$panel->render('content/groupsearch-results.tt', $vars);
Copied: trunk/vhffs-public/groupsearch_form.pl (from rev 1361, branches/vhffs-design/vhffs-public/groupsearch_form.pl)
===================================================================
--- trunk/vhffs-public/groupsearch_form.pl (rev 0)
+++ trunk/vhffs-public/groupsearch_form.pl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -0,0 +1,73 @@
+#!%PERL%
+# Copyright (c) vhffs project and its contributors
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+#3. Neither the name of vhffs nor the names of its contributors
+# may be used to endorse or promote products derived from this
+# software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+use strict;
+use utf8;
+
+use POSIX qw(locale_h);
+use locale;
+use Locale::gettext;
+
+use lib '%VHFFS_LIB_DIR%';
+
+use Vhffs::Panel::Public;
+use Vhffs::Panel::Tag;
+
+my $panel = new Vhffs::Panel::Public();
+
+my $cgi = $panel->{cgi};
+
+my @included_tag_ids = map { int($_); } $cgi->param('included_tags');
+my @excluded_tag_ids = map { int($_); } $cgi->param('excluded_tags');
+
+
+
+my $discard_excluded = $cgi->param('discard_ex');
+@excluded_tag_ids = grep { $_ != $discard_excluded } @excluded_tag_ids if(defined $discard_excluded);
+
+my $discard_included = $cgi->param('discard_inc');
+@included_tag_ids = grep { $_ != $discard_included } @included_tag_ids if(defined $discard_included);
+
+
+my $query_string = '';
+
+$query_string .= 'included_tags='.(join('&included_tags=', @included_tag_ids)) if(scalar(@included_tag_ids));
+$query_string .= '&' if(scalar(@included_tag_ids) && scalar(@excluded_tag_ids));
+$query_string .= 'excluded_tags='.(join('&excluded_tags=', @excluded_tag_ids)) if(scalar(@excluded_tag_ids));
+
+my $vars = {
+ included_tags => Vhffs::Panel::Tag::get_by_tag_ids($panel->{vhffs}, @included_tag_ids),
+ excluded_tags => Vhffs::Panel::Tag::get_by_tag_ids($panel->{vhffs}, @excluded_tag_ids),
+ other_tags => Vhffs::Panel::Tag::get_all_excluding($panel->{vhffs}, @included_tag_ids, @excluded_tag_ids),
+ query_string => $query_string
+};
+
+$panel->render('content/groupsearch-form.tt', $vars);
Modified: trunk/vhffs-public/index.pl
===================================================================
--- trunk/vhffs-public/index.pl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/index.pl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -35,6 +35,31 @@
use POSIX qw(locale_h);
use locale;
use Locale::gettext;
+
+use lib '%VHFFS_LIB_DIR%';
+use Vhffs::Panel::Group;
+use Vhffs::Panel::Public;
+
+my $panel = new Vhffs::Panel::Public();
+
+my $hostname = $panel->{vhffs}->get_config->get_host_name;
+
+my $vars = {
+ lg_title => sprintf( gettext("Last groups on %s") , $hostname ),
+ groups => Vhffs::Panel::Group::get_last_groups( $panel->{vhffs} )
+};
+
+$panel->render('content/last-groups.tt', $vars);
+
+
+__END__
+
+use strict;
+use utf8;
+
+use POSIX qw(locale_h);
+use locale;
+use Locale::gettext;
use CGI;
use lib '%VHFFS_LIB_DIR%';
Modified: trunk/vhffs-public/lastusers.pl
===================================================================
--- trunk/vhffs-public/lastusers.pl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/lastusers.pl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -35,32 +35,16 @@
use POSIX qw(locale_h);
use locale;
use Locale::gettext;
-use CGI;
use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
-use Vhffs::Panel::Template;
+
+use Vhffs::Panel::Public;
use Vhffs::Panel::User;
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
+my $panel = new Vhffs::Panel::Public();
-my $vhffs = $panel->{'vhffs'};
-my $templatedir = $panel->{'templatedir'};
-my $cgi = $panel->{'cgi'};
+my $users = Vhffs::Panel::User::get_last_users($panel->{vhffs});
-$panel->check_public();
-
-my $template;
-my $users = Vhffs::Panel::User::get_last_users( $vhffs );
-my $hostname = $vhffs->get_config->get_host_name;
-
-
-$template = new Vhffs::Panel::Template( filename => $templatedir."/public/userslist.tmpl", global_var => 1, die_on_bad_params => 0, loop_context_vars => 1 );
-$template->param( TEXT_TITLE => sprintf( gettext("Last users on %s") , $hostname ) );
-$template->param( URL_PANEL => $vhffs->get_config->get_panel->{'url'} );
-$template->param( USE_AVATAR => $panel->use_users_avatars );
-$template->param( USERS => $users );
-
-$panel->light( $template );
-$panel->display;
+$panel->render('content/last-users.tt', {
+ users => $users
+});
Deleted: trunk/vhffs-public/tagsearch.pl
===================================================================
--- trunk/vhffs-public/tagsearch.pl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/tagsearch.pl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,84 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-#3. Neither the name of vhffs nor the names of its contributors
-# may be used to endorse or promote products derived from this
-# software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use utf8;
-
-use POSIX qw(locale_h);
-use locale;
-use Locale::gettext;
-use CGI;
-use Encode;
-
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Commons;
-use Vhffs::Panel::Main;
-use Vhffs::Panel::Tag;
-use Vhffs::Panel::Template;
-
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-
-my $vhffs = $panel->{'vhffs'};
-my $templatedir = $panel->{'templatedir'};
-my $cgi = $panel->{'cgi'};
-
-$panel->check_public();
-
-my $template = new Vhffs::Panel::Template( filename => $templatedir.'/public/groupslist.tmpl', die_on_bad_params => 0 );
-my $tag = $cgi->param('tag');
-my $page = $cgi->param('page');
-my $per_page_count = 5;
-$page = 1 unless(defined $page && int($page) > 0);
-$panel->redirect('/') unless(defined $tag && int($tag) > 0);
-
-my $result = Vhffs::Panel::Tag::get_groups(
- $vhffs,
- int($tag),
- ($page -1) * $per_page_count,
- $per_page_count
-);
-
-$template->param( URL_PANEL => $vhffs->get_config->get_panel->{'url'} );
-
-if($result->{total_count} == 0) {
- $template->param( TEXT_TITLE => gettext('No group found') );
-} else {
- Vhffs::Panel::Commons::paginate($template, $page, $result->{total_count}, $per_page_count,
- { tag => $tag });
- $template->param( USE_AVATAR => $panel->use_groups_avatars );
- $template->param( TEXT_TITLE => sprintf( gettext('%d group(s) found'), $result->{total_count} ) );
- $template->param( GROUPS => $result->{data} );
-}
-
-$panel->light( $template );
-$panel->display;
-
Modified: trunk/vhffs-public/templates/Makefile.am
===================================================================
--- trunk/vhffs-public/templates/Makefile.am 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/templates/Makefile.am 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,20 +1,20 @@
publictemplatesdir = @TEMPLATESDIR@/public
nobase_dist_publictemplates_DATA = \
- banner.tmpl \
- group_part.tmpl \
- group.tmpl \
- groupslist.tmpl \
- index.tmpl \
- misc/cvs-part.tmpl \
- misc/groupinfo.tmpl \
- misc/list-part.tmpl \
- misc/pagination.tmpl \
- misc/userinfo.tmpl \
- misc/svn-part.tmpl \
- misc/git-part.tmpl \
- misc/web-part.tmpl \
- simplemsg.tmpl \
- user_part.tmpl \
- user.tmpl \
- userslist.tmpl \
- websiteslist.tmpl
+ common/error.tt \
+ common/pager.tt \
+ content/all-groups.tt \
+ content/last-groups.tt \
+ content/last-users.tt \
+ content/group-details.tt \
+ content/groupsearch-form.tt \
+ content/groupsearch-results.tt \
+ content/usersearch-form.tt \
+ content/usersearch-results.tt \
+ layouts/public.tt \
+ parts/footer.tt \
+ parts/group-general.tt \
+ parts/header.tt \
+ parts/left-menu.tt \
+ parts/tags-cloud.tt \
+ parts/top-menu.tt \
+ parts/user-general.tt
Deleted: trunk/vhffs-public/templates/banner.tmpl
===================================================================
--- trunk/vhffs-public/templates/banner.tmpl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/templates/banner.tmpl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,12 +0,0 @@
-<div id="header">
- <div id="top_menu">
- <div id="userToolBox">
- <a href="<TMPL_VAR ESCAPE=1 NAME="URL_PANEL">"><img src="/themes/vhffs/images/login.png" alt="<TMPL_I18N KEY="Back to login page">" title="<TMPL_I18N KEY="Back to login page">"/></a>
- <a href="/index.pl"><img src="/themes/vhffs/images/home.png" alt="<TMPL_I18N KEY="Homepage of public area">" title="<TMPL_I18N KEY="Homepage of public area">"/></a>
- <a href="/lastusers.pl"><img src="/themes/vhffs/images/users.png" alt="<TMPL_I18N KEY="Last Users">" title="<TMPL_I18N KEY="Last Users">"/></a>
- <a href="/lastgroups.pl"><img src="/themes/vhffs/images/projects.png" alt="<TMPL_I18N KEY="Last Groups">" title="<TMPL_I18N KEY="Last Groups">"/></a>
- <a href="/allwebsites.pl"><img src="/themes/vhffs/images/webs.png" alt="<TMPL_I18N KEY="List of all websites">" title="<TMPL_I18N KEY="List of all websites">"/></a>
- </div>
- </div>
-</div>
-
Copied: trunk/vhffs-public/templates/common (from rev 1361, branches/vhffs-design/vhffs-public/templates/common)
Copied: trunk/vhffs-public/templates/content (from rev 1361, branches/vhffs-design/vhffs-public/templates/content)
Deleted: trunk/vhffs-public/templates/group.tmpl
===================================================================
--- trunk/vhffs-public/templates/group.tmpl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/templates/group.tmpl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,50 +0,0 @@
-<TMPL_INCLUDE NAME="banner.tmpl">
-<div id="public">
-<h1><TMPL_VAR ESCAPE=1 NAME="VALUE_REALNAME"></h1>
-<ul>
- <li><TMPL_I18N KEY="Groupname">: <TMPL_VAR ESCAPE=1 NAME="VALUE_GROUPNAME"></li>
- <li><TMPL_INCLUDE NAME="user_part.tmpl"></li>
-</ul>
-<fieldset><legend><TMPL_I18N KEY="Description"></legend>
-<TMPL_VAR NAME="VALUE_DESCRIPTION">
-</fieldset>
-
-<TMPL_IF NAME="WEBSITES">
-<h2><TMPL_I18N KEY="Websites for this group"></h2>
-<TMPL_INCLUDE NAME="misc/web-part.tmpl">
-</TMPL_IF>
-
-<TMPL_IF NAME="CVSREPOS">
-<h2><TMPL_I18N KEY="CVS Repositories for this group"></h2>
-<TMPL_INCLUDE NAME="misc/cvs-part.tmpl">
-</TMPL_IF>
-
-<TMPL_IF NAME="SVNREPOS">
-<h2><TMPL_I18N KEY="Subversion Repositories for this group"></h2>
-<TMPL_INCLUDE NAME="misc/svn-part.tmpl">
-</TMPL_IF>
-
-<TMPL_IF NAME="GITREPOS">
-<h2><TMPL_I18N KEY="GIT Repositories for this group"></h2>
-<TMPL_INCLUDE NAME="misc/git-part.tmpl">
-</TMPL_IF>
-
-<TMPL_IF NAME="LISTS">
-<h2><TMPL_I18N KEY="Mailing Lists for this group"></h2>
-<TMPL_INCLUDE NAME="misc/list-part.tmpl">
-</TMPL_IF>
-
-<TMPL_IF NAME="TAG_CATEGORIES">
-<h2><TMPL_I18N KEY="Tags"></h2>
-<ul>
-<TMPL_LOOP NAME="TAG_CATEGORIES">
-<li><TMPL_VAR NAME="LABEL" ESCAPE="1">:
-<TMPL_LOOP NAME="TAGS">
-<a href="/tagsearch.pl?tag=<TMPL_VAR NAME="TAG_ID">"><TMPL_VAR NAME="LABEL" ESCAPE="1"><TMPL_UNLESS NAME="__LAST__"></a>,</TMPL_UNLESS>
-</TMPL_LOOP>
-</li>
-</TMPL_LOOP>
-</ul>
-</TMPL_IF>
-
-</div>
Deleted: trunk/vhffs-public/templates/group_part.tmpl
===================================================================
--- trunk/vhffs-public/templates/group_part.tmpl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/templates/group_part.tmpl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,8 +0,0 @@
-<TMPL_IF NAME="GROUPS">
- <TMPL_I18N KEY="Groups">:
- <TMPL_LOOP NAME="GROUPS">
- <a href="/group.pl?name=<TMPL_VAR ESCAPE=1 NAME="GROUPNAME">"><TMPL_VAR ESCAPE=1 NAME="GROUPNAME"></a><TMPL_UNLESS NAME="__LAST__">,</TMPL_UNLESS>
- </TMPL_LOOP>
-<TMPL_ELSE>
- <TMPL_I18N KEY="No group">
-</TMPL_IF>
Deleted: trunk/vhffs-public/templates/groupslist.tmpl
===================================================================
--- trunk/vhffs-public/templates/groupslist.tmpl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/templates/groupslist.tmpl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,20 +0,0 @@
-<TMPL_INCLUDE NAME="banner.tmpl">
-
-<div id="public">
-<h1><TMPL_VAR ESCAPE=1 NAME="TEXT_TITLE"></h1>
-<TMPL_IF NAME="LETTERS">
-<p style="text-align:center">
-<TMPL_LOOP NAME="LETTERS">
-[<a href="/allgroups.pl?letter=<TMPL_VAR ESCAPE=1 NAME="letter">"><TMPL_VAR ESCAPE=1 NAME="letter"></a>]
-</TMPL_LOOP>
-[<a href="/allgroups.pl?letter=all"><TMPL_VAR ESCAPE=1 NAME="ALL"></a>]
-</p>
-</TMPL_IF>
-<TMPL_INCLUDE NAME="misc/pagination.tmpl">
-<TMPL_IF NAME="MESSAGE">
-<p style="text-align:center;font-weight:bold;"><TMPL_VAR ESCAPE=1 NAME="MESSAGE"></p>
-</TMPL_IF>
-<TMPL_LOOP NAME="GROUPS">
-<TMPL_INCLUDE NAME="misc/groupinfo.tmpl">
-</TMPL_LOOP>
-</div>
Deleted: trunk/vhffs-public/templates/index.tmpl
===================================================================
--- trunk/vhffs-public/templates/index.tmpl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/templates/index.tmpl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,70 +0,0 @@
-<TMPL_INCLUDE NAME="banner.tmpl">
-<div id="public">
- <h1><TMPL_VAR ESCAPE=1 NAME="TEXT_TITLE"></h1>
-
- <h2><TMPL_I18N KEY="Users"></h2>
- <ul>
- <li><a href="/lastusers.pl"><TMPL_I18N KEY="Last users"></a></li>
- </ul>
- <fieldset>
- <legend><TMPL_I18N KEY="Search an user"></legend>
- <form method="post" action="/usersearch.pl">
- <p><label for="search_username"><TMPL_I18N KEY="Username">:</label>
- <input type="text" name="username" id="search_username"/></p>
- <p><label for="search_firstname"><TMPL_I18N KEY="Firstname">:</label>
- <input type="text" name="firstname" id="search_firstname"/></p>
- <p><label for="search_lastname"><TMPL_I18N KEY="Lastname">:</label>
- <input type="text" name="lastname" id="search_lastname"/></p>
- <p><input type="submit" name="search_user_submit" value="<TMPL_I18N KEY="Search">"/></p>
- </form>
- </fieldset>
-
- <h2><TMPL_I18N KEY="Groups/Projects"></h2>
- <h3><TMPL_I18N KEY="Project search"></h3>
- <ul>
- <li><a href="/lastgroups.pl"><TMPL_I18N KEY="Last Groups"></a></li>
- <li><a href="/allgroups.pl"><TMPL_I18N KEY="All Groups"></a></li>
- </ul>
- <fieldset>
- <legend><TMPL_I18N KEY="Search a group"></legend>
- <form method="post" action="/groupsearch.pl">
- <p><label for="search_groupname"><TMPL_I18N KEY="Groupname">:</label>
- <input type="text" name="groupname" id="search_groupname"/></p>
- <p><label for="search_description"><TMPL_I18N KEY="Description contains">:</label>
- <input type="text" name="description" id="search_description"/></p>
- <p><input type="submit" name="search_group_submit" value="<TMPL_I18N KEY="Search">"/></p>
- </form>
- </fieldset>
- <TMPL_IF NAME="TOP_TAGS">
- <h3><TMPL_I18N KEY="Most popular tags"></h3>
- <TMPL_LOOP NAME="TOP_TAGS">
- <span class="tag-<TMPL_VAR NAME="WEIGHT">">
- <a href="/tagsearch.pl?tag=<TMPL_VAR NAME="TAG_ID">"> <span title="<TMPL_VAR ESCAPE=1 NAME="CATEGORY_DESCRIPTION">"><TMPL_VAR NAME="CATEGORY_LABEL"></span>::<span title="<TMPL_VAR ESCAPE=1 NAME="TAG_DESCRIPTION">"><TMPL_VAR NAME="TAG_LABEL"></span></a>
- </span>
- </TMPL_LOOP>
- </TMPL_IF>
- <TMPL_IF NAME="RANDOM_TAGS">
- <h3><TMPL_I18N KEY="Random tags"></h3>
- <TMPL_LOOP NAME="RANDOM_TAGS">
- <span class="tag-<TMPL_VAR NAME="WEIGHT">">
- <a href="/tagsearch.pl?tag=<TMPL_VAR NAME="TAG_ID">" ><span title="<TMPL_VAR ESCAPE=1 NAME="CATEGORY_DESCRIPTION">"><TMPL_VAR NAME="CATEGORY_LABEL"></span>::<span title="<TMPL_VAR ESCAPE=1 NAME="TAG_DESCRIPTION">"><TMPL_VAR NAME="TAG_LABEL"></span></a>
- </span>
- </TMPL_LOOP>
- </TMPL_IF>
- <h2><TMPL_I18N KEY="Websites"></h2>
- <ul>
- <li><a href="/allwebsites.pl"><TMPL_I18N KEY="All Websites"></a></li>
- </ul>
- <fieldset>
- <legend><TMPL_I18N KEY="Search a website"></legend>
- <form method="post" action="/websitesearch.pl">
- <p><label for="search_servername"><TMPL_I18N KEY="Website name">:</label>
- <input type="text" name="servername" id="search_servername"/></p>
- <p><label for="search_wdesc"><TMPL_I18N KEY="Website description">:</label>
- <input type="text" name="description" id="search_wdesc"/></p>
- <p><input type="submit" name="search_website_submit" value="<TMPL_I18N KEY="Search">"/></p>
- </form>
- </fieldset>
-
-
-</div>
Copied: trunk/vhffs-public/templates/layouts (from rev 1361, branches/vhffs-design/vhffs-public/templates/layouts)
Copied: trunk/vhffs-public/templates/parts (from rev 1361, branches/vhffs-design/vhffs-public/templates/parts)
Deleted: trunk/vhffs-public/templates/simplemsg.tmpl
===================================================================
--- trunk/vhffs-public/templates/simplemsg.tmpl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/templates/simplemsg.tmpl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,6 +0,0 @@
- <div class="logo">
- </div>
-
- <div class="misc" id="misc">
- <h1 class="message"><TMPL_VAR ESCAPE=1 NAME="MESSAGE"></h1>
- </div>
Deleted: trunk/vhffs-public/templates/user.tmpl
===================================================================
--- trunk/vhffs-public/templates/user.tmpl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/templates/user.tmpl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,6 +0,0 @@
-<TMPL_INCLUDE NAME="banner.tmpl">
-
-<div id="public">
-<h1><TMPL_VAR ESCAPE=0 NAME="USERNAME"></h1>
-<TMPL_INCLUDE NAME="misc/userinfo.tmpl">
-</div>
Deleted: trunk/vhffs-public/templates/user_part.tmpl
===================================================================
--- trunk/vhffs-public/templates/user_part.tmpl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/templates/user_part.tmpl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,8 +0,0 @@
-<TMPL_IF NAME="USERS">
- <TMPL_I18N KEY="Users">:
- <TMPL_LOOP NAME="USERS">
- <a href="/user.pl?name=<TMPL_VAR ESCAPE=1 NAME="USERNAME">"><TMPL_VAR ESCAPE=1 NAME="USERNAME"></a><TMPL_UNLESS NAME="__LAST__">,</TMPL_UNLESS>
- </TMPL_LOOP>
-<TMPL_ELSE>
- <TMPL_I18N KEY="No user">
-</TMPL_IF>
Deleted: trunk/vhffs-public/templates/userslist.tmpl
===================================================================
--- trunk/vhffs-public/templates/userslist.tmpl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/templates/userslist.tmpl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,10 +0,0 @@
-<TMPL_INCLUDE NAME="banner.tmpl">
-
-<div id="public">
-
-<h1><TMPL_VAR ESCAPE=1 NAME="TEXT_TITLE"></h1>
-<TMPL_INCLUDE NAME="misc/pagination.tmpl">
-<TMPL_LOOP NAME="USERS">
-<TMPL_INCLUDE NAME="misc/userinfo.tmpl">
-</TMPL_LOOP>
-</div>
Deleted: trunk/vhffs-public/templates/websiteslist.tmpl
===================================================================
--- trunk/vhffs-public/templates/websiteslist.tmpl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/templates/websiteslist.tmpl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,21 +0,0 @@
-<TMPL_INCLUDE NAME="banner.tmpl">
-
-<div id="public">
-<h1><TMPL_VAR ESCAPE=1 NAME="TEXT_TITLE"></h1>
-<TMPL_IF NAME="LETTERS">
-<p style="text-align:center">
-<TMPL_LOOP name="LETTERS">
-[<a href="/allwebsites.pl?letter=<TMPL_VAR ESCAPE=1 name="letter">" title="<TMPL_VAR ESCAPE=1 name="count"> <TMPL_I18N KEY="website(s)">"><TMPL_VAR ESCAPE=1 name="letter"></a>]
-</TMPL_LOOP>
-[<a href="/allwebsites.pl?letter=all"><TMPL_VAR ESCAPE=1 name="ALL"></a>]
-</p>
-</TMPL_IF>
-<TMPL_INCLUDE NAME="misc/pagination.tmpl">
-<TMPL_IF NAME="WEBSITES">
-<TMPL_INCLUDE NAME="misc/web-part.tmpl">
-<TMPL_ELSE>
-<p style="text-align:center;font-weight:bold;">
-<TMPL_I18N KEY="No websites">
-</p>
-</TMPL_IF>
-</div>
Deleted: trunk/vhffs-public/user.pl
===================================================================
--- trunk/vhffs-public/user.pl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/user.pl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,77 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-#3. Neither the name of vhffs nor the names of its contributors
-# may be used to endorse or promote products derived from this
-# software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use utf8;
-
-use POSIX qw(locale_h);
-use locale;
-use Locale::gettext;
-use CGI;
-
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
-use Vhffs::Panel::Template;
-use Vhffs::Panel::User;
-use Vhffs::User;
-
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-
-$panel->check_public();
-my $cgi = $panel->{cgi};
-my $vhffs = $panel->{vhffs};
-my $templatedir = $panel->{templatedir};
-
-my $username = $cgi->param('name');
-my $user;
-my $template;
-
-if(!defined $username) {
- $template = new HTML::Template( filename => $templatedir.'/public/simplemsg.tmpl' );
- my $message = gettext( "CGI Error !");
- $template->param( MESSAGE => $message );
-} elsif(!defined($user = Vhffs::User::get_by_username($vhffs, $username))) {
- $template = new HTML::Template( filename => $templatedir.'/public/simplemsg.tmpl' );
- my $message = gettext( "CGI Error !");
- $template->param( MESSAGE => $message );
-} else {
- $template = new Vhffs::Panel::Template( filename => $templatedir.'/public/user.tmpl', loop_context_vars => 1, die_on_bad_params => 0);
- $template->param( OBJECT_ID => $user->get_oid );
- $template->param( USERNAME => $user->get_username );
- $template->param( FIRSTNAME => $user->get_firstname );
- $template->param( LASTNAME => $user->get_lastname );
- $template->param( GROUPS => Vhffs::Panel::User::get_groups($user) );
- $template->param( USE_AVATAR => $panel->use_users_avatars );
-}
-
-$panel->light( $template );
-$panel->display;
Modified: trunk/vhffs-public/usersearch.pl
===================================================================
--- trunk/vhffs-public/usersearch.pl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/usersearch.pl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -35,52 +35,37 @@
use POSIX qw(locale_h);
use locale;
use Locale::gettext;
-use CGI;
-use Encode;
use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Commons;
-use Vhffs::Panel::Main;
-use Vhffs::Panel::Template;
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
+use Vhffs::Panel::Public;
+use Vhffs::Panel::User;
-my $vhffs = $panel->{'vhffs'};
-my $templatedir = $panel->{'templatedir'};
-my $cgi = $panel->{'cgi'};
+my $panel = new Vhffs::Panel::Public();
+my $cgi = $panel->{cgi};
-$panel->check_public();
+my $username = Encode::decode_utf8($cgi->param('username'));
+my $page = defined($cgi->param('page')) ? int($cgi->param('page')) : 1;
-my $template = new Vhffs::Panel::Template( filename => $templatedir.'/public/userslist.tmpl', die_on_bad_params => 0 );
-my $username = $cgi->param('username') || '';
-my $firstname = Encode::decode_utf8( $cgi->param('firstname') ) || '';
-my $lastname = Encode::decode_utf8( $cgi->param('lastname') ) || '';
-my $page = $cgi->param('page');
-my $per_page_count = 5;
-$page = 1 unless(defined $page && int($page) > 0);
+if($username =~ /^\s*$/) {
+ $panel->render('common/error.tt', {
+ message => gettext('You have to enter an username')
+ });
+ exit(0);
+}
-my $result = Vhffs::Panel::User::public_search(
- $vhffs,
- ( $username =~ /^\s*$/ ? undef : $username ),
- ( $firstname =~ /^\s*$/ ? undef : $firstname ),
- ( $lastname =~ /^\s*$/ ? undef : $lastname ),
- ($page -1) * $per_page_count,
- $per_page_count
-);
+my ($users, $total) = Vhffs::Panel::User::public_search($panel->{vhffs}, $username, ($page - 1));
-$template->param( URL_PANEL => $vhffs->get_config->get_panel->{'url'} );
-
-if($result->{total_count} == 0) {
- $template->param( TEXT_TITLE => gettext('No user found') );
-} else {
- Vhffs::Panel::Commons::paginate($template, $page, $result->{total_count}, $per_page_count,
- { username => $username, firstname => $firstname, lastname => $lastname});
- $template->param( USE_AVATAR => $panel->use_users_avatars );
- $template->param( TEXT_TITLE => sprintf( gettext('%d user(s) found'), $result->{total_count} ) );
- $template->param( USERS => $result->{data} );
+if($total == 0) {
+ $panel->render('common/error.tt', {
+ message => gettext('No user found')
+ });
+ exit(0);
}
-$panel->light( $template );
-$panel->display;
+my $pager = Vhffs::Panel::Commons::get_pager($page, $total, 10, 5, $panel->{url}, { username => $username });
+$panel->render('content/usersearch-results.tt', {
+ users => $users,
+ u_pager => $pager
+});
Copied: trunk/vhffs-public/usersearch_form.pl (from rev 1361, branches/vhffs-design/vhffs-public/usersearch_form.pl)
===================================================================
--- trunk/vhffs-public/usersearch_form.pl (rev 0)
+++ trunk/vhffs-public/usersearch_form.pl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -0,0 +1,45 @@
+#!%PERL%
+# Copyright (c) vhffs project and its contributors
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+#3. Neither the name of vhffs nor the names of its contributors
+# may be used to endorse or promote products derived from this
+# software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+use strict;
+use utf8;
+
+use POSIX qw(locale_h);
+use locale;
+use Locale::gettext;
+
+use lib '%VHFFS_LIB_DIR%';
+
+use Vhffs::Panel::Public;
+
+my $panel = new Vhffs::Panel::Public();
+
+$panel->render('content/usersearch-form.tt');
Deleted: trunk/vhffs-public/websitesearch.pl
===================================================================
--- trunk/vhffs-public/websitesearch.pl 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-public/websitesearch.pl 2009-03-10 08:08:59 UTC (rev 1362)
@@ -1,85 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-#3. Neither the name of vhffs nor the names of its contributors
-# may be used to endorse or promote products derived from this
-# software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use utf8;
-
-use POSIX qw(locale_h);
-use locale;
-use Locale::gettext;
-use CGI;
-use Encode;
-
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Panel::Main;
-use Vhffs::Panel::Template;
-use Vhffs::Panel::Web;
-
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-
-my $vhffs = $panel->{'vhffs'};
-my $templatedir = $panel->{'templatedir'};
-my $cgi = $panel->{'cgi'};
-
-$panel->check_public();
-
-my $hostname = $vhffs->get_config->get_host_name;
-my $template = new Vhffs::Panel::Template( filename => $templatedir."/public/websiteslist.tmpl" );
-
-my $servername = $cgi->param('servername') || '';
-my $description = Encode::decode_utf8( $cgi->param('description') ) || '';
-my $page = $cgi->param('page');
-my $per_page_count = 10;
-$page = 1 unless(defined $page && int($page) > 0);
-
-my $result = Vhffs::Panel::Web::public_search(
- $vhffs,
- $servername =~ /^\s*$/ ? undef : $servername,
- $description =~ /^\s*$/ ? undef : $description,
- ($page - 1) * $per_page_count,
- $per_page_count
-);
-
-
-if($result->{total_count} == 0) {
- $template->param( TEXT_TITLE => gettext('No website found') );
-} else {
- Vhffs::Panel::Commons::paginate($template, $page, $result->{total_count}, $per_page_count,
- { servername => $servername, description => $description });
- $template->param( TEXT_TITLE => sprintf( gettext('%d websites(s) found'), $result->{total_count} ) );
- $template->param( WEBSITES => $result->{data} );
-}
-
-
-
-$panel->light( $template );
-$panel->display;
Modified: trunk/vhffs-themes/Makefile.am
===================================================================
--- trunk/vhffs-themes/Makefile.am 2009-03-10 06:48:33 UTC (rev 1361)
+++ trunk/vhffs-themes/Makefile.am 2009-03-10 08:08:59 UTC (rev 1362)
@@ -70,10 +70,24 @@
vhffs/images/web.png \
vhffs/images/webs.png \
vhffs/images/cronentry.png \
- vhffs/main.css
+ vhffs/main.css \
+ light-grey/main.css \
+ light-grey/img/flag_en.png \
+ light-grey/img/flag_es.png \
+ light-grey/img/flag_fr.png \
+ light-grey/img/background_layout_2.gif \
+ light-grey/img/new_tag.png \
+ light-grey/img/vhffs-big.png \
+ light-grey/img/background_layout_1.gif \
+ light-grey/img/loading.gif \
+ light-grey/img/vhffs.png \
+ light-grey/img/bullet.png \
+ light-grey/img/background_body.png \
+ light-grey/img/background_layout_3.gif
+
if INSTALL_PANEL
panelthemesdir = @PANELDIR@/themes
Copied: trunk/vhffs-themes/light-grey (from rev 1361, branches/vhffs-design/vhffs-themes/light-grey)