protected function FilterForm::addNewFilter in Feed Import 8
Return new filter elements
Parameters
int $pos: Filter position
array $values: Default filter values
@return array Array containing filter html forms
1 call to FilterForm::addNewFilter()
- FilterForm::buildForm in src/
Form/ FilterForm.php - Form constructor.
File
- src/
Form/ FilterForm.php, line 205 - Contains \Drupal\feed_import\Form\FilterForm
Class
Namespace
Drupal\feed_import\FormCode
protected function addNewFilter($pos = 0, $values = NULL) {
$values['params'] = isset($values['params']) ? $values['params'] : '';
if (is_array($values['params'])) {
$values['params'] = implode(PHP_EOL, $values['params']);
}
return array(
'#attributes' => array(
'class' => array(
'draggable',
),
),
'#weight' => $pos,
'name' => array(
'#type' => 'textfield',
'#size' => 30,
'#default_value' => isset($values['name']) ? $values['name'] : '',
),
'function' => array(
'#type' => 'textfield',
'#size' => 30,
'#default_value' => isset($values['function']) ? $values['function'] : '',
),
'params' => array(
'#type' => 'textarea',
'#default_value' => $values['params'],
'#rows' => 2,
'#cols' => 30,
),
'selected' => array(
'#type' => 'checkbox',
'#default_value' => 0,
),
'weight' => array(
'#type' => 'weight',
'#title' => t('Weight for @title', array(
'@title' => $values['name'],
)),
'#title_display' => 'invisible',
'#default_value' => $pos,
'#attributes' => array(
'class' => array(
'reorder-table-weight',
),
),
),
);
}