Skip to content
Snippets Groups Projects
Commit a5ce14d9 authored by Daniel Wehner's avatar Daniel Wehner Committed by Tim Plunkett
Browse files

Experiment with module handler as PSR0

parent 9b956ea6
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -2,9 +2,11 @@
/**
* @file
* Definition of views_handler_filter_node_status.
* Definition of Drupal\node\Plugins\views\filter\Status
*/
namespace Drupal\node\Plugins\views\filter;
use Drupal\views\Plugins\views\filter\FilterPluginBase;
/**
......@@ -12,7 +14,7 @@
*
* @ingroup views_filter_handlers
*/
class views_handler_filter_node_status extends FilterPluginBase {
class Status extends FilterPluginBase {
function admin_summary() { }
function operator_form(&$form, &$form_state) { }
function can_expose() { return FALSE; }
......
......@@ -172,7 +172,7 @@ function node_views_data() {
'help' => t('Filters out unpublished content if the current user cannot view it.'),
'filter' => array(
'field' => 'status',
'handler' => 'views_handler_filter_node_status',
'handler' => 'Drupal\node\Plugins\views\filter\Status',
'label' => t('Published or admin'),
),
);
......
......@@ -33,6 +33,23 @@ function views_api_version() {
return '3.0';
}
/**
* Implements hook_init().
*
*
*/
function views_init() {
$core_modules = array('aggregator', 'book', 'comment', 'contact', 'field', 'filter', 'locale', 'node', 'search', 'statistics', 'system', 'taxonomy', 'translation', 'user');
$path = drupal_get_path('module', 'views');
$loader = drupal_classloader();
foreach ($core_modules as $module) {
if (function_exists($module . '_views_api')) {
$name = $module . '\\Plugins';
$loader->registerNamespace('Drupal\\' . $name, DRUPAL_ROOT . '/' . $path . '/lib');
}
}
}
/**
* Implements hook_ctools_exportable_info().
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment