Inheritance: extends FluidTYPO3\Flux\Form\AbstractFormField, implements FluidTYPO3\Flux\Form\FieldInterface
 /**
  * @return FieldInterface[]
  */
 public function getFormFields()
 {
     $fields = parent::getFormFields();
     $converters = array_values((array) $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['typeConverters']);
     $converters = array_combine($converters, $converters);
     $fields['typeConverter'] = Select::create(array('type' => 'Select'))->setName('typeConverter')->setItems($converters);
     $fields['targetType'] = Input::create(array('type' => 'Input'))->setName('targetType');
     return $fields;
 }
Example #2
0
 /**
  * @return FieldInterface[]
  */
 public function getFormFields()
 {
     $fields = parent::getFormFields();
     $fields['subject'] = Input::create(array('type' => 'Input'))->setName('subject');
     $fields['body'] = Text::create(array('type' => 'Text'))->setName('body');
     $fields['receipent'] = Input::create(array('type' => 'Input'))->setName('recipient');
     $fields['sender'] = Input::create(array('type' => 'Input'))->setName('sender');
     return $fields;
 }
 /**
  * @return FieldInterface[]
  */
 public function getFormFields()
 {
     $fields = parent::getFormFields();
     $extensionNames = array_keys((array) $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions']);
     $extensionNames = array_combine($extensionNames, $extensionNames);
     $fields['extensionName'] = Select::create(array('type' => 'Select'))->setName('extensionName')->setItems($extensionNames);
     $fields['controller'] = Input::create(array('type' => 'Input'))->setName('controller')->setValidate('trim,required');
     $fields['action'] = Input::create(array('type' => 'Input'))->setName('action')->setValidate('trim,required');
     return $fields;
 }
Example #4
0
 /**
  * @return FieldInterface[]
  */
 public function getFormFields()
 {
     $class = get_class($this);
     /** @var Input $labelField */
     $labelField = Input::create(array('type' => 'Input'));
     $labelField->setName('label');
     $labelField->setDefault($this->getLabel());
     /** @var Select $classField */
     $classField = Select::create(array('type' => 'Select'));
     $classField->setName('class');
     $classField->setItems(array($class => $class));
     return array('label' => $labelField, 'class' => $classField);
 }
Example #5
0
 /**
  * @return FieldInterface[]
  */
 public function getFormFields()
 {
     $severities = array(FlashMessage::OK => 'OK', FlashMessage::ERROR => 'ERROR', FlashMessage::NOTICE => 'NOTICE', FlashMessage::WARNING => 'WARNING');
     $fields = parent::getFormFields();
     $fields['message'] = Text::create(array('type' => 'Text'))->setName('message');
     $fields['title'] = Input::create(array('type' => 'Input'))->setName('title');
     /** @var Select $severity */
     $severity = Select::create(array('type' => 'Select'));
     $severity->setName('severity');
     $severity->setItems($severities);
     $severity->setDefault(FlashMessage::OK);
     $fields['severity'] = $severity;
     return $fields;
 }
Example #6
0
 /**
  * @test
  */
 public function canRemoveBadFieldByInstanceWithoutErrorAndReturnFalse()
 {
     $form = $this->getEmptyDummyForm();
     $field = \FluidTYPO3\Flux\Form\Field\Input::create(array('type' => 'Input', 'name' => 'badname'));
     $child = $form->last()->remove($field);
     $this->assertFalse($child);
 }
 /**
  * @test
  * @dataProvider getRemoveInheritedTestValues
  * @param mixed $testValue
  * @param boolean $inherit
  * @param boolean $inheritEmpty
  * @param boolean $expectsOverride
  */
 public function removesInheritedValuesFromFields($testValue, $inherit, $inheritEmpty, $expectsOverride)
 {
     $instance = $this->createInstance();
     $field = Form\Field\Input::create(array('type' => 'Input'));
     $field->setName('test');
     $field->setInherit($inherit);
     $field->setInheritEmpty($inheritEmpty);
     $values = array('foo' => 'bar', 'test' => $testValue);
     $result = $this->callInaccessibleMethod($instance, 'unsetInheritedValues', $field, $values);
     if (TRUE === $expectsOverride) {
         $this->assertEquals($values, $result);
     } else {
         $this->assertEquals(array('foo' => 'bar'), $result);
     }
 }
Example #8
0
 /**
  * @param array $settings
  * @return FieldInterface
  */
 public static function create(array $settings = array())
 {
     return parent::create($settings);
 }
 /**
  * @return FieldInterface[]
  */
 public function getFormFields()
 {
     $class = get_class($this);
     $fields = array('label' => Input::create(array('type' => 'Input'))->setName('label')->setDefault($this->getLabel()), 'class' => Select::create(array('type' => 'Select'))->setName('class')->setItems(array($class => $class)));
     return $fields;
 }