function aggregator_form_feed_submit in Drupal 5
Same name and namespace in other branches
- 4 modules/aggregator.module \aggregator_form_feed_submit()
- 6 modules/aggregator/aggregator.admin.inc \aggregator_form_feed_submit()
- 7 modules/aggregator/aggregator.admin.inc \aggregator_form_feed_submit()
Process aggregator_form_feed form submissions. @todo Add delete confirmation dialog.
File
- modules/
aggregator/ aggregator.module, line 498 - Used to aggregate syndicated content (RSS, RDF, and Atom).
Code
function aggregator_form_feed_submit($form_id, $form_values) {
if ($form_values['op'] == t('Delete')) {
$title = $form_values['title'];
// Unset the title:
unset($form_values['title']);
}
aggregator_save_feed($form_values);
menu_rebuild();
if (isset($form_values['fid'])) {
if (isset($form_values['title'])) {
drupal_set_message(t('The feed %feed has been updated.', array(
'%feed' => $form_values['title'],
)));
if (arg(0) == 'admin') {
return 'admin/content/aggregator/';
}
else {
return 'aggregator/sources/' . $form_values['fid'];
}
}
else {
watchdog('aggregator', t('Feed %feed deleted.', array(
'%feed' => $title,
)));
drupal_set_message(t('The feed %feed has been deleted.', array(
'%feed' => $title,
)));
if (arg(0) == 'admin') {
return 'admin/content/aggregator/';
}
else {
return 'aggregator/sources/';
}
}
}
else {
watchdog('aggregator', t('Feed %feed added.', array(
'%feed' => $form_values['title'],
)), WATCHDOG_NOTICE, l(t('view'), 'admin/content/aggregator'));
drupal_set_message(t('The feed %feed has been added.', array(
'%feed' => $form_values['title'],
)));
}
}