Refactor out synopsis code from Post to make a new AssetAspect. Have the WikiPage start using it, and assigning synopses to pages.

This commit is contained in:
Colin Kuskie 2010-04-21 18:24:30 -07:00
parent 5ee5c910d8
commit 79fea5bb76
5 changed files with 117 additions and 76 deletions

View file

@ -15,6 +15,7 @@ use Class::C3;
use base qw(
WebGUI::AssetAspect::Subscribable
WebGUI::AssetAspect::Comments
WebGUI::AssetAspect::AutoSynopsis
WebGUI::Asset
);
use Tie::IxHash;
@ -420,6 +421,8 @@ sub processPropertiesFromFormPost {
$properties->{isFeatured} = $session->form->get("isFeatured");
}
($properties->{synopsis}) = $self->getSynopsisAndContent(undef, $self->get('content'));
$self->update($properties);
# deal with attachments from the attachments form control
@ -473,6 +476,7 @@ sub scrubContent {
my $self = shift;
my $content = shift || $self->get("content");
$content =~ s/\^-\;//g;
my $scrubbedContent = WebGUI::HTML::filter($content, $self->getWiki->get("filterCode"));
if ($self->getWiki->get("useContentFilter")) {