2016-08-19 00:51:35 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\Forms;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Readonly version of a checkbox field - "Yes" or "No".
|
|
|
|
*/
|
|
|
|
class CheckboxField_Readonly extends ReadonlyField
|
|
|
|
{
|
|
|
|
|
2016-11-29 00:31:16 +01:00
|
|
|
public function performReadonlyTransformation()
|
|
|
|
{
|
|
|
|
return clone $this;
|
|
|
|
}
|
2016-08-19 00:51:35 +02:00
|
|
|
|
2016-11-29 00:31:16 +01:00
|
|
|
public function Value()
|
|
|
|
{
|
|
|
|
return $this->value ?
|
2017-04-20 03:15:24 +02:00
|
|
|
_t('SilverStripe\\Forms\\CheckboxField.YESANSWER', 'Yes') :
|
|
|
|
_t('SilverStripe\\Forms\\CheckboxField.NOANSWER', 'No');
|
2016-11-29 00:31:16 +01:00
|
|
|
}
|
2016-08-19 00:51:35 +02:00
|
|
|
|
2016-11-29 00:31:16 +01:00
|
|
|
public function getValueCast()
|
|
|
|
{
|
|
|
|
return 'Text';
|
|
|
|
}
|
2016-08-19 00:51:35 +02:00
|
|
|
}
|