function mailing_list_form in Mailing List 6
Same name and namespace in other branches
- 7 mailing_list.admin.inc \mailing_list_form()
Form for adding / renaming a mailing list.
1 string reference to 'mailing_list_form'
- mailing_list_menu in ./
mailing_list.module - Implementation of hook_menu().
File
- ./
mailing_list.admin.inc, line 80 - Mailing list admin UI.
Code
function mailing_list_form(&$form_state, $list = null) {
if (empty($list)) {
drupal_set_title(t('Add mailing list'));
}
else {
drupal_set_title(t('Edit mailing list'));
}
$form = array();
if (isset($form_state['values']['mlid']) || isset($list)) {
$form['mlid'] = array(
'#type' => 'hidden',
'#value' => isset($form_state['values']['mlid']) ? $form_state['values']['mlid'] : isset($list) ? $list->mlid : null,
);
}
$form['name'] = array(
'#title' => t('List name'),
'#type' => 'textfield',
'#required' => TRUE,
'#default_value' => isset($form_state['values']['name']) ? $form_state['values']['name'] : isset($list) ? $list->name : '',
);
$form['submit'] = array(
'#value' => t('Save'),
'#type' => 'submit',
'#submit' => array(
'mailing_list_form_submit',
),
);
$form['#redirect'] = 'admin/build/mailing-list';
return $form;
}