Drupal 8.0.0 beta 12. More info: https://www.drupal.org/node/2514176
This commit is contained in:
commit
9921556621
13277 changed files with 1459781 additions and 0 deletions
50
core/modules/aggregator/aggregator.theme.inc
Normal file
50
core/modules/aggregator/aggregator.theme.inc
Normal file
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Preprocessors and theme functions of Aggregator module.
|
||||
*/
|
||||
|
||||
use Drupal\Component\Utility\SafeMarkup;
|
||||
use Drupal\Core\Render\Element;
|
||||
|
||||
/**
|
||||
* Prepares variables for aggregator item templates.
|
||||
*
|
||||
* Default template: aggregator-item.html.twig.
|
||||
*
|
||||
* @param array $variables
|
||||
* An associative array containing:
|
||||
* - elements: An array of elements to display in view mode.
|
||||
*/
|
||||
function template_preprocess_aggregator_item(&$variables) {
|
||||
$item = $variables['elements']['#aggregator_item'];
|
||||
|
||||
// Helpful $content variable for templates.
|
||||
foreach (Element::children($variables['elements']) as $key) {
|
||||
$variables['content'][$key] = $variables['elements'][$key];
|
||||
}
|
||||
|
||||
$variables['url'] = check_url($item->getLink());
|
||||
$variables['title'] = SafeMarkup::checkPlain($item->label());
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares variables for aggregator feed templates.
|
||||
*
|
||||
* Default template: aggregator-feed.html.twig.
|
||||
*
|
||||
* @param array $variables
|
||||
* An associative array containing:
|
||||
* - elements: An array of elements to display in view mode.
|
||||
*/
|
||||
function template_preprocess_aggregator_feed(&$variables) {
|
||||
$feed = $variables['elements']['#aggregator_feed'];
|
||||
|
||||
// Helpful $content variable for templates.
|
||||
foreach (Element::children($variables['elements']) as $key) {
|
||||
$variables['content'][$key] = $variables['elements'][$key];
|
||||
}
|
||||
$variables['full'] = $variables['elements']['#view_mode'] == 'full';
|
||||
$variables['title'] = SafeMarkup::checkPlain($feed->label());
|
||||
}
|
Reference in a new issue