summaryrefslogtreecommitdiff
path: root/lib/VNDB/Util/CommonHTML.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-04-01 08:49:59 +0200
committerYorhel <git@yorhel.nl>2009-04-01 08:49:59 +0200
commit33c6bd207473e8ce6ddfc0d19b34ccb139aa8521 (patch)
treed5714b79b3e02c77d78f43a1f4b34f7194068b14 /lib/VNDB/Util/CommonHTML.pm
parent61c4d04980dc0376cf0032364a5952f8d828837f (diff)
parentf35175b04fc9f54680ad2578a994177e4d280b09 (diff)
Merge branch 'beta'2.3
Conflicts: data/docs/4
Diffstat (limited to 'lib/VNDB/Util/CommonHTML.pm')
-rw-r--r--lib/VNDB/Util/CommonHTML.pm34
1 files changed, 25 insertions, 9 deletions
diff --git a/lib/VNDB/Util/CommonHTML.pm b/lib/VNDB/Util/CommonHTML.pm
index 6b6725c6..6e50632d 100644
--- a/lib/VNDB/Util/CommonHTML.pm
+++ b/lib/VNDB/Util/CommonHTML.pm
@@ -17,18 +17,22 @@ our @EXPORT = qw|
# generates the "main tabs". These are the commonly used tabs for
# 'objects', i.e. VN/producer/release entries and users
-# Arguments: u/v/r/p, object, currently selected item (empty=main)
+# Arguments: u/v/r/p/g, object, currently selected item (empty=main)
sub htmlMainTabs {
my($self, $type, $obj, $sel) = @_;
$sel ||= '';
my $id = $type.$obj->{id};
+ return if $type eq 'g' && !$self->authCan('tagmod');
+
ul class => 'maintabs';
- li $sel eq 'hist' ? (class => 'tabselected') : ();
- a href => "/$id/hist", 'history';
- end;
+ if($type =~ /[uvrp]/) {
+ li $sel eq 'hist' ? (class => 'tabselected') : ();
+ a href => "/$id/hist", 'history';
+ end;
+ }
- if($type ne 'r') {
+ if($type =~ /[uvp]/) {
my $cnt = $self->dbThreadCount($type, $obj->{id});
li $sel eq 'disc' ? (class => 'tabselected') : ();
a href => "/t/$id", "discussions ($cnt)";
@@ -43,22 +47,34 @@ sub htmlMainTabs {
li $sel eq 'list' ? (class => 'tabselected') : ();
a href => "/$id/list", 'list';
end;
+
+ li $sel eq 'tags' ? (class => 'tabselected') : ();
+ a href => "/$id/tags", 'tags';
+ end;
+ }
+
+ if($type eq 'v' && $self->authCan('tag')) {
+ li $sel eq 'tagmod' ? (class => 'tabselected') : ();
+ a href => "/$id/tagmod", 'modify tags';
+ end;
}
- if($type eq 'u' && ($self->authInfo->{id} && $obj->{id} == $self->authInfo->{id} || $self->authCan('usermod'))
- || $type ne 'u' && $self->authCan('edit') && (!$obj->{locked} || $self->authCan('lock')) && (!$obj->{hidden} || $self->authCan('del'))) {
+ if( $type eq 'u' && ($self->authInfo->{id} && $obj->{id} == $self->authInfo->{id} || $self->authCan('usermod'))
+ || $type =~ /[vrp]/ && $self->authCan('edit') && (!$obj->{locked} || $self->authCan('lock')) && (!$obj->{hidden} || $self->authCan('del'))
+ || $type eq 'g' && $self->authCan('tagmod')
+ ) {
li $sel eq 'edit' ? (class => 'tabselected') : ();
a href => "/$id/edit", 'edit';
end;
}
- if($type ne 'u' && $self->authCan('del')) {
+ if($type =~ /[vrp]/ && $self->authCan('del')) {
li;
a href => "/$id/hide", $obj->{hidden} ? 'unhide' : 'hide';
end;
}
- if($type ne 'u' && $self->authCan('lock')) {
+ if($type =~ /[vrp]/ && $self->authCan('lock')) {
li;
a href => "/$id/lock", $obj->{locked} ? 'unlock' : 'lock';
end;