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

use the right base class for all handlers

parent 3ccb1139
......@@ -8,6 +8,7 @@
namespace Drupal\views\Plugins\views\filter;
use Drupal\views\Plugins\views\Plugin;
use Drupal\views\Plugins\views\Handler;
/**
* @defgroup views_filter_handlers Views filter handlers
......@@ -35,7 +36,7 @@
*
* @ingroup views_filter_handlers
*/
class FilterPluginBase extends Plugin {
class FilterPluginBase extends Handler {
/**
* Contains the actual value of the field,either configured in the views ui
* or entered in the exposed filters.
......@@ -723,7 +724,7 @@ function can_group() {
*
* @ingroup views_filter_handlers
*/
class views_handler_filter_broken extends views_handler_filter {
class views_handler_filter_broken extends FilterPluginBase {
function ui_name($short = FALSE) {
return t('Broken/missing handler');
}
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_argument_aggregator_category_cid.
*/
use Drupal\views\Plugins\views\argument\Numeric;
/**
* Argument handler to accept an aggregator category id.
*
* @ingroup views_argument_handlers
*/
class views_handler_argument_aggregator_category_cid extends views_handler_argument_numeric {
class views_handler_argument_aggregator_category_cid extends Numeric {
/**
* Override the behavior of title(). Get the title of the category.
*/
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_argument_aggregator_fid.
*/
use Drupal\views\Plugins\views\argument\Numeric;
/**
* Argument handler to accept an aggregator feed id.
*
* @ingroup views_argument_handlers
*/
class views_handler_argument_aggregator_fid extends views_handler_argument_numeric {
class views_handler_argument_aggregator_fid extends Numeric {
/**
* Override the behavior of title(). Get the title of the feed.
*/
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_argument_aggregator_iid.
*/
use Drupal\views\Plugins\views\argument\Numeric;
/**
* Argument handler to accept an aggregator item id.
*
* @ingroup views_argument_handlers
*/
class views_handler_argument_aggregator_iid extends views_handler_argument_numeric {
class views_handler_argument_aggregator_iid extends Numeric {
/**
* Override the behavior of title(). Get the title of the category.
*/
......
......@@ -5,13 +5,15 @@
* Definition of views_handler_field_aggregator_category.
*/
use Drupal\views\Plugins\views\field\FieldPluginBase;
/**
* Field handler to provide simple renderer that allows linking to aggregator
* category.
*
* @ingroup views_field_handlers
*/
class views_handler_field_aggregator_category extends views_handler_field {
class views_handler_field_aggregator_category extends FieldPluginBase {
/**
* Constructor to provide additional field to add.
*/
......
......@@ -5,13 +5,15 @@
* Definition of views_handler_field_aggregator_title_link.
*/
use Drupal\views\Plugins\views\field\FieldPluginBase;
/**
* Field handler that turns an item's title into a clickable link to the original
* source article.
*
* @ingroup views_field_handlers
*/
class views_handler_field_aggregator_title_link extends views_handler_field {
class views_handler_field_aggregator_title_link extends FieldPluginBase {
function construct() {
parent::construct();
$this->additional_fields['link'] = 'link';
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_field_aggregator_xss.
*/
use Drupal\views\Plugins\views\field\FieldPluginBase;
/**
* Filters htmls tags from item.
*
* @ingroup views_field_handlers
*/
class views_handler_field_aggregator_xss extends views_handler_field {
class views_handler_field_aggregator_xss extends FieldPluginBase {
function render($values) {
$value = $this->get_value($values);
return aggregator_filter_xss($value);
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_filter_aggregator_category_cid.
*/
use Drupal\views\Plugins\views\filter\InOperator;
/**
* Filter by aggregator category cid
*
* @ingroup views_filter_handlers
*/
class views_handler_filter_aggregator_category_cid extends views_handler_filter_in_operator {
class views_handler_filter_aggregator_category_cid extends InOperator {
function get_value_options() {
if (isset($this->value_options)) {
return;
......
......@@ -5,10 +5,12 @@
* Contains the Aggregator Item RSS row style plugin.
*/
use Drupal\views\Plugins\views\row\RowPluginBase;
/**
* Plugin which loads an aggregator item and formats it as an RSS item.
*/
class views_plugin_row_aggregator_rss extends views_plugin_row {
class views_plugin_row_aggregator_rss extends RowPluginBase {
var $base_table = 'aggregator_item';
var $base_field = 'iid';
......
......@@ -4,10 +4,12 @@
* Contains the book root from current node argument default plugin.
*/
use Drupal\views\Plugins\views\argument_default\Node;
/**
* Default argument plugin to get the current node's book root.
*/
class views_plugin_argument_default_book_root extends views_plugin_argument_default_node {
class views_plugin_argument_default_book_root extends Node {
function get_argument() {
// Use the argument_default_node plugin to get the nid argument.
$nid = parent::get_argument();
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_field_comment.
*/
use Drupal\views\Plugins\views\field\FieldPluginBase;
/**
* Field handler to allow linking to a comment.
*
* @ingroup views_field_handlers
*/
class views_handler_field_comment extends views_handler_field {
class views_handler_field_comment extends FieldPluginBase {
/**
* Override init function to provide generic option to link to comment.
*/
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_field_node_comment.
*/
use Drupal\views\Plugins\views\field\FieldPluginBase;
/**
* Display node comment status.
*
* @ingroup views_field_handlers
*/
class views_handler_field_node_comment extends views_handler_field {
class views_handler_field_node_comment extends FieldPluginBase {
function render($values) {
$value = $this->get_value($values);
switch ($value) {
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_field_node_new_comments.
*/
use Drupal\views\Plugins\views\field\Numeric;
/**
* Field handler to display the number of new comments.
*
* @ingroup views_field_handlers
*/
class views_handler_field_node_new_comments extends views_handler_field_numeric {
class views_handler_field_node_new_comments extends Numeric {
function init(&$view, &$options) {
parent::init($view, $options);
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_filter_ncs_last_updated.
*/
use Drupal\views\Plugins\views\filter\Date;
/**
* Filter handler for the newer of last comment / node updated.
*
* @ingroup views_filter_handlers
*/
class views_handler_filter_ncs_last_updated extends views_handler_filter_date {
class views_handler_filter_ncs_last_updated extends Date {
function query() {
$this->ensure_my_table();
$this->node_table = $this->query->ensure_table('node', $this->relationship);
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_filter_node_comment.
*/
use Drupal\views\Plugins\views\filter\InOperator;
/**
* Filter based on comment node status.
*
* @ingroup views_filter_handlers
*/
class views_handler_filter_node_comment extends views_handler_filter_in_operator {
class views_handler_filter_node_comment extends InOperator {
function get_value_options() {
$this->value_options = array(
COMMENT_NODE_HIDDEN => t('Hidden'),
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_sort_comment_thread.
*/
use Drupal\views\Plugins\views\sort\SortPluginBase;
/**
* Sort handler for ordering by thread.
*
* @ingroup views_sort_handlers
*/
class views_handler_sort_comment_thread extends views_handler_sort {
class views_handler_sort_comment_thread extends SortPluginBase {
function query() {
$this->ensure_my_table();
......
......@@ -6,6 +6,8 @@
*/
use Drupal\views\Join;
use Drupal\views\Plugins\views\sort\SortPluginBase;
/**
* Sort handler to sort by last comment name which might be in 2 different
......@@ -13,7 +15,7 @@
*
* @ingroup views_sort_handlers
*/
class views_handler_sort_ncs_last_comment_name extends views_handler_sort {
class views_handler_sort_ncs_last_comment_name extends SortPluginBase {
function query() {
$this->ensure_my_table();
$join = new Join();
......
......@@ -5,12 +5,15 @@
* Definition of views_handler_sort_ncs_last_updated.
*/
use Drupal\views\Plugins\views\sort\Date;
/**
* Sort handler for the newer of last comment / node updated.
*
* @ingroup views_sort_handlers
*/
class views_handler_sort_ncs_last_updated extends views_handler_sort_date {
class views_handler_sort_ncs_last_updated extends Date {
function query() {
$this->ensure_my_table();
$this->node_table = $this->query->ensure_table('node', $this->relationship);
......
......@@ -5,10 +5,12 @@
* Contains the comment RSS row style plugin.
*/
use Drupal\views\Plugins\views\row\RowPluginBase;
/**
* Plugin which formats the comments as RSS items.
*/
class views_plugin_row_comment_rss extends views_plugin_row {
class views_plugin_row_comment_rss extends RowPluginBase {
var $base_table = 'comment';
var $base_field = 'cid';
......
......@@ -5,10 +5,12 @@
* Contains the node RSS row style plugin.
*/
use Drupal\views\Plugins\views\row\RowPluginBase;
/**
* Plugin which performs a comment_view on the resulting object.
*/
class views_plugin_row_comment_view extends views_plugin_row {
class views_plugin_row_comment_view extends RowPluginBase {
var $base_field = 'cid';
var $base_table = 'comment';
......
......@@ -5,13 +5,15 @@
* Definition of views_handler_argument_field_list.
*/
use Drupal\views\Plugins\views\argument\Numeric;
/**
* Argument handler for list field to show the human readable name in the
* summary.
*
* @ingroup views_argument_handlers
*/
class views_handler_argument_field_list extends views_handler_argument_numeric {
class views_handler_argument_field_list extends Numeric {
/**
* Stores the allowed values of this field.
*
......
......@@ -5,13 +5,16 @@
* Definition of views_handler_argument_field_list_text.
*/
use Drupal\views\Plugins\views\argument\String;
/**
* Argument handler for list field to show the human readable name in the
* summary.
*
* @ingroup views_argument_handlers
*/
class views_handler_argument_field_list_string extends views_handler_argument_string {
class views_handler_argument_field_list_string extends String {
/**
* Stores the allowed values of this field.
*
......
......@@ -5,6 +5,8 @@
* Definition of views_handler_field_field.
*/
use Drupal\views\Plugins\views\field\FieldPluginBase;
/**
* Helper function: Return an array of formatter options for a field type.
*
......@@ -37,7 +39,7 @@ function _field_view_formatter_options($field_type = NULL) {
*
* @ingroup views_field_handlers
*/
class views_handler_field_field extends views_handler_field {
class views_handler_field_field extends FieldPluginBase {
/**
* An array to store field renderable arrays for use by render_items.
* @var array
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_filter_field_list.
*/
use Drupal\views\Plugins\views\filter\InOperator;
/**
* Filter handler which uses list-fields as options.
*
* @ingroup views_filter_handlers
*/
class views_handler_filter_field_list extends views_handler_filter_in_operator {
class views_handler_filter_field_list extends InOperator {
function get_value_options() {
$field = field_info_field($this->definition['field_name']);
$this->value_options = list_allowed_values($field);
......
......@@ -6,13 +6,14 @@
*/
use Drupal\views\Join;
use Drupal\views\Plugins\views\relationship\RelationshipPluginBase;
/**
* A relationship handlers which reverse entity references.
*
* @ingroup views_relationship_handlers
*/
class views_handler_relationship_entity_reverse extends views_handler_relationship {
class views_handler_relationship_entity_reverse extends RelationshipPluginBase {
function init(&$view, &$options) {
parent::init($view, $options);
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_filter_locale_group.
*/
use Drupal\views\Plugins\views\filter\InOperator;
/**
* Filter by locale group.
*
* @ingroup views_filter_handlers
*/
class views_handler_filter_locale_group extends views_handler_filter_in_operator {
class views_handler_filter_locale_group extends InOperator {
function get_value_options() {
if (!isset($this->value_options)) {
$this->value_title = t('Group');
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_filter_locale_language.
*/
use Drupal\views\Plugins\views\filter\InOperator;
/**
* Filter by language.
*
* @ingroup views_filter_handlers
*/
class views_handler_filter_locale_language extends views_handler_filter_in_operator {
class views_handler_filter_locale_language extends InOperator {
function get_value_options() {
if (!isset($this->value_options)) {
$this->value_title = t('Language');
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_filter_locale_version.
*/
use Drupal\views\Plugins\views\filter\InOperator;
/**
* Filter by version.
*
* @ingroup views_filter_handlers
*/
class views_handler_filter_locale_version extends views_handler_filter_in_operator {
class views_handler_filter_locale_version extends InOperator {
function get_value_options() {
if (!isset($this->value_options)) {
$this->value_title = t('Version');
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_filter_node_language.
*/
use Drupal\views\Plugins\views\filter\InOperator;
/**
* Filter by language.
*
* @ingroup views_filter_handlers
*/
class views_handler_filter_node_language extends views_handler_filter_in_operator {
class views_handler_filter_node_language extends InOperator {
function get_value_options() {
if (!isset($this->value_options)) {
$this->value_title = t('Language');
......
......@@ -182,14 +182,14 @@ function node_views_data() {
'title' => t('Promoted to front page'),
'help' => t('Whether or not the content is promoted to the front page.'),
'field' => array(
'handler' => 'views_handler_field_boolean',
'handler' => 'Drupal\views\Plugins\views\field\Boolean',
'click sortable' => TRUE,
'output formats' => array(
'promoted-notpromoted' => array(t('Promoted'), t('Not promoted')),
),
),
'filter' => array(
'handler' => 'views_handler_filter_boolean_operator',
'handler' => 'Drupal\views\Plugins\views\filter\BooleanOperator',
'label' => t('Promoted to front page'),
'type' => 'yes-no',
),
......
......@@ -6,6 +6,7 @@
*/
use Drupal\views\Join;
use Drupal\views\Plugins\views\argument\ArgumentPluginBase;
/**
* Argument that accepts query keys for search.
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_field_search_score.
*/
use Drupal\views\Plugins\views\field\Numeric;
/**
* Field handler to provide simple renderer that allows linking to a node.
*
* @ingroup views_field_handlers
*/
class views_handler_field_search_score extends views_handler_field_numeric {
class views_handler_field_search_score extends Numeric {
function option_definition() {
$options = parent::option_definition();
......
......@@ -7,13 +7,14 @@
use Drupal\views\Join;
use Drupal\search\SearchQuery;
use Drupal\views\Plugins\views\filter\FilterPluginBase;
/**
* Field handler to provide simple renderer that allows linking to a node.
*
* @ingroup views_filter_handlers
*/
class views_handler_filter_search extends views_handler_filter {
class views_handler_filter_search extends FilterPluginBase {
var $always_multiple = TRUE;
/**
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_sort_search_score.
*/
use Drupal\views\Plugins\views\sort\SortPluginBase;
/**
* Field handler to provide simple renderer that allows linking to a node.
*
* @ingroup views_sort_handlers
*/
class views_handler_sort_search_score extends views_handler_sort {
class views_handler_sort_search_score extends SortPluginBase {
function query() {
// Check to see if the search filter/argument added 'score' to the table.
// Our filter stores it as $handler->search_score -- and we also
......
......@@ -5,10 +5,12 @@
* Definition of views_plugin_row_search_view.
*/
use Drupal\views\Plugins\views\row\RowPluginBase;
/**
* Plugin which performs a node_view on the resulting object.
*/
class views_plugin_row_search_view extends views_plugin_row {
class views_plugin_row_search_view extends RowPluginBase {
function option_definition() {
$options = parent::option_definition();
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_field_accesslog_path.
*/
use Drupal\views\Plugins\views\field\FieldPluginBase;
/**
* Field handler to provide simple renderer that turns a URL into a clickable link.
*
* @ingroup views_field_handlers
*/
class views_handler_field_accesslog_path extends views_handler_field {
class views_handler_field_accesslog_path extends FieldPluginBase {
/**
* Override init function to provide generic option to link to node.
*/
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_argument_vocabulary_machine_name.
*/
use Drupal\views\Plugins\views\argument\String;
/**
* Argument handler to accept a vocabulary machine name.
*
* @ingroup views_argument_handlers
*/
class views_handler_argument_vocabulary_machine_name extends views_handler_argument_string {
class views_handler_argument_vocabulary_machine_name extends String {
/**
* Override the behavior of title(). Get the name of the vocabulary..
*/
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_argument_vocabulary_vid.
*/
use Drupal\views\Plugins\views\argument\Numeric;
/**
* Argument handler to accept a vocabulary id.
*
* @ingroup views_argument_handlers
*/
class views_handler_argument_vocabulary_vid extends views_handler_argument_numeric {
class views_handler_argument_vocabulary_vid extends Numeric {
/**
* Override the behavior of title(). Get the name of the vocabulary.
*/
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_argument_user_uid.
*/
use Drupal\views\Plugins\views\argument\Numeric;
/**
* Argument handler to accept a user id.
*
* @ingroup views_argument_handlers
*/
class views_handler_argument_user_uid extends views_handler_argument_numeric {
class views_handler_argument_user_uid extends Numeric {
/**
* Override the behavior of title(). Get the name of the user.
*
......
......@@ -5,12 +5,14 @@
* Definition of views_handler_argument_users_roles_rid.
*/
use Drupal\views\Plugins\views\argument\ManyToOne;
/**
* Allow role ID(s) as argument.
*
* @ingroup views_argument_handlers
*/
class views_handler_argument_users_roles_rid extends views_handler_argument_many_to_one {
class views_handler_argument_users_roles_rid extends ManyToOne {
function title_query() {
$titles = array();
......