diff --git a/core/modules/contact/lib/Drupal/contact/CategoryListBuilder.php b/core/modules/contact/lib/Drupal/contact/CategoryListBuilder.php index 37169ff..dcc7889 100644 --- a/core/modules/contact/lib/Drupal/contact/CategoryListBuilder.php +++ b/core/modules/contact/lib/Drupal/contact/CategoryListBuilder.php @@ -32,7 +32,7 @@ public function buildHeader() { * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { - $row['category'] = $this->getLabel($entity); + $row['category'] = $this->l($this->getLabel($entity),'contact.site_page_category', array('contact_category' => $entity->id())); // Special case the personal category. if ($entity->id() == 'personal') { $row['recipients'] = t('Selected user'); @@ -46,4 +46,30 @@ public function buildRow(EntityInterface $entity) { return $row + parent::buildRow($entity); } + /** + * Renders a link to a route given a route name and its parameters. + * + * @see \Drupal\Core\Utility\LinkGeneratorInterface::generate() for details + * on the arguments, usage, and possible exceptions. + * + * @return string + * An HTML string containing a link to the given route and parameters. + */ + protected function l($text, $route_name, array $parameters = array(), array $options = array()) { + return $this->linkGenerator()->generate($text, $route_name, $parameters, $options); + } + + /** + * Returns the link generator. + * + * @return \Drupal\Core\Utility\LinkGeneratorInterface + * The link generator + */ + protected function linkGenerator() { + if (!isset($this->linkGenerator)) { + $this->linkGenerator = \Drupal::linkGenerator(); + } + return $this->linkGenerator; + } + }