mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
8dd644d25d
Namespace all templates Move difflib and BBCodeParser2 to thirdparty Remove deprecated API marked for removal in 4.0
27 lines
515 B
PHP
27 lines
515 B
PHP
<?php
|
|
|
|
namespace SilverStripe\Forms;
|
|
|
|
use SilverStripe\Core\Convert;
|
|
|
|
/**
|
|
* The readonly class for our {@link TimeField}.
|
|
*/
|
|
class TimeField_Readonly extends TimeField
|
|
{
|
|
|
|
protected $readonly = true;
|
|
|
|
public function Field($properties = array())
|
|
{
|
|
if ($this->valueObj) {
|
|
$val = Convert::raw2xml($this->valueObj->toString($this->getConfig('timeformat')));
|
|
} else {
|
|
// TODO Localization
|
|
$val = '<i>(not set)</i>';
|
|
}
|
|
|
|
return "<span class=\"readonly\" id=\"" . $this->ID() . "\">$val</span>";
|
|
}
|
|
}
|