function name_custom_formats_form in Name Field 6
Same name and namespace in other branches
- 7 name.admin.inc \name_custom_formats_form()
Form callback to edit or add a new custom name format.
2 string references to 'name_custom_formats_form'
- name_custom_format_edit in ./
name.admin.inc - Page to edit a custom format.
- name_menu in ./
name.module - Implementation of hook_menu().
File
- ./
name.admin.inc, line 153 - General administration functions.
Code
function name_custom_formats_form($form_state, $edit = array()) {
$edit += array(
'ncfid' => NULL,
'name' => '',
'machine_name' => '',
'format' => '',
);
$form = array();
$form['ncfid'] = array(
'#type' => 'value',
'#value' => $edit['ncfid'],
);
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Name'),
'#default_value' => $edit['name'],
'#maxlength' => 255,
'#required' => TRUE,
);
$form['machine_name'] = array(
'#title' => t('Machine readable name'),
'#description' => t('The unique machine readable name for this format. This can only contain lowercase letters, numbers and underscores. The keyword %default is reserved for internal usage.', array(
'%default' => 'default',
)),
'#type' => 'textfield',
'#required' => TRUE,
'#default_value' => $edit['machine_name'],
);
$form['format'] = array(
'#type' => 'textfield',
'#title' => t('Format'),
'#default_value' => $edit['format'],
'#maxlength' => 255,
'#required' => TRUE,
);
$form['name_format_help'] = _name_get_name_format_help_form();
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
if (!empty($edit['ncfid'])) {
$form['delete'] = array(
'#type' => 'submit',
'#value' => t('Delete'),
);
}
return $form;
}