Update core 8.3.0
This commit is contained in:
parent
da7a7918f8
commit
cd7a898e66
6144 changed files with 132297 additions and 87747 deletions
|
|
@ -13,35 +13,35 @@ class TourViewBuilder extends EntityViewBuilder {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function viewMultiple(array $entities = array(), $view_mode = 'full', $langcode = NULL) {
|
||||
public function viewMultiple(array $entities = [], $view_mode = 'full', $langcode = NULL) {
|
||||
/** @var \Drupal\tour\TourInterface[] $entities */
|
||||
$build = array();
|
||||
$build = [];
|
||||
foreach ($entities as $entity_id => $entity) {
|
||||
$tips = $entity->getTips();
|
||||
$count = count($tips);
|
||||
$list_items = array();
|
||||
$list_items = [];
|
||||
foreach ($tips as $index => $tip) {
|
||||
if ($output = $tip->getOutput()) {
|
||||
$attributes = array(
|
||||
'class' => array(
|
||||
$attributes = [
|
||||
'class' => [
|
||||
'tip-module-' . Html::cleanCssIdentifier($entity->getModule()),
|
||||
'tip-type-' . Html::cleanCssIdentifier($tip->getPluginId()),
|
||||
'tip-' . Html::cleanCssIdentifier($tip->id()),
|
||||
),
|
||||
);
|
||||
$list_items[] = array(
|
||||
],
|
||||
];
|
||||
$list_items[] = [
|
||||
'output' => $output,
|
||||
'counter' => array(
|
||||
'counter' => [
|
||||
'#type' => 'container',
|
||||
'#attributes' => array(
|
||||
'class' => array(
|
||||
'#attributes' => [
|
||||
'class' => [
|
||||
'tour-progress',
|
||||
),
|
||||
),
|
||||
'#children' => t('@tour_item of @total', array('@tour_item' => $index + 1, '@total' => $count)),
|
||||
),
|
||||
],
|
||||
],
|
||||
'#children' => t('@tour_item of @total', ['@tour_item' => $index + 1, '@total' => $count]),
|
||||
],
|
||||
'#wrapper_attributes' => $tip->getAttributes() + $attributes,
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
// If there is at least one tour item, build the tour.
|
||||
|
|
@ -49,20 +49,20 @@ class TourViewBuilder extends EntityViewBuilder {
|
|||
end($list_items);
|
||||
$key = key($list_items);
|
||||
$list_items[$key]['#wrapper_attributes']['data-text'] = t('End tour');
|
||||
$build[$entity_id] = array(
|
||||
$build[$entity_id] = [
|
||||
'#theme' => 'item_list',
|
||||
'#items' => $list_items,
|
||||
'#list_type' => 'ol',
|
||||
'#attributes' => array(
|
||||
'#attributes' => [
|
||||
'id' => 'tour',
|
||||
'class' => array(
|
||||
'class' => [
|
||||
'hidden',
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
'#cache' => [
|
||||
'tags' => $entity->getCacheTags(),
|
||||
],
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
// If at least one tour was built, attach the tour library.
|
||||
|
|
|
|||
Reference in a new issue