function feeds_ui_edit_page

cis7 feeds_ui.admin.inc feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '')
cle7 feeds_ui.admin.inc feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '')
elmsmedia7 feeds_ui.admin.inc feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '')
icor7 feeds_ui.admin.inc feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '')
meedjum_blog7 feeds_ui.admin.inc feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '')
mooc7 feeds_ui.admin.inc feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '')

Edit feed configuration.

2 string references to 'feeds_ui_edit_page'
feeds_ui_menu in sites/all/modules/ulmus/feeds/feeds_ui/feeds_ui.module
Implements hook_menu().
feeds_ui_theme in sites/all/modules/ulmus/feeds/feeds_ui/feeds_ui.module
Implements hook_theme().

File

sites/all/modules/ulmus/feeds/feeds_ui/feeds_ui.admin.inc, line 284
Contains all page callbacks, forms and theming functions for Feeds administrative pages.

Code

function feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '') {

  // Get plugins and configuration.
  $plugins = FeedsPlugin::all();
  $config = $importer->config;
  // Base path for changing the active container.
  $path = 'admin/structure/feeds/' . $importer->id;

  $active_container = array(
    'class' => array('active-container'),
    'actions' => array(l(t('Help'), $path)),
  );
  switch ($active) {
    case 'help':
      $active_container['title'] = t('Getting started');
      $active_container['body'] = '<div class="help feeds-admin-ui">' . feeds_ui_edit_help() . '</div>';
      unset($active_container['actions']);
      break;
    case 'fetcher':
    case 'parser':
    case 'processor':
      $active_container['title'] = t('Select a !plugin_type', array('!plugin_type' => $active));
      $active_container['body'] = drupal_get_form('feeds_ui_plugin_form', $importer, $active);
      break;
    case 'settings':
      drupal_add_js(drupal_get_path('module', 'ctools') . '/js/dependent.js');
      ctools_include('dependent');
      if (empty($plugin_key)) {
        $active_container['title'] = t('Basic settings');
        $active_container['body'] = feeds_get_form($importer, 'configForm');
      }
      // feeds_plugin() returns a correct result because feed has been
      // instantiated previously.
      elseif (in_array($plugin_key, array_keys($plugins)) && $plugin = feeds_plugin($plugin_key, $importer->id)) {
        $active_container['title'] = t('Settings for !plugin', array('!plugin' => $plugins[$plugin_key]['name']));
        $active_container['body'] = feeds_get_form($plugin, 'configForm');
      }
      break;
    case 'mapping':
      $active_container['title'] = t('Mapping for !processor', array('!processor' => $plugins[$config['processor']['plugin_key']]['name']));
      $active_container['body'] = drupal_get_form('feeds_ui_mapping_form', $importer);
      break;
  }

  // Build config info.
  $config_info = $info = array();
  $info['class'] = array('config-set');

  // Basic information.
  $items = array();
  $items[] = t('Attached to: @type', array('@type' => $importer->config['content_type'] ? node_type_get_name($importer->config['content_type']) : t('[none]')));
  if ($importer->config['import_period'] == FEEDS_SCHEDULE_NEVER) {
    $import_period = t('off');
  }
  elseif ($importer->config['import_period'] == 0) {
    $import_period = t('as often as possible');
  }
  else {
    $import_period = t('every !interval', array('!interval' => format_interval($importer->config['import_period'])));
  }
  $items[] = t('Periodic import: !import_period', array('!import_period' => $import_period));
  $items[] = $importer->config['import_on_create'] ? t('Import on submission') : t('Do not import on submission');

  $info['title'] = t('Basic settings');
  $info['body'] = array(
    array(
      'body' => theme('item_list', array('items' => $items)),
      'actions' => array(l(t('Settings'), $path . '/settings')),
    ),
  );
  $config_info[] = $info;

  // Fetcher.
  $fetcher = $plugins[$config['fetcher']['plugin_key']];
  $actions = array();
  if (feeds_get_form($importer->fetcher, 'configForm')) {
    $actions = array(l(t('Settings'), $path . '/settings/' . $config['fetcher']['plugin_key']));
  }
  $info['title'] = t('Fetcher');
  $info['body'] = array(
    array(
      'title' => $fetcher['name'],
      'body' => $fetcher['description'],
      'actions' => $actions,
    ),
  );
  $info['actions'] = array(l(t('Change'), $path . '/fetcher'));
  $config_info[] = $info;

  // Parser.
  $parser = $plugins[$config['parser']['plugin_key']];
  $actions = array();
  if (feeds_get_form($importer->parser, 'configForm')) {
    $actions = array(l(t('Settings'), $path . '/settings/' . $config['parser']['plugin_key']));
  }
  $info['title'] = t('Parser');
  $info['body'] = array(
    array(
      'title' => $parser['name'],
      'body' => $parser['description'],
      'actions' => $actions,
    ),
  );
  $info['actions'] = array(l(t('Change'), $path . '/parser'));
  $config_info[] = $info;

  // Processor.
  $processor = $plugins[$config['processor']['plugin_key']];
  $actions = array();
  if (feeds_get_form($importer->processor, 'configForm')) {
    $actions[] = l(t('Settings'), $path . '/settings/' . $config['processor']['plugin_key']);
  }
  $actions[] = l(t('Mapping'), $path . '/mapping');
  $info['title'] = t('Processor');
  $info['body'] = array(
    array(
      'title' => $processor['name'],
      'body' => $processor['description'],
      'actions' => $actions,
    ),
  );
  $info['actions'] = array(l(t('Change'), $path . '/processor'));
  $config_info[] = $info;

  return theme('feeds_ui_edit_page', array(
    'info' => $config_info,
    'active' => $active_container,
  ));
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.