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