Refactor processStyle so there's no duplicated code. Make Wobject call

SUPER.  Add an option to skip adding getExtraHeadTags, so that Shortcut
doesn't add them an extra time.  Remove the subclassed getExtraHeadTags,
since prepareView will add them, which prevents adding them a 3rd time.
This commit is contained in:
Colin Kuskie 2009-05-29 23:30:04 +00:00
parent 66843db604
commit b0a1e20053
4 changed files with 50 additions and 43 deletions

View file

@ -2196,23 +2196,30 @@ sub processTemplate {
#-------------------------------------------------------------------
=head2 processStyle ( html )
=head2 processStyle ( $output, $noHeadTags )
Returns some HTML wrappered in a style. Should be overridden by subclasses, because
Returns the output wrappered in a style. Should be overridden by subclasses, because
this one actually doesn't do anything other than return the html back to you and
adds the Asset's extraHeadTags into the raw head tags.
=head3 html
=head3 $output
The content to wrap up.
=head3 $options
Options that alter how the method behaves.
=head4 noHeadTags
If this options is true, then this method will not set the extraHeadTags
=cut
sub processStyle {
my ($self, $output) = @_;
my $session = $self->session;
my $style = $session->style;
$style->setRawHeadTags($self->getExtraHeadTags);
my ($self, $output, $options) = @_;
my $style = $self->session->style;
$style->setRawHeadTags($self->getExtraHeadTags) unless $options->{noHeadTags};
if ($self->get('synopsis')) {
$style->setMeta({
name => 'Description',