Henry Lyne (henrylyne) wrote in changelog,
Henry Lyne
henrylyne
changelog

[ljcom] r7595: Add Community Directory links to main ap...

Committer: henrylyne
Add Community Directory links to main app nav.

U   trunk/cgi-bin/LJ/Nav.pm
Modified: trunk/cgi-bin/LJ/Nav.pm
===================================================================
--- trunk/cgi-bin/LJ/Nav.pm	2009-08-25 06:13:12 UTC (rev 7594)
+++ trunk/cgi-bin/LJ/Nav.pm	2009-08-25 16:12:02 UTC (rev 7595)
@@ -433,7 +433,29 @@
         unshift @{$nav[5]->{links}}, { 'url' => "$siteroot/didyouknow/scrapbook.bml", 'text' => BML::ml('horizon.nav.photos.whatis') } unless $can_upload;
     }
 
-    if (LJ::run_hook("remote_should_see_vertical_nav")) {
+    if (LJ::is_enabled("browse", $remote)) {
+        my @browse_links;
+        my @cats = LJ::Browse->load_for_nav;
+        foreach my $cat (@cats) {
+            push @browse_links, {
+                url => $cat->{url},
+                text => $cat->{pretty_name},
+            };
+        }
+
+        push @browse_links, {
+            url => ($remote && $remote->get_cap("directory")) ? "$siteroot/directorysearch.bml" : "$siteroot/didyouknow/advancedsearch.bml",
+            class => (!$remote || !$remote->get_cap("directory")) ? "disabled" : "",
+            text => BML::ml('horizon.nav.find.directory'),
+        };
+
+        push @nav, { 'name' => BML::ml('horizon.nav.find'),
+                     'id' => "horizon-menu-explore",
+                     'url' => "$siteroot/browse/",
+                     'links' => \@browse_links,
+                 };
+
+    } elsif (LJ::run_hook("remote_should_see_vertical_nav")) {
         my @find_links;
         my @verticals = LJ::Vertical->load_for_nav;
         foreach my $vert (@verticals) {
@@ -652,7 +674,27 @@
         unshift @{$nav[5]->{links}}, { 'url' => "$siteroot/didyouknow/scrapbook.bml", 'text' => BML::ml('vertigo.nav.photos.whatis') } unless $can_upload;
     }
 
-    if (LJ::run_hook("remote_should_see_vertical_nav")) {
+    if (LJ::is_enabled("browse", $remote)) {
+        my @browse_links;
+        my @cats = LJ::Browse->load_for_nav;
+        foreach my $cat (@cats) {
+            push @browse_links, {
+                url => $cat->{url},
+                text => $cat->{pretty_name},
+            };
+        }
+        push @browse_links, {
+            url => ($remote && $remote->get_cap("directory")) ? "$siteroot/directorysearch.bml" : "$siteroot/didyouknow/advancedsearch.bml",
+            class => (!$remote || !$remote->get_cap("directory")) ? "disabled" : "",
+            text => BML::ml('vertigo.nav.find.directory'),
+        };
+
+        push @nav, { 'name' => BML::ml('vertigo.nav.find'),
+                     'id' => "vertigo-menu-explore",
+                     'url' => "$siteroot/browse/",
+                     'links' => \@browse_links,
+                 };
+    } elsif (LJ::run_hook("remote_should_see_vertical_nav")) {
         my @find_links;
         my @verticals = LJ::Vertical->load_for_nav;
         foreach my $vert (@verticals) {

Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments