diff --git a/misc/drupal.css b/misc/drupal.css index 64c789f0909b47d825d9452b7646bd40306ad051..f749d81554e0929e69a156d9e15c9edc12301cfe 100644 --- a/misc/drupal.css +++ b/misc/drupal.css @@ -192,8 +192,15 @@ tr.odd .form-item, tr.even .form-item { /* ** Module specific styles */ -#aggregator .feed img { +#aggregator .feed-source .feed-title { + margin-top: 0; +} +#aggregator .feed-source .feed-image img { + margin-bottom: 0.75em; +} +#aggregator .feed-source .feed-icon { float: right; + display: block; } #aggregator .news-item { clear: both; @@ -206,7 +213,7 @@ tr.odd .form-item, tr.even .form-item { margin-top: 1em; margin-left: 1em; } -#aggregator .news-item .body .feed { +#aggregator .news-item .body .feed-source { font-size: 0.9em; } #aggregator .news-item .title { @@ -234,15 +241,15 @@ tr.odd .form-item, tr.even .form-item { .book .title { font-weight: bold; font-size: 1.3em; - margin-bottom:1em; + margin-bottom: 1em; } .book .tree { - padding-top:1em; + padding-top: 1em; border-top: 1px solid #888; padding-bottom: 1em; } .book .name { - padding-top:1em; + padding-top: 1em; font-weight: bold; font-size: 1em; } diff --git a/modules/aggregator.module b/modules/aggregator.module index e862448447460e0506afcc04ef44db0e367c51f3..bed247589067893c617bd6e8aebdd496bde76121 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -423,7 +423,8 @@ function aggregator_refresh($feed) { } if ($image['LINK'] && $image['URL'] && $image['TITLE']) { - $image = '<a href="'. $image['LINK'] .'"><img src="'. $image['URL'] .'" alt="'. $image['TITLE'] .'" /></a>'; + // 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 = '<a href="'. check_url($image['LINK']) .'" class="feed-image"><img src="'. check_url($image['URL']) .'" alt="'. check_plain($image['TITLE']) .'" /></a>'; } else { $image = NULL; @@ -908,7 +909,7 @@ function aggregator_page_source() { $feed = db_fetch_object(db_query('SELECT * FROM {aggregator_feed} WHERE fid = %d', arg(2))); $info = theme('aggregator_feed', $feed); - return _aggregator_page_list('SELECT * FROM {aggregator_item} WHERE fid = '. $feed->fid .' ORDER BY timestamp DESC, iid DESC', arg(3), "<div class=\"feed\">$info</div>"); + return _aggregator_page_list('SELECT * FROM {aggregator_item} WHERE fid = '. $feed->fid .' ORDER BY timestamp DESC, iid DESC', arg(3), $info); } /** @@ -1148,26 +1149,19 @@ function aggregator_page_categories() { * @ingroup themeable */ function theme_aggregator_feed($feed) { - $output = ''; + $output = '<div class="feed-source">'; + $output .= theme('feed_icon', $feed->url) ."\n"; + $output .= $feed->image . ' <h3 class="feed-title"><a href="'. check_url($feed->link) .'">'. check_plain($feed->title) ."</a></h3>\n"; + $output .= '<div class="feed-description"><em>'. t('Description:') .'</em> '. filter_xss($feed->description) ."</div>\n"; - if ($feed->image) { - $output .= $feed->image; - } - - $output .= $feed->description; - $output .= '<h3>'. t('URL') ."</h3>\n"; - $output .= theme('xml_icon', $feed->url); - $output .= '<a href="'. check_url($feed->link) .'">'. check_plain($feed->link) ."</a>\n"; - $output .= '<h3>'. t('Last update') ."</h3>\n"; $updated = t('%time ago', array('%time' => format_interval(time() - $feed->checked))); - if (user_access('administer news feeds')) { - $output .= l($updated, 'admin/aggregator'); - } - else { - $output .= $updated; + $updated = l($updated, 'admin/aggregator'); } + $output .= '<div class="feed-updated"><em>'. t('Updated:') . "</em> $updated</div>"; + $output .= "</div>\n"; + return $output; } @@ -1214,27 +1208,25 @@ function theme_aggregator_summary_item($item) { * @ingroup themeable */ function theme_aggregator_page_item($item) { - static $last; - - $date = format_date($item->timestamp, 'custom', 'Ymd'); - if ($date != $last) { - $last = $date; - $output .= '<h3>'. format_date($item->timestamp, 'custom', 'F j, Y') ."</h3>\n"; - } - - $output .= "<div class=\"news-item\">\n"; - $output .= ' <div class="date">'. format_date($item->timestamp, 'custom', 'H:i') ."</div>\n"; - $output .= " <div class=\"body\">\n"; $source = ''; if ($item->ftitle && $item->fid) { - $source = '<span class="source">'. l($item->ftitle, "aggregator/sources/$item->fid") .":</span>\n"; + $source = l($item->ftitle, "aggregator/sources/$item->fid", array('class' => 'feed-item-source')) . ' -'; + } + + if (date('Ymd', $item->timestamp) == date('Ymd')) { + $source_date = t('%ago ago', array('%ago' => format_interval(time() - $item->timestamp))); + } + else { + $source_date = format_date($item->timestamp, 'custom', variable_get('date_format_medium', 'D, Y-m-d H:i')); } - $output .= ' <div class="title">'. $source .'<a href="'. check_url($item->link) .'">'. check_plain($item->title) ."</a></div>\n"; + $output .= "<div class=\"feed-item\">\n"; + $output .= '<h3 class="feed-item-title"><a href="'. check_url($item->link) .'">'. check_plain($item->title) ."</a></h3>\n"; + $output .= "<div class=\"feed-item-meta\">$source <span class=\"feed-item-date\">$source_date</span></div>\n"; if ($item->description) { - $output .= ' <div class="description">'. $item->description ."</div>\n"; + $output .= '<div class="feed-item-body">'. filter_xss($item->description) ."</div>\n"; } $result = db_query('SELECT c.title, c.cid FROM {aggregator_category_item} ci LEFT JOIN {aggregator_category} c ON ci.cid = c.cid WHERE ci.iid = %d ORDER BY c.title', $item->iid); @@ -1243,10 +1235,9 @@ function theme_aggregator_page_item($item) { $categories[] = l($category->title, 'aggregator/categories/'. $category->cid); } if ($categories) { - $output .= ' <div class="categories">'. t('Categories') .': '. implode(', ', $categories) ."</div>\n"; + $output .= '<div class="feed-item-categories">'. t('Categories') .': '. implode(', ', $categories) ."</div>\n"; } - $output .= " </div>\n"; $output .= "</div>\n"; return $output; diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index e862448447460e0506afcc04ef44db0e367c51f3..bed247589067893c617bd6e8aebdd496bde76121 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -423,7 +423,8 @@ function aggregator_refresh($feed) { } if ($image['LINK'] && $image['URL'] && $image['TITLE']) { - $image = '<a href="'. $image['LINK'] .'"><img src="'. $image['URL'] .'" alt="'. $image['TITLE'] .'" /></a>'; + // 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 = '<a href="'. check_url($image['LINK']) .'" class="feed-image"><img src="'. check_url($image['URL']) .'" alt="'. check_plain($image['TITLE']) .'" /></a>'; } else { $image = NULL; @@ -908,7 +909,7 @@ function aggregator_page_source() { $feed = db_fetch_object(db_query('SELECT * FROM {aggregator_feed} WHERE fid = %d', arg(2))); $info = theme('aggregator_feed', $feed); - return _aggregator_page_list('SELECT * FROM {aggregator_item} WHERE fid = '. $feed->fid .' ORDER BY timestamp DESC, iid DESC', arg(3), "<div class=\"feed\">$info</div>"); + return _aggregator_page_list('SELECT * FROM {aggregator_item} WHERE fid = '. $feed->fid .' ORDER BY timestamp DESC, iid DESC', arg(3), $info); } /** @@ -1148,26 +1149,19 @@ function aggregator_page_categories() { * @ingroup themeable */ function theme_aggregator_feed($feed) { - $output = ''; + $output = '<div class="feed-source">'; + $output .= theme('feed_icon', $feed->url) ."\n"; + $output .= $feed->image . ' <h3 class="feed-title"><a href="'. check_url($feed->link) .'">'. check_plain($feed->title) ."</a></h3>\n"; + $output .= '<div class="feed-description"><em>'. t('Description:') .'</em> '. filter_xss($feed->description) ."</div>\n"; - if ($feed->image) { - $output .= $feed->image; - } - - $output .= $feed->description; - $output .= '<h3>'. t('URL') ."</h3>\n"; - $output .= theme('xml_icon', $feed->url); - $output .= '<a href="'. check_url($feed->link) .'">'. check_plain($feed->link) ."</a>\n"; - $output .= '<h3>'. t('Last update') ."</h3>\n"; $updated = t('%time ago', array('%time' => format_interval(time() - $feed->checked))); - if (user_access('administer news feeds')) { - $output .= l($updated, 'admin/aggregator'); - } - else { - $output .= $updated; + $updated = l($updated, 'admin/aggregator'); } + $output .= '<div class="feed-updated"><em>'. t('Updated:') . "</em> $updated</div>"; + $output .= "</div>\n"; + return $output; } @@ -1214,27 +1208,25 @@ function theme_aggregator_summary_item($item) { * @ingroup themeable */ function theme_aggregator_page_item($item) { - static $last; - - $date = format_date($item->timestamp, 'custom', 'Ymd'); - if ($date != $last) { - $last = $date; - $output .= '<h3>'. format_date($item->timestamp, 'custom', 'F j, Y') ."</h3>\n"; - } - - $output .= "<div class=\"news-item\">\n"; - $output .= ' <div class="date">'. format_date($item->timestamp, 'custom', 'H:i') ."</div>\n"; - $output .= " <div class=\"body\">\n"; $source = ''; if ($item->ftitle && $item->fid) { - $source = '<span class="source">'. l($item->ftitle, "aggregator/sources/$item->fid") .":</span>\n"; + $source = l($item->ftitle, "aggregator/sources/$item->fid", array('class' => 'feed-item-source')) . ' -'; + } + + if (date('Ymd', $item->timestamp) == date('Ymd')) { + $source_date = t('%ago ago', array('%ago' => format_interval(time() - $item->timestamp))); + } + else { + $source_date = format_date($item->timestamp, 'custom', variable_get('date_format_medium', 'D, Y-m-d H:i')); } - $output .= ' <div class="title">'. $source .'<a href="'. check_url($item->link) .'">'. check_plain($item->title) ."</a></div>\n"; + $output .= "<div class=\"feed-item\">\n"; + $output .= '<h3 class="feed-item-title"><a href="'. check_url($item->link) .'">'. check_plain($item->title) ."</a></h3>\n"; + $output .= "<div class=\"feed-item-meta\">$source <span class=\"feed-item-date\">$source_date</span></div>\n"; if ($item->description) { - $output .= ' <div class="description">'. $item->description ."</div>\n"; + $output .= '<div class="feed-item-body">'. filter_xss($item->description) ."</div>\n"; } $result = db_query('SELECT c.title, c.cid FROM {aggregator_category_item} ci LEFT JOIN {aggregator_category} c ON ci.cid = c.cid WHERE ci.iid = %d ORDER BY c.title', $item->iid); @@ -1243,10 +1235,9 @@ function theme_aggregator_page_item($item) { $categories[] = l($category->title, 'aggregator/categories/'. $category->cid); } if ($categories) { - $output .= ' <div class="categories">'. t('Categories') .': '. implode(', ', $categories) ."</div>\n"; + $output .= '<div class="feed-item-categories">'. t('Categories') .': '. implode(', ', $categories) ."</div>\n"; } - $output .= " </div>\n"; $output .= "</div>\n"; return $output; diff --git a/themes/bluemarine/style.css b/themes/bluemarine/style.css index b19b268dc2fc5b2d7e6a0e305127cc45ba406aa6..b62e2716f9546963060e798274584fabaa1bdcf6 100644 --- a/themes/bluemarine/style.css +++ b/themes/bluemarine/style.css @@ -272,7 +272,7 @@ table { /* ** Module specific styles */ -#aggregator .feed { +#aggregator .feed-source { background-color: #eee; border: 1px solid #ccc; padding: 1em; diff --git a/themes/chameleon/common.css b/themes/chameleon/common.css index 20eef4c528526fc7695033df81cebf3c6a42f09e..8d8041564ab90c9e22c350416c204d8b9a0cefbc 100644 --- a/themes/chameleon/common.css +++ b/themes/chameleon/common.css @@ -145,7 +145,7 @@ br { .form-item textarea { font-size: 1em; } -#aggregator .feed { +#aggregator .feed-source { border: 1px solid gray; padding: 1em; } diff --git a/themes/pushbutton/style.css b/themes/pushbutton/style.css index 389c7bcb09128e6bdc3a30c972b08717652296ec..9f622533962371cad235a1ba0942a85bf7c7b384 100644 --- a/themes/pushbutton/style.css +++ b/themes/pushbutton/style.css @@ -482,7 +482,7 @@ table#footer-menu { .content .active { color: #369; } -#aggregator .feed { +#aggregator .feed-source { background-color: #eee; border: 1px solid #ccc; padding: 1em;