Commit a5ce14d9 authored by dawehner's avatar dawehner Committed by tim.plunkett
Browse files

Experiment with module handler as PSR0

parent 9b956ea6
......@@ -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().
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment