[dw-free] S2 Entry code cleanup
[commit: http://hg.dwscoalition.org/dw-free/rev/366f934766bd]
http://bugs.dwscoalition.org/show_bug.cgi?id=2479
Code cleanup: misc formatting, redundancy cleanup.
Patch by
kareila.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=2479
Code cleanup: misc formatting, redundancy cleanup.
Patch by
Files modified:
- cgi-bin/LJ/S2.pm
- cgi-bin/LJ/S2/EntryPage.pm
--------------------------------------------------------------------------------
diff -r f5ab3d6f909b -r 366f934766bd cgi-bin/LJ/S2.pm
--- a/cgi-bin/LJ/S2.pm Tue Apr 13 07:55:29 2010 -0700
+++ b/cgi-bin/LJ/S2.pm Tue Apr 13 08:05:56 2010 -0700
@@ -1946,13 +1946,6 @@ sub Entry_from_entryobj
$text = DW::Logic::AdultContent->transform_post( post => $text, journal => $journal,
remote => $remote, entry => $entry_obj );
- # security information
- my $allowmask = $entry_obj->allowmask;
- my $security = $entry_obj->security;
- # time when entry was posted
- my $alldatepart = LJ::alldatepart_s2( $entry_obj->{eventtime} );
- my $system_alldatepart = LJ::alldatepart_s2( $entry_obj->{logtime} );;
-
# journal: posted to; poster: posted by
my $posterid = $entry_obj->posterid;
my $userlite_journal = UserLite ( $journal );
@@ -1989,26 +1982,26 @@ sub Entry_from_entryobj
u => $u, remote => $remote, style_args => $style_args, journal => $journal
) );
- my $entry = Entry($u, {
+ my $entry = Entry( $u, {
subject => $subject,
text => $text,
- dateparts => $alldatepart,
- system_dateparts => $system_alldatepart,
- security => $security,
+ dateparts => LJ::alldatepart_s2( $entry_obj->{eventtime} ),
+ system_dateparts => LJ::alldatepart_s2( $entry_obj->{logtime} ),
+ security => $entry_obj->security,
adult_content_level => $entry_obj->adult_content_calculated || $journal->adult_content_calculated,
- allowmask => $allowmask,
+ allowmask => $entry_obj->allowmask,
props => $entry_obj->props,
itemid => $ditemid,
journal => $userlite_journal,
poster => $userlite_poster,
comments => $comments,
- new_day => 0, #if true, set later
+ new_day => 0, #if true, set later
end_day => 0, #if true, set later
userpic => $userpic,
tags => $taglist,
permalink_url => $entry_obj->url,
moodthemeid => $moodthemeid
- });
+ } );
return $entry;
}
diff -r f5ab3d6f909b -r 366f934766bd cgi-bin/LJ/S2/EntryPage.pm
--- a/cgi-bin/LJ/S2/EntryPage.pm Tue Apr 13 07:55:29 2010 -0700
+++ b/cgi-bin/LJ/S2/EntryPage.pm Tue Apr 13 08:05:56 2010 -0700
@@ -491,25 +491,25 @@ sub EntryPage_entry
}
}
- my $s2entry = Entry($u, {
- 'subject' => $subject,
- 'text' => $event,
- 'dateparts' => LJ::alldatepart_s2($entry->eventtime_mysql),
- 'system_dateparts' => LJ::alldatepart_s2($entry->logtime_mysql),
- 'security' => $entry->security,
- 'adult_content_level' => $entry->adult_content_calculated || $u->adult_content_calculated,
- 'allowmask' => $entry->allowmask,
- 'props' => $entry->props,
- 'itemid' => $ditemid,
- 'comments' => $comments,
- 'journal' => $userlite_journal,
- 'poster' => $userlite_poster,
- 'tags' => \@taglist,
- 'new_day' => 0,
- 'end_day' => 0,
- 'userpic' => $userpic,
- 'permalink_url' => $entry->url,
- });
+ my $s2entry = Entry( $u, {
+ subject => $subject,
+ text => $event,
+ dateparts => LJ::alldatepart_s2( $entry->eventtime_mysql ),
+ system_dateparts => LJ::alldatepart_s2( $entry->logtime_mysql ),
+ security => $entry->security,
+ adult_content_level => $entry->adult_content_calculated || $u->adult_content_calculated,
+ allowmask => $entry->allowmask,
+ props => $entry->props,
+ itemid => $ditemid,
+ comments => $comments,
+ journal => $userlite_journal,
+ poster => $userlite_poster,
+ tags => \@taglist,
+ new_day => 0,
+ end_day => 0,
+ userpic => $userpic,
+ permalink_url => $entry->url,
+ } );
return ($entry, $s2entry);
}
--------------------------------------------------------------------------------
