[vhffs-dev] [1178] I finally found the time to add the add/modify/ delete function for tags... |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1178
Author: beuss
Date: 2008-03-30 19:45:43 +0200 (Sun, 30 Mar 2008)
Log Message:
-----------
I finally found the time to add the add/modify/delete function for tags...
Modified Paths:
--------------
trunk/vhffs-api/src/Vhffs/Panel/Admin.pm
trunk/vhffs-api/src/Vhffs/Tag.pm
trunk/vhffs-panel/Makefile.am
trunk/vhffs-panel/templates/Makefile.am
Added Paths:
-----------
trunk/vhffs-panel/admin/tag/create.pl
trunk/vhffs-panel/admin/tag/edit.pl
trunk/vhffs-panel/admin/tag/list.pl
trunk/vhffs-panel/templates/admin/tag/create.tmpl
trunk/vhffs-panel/templates/admin/tag/edit.tmpl
trunk/vhffs-panel/templates/admin/tag/list.tmpl
Modified: trunk/vhffs-api/src/Vhffs/Panel/Admin.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Admin.pm 2008-03-30 17:10:53 UTC (rev 1177)
+++ trunk/vhffs-api/src/Vhffs/Panel/Admin.pm 2008-03-30 17:45:43 UTC (rev 1178)
@@ -148,6 +148,7 @@
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.pl', LABEL => gettext('Manage requests')}
Modified: trunk/vhffs-api/src/Vhffs/Tag.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Tag.pm 2008-03-30 17:10:53 UTC (rev 1177)
+++ trunk/vhffs-api/src/Vhffs/Tag.pm 2008-03-30 17:45:43 UTC (rev 1178)
@@ -39,6 +39,9 @@
use strict;
use utf8;
+use Vhffs::User;
+use Vhffs::Tag::Category;
+
package Vhffs::Tag;
sub create {
@@ -47,12 +50,101 @@
my $dbh = $main->get_db_object();
- my $sql = q{INSERT INTO vhffs_tag(label, description, created, category_id, creator_id) VALUES(?, ?, ?, ?)};
+ my $sql = q{INSERT INTO vhffs_tag(label, description, updated, category_id, updater_id) VALUES(?, ?, ?, ?, ?)};
my $sth = $dbh->prepare($sql);
- $sth->execute($label, $description, $created, $category->get_id, $creator->get_uid);
+ $sth->execute($label, $description, $created, $category->{category_id}, $creator->get_uid);
my $tag_id = $dbh->last_insert_id(undef, undef, 'vhffs_tag', undef);
- return get_by_tag_id($tag_id);
+ return get_by_tag_id($main, $tag_id);
}
-1;
\ No newline at end of file
+sub _new {
+ my ($class, $main, $tag_id, $label, $description, $updated, $updater_id, $category_id) = @_;
+
+ my $self = {};
+
+ bless($self, $class);
+
+ $self->{main} = $main;
+ $self->{tag_id} = $tag_id;
+ $self->{label} = $label;
+ $self->{description} = $description;
+ $self->{updated} = $updated;
+ $self->{updater_id} = $updater_id;
+ $self->{category_id} = $category_id;
+
+ return $self;
+}
+
+sub get_updater {
+ my ($self) = @_;
+
+ unless( defined $self->{updater} ) {
+ $self->{updater} = Vhffs::User::get_by_uid($self->{main}, $self->{updater_id});
+ }
+ return $self->{updater};
+}
+
+sub get_category {
+ my ($self) = @_;
+
+ unless( defined $self->{category} ) {
+ $self->{category} = Vhffs::Tag::Category::get_by_category_id($self->{main}, $self->{category_id});
+ }
+
+ return $self->{category}
+}
+
+sub get_by_tag_id {
+ my($main, $tag_id) = @_;
+
+ my $sql = q{SELECT tag_id, label, description, updated, updater_id, category_id FROM vhffs_tag WHERE tag_id = ?};
+ my $dbh = $main->get_db_object();
+
+ my $sth = $dbh->prepare($sql);
+ $sth->execute($tag_id) or return undef;
+ my @results = $sth->fetchrow_array();
+ return undef unless @results;
+
+ my $tag = _new Vhffs::Tag($main, @results);
+
+ return $tag;
+}
+
+sub get_all {
+ my ($main) = @_;
+
+ my $tags = [];
+
+ my $sql = q{SELECT tag_id, label, description, updated, updater_id, category_id
+ FROM vhffs_tag ORDER BY label};
+
+ my $dbh = $main->get_db_object();
+
+ my $sth = $dbh->prepare($sql);
+ $sth->execute() or return undef;
+
+ while(my $t = $sth->fetchrow_arrayref()) {
+ push @$tags, _new Vhffs::Tag($main, @$t);
+ }
+
+ return $tags;
+}
+
+sub delete {
+ my ($self) = @_;
+
+ my $sql = q{DELETE FROM vhffs_tag WHERE tag_id = ?};
+ my $dbh = $self->{main}->get_db_object();
+ return $dbh->do($sql, undef, $self->{tag_id});
+}
+
+sub save {
+ my ($self) = @_;
+
+ my $sql = q{UPDATE vhffs_tag SET category_id = ?, label = ?, description = ?, updated = ?, updater_id = ? WHERE tag_id = ?};
+ my $dbh = $self->{main}->get_db_object();
+ return $dbh->do($sql, undef, $self->{category_id}, $self->{label}, $self->{description}, $self->{updated}, $self->{updater_id}, $self->{tag_id});
+}
+
+1;
Modified: trunk/vhffs-panel/Makefile.am
===================================================================
--- trunk/vhffs-panel/Makefile.am 2008-03-30 17:10:53 UTC (rev 1177)
+++ trunk/vhffs-panel/Makefile.am 2008-03-30 17:45:43 UTC (rev 1178)
@@ -57,7 +57,10 @@
admin/svn/index.pl \
admin/svn/list.pl \
admin/svn/search.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 \
Added: trunk/vhffs-panel/admin/tag/create.pl
===================================================================
--- trunk/vhffs-panel/admin/tag/create.pl (rev 0)
+++ trunk/vhffs-panel/admin/tag/create.pl 2008-03-30 17:45:43 UTC (rev 1178)
@@ -0,0 +1,116 @@
+#!%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 utf8;
+use POSIX qw(locale_h);
+use locale;
+use Locale::gettext;
+use strict;
+
+
+use lib '%VHFFS_LIB_DIR%';
+use Vhffs::Panel::Main;
+use Vhffs::Panel::Admin;
+use Vhffs::Panel::Template;
+use Vhffs::Tag::Category;
+use Vhffs::Tag;
+
+my $panel = new Vhffs::Panel::Main();
+exit 0 unless $panel;
+my $session = $panel->get_session;
+exit 0 unless $session;
+
+$panel->check_admin;
+
+my $cgi = $panel->{cgi};
+
+if(defined $cgi->param('create_tag_submit')) {
+ if(create()) {
+ $panel->redirect('/admin/tag/index.pl?msg='.gettext('Tag successfully created'));
+ exit(0);
+ }
+}
+
+my $templatedir = $panel->{templatedir};
+
+my $template = new Vhffs::Panel::Template(filename => $templatedir.'/panel/admin/tag/create.tmpl', die_on_bad_params => 0);
+
+$panel->set_title(gettext('Create Tag Category'));
+
+$template->param( CATEGORY_TEXT => gettext('Category') );
+$template->param( CATEGORIES => Vhffs::Tag::Category::get_all($panel->{vhffs}) );
+$template->param( LABEL_TEXT => gettext('Label') );
+$template->param( DESCRIPTION_TEXT => gettext('Description') );
+$template->param( CREATE_TEXT => gettext('Create') );
+
+$panel->build( $template );
+$panel->display;
+
+
+sub create {
+ my $category_id = $cgi->param('category_id');
+ my $label = $cgi->param('label');
+ my $description = $cgi->param('description');
+ my $main = $panel->{vhffs};
+
+ 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 1;
+}
\ No newline at end of file
Added: trunk/vhffs-panel/admin/tag/edit.pl
===================================================================
--- trunk/vhffs-panel/admin/tag/edit.pl (rev 0)
+++ trunk/vhffs-panel/admin/tag/edit.pl 2008-03-30 17:45:43 UTC (rev 1178)
@@ -0,0 +1,125 @@
+#!%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 utf8;
+use POSIX qw(locale_h);
+use HTML::Template;
+use locale;
+use Locale::gettext;
+use strict;
+
+
+use lib '%VHFFS_LIB_DIR%';
+use Vhffs::Panel::Admin;
+use Vhffs::Panel::Main;
+use Vhffs::Panel::Template;
+use Vhffs::Tag;
+
+my $panel = new Vhffs::Panel::Main();
+exit 0 unless $panel;
+my $session = $panel->get_session;
+exit 0 unless $session;
+
+$panel->check_admin;
+
+my $cgi = $panel->{cgi};
+my $tag;
+my $template;
+my $templatedir = $panel->{templatedir};
+my $vhffs = $panel->{vhffs};
+my $user = $panel->{user};
+
+if(!defined $cgi->param('tag_id')) {
+ $template = new HTML::Template( filename => $templatedir.'/panel/misc/simplemsg.tmpl' );
+ $template->param( MESSAGE => gettext('CGI Error!') );
+} elsif(!defined($tag = Vhffs::Tag::get_by_tag_id($panel->{vhffs}, $cgi->param('tag_id')))) {
+ $template = new HTML::Template( filename => $templatedir.'/panel/misc/simplemsg.tmpl' );
+ $template->param( MESSAGE => gettext('Tag not found!') );
+} else {
+ if(defined $cgi->param('update_tag_submit')) {
+ if(update()) {
+ $panel->add_info( gettext('Tag successfully updated') );
+ } else {
+ $panel->add_error( gettext('Unable to update tag') )
+ }
+ }
+
+ $template = new Vhffs::Panel::Template(filename => $templatedir.'/panel/admin/tag/edit.tmpl', die_on_bad_params => 0);
+
+ $panel->set_title(gettext('Update Tag'));
+
+ $template->param( LABEL_VALUE => $tag->{label} );
+ $template->param( DESCRIPTION_VALUE => $tag->{description} );
+ $template->param( CATEGORY_ID_VALUE => $tag->{category_id} );
+ $template->param( CATEGORIES => Vhffs::Tag::Category::get_all($vhffs) );
+ $template->param( TAG_ID => $tag->{tag_id} );
+
+}
+$panel->build( $template );
+$panel->display;
+
+
+sub update {
+ my $tag_id = $cgi->param('tag_id');
+ my $label = $cgi->param('label');
+ my $description = $cgi->param('description');
+ my $category_id = $cgi->param('category_id');
+
+ if(!(defined $tag_id && defined $label && defined $description && 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();
+}
Added: trunk/vhffs-panel/admin/tag/list.pl
===================================================================
--- trunk/vhffs-panel/admin/tag/list.pl (rev 0)
+++ trunk/vhffs-panel/admin/tag/list.pl 2008-03-30 17:45:43 UTC (rev 1178)
@@ -0,0 +1,95 @@
+#!%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 utf8;
+use POSIX qw(locale_h);
+use locale;
+use Locale::gettext;
+use DateTime;
+use DateTime::Locale;
+use strict;
+
+
+use lib '%VHFFS_LIB_DIR%';
+use Vhffs::Panel::Main;
+use Vhffs::Panel::Admin;
+use Vhffs::Panel::Template;
+use Vhffs::Tag;
+
+my $panel = new Vhffs::Panel::Main();
+exit 0 unless $panel;
+my $session = $panel->get_session;
+exit 0 unless $session;
+
+$panel->check_admin;
+
+my $cgi = $panel->{cgi};
+
+if(defined $cgi->param('delete_tag_submit')) {
+ if(delete_tag()) {
+ $panel->add_info( gettext('Tag deleted') );
+ } else {
+ $panel->add_error( gettext('Unable to delete tag') );
+ }
+}
+
+my $templatedir = $panel->{templatedir};
+
+my $template = new Vhffs::Panel::Template(filename => $templatedir.'/panel/admin/tag/list.tmpl', die_on_bad_params => 0 );
+
+$panel->set_title(gettext('Tags'));
+
+my $tags = Vhffs::Tag::get_all($panel->{vhffs});
+# We should really drop HTML::Template....
+my $user = $panel->{user};
+my $loc = DateTime::Locale->load($user->get_lang);
+foreach(@$tags) {
+ my $dt = DateTime->from_epoch( epoch => $_->{updated}, locale => $user->get_lang);
+ $_->{updated} = $dt->strftime($loc->medium_date_format().' '.$loc->long_time_format());
+ $_->{updater_name} = $_->get_updater()->get_username();
+ $_->{category_name} = $_->get_category()->{label};
+}
+
+$template->param( 'TAGS' => $tags );
+
+$panel->build( $template );
+$panel->display;
+
+sub delete_tag {
+ my $tag_id = $cgi->param('tag_id');
+ my $tag = Vhffs::Tag::get_by_tag_id($panel->{vhffs}, $tag_id);
+ if(!defined $tag) {
+ return 0;
+ }
+
+ return $tag->delete();
+}
Modified: trunk/vhffs-panel/templates/Makefile.am
===================================================================
--- trunk/vhffs-panel/templates/Makefile.am 2008-03-30 17:10:53 UTC (rev 1177)
+++ trunk/vhffs-panel/templates/Makefile.am 2008-03-30 17:45:43 UTC (rev 1178)
@@ -38,6 +38,9 @@
admin/repository/search.tmpl \
admin/svn/part.tmpl \
admin/svn/search.tmpl \
+ admin/tag/create.tmpl \
+ admin/tag/edit.tmpl \
+ admin/tag/list.tmpl \
admin/tag/category/create.tmpl \
admin/tag/category/edit.tmpl \
admin/tag/category/list.tmpl \
Added: trunk/vhffs-panel/templates/admin/tag/create.tmpl
===================================================================
--- trunk/vhffs-panel/templates/admin/tag/create.tmpl (rev 0)
+++ trunk/vhffs-panel/templates/admin/tag/create.tmpl 2008-03-30 17:45:43 UTC (rev 1178)
@@ -0,0 +1,16 @@
+<form name="createTag" accept-charset="utf-8" method="post">
+<p><label for="category"><TMPL_VAR NAME="CATEGORY_TEXT"></label>
+<select name="category_id" id="category">
+<TMPL_LOOP NAME="CATEGORIES">
+<option value="<TMPL_VAR NAME="CATEGORY_ID">"><TMPL_VAR NAME="LABEL"></option>
+</TMPL_LOOP>
+</select>
+</p>
+<p><label for="label"><TMPL_VAR NAME="LABEL_TEXT"></label>
+ <input type="text" name="label" id="label" value="<TMPL_VAR NAME="LABEL_VALUE">"/></p>
+<p><label for="description"><TMPL_VAR NAME="DESCRIPTION_TEXT"></label>
+ <textarea name="description" id="description"></textarea></p>
+<p class="button">
+ <input type="submit" name="create_tag_submit" value="<TMPL_VAR NAME="CREATE_TEXT">"/>
+</p>
+</form>
\ No newline at end of file
Added: trunk/vhffs-panel/templates/admin/tag/edit.tmpl
===================================================================
--- trunk/vhffs-panel/templates/admin/tag/edit.tmpl (rev 0)
+++ trunk/vhffs-panel/templates/admin/tag/edit.tmpl 2008-03-30 17:45:43 UTC (rev 1178)
@@ -0,0 +1,19 @@
+<form name="updateTag" accept-charset="utf-8" method="post">
+<p><label for="category"><TMPL_I18N KEY="Category"></label>
+<select name="category_id" id="category">
+<TMPL_LOOP NAME="CATEGORIES">
+<option value="<TMPL_VAR NAME="CATEGORY_ID">"
+<TMPL_IF EXPR="CATEGORY_ID_VALUE==CATEGORY_ID">selected="selected"</TMPL_IF>>
+<TMPL_VAR NAME="LABEL"></option>
+</TMPL_LOOP>
+</select>
+</p>
+<p><label for="label"><TMPL_I18N KEY="Label"></label>
+ <input type="text" name="label" id="label" value="<TMPL_VAR NAME="LABEL_VALUE">"/></p>
+<p><label for="description"><TMPL_I18N KEY="Description"></label>
+ <textarea name="description" id="description"><TMPL_VAR NAME="DESCRIPTION_VALUE"></textarea></p>
+<p class="button">
+ <input type="hidden" name="tag_id" value="<TMPL_VAR NAME="TAG_ID">"/>
+ <input type="submit" name="update_tag_submit" value="<TMPL_I18N KEY="Update">"/>
+</p>
+</form>
\ No newline at end of file
Added: trunk/vhffs-panel/templates/admin/tag/list.tmpl
===================================================================
--- trunk/vhffs-panel/templates/admin/tag/list.tmpl (rev 0)
+++ trunk/vhffs-panel/templates/admin/tag/list.tmpl 2008-03-30 17:45:43 UTC (rev 1178)
@@ -0,0 +1,30 @@
+<a href="/admin/tag/create.pl"><TMPL_I18N KEY="Create new tag"></a>
+<TMPL_IF NAME="TAGS">
+<table border="1">
+<thead>
+<tr>
+<th><TMPL_I18N KEY="Category"></th><th><TMPL_I18N KEY="Label"></th><th><TMPL_I18N KEY="Description"></th>
+<th><TMPL_I18N KEY="Updated"></th>
+<th><TMPL_I18N KEY="By"></th><th><TMPL_I18N KEY="Edit"></th>
+<th><TMPL_I18N KEY="Delete"></th>
+</tr>
+</thead>
+<tbody>
+<TMPL_LOOP NAME="TAGS">
+<tr>
+<td><TMPL_VAR NAME="category_name"></td>
+<td><TMPL_VAR NAME="label" ESCAPE="1"></td><td><TMPL_VAR NAME="description" ESCAPE="1"></td>
+<td><TMPL_VAR NAME="updated"></td><td><TMPL_VAR NAME="updater_name"></td>
+<td><form action="edit.pl" method="post">
+ <input type="hidden" name="tag_id" value="<TMPL_VAR NAME="tag_id">"/>
+ <input type="submit" value="<TMPL_I18N KEY="Edit">"/>
+</form></td>
+<td><form action="#" method="post">
+ <input type="hidden" name="tag_id" value="<TMPL_VAR NAME="tag_id">"/>
+ <input type="submit" value="<TMPL_I18N KEY="Delete">" name="delete_tag_submit"/>
+</form></td>
+</tr>
+</TMPL_LOOP>
+</tbody>
+</table>
+</TMPL_IF>
\ No newline at end of file