--- aggregator.module.original Sat Apr 29 00:35:03 2006
+++ aggregator.module Tue May 2 09:21:57 2006
@@ -213,6 +213,12 @@ function aggregator_settings() {
'#description' => t('Older news items will be automatically discarded. Requires crontab.')
);
+ $form['aggregator_use_blank'] = array(
+ '#type' => 'checkbox', '#title' => t('Open remote links in a new browser tab/window'),
+ '#default_value' => variable_get('aggregator_use_blank', 'check'),
+ '#description' => t('Setting this will cause remote HREF links to have the target="_blank" inserted')
+ );
+
$form['aggregator_category_selector'] = array(
'#type' => 'radios', '#title' => t('Category selection type'), '#default_value' => variable_get('aggregator_category_selector', 'check'),
'#options' => array('checkboxes' => t('checkboxes'), 'select' => t('multiple selector')),
@@ -735,7 +741,8 @@ function aggregator_refresh($feed) {
if ($image['LINK'] && $image['URL'] && $image['TITLE']) {
// Note, we should really use theme_image() here but that only works with local images it won't work with images fetched with a URL unless PHP version > 5
- $image = '';
+ $target = (variable_get('aggregator_use_blank', 0)) ? ('target="_blank"') : ('');
+ $image = '
';
}
else {
$image = NULL;
@@ -1290,7 +1297,8 @@ function theme_aggregator_block_item($it
}
// Display the external link to the item.
- $output .= ''. check_plain($item->title) ."\n";
+ $target = (variable_get('aggregator_use_blank', 0)) ? ('target="_blank"') : ('');
+ $output .= ''. check_plain($item->title) ."\n";
return $output;
}
@@ -1305,9 +1313,10 @@ function theme_aggregator_block_item($it
* @ingroup themeable
*/
function theme_aggregator_summary_item($item) {
- $output = ''. check_plain($item->title) .' '. t('%age old', array('%age' => format_interval(time() - $item->timestamp))) .'';
+ $target = (variable_get('aggregator_use_blank', 0)) ? ('target="_blank"') : ('');
+ $output = ''. check_plain($item->title) .' '. t('%age old', array('%age' => format_interval(time() - $item->timestamp))) .'';
if ($item->feed_link) {
- $output .= ', '. check_plain($item->feed_title) .'';
+ $output .= ', '. check_plain($item->feed_title) .'';
}
return $output ."\n";
}
@@ -1332,7 +1341,8 @@ function theme_aggregator_page_item($ite
}
$output .= "