function aggregator_categorize_items_submit in Drupal 6
Same name and namespace in other branches
- 7 modules/aggregator/aggregator.pages.inc \aggregator_categorize_items_submit()
Process aggregator_categorize_items form submissions.
1 string reference to 'aggregator_categorize_items_submit'
- aggregator_categorize_items in modules/
aggregator/ aggregator.pages.inc - Form builder; build the page list form.
File
- modules/
aggregator/ aggregator.pages.inc, line 190 - User page callbacks for the aggregator module.
Code
function aggregator_categorize_items_submit($form, &$form_state) {
if (!empty($form_state['values']['categories'])) {
foreach ($form_state['values']['categories'] as $iid => $selection) {
db_query('DELETE FROM {aggregator_category_item} WHERE iid = %d', $iid);
foreach ($selection as $cid) {
if ($cid) {
db_query('INSERT INTO {aggregator_category_item} (cid, iid) VALUES (%d, %d)', $cid, $iid);
}
}
}
}
drupal_set_message(t('The categories have been saved.'));
}