diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php index a89f5c4..cc0d83e 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php @@ -7,14 +7,55 @@ namespace Drupal\views_ui; +use Drupal\Component\Plugin\PluginManagerInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Config\Entity\ConfigEntityListController; +use Drupal\Core\Entity\EntityControllerInterface; use Drupal\views\Views; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * Provides a listing of Views. */ -class ViewListController extends ConfigEntityListController { +class ViewListController extends ConfigEntityListController implements EntityControllerInterface { + + /** + * The views display plugin manager to use. + * + * @var \Drupal\Component\Plugin\PluginManagerInterface + */ + protected $displayManager; + + /** + * {@inheritdoc} + */ + public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + return new static( + $entity_type, + $container->get('plugin.manager.entity')->getStorageController($entity_type), + $entity_info, + $container->get('plugin.manager.views.display') + ); + } + + /** + * Constructs a new EntityListController object. + * + * @param string $entity_type. + * The type of entity to be listed. + * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage. + * The entity storage controller class. + * @param array $entity_info + * An array of entity info for this entity type. + * @param \Drupal\Component\Plugin\PluginManagerInterface $display_manager + * The views display plugin manager to use. + */ + public function __construct($entity_type, EntityStorageControllerInterface $storage, $entity_info, PluginManagerInterface $display_manager) { + $this->entityType = $entity_type; + $this->storage = $storage; + $this->entityInfo = $entity_info; + $this->displayManager = $display_manager; + } /** * Overrides Drupal\Core\Entity\EntityListController::load(); @@ -163,7 +204,7 @@ public function render() { * @return array * An array of display types that this view includes. */ - public function getDisplaysList($view) { + protected function getDisplaysList($view) { $manager = Views::pluginManager('display'); $displays = array(); foreach ($view->get('display') as $display) { diff --git a/core/modules/views_ui/views_ui.theme.inc b/core/modules/views_ui/views_ui.theme.inc index bd5bed2..8e503fc 100644 --- a/core/modules/views_ui/views_ui.theme.inc +++ b/core/modules/views_ui/views_ui.theme.inc @@ -92,7 +92,7 @@ function template_preprocess_views_ui_display_tab_bucket(&$variables) { * Implements hook_preprocess_HOOK() for theme_views_ui_view_info(). */ function template_preprocess_views_ui_view_info(&$variables) { - $variables['label'] = $variables['view']->label(); + $variables['title'] = $variables['view']->label(); $variables['displays'] = empty($variables['displays']) ? t('None') : format_plural(count($variables['displays']), 'Display', 'Displays') . ': ' . '' . implode(', ', $variables['displays']) . ''; } @@ -101,7 +101,7 @@ function template_preprocess_views_ui_view_info(&$variables) { */ function theme_views_ui_view_info($variables) { $output = ''; - $output .= '

' . $variables['label'] . "

\n"; + $output .= '

' . $variables['title'] . "

\n"; $output .= '
' . $variables['displays'] . "
\n"; return $output; }