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

convert fields to annotation

parent d21b6884
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 148 additions and 18 deletions
......@@ -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(
......
......@@ -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();
......
......@@ -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();
......
......@@ -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();
......
......@@ -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.
......
......@@ -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();
......
......@@ -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 {
/**
......
......@@ -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';
......
......@@ -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();
......
......@@ -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.
......
......@@ -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.
......
......@@ -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();
......
......@@ -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();
......
......@@ -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.
......
......@@ -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() {
......
......@@ -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();
......
......@@ -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();
......
......@@ -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);
......
......@@ -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(
......
......@@ -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(
......
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