Convert Date plugin to headTags
This commit is contained in:
parent
bd55fb0e58
commit
46fc168e11
1 changed files with 25 additions and 11 deletions
|
|
@ -189,6 +189,30 @@ sub getValueAsHtml {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 headTags ()
|
||||
|
||||
Set head tags for this form plugin
|
||||
|
||||
=cut
|
||||
|
||||
sub headTags {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $style = $session->style;
|
||||
my $url = $session->url;
|
||||
$style->setLink($url->extras('yui/build/calendar/assets/skins/sam/calendar.css'), { rel=>"stylesheet", type=>"text/css", media=>"all" });
|
||||
$style->setScript($url->extras('yui/build/utilities/utilities.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/json/json-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/yahoo/yahoo-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/dom/dom-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/event/event-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/calendar/calendar-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui-webgui/build/i18n/i18n.js' ), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui-webgui/build/datepicker/datepicker.js'),{ type => 'text/javascript' });
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 isDynamicCompatible ( )
|
||||
|
||||
A class method that returns a boolean indicating whether this control is compatible with the DynamicField control.
|
||||
|
|
@ -221,17 +245,6 @@ sub toHtml {
|
|||
$value = WebGUI::DateTime->new($session,0)->toMysqlDate if $value eq '';
|
||||
}
|
||||
|
||||
my $style = $session->style;
|
||||
my $url = $session->url;
|
||||
$style->setLink($url->extras('yui/build/calendar/assets/skins/sam/calendar.css'), { rel=>"stylesheet", type=>"text/css", media=>"all" });
|
||||
$style->setScript($url->extras('yui/build/utilities/utilities.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/json/json-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/yahoo/yahoo-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/dom/dom-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/event/event-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui/build/calendar/calendar-min.js'), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui-webgui/build/i18n/i18n.js' ), { type => 'text/javascript' });
|
||||
$style->setScript($url->extras('yui-webgui/build/datepicker/datepicker.js'),{ type => 'text/javascript' });
|
||||
|
||||
my $field = WebGUI::Form::Text->new($self->session,
|
||||
name => $self->get("name"),
|
||||
|
|
@ -241,6 +254,7 @@ sub toHtml {
|
|||
id => $self->get('id'),
|
||||
maxlength => $self->get("maxlength"),
|
||||
);
|
||||
$self->headTags;
|
||||
return $field->toHtml;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue