mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Static function to be use as well from PopupDateTimeField and put it in a <li> tag
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44171 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
42d7fdbb19
commit
dbf72b83cd
@ -6,6 +6,14 @@
|
|||||||
class CalendarDateField extends DateField {
|
class CalendarDateField extends DateField {
|
||||||
protected $futureOnly;
|
protected $futureOnly;
|
||||||
|
|
||||||
|
static function HTMLField( $id, $name, $val ) {
|
||||||
|
return <<<HTML
|
||||||
|
<input type="text" id="$id" name="$name" value="$val" />
|
||||||
|
<img src="sapphire/images/calendar-icon.gif" id="$id-icon" />
|
||||||
|
<div class="calendarpopup" id="$id-calendar"></div>
|
||||||
|
HTML;
|
||||||
|
}
|
||||||
|
|
||||||
function Field() {
|
function Field() {
|
||||||
Requirements::javascript("jsparty/calendar/calendar.js");
|
Requirements::javascript("jsparty/calendar/calendar.js");
|
||||||
Requirements::javascript("jsparty/calendar/lang/calendar-en.js");
|
Requirements::javascript("jsparty/calendar/lang/calendar-en.js");
|
||||||
@ -20,11 +28,11 @@ class CalendarDateField extends DateField {
|
|||||||
|
|
||||||
$futureClass = $this->futureOnly ? ' futureonly' : '';
|
$futureClass = $this->futureOnly ? ' futureonly' : '';
|
||||||
|
|
||||||
|
$innerHTML = self::HTMLField( $id, $this->name, $val );
|
||||||
|
|
||||||
return <<<HTML
|
return <<<HTML
|
||||||
<div class="calendardate$futureClass">
|
<div class="calendardate$futureClass">
|
||||||
<input type="text" id="$id" name="{$this->name}" value="$val" />
|
$innerHTML
|
||||||
<img src="sapphire/images/calendar-icon.gif" id="{$id}-icon" />
|
|
||||||
<div class="calendarpopup" id="{$id}-calendar"></div>
|
|
||||||
</div>
|
</div>
|
||||||
HTML;
|
HTML;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user