You are here

protected function FeedsExXml::configFormTableColumn in Feeds extensible parsers 7

Same name and namespace in other branches
  1. 7.2 src/FeedsExXml.inc \FeedsExXml::configFormTableColumn()

Returns a form element for a specific column.

Parameters

array &$form_state: The current form state.

array $values: The individual source item values.

string $column: The name of the column.

string $machine_name: The machine name of the source.

Return value

array A single form element.

Overrides FeedsExBase::configFormTableColumn

1 call to FeedsExXml::configFormTableColumn()
FeedsExQueryPathXml::configFormTableColumn in src/FeedsExQueryPathXml.inc
Returns a form element for a specific column.
1 method overrides FeedsExXml::configFormTableColumn()
FeedsExQueryPathXml::configFormTableColumn in src/FeedsExQueryPathXml.inc
Returns a form element for a specific column.

File

src/FeedsExXml.inc, line 148
Contains FeedsExXml.

Class

FeedsExXml
Parses XML documents with XPath.

Code

protected function configFormTableColumn(array &$form_state, array $values, $column, $machine_name) {
  $id = 'feeds-ex-xml-raw-' . check_plain($machine_name);
  switch ($column) {
    case 'raw':
      return array(
        '#type' => 'checkbox',
        '#title' => t('Raw value'),
        '#title_display' => 'invisible',
        '#default_value' => (int) (!empty($values['raw'])),
        '#id' => $id,
      );
    case 'inner':
      return array(
        '#type' => 'checkbox',
        '#title' => t('Inner XML'),
        '#title_display' => 'invisible',
        '#default_value' => (int) (!empty($values['inner'])),
        '#states' => array(
          'visible' => array(
            '#' . $id => array(
              'checked' => TRUE,
            ),
          ),
        ),
      );
  }
}