aggregator_save_category

Versions
5 – 7
aggregator_save_category($edit)

Add/edit/delete aggregator categories.

▾ 1 function calls aggregator_save_category()

aggregator_form_category_submit in 5/modules/aggregator/aggregator.module
Process aggregator_form_category form submissions. @todo Add delete confirmation dialog.

Code

5/modules/aggregator/aggregator.module, line 400

<?php
function aggregator_save_category($edit) {
  if ($edit['cid'] && $edit['title']) {
    db_query("UPDATE {aggregator_category} SET title = '%s', description = '%s' WHERE cid = %d", $edit['title'], $edit['description'], $edit['cid']);
  }
  else if ($edit['cid']) {
    db_query('DELETE FROM {aggregator_category} WHERE cid = %d', $edit['cid']);
  }
  else if ($edit['title']) {
    // A single unique id for bundles and feeds, to use in blocks
    $next_id = db_next_id('{aggregator_category}_cid');
    db_query("INSERT INTO {aggregator_category} (cid, title, description, block) VALUES (%d, '%s', '%s', 5)", $next_id, $edit['title'], $edit['description']);
  }
}
?>