commit 2d0e69d9be0380df4ca8712e0b3710c76fc356fa Author: Jen Lampton Date: Sun Mar 10 14:02:34 2013 -0700 updated diff --git a/core/modules/aggregator/aggregator.pages.inc b/core/modules/aggregator/aggregator.pages.inc index 4310d79..2e313e7 100644 --- a/core/modules/aggregator/aggregator.pages.inc +++ b/core/modules/aggregator/aggregator.pages.inc @@ -312,22 +312,27 @@ function theme_aggregator_categorize_items($variables) { /** * Default theme implementation to present a linked feed item for summaries. * + * Default template: aggregator-summary-item.tpl.php + * * @param $variables * An associative array containing: * - item_link: Link to item. * - item_age: Age of the item. - * - * @see template_preprocess() - * @see template_preprocess_aggregator_summary_item() */ -function theme_aggregator_summary_item($variables) { - return $variables['item_url'] . ' ' . $variables['item_age']; +function template_preprocess_aggregator_summary_item(&$variables) { + $variables['url'] = $variables['item_url']; + $variables['age'] = $variables['item_age']; } /** - * Processes variables for aggregator-item.tpl.php. + * Processes variables for aggregator item templates. * - * @see aggregator-item.tpl.php + * Default template: aggregator-item.tpl.php + * + * @param $variables + * An associative array containing: + * - aggregator_item: An individual feed item for display on the aggregator + * page. */ function template_preprocess_aggregator_item(&$variables) { $item = $variables['aggregator_item']; @@ -537,31 +542,30 @@ function aggregator_page_opml($cid = NULL) { * * @ingroup themeable */ -function theme_aggregator_page_opml($variables) { +function template_preprocess_aggregator_page_opml(&$variables) { $feeds = $variables['feeds']; drupal_add_http_header('Content-Type', 'text/xml; charset=utf-8'); - $output = "\n"; - $output .= "\n"; - $output .= "\n"; - $output .= '' . check_plain(config('system.site')->get('name')) . "\n"; - $output .= '' . gmdate(DATE_RFC2822, REQUEST_TIME) . "\n"; - $output .= "\n"; - $output .= "\n"; - foreach ($feeds as $feed) { - $output .= '\n"; - } - $output .= "\n"; - $output .= "\n"; + $variables['title'] = check_plain(config('system.site')->get('name')); + $variables['date'] = gmdate(DATE_RFC2822, REQUEST_TIME); + $variables['feeds'] = array(); - print $output; + foreach ($feeds as $key => $feed) { + $variables['feeds'][$key]['title'] = check_plain($feed->title); + $variables['feeds'][$key]['url'] = check_url($feed->url); + } } /** - * Processes variables for aggregator-summary-items.tpl.php. + * Processes variables for aggregator summary templates. + * + * Default template: aggregator-summary-items.tpl.php * - * @see aggregator-summary-items.tpl.php + * @param array $variables + * An associative array containing: + * - source: Information about the feed source. + * - summary_items: An array of feed items. */ function template_preprocess_aggregator_summary_items(&$variables) { $variables['title'] = check_plain($variables['source'] instanceof EntityInterface ? $variables['source']->label() : $variables['source']->title); @@ -577,9 +581,13 @@ function template_preprocess_aggregator_summary_items(&$variables) { } /** - * Processes variables for aggregator-summary-item.tpl.php. + * Processes variables for aggregator summary item templates. + * + * Default implementation: aggregator-summary-item.tpl.php * - * @see aggregator-summary-item.tpl.php + * @param array $variables + * An associative array containing: + * - aggregator_item: A feed item. */ function template_preprocess_aggregator_summary_item(&$variables) { $item = $variables['aggregator_item']; @@ -600,9 +608,13 @@ function template_preprocess_aggregator_summary_item(&$variables) { } /** - * Processes variables for aggregator-feed-source.tpl.php. + * Processes variables for aggregator feed source templates. + * + * Default template: aggregator-feed-source.tpl.php * - * @see aggregator-feed-source.tpl.php + * @param array $variables + * An associative array containing: + * - aggregator_feed: Information about the feed source. */ function template_preprocess_aggregator_feed_source(&$variables) { $feed = $variables['aggregator_feed']; diff --git a/core/modules/aggregator/templates/aggregator-feed-source.html.twig b/core/modules/aggregator/templates/aggregator-feed-source.html.twig index 12b2e2d..653cd4d 100644 --- a/core/modules/aggregator/templates/aggregator-feed-source.html.twig +++ b/core/modules/aggregator/templates/aggregator-feed-source.html.twig @@ -8,7 +8,7 @@ * * Available variables: * - source_icon: Feed icon linked to the source. Rendered through - * theme_feed_icon(). + * feed-icon.html.twig. * - source_image: Image set by the feed source. * - source_description: Description set by the feed source. * - source_url: URL to the feed source. @@ -16,7 +16,6 @@ * * @see template_preprocess() * @see template_preprocess_aggregator_feed_source() - * @see theme_feed_icon() * * @ingroup themeable */ @@ -28,9 +27,9 @@ {{ source_description }}
- {{ 'URL' | t }}: {{ source_url }} + {{ 'URL'|t }}: {{ source_url }}
- {{ 'Updated' | t }}: + {{ 'Updated'|t }}:
diff --git a/core/modules/aggregator/templates/aggregator-item.html.twig b/core/modules/aggregator/templates/aggregator-item.html.twig index 6751bf9..49ba80f 100644 --- a/core/modules/aggregator/templates/aggregator-item.html.twig +++ b/core/modules/aggregator/templates/aggregator-item.html.twig @@ -19,7 +19,6 @@ */ #}
-

{{ feed_title }}

@@ -39,8 +38,7 @@ {% if categories %}
- {{ 'Categories' | t }}: {{ categories|join(', ') }} + {{ 'Categories'|t }}: {{ categories|join(', ') }}
{% endif %} -
diff --git a/core/modules/aggregator/templates/aggregator-page-opml.html.twig b/core/modules/aggregator/templates/aggregator-page-opml.html.twig new file mode 100644 index 0000000..b72d0d7 --- /dev/null +++ b/core/modules/aggregator/templates/aggregator-page-opml.html.twig @@ -0,0 +1,30 @@ +{# +/** + * @file + * Default theme implementation to present @todo. + * + * Available variables: + * - title: @todo + * - date: @todo + * - feeds: @todo + * - feed.title: @todo + * - feed.url: @todo + * + * @see template_preprocess() + * @see template_preprocess_aggregator_page_opml() + * + * @ingroup themeable + */ +#} + + + + {{ title }} + {{ date }} + + + {% for feed in feeds %} + + {% endfor %} + + diff --git a/core/modules/aggregator/templates/aggregator-summary-item.html.twig b/core/modules/aggregator/templates/aggregator-summary-item.html.twig new file mode 100644 index 0000000..340a1d9 --- /dev/null +++ b/core/modules/aggregator/templates/aggregator-summary-item.html.twig @@ -0,0 +1,16 @@ +{# +/** + * @file + * Default theme implementation for a single feed in a list of feed items. + * + * Available variables: + * - link: Link to item. + * - age: Age of the item. + * + * @see template_preprocess() + * @see template_preprocess_aggregator_summary_item() + * + * @ingroup themeable + */ +#} +{{ url }} {{ age }} \ No newline at end of file diff --git a/core/modules/aggregator/templates/aggregator-summary-items.html.twig b/core/modules/aggregator/templates/aggregator-summary-items.html.twig index 077b017..96462bd 100644 --- a/core/modules/aggregator/templates/aggregator-summary-items.html.twig +++ b/core/modules/aggregator/templates/aggregator-summary-items.html.twig @@ -7,8 +7,8 @@ * * Available variables: * - title: Title of the feed or category. - * - summary_list: Unordered list of linked feed items generated through - * theme_item_list(). + * - summary_list: Unordered list of linked feed items generated with + * item-list.html.teig. * - source_url: URL to the local source or category. * * @see template_preprocess() @@ -20,5 +20,5 @@

{{ title }}

{{ summary_list }} diff --git a/core/modules/aggregator/templates/aggregator-wrapper.html.twig b/core/modules/aggregator/templates/aggregator-wrapper.html.twig index 184d106..81d9a68 100644 --- a/core/modules/aggregator/templates/aggregator-wrapper.html.twig +++ b/core/modules/aggregator/templates/aggregator-wrapper.html.twig @@ -5,11 +5,10 @@ * * Available variables: * - content: All aggregator content. - * - page: Pager links rendered through theme_pager(). + * - page: Pager links rendered with pager.html.twig. * * @see template_preprocess() * @see template_preprocess_aggregator_wrapper() - * @see theme_pager() * * @ingroup themeable */