[vhffs-dev] [1927] fastcgi'shed panel tags management

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


Revision: 1927
Author:   gradator
Date:     2012-01-23 21:49:48 +0100 (Mon, 23 Jan 2012)
Log Message:
-----------
fastcgi'shed panel tags management

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Panel/Admin.pm
    trunk/vhffs-api/src/Vhffs/Panel/Tag.pm
    trunk/vhffs-panel/Makefile.am
    trunk/vhffs-panel/index.pl
    trunk/vhffs-panel/templates/admin/tag/category/list.tt
    trunk/vhffs-panel/templates/admin/tag/list.tt
    trunk/vhffs-panel/templates/admin/tag/request/details.tt
    trunk/vhffs-panel/templates/admin/tag/request/list.tt
    trunk/vhffs-panel/templates/group/tags.tt
    trunk/vhffs-panel/templates/menu/admin.tt
    trunk/vhffs-panel/templates/menu/moderator.tt

Removed Paths:
-------------
    trunk/vhffs-panel/acl/
    trunk/vhffs-panel/admin/
    trunk/vhffs-panel/object/

Modified: trunk/vhffs-api/src/Vhffs/Panel/Admin.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Admin.pm	2012-01-22 23:40:11 UTC (rev 1926)
+++ trunk/vhffs-api/src/Vhffs/Panel/Admin.pm	2012-01-23 20:49:48 UTC (rev 1927)
@@ -158,11 +158,11 @@
 
 sub get_tag_category {
 	my $items = [
-		{ link => '/admin/tag/create.pl',			label => gettext( 'Create new tag' ) },
-		{ link => '/admin/tag/list.pl',	label => gettext( 'Manage existing tags' )},
-		{ link => '/admin/tag/category/create.pl',	label => gettext( 'Create new category' )},
-		{ link => '/admin/tag/category/list.pl',	label => gettext( 'Manage existing categories' )},
-		{ link => '/admin/tag/request/list.pl',			label => gettext('Manage requests')}
+		{ link => '?do=tagcreate',			label => gettext( 'Create new tag' ) },
+		{ link => '?do=taglist',			label => gettext( 'Manage existing tags' )},
+		{ link => '?do=tagcategorycreate',		label => gettext( 'Create new category' )},
+		{ link => '?do=tagcategorylist',		label => gettext( 'Manage existing categories' )},
+		{ link => '?do=tagrequestlist',			label => gettext( 'Manage requests' )}
 	];
 	return { name => gettext( 'Tags Admin'),		items => $items, type => 'tags' };
 }

Modified: trunk/vhffs-api/src/Vhffs/Panel/Tag.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Tag.pm	2012-01-22 23:40:11 UTC (rev 1926)
+++ trunk/vhffs-api/src/Vhffs/Panel/Tag.pm	2012-01-23 20:49:48 UTC (rev 1927)
@@ -39,6 +39,9 @@
 use Locale::gettext;
 use Vhffs::Constants;
 use Vhffs::Panel::Group;
+require Vhffs::Tag;
+require Vhffs::Tag::Category; 
+require Vhffs::Tag::Request;
 
 =head1 NAME
 
@@ -135,4 +138,549 @@
 	return $dbh->selectall_arrayref($sql, { Slice => {} }, @ids);
 }
 
+sub create_tag {
+	my $panel = shift;
+	return unless $panel->check_modo();
+
+	my $vhffs = $panel->{'vhffs'};
+	my $cgi = $panel->{'cgi'};
+	my $session = $panel->{'session'};
+	my $user = $panel->{'user'};
+
+	my $vars = {};
+
+	if(defined $cgi->param('create_tag_submit')) {
+		if(_create_tag( $panel , $vars )) {
+			$panel->redirect('?do=taglist&msg='.gettext('Tag successfully created'));
+		}
+	}
+
+	$vars->{categories} = Vhffs::Tag::Category::get_all($panel->{vhffs});
+	$panel->render('admin/tag/create.tt', $vars);
+}
+
+sub _create_tag {
+	my $panel = shift;
+	my $vars = shift;
+	my $cgi = $panel->{'cgi'};
+
+	my $category_id = $cgi->param('category_id');
+	my $label = $cgi->param('label');
+	my $description = $cgi->param('description');
+	my $main = $panel->{vhffs};
+
+	$vars->{label} = $label;
+	$vars->{description} = $description;
+	$vars->{category_id} = $category_id;
+
+	unless(defined $category_id && defined $label && defined $description) {
+		$panel->add_error( gettext('CGI Error!') );
+		return 0;
+	}
+	
+	if($category_id !~ /^\d+$/) {
+		$panel->add_error( gettext('Invalid category') );
+		return 0;
+	}
+	
+	if($label =~ /^\s*$/) {
+		$panel->add_error( gettext('You have to enter a label') );
+		return 0;
+	}
+	
+	if($description =~ /^\s*$/) {
+		$panel->add_error( gettext('You have to enter a description') );
+		return 0;
+	}
+	
+	my $category = Vhffs::Tag::Category::get_by_category_id($main, $category_id);
+	
+	unless(defined $category) {
+		$panel->add_error( gettext('Category does not exists') );
+		return 0;
+	}
+	
+	unless(defined Vhffs::Tag::create($main, $label, $description, $panel->{user}, $category)) {
+		$panel->add_error( gettext('Unable to create tag') );
+		return 0;
+	}
+	
+	return 1;
+}
+
+sub create_category {
+	my $panel = shift;
+	return unless $panel->check_modo();
+
+	my $vhffs = $panel->{'vhffs'};
+	my $cgi = $panel->{'cgi'};
+	my $session = $panel->{'session'};
+	my $user = $panel->{'user'};
+
+	my $vars = {};
+
+	if(defined $cgi->param('create_tag_category_submit')) {
+		if(_create_category( $panel, $vars )) {
+			$panel->redirect('?do=tagcategorylist&msg='.gettext('Tag category successfully created'));
+		}
+	}
+
+	$panel->set_title(gettext('Create Tag Category'));
+	$vars->{visibilities} = [
+		{ code => Vhffs::Constants::TAG_VISIBILITY_GROUP_CREATION, label => gettext('Public (available on group creation)') },
+		{ code => Vhffs::Constants::TAG_VISIBILITY_PUBLIC, label => gettext('Public') },
+		{ code => Vhffs::Constants::TAG_VISIBILITY_MODERATORS, label => gettext('Moderators') },
+		{ code => Vhffs::Constants::TAG_VISIBILITY_ADMINS, label => gettext('Administrators') }
+	];
+
+	$panel->render('admin/tag/category/create.tt', $vars);
+}
+
+sub _create_category {
+	my $panel = shift;
+	my $vars = shift;
+	my $vhffs = $panel->{vhffs};
+	my $cgi = $panel->{cgi};
+
+	my $label = $cgi->param('label');
+	my $description = $cgi->param('description');
+	my $visibility = $cgi->param('visibility');
+
+	$vars->{label} = $label;
+	$vars->{description} = $description;
+	$vars->{visibility} = $visibility;
+	
+	unless( defined $label and defined $description and defined $visibility ) {
+		$panel->add_error( gettext('CGI error') );
+		return 0;
+	}
+	
+	if($label =~ /^\s*$/ || $description =~ /^\s*$/) {
+		$panel->add_error( gettext('You have to enter a label and a description for the category') );
+		return 0;
+	}
+	
+	if(!defined Vhffs::Tag::Category::create($vhffs, $label, $description, $visibility, $panel->{user})) {
+		$panel->add_error( gettext('Unable to create category') );
+		return 0;
+	}
+	return 1;
+}
+
+sub list_tag {
+	my $panel = shift;
+	return unless $panel->check_modo();
+
+	my $vhffs = $panel->{'vhffs'};
+	my $cgi = $panel->{'cgi'};
+	my $session = $panel->{'session'};
+	my $user = $panel->{'user'};
+
+	if(defined $cgi->param('delete_tag_submit')) {
+		if(_delete_tag( $panel )) {
+			$panel->add_info( gettext('Tag deleted') );
+		} else {
+			$panel->add_error( gettext('Unable to delete tag') );
+		}
+	}
+
+	$panel->set_title(gettext('Tags'));
+	my $vars = {
+		tags => Vhffs::Tag::get_all($panel->{vhffs})
+	};
+	$panel->render('admin/tag/list.tt', $vars);
+}
+
+sub _delete_tag {
+	my $panel = shift;
+	my $vhffs = $panel->{vhffs};
+	my $cgi = $panel->{cgi};
+
+	my $tag_id = $cgi->param('tag_id');
+	my $tag = Vhffs::Tag::get_by_tag_id($vhffs, $tag_id);
+	return 0 unless defined $tag;
+	
+	return $tag->delete();
+}
+
+sub list_category {
+	my $panel = shift;
+	return unless $panel->check_modo();
+
+	my $vhffs = $panel->{'vhffs'};
+	my $cgi = $panel->{'cgi'};
+	my $session = $panel->{'session'};
+	my $user = $panel->{'user'};
+
+	if(defined $cgi->param('delete_category_submit')) {
+		if(_delete_category( $panel )) {
+			$panel->add_info( gettext('Category deleted') );
+		} else {
+			$panel->add_error( gettext('Unable to delete category') );
+		}
+	}
+
+	$panel->set_title(gettext('Tag categories'));
+
+	my $vars = {};
+	$vars->{categories} = Vhffs::Tag::Category::get_all($panel->{vhffs});
+	$panel->render('admin/tag/category/list.tt', $vars);
+}
+
+sub _delete_category {
+	my $panel = shift;
+	my $vhffs = $panel->{vhffs};
+	my $cgi = $panel->{cgi};
+
+	my $category_id = $cgi->param('category_id');
+	my $category = Vhffs::Tag::Category::get_by_category_id($panel->{vhffs}, $category_id);
+	return 0 unless defined $category;
+	
+	return $category->delete();
+}
+
+sub adminindex {
+	my $panel = shift;
+	return unless $panel->check_modo();
+
+	my $vhffs = $panel->{'vhffs'};
+	my $cgi = $panel->{'cgi'};
+	my $session = $panel->{'session'};
+	my $user = $panel->{'user'};
+
+	$panel->set_title(gettext('Tags\' administration'));
+	require Vhffs::Panel::Admin;
+	$panel->render('admin/index.tt', { categories => [ Vhffs::Panel::Admin::get_tag_category() ] } );
+}
+
+sub list_request {
+	my $panel = shift;
+	return unless $panel->check_modo();
+
+	my $vhffs = $panel->{'vhffs'};
+	my $cgi = $panel->{'cgi'};
+	my $session = $panel->{'session'};
+	my $user = $panel->{'user'};
+
+	my $requests = Vhffs::Tag::Request::get_all($panel->{vhffs});
+	$panel->render('admin/tag/request/list.tt', {
+		requests => $requests
+	});
+}
+
+sub edit_tag {
+	my $panel = shift;
+	return unless $panel->check_modo();
+
+	my $vhffs = $panel->{'vhffs'};
+	my $cgi = $panel->{'cgi'};
+	my $session = $panel->{'session'};
+	my $user = $panel->{'user'};
+	my $tag;
+
+	unless( defined $cgi->param('tag_id') ) {
+		$panel->render('misc/message.tt', { message => gettext('CGI Error!') } );
+		return;
+	}
+
+	unless( defined ( $tag = Vhffs::Tag::get_by_tag_id($panel->{vhffs}, $cgi->param('tag_id')) ) ) {
+		$panel->render('misc/message.tt', { message => gettext('Tag not found!') } );
+		return;
+	}
+
+	if( defined $cgi->param('update_tag_submit') ) {
+		if( _update_tag( $panel, $tag )) {
+			$panel->add_info( gettext('Tag successfully updated') );
+		} else {
+			$panel->add_error( gettext('Unable to update tag') )
+		}
+	}
+
+	my $vars = {
+		tag => $tag,
+		categories => Vhffs::Tag::Category::get_all($vhffs)
+	};
+	$panel->render('admin/tag/edit.tt', $vars);
+}
+
+sub _update_tag {
+	my $panel = shift;
+	my $tag = shift;
+	my $cgi = $panel->{cgi};
+	my $user = $panel->{'user'};
+
+	my $tag_id = $cgi->param('tag_id');
+	my $label = $cgi->param('label');
+	my $description = $cgi->param('description');
+	my $category_id = $cgi->param('category_id');
+	
+	unless( defined $tag_id and defined $label and defined $description and defined $category_id ) {
+		$panel->add_error( gettext('CGI error') );
+		return 0;
+	}
+	
+	if($label =~ /^\s*$/) {
+		$panel->add_error( gettext('You have to enter a label') );
+	}
+	
+	if($description =~ /^\s*$/) {
+		$panel->add_error( gettext('You have to enter a description') );
+	}
+	
+	if($category_id !~ /^\d+$/) {
+		$panel->add_error( gettext('Invalid category') );
+	}
+	
+	if($panel->has_errors()) {
+		return 0;
+	}
+	
+	$tag->{label} = $label;
+	$tag->{description} = $description;
+	$tag->{category_id} = $category_id;
+	$tag->{updated} = time();
+	$tag->{updater_id} = $user->get_uid;
+	return $tag->save();
+}
+
+sub edit_category {
+	my $panel = shift;
+	return unless $panel->check_modo();
+
+	my $vhffs = $panel->{'vhffs'};
+	my $cgi = $panel->{'cgi'};
+	my $session = $panel->{'session'};
+	my $user = $panel->{'user'};
+	my $category;
+	my $vars = {};
+
+	unless( defined $cgi->param('category_id') ) {
+		$panel->render('misc/message.tt', { message => gettext('CGI Error!') } );
+		return;
+	}
+
+	unless( defined( $category = Vhffs::Tag::Category::get_by_category_id($panel->{vhffs}, $cgi->param('category_id')) ) ) {
+		$panel->render('misc/message.tt', { message => gettext('Category not found!') } );
+		return;
+	}
+
+	if(defined $cgi->param('update_tag_category_submit')) {
+		if( _update_category( $panel, $category )) {
+			$panel->add_info( gettext('Tag category successfully updated') );
+		} else {
+			$panel->add_error( gettext('Unable to update category') )
+		}
+	}
+
+	$panel->set_title(gettext('Update Tag Category'));
+	$vars->{visibilities} = [
+		{ code => Vhffs::Constants::TAG_VISIBILITY_GROUP_CREATION, label => gettext('Public (available on group creation)') },
+		{ code => Vhffs::Constants::TAG_VISIBILITY_PUBLIC, label => gettext('Public') },
+		{ code => Vhffs::Constants::TAG_VISIBILITY_MODERATORS, label => gettext('Moderators') },
+		{ code => Vhffs::Constants::TAG_VISIBILITY_ADMINS, label => gettext('Administrators') }
+	];
+	$vars->{category} = $category;
+	$panel->render('admin/tag/category/edit.tt', $vars);
+}
+
+sub _update_category {
+	my $panel = shift;
+	my $category = shift;
+	my $vhffs = $panel->{vhffs};
+	my $cgi = $panel->{cgi};
+	my $user = $panel->{user};
+
+	my $label = $cgi->param('label');
+	my $description = $cgi->param('description');
+	my $visibility = $cgi->param('visibility');
+	
+	if(!(defined $label && defined $description && defined $visibility)) {
+		$panel->add_error( gettext('CGI error') );
+		return 0;
+	}
+	
+	if($label =~ /^\s*$/) {
+		$panel->add_error( gettext('You have to enter a label') );
+	}
+	
+	if($description =~ /^\s*$/) {
+		$panel->add_error( gettext('You have to enter a description') );
+	}
+	
+	if($visibility !~ /^\d+$/) {
+		$panel->add_error( gettext('Invalid visibility') );
+	}
+	
+	if($panel->has_errors()) {
+		return 0;
+	}
+		
+	$category->{label} = $label;
+	$category->{description} = $description;
+	$category->{visibility} = $visibility;
+	$category->{updated} = time();
+	$category->{updater_id} = $user->get_uid;
+	return $category->save();
+}
+
+sub details_request {
+	my $panel = shift;
+	return unless $panel->check_modo();
+
+	my $vhffs = $panel->{'vhffs'};
+	my $cgi = $panel->{'cgi'};
+	my $session = $panel->{'session'};
+	my $user = $panel->{'user'};
+
+	my $request_id;
+	my $vars = {};
+	
+	unless(defined ($request_id = $cgi->param('request_id'))) {
+		$panel->render('misc/message.tt', {
+			message => gettext('CGI Error'),
+			refresh_url => '/admin/tag/request/list.pl'
+		});
+		return;
+	}
+	
+	my $request;
+	
+	unless(defined ($request = Vhffs::Tag::Request::get_by_request_id($vhffs, $request_id))) {
+		$panel->render('misc/message.tt', {
+			message => gettext('Tag request not found'),
+			refresh_url => '/admin/tag/request/list.pl'
+			});
+		return;
+	}
+	
+	if(defined $cgi->param('accept_request_submit')) {
+		if(_accept_request( $panel, $request )) {
+			$panel->render('misc/message.tt', {
+				message => gettext('Tag request accepted'),
+				refresh_url => '/admin/tag/request/list.pl'
+			});
+			return;
+		}
+
+		$vars->{category_label} = $cgi->param('category_label');
+		$vars->{category_description} = $cgi->param('category_description');
+		$vars->{tag_label} = $cgi->param('tag_label');
+		$vars->{tag_description} = $cgi->param('tag_description');
+	}
+
+	if(defined $cgi->param('discard_request_submit')) {
+		$request->delete();
+		$panel->render('misc/message.tt', {
+			message => gettext('Tag request deleted'),
+			refresh_url => '/admin/tag/request/list.pl'
+		});
+		return;
+	}
+	
+	$panel->set_title( gettext('Tag request details') );
+	
+	my $category_id = $cgi->param('category');
+	
+	if(defined $category_id) {
+		$vars->{category_tags} = Vhffs::Tag::get_by_category_id($vhffs, $category_id);
+		$vars->{selected_category} = $category_id;
+	}
+	$vars->{categories} = Vhffs::Tag::Category::get_all($vhffs);
+	$vars->{request} = $request;
+	
+	$panel->render('admin/tag/request/details.tt', $vars);
+}
+
+
+sub _accept_request {
+	my $panel = shift;
+	my $request = shift;
+	my $vhffs = $panel->{vhffs};
+	my $cgi = $panel->{cgi};
+
+	my $category_id = $cgi->param('category');
+	my $category_label = $cgi->param('category_label');
+	my $tag_id = $cgi->param('tag');
+	my $tag_label = $cgi->param('tag_label');
+	my $category_description = $cgi->param('category_description');
+	my $tag_description = $cgi->param('tag_description');
+	
+	unless(defined $category_id && defined $category_label && defined $category_description
+			&& defined $tag_id && defined $tag_label && defined $tag_description) {
+		$panel->add_error(gettext('CGI Error'));
+		return 0;
+	}
+	
+	my $category;
+	my $tag;
+	
+	if($category_id < 0) {
+		if($tag_id > 0) {
+			$panel->add_error( gettext('If you want to create a new category, you have to create a new tag too') );
+			return 0;
+		}
+		
+		if($category_label =~ /^\s*$/ || $category_description =~ /^\s*$/) {
+			$panel->add_error( gettext('You have to enter a label and a description for the category') );
+			return 0;
+		}
+		
+		if($tag_label =~ /^\s*$/ || $tag_description =~ /^\s*$/) {
+			$panel->add_error( gettext('You have to enter a label and a description for the tag') );
+			return 0;
+		}
+		
+		unless(defined ($category = Vhffs::Tag::Category::create($vhffs, $category_label, $category_description, Vhffs::Constants::TAG_VISIBILITY_PUBLIC, $panel->{user}) ) ) {
+			$panel->add_error( gettext('Unable to create category') );
+			return 0;
+		}
+		
+		unless(defined ($tag = Vhffs::Tag::create($vhffs, $tag_label, $tag_description, $panel->{user}, $category) ) ) {
+			$panel->add_error( gettext('Unable to create tag') );
+			$category->delete();
+			return 0;
+		}
+	} else {
+		$category = Vhffs::Tag::Category::get_by_category_id($vhffs, $category_id);
+		unless(defined $category) {
+			$panel->add_error( gettext('Category not found') );
+			return 0;
+		}
+		
+		if($tag_id > 0) {
+			$tag = Vhffs::Tag::get_by_tag_id($vhffs, $tag_id);
+			unless( defined($tag) ) {
+				$panel->add_error( gettext('Tag not found') );
+				return 0;
+			}
+		} else {
+			if($tag_label =~ /^\s*$/ || $tag_description =~ /^\s*$/) {
+				$panel->add_error( gettext('You have to enter a label and a description for the tag') );
+				return 0;
+			}
+			
+			$tag = Vhffs::Tag::create($vhffs, $tag_label, $tag_description, $panel->{user}, $category);
+			
+			unless(defined $tag) {
+				$panel->add_error( gettext('Unable to create tag') );
+				return 0;
+			}
+		}
+	}
+	
+	# Adds the tag to the object for which it has
+	# been requested.
+	
+	my $object = $request->get_tagged();
+	if(defined $object) {
+		my $user = $request->get_requester();
+		$user = $panel->{user} unless(defined $user);
+		$object->add_tag($tag, $user);
+	}
+	
+	$request->delete();
+	
+	return 1;
+}
+
 1;

Modified: trunk/vhffs-panel/Makefile.am
===================================================================
--- trunk/vhffs-panel/Makefile.am	2012-01-22 23:40:11 UTC (rev 1926)
+++ trunk/vhffs-panel/Makefile.am	2012-01-23 20:49:48 UTC (rev 1927)
@@ -794,16 +794,7 @@
 
 paneldir = @PANELDIR@
 nobase_dist_panel_DATA = favicon.ico
-nobase_dist_panel_SCRIPTS = index.pl \
-	admin/tag/create.pl \
-	admin/tag/edit.pl \
-	admin/tag/index.pl \
-	admin/tag/list.pl \
-	admin/tag/category/create.pl \
-	admin/tag/category/edit.pl \
-	admin/tag/category/list.pl \
-	admin/tag/request/details.pl \
-	admin/tag/request/list.pl
+nobase_dist_panel_SCRIPTS = index.pl
 
 # Define the substitution we need to point perl script at correct location
 do_sed = $(SED) --in-place \

Modified: trunk/vhffs-panel/index.pl
===================================================================
--- trunk/vhffs-panel/index.pl	2012-01-22 23:40:11 UTC (rev 1926)
+++ trunk/vhffs-panel/index.pl	2012-01-23 20:49:48 UTC (rev 1927)
@@ -368,6 +368,33 @@
 	} elsif( $do eq 'admincronindex' ) {
 		require Vhffs::Panel::Cron;
 		Vhffs::Panel::Cron::adminindex( $panel );
+	} elsif( $do eq 'tagcreate' ) {
+		require Vhffs::Panel::Tag;
+		Vhffs::Panel::Tag::create_tag( $panel );
+	} elsif( $do eq 'taglist' ) {
+		require Vhffs::Panel::Tag;
+		Vhffs::Panel::Tag::list_tag( $panel );
+	} elsif( $do eq 'tagedit' ) {
+		require Vhffs::Panel::Tag;
+		Vhffs::Panel::Tag::edit_tag( $panel );
+	} elsif( $do eq 'tagcategorycreate' ) {
+		require Vhffs::Panel::Tag;
+		Vhffs::Panel::Tag::create_category( $panel );
+	} elsif( $do eq 'tagcategorylist' ) {
+		require Vhffs::Panel::Tag;
+		Vhffs::Panel::Tag::list_category( $panel );
+	} elsif( $do eq 'tagcategoryedit' ) {
+		require Vhffs::Panel::Tag;
+		Vhffs::Panel::Tag::edit_category( $panel );
+	} elsif( $do eq 'tagrequestlist' ) {
+		require Vhffs::Panel::Tag;
+		Vhffs::Panel::Tag::list_request( $panel );
+	} elsif( $do eq 'tagrequestdetails' ) {
+		require Vhffs::Panel::Tag;
+		Vhffs::Panel::Tag::details_request( $panel );
+	} elsif( $do eq 'admintagindex' ) {
+		require Vhffs::Panel::Tag;
+		Vhffs::Panel::Tag::adminindex( $panel );
 	}
 }
 

Modified: trunk/vhffs-panel/templates/admin/tag/category/list.tt
===================================================================
--- trunk/vhffs-panel/templates/admin/tag/category/list.tt	2012-01-22 23:40:11 UTC (rev 1926)
+++ trunk/vhffs-panel/templates/admin/tag/category/list.tt	2012-01-23 20:49:48 UTC (rev 1927)
@@ -1,6 +1,6 @@
 [% USE date %]
 [% USE dumper %]
-<p><a href="/admin/tag/category/create.pl">[% 'Add a category.' | i18n | html %]</a></p>
+<p><a href="?do=tagcategorycreate">[% 'Add a category.' | i18n | html %]</a></p>
 [% IF categories.size() > 0 %]
 <table border="1">
     <thead>
@@ -17,7 +17,7 @@
             <td>[% c.label | html %]</td><td>[% c.description | html %]</td>
             <td>[% c.get_visibility_string | i18n | html %]</td><td>[% date.format(c.updated, '%x') %]</td>
             <td>[% c.get_updater.get_username | html %]</td>
-            <td><form action="edit.pl" method="post">
+            <td><form action="?do=tagcategoryedit" method="post">
             	<input type="hidden" name="category_id" value="[% c.category_id %]"/>
             	<input type="submit" value="[% 'Edit' | i18n | html %]"/>
             </form></td>

Modified: trunk/vhffs-panel/templates/admin/tag/list.tt
===================================================================
--- trunk/vhffs-panel/templates/admin/tag/list.tt	2012-01-22 23:40:11 UTC (rev 1926)
+++ trunk/vhffs-panel/templates/admin/tag/list.tt	2012-01-23 20:49:48 UTC (rev 1927)
@@ -1,5 +1,5 @@
 [% USE date %]
-<p><a href="/admin/tag/create.pl">[% 'Create new tag.' | i18n | html %]</a></p>
+<p><a href="?do=tagcreate">[% 'Create new tag.' | i18n | html %]</a></p>
 [% IF tags.size() > 0 %]
 <table border="1">
     <thead>
@@ -20,7 +20,7 @@
             <td>[% t.description | html %]</td>
             <td>[% date.format(t.updated, '%x') %]</td>
             <td>[% t.get_updater.get_username | html %]</td>
-            <td><form action="edit.pl" method="post">
+            <td><form action="?do=tagedit" method="post">
             	<input type="hidden" name="tag_id" value="[% t.tag_id %]"/>
             	<input type="submit" value="[% 'Edit' | i18n | html %]"/>
             </form></td>

Modified: trunk/vhffs-panel/templates/admin/tag/request/details.tt
===================================================================
--- trunk/vhffs-panel/templates/admin/tag/request/details.tt	2012-01-22 23:40:11 UTC (rev 1926)
+++ trunk/vhffs-panel/templates/admin/tag/request/details.tt	2012-01-23 20:49:48 UTC (rev 1927)
@@ -7,7 +7,7 @@
 <p class="info">[% 'You can either accept the request (and possibly change the name of the tag/category) or reattach it to an existing category and/or tag. If you choose to create a category, you\'ve to create the tag too.' | i18n | html %]</p>
 <fieldset>
 <legend>[% 'Manage request' | i18n | html %]</legend>
-<form class="table-like" name="manageTagRequestForm" id="manageTagRequestForm" action="/admin/tag/request/details.pl" method="post">
+<form class="table-like" name="manageTagRequestForm" id="manageTagRequestForm" action="?do=tagrequestdetails&request_id=[% request.request_id %]" method="post">
 <div style="width:50%;float:left">
 <h3>Category</h3>
 <p><select name="category" id="tagRequestCategorySelect">

Modified: trunk/vhffs-panel/templates/admin/tag/request/list.tt
===================================================================
--- trunk/vhffs-panel/templates/admin/tag/request/list.tt	2012-01-22 23:40:11 UTC (rev 1926)
+++ trunk/vhffs-panel/templates/admin/tag/request/list.tt	2012-01-23 20:49:48 UTC (rev 1927)
@@ -14,7 +14,7 @@
     <tbody>
 [% FOREACH r IN requests %]
 <tr>
-	<td><a href="/admin/tag/request/details.pl?request_id=[% r.request_id %]">
+	<td><a href="?do=tagrequestdetails&request_id=[% r.request_id %]">
 		[% r.category_label | i18n | html %]</a></td>
 	<td>[% r.tag_label | i18n | html %]</td>
 	<td>[% (r.get_requester ? r.get_requester.get_username : 'DELETED') | html %]</td>

Modified: trunk/vhffs-panel/templates/group/tags.tt
===================================================================
--- trunk/vhffs-panel/templates/group/tags.tt	2012-01-22 23:40:11 UTC (rev 1926)
+++ trunk/vhffs-panel/templates/group/tags.tt	2012-01-23 20:49:48 UTC (rev 1927)
@@ -16,7 +16,7 @@
 [% FOREACH c IN tag_categories %]
 <li>[% c.label | html %]:
 [% FOREACH t IN c.tags %]
-<a href="?group=[% group.get_groupname | html %]&amp;add_tag_submit=true&amp;tag_id=[% t.tag_id %]#tags">[% t.label | html %]</a>[% ', ' UNLESS loop.last() %]
+<a href="?do=groupprefs&group=[% group.get_groupname | html %]&amp;add_tag_submit=true&amp;tag_id=[% t.tag_id %]#tags">[% t.label | html %]</a>[% ', ' UNLESS loop.last() %]
 [% END # t IN c.tags %]
 ;</li>
 [% END # c IN tag_categories %]

Modified: trunk/vhffs-panel/templates/menu/admin.tt
===================================================================
--- trunk/vhffs-panel/templates/menu/admin.tt	2012-01-22 23:40:11 UTC (rev 1926)
+++ trunk/vhffs-panel/templates/menu/admin.tt	2012-01-23 20:49:48 UTC (rev 1927)
@@ -15,4 +15,5 @@
 [% IF panel_header.available_services.mail %]<li><a/ href="?do=adminmailindex">[% 'Mail' | i18n | html %]</a></li>[% END %]
 [% IF panel_header.available_services.mailinglist %]<li><a/ href="?do=adminmailinglistindex">[% 'ML' | i18n | html %]</a></li>[% END %]
 [% IF panel_header.available_services.cron %]<li><a/ href="?do=admincronindex">[% 'Crons' | i18n | html %]</a></li>[% END %]
+<li><a href="?do=admintagindex">[% 'Tags' | i18n | html %]</a></li>
 </ul>

Modified: trunk/vhffs-panel/templates/menu/moderator.tt
===================================================================
--- trunk/vhffs-panel/templates/menu/moderator.tt	2012-01-22 23:40:11 UTC (rev 1926)
+++ trunk/vhffs-panel/templates/menu/moderator.tt	2012-01-23 20:49:48 UTC (rev 1927)
@@ -1,4 +1,5 @@
 <ul>
 <li><a href="?do=stats">[% 'Get statistics' | i18n | html %]</a></li>
 <li><a href="?do=moderation">[% 'Moderation' | i18n | html %]</a></li>
+<li><a href="?do=admintagindex">[% 'Tags' | i18n | html %]</a></li>
 </ul>


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