diff --git a/lib/Drupal/views/Plugin/views/wizard/TaxonomyTerm.php b/lib/Drupal/views/Plugin/views/wizard/TaxonomyTerm.php index 20e37636ddff2eaeeb44fe1f73c1ac0f78822bd3..2ff6722a91752363d1a80a503857978ae91aa5d9 100644 --- a/lib/Drupal/views/Plugin/views/wizard/TaxonomyTerm.php +++ b/lib/Drupal/views/Plugin/views/wizard/TaxonomyTerm.php @@ -19,7 +19,6 @@ * base_table = "taxonomy_term_data", * created_column = "created", * title = @Translation("Taxonomy terms"), - * filters = {""}, * path_field = { * "id" = "tid", * "table" = "taxonomy_term_data", diff --git a/lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_term_node_tid.inc b/lib/Views/taxonomy/Plugin/views/argument/IndexTid.php similarity index 85% rename from lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_term_node_tid.inc rename to lib/Views/taxonomy/Plugin/views/argument/IndexTid.php index f47f08a85a30425641aab5b7be8a189cba054aaf..e6ffe15771fd2a815b878c41e6baf8d9a7d83ee9 100644 --- a/lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_term_node_tid.inc +++ b/lib/Views/taxonomy/Plugin/views/argument/IndexTid.php @@ -10,7 +10,18 @@ * * @ingroup views_argument_handlers */ -class views_handler_argument_term_node_tid extends views_handler_argument_many_to_one { + +namespace Views\taxonomy\Plugin\views\argument; + +use Drupal\Core\Annotation\Plugin; +use Drupal\views\Plugin\views\argument\ManyToOne; + +/** + * @Plugin( + * plugin_id = "taxonomy_index_tid" + * ) + */ +class IndexTid extends ManyToOne { function option_definition() { $options = parent::option_definition(); $options['set_breadcrumb'] = array('default' => FALSE, 'bool' => TRUE); diff --git a/lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_term_node_tid_depth.inc b/lib/Views/taxonomy/Plugin/views/argument/IndexTidDepth.php similarity index 95% rename from lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_term_node_tid_depth.inc rename to lib/Views/taxonomy/Plugin/views/argument/IndexTidDepth.php index 5b0b34d8f78c336f8ea95f2d964ee6ed3858d27c..c618711253bf47d7013c2afe229b632c89751798 100644 --- a/lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_term_node_tid_depth.inc +++ b/lib/Views/taxonomy/Plugin/views/argument/IndexTidDepth.php @@ -5,6 +5,11 @@ * Definition of views_handler_argument_term_node_tid_depth. */ +namespace Views\taxonomy\Plugin\views\argument; + +use Drupal\views\Plugin\views\argument\ArgumentPluginBase; +use Drupal\Core\Annotation\Plugin; + /** * Argument handler for taxonomy terms with depth. * @@ -13,7 +18,13 @@ * * @ingroup views_argument_handlers */ -class views_handler_argument_term_node_tid_depth extends views_handler_argument { + +/** + * @Plugin( + * plugin_id = "taxonomy_index_tid_depth" + * ) + */ +class IndexTidDepth extends ArgumentPluginBase { function option_definition() { $options = parent::option_definition(); diff --git a/lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_term_node_tid_depth_modifier.inc b/lib/Views/taxonomy/Plugin/views/argument/IndexTidDepthModifier.php similarity index 83% rename from lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_term_node_tid_depth_modifier.inc rename to lib/Views/taxonomy/Plugin/views/argument/IndexTidDepthModifier.php index 2f9dd4e7b7280c3f1484c32b17dc188783d0af9c..32f8c250f6e4c28c68b5628272fcec82a849229f 100644 --- a/lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_term_node_tid_depth_modifier.inc +++ b/lib/Views/taxonomy/Plugin/views/argument/IndexTidDepthModifier.php @@ -2,9 +2,14 @@ /** * @file - * Definition of views_handler_argument_term_node_tid_depth_modif. + * Definition of views_handler_argument_term_node_tid_depth_modifier. */ +namespace Views\taxonomy\Plugin\views\argument; + +use Drupal\views\Plugin\views\argument\ArgumentPluginBase; +use Drupal\Core\Annotation\Plugin; + /** * Argument handler for to modify depth for a previous term. * @@ -13,7 +18,13 @@ * * @ingroup views_argument_handlers */ -class views_handler_argument_term_node_tid_depth_modifier extends views_handler_argument { + +/** + * @Plugin( + * plugin_id = "taxonomy_index_tid_depth_modifier" + * ) + */ +class IndexTidDepthModifier extends ArgumentPluginBase { function options_form(&$form, &$form_state) { } function query($group_by = FALSE) { } function pre_query() { diff --git a/lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_taxonomy.inc b/lib/Views/taxonomy/Plugin/views/argument/Taxonomy.php similarity index 70% rename from lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_taxonomy.inc rename to lib/Views/taxonomy/Plugin/views/argument/Taxonomy.php index 10fc500b37f921427e89d0bec6976155898086d9..6a11d92d7cffd92b9bbd57c83b1db79d5d7df396 100644 --- a/lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_taxonomy.inc +++ b/lib/Views/taxonomy/Plugin/views/argument/Taxonomy.php @@ -5,12 +5,23 @@ * Definition of views_handler_argument_taxonomy. */ +namespace Views\taxonomy\Plugin\views\argument; + +use Drupal\views\Plugin\views\argument\Numeric; +use Drupal\Core\Annotation\Plugin; + /** * Argument handler for basic taxonomy tid. * * @ingroup views_argument_handlers */ -class views_handler_argument_taxonomy extends views_handler_argument_numeric { + +/** + * @plugin( + * plugin_id = "taxonomy" + * ) + */ +class Taxonomy extends Numeric { /** * Override the behavior of title(). Get the title of the node. diff --git a/lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_vocabulary_machine_name.inc b/lib/Views/taxonomy/Plugin/views/argument/VocabularyMachineName.php similarity index 75% rename from lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_vocabulary_machine_name.inc rename to lib/Views/taxonomy/Plugin/views/argument/VocabularyMachineName.php index c4da1bf3d77afe123537588010a5e45a0571e521..e4d86e4fce9a813ea0bf587c7ed6c445b080896a 100644 --- a/lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_vocabulary_machine_name.inc +++ b/lib/Views/taxonomy/Plugin/views/argument/VocabularyMachineName.php @@ -5,14 +5,23 @@ * Definition of views_handler_argument_vocabulary_machine_name. */ +namespace Views\taxonomy\Plugin\views\argument; + use Drupal\views\Plugin\views\argument\String; +use Drupal\Core\Annotation\Plugin; /** * Argument handler to accept a vocabulary machine name. * * @ingroup views_argument_handlers */ -class views_handler_argument_vocabulary_machine_name extends String { + +/** + * @Plugin( + * plugin_id = "vocabulary_machine_name" + * ) + */ +class VocabularyMachineName extends String { /** * Override the behavior of title(). Get the name of the vocabulary.. */ diff --git a/lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_vocabulary_vid.inc b/lib/Views/taxonomy/Plugin/views/argument/VocabularyVid.php similarity index 75% rename from lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_vocabulary_vid.inc rename to lib/Views/taxonomy/Plugin/views/argument/VocabularyVid.php index 899ee9660e49f8d4a0f9624a8d381c61cb2de04d..cd57f5be4c82e9c684814e815b58c72fb7733182 100644 --- a/lib/Views/taxonomy/Plugin/views/argument/views_handler_argument_vocabulary_vid.inc +++ b/lib/Views/taxonomy/Plugin/views/argument/VocabularyVid.php @@ -5,6 +5,9 @@ * Definition of views_handler_argument_vocabulary_vid. */ +namespace Views\taxonomy\Plugin\views\argument; + +use Drupal\Core\Annotation\Plugin; use Drupal\views\Plugin\views\argument\Numeric; /** @@ -12,7 +15,13 @@ * * @ingroup views_argument_handlers */ -class views_handler_argument_vocabulary_vid extends Numeric { + +/** + * @Plugin( + * plugin_id = "vocabulary_vid" + * ) + */ +class VocabularyVid extends Numeric { /** * Override the behavior of title(). Get the name of the vocabulary. */ diff --git a/lib/Views/taxonomy/Plugin/views/argument_default/views_plugin_argument_default_taxonomy_tid.inc b/lib/Views/taxonomy/Plugin/views/argument_default/Tid.php similarity index 93% rename from lib/Views/taxonomy/Plugin/views/argument_default/views_plugin_argument_default_taxonomy_tid.inc rename to lib/Views/taxonomy/Plugin/views/argument_default/Tid.php index 823b5612cb029ed239cd3798b8a4c3c79f0ca6eb..8ca1bc3cfe83062b486face53082edb873e6db26 100644 --- a/lib/Views/taxonomy/Plugin/views/argument_default/views_plugin_argument_default_taxonomy_tid.inc +++ b/lib/Views/taxonomy/Plugin/views/argument_default/Tid.php @@ -5,10 +5,21 @@ * Definition of views_plugin_argument_default_taxonomy_tid. */ +namespace Views\taxonomy\Plugin\views\argument_default; + +use Drupal\Core\Annotation\Plugin; +use Drupal\Core\Annotation\Translation; +use Drupal\views\Plugin\views\argument_default\ArgumentDefaultPluginBase; + /** * Taxonomy tid default argument. + * + * @Plugin( + * plugin_id = "taxonomy_tid", + * title = @Translation("Taxonomy term ID from URL") + * ) */ -class views_plugin_argument_default_taxonomy_tid extends views_plugin_argument_default { +class Tid extends ArgumentDefaultPluginBase { function init(&$view, &$argument, $options) { parent::init($view, $argument, $options); diff --git a/lib/Views/taxonomy/Plugin/views/argument_validate/views_plugin_argument_validate_taxonomy_term.inc b/lib/Views/taxonomy/Plugin/views/argument_validate/Term.php similarity index 95% rename from lib/Views/taxonomy/Plugin/views/argument_validate/views_plugin_argument_validate_taxonomy_term.inc rename to lib/Views/taxonomy/Plugin/views/argument_validate/Term.php index a324a011704b84ec97569897e266593349d9824d..7b7e8e02266725cf97b077fc6e83fed4febcd3eb 100644 --- a/lib/Views/taxonomy/Plugin/views/argument_validate/views_plugin_argument_validate_taxonomy_term.inc +++ b/lib/Views/taxonomy/Plugin/views/argument_validate/Term.php @@ -5,10 +5,22 @@ * Contains the 'taxonomy term' argument validator plugin. */ + +namespace Views\taxonomy\Plugin\views\argument_validator; + +use Drupal\Core\Annotation\Plugin; +use Drupal\Core\Annotation\Translation; +use Drupal\views\Plugin\views\argument_validator\ArgumentValidatorPluginBase; + + /** * Validate whether an argument is an acceptable node. + * + * @Plugin( + * plugin_id = "taxonomy_term", + * title = @Translation("Taxonomy term") */ -class views_plugin_argument_validate_taxonomy_term extends views_plugin_argument_validate { +class Term extends ArgumentValidatorPluginBase { function init(&$view, &$argument, $options) { parent::init($view, $argument, $options); diff --git a/lib/Views/taxonomy/Plugin/views/field/views_handler_field_term_link_edit.inc b/lib/Views/taxonomy/Plugin/views/field/LinkEdit.php similarity index 87% rename from lib/Views/taxonomy/Plugin/views/field/views_handler_field_term_link_edit.inc rename to lib/Views/taxonomy/Plugin/views/field/LinkEdit.php index 5605b9fe070f1709be58603cb2abef62dd9590b2..8e5e4d45476b37bbf85f27c846d7d41c8d14e83e 100644 --- a/lib/Views/taxonomy/Plugin/views/field/views_handler_field_term_link_edit.inc +++ b/lib/Views/taxonomy/Plugin/views/field/LinkEdit.php @@ -5,12 +5,23 @@ * Definition of views_handler_field_term_link_edit. */ +namespace Views\taxonomy\Plugin\views\field; + +use Drupal\views\Plugin\views\field\FieldPluginBase; +use Drupal\Core\Annotation\Plugin; + /** * Field handler to present a term edit link. * * @ingroup views_field_handlers */ -class views_handler_field_term_link_edit extends views_handler_field { + +/** + * @Plugin( + * plugin_id = "term_link_edit" + * ) + */ +class LinkEdit extends FieldPluginBase { function construct() { parent::construct(); $this->additional_fields['tid'] = 'tid'; diff --git a/lib/Views/taxonomy/Plugin/views/field/views_handler_field_taxonomy.inc b/lib/Views/taxonomy/Plugin/views/field/Taxonomy.php similarity index 91% rename from lib/Views/taxonomy/Plugin/views/field/views_handler_field_taxonomy.inc rename to lib/Views/taxonomy/Plugin/views/field/Taxonomy.php index 05ee45d324e19b0af0c20e6b63386eea24e01046..7886dd1fb87fcb52afadbb6ee3ce546e48aaa91d 100644 --- a/lib/Views/taxonomy/Plugin/views/field/views_handler_field_taxonomy.inc +++ b/lib/Views/taxonomy/Plugin/views/field/Taxonomy.php @@ -5,13 +5,25 @@ * Definition of views_handler_field_taxonomy. */ + +namespace Views\taxonomy\Plugin\views\field; + +use Drupal\views\Plugin\views\field\FieldPluginBase; +use Drupal\Core\Annotation\Plugin; + /** * Field handler to provide simple renderer that allows linking to a taxonomy * term. * * @ingroup views_field_handlers */ -class views_handler_field_taxonomy extends views_handler_field { + +/** + * @Plugin( + * plugin_id = "taxonomy" + * ) + */ +class Taxonomy extends FieldPluginBase { /** * Constructor to provide additional field to add. * diff --git a/lib/Views/taxonomy/Plugin/views/field/views_handler_field_term_node_tid.inc b/lib/Views/taxonomy/Plugin/views/field/TaxonomyIndexTid.php similarity index 95% rename from lib/Views/taxonomy/Plugin/views/field/views_handler_field_term_node_tid.inc rename to lib/Views/taxonomy/Plugin/views/field/TaxonomyIndexTid.php index 7e3ad21ef98a66dc2c536227520e9c70baaf8788..4f6942135930726bb78416290a55eaedadda230b 100644 --- a/lib/Views/taxonomy/Plugin/views/field/views_handler_field_term_node_tid.inc +++ b/lib/Views/taxonomy/Plugin/views/field/TaxonomyIndexTid.php @@ -5,12 +5,23 @@ * Definition of views_handler_field_term_node_tid. */ +namespace Views\taxonomy\Plugin\views\field; + +use Drupal\views\Plugin\views\field\PrerenderList; +use Drupal\Core\Annotation\Plugin; + /** * Field handler to display all taxonomy terms of a node. * * @ingroup views_field_handlers */ -class views_handler_field_term_node_tid extends views_handler_field_prerender_list { + +/** + * @Plugin( + * plugin_id = "taxonomy_index_tid" + * ) + */ +class TaxonomyIndexTid extends PrerenderList { function init(&$view, &$options) { parent::init($view, $options); // @todo: Wouldn't it be possible to use $this->base_table and no if here? diff --git a/lib/Views/taxonomy/Plugin/views/filter/views_handler_filter_term_node_tid.inc b/lib/Views/taxonomy/Plugin/views/filter/TaxonomyIndexTid.php similarity index 97% rename from lib/Views/taxonomy/Plugin/views/filter/views_handler_filter_term_node_tid.inc rename to lib/Views/taxonomy/Plugin/views/filter/TaxonomyIndexTid.php index 8945edc0d941a6c0abe1075d244e9f51aa528cf0..fa810e1e8462c60cc457220b4ea10eb297cb3d96 100644 --- a/lib/Views/taxonomy/Plugin/views/filter/views_handler_filter_term_node_tid.inc +++ b/lib/Views/taxonomy/Plugin/views/filter/TaxonomyIndexTid.php @@ -5,12 +5,23 @@ * Definition of views_handler_filter_term_node_tid. */ +namespace Views\taxonomy\Plugin\views\filter; + +use Drupal\Core\Annotation\Plugin; +use Drupal\views\Plugin\views\filter\ManyToOne; + /** * Filter by term id. * * @ingroup views_filter_handlers */ -class views_handler_filter_term_node_tid extends views_handler_filter_many_to_one { + +/** + * @Plugin( + * plugin_id = "taxonomy_index_tid" + * ) + */ +class TaxonomyIndexTid extends ManyToOne { // Stores the exposed input for this filter. var $validated_exposed_input = NULL; diff --git a/lib/Views/taxonomy/Plugin/views/filter/views_handler_filter_term_node_tid_depth.inc b/lib/Views/taxonomy/Plugin/views/filter/TaxonomyIndexTidDepth.php similarity index 94% rename from lib/Views/taxonomy/Plugin/views/filter/views_handler_filter_term_node_tid_depth.inc rename to lib/Views/taxonomy/Plugin/views/filter/TaxonomyIndexTidDepth.php index fe12780f423d8a90b93d9112350e8772fd89c1f8..ef7f25ebe4864174f3efb6d5fd436b594a0bd5cb 100644 --- a/lib/Views/taxonomy/Plugin/views/filter/views_handler_filter_term_node_tid_depth.inc +++ b/lib/Views/taxonomy/Plugin/views/filter/TaxonomyIndexTidDepth.php @@ -5,6 +5,11 @@ * Definition of views_handler_filter_term_node_tid_depth. */ + +namespace Views\taxonomy\Plugin\views\filter; + +use Drupal\Core\Annotation\Plugin; + /** * Filter handler for taxonomy terms with depth. * @@ -13,7 +18,13 @@ * * @ingroup views_filter_handlers */ -class views_handler_filter_term_node_tid_depth extends views_handler_filter_term_node_tid { + +/** + * @Plugin( + * plugin_id = "taxonomy_index_tid_depth" + * ) + */ +class TaxonomyIndexTidDepth extends TaxonomyIndexTid { function operator_options($which = 'title') { return array( 'or' => t('Is one of'), diff --git a/lib/Views/taxonomy/Plugin/views/filter/views_handler_filter_vocabulary_machine_name.inc b/lib/Views/taxonomy/Plugin/views/filter/VocabularyMachineName.php similarity index 64% rename from lib/Views/taxonomy/Plugin/views/filter/views_handler_filter_vocabulary_machine_name.inc rename to lib/Views/taxonomy/Plugin/views/filter/VocabularyMachineName.php index 18754b2270f0f29a572b33bdae739bf479705a0c..8215aef75bd5596ae4144c8607e57033c9059b1b 100644 --- a/lib/Views/taxonomy/Plugin/views/filter/views_handler_filter_vocabulary_machine_name.inc +++ b/lib/Views/taxonomy/Plugin/views/filter/VocabularyMachineName.php @@ -5,12 +5,23 @@ * Definition of views_handler_filter_vocabulary_machine_name. */ +namespace Views\taxonomy\Plugin\views\filter; + +use Drupal\Core\Annotation\Plugin; +use Drupal\views\Plugin\views\filter\InOperator; + /** * Filter by vocabulary machine name. * * @ingroup views_filter_handlers */ -class views_handler_filter_vocabulary_machine_name extends views_handler_filter_in_operator { + +/** + * @Plugin( + * plugin_id = "vocabulary_machine_name" + * ) + */ +class VocabularyMachineName extends InOperator { function get_value_options() { if (isset($this->value_options)) { return; diff --git a/lib/Views/taxonomy/Plugin/views/filter/views_handler_filter_vocabulary_vid.inc b/lib/Views/taxonomy/Plugin/views/filter/VocabularyVid.php similarity index 65% rename from lib/Views/taxonomy/Plugin/views/filter/views_handler_filter_vocabulary_vid.inc rename to lib/Views/taxonomy/Plugin/views/filter/VocabularyVid.php index f2c4ccd3ab947e7ed15a83338374c21f5faa8451..e45f162dffc26a1afd371952de73a03939cb4e59 100644 --- a/lib/Views/taxonomy/Plugin/views/filter/views_handler_filter_vocabulary_vid.inc +++ b/lib/Views/taxonomy/Plugin/views/filter/VocabularyVid.php @@ -5,12 +5,23 @@ * Definition of views_handler_filter_vocabulary_vid. */ +namespace Views\taxonomy\Plugin\views\filter; + +use Drupal\Core\Annotation\Plugin; +use Drupal\views\Plugin\views\filter\InOperator; + /** * Filter by vocabulary id. * * @ingroup views_filter_handlers */ -class views_handler_filter_vocabulary_vid extends views_handler_filter_in_operator { + +/** + * @Plugin( + * plugin_id = "vocabulary_vid" + * ) + */ +class VocabularyVid extends InOperator { function get_value_options() { if (isset($this->value_options)) { return; diff --git a/lib/Views/taxonomy/Plugin/views/relationship/views_handler_relationship_node_term_data.inc b/lib/Views/taxonomy/Plugin/views/relationship/NodeTermData.php similarity index 94% rename from lib/Views/taxonomy/Plugin/views/relationship/views_handler_relationship_node_term_data.inc rename to lib/Views/taxonomy/Plugin/views/relationship/NodeTermData.php index 4111725d94b6c608c5eb9d585b2d24b6ac20e222..7b9ada2371321db5d5347ef454bc276816ce2c40 100644 --- a/lib/Views/taxonomy/Plugin/views/relationship/views_handler_relationship_node_term_data.inc +++ b/lib/Views/taxonomy/Plugin/views/relationship/NodeTermData.php @@ -5,15 +5,24 @@ * Definition of views_handler_relationship_node_term_data. */ +namespace Views\taxonomy\Plugin\views\relationship; + use Drupal\views\Join; use Drupal\views\Plugin\views\relationship\RelationshipPluginBase; +use Drupal\Core\Annotation\Plugin; /** * Relationship handler to return the taxonomy terms of nodes. * * @ingroup views_relationship_handlers */ -class views_handler_relationship_node_term_data extends RelationshipPluginBase { + +/** + * @Plugin( + * plugin_id = "node_term_data" + * ) + */ +class NodeTermData extends RelationshipPluginBase { function init(&$view, &$options) { parent::init($view, $options); diff --git a/lib/Views/translation/Plugin/views/argument/views_handler_argument_node_tnid.inc b/lib/Views/translation/Plugin/views/argument/NodeTnid.php similarity index 69% rename from lib/Views/translation/Plugin/views/argument/views_handler_argument_node_tnid.inc rename to lib/Views/translation/Plugin/views/argument/NodeTnid.php index 61e9ebabfa03f1f83b3b5c23413fcf7185b5dc2f..b6eb42895b9a275d9569a4107042920aacb02cd5 100644 --- a/lib/Views/translation/Plugin/views/argument/views_handler_argument_node_tnid.inc +++ b/lib/Views/translation/Plugin/views/argument/NodeTnid.php @@ -5,12 +5,23 @@ * Provide node tnid argument handler. */ +namespace Views\translation\Plugin\views\argument; + +use Drupal\views\Plugin\views\argument\Numeric; +use Drupal\Core\Annotation\Plugin; + /** * Argument handler to accept a node translation id. * * @ingroup views_argument_handlers */ -class views_handler_argument_node_tnid extends views_handler_argument_numeric { + +/** + * @Plugin( + * plugin_id = "node_tnid" + * ) + */ +class NodeTnid extends Numeric { /** * Override the behavior of title(). Get the title of the node. */ diff --git a/lib/Views/translation/Plugin/views/field/views_handler_field_node_link_translate.inc b/lib/Views/translation/Plugin/views/field/NodeLinkTranslate.php similarity index 78% rename from lib/Views/translation/Plugin/views/field/views_handler_field_node_link_translate.inc rename to lib/Views/translation/Plugin/views/field/NodeLinkTranslate.php index 3e30725c9dcc177d8f52d7e40e1e4ce32e78fa25..0a3e5e7af8d36b2c408cc970c6ecd774084d006d 100644 --- a/lib/Views/translation/Plugin/views/field/views_handler_field_node_link_translate.inc +++ b/lib/Views/translation/Plugin/views/field/NodeLinkTranslate.php @@ -5,12 +5,23 @@ * Definition of views_handler_field_node_link_translate. */ +namespace Views\translation\Plugin\views\field; + +use Views\node\Plugin\views\field\Link; +use Drupal\Core\Annotation\Plugin; + /** * Field handler to present a link node translate. * * @ingroup views_field_handlers */ -class views_handler_field_node_link_translate extends views_handler_field_node_link { + +/** + * @Plugin( + * plugin_id = "node_link_translate" + * ) + */ +class NodeLinkTranslate extends Link { function render_link($data, $values) { // ensure user has access to edit this node. $node = $this->get_value($values); diff --git a/lib/Views/translation/Plugin/views/field/views_handler_field_node_translation_link.inc b/lib/Views/translation/Plugin/views/field/NodeTranslationLink.php similarity index 85% rename from lib/Views/translation/Plugin/views/field/views_handler_field_node_translation_link.inc rename to lib/Views/translation/Plugin/views/field/NodeTranslationLink.php index eb3a1ac4f791a8945c86e11805c4e82bf4c63757..9ccc74bada12406857393879937635ac0e5e256f 100644 --- a/lib/Views/translation/Plugin/views/field/views_handler_field_node_translation_link.inc +++ b/lib/Views/translation/Plugin/views/field/NodeTranslationLink.php @@ -5,12 +5,23 @@ * Definition of views_handler_field_node_translation_link. */ +namespace Views\translation\Plugin\views\field; + +use Drupal\views\Plugin\views\field\FieldPluginBase; +use Drupal\Core\Annotation\Plugin; + /** * Field handler to present a link to the node. * * @ingroup views_field_handlers */ -class views_handler_field_node_translation_link extends views_handler_field { + +/** + * @Plugin( + * plugin_id = "node_translation_link" + * ) + */ +class NodeTranslationLink extends FieldPluginBase { function construct() { parent::construct(); $this->additional_fields['nid'] = 'nid'; diff --git a/lib/Views/translation/Plugin/views/filter/views_handler_filter_node_tnid.inc b/lib/Views/translation/Plugin/views/filter/NodeTnid.php similarity index 81% rename from lib/Views/translation/Plugin/views/filter/views_handler_filter_node_tnid.inc rename to lib/Views/translation/Plugin/views/filter/NodeTnid.php index ed4d6a9a7a2626942d2663019a0d7fbf806b6747..6a980fbcc104b42a85fb835f00791bd716339d52 100644 --- a/lib/Views/translation/Plugin/views/filter/views_handler_filter_node_tnid.inc +++ b/lib/Views/translation/Plugin/views/filter/NodeTnid.php @@ -5,12 +5,23 @@ * Definition of views_handler_filter_node_tnid. */ +namespace Views\translation\Plugin\views\filter; + +use Drupal\views\Plugin\views\filter\FilterPluginBase; +use Drupal\Core\Annotation\Plugin; + /** * Filter by whether the node is the original translation. * * @ingroup views_filter_handlers */ -class views_handler_filter_node_tnid extends views_handler_filter { + +/** + * @Plugin( + * plugin_id = "node_tnid" + * ) + */ +class NodeTnid extends FilterPluginBase { function admin_summary() { } function option_definition() { $options = parent::option_definition(); diff --git a/lib/Views/translation/Plugin/views/filter/views_handler_filter_node_tnid_child.inc b/lib/Views/translation/Plugin/views/filter/NodeTnidChild.php similarity index 66% rename from lib/Views/translation/Plugin/views/filter/views_handler_filter_node_tnid_child.inc rename to lib/Views/translation/Plugin/views/filter/NodeTnidChild.php index 51316eb332bec48ff0a21672be60442f6834d26f..1f89cca912fec8cbe1ec506e73e4b3a44cf57d83 100644 --- a/lib/Views/translation/Plugin/views/filter/views_handler_filter_node_tnid_child.inc +++ b/lib/Views/translation/Plugin/views/filter/NodeTnidChild.php @@ -5,12 +5,23 @@ * Definition of views_handler_filter_node_tnid_child. */ +namespace Views\translation\Plugin\views\filter; + +use Drupal\views\Plugin\views\filter\FilterPluginBase; +use Drupal\Core\Annotation\Plugin; + /** * Filter by whether the node is not the original translation. * * @ingroup views_filter_handlers */ -class views_handler_filter_node_tnid_child extends views_handler_filter { + +/** + * @Plugin( + * plugin_id = "node_tnid_child" + * ) + */ +class NodeTnidChild extends FilterPluginBase { function admin_summary() { } function operator_form(&$form, &$form_state) { } function can_expose() { return FALSE; } diff --git a/lib/Views/translation/Plugin/views/relationship/views_handler_relationship_translation.inc b/lib/Views/translation/Plugin/views/relationship/Translation.php similarity index 94% rename from lib/Views/translation/Plugin/views/relationship/views_handler_relationship_translation.inc rename to lib/Views/translation/Plugin/views/relationship/Translation.php index 9766322a193fcc7e7bca7b2e4156e95f43323187..f36d14d7e93056705d2da4327b45107c085bf7b4 100644 --- a/lib/Views/translation/Plugin/views/relationship/views_handler_relationship_translation.inc +++ b/lib/Views/translation/Plugin/views/relationship/Translation.php @@ -5,8 +5,11 @@ * Definition of views_handler_relationship_translation. */ +namespace Views\translation\Plugin\views\relationship; + use Drupal\views\Join; use Drupal\views\Plugin\views\relationship\RelationshipPluginBase; +use Drupal\Core\Annotation\Plugin; /** * Handles relationships for content translation sets and provides multiple @@ -14,7 +17,13 @@ * * @ingroup views_relationship_handlers */ -class views_handler_relationship_translation extends RelationshipPluginBase { + +/** + * @Plugin( + * plugin_id = "translation" + * ) + */ +class Translation extends RelationshipPluginBase { function option_definition() { $options = parent::option_definition(); $options['language'] = array('default' => 'current'); diff --git a/lib/Views/user/Plugin/views/argument/views_handler_argument_users_roles_rid.inc b/lib/Views/user/Plugin/views/argument/RolesRid.php similarity index 73% rename from lib/Views/user/Plugin/views/argument/views_handler_argument_users_roles_rid.inc rename to lib/Views/user/Plugin/views/argument/RolesRid.php index b82102760f4e58be0e43aebdda3bcdcb8e694aae..989e235ad9f590b42cdb564cbd5e427ea555ce19 100644 --- a/lib/Views/user/Plugin/views/argument/views_handler_argument_users_roles_rid.inc +++ b/lib/Views/user/Plugin/views/argument/RolesRid.php @@ -5,6 +5,9 @@ * Definition of views_handler_argument_users_roles_rid. */ +namespace Views\user\Plugin\views\argument; + +use Drupal\Core\Annotation\Plugin; use Drupal\views\Plugin\views\argument\ManyToOne; /** @@ -12,7 +15,13 @@ * * @ingroup views_argument_handlers */ -class views_handler_argument_users_roles_rid extends ManyToOne { + +/** + * @Plugin( + * plugin_id = "user_roles_rid" + * ) + */ +class RolesRid extends ManyToOne { function title_query() { $titles = array(); diff --git a/lib/Views/user/Plugin/views/argument/views_handler_argument_user_uid.inc b/lib/Views/user/Plugin/views/argument/Uid.php similarity index 80% rename from lib/Views/user/Plugin/views/argument/views_handler_argument_user_uid.inc rename to lib/Views/user/Plugin/views/argument/Uid.php index e1532221a498114e870c9a385a0013a23fc1ccdf..1e683a40db299c82c1110bcf3fdcbd5eb5c7d6c6 100644 --- a/lib/Views/user/Plugin/views/argument/views_handler_argument_user_uid.inc +++ b/lib/Views/user/Plugin/views/argument/Uid.php @@ -5,6 +5,9 @@ * Definition of views_handler_argument_user_uid. */ +namespace Views\user\Plugin\views\argument; + +use Drupal\Core\Annotation\Plugin; use Drupal\views\Plugin\views\argument\Numeric; /** @@ -12,7 +15,13 @@ * * @ingroup views_argument_handlers */ -class views_handler_argument_user_uid extends Numeric { + +/** + * @Plugin( + * plugin_id = "user_uid" + * ) + */ +class Uid extends Numeric { /** * Override the behavior of title(). Get the name of the user. * diff --git a/lib/Views/user/Plugin/views/argument_default/views_plugin_argument_default_current_user.inc b/lib/Views/user/Plugin/views/argument_default/CurrentUser.php similarity index 56% rename from lib/Views/user/Plugin/views/argument_default/views_plugin_argument_default_current_user.inc rename to lib/Views/user/Plugin/views/argument_default/CurrentUser.php index e6d5f06ce16fb0e02ac75dfed97bbe70aba428f8..c52c5aca0f4f00164df93bfe5463a06026f400d7 100644 --- a/lib/Views/user/Plugin/views/argument_default/views_plugin_argument_default_current_user.inc +++ b/lib/Views/user/Plugin/views/argument_default/CurrentUser.php @@ -5,14 +5,23 @@ * Contains the current user argument default plugin. */ +namespace Views\user\Plugin\views\argument_default; + +use Drupal\Core\Annotation\Plugin; +use Drupal\Core\Annotation\Translation; use Drupal\views\Plugin\views\argument_default\ArgumentDefaultPluginBase; /** * Default argument plugin to extract the global $user * * This plugin actually has no options so it odes not need to do a great deal. + * + * @Plugin( + * plugin_id = "current_user", + * title = @Translation("User ID from logged in user"), + * ) */ -class views_plugin_argument_default_current_user extends ArgumentDefaultPluginBase { +class CurrentUser extends ArgumentDefaultPluginBase { function get_argument() { global $user; return $user->uid; diff --git a/lib/Views/user/Plugin/views/argument_default/views_plugin_argument_default_user.inc b/lib/Views/user/Plugin/views/argument_default/User.php similarity index 87% rename from lib/Views/user/Plugin/views/argument_default/views_plugin_argument_default_user.inc rename to lib/Views/user/Plugin/views/argument_default/User.php index ea2f9185b022b1a3d59c97fd084c23c5fb4f9c04..55e8b6daa4d92815ba5e4fbdba517fbfc0a75738 100644 --- a/lib/Views/user/Plugin/views/argument_default/views_plugin_argument_default_user.inc +++ b/lib/Views/user/Plugin/views/argument_default/User.php @@ -5,12 +5,21 @@ * Contains the user from URL argument default plugin. */ +namespace Views\user\Plugin\views\argument_default; + +use Drupal\Core\Annotation\Plugin; +use Drupal\Core\Annotation\Translation; use Drupal\views\Plugin\views\argument_default\ArgumentDefaultPluginBase; /** * Default argument plugin to extract a user via menu_get_object. + * + * @Plugin( + * plugin_id = "user", + * title = @Translation("User ID from URL"), + * ) */ -class views_plugin_argument_default_user extends ArgumentDefaultPluginBase { +class User extends ArgumentDefaultPluginBase { function option_definition() { $options = parent::option_definition(); $options['user'] = array('default' => '', 'bool' => TRUE, 'translatable' => FALSE); diff --git a/lib/Views/user/Plugin/views/argument_validate/views_plugin_argument_validate_user.inc b/lib/Views/user/Plugin/views/argument_validator/User.php similarity index 95% rename from lib/Views/user/Plugin/views/argument_validate/views_plugin_argument_validate_user.inc rename to lib/Views/user/Plugin/views/argument_validator/User.php index 2db795f45e503a4f759adf5b47c2f49ef0b3968b..3cbca124e9ee7cabe00140e124da2313e651fbcd 100644 --- a/lib/Views/user/Plugin/views/argument_validate/views_plugin_argument_validate_user.inc +++ b/lib/Views/user/Plugin/views/argument_validator/User.php @@ -5,6 +5,10 @@ * Definition of views_plugin_argument_validate_user. */ +namespace Views\user\Plugin\views\argument_validator; + +use Drupal\Core\Annotation\Plugin; +use Drupal\Core\Annotation\Translation; use Drupal\views\Plugin\views\argument_validator\ArgumentValidatorPluginBase; /** @@ -13,8 +17,13 @@ * This supports either numeric arguments (UID) or strings (username) and * converts either one into the user's UID. This validator also sets the * argument's title to the username. + * + * @Plugin( + * plugin_id = "user", + * title = @Translation("User"), + * ) */ -class views_plugin_argument_validate_user extends ArgumentValidatorPluginBase { +class User extends ArgumentValidatorPluginBase { function option_definition() { $options = parent::option_definition(); $options['type'] = array('default' => 'uid'); diff --git a/lib/Views/user/Plugin/views/row/views_plugin_row_user_view.inc b/lib/Views/user/Plugin/views/row/View.php similarity index 88% rename from lib/Views/user/Plugin/views/row/views_plugin_row_user_view.inc rename to lib/Views/user/Plugin/views/row/View.php index 4e3ee0c8f82953ce6a5ef3f51208aa8f95b6b48a..bdbb7ebff91f6e726a6d285eae01c0be79ef9ce3 100644 --- a/lib/Views/user/Plugin/views/row/views_plugin_row_user_view.inc +++ b/lib/Views/user/Plugin/views/row/View.php @@ -12,7 +12,18 @@ * * @ingroup views_row_plugins */ -class views_plugin_row_user_view extends RowPluginBase { +/** + * @Plugin( + * plugin_id = "user", + * title = @Translation("User"), + * help = @Translation("Display the user with standard user view."), + * base = {"users"}, + * uses_options = TRUE, + * type = "normal", + * help_topic = "style-users" + * ) + */ +class View extends RowPluginBase { var $base_table = 'users'; var $base_field = 'uid'; diff --git a/modules/taxonomy.views.inc b/modules/taxonomy.views.inc index 3e4b757d0d55c58fb67a9e7887fbf4d7de1a5795..71d5471e19f390d2660f8792e8fbc501a772e931 100644 --- a/modules/taxonomy.views.inc +++ b/modules/taxonomy.views.inc @@ -57,11 +57,11 @@ function taxonomy_views_data() { ), 'filter' => array( 'help' => t('Filter the results of "Taxonomy: Term" to a particular vocabulary.'), - 'handler' => 'views_handler_filter_vocabulary_machine_name', + 'plugin_id' => 'vocabulary_machine_name', ), 'argument' => array( 'help' => t('Filter the results of "Taxonomy: Term" to a particular vocabulary.'), - 'handler' => 'views_handler_argument_vocabulary_machine_name', + 'plugin_id' => 'vocabulary_machine_name', ), ); $data['taxonomy_vocabulary']['vid'] = array( @@ -72,7 +72,7 @@ function taxonomy_views_data() { 'click sortable' => TRUE, ), 'argument' => array( - 'handler' => 'views_handler_argument_vocabulary_vid', + 'plugin_id' => 'vocabulary_vid', 'name field' => 'name', ), 'sort' => array( @@ -153,14 +153,14 @@ function taxonomy_views_data() { 'plugin_id' => 'standard', ), 'argument' => array( - 'handler' => 'views_handler_argument_taxonomy', + 'plugin_id' => 'taxonomy', 'name field' => 'name', 'zero is null' => TRUE, ), 'filter' => array( 'title' => t('Term'), 'help' => t('Taxonomy term chosen from autocomplete or select widget.'), - 'handler' => 'views_handler_filter_term_node_tid', + 'plugin_id' => 'taxonomy_tid', 'hierarchy table' => 'taxonomy_term_hierarchy', 'numeric' => TRUE, ), @@ -197,7 +197,7 @@ function taxonomy_views_data() { 'title' => t('Name'), 'help' => t('The taxonomy term name.'), 'field' => array( - 'handler' => 'views_handler_field_taxonomy', + 'plugin_id' => 'taxonomy', 'click sortable' => TRUE, ), 'sort' => array( @@ -252,7 +252,7 @@ function taxonomy_views_data() { 'title' => t('Vocabulary'), 'help' => t('Filter the results of "Taxonomy: Term" to a particular vocabulary.'), 'filter' => array( - 'handler' => 'views_handler_filter_vocabulary_vid', + 'plugin_id' => 'vocabulary_vid', ), ); @@ -261,7 +261,7 @@ function taxonomy_views_data() { 'field' => array( 'title' => t('Term edit link'), 'help' => t('Provide a simple link to edit the term.'), - 'handler' => 'views_handler_field_term_link_edit', + 'plugin_id' => 'term_link_edit', ), ); @@ -308,7 +308,7 @@ function taxonomy_views_data() { 'title' => t('Has taxonomy term ID'), 'help' => t('Display content if it has the selected taxonomy terms.'), 'argument' => array( - 'handler' => 'views_handler_argument_term_node_tid', + 'plugin_id' => 'taxonomy_index_tid', 'name table' => 'taxonomy_term_data', 'name field' => 'name', 'empty field name' => t('Uncategorized'), @@ -317,7 +317,7 @@ function taxonomy_views_data() { ), 'filter' => array( 'title' => t('Has taxonomy term'), - 'handler' => 'views_handler_filter_term_node_tid', + 'plugin_id' => 'taxonomy_index_tid', 'hierarchy table' => 'taxonomy_term_hierarchy', 'numeric' => TRUE, 'skip base' => 'taxonomy_term_data', @@ -366,7 +366,7 @@ function taxonomy_views_data() { ), 'argument' => array( 'help' => t('The parent term of the term.'), - 'handler' => 'views_handler_argument_taxonomy', + 'plugin_id' => 'taxonomy', ), ); @@ -381,14 +381,14 @@ function taxonomy_views_data_alter(&$data) { 'title' => t('Taxonomy terms on node'), 'help' => t('Relate nodes to taxonomy terms, specifiying which vocabulary or vocabularies to use. This relationship will cause duplicated records if there are multiple terms.'), 'relationship' => array( - 'handler' => 'views_handler_relationship_node_term_data', + 'plugin_id' => 'node_term_data', 'label' => t('term'), 'base' => 'taxonomy_term_data', ), 'field' => array( 'title' => t('All taxonomy terms'), 'help' => t('Display all taxonomy terms associated with a node from specified vocabularies.'), - 'handler' => 'views_handler_field_term_node_tid', + 'plugin_id' => 'taxonomy_index_tid', 'no group by' => TRUE, ), ); @@ -398,12 +398,12 @@ function taxonomy_views_data_alter(&$data) { 'real field' => 'nid', 'argument' => array( 'title' => t('Has taxonomy term ID (with depth)'), - 'handler' => 'views_handler_argument_term_node_tid_depth', + 'plugin_id' => 'taxonomy_index_tid_depth', 'accept depth modifier' => TRUE, ), 'filter' => array( 'title' => t('Has taxonomy terms (with depth)'), - 'handler' => 'views_handler_filter_term_node_tid_depth', + 'plugin_id' => 'taxonomy_index_tid_depth', ), ); @@ -411,7 +411,7 @@ function taxonomy_views_data_alter(&$data) { 'title' => t('Has taxonomy term ID depth modifier'), 'help' => t('Allows the "depth" for Taxonomy: Term ID (with depth) to be modified via an additional contextual filter value.'), 'argument' => array( - 'handler' => 'views_handler_argument_term_node_tid_depth_modifier', + 'plugin_id' => 'taxonomy_index_tid_depth_modifier', ), ); } @@ -429,7 +429,7 @@ function taxonomy_field_views_data($field) { foreach ($data as $table_name => $table_data) { foreach ($table_data as $field_name => $field_data) { if (isset($field_data['filter']) && $field_name != 'delta') { - $data[$table_name][$field_name]['filter']['handler'] = 'views_handler_filter_term_node_tid'; + $data[$table_name][$field_name]['filter']['plugin_id'] = 'taxonomy_index_tid'; $data[$table_name][$field_name]['filter']['vocabulary'] = $field['settings']['allowed_values'][0]['vocabulary']; } } @@ -466,7 +466,7 @@ function taxonomy_field_views_data_views_data_alter(&$data, $field) { $data['taxonomy_term_data'][$pseudo_field_name]['relationship'] = array( 'title' => t('@entity using @field', array('@entity' => $entity, '@field' => $label)), 'help' => t('Relate each @entity with a @field set to the term.', array('@entity' => $entity, '@field' => $label)), - 'handler' => 'views_handler_relationship_entity_reverse', + 'plugin_id' => 'entity_reverse', 'field_name' => $field['field_name'], 'field table' => _field_sql_storage_tablename($field), 'field field' => $field['field_name'] . '_tid', @@ -488,30 +488,6 @@ function taxonomy_field_views_data_views_data_alter(&$data, $field) { } } -/** - * Implements hook_views_plugins(). - */ -function taxonomy_views_plugins() { - return array( - 'module' => 'views', // This just tells our themes are elsewhere. - 'argument validator' => array( - 'taxonomy_term' => array( - 'title' => t('Taxonomy term'), - 'handler' => 'views_plugin_argument_validate_taxonomy_term', - 'path' => drupal_get_path('module', 'views') . '/modules/taxonomy', // not necessary for most modules - ), - ), - 'argument default' => array( - 'taxonomy_tid' => array( - 'title' => t('Taxonomy term ID from URL'), - 'handler' => 'views_plugin_argument_default_taxonomy_tid', - 'path' => drupal_get_path('module', 'views') . '/modules/taxonomy', - 'parent' => 'fixed', - ), - ), - ); -} - /** * Helper function to set a breadcrumb for taxonomy. */ diff --git a/modules/translation.views.inc b/modules/translation.views.inc index dd975264cc32b3fc32c40f09154c3c7c32a2b813..c55e513e70e215d518cef00328e8f3f56640848c 100644 --- a/modules/translation.views.inc +++ b/modules/translation.views.inc @@ -26,14 +26,14 @@ function translation_views_data_alter(&$data) { 'title' => t('Translation set node ID'), 'help' => t('The ID of the translation set the content belongs to.'), 'field' => array( - 'handler' => 'views_handler_field_node', + 'plugin_id' => 'node', 'click sortable' => TRUE, ), 'filter' => array( 'plugin_id' => 'numeric', ), 'argument' => array( - 'handler' => 'views_handler_argument_node_tnid', + 'plugin_id' => 'node_tnid', 'name field' => 'title', // the field to display in the summary. 'numeric' => TRUE, 'validate type' => 'tnid', @@ -63,7 +63,7 @@ function translation_views_data_alter(&$data) { 'base field' => 'tnid', 'relationship table' => 'node', 'relationship field' => 'nid', - 'handler' => 'views_handler_relationship_translation', + 'plugin_id' => 'translation', 'label' => t('Translations'), ), ); @@ -74,7 +74,7 @@ function translation_views_data_alter(&$data) { 'title' => t('Source translation'), 'help' => t('Content that is either untranslated or is the original version of a translation set.'), 'filter' => array( - 'handler' => 'views_handler_filter_node_tnid', + 'plugin_id' => 'node_tnid', ), ); @@ -84,7 +84,7 @@ function translation_views_data_alter(&$data) { 'title' => t('Child translation'), 'help' => t('Content that is a translation of a source translation.'), 'filter' => array( - 'handler' => 'views_handler_filter_node_tnid_child', + 'plugin_id' => 'node_tnid_child', ), ); @@ -113,7 +113,7 @@ function translation_views_data_alter(&$data) { 'title' => t('Translate link'), 'help' => t('Provide a simple link to translate the node.'), 'field' => array( - 'handler' => 'views_handler_field_node_link_translate', + 'plugin_id' => 'node_link_translate', ), ); diff --git a/modules/user.views.inc b/modules/user.views.inc index 4e0dd88af90053706793e59f6a13798ebfa3d94b..c7f5efd58d4e0c7f7400951a233ed769f7d7f652 100644 --- a/modules/user.views.inc +++ b/modules/user.views.inc @@ -531,30 +531,6 @@ function user_views_data() { */ function user_views_plugins() { return array( - 'module' => 'views', // This just tells our themes are elsewhere. - 'row' => array( - 'user' => array( - 'title' => t('User'), - 'help' => t('Display the user with standard user view.'), - 'handler' => 'views_plugin_row_user_view', - 'base' => array('users'), // only works with 'users' as base. - 'uses options' => TRUE, - 'type' => 'normal', - 'help topic' => 'style-users', - ), - ), - 'argument default' => array( - 'user' => array( - 'title' => t('User ID from URL'), - 'handler' => 'views_plugin_argument_default_user', - 'path' => drupal_get_path('module', 'views') . '/modules/user', // not necessary for most modules - ), - 'current_user' => array( - 'title' => t('User ID from logged in user'), - 'handler' => 'views_plugin_argument_default_current_user', - 'path' => drupal_get_path('module', 'views') . '/modules/user', // not necessary for most modules - ), - ), 'argument validator' => array( 'user' => array( 'title' => t('User'),