function textimage_preset_edit_validate in Textimage 5
Same name and namespace in other branches
- 5.2 textimage_admin.inc \textimage_preset_edit_validate()
- 6.2 textimage_admin.inc \textimage_preset_edit_validate()
- 7.2 textimage.admin.inc \textimage_preset_edit_validate()
File
- ./
textimage.module, line 506
Code
function textimage_preset_edit_validate($form_id, $form_values) {
// Check for illegal characters in preset names
if (preg_match('/[^0-9a-zA-Z_\\-]/', $form_values['name'])) {
form_set_error('name', t('Please only use alphanumic characters, underscores (_), and hyphens (-) for preset names.'));
}
if ($form_values['preset_id'] == 'new') {
// Check for duplicate preset names
$preset = _textimage_preset_load_by_name($form_values['name']);
if ($preset['name']) {
form_set_error('name', t('The name %name is already in use by another preset.', array(
'%name' => $form_values['name'],
)));
}
}
}