Commit 684b4a03 authored by dawehner's avatar dawehner Committed by tim.plunkett

lets use annotated handlers in even more places

parent aa5cc306
......@@ -97,7 +97,7 @@
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
'plugin_id' => 'string',
),
'sort' => array(
'plugin_id' => 'standard',
......
......@@ -22,6 +22,9 @@
*
* @ingroup views_area_handlers
*/
/**
*/
class AreaPluginBase extends Handler {
/**
* Get this field's label.
......
......@@ -7,11 +7,19 @@
namespace Drupal\views\Plugins\views\area;
use Drupal\Core\Annotation\Plugin;
/**
* Views area handler to display some configurable result summary.
*
* @ingroup views_area_handlers
*/
/**
* @Plugin(
* plugin_id = "result"
* )
*/
class Result extends AreaPluginBase {
function option_definition() {
......
......@@ -7,11 +7,19 @@
namespace Drupal\views\Plugins\views\area;
use Drupal\Core\Annotation\Plugin;
/**
* Views area text handler.
*
* @ingroup views_area_handlers
*/
/**
* @Plugin(
* plugin_id = "text"
* )
*/
class Text extends AreaPluginBase {
function option_definition() {
......
......@@ -7,11 +7,19 @@
namespace Drupal\views\Plugins\views\area;
use Drupal\Core\Annotation\Plugin;
/**
* Views area handlers. Insert a view inside of an area.
*
* @ingroup views_area_handlers
*/
/**
* @Plugin(
* plugin_id = "view"
* )
*/
class View extends AreaPluginBase {
function option_definition() {
......
......@@ -7,6 +7,8 @@
namespace Drupal\views\Plugins\views\argument;
use Drupal\Core\Annotation\Plugin;
/**
* Abstract argument handler for dates.
*
......@@ -25,6 +27,12 @@
*
* @ingroup views_argument_handlers
*/
/**
* @Plugin(
* plugin_id = "date"
* )
*/
class Date extends ArgumentPluginBase {
var $option_name = 'default_argument_date';
......
......@@ -7,6 +7,8 @@
namespace Drupal\views\Plugins\views\argument;
use Drupal\Core\Annotation\Plugin;
/**
* Abstract argument handler for simple formulae.
*
......@@ -17,6 +19,12 @@
*
* @ingroup views_argument_handlers
*/
/**
* @Plugin(
* plugin_id = "formula"
* )
*/
class Formula extends ArgumentPluginBase {
var $formula = NULL;
/**
......
......@@ -7,11 +7,19 @@
namespace Drupal\views\Plugins\views\argument;
use Drupal\Core\Annotation\Plugin;
/**
* Simple handler for arguments using group by.
*
* @ingroup views_argument_handlers
*/
/**
* @Plugin(
* plugin_id = "groupby_numeric"
* )
*/
class GroupByNumeric extends ArgumentPluginBase {
function query($group_by = FALSE) {
$this->ensure_my_table();
......
......@@ -7,6 +7,8 @@
namespace Drupal\views\Plugins\views\argument;
use Drupal\Core\Annotation\Plugin;
/**
* An argument handler for use in fields that have a many to one relationship
* with the table(s) to the left. This adds a bunch of options that are
......@@ -20,6 +22,12 @@
*
* @ingroup views_argument_handlers
*/
/**
* @Plugin(
* plugin_id = "many_to_one"
* )
*/
class ManyToOne extends ArgumentPluginBase {
function init(&$view, &$options) {
parent::init($view, $options);
......
......@@ -7,11 +7,19 @@
namespace Drupal\views\Plugins\views\argument;
use Drupal\Core\Annotation\Plugin;
/**
* Argument handler that ignores the argument.
*
* @ingroup views_argument_handlers
*/
/**
* @Plugin(
* plugin_id = "null"
* )
*/
class Null extends ArgumentPluginBase {
function option_definition() {
$options = parent::option_definition();
......
......@@ -7,12 +7,20 @@
namespace Drupal\views\Plugins\views\argument;
use Drupal\Core\Annotation\Plugin;
/**
* Basic argument handler for arguments that are numeric. Incorporates
* break_phrase.
*
* @ingroup views_argument_handlers
*/
/**
* @Plugin(
* plugin_id = "numeric"
* )
*/
class Numeric extends ArgumentPluginBase {
/**
* The operator used for the query: or|and.
......
......@@ -7,12 +7,20 @@
namespace Drupal\views\Plugins\views\argument;
use Drupal\Core\Annotation\Plugin;
/**
* Basic argument handler to implement string arguments that may have length
* limits.
*
* @ingroup views_argument_handlers
*/
/**
* @Plugin(
* plugin_id = "string"
* )
*/
class String extends ArgumentPluginBase {
function init(&$view, &$options) {
parent::init($view, $options);
......
......@@ -1539,8 +1539,8 @@ function get_aggregation_info() {
'title' => t('Count'),
'method' => 'views_query_default_aggregation_method_simple',
'handler' => array(
'argument' => 'views_handler_argument_group_by_numeric',
'field' => 'views_handler_field_numeric',
'argument' => 'groupby_numeric',
'field' => 'groupby_numeric',
'filter' => 'groupby_numeric',
'sort' => 'groupby_numeric',
),
......@@ -1549,8 +1549,8 @@ function get_aggregation_info() {
'title' => t('Count DISTINCT'),
'method' => 'views_query_default_aggregation_method_distinct',
'handler' => array(
'argument' => 'views_handler_argument_group_by_numeric',
'field' => 'views_handler_field_numeric',
'argument' => 'groupby_numeric',
'field' => 'groupby_numeric',
'filter' => 'groupby_numeric',
'sort' => 'groupby_numeric',
),
......@@ -1559,7 +1559,8 @@ function get_aggregation_info() {
'title' => t('Sum'),
'method' => 'views_query_default_aggregation_method_simple',
'handler' => array(
'argument' => 'views_handler_argument_group_by_numeric',
'argument' => 'groupby_numeric',
'field' => 'groupby_numeric',
'filter' => 'groupby_numeric',
'sort' => 'groupby_numeric',
),
......@@ -1568,7 +1569,8 @@ function get_aggregation_info() {
'title' => t('Average'),
'method' => 'views_query_default_aggregation_method_simple',
'handler' => array(
'argument' => 'views_handler_argument_group_by_numeric',
'argument' => 'groupby_numeric',
'field' => 'groupby_numeric',
'filter' => 'groupby_numeric',
'sort' => 'groupby_numeric',
),
......@@ -1577,7 +1579,8 @@ function get_aggregation_info() {
'title' => t('Minimum'),
'method' => 'views_query_default_aggregation_method_simple',
'handler' => array(
'argument' => 'views_handler_argument_group_by_numeric',
'argument' => 'groupby_numeric',
'field' => 'groupby_numeric',
'filter' => 'groupby_numeric',
'sort' => 'groupby_numeric',
),
......@@ -1586,7 +1589,8 @@ function get_aggregation_info() {
'title' => t('Maximum'),
'method' => 'views_query_default_aggregation_method_simple',
'handler' => array(
'argument' => 'views_handler_argument_group_by_numeric',
'argument' => 'groupby_numeric',
'field' => 'groupby_numeric',
'filter' => 'groupby_numeric',
'sort' => 'groupby_numeric',
),
......@@ -1595,7 +1599,8 @@ function get_aggregation_info() {
'title' => t('Standard derivation'),
'method' => 'views_query_default_aggregation_method_simple',
'handler' => array(
'argument' => 'views_handler_argument_group_by_numeric',
'argument' => 'groupby_numeric',
'field' => 'groupby_numeric',
'filter' => 'groupby_numeric',
'sort' => 'groupby_numeric',
),
......
......@@ -126,7 +126,7 @@ protected function viewsData() {
'click sortable' => TRUE,
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
'plugin_id' => 'numeric',
),
'filter' => array(
'plugin_id' => 'numeric',
......@@ -143,7 +143,7 @@ protected function viewsData() {
'click sortable' => TRUE,
),
'argument' => array(
'handler' => 'views_handler_argument_string',
'plugin_id' => 'string',
),
'filter' => array(
'plugin_id' => 'string',
......@@ -160,7 +160,7 @@ protected function viewsData() {
'click sortable' => TRUE,
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
'plugin_id' => 'numeric',
),
'filter' => array(
'plugin_id' => 'numeric',
......@@ -177,7 +177,7 @@ protected function viewsData() {
'click sortable' => TRUE,
),
'argument' => array(
'handler' => 'views_handler_argument_string',
'plugin_id' => 'string',
),
'filter' => array(
'plugin_id' => 'string',
......@@ -194,13 +194,13 @@ protected function viewsData() {
'click sortable' => TRUE,
),
'argument' => array(
'handler' => 'views_handler_argument_date',
'plugin_id' => 'date',
),
'filter' => array(
'plugin_id' => 'date',
),
'sort' => array(
'handler' => 'views_handler_sort_date',
'plugin_id' => 'date',
),
);
return $data;
......
......@@ -37,7 +37,7 @@ function aggregator_views_data() {
'click sortable' => TRUE,
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
'plugin_id' => 'numeric',
'numeric' => TRUE,
),
'filter' => array(
......@@ -126,7 +126,7 @@ function aggregator_views_data() {
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
'plugin_id' => 'string',
),
);
......@@ -136,7 +136,7 @@ function aggregator_views_data() {
'help' => t('The guid of the original imported item.'),
// Information for displaying a title as a field
'field' => array(
'handler' => 'views_handler_field_xss',
'plugin_id' => 'xss',
'click sortable' => TRUE,
),
'sort' => array(
......@@ -147,7 +147,7 @@ function aggregator_views_data() {
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
'plugin_id' => 'string',
),
);
......@@ -176,14 +176,14 @@ function aggregator_views_data() {
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort_date',
'plugin_id' => 'date',
),
// Information for accepting a title as a filter
'filter' => array(
'plugin_id' => 'date',
),
'argument' => array(
'handler' => 'views_handler_argument_date',
'plugin_id' => 'date',
),
);
......@@ -244,7 +244,7 @@ function aggregator_views_data() {
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
'plugin_id' => 'string',
),
);
......@@ -275,13 +275,13 @@ function aggregator_views_data() {
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort_date',
'plugin_id' => 'date',
),
'filter' => array(
'plugin_id' => 'date',
),
'argument' => array(
'handler' => 'views_handler_argument_date',
'plugin_id' => 'date',
),
);
......@@ -291,7 +291,7 @@ function aggregator_views_data() {
'help' => t('The description of the aggregator feed.'),
// Information for displaying a title as a field
'field' => array(
'handler' => 'views_handler_field_xss',
'plugin_id' => 'xss',
'click sortable' => FALSE,
),
'filter' => array(
......@@ -309,14 +309,14 @@ function aggregator_views_data() {
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort_date',
'plugin_id' => 'date',
),
// Information for accepting a title as a filter
'filter' => array(
'plugin_id' => 'date',
),
'argument' => array(
'handler' => 'views_handler_argument_date',
'plugin_id' => 'date',
),
);
......
......@@ -74,7 +74,7 @@ function book_views_data() {
'plugin_id' => 'numeric',
),
'argument' => array(
'handler' => 'views_handler_argument',
'plugin_id' => 'standard',
),
);
......
......@@ -53,7 +53,7 @@ function comment_views_data() {
'plugin_id' => 'standard',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
'plugin_id' => 'string',
),
);
......@@ -72,7 +72,7 @@ function comment_views_data() {
'plugin_id' => 'standard',
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
'plugin_id' => 'numeric',
),
);
......@@ -91,7 +91,7 @@ function comment_views_data() {
'plugin_id' => 'standard',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
'plugin_id' => 'string',
),
);
......@@ -110,7 +110,7 @@ function comment_views_data() {
'plugin_id' => 'standard',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
'plugin_id' => 'string',
),
);
......@@ -129,7 +129,7 @@ function comment_views_data() {
'plugin_id' => 'standard',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
'plugin_id' => 'string',
),
);
......@@ -148,7 +148,7 @@ function comment_views_data() {
'plugin_id' => 'standard',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
'plugin_id' => 'string',
),
);
......@@ -161,7 +161,7 @@ function comment_views_data() {
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort_date',
'plugin_id' => 'date',
),
'filter' => array(
'plugin_id' => 'date',
......@@ -200,7 +200,7 @@ function comment_views_data() {
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort_date',
'plugin_id' => 'date',
),
'filter' => array(
'plugin_id' => 'date',
......@@ -362,7 +362,7 @@ function comment_views_data() {
'plugin_id' => 'numeric',
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
'plugin_id' => 'numeric',
),
'field' => array(
'plugin_id' => 'numeric',
......@@ -384,7 +384,7 @@ function comment_views_data() {
'plugin_id' => 'numeric',
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
'plugin_id' => 'numeric',
),
'field' => array(
'handler' => 'views_handler_field_user',
......@@ -432,7 +432,7 @@ function comment_views_data() {
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort_date',
'plugin_id' => 'date',
),
'filter' => array(
'plugin_id' => 'date',
......@@ -469,7 +469,7 @@ function comment_views_data() {
'plugin_id' => 'standard',
),
'argument' => array(
'handler' => 'views_handler_argument',
'plugin_id' => 'standard',
),
);
......@@ -520,7 +520,7 @@ function comment_views_data() {
'plugin_id' => 'numeric',
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
'plugin_id' => 'numeric',
),
'field' => array(
'plugin_id' => 'numeric',
......
......@@ -375,7 +375,7 @@ function field_views_field_default_views_data($field) {
$data[$table]['delta']['argument'] = array(
'field' => 'delta',
'table' => $table,
'handler' => 'views_handler_argument_numeric',
'plugin_id' => 'numeric',
'additional fields' => $additional_fields,
'empty field name' => t('- No value -'),
'field_name' => $field['field_name'],
......
......@@ -33,7 +33,7 @@ function language_views_data() {
'plugin_id' => 'string'
),
'argument' => array(
'handler' => 'views_handler_argument_string',
'plugin_id' => 'string',
),
'sort' => array(
'plugin_id' => 'standard',
......@@ -50,7 +50,7 @@ function language_views_data() {
'plugin_id' => 'string'
),
'argument' => array(
'handler' => 'views_handler_argument_string',
'plugin_id' => 'string',
),
'sort' => array(
'plugin_id' => 'standard',
......@@ -67,7 +67,7 @@ function language_views_data() {
'plugin_id' => 'numeric'
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
'plugin_id' => 'numeric',
),
'sort' => array(
'plugin_id' => 'standard',
......@@ -84,7 +84,7 @@ function language_views_data() {
'plugin_id' => 'numeric'
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
'plugin_id' => 'numeric',
),
'sort' => array(
'plugin_id' => 'standard',
......
......@@ -32,7 +32,7 @@ function locale_views_data() {
'click sortable' => TRUE,
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
'plugin_id' => 'numeric',
'numeric' => TRUE,
'validate type' => 'lid',
),
......@@ -60,7 +60,7 @@ function locale_views_data() {
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
'plugin_id' => 'string',
),
);
......@@ -107,7 +107,7 @@ function locale_views_data() {
'handler' => 'views_handler_filter_locale_version',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
'plugin_id' => 'string',
),
);
......
......@@ -89,7 +89,7 @@ function node_views_data() {
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\String',
'plugin_id' => 'string',
),
);
......@@ -389,7 +389,7 @@ function node_views_data() {
'handler' => 'views_handler_filter_user_name',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\Numeric',
'plugin_id' => 'numeric',
),
'field' => array(
'handler' => 'views_handler_field_user',
......@@ -505,7 +505,7 @@ function node_views_data() {
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\String',
'plugin_id' => 'string',
),
);
......
......@@ -108,7 +108,7 @@ function statistics_views_data() {
'click sortable' => TRUE,
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\Numeric',
'plugin_id' => 'numeric',
'name field' => 'wid',
'numeric' => TRUE,
),
......@@ -133,7 +133,7 @@ function statistics_views_data() {
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\String',
'plugin_id' => 'string',
),
'sort' => array(
'plugin_id' => 'standard',
......@@ -156,7 +156,7 @@ function statistics_views_data() {
'plugin_id' => 'standard',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\sort\String',
'plugin_id' => 'standard',
),
);
......@@ -211,7 +211,7 @@ function statistics_views_data() {
'plugin_id' => 'standard',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\String',
'plugin_id' => 'string',
),
);
......
......@@ -66,7 +66,7 @@ function system_views_data() {
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\String',
'plugin_id' => 'string',
),
);
......@@ -85,7 +85,7 @@ function system_views_data() {
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\String',
'plugin_id' => 'string',
),
);
......@@ -104,7 +104,7 @@ function system_views_data() {
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\String',
'plugin_id' => 'string',
),
);
......@@ -398,7 +398,7 @@ function system_views_data() {
'plugin_id' => 'string',
),
'argument' => array(
'handler' => 'Drupal\views\Plugins\views\argument\String',
'plugin_id' => 'string',
),
'sort' => array(
'plugin_id' => 'standard',
......@@ -415,7 +415,7 @@ function system_views_data() {
'plugin_id' => 'string',
),
'argument' => array(