[livejournal] r23355: LJSUP-13980 (remove settings for friends...
Committer: ailyin
LJSUP-13980 (remove settings for friends page)U trunk/cgi-bin/LJ/Customize.pm U trunk/cgi-bin/LJ/S2.pm U trunk/cgi-bin/LJ/Widget/MoodThemeChooser.pm
Modified: trunk/cgi-bin/LJ/Customize.pm
===================================================================
--- trunk/cgi-bin/LJ/Customize.pm 2012-11-23 15:14:28 UTC (rev 23354)
+++ trunk/cgi-bin/LJ/Customize.pm 2012-11-26 07:36:00 UTC (rev 23355)
@@ -550,8 +550,11 @@
next unless ref $prop;
}
- next if (S2::is_property_hidden([$style->{'layer'}{'theme'}], $prop->{'name'}));
+ my $prop_hidden = S2::is_property_hidden(
+ [ values %{ $style->{'layer'} } ], $prop->{'name'} );
+ next if $prop_hidden;
+
if (LJ::is_enabled("delayed_entries")) {
if ($prop->{'name'} eq 'sticky_subject' ||
$prop->{'name'} eq 'sticky_post' ) {
Modified: trunk/cgi-bin/LJ/S2.pm
===================================================================
--- trunk/cgi-bin/LJ/S2.pm 2012-11-23 15:14:28 UTC (rev 23354)
+++ trunk/cgi-bin/LJ/S2.pm 2012-11-26 07:36:00 UTC (rev 23355)
@@ -393,6 +393,11 @@
return $ret;
}
+sub augment_layers {
+ my @lids = @_;
+ LJ::run_hooks( 'augment_s2_layers', @lids );
+}
+
# returns max comptime of all lids requested to be loaded
sub load_layers {
my @lids = map { $_ + 0 } @_;
@@ -438,7 +443,10 @@
}
# it's possible we don't need to hit the database for anything
- return $maxtime unless @from_db;
+ unless (@from_db) {
+ augment_layers(@lids);
+ return $maxtime;
+ }
# figure out who owns what we need
my $us = LJ::S2::get_layer_owners(@from_db);
@@ -513,8 +521,12 @@
push @to_load, $lid;
}
- return $maxtime unless @to_load;
+ unless (@to_load) {
+ augment_layers(@lids);
+ return $maxtime;
+ }
+
# get the dbh and start loading these
my $dbr = LJ::S2::get_s2_reader();
die "Failure getting S2 database handle in LJ::S2::load_layers\n"
@@ -528,6 +540,8 @@
S2::load_layer($id, $comp, $comptime);
$maxtime = $comptime if $comptime > $maxtime;
}
+
+ augment_layers(@lids);
return $maxtime;
}
Modified: trunk/cgi-bin/LJ/Widget/MoodThemeChooser.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/MoodThemeChooser.pm 2012-11-23 15:14:28 UTC (rev 23354)
+++ trunk/cgi-bin/LJ/Widget/MoodThemeChooser.pm 2012-11-26 07:36:00 UTC (rev 23355)
@@ -36,13 +36,16 @@
selected => $preview_moodthemeid },
map { {value => $_->{moodthemeid}, text => $_->{name}, disabled => $_->{disabled}} } @themes,
) . "<br />";
- $ret .= $class->html_check(
- name => 'opt_forcemoodtheme',
- id => 'opt_forcemoodtheme',
- selected => $forcemoodtheme,
- );
- $ret .= "<label for='opt_forcemoodtheme'>" . $class->ml('widget.moodthemechooser.forcetheme') . "</label>";
+ if ( LJ::is_enabled('friendsfeed_optout') ) {
+ $ret .= $class->html_check(
+ name => 'opt_forcemoodtheme',
+ id => 'opt_forcemoodtheme',
+ selected => $forcemoodtheme,
+ );
+ $ret .= "<label for='opt_forcemoodtheme'>" . $class->ml('widget.moodthemechooser.forcetheme') . "</label>";
+ }
+
my $journalarg = $getextra ? "?journal=" . $u->user : "";
$ret .= "<ul class='moodtheme-links nostyle'>";
$ret .= "<li><a href='$LJ::SITEROOT/moodlist.bml$journalarg'>" . $class->ml('widget.moodthemechooser.links.allthemes') . "</a></li>";
