[dw-free] Revamp /update
[commit: http://hg.dwscoalition.org/dw-free/rev/0c2da8bf43e8]
http://bugs.dwscoalition.org/show_bug.cgi?id=2524
Add all missing panels to the last column (just in case).
Patch by
fu.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=2524
Add all missing panels to the last column (just in case).
Patch by
Files modified:
- cgi-bin/LJ/User.pm
--------------------------------------------------------------------------------
diff -r 7e25481481b4 -r 0c2da8bf43e8 cgi-bin/LJ/User.pm
--- a/cgi-bin/LJ/User.pm Mon Oct 31 18:17:03 2011 +0800
+++ b/cgi-bin/LJ/User.pm Mon Oct 31 20:04:45 2011 +0800
@@ -4796,7 +4796,7 @@
}
my $prop = $u->prop( "entryform_panels" );
- return $prop ? Storable::thaw( $prop ) : {
+ my $default = {
order => [ [ "tags", "displaydate" ],
# FIXME: should be [ "status" "journal" "comments" "age_restriction" ] %]
@@ -4822,6 +4822,32 @@
collapsed => {
}
};
+
+ my %need_panels = map { $_ => 1 } keys %{$default->{show}};
+
+ my $ret;
+ $ret = Storable::thaw( $prop ) if $prop;
+
+ if ( $ret ) {
+ # fill in any modules that somehow are not in this list
+ foreach my $column ( @{$ret->{order}} ) {
+ foreach my $panel ( @{$column} ) {
+ delete $need_panels{$panel};
+ }
+ }
+
+ my @col = @{$ret->{order}->[2]};
+ foreach ( keys %need_panels ) {
+ # add back into last column, but don't show
+ push @col, $_;
+ $ret->{show}->{$_} = 0;
+ }
+ $ret->{order}->[2] = \@col;
+ } else {
+ $ret = $default;
+ }
+
+ return $ret;
}
sub entryform_panels_order {
--------------------------------------------------------------------------------
