/**
  */
 function setReadonly($bool)
 {
     parent::setReadonly($bool);
     if ($bool) {
         $this->fieldFindBuyable = $this->fieldFindBuyable->performReadonlyTransformation();
         $this->fieldSelectedBuyable = $this->fieldSelectedBuyable->performReadonlyTransformation();
     }
 }
 /**
  * @todo Implement removal of readonly state with $bool=false
  * @todo Set readonly state whenever field is recreated, e.g. in setAllowedCurrencies()
  */
 public function setReadonly($bool)
 {
     parent::setReadonly($bool);
     if ($bool) {
         $this->fieldPageID = $this->fieldPageID->performReadonlyTransformation();
         $this->fieldCustomURL = $this->fieldCustomURL->performReadonlyTransformation();
     }
 }
示例#3
0
 /**
  * @todo Implement removal of readonly state with $bool=false
  * @todo Set readonly state whenever field is recreated, e.g. in setAllowedCurrencies()
  */
 function setReadonly($bool)
 {
     parent::setReadonly($bool);
     if ($bool) {
         $this->fieldAmount = $this->fieldAmount->performReadonlyTransformation();
         $this->fieldCurrency = $this->fieldCurrency->performReadonlyTransformation();
     }
 }
 /**
  * @todo Implement removal of readonly state with $bool=false
  * @todo Set readonly state whenever field is recreated, e.g. in setAllowedCurrencies()
  */
 function setReadonly($bool)
 {
     parent::setReadonly($bool);
     if ($bool) {
         $this->fieldAddress = $this->fieldAddress->performReadonlyTransformation();
         $this->fieldLatitude = $this->fieldLatitude->performReadonlyTransformation();
         $this->fieldLongditude = $this->fieldLongditude->performReadonlyTransformation();
     }
 }
 /**
  * @todo Implement removal of readonly state with $bool=false
  * @todo Set readonly state whenever field is recreated, e.g. in setAllowedCurrencies()
  */
 public function setReadonly($bool)
 {
     parent::setReadonly($bool);
     if ($bool) {
         $this->fieldPageID = $this->fieldPageID->performReadonlyTransformation();
         $this->fieldPageAnchor = $this->fieldPageAnchor->performReadonlyTransformation();
         $this->fieldCustomURL = $this->fieldCustomURL->performReadonlyTransformation();
         $this->fieldShortcode = $this->fieldShortcode->performReadonlyTransformation();
         $this->fieldFileID = $this->fieldFileID->performReadonlyTransformation();
         $this->fieldTitle = $this->fieldTitle->performReadonlyTransformation();
         $this->fieldLinkmode = $this->fieldLinkmode->performReadonlyTransformation();
     }
 }
示例#6
0
 public function performReadonlyTransformation()
 {
     $field = parent::performReadonlyTransformation();
     $field->setValue($this->dataValue());
     $dateFieldConfig = $this->getDateField()->getConfig();
     if ($dateFieldConfig) {
         foreach ($dateFieldConfig as $k => $v) {
             $field->getDateField()->setConfig($k, $v);
         }
     }
     $timeFieldConfig = $this->getTimeField()->getConfig();
     if ($timeFieldConfig) {
         foreach ($timeFieldConfig as $k => $v) {
             $field->getTimeField()->setConfig($k, $v);
         }
     }
     return $field;
 }
示例#7
0
 public function testReadonly()
 {
     $field = new FormField('MyField');
     $field->setReadonly(true);
     $this->assertContains('readonly="readonly"', $field->getAttributesHTML());
     $field->setReadonly(false);
     $this->assertNotContains('readonly="readonly"', $field->getAttributesHTML());
     $this->assertInstanceOf('FormField', $field->performReadonlyTransformation());
     eval("class FormField_Readonly extends FormField {}");
     $this->assertInstanceOf('FormField_Readonly', $field->performReadonlyTransformation());
 }
示例#8
0
 /**
  * Changes this field to the readonly field.
  */
 public function performReadonlyTransformation()
 {
     $copy = parent::performReadonlyTransformation();
     $copy->setKeyField($this->keyField);
     $copy->setLabelField($this->labelField);
     $copy->setSourceObject($this->sourceObject);
     return $copy;
 }