diff --git a/core/modules/node/lib/Drupal/node/NodeListController.php b/core/modules/node/lib/Drupal/node/NodeListController.php index 15b4493..f34e57d 100644 --- a/core/modules/node/lib/Drupal/node/NodeListController.php +++ b/core/modules/node/lib/Drupal/node/NodeListController.php @@ -30,14 +30,7 @@ class NodeListController extends EntityListController { protected $dateService; /** - * The string translation service. - * - * @var \Drupal\Core\StringTranslation\TranslationInterface - */ - protected $translation; - - /** - * Constructs a new DateFormatListController object. + * Constructs a new NodeListController object. * * @param string $entity_type * The type of entity to be listed. @@ -52,11 +45,10 @@ class NodeListController extends EntityListController { * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * The string translation service. */ - public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, ModuleHandlerInterface $module_handler, Date $date_service, TranslationInterface $string_translation) { + public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, ModuleHandlerInterface $module_handler, Date $date_service) { parent::__construct($entity_type, $entity_info, $storage, $module_handler); $this->dateService = $date_service; - $this->translation = $string_translation; } /** @@ -68,8 +60,7 @@ public static function createInstance(ContainerInterface $container, $entity_typ $entity_info, $container->get('entity.manager')->getStorageController($entity_type), $container->get('module_handler'), - $container->get('date'), - $container->get('string_translation') + $container->get('date') ); } @@ -113,7 +104,7 @@ public function buildRow(EntityInterface $entity) { $row['title']['data'] = array( '#type' => 'link', '#title' => $entity->label(), - '#href' => 'node/' . $entity->id(), + '#href' => $entity->uri(), '#options' => $langcode != Language::LANGCODE_NOT_SPECIFIED && isset($languages[$langcode]) ? array('language' => $languages[$langcode]) : array(), '#suffix' => ' ' . drupal_render($mark), ); @@ -139,7 +130,7 @@ public function getOperations(EntityInterface $entity) { if ($entity->isTranslatable()) { $operations['translate'] = array( 'title' => $this->t('Translate'), - 'href' => 'node/' . $entity->id() . '/translations', + 'href' => $entity->uri() . '/translations', ); } @@ -151,13 +142,4 @@ public function getOperations(EntityInterface $entity) { return $operations; } - /** - * Translates a string to the current language or to a given language. - * - * See the $this->t() documentation for details. - */ - protected function t($string, array $args = array(), array $options = array()) { - return $this->translation->translate($string, $args, $options); - } - }