function aggregator_form_category

Form constructor to add/edit/delete aggregator categories.

Parameters

$edit: An associative array containing:

  • title: A string to use for the category title.
  • description: A string to use for the category description.
  • cid: The category ID.

See also

aggregator_form_category_validate()

aggregator_form_category_submit()

Related topics

1 string reference to 'aggregator_form_category'
aggregator_menu in modules/aggregator/aggregator.module
Implements hook_menu().

File

modules/aggregator/aggregator.admin.inc, line 549

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.