--- /contrib-modules/aggregator2/aggregator2.module	2005-11-14 12:24:18.000000000 -0500
+++ modules/aggregator2/aggregator2.module	2005-11-19 05:46:35.000000000 -0500
@@ -49,6 +49,14 @@
 static $AGGREGATOR2_REFRESH_FEED_RUNNING = FALSE;
 
 /**
+ * Implementation of hook_node_info().
+ */
+function aggregator2_node_info() {
+  return array(	'aggregator2-item' => array('name' => t('aggregator2 news feed item'), 'base' => 'aggregator2'),
+		'aggregator2-feed' => array('name' => t('aggregator2 news feed'), 'base' => 'aggregator2'));
+}
+
+/**
  * Implementation of hook_help().
  */
 function aggregator2_help($section) {
@@ -100,18 +108,6 @@
 }
 
 /**
- * Implementation of hook_node_name().
- */
-function aggregator2_node_name($node) {
-  switch (is_string($node) ? $node : $node->type) {
-    case 'aggregator2-feed':
-      return t('aggregator2 news feed');
-    case 'aggregator2-item':
-      return t('aggregator2 news feed item');
-  }
-}
-
-/**
  * Implementation of hook_access().
  */
 function aggregator2_access($op, $node) {
@@ -149,13 +145,6 @@
 }
 
 /**
- * Implementation of hook_node_types().
- */
-function aggregator2_node_types() {
-  return array('aggregator2-item', 'aggregator2-feed');
-}
-
-/**
  * Implementation of hook_link().
  */
 function aggregator2_link($type, $node = NULL, $teaser = FALSE) {
@@ -217,8 +206,8 @@
       $options = variable_get('aggregator2_feed_defs', array('freezed' => 0, 'update_items' => 1, 'item_status' => 1));
       $node->update_items = $options['update_items'];
       $node->item_status = $options['item_status'];
-      $node->item_delete_mode = $options['item_delete_mode'];
-      $node->clear_items = $options['clear_items'];
+      $node->item_delete_mode_bits = $options['discard']['item_delete_mode_bits'];
+      $node->clear_items = $options['discard']['clear_items'];
       $node->promoted_items = $options['promoted_items'];
       $node->freezed = $options['freezed'];
       $node->change_existing_items = $options['change_existing_items'];
@@ -365,7 +354,7 @@
     $rows[] = array(t('Last checked feed host'), ($node->checked ? t('%time ago', array('%time' => format_interval(time() - $node->checked))) : t('never')) );
     $rows[] = array(t('Time until next refresh'), ($node->checked ? t('%time left', array('%time' => format_interval($node->checked + $node->refresh - time()))) : t('never')) );
 
-    $output .= theme('table', NULL, $rows);
+    $output .= theme('table', array(), $rows);
     $node->body .= $output;
   }
 
@@ -378,20 +367,32 @@
 function aggregator2_form(&$node) {
   $type = ($node->type ? $node->type : arg(2));
 
-  $output .= form_textfield(t('Original author'), 'author', $node->author, 60, 60, NULL, NULL, NULL);
+  $form = array();
+   
+  $form['title'] = array(
+    '#type' => 'textfield', 
+    '#title' => t('Title'), 
+    '#required' => TRUE, 
+    '#default_value' => $node->title
+    );  
 
   if (user_access('administer nodes') && $type == 'aggregator2-feed') {
-    $output .= form_checkbox(t('Freeze'), 'freezed', 1, $node->freezed, t('If set, aggragator2 will not create new items, or update old ones, for this feed.'));
+    $form['freezed'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Freeze'),
+      '#return_value' => 1,
+      '#default_value' => $node->freezed,
+      '#description' => t('If set, aggragator2 will not create new items, or update old ones, for this feed.')
+      );
     if ($node->nid) {
       // "change_existing_items" is not saved anywhere, it's temporary for the time of editing, and saving time
-      $output .= form_checkbox(t('Apply changes to already existing items'), 'change_existing_items', 1, $node->change_existing_items, t('If set, changes to input format and item categories will be applied also to already existing items.'));
-    }
-  }
-
-  if (function_exists('taxonomy_node_form')) {
-    $temp = module_invoke('taxonomy', 'node_form', $type, $node);
-    if (is_array($temp) && count($temp) > 0) {
-      $output .= form_group(t('Categories'), implode('', $temp), t('Select categories to be associated with this feed'));
+      $form['change_existing_items'] = array(
+	'#type' => 'checkbox',
+	'#title' => t('Apply changes to already existing items'),
+	'#return_value' => 1,
+	'#default_value' => $node->change_existing_items,
+	'#description' => t('If set, changes to input format and item categories will be applied also to already existing items.')
+	);
     }
   }
 
@@ -401,73 +402,182 @@
       $node->clear_items = 1000000000;
     }
 
-    $output .= form_textfield(t('URL'), 'url', $node->url, 60, 250, NULL, NULL, TRUE);
-    $output .= form_textfield(t('Image link'), 'image', $node->image, 60, 1024, t('Use only full URL (including "http://" part too) to image so it does not break RSS/ATOM feed compatibility.'), NULL, FALSE);
+    $form['url'] = array(
+      '#type' => 'textfield',
+      '#title' => t('URL'),
+      '#default_value' => $node->url,
+      '#size' => 60,
+      '#maxlength' => 250,
+      '#description' => NULL,
+      '#attributes' => NULL,
+      '#required' => TRUE
+      );
+    $form['image'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Image link'),
+      '#default_value' => $node->image,
+      '#size' => 60,
+      '#maxlength' => 1024,
+      '#description' => t('Use only full URL (including "http://" part too) to image so it does not break RSS/ATOM feed compatibility.'),
+      '#attributes' => NULL,
+      '#required' => FALSE
+      );
 
     $period = drupal_map_assoc(array(900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200), 'format_interval');
-    $output .= form_select(t('Update interval'), 'refresh', $node->refresh, $period, t('The refresh interval indicating how often you want to update this feed. Requires crontab.'));
 
-    if (function_exists('taxonomy_node_form')) {
-      /*
-       * workaround "bug" in taxonomy module - taxonomy_node_form function doesn't care about different name for values
-       * so it always checks $node->taxonomy instead of $node->'name' :(
-       * so just copy part of taxonomy_node_form function here...
-       */
-      $temp = NULL;
-      $c = db_query("SELECT v.*, n.type FROM {vocabulary} v INNER JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE n.type = '%s' ORDER BY v.weight, v.name", 'aggregator2-item');
-      while ($vocabulary = db_fetch_object($c)) {
-        $temp[] = taxonomy_form($vocabulary->vid, $node->feed_item_taxonomy, '', 'feed_item_taxonomy');
-      }
-      if (is_array($temp) && count($temp) > 0) {
-        $output .= form_group(t('Item categories'), implode('', $temp), t('Select categories to be associated with aggregated items'));
-      }
-    }
+    $form['refresh'] = array(
+      '#type' => 'select',
+      '#title' => t('Update interval'),
+      '#default_value' => $node->refresh,
+      '#options' => $period,
+      '#description' => t('The refresh interval indicating how often you want to update this feed. Requires crontab.')
+      );
 
     if (user_access('administer nodes')) {
-      $output .= form_checkbox(t('Update existing items'), 'update_items', 1, $node->update_items, t('If enabled, aggragator2 will update already existing items, overwriting any changes done between cron runs.'));
-      $output .= form_checkbox(t('Publish new items'), 'item_status', 1, $node->item_status, t('If enabled, aggragator2 will mark each new item as published.'));
+      $form['update_items'] = array(
+	'#type' => 'checkbox',
+	'#title' => t('Update existing items'),
+	'#return_value' => 1,
+	'#default_value' => $node->update_items,
+	'#description' => t('If enabled, aggragator2 will update already existing items, overwriting any changes done between cron runs.')
+	);
+      $form['item_status'] = array(
+	'#type' => 'checkbox',
+	'#title' => t('Publish new items'),
+	'#return_value' => 1,
+	'#default_value' => $node->item_status,
+	'#description' => t('If enabled, aggragator2 will mark each new item as published.')
+	);
+
       $temp = array();
       $period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 3628800, 4838400, 7257600, 15724800, 31536000), 'format_interval');
       $period['1000000000'] = t('Never');
-      $temp[] = form_select(t('Discard feed items older than'), 'clear_items', $node->clear_items, $period, t('The time feed items should be kept. Older items will be automatically discarded. Requires crontab.'));
-      $temp[] = form_checkbox(t('Discard only items not published currently'), 'item_delete_mode_bits][1', AGGREGATOR2_ITEM_DELETE_UNPUBLISHED, $node->item_delete_mode & AGGREGATOR2_ITEM_DELETE_UNPUBLISHED);
-      $output .= form_group(t('Discarding items'), implode('', $temp));
+
+      $form['discard'] = array(
+	'#type' => 'fieldset',
+	'#title' => t('Discarding items'),
+        '#collapsible' => TRUE,
+	'#collapsed' => TRUE
+	);
+      $form['discard']['clear_items'] = array(
+	'#type' => 'select',
+	'#title' => t('Discard feed items older than'),
+	'#default_value' => $node->clear_items,
+	'#options' => $period,
+	'#description' => t('The time feed items should be kept. Older items will be automatically discarded. Requires crontab.')
+	);
+      $form['discard']['item_delete_mode_bits']['1'] = array(
+	'#type' => 'checkbox',
+	'#title' => t('Discard only items not published currently'),
+	'#return_value' => AGGREGATOR2_ITEM_DELETE_UNPUBLISHED,
+	'#default_value' => $node->item_delete_mode & AGGREGATOR2_ITEM_DELETE_UNPUBLISHED
+	);
 
       $promoted_count = drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30));
       $promoted_count['0'] = t('None');
       $promoted_count['1000000000'] = t('All');
-      $output .= form_select(t('Promote items'), 'promoted_items', $node->promoted_items, $promoted_count, t('Select how many of aggregated items should be promoted to front page. When new items are created old ones will be taken out from front page.'));
-    }
-
-    $output .= form_select(t('Item date source'), 'item_date_source', $node->item_date_source, array(AGGREGATOR2_ITEM_DATE_SNIFFED => t('Feed'), AGGREGATOR2_ITEM_DATE_CURRENT => t('Current')), t('Select which date will be used for aggregated items. If "Feed" is selected, Aggregator2 module will try to find date in feed, and if not found, current date will be used. If "Current" is selected, date of creation of items will always be set to the one at which items are aggregated.'));
-    $output .= form_select(t('Show "full article"/"source site" link'), 'item_show_link', $node->item_show_link, array(AGGREGATOR2_SHOW_LINK_ALWAYS => t('Always'), AGGREGATOR2_SHOW_LINK_NEVER => t('Do not display'), AGGREGATOR2_SHOW_LINK_TEASER_ONLY => t('Only with teaser'), AGGREGATOR2_SHOW_LINK_PAGE_ONLY => t('Only on full page')), t('Select place(s) where link to full article (for news items) or source site (for news feeds) will be shown.'));
+      $form['promoted_items'] = array(
+	'#type' => 'select',
+	'#title' => t('Promote items'),
+	'#default_value' => $node->promoted_items,
+	'#options' => $promoted_count,
+	'#description' => t('Select how many of aggregated items should be promoted to front page. When new items are created old ones will be taken out from front page.')
+	);
+    }
+
+    $form['item_date_source'] = array(
+      '#type' => 'select',
+      '#title' => t('Item date source'),
+      '#default_value' => $node->item_date_source,
+      '#options' => array(AGGREGATOR2_ITEM_DATE_SNIFFED => t('Feed'), AGGREGATOR2_ITEM_DATE_CURRENT => t('Current')),
+      '#description' => t('Select which date will be used for aggregated items. If "Feed" is selected, Aggregator2 module will try to find date in feed, and if not found, current date will be used. If "Current" is selected, date of creation of items will always be set to the one at which items are aggregated.')
+      );
+    $form['item_show_link'] = array(
+      '#type' => 'select',
+      '#title' => t('Show "full article"/"source site" link'),
+      '#default_value' => $node->item_show_link,
+      '#options' => array(AGGREGATOR2_SHOW_LINK_ALWAYS => t('Always'), AGGREGATOR2_SHOW_LINK_NEVER => t('Do not display'), AGGREGATOR2_SHOW_LINK_TEASER_ONLY => t('Only with teaser'), AGGREGATOR2_SHOW_LINK_PAGE_ONLY => t('Only on full page')),
+      '#description' => t('Select place(s) where link to full article (for news items) or source site (for news feeds) will be shown.')
+      );
   }
   if ($node->nid) {
     if ($type == 'aggregator2-item') {
-      $output .= form_textfield(t('Link'), 'link', $node->link, 60, 250, NULL, NULL, TRUE);
-      $output .= form_select(t('Feed Name'), 'fid', $node->fid, aggregator2_node_list('aggregator2-feed'), t('The RSS feed which this item belongs to.'), 0, FALSE, TRUE);
+      $form['link'] = array(
+	'#type' => 'textfield',
+	'#title' => t('Link'),
+	'#default_value' => $node->link,
+	'#size' => 60,
+	'#maxlength' => 250,
+	'#description' => NULL,
+	'#attributes' => NULL,
+	'#required' => TRUE
+	);
+      $form['fid'] = array(
+	'#type' => 'select',
+	'#title' => t('Feed Name'),
+	'#default_value' => $node->fid,
+	'#options' => aggregator2_node_list('aggregator2-feed'),
+	'#description' => t('The RSS feed which this item belongs to.'),
+	'#extra' => 0,
+	'#multiple' => FALSE,
+	'#required' => TRUE
+	);
     }
   }
-  $output .= form_textarea(t('Description'), 'body', $node->body, 60, 10, t('Leave it blank to allow aggregator2 to use aggregated content for description.'), NULL, TRUE);
-  $output .= filter_form('format', $node->format);
 
-  return $output;
+  $form['body'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Description'),
+    '#default_value' => $node->body,
+    '#cols' => 60,
+    '#rows' => 10,
+    '#description' => '',
+    '#attributes' => NULL,
+    '#required' => TRUE
+    );
+ $form = array_merge($form, filter_form($node->format)); 
+
+  return $form;
 }
 
 /**
  * Implementation of hook_settings().
  */
 function aggregator2_settings() {
-  $output = '';
+  $form = array();
 
-  $output .= form_checkbox(t('Create drupal blocks for each feed'), 'aggregator2_create_feed_blocks', 1, variable_get('aggregator2_create_feed_blocks', 0), t('If enabled, aggragator2 will create block for each feed. Such block still needs to be enabled on '. l('admin/block', 'admin/block') .' page.'));
-  $output .= form_checkbox(t('Show link to feed with each item'), 'aggregator2_show_feed_link', 1, variable_get('aggregator2_show_feed_link', 0), t('If enabled, aggragator2 will show "source" link with each item. It will point to item\'s feed node.'));
-  $output .= form_checkbox(t('Show link to items with each feed'), 'aggregator2_show_item_link', 1, variable_get('aggregator2_show_item_link', 0), t('If enabled, aggragator2 will show "items" link with each feed. It will point to feed node list of all items.'));  
+  $form['aggregator2_create_feed_blocks'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Create drupal blocks for each feed'),
+    '#return_value' => 1,
+    '#default_value' => variable_get('aggregator2_create_feed_blocks', 0),
+    '#description' => t('If enabled, aggragator2 will create block for each feed. Such block still needs to be enabled on '. l('admin/block', 'admin/block') .' page.')
+    );
+  $form['aggregator2_show_feed_link'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Show link to feed with each item'),
+    '#return_value' => 1,
+    '#default_value' => variable_get('aggregator2_show_feed_link', 0),
+    '#description' => t('If enabled, aggragator2 will show "source" link with each item. It will point to item\'s feed node.')
+    );
+  $form['aggregator2_show_item_link'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Show link to items with each feed'),
+    '#return_value' => 1,
+    '#default_value' => variable_get('aggregator2_show_item_link', 0),
+    '#description' => t('If enabled, aggragator2 will show "items" link with each feed. It will point to feed node list of all items.')
+    );
 
   // how many feeds to update at one cron run
   $feed_count = drupal_map_assoc(array(0, 1, 2, 3, 4, 5, 10, 15, 20, 25, 50, 100));
   $feed_count['9999999'] = t('All');
-  $output .= form_select(t('Number of feeds to update at a time'), 'aggregator2_cron_feed_count', variable_get('aggregator2_cron_feed_count', 10), $feed_count, t('Select how many feeds can be updated at one cron run.'));
+  $form['aggregator2_cron_feed_count'] = array(
+    '#type' => 'select',
+    '#title' => t('Number of feeds to update at a time'),
+    '#default_value' => variable_get('aggregator2_cron_feed_count', 10),
+    '#options' => $feed_count,
+    '#description' => t('Select how many feeds can be updated at one cron run.')
+    );
 
   // Globally change settings for all feeds - useful if one wants to change setting without need to edit each feed
   if ($clear_items = variable_get('aggregator2_clear_items', 0)) {
@@ -477,9 +587,22 @@
   $period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 3628800, 4838400, 7257600, 15724800, 31536000), 'format_interval');
   $period['0'] = t('Do not change');
   $period['1000000000'] = t('Never');
-  $output .= form_group(t('Change all news feeds with one click'), form_select(t('Discard feed items older than'), 'aggregator2_clear_items', 0, $period, t('The time feed items should be kept. Older items will be automatically discarded. Requires crontab.')));
 
-  return $output;
+  $form['all_items'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Change all news feeds with one click'),
+    '#collapsible' => TRUE,
+    '#collapsed' => FALSE
+    );
+  $form['all_items']['aggregator2_clear_items'] = array(
+    '#type' => 'select',
+    '#title' => t('Discard feed items older than'),
+    '#default_value' => 0,
+    '#options' => $period,
+    '#description' => t('The time feed items should be kept. Older items will be automatically discarded. Requires crontab.')
+    );
+
+  return $form;
 }
 
 /**
@@ -537,28 +660,43 @@
     case 'settings':
       if ($node->type == 'aggregator2-feed') {
         $options = variable_get('aggregator2_feed_defs', array('freezed' => 0, 'update_items' => 1, 'item_status' => 1));
-        $output = '';
+        $form = array();
 
-        $temp = form_checkbox(t('Freeze'), 'aggregator2_feed_defs][freezed', 1, $options['freezed']);
+	$form['aggregator2_feed_defs'] = array(
+	  '#type' => 'fieldset',
+	  '#title' => t('Default feed options'),
+	  '#collapsible' => TRUE,
+	  '#collapsed' => FALSE
+	  );
+	$form['aggregator2_feed_defs']['freezed'] = array(
+	  '#type' => 'checkbox',
+	  '#title' => t('Freeze'),
+	  '#return_value' => 1,
+	  '#default_value' => $options['freezed']
+	  );
         // "change_existing_items" is not saved anywhere, it's temporary for the time of editing, and saving time
-        $temp .= form_checkbox(t('Apply changes to already existing items after feed is re-edited'), 'aggregator2_feed_defs][change_existing_items', 1, $options['change_existing_items']);
-        $temp .= form_checkbox(t('Update existing items'), 'aggregator2_feed_defs][update_items', 1, $options['update_items']);
-        $temp .= form_checkbox(t('Publish new items'), 'aggregator2_feed_defs][item_status', 1, $options['item_status']);
-        $temp .= form_checkbox(t('Discard only items not published currently'), 'aggregator2_feed_defs][item_delete_mode', 1, $options['item_delete_mode']);
-        $output = form_item(t('Default feed options'), $temp);
-
-        $promoted_count = drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30));
-        $promoted_count['0'] = t('None');
-        $promoted_count['1000000000'] = t('All');
-        $output .= form_select(t('By default promote items'), 'aggregator2_feed_defs][promoted_items', $options['promoted_items'], $promoted_count, t('Select how many of aggregated items should be promoted to front page. When new items are created old ones will be taken out from front page.'));
-
-        $period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 3628800, 4838400, 7257600, 15724800, 31536000), 'format_interval');
-        $period['1000000000'] = t('Never');
-        $output .= form_select(t('By default discard feed items older than'), 'aggregator2_feed_defs][clear_items', $options['clear_items'], $period, t('The time feed items should be kept. Older items will be automatically discarded. Requires crontab.'));
-
-        return $output;
+	$form['aggregator2_feed_defs']['change_existing_items'] = array(
+	  '#type' => 'checkbox',
+	  '#title' => t('Apply changes to already existing items after feed is re-edited'),
+	  '#return_value' => 1,
+	  '#default_value' => $options['change_existing_items']
+	  );
+	$form['aggregator2_feed_defs']['update_items'] = array(
+	  '#type' => 'checkbox',
+	  '#title' => t('Update existing items'),
+	  '#return_value' => 1,
+	  '#default_value' => $options['update_items']
+	  );
+	$form['aggregator2_feed_defs']['item_status'] = array(
+	  '#type' => 'checkbox',
+	  '#title' => t('Publish new items'),
+	  '#return_value' => 1,
+	  '#default_value' => $options['item_status']
+	  );
+          return $form;
       }
       break;
+
     case 'rss item':
       if ($node->type == 'aggregator2-item') {
         return array(array('key' => 'source',
@@ -594,7 +732,7 @@
 
   $result = db_query('SELECT nid FROM {aggregator2_feed} WHERE freezed = 0 AND checked + refresh < %d ORDER BY checked ASC '. $limit, time());
   while ($temp = db_fetch_array($result)) {
-    $feed = node_load(array('nid'=>$temp['nid']));
+    $feed = node_load($temp['nid']);
     // Fake login
     if ($feed->uid != $user->uid) {
       if ($account = user_load(array('uid' => $feed->uid, 'status' => 1))) {
@@ -661,7 +799,7 @@
     $nid = arg(1);
   }
 
-  $feed = node_load(array('nid'=>$nid));
+  $feed = node_load($nid);
   if ($feed->type == 'aggregator2-feed') {
     global $user;
     if ((user_access(AGGREGATOR2_PERM_REFRESH_OWN_FEED) && ($feed->uid == $user->uid)) || user_access('administer nodes')) {
@@ -686,7 +824,7 @@
   $op = $_POST['op'];
   $edit = $_POST['edit'];
 
-  $feed = node_load(array('nid'=>$nid));
+  $feed = node_load($nid);
   if ($feed->type == 'aggregator2-feed') {
     global $user;
     if (!user_access(AGGREGATOR2_PERM_EDIT_OWN_ITEM) || ($user->uid != $feed->uid)) {
@@ -708,7 +846,7 @@
       // Remove each feed item node
       if (is_array($edit['nodes'])) {
         foreach ($edit['nodes'] as $nid => $value) {
-          node_delete(array('nid' => $nid, 'confirm' => 1));
+          node_delete($nid);
         }
       }
 
@@ -749,12 +887,12 @@
   $output = '';
 
   if ($nid) {
-    $feed = node_load(array('nid' => $nid));
+    $feed = node_load($nid);
     if ($feed && $feed->type == 'aggregator2-feed') {
       $output .= node_view($feed, 1);
       $result = pager_query(db_rewrite_sql('SELECT n.nid, n.sticky, n.created FROM {node} n INNER JOIN {aggregator2_item} ai ON ai.nid = n.nid WHERE ai.fid = %d AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC'), variable_get('default_nodes_main', 10), 0, NULL, $feed->nid);
       while ($node = db_fetch_object($result)) {
-        $output .= node_view(node_load(array('nid' => $node->nid)), 1);
+        $output .= node_view(node_load($node->nid), 1);
       }
       $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
     }
@@ -766,12 +904,12 @@
     // If there's no nid given, then show page with feed nodes
     $result = pager_query(db_rewrite_sql('SELECT n.nid, n.sticky, n.created FROM {node} n INNER JOIN {aggregator2_feed} af ON af.nid = n.nid WHERE n.status = 1 ORDER BY n.sticky DESC, n.created DESC'), variable_get('default_nodes_main', 10), 0, NULL);
     while ($node = db_fetch_object($result)) {
-      $output .= node_view(node_load(array('nid' => $node->nid)), 1);
+      $output .= node_view(node_load($node->nid), 1);
     }
     $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
   }
 
-  print theme('page', $output);
+  return $output;
 }
 
 /**
@@ -1443,7 +1581,7 @@
     else {
       $edit = NULL;
       if ($entry && $entry->nid) {
-        $edit = node_load(array('nid'=>$entry->nid));
+        $edit = node_load($entry->nid);
         /*
         ** Taxonomy module doesn't add taxonomy terms at load time... so we have to do it by hand :((
         */
@@ -1523,9 +1661,9 @@
         watchdog('aggregator2', t('Errors in entry %title from %site feed:'."\n".implode("\n", $errors), array('%title' => '<em>'. $node->title .'</em>', '%site' => '<em>'. $feed->title .'</em>')), WATCHDOG_ERROR);
       }
       else {
-        $nid = node_save($node);
-        if ($nid) {
-          if ($nid != $edit->nid) {
+        node_save($node);
+        if ($node->nid) {
+          if ($node->nid != $edit->nid) {
             watchdog('aggregator2', t('%type: added %title from %site feed.', array('%type' => '<em>'. t($node->type) .'</em>', '%title' => '<em>'. $node->title .'</em>', '%site' => '<em>'. $feed->title .'</em>')), WATCHDOG_NOTICE, l(t('view'), "node/$nid"));
           }
           else {
@@ -1552,7 +1690,7 @@
     if (db_num_rows($result)) {
       $items = array();
       while ($item = db_fetch_object($result)) {
-        node_delete(array('nid' => $item->nid, 'confirm' => '1'));
+        node_delete($item->nid);
       }
     }
   }
