From cb367a80201505f46471c935b07741332ac373f0 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 17 Jan 2007 17:44:07 +0000 Subject: [PATCH] more formatting --- lib/WebGUI/Asset/Wobject/Collaboration.pm | 37 ++++++++++++----------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 513a30824..327801b2a 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -684,28 +684,29 @@ SQL 'link' => $postUrl, guid => $postUrl, description => $post->get('synopsis'), pubDate => $datetime->epochToMail($post->get('dateUpdated')), - attachmentLoop => do { - if ($post->get('storageId')) { - my $storage = $post->getStorageLocation; - #returns this - [ - map { - { - 'attachment.url' => $storage->getUrl($_), - 'attachment.path' => $storage->getPath($_), - 'attachment.length' => $storage->getFileSize($_) - } - } @{$storage->getFiles} - ] - } - else { - [] - } - } + attachmentLoop => $self->getRssItemsAttachments($post), }) } @postIds; } +#------------------------------------------------------------------- +sub getRssItemsAttachments { + my $self = shift; + my $post = shift; + if ($post->get('storageId')) { + my $storage = $post->getStorageLocation; + my @attachments = map { + { + 'attachment.url' => $storage->getUrl($_), + 'attachment.path' => $storage->getPath($_), + 'attachment.length' => $storage->getFileSize($_) + } + } @{$storage->getFiles}; + return \@attachments; + } + return []; +} + #------------------------------------------------------------------- sub getEditTabs { my $self = shift;