You are here

function feeds_ui_create_form in Feeds 6

Same name and namespace in other branches
  1. 8.2 feeds_ui/feeds_ui.admin.inc \feeds_ui_create_form()
  2. 7.2 feeds_ui/feeds_ui.admin.inc \feeds_ui_create_form()
  3. 7 feeds_ui/feeds_ui.admin.inc \feeds_ui_create_form()

Create a new configuration.

Parameters

$form_state: Form API form state array.

$from_importer: FeedsImporter object. If given, form will create a new importer as a copy of $from_importer.

1 string reference to 'feeds_ui_create_form'
feeds_ui_menu in feeds_ui/feeds_ui.module
Implementation of hook_menu().

File

feeds_ui/feeds_ui.admin.inc, line 153
Contains all page callbacks, forms and theming functions for Feeds administrative pages.

Code

function feeds_ui_create_form(&$form_state, $from_importer = NULL) {
  drupal_add_js(drupal_get_path('module', 'feeds_ui') . '/feeds_ui.js');
  $form = array();
  $form['#from_importer'] = $from_importer;
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Name'),
    '#description' => t('A natural name for this configuration. Example: RSS Feed. You can always change this name later.'),
    '#required' => TRUE,
    '#maxlength' => 128,
    '#attributes' => array(
      'class' => 'feed-name',
    ),
  );
  $form['id'] = array(
    '#type' => 'textfield',
    '#title' => t('Machine-readable name'),
    '#description' => t('A unique machine-readable name. Can only contain lowercase letters, numbers, and underscores.'),
    '#required' => TRUE,
    '#maxlength' => 128,
    '#attributes' => array(
      'class' => 'feed-id',
    ),
  );
  $form['description'] = array(
    '#type' => 'textfield',
    '#title' => t('Description'),
    '#description' => t('A description of this configuration.'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Create'),
  );
  return $form;
}