Reindent Article.pm
This commit is contained in:
parent
1860408b62
commit
c549803777
1 changed files with 20 additions and 19 deletions
|
|
@ -57,7 +57,7 @@ property storageId => (
|
||||||
fieldType => "image",
|
fieldType => "image",
|
||||||
deleteFileUrl => \&_storageId_deleteFileUrl,
|
deleteFileUrl => \&_storageId_deleteFileUrl,
|
||||||
maxAttachments => 2,
|
maxAttachments => 2,
|
||||||
persist => 1,
|
persist => 1,
|
||||||
default => undef,
|
default => undef,
|
||||||
label => ["attachments", 'Asset_Article'],
|
label => ["attachments", 'Asset_Article'],
|
||||||
hoverHelp => ["attachments help", 'Asset_Article'],
|
hoverHelp => ["attachments help", 'Asset_Article'],
|
||||||
|
|
@ -185,8 +185,9 @@ sub getStorageLocation {
|
||||||
unless (exists $self->{_storageLocation}) {
|
unless (exists $self->{_storageLocation}) {
|
||||||
if ($self->storageId eq "") {
|
if ($self->storageId eq "") {
|
||||||
$self->{_storageLocation} = WebGUI::Storage->create($self->session);
|
$self->{_storageLocation} = WebGUI::Storage->create($self->session);
|
||||||
$self->update({storageId=>$self->{_storageLocation}->getId});
|
$self->update({ storageId => $self->{_storageLocation}->getId });
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$self->{_storageLocation} = WebGUI::Storage->get($self->session,$self->storageId);
|
$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
|
=cut
|
||||||
|
|
||||||
override indexContent => sub {
|
override indexContent => sub {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $indexer = super();
|
my $indexer = super();
|
||||||
$indexer->addKeywords($self->linkTitle);
|
$indexer->addKeywords($self->linkTitle);
|
||||||
$indexer->addKeywords($self->linkURL);
|
$indexer->addKeywords($self->linkURL);
|
||||||
my $storage = $self->getStorageLocation;
|
my $storage = $self->getStorageLocation;
|
||||||
foreach my $file (@{$storage->getFiles}) {
|
foreach my $file (@{$storage->getFiles}) {
|
||||||
$indexer->addFile($storage->getPath($file));
|
$indexer->addFile($storage->getPath($file));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -268,14 +269,14 @@ Extend the super class to delete all storage locations.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
override purge => sub {
|
override purge => sub {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $sth = $self->session->db->read("select storageId from Article where assetId=?",[$self->getId]);
|
my $sth = $self->session->db->read("select storageId from Article where assetId=?",[$self->getId]);
|
||||||
while (my ($storageId) = $sth->array) {
|
while (my ($storageId) = $sth->array) {
|
||||||
my $storage = WebGUI::Storage->get($self->session,$storageId);
|
my $storage = WebGUI::Storage->get($self->session,$storageId);
|
||||||
$storage->delete if defined $storage;
|
$storage->delete if defined $storage;
|
||||||
}
|
}
|
||||||
$sth->finish;
|
$sth->finish;
|
||||||
return super();
|
return super();
|
||||||
};
|
};
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue