aggregator_save_category

  1. drupal
    1. 4.7
    2. 5 aggregator.module
    3. 6 aggregator.module
    4. 7 aggregator.module
Versions
4.7 – 7 aggregator_save_category($edit)

Add/edit/delete aggregator categories.

▾ 1 function calls aggregator_save_category()

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

Code

modules/aggregator.module, line 399

<?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']);
  }
}
?>