Same name and namespace in other branches
- 5.x modules/aggregator/aggregator.module \aggregator_form_category_validate()
- 6.x modules/aggregator/aggregator.admin.inc \aggregator_form_category_validate()
- 7.x modules/aggregator/aggregator.admin.inc \aggregator_form_category_validate()
Validate aggregator_form_feed form submissions.
File
- modules/
aggregator.module, line 341 - Used to aggregate syndicated content (RSS, RDF, and Atom).
Code
function aggregator_form_category_validate($form_id, $form_values) {
if ($_POST['op'] == t('Submit')) {
// Check for duplicate titles
if (isset($form_values['cid'])) {
$category = db_fetch_object(db_query("SELECT cid FROM {aggregator_category} WHERE title = '%s' AND cid != %d", $form_values['title'], $form_values['cid']));
}
else {
$category = db_fetch_object(db_query("SELECT cid FROM {aggregator_category} WHERE title = '%s'", $form_values['title']));
}
if ($category) {
form_set_error('title', t('A category named %category already exists. Please enter a unique title.', array(
'%category' => theme('placeholder', $form_values['title']),
)));
}
}
}