Inheritance: extends BaseControl
Esempio n. 1
0
 /**
  * @return string
  */
 public function getControl($onlyPreview = FALSE)
 {
     if (!$this->isOk()) {
         return NULL;
     }
     $html = Html::el('div');
     $html->addClass('preview-image-container');
     $html->setHtml(Html::el('img')->src($this->getImageClass()->getLink())->height($this->height)->width($this->width));
     return $html . Html::el('div')->setHtml($onlyPreview ? NULL : parent::getControl());
 }
 /**
  * @return string
  */
 public function getControl()
 {
     if (!$this->isOk()) {
         return NULL;
     }
     $html = Html::el('div')->setClass('file-upload-container');
     $file = Html::el('span')->setText(basename($this->file));
     $html->setHtml($file);
     return $html . parent::getControl();
 }
Esempio n. 3
0
 /**
  * @dataProvider dp_testToPropertyValue
  */
 public function testToPropertyValue($value)
 {
     $this->control->expects($this->any())->method('getValue')->will($this->returnValue($value));
     $result = $this->object->toPropertyValue($this->control, $this->metadata);
     $this->assertSame($value, $result);
 }
Esempio n. 4
0
 /**
  * @param  Checkbox $checkbox
  * @return bool
  */
 public static function validateCheckedCount(Checkbox $checkbox)
 {
     return $checkbox->getForm()->isSubmitted()->getParent()->lookupPath(NForm::class) !== 'actions-buttons' || in_array(TRUE, $checkbox->getParent()->getValues(TRUE), TRUE);
 }