You are here

function feedapi_import_opml in FeedAPI 6

OPML Feed import form, also allows setting defaults to be applied to each feed

1 string reference to 'feedapi_import_opml'
feedapi_menu in ./feedapi.module
Implementation of hook_menu().

File

./feedapi.opml.inc, line 11
OPML import and export for FeedAPI

Code

function feedapi_import_opml($form_state) {
  $form['opml'] = array(
    '#type' => 'file',
    '#title' => t('OPML File'),
    '#size' => 50,
    '#description' => t('Upload an OPML file containing a list of newsfeeds to be imported.'),
  );
  $form['feed_type'] = array(
    '#type' => 'select',
    '#title' => t('Feed Type'),
    '#description' => t("The type of feed you would like to associate this import with."),
    '#options' => feedapi_get_types(),
    '#required' => TRUE,
  );
  $form['override_title'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use TITLE attribute of OPML entries as feed title'),
    '#description' => t('If checked feed title will be overriden with the information from OPML file'),
  );
  $form['override_body'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use TEXT attribute of OPML entries as feed description'),
    '#description' => t('If checked feed description will be overriden with the information from OPML file'),
  );
  $form['#attributes']['enctype'] = 'multipart/form-data';
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Import'),
  );
  if (module_exists('og')) {
    og_form_add_og_audience($form, $form_state);
  }
  return $form;
}