ssafronova (ssafronova) wrote in changelog,
ssafronova
ssafronova
changelog

[ljcom] r9780: LJSUP-7377: Wishlist

Committer: ssafronova
LJSUP-7377: Wishlist
U   trunk/cgi-bin/LJ/Hooks/Userinfo.pm
Modified: trunk/cgi-bin/LJ/Hooks/Userinfo.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/Userinfo.pm	2010-12-02 05:08:17 UTC (rev 9779)
+++ trunk/cgi-bin/LJ/Hooks/Userinfo.pm	2010-12-02 05:20:57 UTC (rev 9780)
@@ -1,6 +1,8 @@
 package LJ::LJcom;
 use strict;
 
+use LJ::WishList;
+
 LJ::register_hook("userinfo_rows", sub {
     my $args = shift;
     my $u = $args->{'u'};
@@ -275,6 +277,25 @@
         $$r .= "</div>\n";
     }
 
+    my $wishes = LJ::WishList->load_profile($u);
+    if (scalar @$wishes) {
+        my $ulink = $u->journal_base;
+        if ($with_header) {
+            $$r .= "<div class='section$extra_section_class'><span class='expandcollapse on' id='wished_header'>";
+            $$r .= "<img id='wishes_arrow' src='$LJ::IMGPREFIX/profile_icons/arrow-down.gif' align='absmiddle' /> " . LJ::Lang::ml('ljcom.userinfo.wishes.header');
+            $$r .= "</span> <span class='section_link'>[<a href='$ulink/wishlist'>" . LJ::Lang::ml('ljcom.userinfo.wishes.viewall') . "</a>]</span></div>";
+            $$r .= "\n<div class='section_body' id='wishes_body'>";
+			$$r .= "\n<ul class='b-wishes-list'>";
+        } else {
+            $$r .= "<div style='float: left; margin-top: 1em'>";
+			$$r .= "\n<ul>";
+        }
+        $$r .= LJ::JSON->to_json($wishes);
+        $$r .= "</ul>\n";
+        $$r .= "<p style='font-size: .9em; white-space: nowrap'><a href='$ulink/wishlist'>" . LJ::Lang::ml('ljcom.userinfo.wishes.viewall') . " . </a></p>" unless $with_header;
+        $$r .= "</div>\n";
+    }
+
 });
 
 LJ::register_hook("userinfo_html_nextto_journal", sub {

Tags: ljcom, pm, ssafronova
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