Commit 53e5a482 authored by webchick's avatar webchick

Issue #1783196 by dawehner, damiankloip, tim.plunkett: Get the views plugin...

Issue #1783196 by dawehner, damiankloip, tim.plunkett: Get the views plugin manager from the DIC when possible.
parent 396a6475
...@@ -22,6 +22,7 @@ function comment_views_data() { ...@@ -22,6 +22,7 @@ function comment_views_data() {
'access query tag' => 'comment_access', 'access query tag' => 'comment_access',
); );
$data['comment']['table']['entity type'] = 'comment'; $data['comment']['table']['entity type'] = 'comment';
$data['comment']['table']['wizard_id'] = 'comment';
// Fields // Fields
......
...@@ -27,6 +27,7 @@ function file_views_data() { ...@@ -27,6 +27,7 @@ function file_views_data() {
), ),
); );
$data['file_managed']['table']['entity type'] = 'file'; $data['file_managed']['table']['entity type'] = 'file';
$data['file_managed']['table']['wizard_id'] = 'file_managed';
// fid // fid
$data['file_managed']['fid'] = array( $data['file_managed']['fid'] = array(
......
...@@ -30,6 +30,7 @@ function node_views_data() { ...@@ -30,6 +30,7 @@ function node_views_data() {
), ),
); );
$data['node']['table']['entity type'] = 'node'; $data['node']['table']['entity type'] = 'node';
$data['node']['table']['wizard_id'] = 'node';
// node table -- fields // node table -- fields
...@@ -422,6 +423,8 @@ function node_views_data() { ...@@ -422,6 +423,8 @@ function node_views_data() {
// have a group defined will go into this field by default. // have a group defined will go into this field by default.
$data['node_revision']['table']['entity type'] = 'node'; $data['node_revision']['table']['entity type'] = 'node';
$data['node_revision']['table']['group'] = t('Content revision'); $data['node_revision']['table']['group'] = t('Content revision');
$data['node_revision']['table']['wizard_id'] = 'node_revision';
// Advertise this table as a possible base table // Advertise this table as a possible base table
$data['node_revision']['table']['base'] = array( $data['node_revision']['table']['base'] = array(
......
...@@ -105,6 +105,8 @@ function taxonomy_views_data() { ...@@ -105,6 +105,8 @@ function taxonomy_views_data() {
'access query tag' => 'term_access', 'access query tag' => 'term_access',
); );
$data['taxonomy_term_data']['table']['entity type'] = 'taxonomy_term'; $data['taxonomy_term_data']['table']['entity type'] = 'taxonomy_term';
$data['taxonomy_term_data']['table']['wizard_id'] = 'taxonomy_term';
// The term data table // The term data table
$data['taxonomy_term_data']['table']['join'] = array( $data['taxonomy_term_data']['table']['join'] = array(
......
...@@ -24,6 +24,7 @@ function user_views_data() { ...@@ -24,6 +24,7 @@ function user_views_data() {
'access query tag' => 'user_access', 'access query tag' => 'user_access',
); );
$data['users']['table']['entity type'] = 'user'; $data['users']['table']['entity type'] = 'user';
$data['users']['table']['wizard_id'] = 'user';
// uid // uid
$data['users']['uid'] = array( $data['users']['uid'] = array(
......
...@@ -224,7 +224,7 @@ public function addDisplay($plugin_id = 'page', $title = NULL, $id = NULL) { ...@@ -224,7 +224,7 @@ public function addDisplay($plugin_id = 'page', $title = NULL, $id = NULL) {
return FALSE; return FALSE;
} }
$plugin = views_get_plugin_definition('display', $plugin_id); $plugin = drupal_container()->get('plugin.manager.views.display')->getDefinition($plugin_id);
if (empty($plugin)) { if (empty($plugin)) {
$plugin['title'] = t('Broken'); $plugin['title'] = t('Broken');
} }
......
<?php
/**
* @file
* Definition of Drupal\views\Plugin\Type\DefaultWizardDeriver.
*/
namespace Drupal\views\Plugin\Type;
use Drupal\Component\Plugin\Derivative\DerivativeInterface;
/**
* A derivative class which provides automatic wizards for all base tables.
*/
class DefaultWizardDeriver implements DerivativeInterface {
/**
* Stores all base table plugin information.
*
* @var array
*/
protected $derivatives = array();
/**
* Implements Drupal\Component\Plugin\Derivative\DerivativeInterface::getDerivativeDefinition().
*/
public function getDerivativeDefinition($derivative_id, array $base_plugin_definition) {
if (!empty($this->derivatives) && !empty($this->derivatives[$derivative_id])) {
return $this->derivatives[$derivative_id];
}
$this->getDerivativeDefinitions($base_plugin_definition);
return $this->derivatives[$derivative_id];
}
/**
* Implements Drupal\Component\Plugin\Derivative\DerivativeInterface::getDerivativeDefinitions().
*/
public function getDerivativeDefinitions(array $base_plugin_definition) {
$base_tables = array_keys(views_fetch_base_tables());
$this->derivatives = array();
foreach ($base_tables as $table) {
$views_info = views_fetch_data($table);
if (empty($views_info['table']['wizard_id'])) {
$this->derivatives[$table] = array(
'id' => 'standard',
'base_table' => $table,
'title' => $views_info['table']['base']['title'],
'class' => 'Drupal\views\Plugin\views\wizard\Standard'
);
}
}
return $this->derivatives;
}
}
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
namespace Drupal\views\Plugin\Type; namespace Drupal\views\Plugin\Type;
use Drupal\Component\Plugin\PluginManagerBase; use Drupal\Component\Plugin\PluginManagerBase;
use Drupal\Component\Plugin\Factory\DefaultFactory; use Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator;
use Drupal\Component\Plugin\Discovery\ProcessDecorator; use Drupal\Component\Plugin\Discovery\ProcessDecorator;
use Drupal\Component\Plugin\Factory\DefaultFactory;
use Drupal\Core\Plugin\Discovery\AlterDecorator; use Drupal\Core\Plugin\Discovery\AlterDecorator;
use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery; use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery;
use Drupal\Core\Plugin\Discovery\CacheDecorator; use Drupal\Core\Plugin\Discovery\CacheDecorator;
...@@ -23,6 +24,7 @@ public function __construct() { ...@@ -23,6 +24,7 @@ public function __construct() {
$this->discovery = new AnnotatedClassDiscovery('views', 'wizard'); $this->discovery = new AnnotatedClassDiscovery('views', 'wizard');
$this->discovery = new AlterDecorator($this->discovery, 'views_plugins_wizard'); $this->discovery = new AlterDecorator($this->discovery, 'views_plugins_wizard');
$this->discovery = new ProcessDecorator($this->discovery, array($this, 'processDefinition')); $this->discovery = new ProcessDecorator($this->discovery, array($this, 'processDefinition'));
$this->discovery = new DerivativeDiscoveryDecorator($this->discovery);
$this->discovery = new CacheDecorator($this->discovery, 'views:wizard', 'views_info'); $this->discovery = new CacheDecorator($this->discovery, 'views:wizard', 'views_info');
$this->factory = new DefaultFactory($this); $this->factory = new DefaultFactory($this);
$this->defaults = array( $this->defaults = array(
......
...@@ -301,7 +301,7 @@ public function buildOptionsForm(&$form, &$form_state) { ...@@ -301,7 +301,7 @@ public function buildOptionsForm(&$form, &$form_state) {
), ),
); );
$plugins = views_get_plugin_definitions('argument_validator'); $plugins = drupal_container()->get('plugin.manager.views.argument_validator')->getDefinitions();
foreach ($plugins as $id => $info) { foreach ($plugins as $id => $info) {
if (!empty($info['no_ui'])) { if (!empty($info['no_ui'])) {
continue; continue;
...@@ -496,7 +496,7 @@ function default_actions($which = NULL) { ...@@ -496,7 +496,7 @@ function default_actions($which = NULL) {
* default action is set to provide default argument. * default action is set to provide default argument.
*/ */
function default_argument_form(&$form, &$form_state) { function default_argument_form(&$form, &$form_state) {
$plugins = views_get_plugin_definitions('argument_default'); $plugins = drupal_container()->get('plugin.manager.views.argument_default')->getDefinitions();
$options = array(); $options = array();
$form['default_argument_skip_url'] = array( $form['default_argument_skip_url'] = array(
...@@ -560,7 +560,7 @@ function default_argument_form(&$form, &$form_state) { ...@@ -560,7 +560,7 @@ function default_argument_form(&$form, &$form_state) {
* default action is set to display one. * default action is set to display one.
*/ */
function default_summary_form(&$form, &$form_state) { function default_summary_form(&$form, &$form_state) {
$style_plugins = views_get_plugin_definitions('style'); $style_plugins = drupal_container()->get('plugin.manager.views.style')->getDefinitions();
$summary_plugins = array(); $summary_plugins = array();
$format_options = array(); $format_options = array();
foreach ($style_plugins as $key => $plugin) { foreach ($style_plugins as $key => $plugin) {
...@@ -1053,7 +1053,7 @@ function get_plugin($type = 'argument_default', $name = NULL) { ...@@ -1053,7 +1053,7 @@ function get_plugin($type = 'argument_default', $name = NULL) {
$options = $this->options[$options_name]; $options = $this->options[$options_name];
} }
$plugin = views_get_plugin($type, $name); $plugin = drupal_container()->get("plugin.manager.views.$type")->createInstance($name);
if ($plugin) { if ($plugin) {
// Style plugins expects different parameters as argument related plugins. // Style plugins expects different parameters as argument related plugins.
if ($type == 'style') { if ($type == 'style') {
......
...@@ -105,8 +105,9 @@ public function init(ViewExecutable $view, &$display, $options = NULL) { ...@@ -105,8 +105,9 @@ public function init(ViewExecutable $view, &$display, $options = NULL) {
$this->extender = array(); $this->extender = array();
$extenders = views_get_enabled_display_extenders(); $extenders = views_get_enabled_display_extenders();
if (!empty($extenders)) { if (!empty($extenders)) {
$manager = drupal_container()->get('plugin.manager.views.display_extender');
foreach ($extenders as $extender) { foreach ($extenders as $extender) {
$plugin = views_get_plugin('display_extender', $extender); $plugin = $manager->createInstance($extender);
if ($plugin) { if ($plugin) {
$plugin->init($this->view, $this); $plugin->init($this->view, $this);
$this->extender[$extender] = $plugin; $this->extender[$extender] = $plugin;
......
...@@ -61,7 +61,7 @@ public function executeHookMenu($callbacks) { ...@@ -61,7 +61,7 @@ public function executeHookMenu($callbacks) {
$access_plugin = $this->getPlugin('access'); $access_plugin = $this->getPlugin('access');
if (!isset($access_plugin)) { if (!isset($access_plugin)) {
$access_plugin = views_get_plugin('access', 'none'); $access_plugin = drupal_container()->get("plugin.manager.views.access")->createInstance('none');
} }
// Get access callback might return an array of the callback + the dynamic arguments. // Get access callback might return an array of the callback + the dynamic arguments.
......
<?php
/**
* @file
* Definition of Drupal\views\Plugin\views\wizard\Standard.
*/
namespace Drupal\views\Plugin\views\wizard;
use Drupal\Core\Annotation\Plugin;
/**
* @Plugin(
* id = "standard",
* derivative = "Drupal\views\Plugin\Type\DefaultWizardDeriver"
* )
*/
class Standard extends WizardPluginBase {
}
...@@ -507,9 +507,7 @@ public static function getSelected($form_state, $parents, $default_value, $eleme ...@@ -507,9 +507,7 @@ public static function getSelected($form_state, $parents, $default_value, $eleme
protected function build_form_style(array &$form, array &$form_state, $type) { protected function build_form_style(array &$form, array &$form_state, $type) {
$style_form =& $form['displays'][$type]['options']['style']; $style_form =& $form['displays'][$type]['options']['style'];
$style = $style_form['style_plugin']['#default_value']; $style = $style_form['style_plugin']['#default_value'];
// @fixme $style_plugin = drupal_container()->get("plugin.manager.views.style")->createInstance($style);
$style_plugin = views_get_plugin('style', $style);
if (isset($style_plugin) && $style_plugin->usesRowPlugin()) { if (isset($style_plugin) && $style_plugin->usesRowPlugin()) {
$options = $this->row_style_options(); $options = $this->row_style_options();
$style_form['row_plugin'] = array( $style_form['row_plugin'] = array(
...@@ -690,7 +688,7 @@ protected function build_display_options($form, $form_state) { ...@@ -690,7 +688,7 @@ protected function build_display_options($form, $form_state) {
protected function alter_display_options(&$display_options, $form, $form_state) { protected function alter_display_options(&$display_options, $form, $form_state) {
foreach ($display_options as $display_type => $options) { foreach ($display_options as $display_type => $options) {
// Allow style plugins to hook in and provide some settings. // Allow style plugins to hook in and provide some settings.
$style_plugin = views_get_plugin('style', $options['style']['type']); $style_plugin = drupal_container()->get("plugin.manager.views.style")->createInstance($options['style']['type']);
$style_plugin->wizard_submit($form, $form_state, $this, $display_options, $display_type); $style_plugin->wizard_submit($form, $form_state, $this, $display_options, $display_type);
} }
} }
...@@ -840,7 +838,7 @@ protected function default_display_filters_user(array $form, array &$form_state) ...@@ -840,7 +838,7 @@ protected function default_display_filters_user(array $form, array &$form_state)
$table_data = views_fetch_data($table); $table_data = views_fetch_data($table);
// If the 'in' operator is being used, map the values to an array. // If the 'in' operator is being used, map the values to an array.
$handler = $table_data[$bundle_key]['filter']['id']; $handler = $table_data[$bundle_key]['filter']['id'];
$handler_definition = views_get_plugin_definition('filter', $handler); $handler_definition = drupal_container()->get('plugin.manager.views.filter')->getDefinition($handler);
if ($handler == 'in_operator' || is_subclass_of($handler_definition['class'], 'Drupal\\views\\Plugin\\views\\filter\\InOperator')) { if ($handler == 'in_operator' || is_subclass_of($handler_definition['class'], 'Drupal\\views\\Plugin\\views\\filter\\InOperator')) {
$value = drupal_map_assoc(array($form_state['values']['show']['type'])); $value = drupal_map_assoc(array($form_state['values']['show']['type']));
} }
......
...@@ -52,7 +52,7 @@ protected function viewsData() { ...@@ -52,7 +52,7 @@ protected function viewsData() {
*/ */
public function testFilterQuery() { public function testFilterQuery() {
// Check that we can find the test filter plugin. // Check that we can find the test filter plugin.
$plugin = views_get_plugin('filter', 'test_filter'); $plugin = drupal_container()->get("plugin.manager.views.filter")->createInstance('test_filter');
$this->assertTrue($plugin instanceof FilterPlugin, 'Test filter plugin found.'); $this->assertTrue($plugin instanceof FilterPlugin, 'Test filter plugin found.');
$view = views_get_view('test_filter'); $view = views_get_view('test_filter');
......
...@@ -88,7 +88,7 @@ public function testPluginInstances() { ...@@ -88,7 +88,7 @@ public function testPluginInstances() {
foreach ($this->definitions as $type => $plugins) { foreach ($this->definitions as $type => $plugins) {
// Get a plugin manager for this type. // Get a plugin manager for this type.
$manager = $container->get("plugin.manager.views.$type"); $manager = $container->get("plugin.manager.views.$type");
foreach ($plugins as $definition) { foreach ($plugins as $id => $definition) {
// Get a reflection class for this plugin. // Get a reflection class for this plugin.
// We only want to test true plugins, i.e. They extend PluginBase. // We only want to test true plugins, i.e. They extend PluginBase.
$reflection = new \ReflectionClass($definition['class']); $reflection = new \ReflectionClass($definition['class']);
...@@ -96,8 +96,8 @@ public function testPluginInstances() { ...@@ -96,8 +96,8 @@ public function testPluginInstances() {
// Create a plugin instance and check what it is. This is not just // Create a plugin instance and check what it is. This is not just
// good to check they can be created but for throwing any notices for // good to check they can be created but for throwing any notices for
// method signatures etc... too. // method signatures etc... too.
$instance = $manager->createInstance($definition['id']); $instance = $manager->createInstance($id);
$this->assertTrue($instance instanceof $definition['class'], format_string('Instance of @type:@id created', array('@type' => $type, '@id' => $definition['id']))); $this->assertTrue($instance instanceof $definition['class'], format_string('Instance of @type:@id created', array('@type' => $type, '@id' => $id)));
} }
} }
} }
......
...@@ -577,7 +577,7 @@ public function initDisplay() { ...@@ -577,7 +577,7 @@ public function initDisplay() {
// Instantiate all displays // Instantiate all displays
foreach ($this->storage->get('display') as $id => $display) { foreach ($this->storage->get('display') as $id => $display) {
$this->displayHandlers[$id] = views_get_plugin('display', $display['display_plugin']); $this->displayHandlers[$id] = drupal_container()->get("plugin.manager.views.display")->createInstance($display['display_plugin']);
if (!empty($this->displayHandlers[$id])) { if (!empty($this->displayHandlers[$id])) {
// Initialize the new display handler with data. // Initialize the new display handler with data.
// @todo Refactor display to not need the handler data by reference. // @todo Refactor display to not need the handler data by reference.
...@@ -688,7 +688,7 @@ public function initStyle() { ...@@ -688,7 +688,7 @@ public function initStyle() {
$this->style_options = $style['options']; $this->style_options = $style['options'];
} }
$this->style_plugin = views_get_plugin('style', $this->plugin_name); $this->style_plugin = drupal_container()->get("plugin.manager.views.style")->createInstance($this->plugin_name);
if (empty($this->style_plugin)) { if (empty($this->style_plugin)) {
return FALSE; return FALSE;
...@@ -2207,11 +2207,12 @@ public function setItemOption($display_id, $type, $id, $option, $value) { ...@@ -2207,11 +2207,12 @@ public function setItemOption($display_id, $type, $id, $option, $value) {
public function &newDisplay($id) { public function &newDisplay($id) {
// Create a handler. // Create a handler.
$display = $this->storage->get('display'); $display = $this->storage->get('display');
$this->displayHandlers[$id] = views_get_plugin('display', $display[$id]['display_plugin']); $manager = drupal_container()->get("plugin.manager.views.display");
$this->displayHandlers[$id] = $manager->createInstance($display[$id]['display_plugin']);
if (empty($this->displayHandlers[$id])) { if (empty($this->displayHandlers[$id])) {
// provide a 'default' handler as an emergency. This won't work well but // provide a 'default' handler as an emergency. This won't work well but
// it will keep things from crashing. // it will keep things from crashing.
$this->displayHandlers[$id] = views_get_plugin('display', 'default'); $this->displayHandlers[$id] = $manager->createInstance('default');
} }
if (!empty($this->displayHandlers[$id])) { if (!empty($this->displayHandlers[$id])) {
......
...@@ -840,7 +840,8 @@ function views_add_contextual_links(&$render_element, $location, ViewExecutable ...@@ -840,7 +840,8 @@ function views_add_contextual_links(&$render_element, $location, ViewExecutable
// Also do not do anything if the display plugin has not defined any // Also do not do anything if the display plugin has not defined any
// contextual links that are intended to be displayed in the requested // contextual links that are intended to be displayed in the requested
// location. // location.
$plugin = views_get_plugin_definition('display', $view->displayHandlers[$display_id]->display['display_plugin']); $plugin_id = $view->displayHandlers[$display_id]->getPluginId();
$plugin = drupal_container()->get('plugin.manager.views.display')->getDefinition($plugin_id);
// If contextual_links_locations are not set, provide a sane default. (To // If contextual_links_locations are not set, provide a sane default. (To
// avoid displaying any contextual links at all, a display plugin can still // avoid displaying any contextual links at all, a display plugin can still
// set 'contextual_links_locations' to, e.g., {""}.) // set 'contextual_links_locations' to, e.g., {""}.)
...@@ -1230,6 +1231,59 @@ function views_fetch_data($table = NULL, $reset = FALSE) { ...@@ -1230,6 +1231,59 @@ function views_fetch_data($table = NULL, $reset = FALSE) {
return _views_fetch_data($table, $reset); return _views_fetch_data($table, $reset);
} }
/**
* Fetch a list of all base tables available
*
* @return array
* A keyed array of in the form of 'base_table' => 'Description'.
*/
function views_fetch_base_tables() {
static $base_tables = array();
if (empty($base_tables)) {
$tables = array();
$data = views_fetch_data();
foreach ($data as $table => $info) {
if (!empty($info['table']['base'])) {
$tables[$table] = array(
'title' => $info['table']['base']['title'],
'description' => !empty($info['table']['base']['help']) ? $info['table']['base']['help'] : '',
'weight' => !empty($info['table']['base']['weight']) ? $info['table']['base']['weight'] : 0,
);
}
}
uasort($tables, '_views_weight_sort');
$base_tables = $tables;
}
return $base_tables;
}
/**
* Sorts a structured array by the 'weight' and then by 'title' element.
*
* Callback for uasort() in views_fetch_base_tables().
*
* @param array $a
* First item for comparison. The compared items should be associative arrays
* that include a 'weight' and title element.
* @param array $b
* Second item for comparison.
*
* @return int
* -1 if the first item comes first, 1 if second and 0 if they have the same
* order.
*/
function _views_weight_sort($a, $b) {
if ($a['weight'] != $b['weight']) {
return $a['weight'] < $b['weight'] ? -1 : 1;
}
if ($a['title'] != $b['title']) {
return $a['title'] < $b['title'] ? -1 : 1;
}
return 0;
}
/** /**
* Fetch a list of all base tables available * Fetch a list of all base tables available
* *
...@@ -1245,7 +1299,7 @@ function views_fetch_data($table = NULL, $reset = FALSE) { ...@@ -1245,7 +1299,7 @@ function views_fetch_data($table = NULL, $reset = FALSE) {
* A keyed array of in the form of 'base_table' => 'Description'. * A keyed array of in the form of 'base_table' => 'Description'.
*/ */
function views_fetch_plugin_names($type, $key = NULL, $base = array()) { function views_fetch_plugin_names($type, $key = NULL, $base = array()) {
$definitions = views_get_plugin_definitions($type); $definitions = drupal_container()->get("plugin.manager.views.$type")->getDefinitions();
$plugins = array(); $plugins = array();
foreach ($definitions as $id => $plugin) { foreach ($definitions as $id => $plugin) {
...@@ -1291,39 +1345,17 @@ function views_get_plugin($type, $plugin_id) { ...@@ -1291,39 +1345,17 @@ function views_get_plugin($type, $plugin_id) {
/** /**
* Gets all the views plugin definitions. * Gets all the views plugin definitions.
* *
* @param string|false $type
* Either the plugin type, or FALSE to load all definitions.
*
* @return array * @return array
* An array of plugin definitions for a single type, or an associative array * An array of plugin definitions for all types.
* of plugin definitions keyed by plugin type.
*/ */
function views_get_plugin_definitions($type = FALSE) { function views_get_plugin_definitions() {
$plugins = array();
$plugin_types = $type ? array($type) : ViewExecutable::getPluginTypes();
$container = drupal_container(); $container = drupal_container();
foreach ($plugin_types as $plugin_type) { $plugins = array();
foreach (ViewExecutable::getPluginTypes() as $plugin_type) {
$plugins[$plugin_type] = $container->get("plugin.manager.views.$plugin_type")->getDefinitions(); $plugins[$plugin_type] = $container->get("plugin.manager.views.$plugin_type")->getDefinitions();
} }
if ($type) {
return $plugins[$type];
}
return $plugins;
}
/** return $plugins;
* Gets the plugin definition from a plugin type with a specific ID.
*
* @param string $type
* The plugin type, e.g., 'access' or 'display'.
* @param string $plugin_id
* The name of the plugin, e.g., 'standard'.
*
* @return array
* A plugin definition.
*/
function views_get_plugin_definition($type, $plugin_id) {
return drupal_container()->get("plugin.manager.views.$type")->getDefinition($plugin_id);
} }
/** /**
...@@ -1389,7 +1421,7 @@ function views_get_applicable_views($type) { ...@@ -1389,7 +1421,7 @@ function views_get_applicable_views($type) {
// Loop on array keys because something seems to muck with $view->display // Loop on array keys because something seems to muck with $view->display
// a bit in PHP4. // a bit in PHP4.
foreach (array_keys($display) as $id) { foreach (array_keys($display) as $id) {
$plugin = views_get_plugin_definition('display', $display[$id]['display_plugin']); $plugin = drupal_container()->get('plugin.manager.views.display')->getDefinition($display[$id]['display_plugin']);
if (!empty($plugin[$type])) { if (!empty($plugin[$type])) {
// This view uses_hook_menu. Clone it so that different handlers // This view uses_hook_menu. Clone it so that different handlers
// don't trip over each other, and add it to the list. // don't trip over each other, and add it to the list.
......
...@@ -2113,45 +2113,6 @@ function views_ui_autocomplete_tag($string = '') { ...@@ -2113,45 +2113,6 @@ function views_ui_autocomplete_tag($string = '') {
return new JsonResponse($matches); return new JsonResponse($matches);
} }
function _views_weight_sort($a, $b) {
if ($a['weight'] != $b['weight']) {
return $a['weight'] < $b['weight'] ? -1 : 1;
}
if ($a['title'] != $b['title']) {