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

use the right base class for all handlers

parent 3ccb1139
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
Showing
with 61 additions and 21 deletions
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
namespace Drupal\views\Plugins\views\filter; namespace Drupal\views\Plugins\views\filter;
use Drupal\views\Plugins\views\Plugin; use Drupal\views\Plugins\views\Plugin;
use Drupal\views\Plugins\views\Handler;
/** /**
* @defgroup views_filter_handlers Views filter handlers * @defgroup views_filter_handlers Views filter handlers
...@@ -35,7 +36,7 @@ ...@@ -35,7 +36,7 @@
* *
* @ingroup views_filter_handlers * @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 * Contains the actual value of the field,either configured in the views ui
* or entered in the exposed filters. * or entered in the exposed filters.
...@@ -723,7 +724,7 @@ function can_group() { ...@@ -723,7 +724,7 @@ function can_group() {
* *
* @ingroup views_filter_handlers * @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) { function ui_name($short = FALSE) {
return t('Broken/missing handler'); return t('Broken/missing handler');
} }
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
* Definition of views_handler_argument_aggregator_category_cid. * Definition of views_handler_argument_aggregator_category_cid.
*/ */
use Drupal\views\Plugins\views\argument\Numeric;
/** /**
* Argument handler to accept an aggregator category id. * Argument handler to accept an aggregator category id.
* *
* @ingroup views_argument_handlers * @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. * Override the behavior of title(). Get the title of the category.
*/ */
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
* Definition of views_handler_argument_aggregator_fid. * Definition of views_handler_argument_aggregator_fid.
*/ */
use Drupal\views\Plugins\views\argument\Numeric;
/** /**
* Argument handler to accept an aggregator feed id. * Argument handler to accept an aggregator feed id.
* *
* @ingroup views_argument_handlers * @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. * Override the behavior of title(). Get the title of the feed.
*/ */
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
* Definition of views_handler_argument_aggregator_iid. * Definition of views_handler_argument_aggregator_iid.
*/ */
use Drupal\views\Plugins\views\argument\Numeric;
/** /**
* Argument handler to accept an aggregator item id. * Argument handler to accept an aggregator item id.
* *
* @ingroup views_argument_handlers * @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. * Override the behavior of title(). Get the title of the category.
*/ */
......
...@@ -5,13 +5,15 @@ ...@@ -5,13 +5,15 @@
* Definition of views_handler_field_aggregator_category. * 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 * Field handler to provide simple renderer that allows linking to aggregator
* category. * category.
* *
* @ingroup views_field_handlers * @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. * Constructor to provide additional field to add.
*/ */
......
...@@ -5,13 +5,15 @@ ...@@ -5,13 +5,15 @@
* Definition of views_handler_field_aggregator_title_link. * 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 * Field handler that turns an item's title into a clickable link to the original
* source article. * source article.
* *
* @ingroup views_field_handlers * @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() { function construct() {
parent::construct(); parent::construct();
$this->additional_fields['link'] = 'link'; $this->additional_fields['link'] = 'link';
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
* Definition of views_handler_field_aggregator_xss. * Definition of views_handler_field_aggregator_xss.
*/ */
use Drupal\views\Plugins\views\field\FieldPluginBase;
/** /**
* Filters htmls tags from item. * Filters htmls tags from item.
* *
* @ingroup views_field_handlers * @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) { function render($values) {
$value = $this->get_value($values); $value = $this->get_value($values);
return aggregator_filter_xss($value); return aggregator_filter_xss($value);
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
* Definition of views_handler_filter_aggregator_category_cid. * Definition of views_handler_filter_aggregator_category_cid.
*/ */
use Drupal\views\Plugins\views\filter\InOperator;
/** /**
* Filter by aggregator category cid * Filter by aggregator category cid
* *
* @ingroup views_filter_handlers * @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() { function get_value_options() {
if (isset($this->value_options)) { if (isset($this->value_options)) {
return; return;
......
...@@ -5,10 +5,12 @@ ...@@ -5,10 +5,12 @@
* Contains the Aggregator Item RSS row style plugin. * 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. * 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_table = 'aggregator_item';
var $base_field = 'iid'; var $base_field = 'iid';
......
...@@ -4,10 +4,12 @@ ...@@ -4,10 +4,12 @@
* Contains the book root from current node argument default plugin. * 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. * 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() { function get_argument() {
// Use the argument_default_node plugin to get the nid argument. // Use the argument_default_node plugin to get the nid argument.
$nid = parent::get_argument(); $nid = parent::get_argument();
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
* Definition of views_handler_field_comment. * Definition of views_handler_field_comment.
*/ */
use Drupal\views\Plugins\views\field\FieldPluginBase;
/** /**
* Field handler to allow linking to a comment. * Field handler to allow linking to a comment.
* *
* @ingroup views_field_handlers * @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. * Override init function to provide generic option to link to comment.
*/ */
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
* Definition of views_handler_field_node_comment. * Definition of views_handler_field_node_comment.
*/ */
use Drupal\views\Plugins\views\field\FieldPluginBase;
/** /**
* Display node comment status. * Display node comment status.
* *
* @ingroup views_field_handlers * @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) { function render($values) {
$value = $this->get_value($values); $value = $this->get_value($values);
switch ($value) { switch ($value) {
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
* Definition of views_handler_field_node_new_comments. * Definition of views_handler_field_node_new_comments.
*/ */
use Drupal\views\Plugins\views\field\Numeric;
/** /**
* Field handler to display the number of new comments. * Field handler to display the number of new comments.
* *
* @ingroup views_field_handlers * @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) { function init(&$view, &$options) {
parent::init($view, $options); parent::init($view, $options);
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
* Definition of views_handler_filter_ncs_last_updated. * 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. * Filter handler for the newer of last comment / node updated.
* *
* @ingroup views_filter_handlers * @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() { function query() {
$this->ensure_my_table(); $this->ensure_my_table();
$this->node_table = $this->query->ensure_table('node', $this->relationship); $this->node_table = $this->query->ensure_table('node', $this->relationship);
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
* Definition of views_handler_filter_node_comment. * Definition of views_handler_filter_node_comment.
*/ */
use Drupal\views\Plugins\views\filter\InOperator;
/** /**
* Filter based on comment node status. * Filter based on comment node status.
* *
* @ingroup views_filter_handlers * @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() { function get_value_options() {
$this->value_options = array( $this->value_options = array(
COMMENT_NODE_HIDDEN => t('Hidden'), COMMENT_NODE_HIDDEN => t('Hidden'),
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
* Definition of views_handler_sort_comment_thread. * Definition of views_handler_sort_comment_thread.
*/ */
use Drupal\views\Plugins\views\sort\SortPluginBase;
/** /**
* Sort handler for ordering by thread. * Sort handler for ordering by thread.
* *
* @ingroup views_sort_handlers * @ingroup views_sort_handlers
*/ */
class views_handler_sort_comment_thread extends views_handler_sort { class views_handler_sort_comment_thread extends SortPluginBase {
function query() { function query() {
$this->ensure_my_table(); $this->ensure_my_table();
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
*/ */
use Drupal\views\Join; 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 * Sort handler to sort by last comment name which might be in 2 different
...@@ -13,7 +15,7 @@ ...@@ -13,7 +15,7 @@
* *
* @ingroup views_sort_handlers * @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() { function query() {
$this->ensure_my_table(); $this->ensure_my_table();
$join = new Join(); $join = new Join();
......
...@@ -5,12 +5,15 @@ ...@@ -5,12 +5,15 @@
* Definition of views_handler_sort_ncs_last_updated. * 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. * Sort handler for the newer of last comment / node updated.
* *
* @ingroup views_sort_handlers * @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() { function query() {
$this->ensure_my_table(); $this->ensure_my_table();
$this->node_table = $this->query->ensure_table('node', $this->relationship); $this->node_table = $this->query->ensure_table('node', $this->relationship);
......
...@@ -5,10 +5,12 @@ ...@@ -5,10 +5,12 @@
* Contains the comment RSS row style plugin. * Contains the comment RSS row style plugin.
*/ */
use Drupal\views\Plugins\views\row\RowPluginBase;
/** /**
* Plugin which formats the comments as RSS items. * 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_table = 'comment';
var $base_field = 'cid'; var $base_field = 'cid';
......
...@@ -5,10 +5,12 @@ ...@@ -5,10 +5,12 @@
* Contains the node RSS row style plugin. * Contains the node RSS row style plugin.
*/ */
use Drupal\views\Plugins\views\row\RowPluginBase;
/** /**
* Plugin which performs a comment_view on the resulting object. * 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_field = 'cid';
var $base_table = 'comment'; var $base_table = 'comment';
......
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