From d116463bf610fda5d8fc9e45a7809d91a57219cb Mon Sep 17 00:00:00 2001 From: Daniel Wehner <daniel.wehner@erdfisch.de> Date: Sat, 28 Jul 2012 11:04:04 -0500 Subject: [PATCH] convert fields to annotation --- help/api-example.html | 4 ++-- .../views/Plugins/views/field/Boolean.php | 7 +++++++ .../Plugins/views/field/ContextualLinks.php | 8 ++++++++ .../views/Plugins/views/field/Counter.php | 8 ++++++++ .../views/Plugins/views/field/Custom.php | 8 ++++++++ lib/Drupal/views/Plugins/views/field/Date.php | 8 ++++++++ .../views/Plugins/views/field/Entity.php | 8 ++++++++ .../Plugins/views/field/FieldPluginBase.php | 8 +++++++- .../views/Plugins/views/field/FileSize.php | 8 +++++++- .../views/Plugins/views/field/MachineName.php | 8 ++++++++ .../views/Plugins/views/field/Markup.php | 8 ++++++++ lib/Drupal/views/Plugins/views/field/Math.php | 8 ++++++++ .../views/Plugins/views/field/Numeric.php | 8 ++++++++ .../Plugins/views/field/PrerenderList.php | 8 ++++++++ .../views/Plugins/views/field/Serialized.php | 8 ++++++++ .../Plugins/views/field/TimeInterval.php | 8 ++++++++ lib/Drupal/views/Plugins/views/field/Url.php | 8 ++++++++ lib/Drupal/views/Plugins/views/field/Xss.php | 7 +++++++ lib/Drupal/views/Tests/ViewsSqlTest.php | 10 +++++----- modules/aggregator.views.inc | 18 ++++++++--------- modules/book.views.inc | 4 ++-- modules/comment.views.inc | 20 +++++++++---------- modules/field.views.inc | 2 +- modules/language.views.inc | 8 ++++---- modules/locale.views.inc | 14 ++++++------- modules/node.views.inc | 14 ++++++------- modules/poll.views.inc | 2 +- modules/statistics.views.inc | 18 ++++++++--------- modules/system.views.inc | 20 +++++++++---------- modules/taxonomy.views.inc | 16 +++++++-------- modules/translation.views.inc | 4 ++-- modules/user.views.inc | 18 ++++++++--------- modules/views.views.inc | 8 ++++---- views.api.php | 8 ++++---- 34 files changed, 226 insertions(+), 96 deletions(-) diff --git a/help/api-example.html b/help/api-example.html index e3b59d03ede8..69011a33f0c2 100644 --- a/help/api-example.html +++ b/help/api-example.html @@ -73,7 +73,7 @@ 'title' => t('Quantity'), 'help' => t('Quantity of items.'), 'field' => array( - 'handler' => 'views_handler_field_numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'filter' => array( @@ -90,7 +90,7 @@ 'help' => t('Color of item.'), 'field' => array( - 'handler' => 'views_handler_field', + 'plugin_id' => 'standard', 'click sortable' => TRUE, ), 'filter' => array( diff --git a/lib/Drupal/views/Plugins/views/field/Boolean.php b/lib/Drupal/views/Plugins/views/field/Boolean.php index 2900d4f21ca5..817373856c5e 100644 --- a/lib/Drupal/views/Plugins/views/field/Boolean.php +++ b/lib/Drupal/views/Plugins/views/field/Boolean.php @@ -6,6 +6,7 @@ */ namespace Drupal\views\Plugins\views\field; +use Drupal\Core\Annotation\Plugin; /** * A handler to provide proper displays for booleans. @@ -23,6 +24,12 @@ * * @ingroup views_field_handlers */ + +/** + * @plugin( + * plugin_id = "boolean" + * ) + */ class Boolean extends FieldPluginBase { function option_definition() { $options = parent::option_definition(); diff --git a/lib/Drupal/views/Plugins/views/field/ContextualLinks.php b/lib/Drupal/views/Plugins/views/field/ContextualLinks.php index 579671d4b703..9c66ca3dd6ba 100644 --- a/lib/Drupal/views/Plugins/views/field/ContextualLinks.php +++ b/lib/Drupal/views/Plugins/views/field/ContextualLinks.php @@ -7,11 +7,19 @@ namespace Drupal\views\Plugins\views\field; +use Drupal\Core\Annotation\Plugin; + /** * Provides a handler that adds contextual links. * * @ingroup views_field_handlers */ + +/** + * @plugin( + * plugin_id = "contextual_links" + * ) + */ class ContextualLinks extends FieldPluginBase { function option_definition() { $options = parent::option_definition(); diff --git a/lib/Drupal/views/Plugins/views/field/Counter.php b/lib/Drupal/views/Plugins/views/field/Counter.php index 077a540da186..96f05da12cfe 100644 --- a/lib/Drupal/views/Plugins/views/field/Counter.php +++ b/lib/Drupal/views/Plugins/views/field/Counter.php @@ -7,11 +7,19 @@ namespace Drupal\views\Plugins\views\field; +use Drupal\Core\Annotation\Plugin; + /** * Field handler to show a counter of the current row. * * @ingroup views_field_handlers */ + +/** + * @plugin( + * plugin_id = "counter" + * ) + */ class Counter extends FieldPluginBase { function option_definition() { $options = parent::option_definition(); diff --git a/lib/Drupal/views/Plugins/views/field/Custom.php b/lib/Drupal/views/Plugins/views/field/Custom.php index d791f4ab8d4c..6402b9763397 100644 --- a/lib/Drupal/views/Plugins/views/field/Custom.php +++ b/lib/Drupal/views/Plugins/views/field/Custom.php @@ -7,11 +7,19 @@ namespace Drupal\views\Plugins\views\field; +use Drupal\Core\Annotation\Plugin; + /** * A handler to provide a field that is completely custom by the administrator. * * @ingroup views_field_handlers */ + +/** + * @plugin( + * plugin_id = "custom" + * ) + */ class Custom extends FieldPluginBase { function query() { // do nothing -- to override the parent query. diff --git a/lib/Drupal/views/Plugins/views/field/Date.php b/lib/Drupal/views/Plugins/views/field/Date.php index 8501fd1e168f..463ea28862e0 100644 --- a/lib/Drupal/views/Plugins/views/field/Date.php +++ b/lib/Drupal/views/Plugins/views/field/Date.php @@ -7,11 +7,19 @@ namespace Drupal\views\Plugins\views\field; +use Drupal\Core\Annotation\Plugin; + /** * A handler to provide proper displays for dates. * * @ingroup views_field_handlers */ + +/** + * @plugin( + * plugin_id = "date" + * ) + */ class Date extends FieldPluginBase { function option_definition() { $options = parent::option_definition(); diff --git a/lib/Drupal/views/Plugins/views/field/Entity.php b/lib/Drupal/views/Plugins/views/field/Entity.php index c6553b598389..f979cd5b20d5 100644 --- a/lib/Drupal/views/Plugins/views/field/Entity.php +++ b/lib/Drupal/views/Plugins/views/field/Entity.php @@ -7,6 +7,8 @@ namespace Drupal\views\Plugins\views\field; +use Drupal\Core\Annotation\Plugin; + /** * A handler to display data from entity objects. * @@ -18,6 +20,12 @@ * * @ingroup views_field_handlers */ + +/** + * @plugin( + * plugin_id = "entity" + * ) + */ class Entity extends FieldPluginBase { /** diff --git a/lib/Drupal/views/Plugins/views/field/FieldPluginBase.php b/lib/Drupal/views/Plugins/views/field/FieldPluginBase.php index dce63a3135c2..1b51b1faf4a0 100644 --- a/lib/Drupal/views/Plugins/views/field/FieldPluginBase.php +++ b/lib/Drupal/views/Plugins/views/field/FieldPluginBase.php @@ -7,8 +7,8 @@ namespace Drupal\views\Plugins\views\field; -use Drupal\views\Plugins\views\Plugin; use Drupal\views\Plugins\views\Handler; +use Drupal\Core\Annotation\Plugin; /** * @defgroup views_field_handlers Views field handlers @@ -47,6 +47,12 @@ * * @ingroup views_field_handlers */ + +/** + * @plugin( + * plugin_id = "standard" + * ) + */ class FieldPluginBase extends Handler { var $field_alias = 'unknown'; diff --git a/lib/Drupal/views/Plugins/views/field/FileSize.php b/lib/Drupal/views/Plugins/views/field/FileSize.php index 421c2839b9a3..5876ca24ebf8 100644 --- a/lib/Drupal/views/Plugins/views/field/FileSize.php +++ b/lib/Drupal/views/Plugins/views/field/FileSize.php @@ -5,13 +5,19 @@ */ namespace Drupal\views\Plugins\views\field; -use Drupal\views\Plugins\views\field\FieldPluginBase; +use Drupal\Core\Annotation\Plugin; /** * Render a numeric value as a size. * * @ingroup views_field_handlers */ + +/** + * @plugin( + * plugin_id = "file_size" + * ) + */ class FileSize extends FieldPluginBase { function option_definition() { $options = parent::option_definition(); diff --git a/lib/Drupal/views/Plugins/views/field/MachineName.php b/lib/Drupal/views/Plugins/views/field/MachineName.php index 5b8e33954ef6..7fc2a5bddef9 100644 --- a/lib/Drupal/views/Plugins/views/field/MachineName.php +++ b/lib/Drupal/views/Plugins/views/field/MachineName.php @@ -7,6 +7,8 @@ namespace Drupal\views\Plugins\views\field; +use Drupal\Core\Annotation\Plugin; + /** * Field handler whichs allows to show machine name content as human name. * @ingroup views_field_handlers @@ -15,6 +17,12 @@ * - options callback: The function to call in order to generate the value options. If omitted, the options 'Yes' and 'No' will be used. * - options arguments: An array of arguments to pass to the options callback. */ + +/** + * @plugin( + * plugin_id = "machine_name" + * ) + */ class MachineName extends FieldPluginBase { /** * @var array Stores the available options. diff --git a/lib/Drupal/views/Plugins/views/field/Markup.php b/lib/Drupal/views/Plugins/views/field/Markup.php index 909a878a579d..32ddef95bc29 100644 --- a/lib/Drupal/views/Plugins/views/field/Markup.php +++ b/lib/Drupal/views/Plugins/views/field/Markup.php @@ -7,6 +7,8 @@ namespace Drupal\views\Plugins\views\field; +use Drupal\Core\Annotation\Plugin; + /** * A handler to run a field through check_markup, using a companion * format field. @@ -18,6 +20,12 @@ * * @ingroup views_field_handlers */ + +/** + * @plugin( + * plugin_id = "markup" + * ) + */ class Markup extends FieldPluginBase { /** * Constructor; calls to base object constructor. diff --git a/lib/Drupal/views/Plugins/views/field/Math.php b/lib/Drupal/views/Plugins/views/field/Math.php index e928c42dcdae..ce2f39364ed7 100644 --- a/lib/Drupal/views/Plugins/views/field/Math.php +++ b/lib/Drupal/views/Plugins/views/field/Math.php @@ -7,6 +7,8 @@ namespace Drupal\views\Plugins\views\field; +use Drupal\Core\Annotation\Plugin; + /** * Render a mathematical expression as a numeric value * @@ -16,6 +18,12 @@ * * @ingroup views_field_handlers */ + +/** + * @plugin( + * plugin_id = "math" + * ) + */ class Math extends FieldPluginBase { function option_definition() { $options = parent::option_definition(); diff --git a/lib/Drupal/views/Plugins/views/field/Numeric.php b/lib/Drupal/views/Plugins/views/field/Numeric.php index 8173cf2562b2..397846ef05d8 100644 --- a/lib/Drupal/views/Plugins/views/field/Numeric.php +++ b/lib/Drupal/views/Plugins/views/field/Numeric.php @@ -7,6 +7,8 @@ namespace Drupal\views\Plugins\views\field; +use Drupal\Core\Annotation\Plugin; + /** * Render a field as a numeric value * @@ -16,6 +18,12 @@ * * @ingroup views_field_handlers */ + +/** + * @plugin( + * plugin_id = "numeric" + * ) + */ class Numeric extends FieldPluginBase { function option_definition() { $options = parent::option_definition(); diff --git a/lib/Drupal/views/Plugins/views/field/PrerenderList.php b/lib/Drupal/views/Plugins/views/field/PrerenderList.php index bfcd68388676..7c5bae1edcf1 100644 --- a/lib/Drupal/views/Plugins/views/field/PrerenderList.php +++ b/lib/Drupal/views/Plugins/views/field/PrerenderList.php @@ -7,6 +7,8 @@ namespace Drupal\views\Plugins\views\field; +use Drupal\Core\Annotation\Plugin; + /** * Field handler to provide a list of items. * @@ -17,6 +19,12 @@ * * @ingroup views_field_handlers */ + +/** + * @plugin( + * plugin_id = "prerender_list" + * ) + */ class PrerenderList extends FieldPluginBase { /** * Stores all items which are used to render the items. diff --git a/lib/Drupal/views/Plugins/views/field/Serialized.php b/lib/Drupal/views/Plugins/views/field/Serialized.php index 27106ad05b65..db3e31d2d2e2 100644 --- a/lib/Drupal/views/Plugins/views/field/Serialized.php +++ b/lib/Drupal/views/Plugins/views/field/Serialized.php @@ -7,11 +7,19 @@ namespace Drupal\views\Plugins\views\field; +use Drupal\Core\Annotation\Plugin; + /** * Field handler to show data of serialized fields. * * @ingroup views_field_handlers */ + +/** + * @plugin( + * plugin_id = "serialized" + * ) + */ class Serialized extends FieldPluginBase { function option_definition() { diff --git a/lib/Drupal/views/Plugins/views/field/TimeInterval.php b/lib/Drupal/views/Plugins/views/field/TimeInterval.php index 67cfaefb32b3..38d5ec2cfb90 100644 --- a/lib/Drupal/views/Plugins/views/field/TimeInterval.php +++ b/lib/Drupal/views/Plugins/views/field/TimeInterval.php @@ -7,11 +7,19 @@ namespace Drupal\views\Plugins\views\field; +use Drupal\Core\Annotation\Plugin; + /** * A handler to provide proper displays for time intervals. * * @ingroup views_field_handlers */ + +/** + * @plugin( + * plugin_id = "time_interval" + * ) + */ class TimeInterval extends FieldPluginBase { function option_definition() { $options = parent::option_definition(); diff --git a/lib/Drupal/views/Plugins/views/field/Url.php b/lib/Drupal/views/Plugins/views/field/Url.php index 6d9a2229e962..4db114b16e86 100644 --- a/lib/Drupal/views/Plugins/views/field/Url.php +++ b/lib/Drupal/views/Plugins/views/field/Url.php @@ -7,11 +7,19 @@ namespace Drupal\views\Plugins\views\field; +use Drupal\Core\Annotation\Plugin; + /** * Field handler to provide simple renderer that turns a URL into a clickable link. * * @ingroup views_field_handlers */ + +/** + * @plugin( + * plugin_id = "url" + * ) + */ class Url extends FieldPluginBase { function option_definition() { $options = parent::option_definition(); diff --git a/lib/Drupal/views/Plugins/views/field/Xss.php b/lib/Drupal/views/Plugins/views/field/Xss.php index 9467a3c259cf..63bbc4c48bea 100644 --- a/lib/Drupal/views/Plugins/views/field/Xss.php +++ b/lib/Drupal/views/Plugins/views/field/Xss.php @@ -6,12 +6,19 @@ namespace Drupal\views\Plugins\views\field; use Drupal\views\Plugins\views\field\FieldPluginBase; +use Drupal\Core\Annotation\Plugin; /** * A handler to run a field through simple XSS filtering. * * @ingroup views_field_handlers */ + +/** + * @plugin( + * plugin_id = "xss" + * ) + */ class Xss extends FieldPluginBase { function render($values) { $value = $this->get_value($values); diff --git a/lib/Drupal/views/Tests/ViewsSqlTest.php b/lib/Drupal/views/Tests/ViewsSqlTest.php index deb70bd325f6..6df3819ae00f 100644 --- a/lib/Drupal/views/Tests/ViewsSqlTest.php +++ b/lib/Drupal/views/Tests/ViewsSqlTest.php @@ -122,7 +122,7 @@ protected function viewsData() { 'title' => t('ID'), 'help' => t('The test data ID'), 'field' => array( - 'handler' => 'views_handler_field_numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'argument' => array( @@ -139,7 +139,7 @@ protected function viewsData() { 'title' => t('Name'), 'help' => t('The name of the person'), 'field' => array( - 'handler' => 'views_handler_field', + 'plugin_id' => 'standard', 'click sortable' => TRUE, ), 'argument' => array( @@ -156,7 +156,7 @@ protected function viewsData() { 'title' => t('Age'), 'help' => t('The age of the person'), 'field' => array( - 'handler' => 'views_handler_field_numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'argument' => array( @@ -173,7 +173,7 @@ protected function viewsData() { 'title' => t('Job'), 'help' => t('The job of the person'), 'field' => array( - 'handler' => 'views_handler_field', + 'plugin_id' => 'standard', 'click sortable' => TRUE, ), 'argument' => array( @@ -190,7 +190,7 @@ protected function viewsData() { 'title' => t('Created'), 'help' => t('The creation date of this record'), 'field' => array( - 'handler' => 'views_handler_field_date', + 'plugin_id' => 'date', 'click sortable' => TRUE, ), 'argument' => array( diff --git a/modules/aggregator.views.inc b/modules/aggregator.views.inc index 9f3a74344e51..b7d372c1352f 100644 --- a/modules/aggregator.views.inc +++ b/modules/aggregator.views.inc @@ -33,7 +33,7 @@ function aggregator_views_data() { 'title' => t('Feed Item ID'), 'help' => t('The unique ID of the aggregator item.'), 'field' => array( - 'handler' => 'views_handler_field_numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'argument' => array( @@ -54,7 +54,7 @@ function aggregator_views_data() { 'help' => t('The unique ID of the aggregator item.'), // The help that appears on the UI, // Information for displaying the iid 'field' => array( - 'handler' => 'views_handler_field_numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), // Information for accepting a iid as an argument @@ -97,7 +97,7 @@ function aggregator_views_data() { 'title' => t('Link'), // The item it appears as on the UI, 'help' => t('The link to the original source URL of the item.'), 'field' => array( - 'handler' => 'views_handler_field_url', + 'plugin_id' => 'url', 'click sortable' => TRUE, ), 'sort' => array( @@ -172,7 +172,7 @@ function aggregator_views_data() { 'help' => t('The date the original feed item was posted. (With some feeds, this will be the date it was imported.)'), // Information for displaying a title as a field 'field' => array( - 'handler' => 'views_handler_field_date', + 'plugin_id' => 'date', 'click sortable' => TRUE, ), 'sort' => array( @@ -207,7 +207,7 @@ function aggregator_views_data() { 'help' => t('The unique ID of the aggregator feed.'), // The help that appears on the UI, // Information for displaying the fid 'field' => array( - 'handler' => 'views_handler_field_numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), // Information for accepting a fid as an argument @@ -254,7 +254,7 @@ function aggregator_views_data() { 'help' => t('The link to the source URL of the feed.'), // Information for displaying a title as a field 'field' => array( - 'handler' => 'views_handler_field_url', + 'plugin_id' => 'url', 'click sortable' => TRUE, ), 'sort' => array( @@ -271,7 +271,7 @@ function aggregator_views_data() { 'help' => t('The date the feed was last checked for new content.'), // Information for displaying a title as a field 'field' => array( - 'handler' => 'views_handler_field_date', + 'plugin_id' => 'date', 'click sortable' => TRUE, ), 'sort' => array( @@ -305,7 +305,7 @@ function aggregator_views_data() { 'help' => t('The date of the most recent new content on the feed.'), // Information for displaying a title as a field 'field' => array( - 'handler' => 'views_handler_field_date', + 'plugin_id' => 'date', 'click sortable' => TRUE, ), 'sort' => array( @@ -348,7 +348,7 @@ function aggregator_views_data() { 'title' => t('Category ID'), 'help' => t('The unique ID of the aggregator category.'), 'field' => array( - 'handler' => 'views_handler_field_numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'argument' => array( diff --git a/modules/book.views.inc b/modules/book.views.inc index e814068a06db..b14193e4e9cb 100644 --- a/modules/book.views.inc +++ b/modules/book.views.inc @@ -52,7 +52,7 @@ function book_views_data() { 'title' => t('Weight'), 'help' => t('The weight of the book page.'), 'field' => array( - 'handler' => 'views_handler_field_numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'sort' => array( @@ -64,7 +64,7 @@ function book_views_data() { 'title' => t('Depth'), 'help' => t('The depth of the book page in the hierarchy; top level books have a depth of 1.'), 'field' => array( - 'handler' => 'views_handler_field_numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'sort' => array( diff --git a/modules/comment.views.inc b/modules/comment.views.inc index c16f1cc72301..06689177a083 100644 --- a/modules/comment.views.inc +++ b/modules/comment.views.inc @@ -100,7 +100,7 @@ function comment_views_data() { 'title' => t("Author's website"), 'help' => t("The website address of the comment's author. Can be rendered as a link. Will be empty if the author is a registered user."), 'field' => array( - 'handler' => 'views_handler_field_url', + 'plugin_id' => 'url', 'click sortable' => TRUE, ), 'filter' => array( @@ -119,7 +119,7 @@ function comment_views_data() { 'title' => t('Hostname'), 'help' => t('Hostname of user that posted the comment.'), 'field' => array( - 'handler' => 'views_handler_field', + 'plugin_id' => 'standard', 'click sortable' => TRUE, ), 'filter' => array( @@ -138,7 +138,7 @@ function comment_views_data() { 'title' => t('Mail'), 'help' => t('Email of user that posted the comment. Will be empty if the author is a registered user.'), 'field' => array( - 'handler' => 'views_handler_field', + 'plugin_id' => 'standard', 'click sortable' => TRUE, ), 'filter' => array( @@ -157,7 +157,7 @@ function comment_views_data() { 'title' => t('Post date'), 'help' => t('Date and time of when the comment was created.'), 'field' => array( - 'handler' => 'views_handler_field_date', + 'plugin_id' => 'date', 'click sortable' => TRUE, ), 'sort' => array( @@ -196,7 +196,7 @@ function comment_views_data() { 'title' => t('Updated date'), 'help' => t('Date and time of when the comment was last updated.'), 'field' => array( - 'handler' => 'views_handler_field_date', + 'plugin_id' => 'date', 'click sortable' => TRUE, ), 'sort' => array( @@ -272,7 +272,7 @@ function comment_views_data() { 'title' => t('Approved'), 'help' => t('Whether the comment is approved (or still in the moderation queue).'), 'field' => array( - 'handler' => 'views_handler_field_boolean', + 'plugin_id' => 'boolean', 'click sortable' => TRUE, 'output formats' => array( 'approved-not-approved' => array(t('Approved'), t('Not Approved')), @@ -365,7 +365,7 @@ function comment_views_data() { 'handler' => 'views_handler_argument_numeric', ), 'field' => array( - 'handler' => 'views_handler_field_numeric', + 'plugin_id' => 'numeric', ), ); @@ -395,7 +395,7 @@ function comment_views_data() { 'title' => t('Parent CID'), 'help' => t('The Comment ID of the parent comment.'), 'field' => array( - 'handler' => 'views_handler_field', + 'plugin_id' => 'standard', ), 'relationship' => array( 'title' => t('Parent comment'), @@ -459,7 +459,7 @@ function comment_views_data() { 'title' => t('Comment count'), 'help' => t('The number of comments a node has.'), 'field' => array( - 'handler' => 'views_handler_field_numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'filter' => array( @@ -523,7 +523,7 @@ function comment_views_data() { 'handler' => 'views_handler_argument_numeric', ), 'field' => array( - 'handler' => 'views_handler_field_numeric', + 'plugin_id' => 'numeric', ), ); diff --git a/modules/field.views.inc b/modules/field.views.inc index 81c8e794b71b..623e4b2b7a74 100644 --- a/modules/field.views.inc +++ b/modules/field.views.inc @@ -370,7 +370,7 @@ function field_views_field_default_views_data($field) { 'help' => t('Delta - Appears in: @bundles.', array('@bundles' => implode(', ', $bundles_names))), ); $data[$table]['delta']['field'] = array( - 'handler' => 'views_handler_field_numeric', + 'plugin_id' => 'numeric', ); $data[$table]['delta']['argument'] = array( 'field' => 'delta', diff --git a/modules/language.views.inc b/modules/language.views.inc index 75336afb1ac2..18f2b8cd837c 100644 --- a/modules/language.views.inc +++ b/modules/language.views.inc @@ -27,7 +27,7 @@ function language_views_data() { 'title' => t('Language code'), 'help' => t("Language code, e.g. 'de' or 'en-US'."), 'field' => array( - 'handler' => 'views_handler_field', + 'plugin_id' => 'standard', ), 'filter' => array( 'plugin_id' => 'string' @@ -44,7 +44,7 @@ function language_views_data() { 'title' => t('Language name'), 'help' => t("Language name, e.g. 'German' or 'English'."), 'field' => array( - 'handler' => 'views_handler_field', + 'plugin_id' => 'standard', ), 'filter' => array( 'plugin_id' => 'string' @@ -61,7 +61,7 @@ function language_views_data() { 'title' => t('Direction'), 'help' => t('Direction of language (Left-to-Right = 0, Right-to-Left = 1).'), 'field' => array( - 'handler' => 'views_handler_field_numeric', + 'plugin_id' => 'numeric', ), 'filter' => array( 'plugin_id' => 'numeric' @@ -78,7 +78,7 @@ function language_views_data() { 'title' => t('Weight'), 'help' => t('Weight, used in lists of languages.'), 'field' => array( - 'handler' => 'views_handler_field_numeric', + 'plugin_id' => 'numeric', ), 'filter' => array( 'plugin_id' => 'numeric' diff --git a/modules/locale.views.inc b/modules/locale.views.inc index a12a4863dfd5..273dd883bd9c 100644 --- a/modules/locale.views.inc +++ b/modules/locale.views.inc @@ -28,7 +28,7 @@ function locale_views_data() { 'title' => t('LID'), 'help' => t('The ID of the source string.'), 'field' => array( - 'handler' => 'views_handler_field', + 'plugin_id' => 'standard', 'click sortable' => TRUE, ), 'argument' => array( @@ -50,7 +50,7 @@ function locale_views_data() { 'title' => t('Location'), 'help' => t('A description of the location or context of the string.'), 'field' => array( - 'handler' => 'views_handler_field', + 'plugin_id' => 'standard', 'click sortable' => TRUE, ), 'sort' => array( @@ -87,7 +87,7 @@ function locale_views_data() { 'title' => t('Source'), 'help' => t('The full original string.'), 'field' => array( - 'handler' => 'views_handler_field', + 'plugin_id' => 'standard', ), 'filter' => array( 'plugin_id' => 'string', @@ -100,7 +100,7 @@ function locale_views_data() { 'title' => t('Version'), 'help' => t('The version of Drupal core that this string is for.'), 'field' => array( - 'handler' => 'views_handler_field', + 'plugin_id' => 'standard', 'click sortable' => TRUE, ), 'filter' => array( @@ -141,7 +141,7 @@ function locale_views_data() { 'title' => t('Translation'), 'help' => t('The full translation string.'), 'field' => array( - 'handler' => 'views_handler_field', + 'plugin_id' => 'standard', ), 'filter' => array( 'plugin_id' => 'string', @@ -170,7 +170,7 @@ function locale_views_data() { 'title' => t('Singular LID'), 'help' => t('The ID of the parent translation.'), 'field' => array( - 'handler' => 'views_handler_field', + 'plugin_id' => 'standard', ), ); @@ -180,7 +180,7 @@ function locale_views_data() { 'title' => t('Plural'), 'help' => t('Whether or not the translation is plural.'), 'field' => array( - 'handler' => 'views_handler_field_boolean', + 'plugin_id' => 'boolean', 'click sortable' => TRUE, ), 'filter' => array( diff --git a/modules/node.views.inc b/modules/node.views.inc index d83a0859fabf..76ec68771934 100644 --- a/modules/node.views.inc +++ b/modules/node.views.inc @@ -98,7 +98,7 @@ function node_views_data() { 'title' => t('Post date'), // The item it appears as on the UI, 'help' => t('The date the content was posted.'), // The help that appears on the UI, 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Date', + 'plugin_id' => 'date', 'click sortable' => TRUE, ), 'sort' => array( @@ -114,7 +114,7 @@ function node_views_data() { 'title' => t('Updated date'), // The item it appears as on the UI, 'help' => t('The date the content was last updated.'), // The help that appears on the UI, 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Date', + 'plugin_id' => 'date', 'click sortable' => TRUE, ), 'sort' => array( @@ -149,7 +149,7 @@ function node_views_data() { 'title' => t('Published'), 'help' => t('Whether or not the content is published.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Boolean', + 'plugin_id' => 'boolean', 'click sortable' => TRUE, 'output formats' => array( 'published-notpublished' => array(t('Published'), t('Not published')), @@ -182,7 +182,7 @@ 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' => 'Drupal\views\Plugins\views\field\Boolean', + 'plugin_id' => 'boolean', 'click sortable' => TRUE, 'output formats' => array( 'promoted-notpromoted' => array(t('Promoted'), t('Not promoted')), @@ -204,7 +204,7 @@ function node_views_data() { 'help' => t('Whether or not the content is sticky.'), // The help that appears on the UI, // Information for displaying a title as a field 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Boolean', + 'plugin_id' => 'boolean', 'click sortable' => TRUE, 'output formats' => array( 'sticky' => array(t('Sticky'), t('Not sticky')), @@ -515,7 +515,7 @@ function node_views_data() { 'help' => t('The log message entered when the revision was created.'), // The help that appears on the UI, // Information for displaying a title as a field 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Xss', + 'plugin_id' => 'xss', ), 'filter' => array( 'plugin_id' => 'string', @@ -528,7 +528,7 @@ function node_views_data() { 'title' => t('Updated date'), // The item it appears as on the UI, 'help' => t('The date the node was last updated.'), // The help that appears on the UI, 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Date', + 'plugin_id' => 'date', 'click sortable' => TRUE, ), 'sort' => array( diff --git a/modules/poll.views.inc b/modules/poll.views.inc index 4ec5bb8e2ae2..fe5d1e3f9c56 100644 --- a/modules/poll.views.inc +++ b/modules/poll.views.inc @@ -30,7 +30,7 @@ function poll_views_data() { 'title' => t('Active'), 'help' => t('Whether the poll is open for voting.'), 'field' => array( - 'handler' => 'views_handler_field_boolean', + 'plugin_id' => 'boolean', 'click sortable' => TRUE, ), 'filter' => array( diff --git a/modules/statistics.views.inc b/modules/statistics.views.inc index 8679efba9896..1df8eae90978 100644 --- a/modules/statistics.views.inc +++ b/modules/statistics.views.inc @@ -32,7 +32,7 @@ function statistics_views_data() { 'help' => t('The total number of times the node has been viewed.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'filter' => array( @@ -49,7 +49,7 @@ function statistics_views_data() { 'help' => t('The total number of times the node has been viewed today.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'filter' => array( @@ -66,7 +66,7 @@ function statistics_views_data() { 'help' => t('The most recent time the node has been viewed.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Date', + 'plugin_id' => 'date', 'click sortable' => TRUE, ), 'filter' => array( @@ -104,7 +104,7 @@ function statistics_views_data() { 'title' => t('Aid'), 'help' => t('Unique access event ID.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'argument' => array( @@ -126,7 +126,7 @@ function statistics_views_data() { 'help' => t('Browser session ID of user that visited page.'), 'field' => array( - 'handler' => 'views_handler_field', + 'plugin_id' => 'standard', 'click sortable' => TRUE, ), 'filter' => array( @@ -185,7 +185,7 @@ function statistics_views_data() { 'title' => t('Referrer'), 'help' => t('Referrer URI.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Url', + 'plugin_id' => 'url', 'click sortable' => TRUE, ), 'filter' => array( @@ -201,7 +201,7 @@ function statistics_views_data() { 'title' => t('Hostname'), 'help' => t('Hostname of user that visited the page.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\FieldPluginBase', + 'plugin_id' => 'standard', 'click sortable' => TRUE, ), 'filter' => array( @@ -231,7 +231,7 @@ function statistics_views_data() { 'title' => t('Timer'), 'help' => t('Time in milliseconds that the page took to load.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'filter' => array( @@ -247,7 +247,7 @@ function statistics_views_data() { 'title' => t('Timestamp'), 'help' => t('Timestamp of when the page was visited.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Date', + 'plugin_id' => 'date', 'click sortable' => TRUE, ), 'sort' => array( diff --git a/modules/system.views.inc b/modules/system.views.inc index f70a77fd2be4..e4bf4d625433 100644 --- a/modules/system.views.inc +++ b/modules/system.views.inc @@ -156,7 +156,7 @@ function system_views_data() { 'title' => t('Upload date'), 'help' => t('The date the file was uploaded.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Date', + 'plugin_id' => 'date', 'click sortable' => TRUE, ), 'sort' => array( @@ -391,7 +391,7 @@ function system_views_data() { 'title' => t('Module'), 'help' => t('The module managing this file relationship.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\FieldPluginBase', + 'plugin_id' => 'standard', 'click sortable' => TRUE, ), 'filter' => array( @@ -408,7 +408,7 @@ function system_views_data() { 'title' => t('Entity type'), 'help' => t('The type of entity that is related to the file.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\FieldPluginBase', + 'plugin_id' => 'standard', 'click sortable' => TRUE, ), 'filter' => array( @@ -425,7 +425,7 @@ function system_views_data() { 'title' => t('Entity ID'), 'help' => t('The ID of the entity that is related to the file.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'argument' => array( @@ -442,7 +442,7 @@ function system_views_data() { 'title' => t('Use count'), 'help' => t('The number of times the file is used by this entity.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'filter' => array( @@ -470,7 +470,7 @@ function system_views_data() { 'title' => t('Module/Theme/Theme engine filename'), 'help' => t('The path of the primary file for this item, relative to the Drupal root; e.g. modules/node/node.module.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\FieldPluginBase', + 'plugin_id' => 'standard', 'click sortable' => TRUE, ), 'argument' => array( @@ -489,7 +489,7 @@ function system_views_data() { 'title' => t('Module/Theme/Theme engine name'), 'help' => t('The name of the item; e.g. node.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\FieldPluginBase', + 'plugin_id' => 'standard', 'click sortable' => TRUE, ), 'argument' => array( @@ -508,7 +508,7 @@ function system_views_data() { 'title' => t('Type'), 'help' => t('The type of the item, either module, theme, or theme_engine.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\FieldPluginBase', + 'plugin_id' => 'standard', 'click sortable' => TRUE, ), 'argument' => array( @@ -527,7 +527,7 @@ function system_views_data() { 'title' => t('Status'), 'help' => t('Boolean indicating whether or not this item is enabled.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Boolean', + 'plugin_id' => 'boolean', 'click sortable' => TRUE, ), 'argument' => array( @@ -546,7 +546,7 @@ function system_views_data() { 'title' => t('Schema version'), 'help' => t("The module's database schema version number. -1 if the module is not installed (its tables do not exist); 0 or the largest N of the module's hook_update_N() function that has either been run or existed when the module was first installed."), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'argument' => array( diff --git a/modules/taxonomy.views.inc b/modules/taxonomy.views.inc index 9c6237675e3e..1e1f8671bc97 100644 --- a/modules/taxonomy.views.inc +++ b/modules/taxonomy.views.inc @@ -40,7 +40,7 @@ function taxonomy_views_data() { 'title' => t('Name'), // The item it appears as on the UI, 'field' => array( 'help' => t('Name of the vocabulary a term is a member of. This will be the vocabulary that whichever term the "Taxonomy: Term" field is; and can similarly cause duplicates.'), - 'handler' => 'Drupal\views\Plugins\views\field\FieldPluginBase', + 'plugin_id' => 'standard', 'click sortable' => TRUE, ), 'sort' => array( @@ -52,7 +52,7 @@ function taxonomy_views_data() { 'title' => t('Machine name'), // The item it appears as on the UI, 'field' => array( 'help' => t('Machine-Name of the vocabulary a term is a member of. This will be the vocabulary that whichever term the "Taxonomy: Term" field is; and can similarly cause duplicates.'), - 'handler' => 'Drupal\views\Plugins\views\field\FieldPluginBase', + 'plugin_id' => 'standard', 'click sortable' => TRUE, ), 'filter' => array( @@ -68,7 +68,7 @@ function taxonomy_views_data() { 'title' => t('Vocabulary ID'), // The item it appears as on the UI, 'help' => t('The taxonomy vocabulary ID'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'argument' => array( @@ -83,14 +83,14 @@ function taxonomy_views_data() { 'title' => t('Description'), // The item it appears as on the UI, 'help' => t('The taxonomy vocabulary description'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\FieldPluginBase', + 'plugin_id' => 'standard', ), ); $data['taxonomy_vocabulary']['weight'] = array( 'title' => t('Weight'), 'help' => t('The taxonomy vocabulary weight'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'argument' => array( @@ -146,7 +146,7 @@ function taxonomy_views_data() { 'title' => t('Term ID'), 'help' => t('The tid of a taxonomy term.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'sort' => array( @@ -220,7 +220,7 @@ function taxonomy_views_data() { 'title' => t('Weight'), 'help' => t('The term weight field'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'sort' => array( @@ -239,7 +239,7 @@ function taxonomy_views_data() { 'title' => t('Term description'), 'help' => t('The description associated with a taxonomy term.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Markup', + 'plugin_id' => 'markup', 'format' => array('field' => 'format'), ), 'filter' => array( diff --git a/modules/translation.views.inc b/modules/translation.views.inc index 116174384bb7..4f9a1d0f9ee8 100644 --- a/modules/translation.views.inc +++ b/modules/translation.views.inc @@ -30,7 +30,7 @@ function translation_views_data_alter(&$data) { 'click sortable' => TRUE, ), 'filter' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Numeric', + 'plugin_id' => 'numeric', ), 'argument' => array( 'handler' => 'views_handler_argument_node_tnid', @@ -94,7 +94,7 @@ function translation_views_data_alter(&$data) { 'title' => t('Translation status'), 'help' => t('The translation status of the content - whether or not the translation needs to be updated.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Boolean', + 'plugin_id' => 'boolean', 'click sortable' => TRUE, ), 'filter' => array( diff --git a/modules/user.views.inc b/modules/user.views.inc index 652df3ab5e00..d50c114b7b8a 100644 --- a/modules/user.views.inc +++ b/modules/user.views.inc @@ -203,7 +203,7 @@ function user_views_data() { 'title' => t('Created date'), // The item it appears as on the UI, 'help' => t('The date the user was created.'), // The help that appears on the UI, 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Date', + 'plugin_id' => 'date', 'click sortable' => TRUE, ), 'sort' => array( @@ -274,7 +274,7 @@ function user_views_data() { 'title' => t('Last access'), // The item it appears as on the UI, 'help' => t("The user's last access date."), // The help that appears on the UI, 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Date', + 'plugin_id' => 'date', 'click sortable' => TRUE, ), 'sort' => array( @@ -290,7 +290,7 @@ function user_views_data() { 'title' => t('Last login'), // The item it appears as on the UI, 'help' => t("The user's last login date."), // The help that appears on the UI, 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Date', + 'plugin_id' => 'date', 'click sortable' => TRUE, ), 'sort' => array( @@ -307,7 +307,7 @@ function user_views_data() { 'help' => t('Whether a user is active or blocked.'), // The help that appears on the UI, // Information for displaying a title as a field 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Boolean', + 'plugin_id' => 'boolean', 'click sortable' => TRUE, 'output formats' => array( 'active-blocked' => array(t('Active'), t('Blocked')), @@ -329,7 +329,7 @@ function user_views_data() { 'help' => t("The user's signature."), // The help that appears on the UI, // Information for displaying a title as a field 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Markup', + 'plugin_id' => 'markup', 'format' => filter_fallback_format(), ), 'filter' => array( @@ -357,7 +357,7 @@ function user_views_data() { 'title' => t('Data'), 'help' => t('Provide serialized data of the user'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Serialized', + 'plugin_id' => 'serialized', ), ); @@ -485,7 +485,7 @@ function user_views_data() { 'title' => t('Authmap ID'), 'help' => t('The Authmap ID.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Numeric', + 'plugin_id' => 'numeric', ), 'filter' => array( 'plugin_id' => 'numeric', @@ -500,7 +500,7 @@ function user_views_data() { 'title' => t('Authentication name'), 'help' => t('The unique authentication name.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\FieldPluginBase', + 'plugin_id' => 'standard', ), 'filter' => array( 'plugin_id' => 'string', @@ -513,7 +513,7 @@ function user_views_data() { 'title' => t('Authentication module'), 'help' => t('The name of the module managing the authentication entry.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\FieldNumeric', + 'plugin_id' => 'standard', ), 'filter' => array( 'plugin_id' => 'string', diff --git a/modules/views.views.inc b/modules/views.views.inc index 04ad7ce5e241..30e821e1eb9b 100644 --- a/modules/views.views.inc +++ b/modules/views.views.inc @@ -37,7 +37,7 @@ function views_views_data() { 'title' => t('Custom text'), 'help' => t('Provide custom text or link.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Custom', + 'plugin_id' => 'custom', ), ); @@ -45,7 +45,7 @@ function views_views_data() { 'title' => t('View result counter'), 'help' => t('Displays the actual position of the view result'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Counter', + 'plugin_id' => 'counter', ), ); @@ -86,7 +86,7 @@ function views_views_data() { 'title' => t('Contextual Links'), 'help' => t('Display fields in a contextual links menu.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\ContextualLinks', + 'plugin_id' => 'contextual_links', ), ); } @@ -104,7 +104,7 @@ function views_views_data() { 'title' => t('Math expression'), 'help' => t('Evaluates a mathematical expression and displays it.'), 'field' => array( - 'handler' => 'Drupal\views\Plugins\views\field\Math', + 'plugin_id' => 'math', 'float' => TRUE, ), ); diff --git a/views.api.php b/views.api.php index 6a0eef2eb958..84349713bb52 100644 --- a/views.api.php +++ b/views.api.php @@ -384,7 +384,7 @@ function hook_views_data() { 'title' => t('Plain text field'), 'help' => t('Just a plain text field.'), 'field' => array( - 'handler' => 'views_handler_field', + 'plugin_id' => 'standard', 'click sortable' => TRUE, // This is use by the table display plugin. ), 'sort' => array( @@ -403,7 +403,7 @@ function hook_views_data() { 'title' => t('Numeric field'), 'help' => t('Just a numeric field.'), 'field' => array( - 'handler' => 'views_handler_field_numeric', + 'plugin_id' => 'numeric', 'click sortable' => TRUE, ), 'filter' => array( @@ -419,7 +419,7 @@ function hook_views_data() { 'title' => t('Boolean field'), 'help' => t('Just an on/off field.'), 'field' => array( - 'handler' => 'views_handler_field_boolean', + 'plugin_id' => 'boolean', 'click sortable' => TRUE, ), 'filter' => array( @@ -441,7 +441,7 @@ function hook_views_data() { 'title' => t('Timestamp field'), 'help' => t('Just a timestamp field.'), 'field' => array( - 'handler' => 'views_handler_field_date', + 'plugin_id' => 'date', 'click sortable' => TRUE, ), 'sort' => array( -- GitLab