diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2007-03-27 05:13:55 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2007-03-27 05:13:55 +0000 |
commit | f7440d4d73ec57219af232c135be3b2567dda45f (patch) | |
tree | a6b7d947eda1c7bfc2197bfb584f7b17143c97a5 /modules/aggregator | |
parent | f2ca29071fe33603cf22f1603a3e6a61ee9c0814 (diff) | |
download | brdo-f7440d4d73ec57219af232c135be3b2567dda45f.tar.gz brdo-f7440d4d73ec57219af232c135be3b2567dda45f.tar.bz2 |
#130971: Kitchen sink (E_NOTICE compliance / Code style / Bugfix in book toc)
Diffstat (limited to 'modules/aggregator')
-rw-r--r-- | modules/aggregator/aggregator.module | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 1569db535..230810bd6 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -310,7 +310,7 @@ function aggregator_block($op = 'list', $delta = 0, $edit = array()) { /** * Generate a form to add/edit/delete aggregator categories. */ - function aggregator_form_category($edit = array()) { +function aggregator_form_category($edit = array('title' => '', 'description' => '', 'cid' => NULL)) { $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#default_value' => $edit['title'], @@ -392,13 +392,13 @@ function aggregator_form_category_submit($form_id, $form_values) { * Add/edit/delete aggregator categories. */ function aggregator_save_category($edit) { - if ($edit['cid'] && $edit['title']) { + if (!empty($edit['cid']) && !empty($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']) { + else if (!empty($edit['cid'])) { db_query('DELETE FROM {aggregator_category} WHERE cid = %d', $edit['cid']); } - else if ($edit['title']) { + else if (!empty($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']); @@ -408,7 +408,7 @@ function aggregator_save_category($edit) { /** * Generate a form to add/edit feed sources. */ -function aggregator_form_feed($edit = array()) { +function aggregator_form_feed($edit = array('refresh' => 900, 'title' => '', 'url' => '', 'fid' => NULL)) { $period = drupal_map_assoc(array(900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200), 'format_interval'); if ($edit['refresh'] == '') { @@ -568,7 +568,7 @@ function aggregator_remove($feed) { while ($item = db_fetch_object($result)) { $items[] = "iid = $item->iid"; } - if ($items) { + if (!empty($items)) { db_query('DELETE FROM {aggregator_category_item} WHERE '. implode(' OR ', $items)); } db_query('DELETE FROM {aggregator_item} WHERE fid = %d', $feed['fid']); @@ -677,6 +677,7 @@ function aggregator_element_data($parser, $data) { // it or its contents will end up in the item array. break; default: + $channel += array($tag => ''); $channel[$tag] .= $data; } } |