Skip navigation
Help

aggregator_form_category

6 aggregator.admin.inc aggregator_form_category(&$form_state, $edit = array('title' => '', 'description' => '', 'cid' => NULL))
7 aggregator.admin.inc aggregator_form_category($form, &$form_state, $edit = array('title' => '', 'description' => '', 'cid' => NULL))

Form builder; Generate a form to add/edit/delete aggregator categories.

See also

aggregator_form_category_validate()

aggregator_form_category_submit()

Related topics

1 string reference to 'aggregator_form_category'

File

drupal/modules/aggregator/aggregator.admin.inc, line 517
Admin page callbacks for the aggregator module.

Code

function aggregator_form_category($form, &$form_state, $edit = array('title' => '', 'description' => '', 'cid' => NULL)) {
  $form['title'] = array(
    '#type' => 'textfield', 
    '#title' => t('Title'), 
    '#default_value' => $edit['title'], 
    '#maxlength' => 64, 
    '#required' => TRUE,
  );
  $form['description'] = array(
    '#type' => 'textarea', 
    '#title' => t('Description'), 
    '#default_value' => $edit['description'],
  );
  $form['actions'] = array('#type' => 'actions');
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  if ($edit['cid']) {
    $form['actions']['delete'] = array(
      '#type' => 'submit',
      '#value' => t('Delete'),
    );
    $form['cid'] = array(
      '#type' => 'hidden',
      '#value' => $edit['cid'],
    );
  }

  return $form;
}