You are here

public function ParserBase::feedForm in Feeds XPath Parser 8

File

lib/Drupal/feeds_xpathparser/ParserBase.php, line 328
Contains \Drupal\feeds_xpathparser\ParserBase.

Class

ParserBase
Base class for the HTML and XML parsers.

Namespace

Drupal\feeds_xpathparser

Code

public function feedForm(array $form, array &$form_state, FeedInterface $feed) {
  if (!$this->config['allow_override']) {
    return $form;
  }
  if ($feed_config = $feed
    ->getConfigFor($this)) {
    $form['parser'] = $this
      ->baseForm(array(), $form_state, $feed_config);
  }
  else {
    $form['parser'] = $this
      ->baseForm(array(), $form_state, $this->config);
  }
  $form['parser']['#type'] = 'details';
  $form['parser']['#group'] = 'advanced';
  $form['parser']['#title'] = t('XPath parser');
  $form['parser']['#weight'] = 1000;
  $form['parser']['context']['#parents'] = array(
    'parser',
    'context',
  );
  $form['parser']['sources']['#parents'] = array(
    'parser',
    'sources',
  );
  $form['parser']['raw_xml_settings']['raw_xml']['#parents'] = array(
    'parser',
    'raw_xml',
  );
  $form['parser']['debug']['debug']['#parents'] = array(
    'parser',
    'debug',
  );
  $form['parser']['debug']['errors']['#parents'] = array(
    'parser',
    'errors',
  );
  if (isset($form['parser']['debug']['tidy'])) {
    $form['parser']['debug']['tidy']['#parents'] = array(
      'parser',
      'tidy',
    );
    $form['parser']['debug']['tidy_encoding']['#parents'] = array(
      'parser',
      'tidy_encoding',
    );
  }
  return $form;
}