Only show the links to the shop if payments are enabled in this 
installation. (Correct bug number)

        Patch by kareila. 
X-Hg-Repo: dw-free
  Subject: dw-free: http://bugs.dwscoalition.org/show_bug.cgi?id=2508
  From: fu
  
  changeset df46ce717ead in /home/hg/repos/dw-free
  details: http://hg.dwscoalition.org/dw-free?cmd=changeset;node=df46ce717ead
  description:
    http://bugs.dwscoalition.org/show_bug.cgi?id=2508

        Only show the links to the shop if payments are enabled in this 
installation. (Correct bug number)

        Patch by kareila. 

diffs (72 lines):

diff -r ddbf13a0f9a5 -r df46ce717ead bin/upgrading/en.dat
--- a/bin/upgrading/en.dat      Fri Jun 04 13:50:43 2010 +0800
+++ b/bin/upgrading/en.dat      Fri Jun 04 13:55:13 2010 +0800
@@ -2177,6 +2177,8 @@ menunav.organize.selectstyle=Select Styl
 
 menunav.read=Read
 
+menunav.read.archive=Archive
+
 menunav.read.inbox.nounread=Inbox
 
 menunav.read.inbox.unread2=Inbox [[num]]
diff -r ddbf13a0f9a5 -r df46ce717ead cgi-bin/DW/Logic/MenuNav.pm
--- a/cgi-bin/DW/Logic/MenuNav.pm       Fri Jun 04 13:50:43 2010 +0800
+++ b/cgi-bin/DW/Logic/MenuNav.pm       Fri Jun 04 13:55:13 2010 +0800
@@ -178,6 +178,11 @@ sub get_menu_navigation {
                     display => $loggedin_hasnetwork,
                 },
                 {
+                    url => $u ? $u->archive_current_month : "",
+                    text => "menunav.read.archive",
+                    display => $loggedin_hasjournal,
+                },
+                {
                     url => "$LJ::SITEROOT/tools/recent_comments",
                     text => "menunav.read.recentcomments",
                     display => $loggedin,
diff -r ddbf13a0f9a5 -r df46ce717ead cgi-bin/LJ/User.pm
--- a/cgi-bin/LJ/User.pm        Fri Jun 04 13:50:43 2010 +0800
+++ b/cgi-bin/LJ/User.pm        Fri Jun 04 13:55:13 2010 +0800
@@ -1781,6 +1781,15 @@ sub allow_search_by {
 }
 
 
+# returns a link to the current year and month in the user's archive
+sub archive_current_month {
+    my ( $u ) = @_;
+    return '' if $u->is_identity;  # no archive to read
+    my $t = $u->time_now;
+    return sprintf( "%s/%02d/%02d/", $u->journal_base, $t->year, $t->mon );
+}
+
+
 sub caps {
     my $u = shift;
     return $u->{caps};
diff -r ddbf13a0f9a5 -r df46ce717ead htdocs/site/index.bml
--- a/htdocs/site/index.bml     Fri Jun 04 13:50:43 2010 +0800
+++ b/htdocs/site/index.bml     Fri Jun 04 13:55:13 2010 +0800
@@ -93,7 +93,11 @@ body<=
 </div>
 <div id='maplinks-right'>
 
- <dl><dt><?_code return BML::ml('.maplinks.shop-title', { sitename => 
$LJ::SITENAMESHORT }); _code?></dt>
+<?_code
+if ( LJ::is_enabled( 'payments' ) ) {
+    my $shop_title = BML::ml('.maplinks.shop-title', { sitename => 
$LJ::SITENAMESHORT } );
+    return qq{
+ <dl><dt>$shop_title</dt>
   <dd><ul>
    <li><a href='/shop'><?_ml .maplinks.buy-points _ml?></a></li>
    <li><a href='/shop/gifts'><?_ml .maplinks.buy-circle _ml?></a></li>
@@ -102,6 +106,9 @@ body<=
    <li><a href='http://www.zazzle.com/dreamwidth*'><?_ml 
.maplinks.buy-merchandise _ml?></a></li>
    <li><a href='/shop/history'><?_ml .maplinks.payment-history _ml?></a></li>
   </ul></dd></dl>
+    };
+}
+_code?>
 
  <dl><dt><?_code return BML::ml('.maplinks.learn-site-title', { sitename => 
$LJ::SITENAMESHORT }); _code?></dt>
   <dd><ul>
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to