summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Users.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VNDB/Handler/Users.pm')
-rw-r--r--lib/VNDB/Handler/Users.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/VNDB/Handler/Users.pm b/lib/VNDB/Handler/Users.pm
index 32b1d205..0068768d 100644
--- a/lib/VNDB/Handler/Users.pm
+++ b/lib/VNDB/Handler/Users.pm
@@ -375,6 +375,7 @@ sub edit {
{ post => 'hide_list', required => 0, default => 0, enum => [0,1] },
{ post => 'show_nsfw', required => 0, default => 0, enum => [0,1] },
{ post => 'tags_all', required => 0, default => 0, enum => [0,1] },
+ { post => 'tags_cat', required => 0, multi => 1, enum => [qw|cont ero tech|] },
{ post => 'skin', required => 0, default => $self->{skin_default}, enum => [ keys %{$self->{skins}} ] },
{ post => 'customcss', required => 0, maxlength => 2000, default => '' },
);
@@ -383,6 +384,9 @@ sub edit {
if(!$frm->{_err}) {
$frm->{skin} = '' if $frm->{skin} eq $self->{skin_default};
$self->dbUserPrefSet($uid, $_ => $frm->{$_}) for (qw|skin customcss show_nsfw tags_all hide_list |);
+
+ my $tags_cat = join(',', sort @{$frm->{tags_cat}}) || 'none';
+ $self->dbUserPrefSet($uid, tags_cat => $tags_cat eq $self->{default_tags_cat} ? '' : $tags_cat);
my %o;
if($self->authCan('usermod')) {
$o{username} = $frm->{usrname} if $frm->{usrname};
@@ -402,6 +406,7 @@ sub edit {
$frm->{mail} ||= $u->{mail};
$frm->{perms} ||= [ grep $u->{perm} & $self->{permissions}{$_}, keys %{$self->{permissions}} ];
$frm->{$_} //= $u->{prefs}{$_} for(qw|skin customcss show_nsfw tags_all hide_list|);
+ $frm->{tags_cat} ||= [ split /,/, $u->{prefs}{tags_cat}||$self->{default_tags_cat} ];
$frm->{ign_votes} = $u->{ign_votes} if !defined $frm->{ign_votes};
$frm->{skin} ||= $self->{skin_default};
@@ -437,6 +442,8 @@ sub edit {
[ check => short => 'hide_list', name => mt '_usere_flist', "/u$uid/list", "/u$uid/votes", "/u$uid/wish" ],
[ check => short => 'show_nsfw', name => mt '_usere_fnsfw' ],
[ check => short => 'tags_all', name => mt '_usere_ftags' ],
+ [ select => short => 'tags_cat', name => mt('_usere_tagcats'), multi => 1, size => 3, options => [
+ map [ $_, mt '_tagcat_'.$_ ], qw|cont ero tech| ] ],
[ select => short => 'skin', name => mt('_usere_skin'), width => 300, options => [
map [ $_, $self->{skins}{$_}[0].($self->debug?" [$_]":'') ], sort { $self->{skins}{$a}[0] cmp $self->{skins}{$b}[0] } keys %{$self->{skins}} ] ],
[ textarea => short => 'customcss', name => mt '_usere_css' ],