? cleanup_settings.patch
Index: aggregator/aggregator.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/new_aggregator/aggregator/aggregator.admin.inc,v
retrieving revision 1.5
diff -u -r1.5 aggregator.admin.inc
--- aggregator/aggregator.admin.inc 21 Jul 2008 18:33:26 -0000 1.5
+++ aggregator/aggregator.admin.inc 4 Aug 2008 02:55:47 -0000
@@ -19,56 +19,94 @@
foreach ($parsers as $k => $v) {
$info = module_invoke($v, 'aggregator_parse', 'info');
unset($parsers[$k]);
- $parsers[$v] = $info['title'];
+ $parsers[$v] = $info['title'] . ' ' . $info['description'] .'';
}
$processors = module_implements('aggregator_process');
foreach ($processors as $k => $v) {
$info = module_invoke($v, 'aggregator_process', 'info');
unset($processors[$k]);
- $processors[$v] = $info['title'];
+ $processors[$v] = $info['title'] . ' ' . $info['description'] .'';
}
$form['type'] = array('#type' => 'value', '#value' => $type); // For other modules' form_alter().
- $form['aggregator_feed_' . $type] = array(
- '#type' => 'checkbox',
- '#title' => t('Is a feed content type'),
- '#description' => t('Check if you would like to use this content type for downloading feeds to your site.'),
- '#default_value' => variable_get('aggregator_feed_' . $type, FALSE),
- '#weight' => -15,
- );
- $form['aggregator_parser_' . $type] = array(
- '#type' => 'radios',
- '#title' => t('Parser'),
- '#description' => t('Parsers are responsible for retrieving and parsing feed data.'),
- '#options' => $parsers,
- '#default_value' => variable_get('aggregator_parser_' . $type, array_pop($parsers)),
- );
- $form['aggregator_processor_' . $type] = array(
- '#type' => 'checkboxes',
- '#title' => t('Processors'),
- '#description' => t('Processors act on parsed feed data. Pick the processors suitable for your task.'),
- '#options' => $processors,
- '#default_value' => variable_get('aggregator_processor_' . $type, array_slice($processors, 0, 1)),
- );
- $form['aggregator_deduper_' . $type] = array(
- '#type' => 'hidden',
- '#value' => variable_get('aggregator_deduper_' . $type, array_pop(variable_get('aggregator_processor_' . $type, array_slice($processors, 0, 1)))),
- );
- $form['aggregator_refresh_' . $type] = array(
- '#type' => 'select',
- '#title' => t('Update interval'),
- '#default_value' => variable_get('aggregator_refresh_' . $type, 3600),
- '#options' => $period,
- '#description' => t('The approximate length of time between feed updates. (Requires a correctly configured cron maintenance task.)', array('@cron' => url('admin/reports/status'))),
- );
- $form['modules'] = array();
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Save configuration'),
- );
+
+ if (variable_get('aggregator_feed_' . $type, FALSE)) {
+ $form['status'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Aggregation functionality for this content type'),
+ '#description' => t('Click this button to disable feed aggregation functionality for this content type.'),
+ '#weight' => -15,
+ );
+ $form['status']['disable'] = array(
+ '#type' => 'submit',
+ '#value' => t('Disable'),
+ '#submit' => array('aggregator_settings_form_enable'),
+ );
+ $form['config'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Configuration'),
+ );
+ $form['config']['aggregator_parser_' . $type] = array(
+ '#type' => 'radios',
+ '#title' => t('Parser'),
+ '#description' => t('Parsers retrieve and parse feed data. Choose one suitable for the type of feeds you would like to aggregate.'),
+ '#options' => $parsers,
+ '#default_value' => variable_get('aggregator_parser_' . $type, array_pop(array_flip($parsers))),
+ );
+ $form['config']['aggregator_processor_' . $type] = array(
+ '#type' => 'checkboxes',
+ '#title' => t('Processors'),
+ '#description' => t('Processors act on parsed feed data, for example they store feed items. Pick the processors suitable for your task.'),
+ '#options' => $processors,
+ '#default_value' => variable_get('aggregator_processor_' . $type, array_slice(array_flip($processors), 0, 1)),
+ );
+ $form['config']['aggregator_deduper_' . $type] = array(
+ '#type' => 'hidden',
+ '#value' => variable_get('aggregator_deduper_' . $type, array_pop(variable_get('aggregator_processor_' . $type, array_slice($processors, 0, 1)))),
+ );
+ $form['config']['aggregator_refresh_' . $type] = array(
+ '#type' => 'select',
+ '#title' => t('Update interval'),
+ '#default_value' => variable_get('aggregator_refresh_' . $type, 3600),
+ '#options' => $period,
+ '#description' => t('Approximate time between checking feeds of this content type. Requires a correctly configured cron maintenance task.', array('@cron' => url('admin/reports/status'))),
+ );
+ $form['modules'] = array();
+ $form['submit'] = array(
+ '#type' => 'submit',
+ '#value' => t('Save configuration'),
+ );
+ }
+ else {
+ $form['status'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Aggregation functionality for this content type'),
+ '#description' => t('Click this button to enable feed aggregation functionality for this content type.'),
+ '#weight' => -15,
+ );
+ $form['status']['enable'] = array(
+ '#type' => 'submit',
+ '#value' => t('Enable'),
+ '#submit' => array('aggregator_settings_form_enable'),
+ '#default_value' => TRUE,
+ '#weight' => -15,
+ );
+ }
return $form;
}
/**
+ * Submit handler for enable/disable button.
+ */
+function aggregator_settings_form_enable($form, &$form_state) {
+ if (isset($form_state['values']['disable'])) {
+ variable_set('aggregator_feed_'. $form_state['values']['type'], FALSE);
+ }
+ else if (isset($form_state['values']['enable'])) {
+ variable_set('aggregator_feed_'. $form_state['values']['type'], TRUE);
+ }
+}
+
+/**
* Stores the values in the {variable} table.
*/
function aggregator_settings_form_submit($form, &$form_state) {
Index: aggregator/aggregator.light.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/new_aggregator/aggregator/aggregator.light.inc,v
retrieving revision 1.1
diff -u -r1.1 aggregator.light.inc
--- aggregator/aggregator.light.inc 21 Jul 2008 12:15:44 -0000 1.1
+++ aggregator/aggregator.light.inc 4 Aug 2008 02:55:47 -0000
@@ -101,7 +101,7 @@
case 'info':
return array(
'title' => t('Aggregator Light'),
- 'description' => t('Provides lightweight item processor for Aggregator.'),
+ 'description' => t('Creates lightweight records of feed items.'),
);
}
}
@@ -111,55 +111,53 @@
*/
function _aggregator_light_form_settings(&$form) {
$type = $form['type']['#value'];
- $info = module_invoke('aggregator', 'aggregator_process', 'info');
- $form['modules']['aggregator'] = array(
- '#type' => 'fieldset',
- '#title' => t('Aggregator Light processor settings'),
- '#description' => $info['description'],
- '#collapsible' => TRUE,
- '#collapsed' => !aggregator_is_enabled('aggregator', $type),
- );
- $vocabs = taxonomy_get_vocabularies();
- $vids = array();
- $vids[0] = t('None');
- foreach ($vocabs as $vid => $vocab) {
- $vids[$vid] = $vocab->name;
- }
- $period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 4838400, 9676800), 'format_interval');
- $form['modules']['aggregator']['aggregator_vid_' . $type] = array(
- '#type' => 'select',
- '#title' => t('Vocabulary'),
- '#multiple' => FALSE,
- '#options' => $vids,
- '#description' => t('Select a vocabulary for categorizing feed items.'),
- '#default_value' => variable_get('aggregator_vid_' . $type, 0),
- );
- $form['modules']['aggregator']['aggregator_clear_' . $type] = array(
- '#type' => 'select',
- '#title' => t('Discard items older than'),
- '#default_value' => variable_get('aggregator_clear_' . $type, 9676800),
- '#options' => $period,
- '#description' => t('The length of time to retain feed items before discarding. (Requires a correctly configured cron maintenance task.)', array('@cron' => url('admin/reports/status'))),
- );
- $formats = filter_formats();
- foreach ($formats as $k => $format) {
- $formats[$k] = $format->name;
+ if (variable_get('aggregator_feed_'. $type, FALSE) && aggregator_is_enabled('aggregator', $type)) {
+ $form['modules']['aggregator'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Advanced Aggregator Light settings'),
+ );
+ $vocabs = taxonomy_get_vocabularies();
+ $vids = array();
+ $vids[0] = t('None');
+ foreach ($vocabs as $vid => $vocab) {
+ $vids[$vid] = $vocab->name;
+ }
+ $period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 4838400, 9676800), 'format_interval');
+ $form['modules']['aggregator']['aggregator_vid_' . $type] = array(
+ '#type' => 'select',
+ '#title' => t('Vocabulary'),
+ '#multiple' => FALSE,
+ '#options' => $vids,
+ '#description' => t('Select a vocabulary for categorizing feed items.'),
+ '#default_value' => variable_get('aggregator_vid_' . $type, 0),
+ );
+ $form['modules']['aggregator']['aggregator_clear_' . $type] = array(
+ '#type' => 'select',
+ '#title' => t('Discard items older than'),
+ '#default_value' => variable_get('aggregator_clear_' . $type, 9676800),
+ '#options' => $period,
+ '#description' => t('The length of time to retain feed items before discarding. Requires a correctly configured cron maintenance task.', array('@cron' => url('admin/reports/status'))),
+ );
+ $formats = filter_formats();
+ foreach ($formats as $k => $format) {
+ $formats[$k] = $format->name;
+ }
+ $form['modules']['aggregator']['aggregator_input_filter_' . $type] = array(
+ '#type' => 'select',
+ '#title' => t('Input format for item description'),
+ '#default_value' => variable_get('aggregator_input_filter_' . $type, FILTER_FORMAT_DEFAULT),
+ '#options' => $formats,
+ '#description' => t('Specify here the filter to apply to incoming feed items.'),
+ );
+ $items = array(0 => t('none')) + drupal_map_assoc(array(3, 5, 10, 15, 20, 25), '_aggregator_items');
+ $form['modules']['aggregator']['aggregator_summary_items_' . $type] = array(
+ '#type' => 'select',
+ '#title' => t('Items shown in sources and categories pages') ,
+ '#default_value' => variable_get('aggregator_summary_items_' . $type, 3),
+ '#options' => $items,
+ '#description' => t('Number of feed items displayed in feed and category summary pages.'),
+ );
}
- $form['modules']['aggregator']['aggregator_input_filter_' . $type] = array(
- '#type' => 'select',
- '#title' => t('Input format for item description'),
- '#default_value' => variable_get('aggregator_input_filter_' . $type, FILTER_FORMAT_DEFAULT),
- '#options' => $formats,
- '#description' => t('You can specify here the allowed elements in the feed items.'),
- );
- $items = array(0 => t('none')) + drupal_map_assoc(array(3, 5, 10, 15, 20, 25), '_aggregator_items');
- $form['modules']['aggregator']['aggregator_summary_items_' . $type] = array(
- '#type' => 'select',
- '#title' => t('Items shown in sources and categories pages') ,
- '#default_value' => variable_get('aggregator_summary_items_' . $type, 3),
- '#options' => $items,
- '#description' => t('Number of feed items displayed in feed and category summary pages.'),
- );
}
/**
Index: syndication_parser/syndication_parser.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/new_aggregator/syndication_parser/syndication_parser.module,v
retrieving revision 1.9
diff -u -r1.9 syndication_parser.module
--- syndication_parser/syndication_parser.module 20 Jul 2008 18:06:12 -0000 1.9
+++ syndication_parser/syndication_parser.module 4 Aug 2008 02:55:47 -0000
@@ -74,7 +74,7 @@
case 'info':
return array(
'title' => t('Syndication Parser'),
- 'description' => t('Parser for RSS, Atom and RDF feeds. Mainly based on SimpleXML.'),
+ 'description' => t('Default parser for RSS, Atom and RDF feeds.'),
);
}
}