Committer: wisest-owlLJSUP-3742: Add $LJ::DISABLED to Yandex Search form
U trunk/cgi-bin/LJ/Hooks/ControlStrip.pm
U trunk/cgi-bin/LJ/Hooks/SUP.pm
U trunk/cgi-bin/bml/scheme/lanzelot.look
Modified: trunk/cgi-bin/LJ/Hooks/ControlStrip.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/ControlStrip.pm 2009-02-04 05:02:45 UTC (rev 7021)
+++ trunk/cgi-bin/LJ/Hooks/ControlStrip.pm 2009-02-04 08:05:04 UTC (rev 7022)
@@ -241,5 +241,60 @@
return "
" . LJ::Lang::ml('web.controlstrip.links.learnmore') . "";
});
+LJ::register_hook('add_extra_cells_in_controlstrip', sub {
+ my $journal = LJ::get_active_journal();
+ return unless $journal;
+ return if LJ::SUP->is_sup_enabled($journal);
+ my $ret = shift;
+
+ $$ret .= "";
+
+ my @verticals = LJ::Vertical->load_for_nav;
+
+ my $remote = LJ::get_remote();
+ my $condensed = ($remote && $remote->can_use_stylealwaysmine) ? 1 : 0;
+ if (@verticals) {
+ $$ret .= "
" . BML::ml('web.controlstrip.links.explore', { sitenameabbrev => $LJ::SITENAMEABBREV }) . ": ";
+
+ my $count = 0;
+ foreach my $vert (@verticals) {
+ $$ret .= "
$vert->{display_name} ";
+ $count++;
+ if ($condensed && $count >= 3) {
+ $$ret .= "
" . BML::ml('web.controlstrip.links.more') . " >";
+ last;
+ }
+ }
+ $$ret .= "
";
+ }
+
+ $$ret .= "";
+
+ $$ret .= "";
+
+ return;
+}) unless LJ::is_enabled("yandex_search");
+
1;
Modified: trunk/cgi-bin/LJ/Hooks/SUP.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/SUP.pm 2009-02-04 05:02:45 UTC (rev 7021)
+++ trunk/cgi-bin/LJ/Hooks/SUP.pm 2009-02-04 08:05:04 UTC (rev 7022)
@@ -387,16 +387,26 @@
return;
});
-LJ::register_hook("add_extra_cells_in_controlstrip", sub {
+LJ::register_hook('add_extra_cells_in_controlstrip', sub {
my $rret = shift;
+ my $journal = LJ::get_active_journal();
+ return unless $journal;
+ return unless LJ::SUP->is_sup_enabled($journal);
+
my $ret = "";
$ret .= "";
- $ret .= "