ssafronova (ssafronova) wrote in changelog,
ssafronova
ssafronova
changelog

[livejournal] r17557: LJSUP-7103: New update.bml - LJSUP-7109:...

Committer: ssafronova
LJSUP-7103: New update.bml - LJSUP-7109: create text widget
A   trunk/cgi-bin/LJ/Widget/UpdateJournal/
A   trunk/cgi-bin/LJ/Widget/UpdateJournal/TextBlock.pm
U   trunk/cgi-bin/LJ/Widget/UpdateJournal.pm
U   trunk/templates/UpdateJournal/main.tmpl
A   trunk/templates/UpdateJournal/text.tmpl
Added: trunk/cgi-bin/LJ/Widget/UpdateJournal/TextBlock.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/UpdateJournal/TextBlock.pm	                        (rev 0)
+++ trunk/cgi-bin/LJ/Widget/UpdateJournal/TextBlock.pm	2010-10-13 11:02:45 UTC (rev 17557)
@@ -0,0 +1,18 @@
+package LJ::Widget::UpdateJournal::TextBlock;
+# it is not a wdget, it is perl module
+# subject + body, tags and userpic group of elements
+
+use strict;
+use Carp qw(croak);
+
+sub prepare_template_params {
+    my $class = shift;
+    my $template_obj = shift;
+    my $opts = shift;
+
+    $template_obj->param(step => 1);
+
+    return;
+}
+
+1;

Modified: trunk/cgi-bin/LJ/Widget/UpdateJournal.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/UpdateJournal.pm	2010-10-13 11:00:35 UTC (rev 17556)
+++ trunk/cgi-bin/LJ/Widget/UpdateJournal.pm	2010-10-13 11:02:45 UTC (rev 17557)
@@ -4,6 +4,9 @@
 use base qw(LJ::Widget::Template);
 use Carp qw(croak);
 
+# they are not widgets, they are perl modules
+use LJ::Widget::UpdateJournal::TextBlock; # subject + body, tags and userpic group of elements
+
 #sub need_res { qw( stc/widgets/examplepostwidget.css ) }
 
 sub template_filename {
@@ -15,6 +18,9 @@
     my $template_obj = shift;
     my $opts = shift;
 
+    # put all needed parameters in common template object
+    LJ::Widget::UpdateJournal::TextBlock->prepare_template_params($template_obj, $opts);
+
     $template_obj->param(step => 1);
 
     return;

Modified: trunk/templates/UpdateJournal/main.tmpl
===================================================================
--- trunk/templates/UpdateJournal/main.tmpl	2010-10-13 11:00:35 UTC (rev 17556)
+++ trunk/templates/UpdateJournal/main.tmpl	2010-10-13 11:02:45 UTC (rev 17557)
@@ -1 +1,2 @@
+<TMPL_INCLUDE templates/UpdateJournal/text.tmpl>
 Hello, world!
\ No newline at end of file

Added: trunk/templates/UpdateJournal/text.tmpl
===================================================================
--- trunk/templates/UpdateJournal/text.tmpl	                        (rev 0)
+++ trunk/templates/UpdateJournal/text.tmpl	2010-10-13 11:02:45 UTC (rev 17557)
@@ -0,0 +1 @@
+Text block
\ No newline at end of file

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