sunnyman's (sunnyman) wrote in changelog,
sunnyman's
sunnyman
changelog

[livejournal] r23049: LJSUP-13769: S2 styles Journal Promo blo...

Committer: vtroitsky
LJSUP-13769: S2 styles Journal Promo block
U   trunk/bin/upgrading/s2layers/core1.s2
U   trunk/cgi-bin/LJ/S2.pm
Modified: trunk/bin/upgrading/s2layers/core1.s2
===================================================================
--- trunk/bin/upgrading/s2layers/core1.s2	2012-10-04 09:11:43 UTC (rev 23048)
+++ trunk/bin/upgrading/s2layers/core1.s2	2012-10-04 09:59:24 UTC (rev 23049)
@@ -636,6 +636,9 @@
     function builtin get_alien_post( string url ) : Entry
     "Returns any public entry from any journal having give_posts_to_alien prop. Recipient must have get_alien_posts prop";
 
+    function builtin is_journalpromo() : bool
+    "Return true if journal promo is not empty.";
+
     function builtin journalpromo() : string
     "Returns rendered journal promo.";
 

Modified: trunk/cgi-bin/LJ/S2.pm
===================================================================
--- trunk/cgi-bin/LJ/S2.pm	2012-10-04 09:11:43 UTC (rev 23048)
+++ trunk/cgi-bin/LJ/S2.pm	2012-10-04 09:59:24 UTC (rev 23049)
@@ -5344,6 +5344,24 @@
                         $/x;
 }
 
+sub Page__is_journalpromo {
+    my ($ctx, $this) = @_;
+
+    my $opts;
+    
+    $opts->{'remote'} = LJ::get_remote();
+    $opts->{'journal'} = $LJ::S2::CURR_PAGE->{'journal'}->{'_u'};
+
+    my $ret = 0;
+    eval { $ret = "LJ::Widget::JournalPromo"->is_visible(%$opts); };
+
+    if ($@) {
+        warn "Error when Page::is_journalpromo() try to call LJ::Widget::JournalPromo->is_visible() from LJ::S2:\n$@\n";
+        return 0;   
+    }
+    return $ret;
+}
+
 sub Page__journalpromo {
     my ($ctx, $this) = @_;
 

Tags: livejournal, pm, s2, sunnyman, vtroitsky
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