aggregator_save_category

Versions
4.6 – 7
aggregator_save_category($edit)

▾ 2 functions call aggregator_save_category()

aggregator_admin_edit_category in modules/aggregator.module
Menu callback; displays the category edit form, or saves changes and redirects to the overview page.
aggregator_edit in modules/aggregator.module

Code

modules/aggregator.module, line 605

<?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']);
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.