function aggregator_categorize_items_submit

7.x aggregator.pages.inc aggregator_categorize_items_submit($form, &$form_state)
6.x aggregator.pages.inc aggregator_categorize_items_submit($form, &$form_state)

Process aggregator_categorize_items form submissions.

1 string reference to 'aggregator_categorize_items_submit'
aggregator_categorize_items in drupal-6.x/modules/aggregator/aggregator.pages.inc
Form builder; build the page list form.

File

drupal-6.x/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.'));
}