журнал (shhh) wrote in changelog,
журнал
shhh
changelog

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

Committer: nnikulochkina
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-09-25 12:23:50 UTC (rev 22967)
+++ trunk/bin/upgrading/s2layers/core1.s2	2012-09-25 14:05:53 UTC (rev 22968)
@@ -635,6 +635,12 @@
 
     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 journalpromo() : string
+    "Returns rendered journal promo.";
+
+    function builtin render_journalpromo()
+    "Print rendered journal promo.";
 }
 
 class TagsPage extends Page

Modified: trunk/cgi-bin/LJ/S2.pm
===================================================================
--- trunk/cgi-bin/LJ/S2.pm	2012-09-25 12:23:50 UTC (rev 22967)
+++ trunk/cgi-bin/LJ/S2.pm	2012-09-25 14:05:53 UTC (rev 22968)
@@ -5344,4 +5344,32 @@
                         $/x;
 }
 
+sub Page__journalpromo {
+    my ($ctx, $this) = @_;
+
+    my $opts;
+    
+    $opts->{'remote'} = LJ::get_remote();
+    $opts->{'journal'} = $LJ::S2::CURR_PAGE->{'journal'}->{'_u'};
+
+    my $ret = '';
+    
+    eval { $ret = "LJ::Widget::JournalPromo"->render(%$opts); };
+
+    if ($@) {
+        warn "Error when Page::journalpromo() try to call LJ::Widget::JournalPromo->render() from LJ::S2:\n$@\n";
+        return '';
+    }
+
+    return $ret;
+}
+
+sub Page__render_journalpromo {
+    my ($ctx, $this) = @_;
+    
+    my $rendered = Page__journalpromo($ctx, $this);
+    $S2::pout->($rendered);
+}
+
+
 1;

Tags: livejournal, nikulochkina, nnikulochkina, pm, s2
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