/**
  * (non-PHPdoc)
  * @see sapphire/forms/FormField#Field()
  */
 function Field()
 {
     if ($this->isReadonly()) {
         $nullableCheckbox = new CheckboxField_Readonly($this->getIsNullId());
     } else {
         $nullableCheckbox = new CheckboxField($this->getIsNullId());
     }
     $nullableCheckbox->setValue(is_null($this->dataValue()));
     return $this->valueField->Field() . ' ' . $nullableCheckbox->Field() . '&nbsp;<span>' . $this->getIsNullLabel() . '</span>';
 }
 /**
  * @param array $properties
  * @return HTMLText
  */
 public function Field($properties = array())
 {
     $this->addExtraClass('prettycheckablefield')->setAttribute('data-prettycheckableconfig', Convert::array2json($this->pretty_checkable_config));
     //allow for not including default styles
     if ($this->config()->get('require_css') == true) {
         Requirements::css(PRETTY_CHECKABLE_FIELD_THIRDPARTY . '/prettyCheckable-2.1.2/dist/prettyCheckable.css');
     }
     Requirements::javascript(PRETTY_CHECKABLE_FIELD_THIRDPARTY . '/prettyCheckable-2.1.2/dist/prettyCheckable.min.js');
     Requirements::javascript(PRETTY_CHECKABLE_FIELD_JAVASCRIPT . '/pretty.checkable.box.field.js');
     return parent::Field($properties);
 }
Ejemplo n.º 3
0
 /**
  * @param array $properties
  *
  * @return string
  */
 public function Field($properties = array())
 {
     if ($this->isReadonly()) {
         $nullableCheckbox = new CheckboxField_Readonly($this->getIsNullId());
     } else {
         $nullableCheckbox = new CheckboxField($this->getIsNullId());
     }
     $nullableCheckbox->setValue(is_null($this->dataValue()));
     return sprintf('%s %s&nbsp;<span>%s</span>', $this->valueField->Field(), $nullableCheckbox->Field(), $this->getIsNullLabel());
 }
Ejemplo n.º 4
0
 public function Field($properties = array())
 {
     Requirements::css(SWITCHFIELD_PATH . '/css/switchfield.css');
     return parent::Field($properties);
 }