function aggregator_form_category
7.x aggregator.admin.inc | aggregator_form_category( |
6.x aggregator.admin.inc | aggregator_form_category(&$form_state, $edit = array('title' => '', 'description' => '', 'cid' => NULL)) |
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 drupal-7.x/
modules/ aggregator/ aggregator.module - Implements hook_menu().
File
- drupal-7.x/
modules/ aggregator/ aggregator.admin.inc, line 549 - Administration 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;
}