From c5498037778e63622ceefc0b5985fdd98189eeb3 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 6 Apr 2010 19:05:12 -0700 Subject: [PATCH] Reindent Article.pm --- lib/WebGUI/Asset/Wobject/Article.pm | 39 +++++++++++++++-------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/Article.pm b/lib/WebGUI/Asset/Wobject/Article.pm index c2c59fac9..29617d92b 100644 --- a/lib/WebGUI/Asset/Wobject/Article.pm +++ b/lib/WebGUI/Asset/Wobject/Article.pm @@ -57,7 +57,7 @@ property storageId => ( fieldType => "image", deleteFileUrl => \&_storageId_deleteFileUrl, maxAttachments => 2, - persist => 1, + persist => 1, default => undef, label => ["attachments", 'Asset_Article'], hoverHelp => ["attachments help", 'Asset_Article'], @@ -185,8 +185,9 @@ sub getStorageLocation { unless (exists $self->{_storageLocation}) { if ($self->storageId eq "") { $self->{_storageLocation} = WebGUI::Storage->create($self->session); - $self->update({storageId=>$self->{_storageLocation}->getId}); - } else { + $self->update({ storageId => $self->{_storageLocation}->getId }); + } + else { $self->{_storageLocation} = WebGUI::Storage->get($self->session,$self->storageId); } } @@ -202,14 +203,14 @@ Indexing the content of attachments and user defined fields. See WebGUI::Asset:: =cut override indexContent => sub { - my $self = shift; - my $indexer = super(); - $indexer->addKeywords($self->linkTitle); - $indexer->addKeywords($self->linkURL); - my $storage = $self->getStorageLocation; - foreach my $file (@{$storage->getFiles}) { - $indexer->addFile($storage->getPath($file)); - } + my $self = shift; + my $indexer = super(); + $indexer->addKeywords($self->linkTitle); + $indexer->addKeywords($self->linkURL); + my $storage = $self->getStorageLocation; + foreach my $file (@{$storage->getFiles}) { + $indexer->addFile($storage->getPath($file)); + } }; #------------------------------------------------------------------- @@ -268,14 +269,14 @@ Extend the super class to delete all storage locations. =cut override purge => sub { - my $self = shift; - my $sth = $self->session->db->read("select storageId from Article where assetId=?",[$self->getId]); - while (my ($storageId) = $sth->array) { - my $storage = WebGUI::Storage->get($self->session,$storageId); - $storage->delete if defined $storage; - } - $sth->finish; - return super(); + my $self = shift; + my $sth = $self->session->db->read("select storageId from Article where assetId=?",[$self->getId]); + while (my ($storageId) = $sth->array) { + my $storage = WebGUI::Storage->get($self->session,$storageId); + $storage->delete if defined $storage; + } + $sth->finish; + return super(); }; #-------------------------------------------------------------------