From: <mp...@kr...> - 2008-02-27 23:01:37
|
Revision: 4901 Author: mpeters Date: 2008-02-27 18:01:36 -0500 (Wed, 27 Feb 2008) Log Message: ----------- running through perltidy in preparation for working on this function Modified Paths: -------------- branches/krang_v3_02/lib/Krang/Story.pm Modified: branches/krang_v3_02/lib/Krang/Story.pm =================================================================== --- branches/krang_v3_02/lib/Krang/Story.pm 2008-02-27 22:31:58 UTC (rev 4900) +++ branches/krang_v3_02/lib/Krang/Story.pm 2008-02-27 23:01:36 UTC (rev 4901) @@ -2259,16 +2259,16 @@ =cut sub serialize_xml { - my ($self, %args) = @_; - my ($writer, $set) = @args{qw(writer set)}; + my ($self, %args) = @_; + my ($writer, $set) = @args{qw(writer set)}; local $_; # open up <story> linked to schema/story.xsd - $writer->startTag('story', - "xmlns:xsi" => - "http://www.w3.org/2001/XMLSchema-instance", - "xsi:noNamespaceSchemaLocation" => - 'story.xsd'); + $writer->startTag( + 'story', + "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance", + "xsi:noNamespaceSchemaLocation" => 'story.xsd' + ); # basic fields $writer->dataElement(story_id => $self->story_id); @@ -2296,23 +2296,25 @@ my %contrib_type = pkg('Pref')->get('contrib_type'); for my $contrib ($self->contribs) { $writer->startTag('contrib'); - $writer->dataElement(contrib_id => $contrib->contrib_id); - $writer->dataElement(contrib_type => - $contrib_type{$contrib->selected_contrib_type()}); + $writer->dataElement(contrib_id => $contrib->contrib_id); + $writer->dataElement(contrib_type => $contrib_type{$contrib->selected_contrib_type()}); $writer->endTag('contrib'); $set->add(object => $contrib, from => $self); } # schedules - foreach my $schedule ( pkg('Schedule')->find( object_type => 'story', object_id => $self->story_id ) ) { + my @schedules = pkg('Schedule')->find(object_type => 'story', object_id => $self->story_id); + foreach my $schedule (@schedules) { $set->add(object => $schedule, from => $self); } - + # serialize elements - $self->element->serialize_xml(writer => $writer, - set => $set); - + $self->element->serialize_xml( + writer => $writer, + set => $set + ); + # all done $writer->endTag('story'); } |