Commit d00169d1 authored by dawehner's avatar dawehner Committed by tim.plunkett

convert filter plugins to annotations

parent e2daf79c
......@@ -77,7 +77,7 @@
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
'plugin_id' => 'numeric',
),
'sort' => array(
'handler' => 'views_handler_sort',
......@@ -94,7 +94,7 @@
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
......
......@@ -7,11 +7,19 @@
namespace Drupal\views\Plugins\views\filter;
use Drupal\Core\Annotation\Plugin;
/**
* Filter to handle dates stored as a timestamp.
*
* @ingroup views_filter_handlers
*/
/**
* @Plugin(
* plugin_id = "date"
* )
*/
class Date extends Numeric {
function option_definition() {
$options = parent::option_definition();
......
......@@ -7,8 +7,8 @@
namespace Drupal\views\Plugins\views\filter;
use Drupal\views\Plugins\views\Plugin;
use Drupal\views\Plugins\views\Handler;
use Drupal\Core\Annotation\Plugin;
/**
* @defgroup views_filter_handlers Views filter handlers
......@@ -36,6 +36,12 @@
*
* @ingroup views_filter_handlers
*/
/**
* @Plugin(
* plugin_id = "standard"
* )
*/
class FilterPluginBase extends Handler {
/**
* Contains the actual value of the field,either configured in the views ui
......
......@@ -8,12 +8,19 @@
namespace Drupal\views\Plugins\views\filter;
use Drupal\Core\Database\Database;
use Drupal\Core\Annotation\Plugin;
/**
* Simple filter to handle greater than/less than filters
*
* @ingroup views_filter_handlers
*/
/**
* @Plugin(
* plugin_id = "numeric"
* )
*/
class Numeric extends FilterPluginBase {
var $always_multiple = TRUE;
function option_definition() {
......
......@@ -8,6 +8,7 @@
namespace Drupal\views\Plugins\views\filter;
use Drupal\Core\Database\Database;
use Drupal\Core\Annotation\Plugin;
/**
* Basic textfield filter to handle string filtering commands
......@@ -15,6 +16,12 @@
*
* @ingroup views_filter_handlers
*/
/**
* @Plugin(
* plugin_id = "string"
* )
*/
class String extends FilterPluginBase {
// exposed filter options
......
......@@ -129,7 +129,7 @@ protected function viewsData() {
'handler' => 'views_handler_argument_numeric',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
'plugin_id' => 'numeric',
),
'sort' => array(
'handler' => 'views_handler_sort',
......@@ -146,7 +146,7 @@ protected function viewsData() {
'handler' => 'views_handler_argument_string',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
'sort' => array(
'handler' => 'views_handler_sort',
......@@ -163,7 +163,7 @@ protected function viewsData() {
'handler' => 'views_handler_argument_numeric',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
'plugin_id' => 'numeric',
),
'sort' => array(
'handler' => 'views_handler_sort',
......@@ -180,7 +180,7 @@ protected function viewsData() {
'handler' => 'views_handler_argument_string',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
'sort' => array(
'handler' => 'views_handler_sort',
......@@ -197,7 +197,7 @@ protected function viewsData() {
'handler' => 'views_handler_argument_date',
),
'filter' => array(
'handler' => 'views_handler_filter_date',
'plugin_id' => 'date',
),
'sort' => array(
'handler' => 'views_handler_sort_date',
......
......@@ -41,7 +41,7 @@ function aggregator_views_data() {
'numeric' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
'plugin_id' => 'numeric',
),
'sort' => array(
'handler' => 'views_handler_sort',
......@@ -65,7 +65,7 @@ function aggregator_views_data() {
),
// Information for accepting a nid as a filter
'filter' => array(
'handler' => 'views_handler_filter_numeric',
'plugin_id' => 'numeric',
),
// Information for sorting on a nid.
'sort' => array(
......@@ -88,7 +88,7 @@ function aggregator_views_data() {
),
// Information for accepting a title as a filter
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
);
......@@ -105,7 +105,7 @@ function aggregator_views_data() {
),
// Information for accepting a title as a filter
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
);
......@@ -123,7 +123,7 @@ function aggregator_views_data() {
),
// Information for accepting a title as a filter
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
......@@ -144,7 +144,7 @@ function aggregator_views_data() {
),
// Information for accepting a title as a filter
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
......@@ -162,7 +162,7 @@ function aggregator_views_data() {
),
// Information for accepting a title as a filter
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
);
......@@ -180,7 +180,7 @@ function aggregator_views_data() {
),
// Information for accepting a title as a filter
'filter' => array(
'handler' => 'views_handler_filter_date',
'plugin_id' => 'date',
),
'argument' => array(
'handler' => 'views_handler_argument_date',
......@@ -218,7 +218,7 @@ function aggregator_views_data() {
),
// Information for accepting a nid as a filter
'filter' => array(
'handler' => 'views_handler_filter_numeric',
'plugin_id' => 'numeric',
),
// Information for sorting on a fid.
'sort' => array(
......@@ -241,7 +241,7 @@ function aggregator_views_data() {
),
// Information for accepting a title as a filter
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
......@@ -261,7 +261,7 @@ function aggregator_views_data() {
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
);
......@@ -278,7 +278,7 @@ function aggregator_views_data() {
'handler' => 'views_handler_sort_date',
),
'filter' => array(
'handler' => 'views_handler_filter_date',
'plugin_id' => 'date',
),
'argument' => array(
'handler' => 'views_handler_argument_date',
......@@ -295,7 +295,7 @@ function aggregator_views_data() {
'click sortable' => FALSE,
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
);
......@@ -313,7 +313,7 @@ function aggregator_views_data() {
),
// Information for accepting a title as a filter
'filter' => array(
'handler' => 'views_handler_filter_date',
'plugin_id' => 'date',
),
'argument' => array(
'handler' => 'views_handler_argument_date',
......@@ -376,7 +376,7 @@ function aggregator_views_data() {
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
);
......
......@@ -71,7 +71,7 @@ function book_views_data() {
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
'plugin_id' => 'numeric',
),
'argument' => array(
'handler' => 'views_handler_argument',
......
......@@ -47,7 +47,7 @@ function comment_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
'sort' => array(
'handler' => 'views_handler_sort',
......@@ -66,7 +66,7 @@ function comment_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
'plugin_id' => 'numeric',
),
'sort' => array(
'handler' => 'views_handler_sort',
......@@ -85,7 +85,7 @@ function comment_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
'sort' => array(
'handler' => 'views_handler_sort',
......@@ -104,7 +104,7 @@ function comment_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
'sort' => array(
'handler' => 'views_handler_sort',
......@@ -123,7 +123,7 @@ function comment_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
'sort' => array(
'handler' => 'views_handler_sort',
......@@ -142,7 +142,7 @@ function comment_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
'sort' => array(
'handler' => 'views_handler_sort',
......@@ -164,7 +164,7 @@ function comment_views_data() {
'handler' => 'views_handler_sort_date',
),
'filter' => array(
'handler' => 'views_handler_filter_date',
'plugin_id' => 'date',
),
);
......@@ -203,7 +203,7 @@ function comment_views_data() {
'handler' => 'views_handler_sort_date',
),
'filter' => array(
'handler' => 'views_handler_filter_date',
'plugin_id' => 'date',
),
);
......@@ -355,11 +355,11 @@ function comment_views_data() {
'help' => t('The content to which the comment is a reply to.'),
'base' => 'node',
'base field' => 'nid',
'handler' => 'views_handler_relationship',
'plugin_id' => 'standard',
'label' => t('Content'),
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
'plugin_id' => 'numeric',
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
......@@ -377,11 +377,11 @@ function comment_views_data() {
'help' => t("The User ID of the comment's author."),
'base' => 'users',
'base field' => 'uid',
'handler' => 'views_handler_relationship',
'plugin_id' => 'standard',
'label' => t('author'),
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
'plugin_id' => 'numeric',
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
......@@ -435,7 +435,7 @@ function comment_views_data() {
'handler' => 'views_handler_sort_date',
),
'filter' => array(
'handler' => 'views_handler_filter_date',
'plugin_id' => 'date',
),
);
......@@ -463,7 +463,7 @@ function comment_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
'plugin_id' => 'numeric',
),
'sort' => array(
'handler' => 'views_handler_sort',
......@@ -513,11 +513,11 @@ function comment_views_data() {
'title' => t('Last comment author'),
'base' => 'users',
'base field' => 'uid',
'handler' => 'views_handler_relationship',
'plugin_id' => 'standard',
'label' => t('Last comment author'),
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
'plugin_id' => 'numeric',
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
......
......@@ -383,7 +383,7 @@ function field_views_field_default_views_data($field) {
$data[$table]['delta']['filter'] = array(
'field' => 'delta',
'table' => $table,
'handler' => 'views_handler_filter_numeric',
'plugin_id' => 'numeric',
'additional fields' => $additional_fields,
'field_name' => $field['field_name'],
'allow empty' => TRUE,
......
......@@ -30,7 +30,7 @@ function language_views_data() {
'handler' => 'views_handler_field',
),
'filter' => array(
'handler' => 'views_handler_filter_string'
'plugin_id' => 'string'
),
'argument' => array(
'handler' => 'views_handler_argument_string',
......@@ -47,7 +47,7 @@ function language_views_data() {
'handler' => 'views_handler_field',
),
'filter' => array(
'handler' => 'views_handler_filter_string'
'plugin_id' => 'string'
),
'argument' => array(
'handler' => 'views_handler_argument_string',
......@@ -64,7 +64,7 @@ function language_views_data() {
'handler' => 'views_handler_field_numeric',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric'
'plugin_id' => 'numeric'
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
......@@ -81,7 +81,7 @@ function language_views_data() {
'handler' => 'views_handler_field_numeric',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric'
'plugin_id' => 'numeric'
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
......
......@@ -37,7 +37,7 @@ function locale_views_data() {
'validate type' => 'lid',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
'plugin_id' => 'numeric',
),
'sort' => array(
'handler' => 'views_handler_sort',
......@@ -57,7 +57,7 @@ function locale_views_data() {
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
......@@ -90,7 +90,7 @@ function locale_views_data() {
'handler' => 'views_handler_field',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
);
......@@ -144,7 +144,7 @@ function locale_views_data() {
'handler' => 'views_handler_field',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'plugin_id' => 'string',
),
);
......
......@@ -60,7 +60,7 @@ function node_views_data() {
),
// Information for accepting a nid as a filter
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\Numeric',
'plugin_id' => 'numeric',
),
// Information for sorting on a nid.
'sort' => array(
......@@ -86,7 +86,7 @@ function node_views_data() {
),
// Information for accepting a title as a filter
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\String',
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\String',
......@@ -502,7 +502,7 @@ function node_views_data() {
'plugin_id' => 'standard',
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\String',
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\String',
......@@ -518,7 +518,7 @@ function node_views_data() {
'handler' => 'Drupal\views\Plugins\views\field\Xss',
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\String',
'plugin_id' => 'string',
),
);
......
......@@ -36,7 +36,7 @@ function statistics_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\Numeric',
'plugin_id' => 'numeric',
),
'sort' => array(
'plugin_id' => 'standard',
......@@ -53,7 +53,7 @@ function statistics_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\Numeric',
'plugin_id' => 'numeric',
),
'sort' => array(
'plugin_id' => 'standard',
......@@ -113,7 +113,7 @@ function statistics_views_data() {
'numeric' => TRUE,
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\Numeric',
'plugin_id' => 'numeric',
),
'sort' => array(
'plugin_id' => 'standard',
......@@ -130,7 +130,7 @@ function statistics_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\String',
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\String',
......@@ -150,7 +150,7 @@ function statistics_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\String',
'plugin_id' => 'string',
),
'sort' => array(
'plugin_id' => 'standard',
......@@ -170,7 +170,7 @@ function statistics_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\String',
'plugin_id' => 'string',
),
'sort' => array(
'plugin_id' => 'standard',
......@@ -189,7 +189,7 @@ function statistics_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\String',
'plugin_id' => 'string',
),
'sort' => array(
'plugin_id' => 'standard',
......@@ -205,7 +205,7 @@ function statistics_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\String',
'plugin_id' => 'string',
),
'sort' => array(
'plugin_id' => 'standard',
......@@ -235,7 +235,7 @@ function statistics_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\Numeric',
'plugin_id' => 'numeric',
),
'sort' => array(
'plugin_id' => 'standard',
......
......@@ -44,7 +44,7 @@ function system_views_data() {
'numeric' => TRUE,
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\Numeric',
'plugin_id' => 'numeric',
),
'sort' => array(
'plugin_id' => 'standard',
......@@ -63,7 +63,7 @@ function system_views_data() {
'plugin_id' => 'standard',
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\String',
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\String',
......@@ -82,7 +82,7 @@ function system_views_data() {
'plugin_id' => 'standard',
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\String',
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\String',
......@@ -101,7 +101,7 @@ function system_views_data() {
'plugin_id' => 'standard',
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\String',
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\String',
......@@ -131,7 +131,7 @@ function system_views_data() {
'plugin_id' => 'standard',
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\Numeric',
'plugin_id' => 'numeric',
),
);
......@@ -395,7 +395,7 @@ function system_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\String',
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\String',
......@@ -412,7 +412,7 @@ function system_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\String',
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\String',
......@@ -432,7 +432,7 @@ function system_views_data() {
'handler' => 'Drupal\views\Plugins\views\argument\Numeric',
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\Numeric',
'plugin_id' => 'numeric',
),
'sort' => array(
'plugin_id' => 'standard',
......@@ -446,7 +446,7 @@ function system_views_data() {
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\Numeric',
'plugin_id' => 'numeric',
),
'sort' => array(
'plugin_id' => 'standard',
......@@ -478,7 +478,7 @@ function system_views_data() {
'name field' => 'filename', // the field to display in the summary.
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\String',
'plugin_id' => 'string',
),
'sort' => array(
'plugin_id' => 'standard',
......@@ -497,7 +497,7 @@ function system_views_data() {
'name field' => 'name', // the field to display in the summary.
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\String',
'plugin_id' => 'string',
),
'sort' => array(
'plugin_id' => 'standard',
......@@ -554,7 +554,7 @@ function system_views_data() {
'name field' => 'schema_version', // the field to display in the summary.
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\Numeric',
'plugin_id' => 'numeric',
),
'sort' => array(
'plugin_id' => 'standard',
......
......@@ -101,7 +101,7 @@ function taxonomy_views_data() {
'plugin_id' => 'standard',
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\Numeric',
'plugin_id' => 'numeric',
),
);
......@@ -172,7 +172,7 @@ function taxonomy_views_data() {
'help' => t('The tid of a taxonomy term.'),
'real field' => 'tid',
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\Numeric',
'plugin_id' => 'numeric',
'allow empty' => TRUE,
),
);
......@@ -204,7 +204,7 @@ function taxonomy_views_data() {
'plugin_id' => 'standard',
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\String',
'plugin_id' => 'string',
'help' => t('Taxonomy term name.'),
),
'argument' => array(
......@@ -227,7 +227,7 @@ function taxonomy_views_data() {
'plugin_id' => 'standard',
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\Numeric',
'plugin_id' => 'numeric',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\Numeric',
......@@ -243,7 +243,7 @@ function taxonomy_views_data() {
'format' => array('field' => 'format'),
),
'filter' => array(
'handler' => 'Drupal\views\Plugins\views\filter\String',
'plugin_id' => 'string',
),
);
......
......@@ -78,7 +78,7 @@ function user_views_data() {
'real field' => 'uid',