Remove the headblock property from the Template Asset, and merge
it into extra head tags. Style templates are not allowed to have extra head tags.
This commit is contained in:
parent
d3f8a075a7
commit
2b3b3fd458
7 changed files with 108 additions and 46 deletions
|
|
@ -371,7 +371,7 @@ sub definition {
|
|||
uiLevel=>3,
|
||||
fieldType=>'text',
|
||||
defaultValue=>'',
|
||||
filter=>'fixUrl'
|
||||
filter=>'fixUrl',
|
||||
},
|
||||
isHidden=>{
|
||||
tab=>"display",
|
||||
|
|
@ -387,7 +387,7 @@ sub definition {
|
|||
hoverHelp=>$i18n->get('940 description'),
|
||||
uiLevel=>9,
|
||||
fieldType=>'yesNo',
|
||||
defaultValue=>0
|
||||
defaultValue=>0,
|
||||
},
|
||||
encryptPage=>{
|
||||
fieldType => ($session->config->get("sslEnabled") ? 'yesNo' : 'hidden'),
|
||||
|
|
@ -404,7 +404,7 @@ sub definition {
|
|||
uiLevel=>6,
|
||||
fieldType=>'user',
|
||||
filter=>'fixId',
|
||||
defaultValue=>'3'
|
||||
defaultValue=>'3',
|
||||
},
|
||||
groupIdView=>{
|
||||
tab=>"security",
|
||||
|
|
@ -413,7 +413,7 @@ sub definition {
|
|||
uiLevel=>6,
|
||||
fieldType=>'group',
|
||||
filter=>'fixId',
|
||||
defaultValue=>'7'
|
||||
defaultValue=>'7',
|
||||
},
|
||||
groupIdEdit=>{
|
||||
tab=>"security",
|
||||
|
|
@ -423,7 +423,7 @@ sub definition {
|
|||
uiLevel=>6,
|
||||
fieldType=>'group',
|
||||
filter=>'fixId',
|
||||
defaultValue=>'4'
|
||||
defaultValue=>'4',
|
||||
},
|
||||
synopsis=>{
|
||||
tab=>"meta",
|
||||
|
|
@ -431,15 +431,16 @@ sub definition {
|
|||
hoverHelp=>$i18n->get('412 description'),
|
||||
uiLevel=>3,
|
||||
fieldType=>'textarea',
|
||||
defaultValue=>undef
|
||||
defaultValue=>undef,
|
||||
},
|
||||
extraHeadTags=>{
|
||||
tab=>"meta",
|
||||
label=>$i18n->get("extra head tags"),
|
||||
hoverHelp=>$i18n->get('extra head tags description'),
|
||||
uiLevel=>5,
|
||||
fieldType=>'textarea',
|
||||
defaultValue=>undef
|
||||
fieldType=>'codearea',
|
||||
defaultValue=>undef,
|
||||
customDrawMethod => 'drawExtraHeadTags',
|
||||
},
|
||||
isPackage=>{
|
||||
label=>$i18n->get("make package"),
|
||||
|
|
@ -447,7 +448,7 @@ sub definition {
|
|||
hoverHelp=>$i18n->get('make package description'),
|
||||
uiLevel=>7,
|
||||
fieldType=>'yesNo',
|
||||
defaultValue=>0
|
||||
defaultValue=>0,
|
||||
},
|
||||
isPrototype=>{
|
||||
tab=>"meta",
|
||||
|
|
@ -455,7 +456,7 @@ sub definition {
|
|||
hoverHelp=>$i18n->get('make prototype description'),
|
||||
uiLevel=>9,
|
||||
fieldType=>'yesNo',
|
||||
defaultValue=>0
|
||||
defaultValue=>0,
|
||||
},
|
||||
isExportable=>{
|
||||
tab=>'meta',
|
||||
|
|
@ -476,7 +477,7 @@ sub definition {
|
|||
status=>{
|
||||
noFormPost=>1,
|
||||
fieldType=>'hidden',
|
||||
defaultValue=>'pending'
|
||||
defaultValue=>'pending',
|
||||
},
|
||||
lastModified=>{
|
||||
noFormPost=>1,
|
||||
|
|
@ -486,7 +487,7 @@ sub definition {
|
|||
assetSize=>{
|
||||
noFormPost=>1,
|
||||
fieldType=>'hidden',
|
||||
defaultValue=>0
|
||||
defaultValue=>0,
|
||||
},
|
||||
);
|
||||
push(@{$definition}, {
|
||||
|
|
@ -502,6 +503,25 @@ sub definition {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 drawExtraHeadTags ( )
|
||||
|
||||
Draw the Extra Head Tags. Done with a customDrawMethod because the Template
|
||||
will override this.
|
||||
|
||||
=cut
|
||||
|
||||
sub drawExtraHeadTags {
|
||||
my ($self, $params) = @_;
|
||||
return WebGUI::Form::codearea($self->session, {
|
||||
name => $params->{name},
|
||||
value => $self->get($params->{name}),
|
||||
defaultValue => undef,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 DESTROY ( )
|
||||
|
|
@ -1958,7 +1978,7 @@ OUTPUT
|
|||
|
||||
=head2 prepareView ( )
|
||||
|
||||
Executes what is necessary to make the view() method work with content chunking. This includes things like processing template head tags.
|
||||
Executes what is necessary to make the view() method work with content chunking.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -1970,12 +1990,11 @@ sub prepareView {
|
|||
my $style = $self->session->style;
|
||||
my @keywords = @{WebGUI::Keyword->new($self->session)->getKeywordsForAsset({asset=>$self, asArrayRef=>1})};
|
||||
if (scalar @keywords) {
|
||||
$style->setMeta( {
|
||||
$style->setMeta({
|
||||
name => 'keywords',
|
||||
content => join(',', @keywords),
|
||||
});
|
||||
});
|
||||
}
|
||||
$style->setRawHeadTags($self->getExtraHeadTags);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -2114,7 +2133,9 @@ sub processTemplate {
|
|||
|
||||
=head2 processStyle ( html )
|
||||
|
||||
Returns some HTML 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.
|
||||
Returns some HTML 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
|
||||
|
||||
|
|
@ -2124,6 +2145,7 @@ The content to wrap up.
|
|||
|
||||
sub processStyle {
|
||||
my ($self, $output) = @_;
|
||||
$self->session->style->setRawHeadTags($self->getExtraHeadTags);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue