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

convert fields to annotation

parent d21b6884
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
'title' => t('Quantity'), 'title' => t('Quantity'),
'help' => t('Quantity of items.'), 'help' => t('Quantity of items.'),
'field' => array( 'field' => array(
'handler' => 'views_handler_field_numeric', 'plugin_id' => 'numeric',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
'filter' => array( 'filter' => array(
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
'help' => t('Color of item.'), 'help' => t('Color of item.'),
'field' => array( 'field' => array(
'handler' => 'views_handler_field', 'plugin_id' => 'standard',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
'filter' => array( 'filter' => array(
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
namespace Drupal\views\Plugins\views\field; namespace Drupal\views\Plugins\views\field;
use Drupal\Core\Annotation\Plugin;
/** /**
* A handler to provide proper displays for booleans. * A handler to provide proper displays for booleans.
...@@ -23,6 +24,12 @@ ...@@ -23,6 +24,12 @@
* *
* @ingroup views_field_handlers * @ingroup views_field_handlers
*/ */
/**
* @plugin(
* plugin_id = "boolean"
* )
*/
class Boolean extends FieldPluginBase { class Boolean extends FieldPluginBase {
function option_definition() { function option_definition() {
$options = parent::option_definition(); $options = parent::option_definition();
......
...@@ -7,11 +7,19 @@ ...@@ -7,11 +7,19 @@
namespace Drupal\views\Plugins\views\field; namespace Drupal\views\Plugins\views\field;
use Drupal\Core\Annotation\Plugin;
/** /**
* Provides a handler that adds contextual links. * Provides a handler that adds contextual links.
* *
* @ingroup views_field_handlers * @ingroup views_field_handlers
*/ */
/**
* @plugin(
* plugin_id = "contextual_links"
* )
*/
class ContextualLinks extends FieldPluginBase { class ContextualLinks extends FieldPluginBase {
function option_definition() { function option_definition() {
$options = parent::option_definition(); $options = parent::option_definition();
......
...@@ -7,11 +7,19 @@ ...@@ -7,11 +7,19 @@
namespace Drupal\views\Plugins\views\field; namespace Drupal\views\Plugins\views\field;
use Drupal\Core\Annotation\Plugin;
/** /**
* Field handler to show a counter of the current row. * Field handler to show a counter of the current row.
* *
* @ingroup views_field_handlers * @ingroup views_field_handlers
*/ */
/**
* @plugin(
* plugin_id = "counter"
* )
*/
class Counter extends FieldPluginBase { class Counter extends FieldPluginBase {
function option_definition() { function option_definition() {
$options = parent::option_definition(); $options = parent::option_definition();
......
...@@ -7,11 +7,19 @@ ...@@ -7,11 +7,19 @@
namespace Drupal\views\Plugins\views\field; namespace Drupal\views\Plugins\views\field;
use Drupal\Core\Annotation\Plugin;
/** /**
* A handler to provide a field that is completely custom by the administrator. * A handler to provide a field that is completely custom by the administrator.
* *
* @ingroup views_field_handlers * @ingroup views_field_handlers
*/ */
/**
* @plugin(
* plugin_id = "custom"
* )
*/
class Custom extends FieldPluginBase { class Custom extends FieldPluginBase {
function query() { function query() {
// do nothing -- to override the parent query. // do nothing -- to override the parent query.
......
...@@ -7,11 +7,19 @@ ...@@ -7,11 +7,19 @@
namespace Drupal\views\Plugins\views\field; namespace Drupal\views\Plugins\views\field;
use Drupal\Core\Annotation\Plugin;
/** /**
* A handler to provide proper displays for dates. * A handler to provide proper displays for dates.
* *
* @ingroup views_field_handlers * @ingroup views_field_handlers
*/ */
/**
* @plugin(
* plugin_id = "date"
* )
*/
class Date extends FieldPluginBase { class Date extends FieldPluginBase {
function option_definition() { function option_definition() {
$options = parent::option_definition(); $options = parent::option_definition();
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
namespace Drupal\views\Plugins\views\field; namespace Drupal\views\Plugins\views\field;
use Drupal\Core\Annotation\Plugin;
/** /**
* A handler to display data from entity objects. * A handler to display data from entity objects.
* *
...@@ -18,6 +20,12 @@ ...@@ -18,6 +20,12 @@
* *
* @ingroup views_field_handlers * @ingroup views_field_handlers
*/ */
/**
* @plugin(
* plugin_id = "entity"
* )
*/
class Entity extends FieldPluginBase { class Entity extends FieldPluginBase {
/** /**
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
namespace Drupal\views\Plugins\views\field; namespace Drupal\views\Plugins\views\field;
use Drupal\views\Plugins\views\Plugin;
use Drupal\views\Plugins\views\Handler; use Drupal\views\Plugins\views\Handler;
use Drupal\Core\Annotation\Plugin;
/** /**
* @defgroup views_field_handlers Views field handlers * @defgroup views_field_handlers Views field handlers
...@@ -47,6 +47,12 @@ ...@@ -47,6 +47,12 @@
* *
* @ingroup views_field_handlers * @ingroup views_field_handlers
*/ */
/**
* @plugin(
* plugin_id = "standard"
* )
*/
class FieldPluginBase extends Handler { class FieldPluginBase extends Handler {
var $field_alias = 'unknown'; var $field_alias = 'unknown';
......
...@@ -5,13 +5,19 @@ ...@@ -5,13 +5,19 @@
*/ */
namespace Drupal\views\Plugins\views\field; 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. * Render a numeric value as a size.
* *
* @ingroup views_field_handlers * @ingroup views_field_handlers
*/ */
/**
* @plugin(
* plugin_id = "file_size"
* )
*/
class FileSize extends FieldPluginBase { class FileSize extends FieldPluginBase {
function option_definition() { function option_definition() {
$options = parent::option_definition(); $options = parent::option_definition();
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
namespace Drupal\views\Plugins\views\field; namespace Drupal\views\Plugins\views\field;
use Drupal\Core\Annotation\Plugin;
/** /**
* Field handler whichs allows to show machine name content as human name. * Field handler whichs allows to show machine name content as human name.
* @ingroup views_field_handlers * @ingroup views_field_handlers
...@@ -15,6 +17,12 @@ ...@@ -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 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. * - options arguments: An array of arguments to pass to the options callback.
*/ */
/**
* @plugin(
* plugin_id = "machine_name"
* )
*/
class MachineName extends FieldPluginBase { class MachineName extends FieldPluginBase {
/** /**
* @var array Stores the available options. * @var array Stores the available options.
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
namespace Drupal\views\Plugins\views\field; namespace Drupal\views\Plugins\views\field;
use Drupal\Core\Annotation\Plugin;
/** /**
* A handler to run a field through check_markup, using a companion * A handler to run a field through check_markup, using a companion
* format field. * format field.
...@@ -18,6 +20,12 @@ ...@@ -18,6 +20,12 @@
* *
* @ingroup views_field_handlers * @ingroup views_field_handlers
*/ */
/**
* @plugin(
* plugin_id = "markup"
* )
*/
class Markup extends FieldPluginBase { class Markup extends FieldPluginBase {
/** /**
* Constructor; calls to base object constructor. * Constructor; calls to base object constructor.
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
namespace Drupal\views\Plugins\views\field; namespace Drupal\views\Plugins\views\field;
use Drupal\Core\Annotation\Plugin;
/** /**
* Render a mathematical expression as a numeric value * Render a mathematical expression as a numeric value
* *
...@@ -16,6 +18,12 @@ ...@@ -16,6 +18,12 @@
* *
* @ingroup views_field_handlers * @ingroup views_field_handlers
*/ */
/**
* @plugin(
* plugin_id = "math"
* )
*/
class Math extends FieldPluginBase { class Math extends FieldPluginBase {
function option_definition() { function option_definition() {
$options = parent::option_definition(); $options = parent::option_definition();
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
namespace Drupal\views\Plugins\views\field; namespace Drupal\views\Plugins\views\field;
use Drupal\Core\Annotation\Plugin;
/** /**
* Render a field as a numeric value * Render a field as a numeric value
* *
...@@ -16,6 +18,12 @@ ...@@ -16,6 +18,12 @@
* *
* @ingroup views_field_handlers * @ingroup views_field_handlers
*/ */
/**
* @plugin(
* plugin_id = "numeric"
* )
*/
class Numeric extends FieldPluginBase { class Numeric extends FieldPluginBase {
function option_definition() { function option_definition() {
$options = parent::option_definition(); $options = parent::option_definition();
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
namespace Drupal\views\Plugins\views\field; namespace Drupal\views\Plugins\views\field;
use Drupal\Core\Annotation\Plugin;
/** /**
* Field handler to provide a list of items. * Field handler to provide a list of items.
* *
...@@ -17,6 +19,12 @@ ...@@ -17,6 +19,12 @@
* *
* @ingroup views_field_handlers * @ingroup views_field_handlers
*/ */
/**
* @plugin(
* plugin_id = "prerender_list"
* )
*/
class PrerenderList extends FieldPluginBase { class PrerenderList extends FieldPluginBase {
/** /**
* Stores all items which are used to render the items. * Stores all items which are used to render the items.
......
...@@ -7,11 +7,19 @@ ...@@ -7,11 +7,19 @@
namespace Drupal\views\Plugins\views\field; namespace Drupal\views\Plugins\views\field;
use Drupal\Core\Annotation\Plugin;
/** /**
* Field handler to show data of serialized fields. * Field handler to show data of serialized fields.
* *
* @ingroup views_field_handlers * @ingroup views_field_handlers
*/ */
/**
* @plugin(
* plugin_id = "serialized"
* )
*/
class Serialized extends FieldPluginBase { class Serialized extends FieldPluginBase {
function option_definition() { function option_definition() {
......
...@@ -7,11 +7,19 @@ ...@@ -7,11 +7,19 @@
namespace Drupal\views\Plugins\views\field; namespace Drupal\views\Plugins\views\field;
use Drupal\Core\Annotation\Plugin;
/** /**
* A handler to provide proper displays for time intervals. * A handler to provide proper displays for time intervals.
* *
* @ingroup views_field_handlers * @ingroup views_field_handlers
*/ */
/**
* @plugin(
* plugin_id = "time_interval"
* )
*/
class TimeInterval extends FieldPluginBase { class TimeInterval extends FieldPluginBase {
function option_definition() { function option_definition() {
$options = parent::option_definition(); $options = parent::option_definition();
......
...@@ -7,11 +7,19 @@ ...@@ -7,11 +7,19 @@
namespace Drupal\views\Plugins\views\field; 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. * Field handler to provide simple renderer that turns a URL into a clickable link.
* *
* @ingroup views_field_handlers * @ingroup views_field_handlers
*/ */
/**
* @plugin(
* plugin_id = "url"
* )
*/
class Url extends FieldPluginBase { class Url extends FieldPluginBase {
function option_definition() { function option_definition() {
$options = parent::option_definition(); $options = parent::option_definition();
......
...@@ -6,12 +6,19 @@ ...@@ -6,12 +6,19 @@
namespace Drupal\views\Plugins\views\field; namespace Drupal\views\Plugins\views\field;
use Drupal\views\Plugins\views\field\FieldPluginBase; use Drupal\views\Plugins\views\field\FieldPluginBase;
use Drupal\Core\Annotation\Plugin;
/** /**
* A handler to run a field through simple XSS filtering. * A handler to run a field through simple XSS filtering.
* *
* @ingroup views_field_handlers * @ingroup views_field_handlers
*/ */
/**
* @plugin(
* plugin_id = "xss"
* )
*/
class Xss extends FieldPluginBase { class Xss extends FieldPluginBase {
function render($values) { function render($values) {
$value = $this->get_value($values); $value = $this->get_value($values);
......
...@@ -122,7 +122,7 @@ protected function viewsData() { ...@@ -122,7 +122,7 @@ protected function viewsData() {
'title' => t('ID'), 'title' => t('ID'),
'help' => t('The test data ID'), 'help' => t('The test data ID'),
'field' => array( 'field' => array(
'handler' => 'views_handler_field_numeric', 'plugin_id' => 'numeric',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
'argument' => array( 'argument' => array(
...@@ -139,7 +139,7 @@ protected function viewsData() { ...@@ -139,7 +139,7 @@ protected function viewsData() {
'title' => t('Name'), 'title' => t('Name'),
'help' => t('The name of the person'), 'help' => t('The name of the person'),
'field' => array( 'field' => array(
'handler' => 'views_handler_field', 'plugin_id' => 'standard',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
'argument' => array( 'argument' => array(
...@@ -156,7 +156,7 @@ protected function viewsData() { ...@@ -156,7 +156,7 @@ protected function viewsData() {
'title' => t('Age'), 'title' => t('Age'),
'help' => t('The age of the person'), 'help' => t('The age of the person'),
'field' => array( 'field' => array(
'handler' => 'views_handler_field_numeric', 'plugin_id' => 'numeric',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
'argument' => array( 'argument' => array(
...@@ -173,7 +173,7 @@ protected function viewsData() { ...@@ -173,7 +173,7 @@ protected function viewsData() {
'title' => t('Job'), 'title' => t('Job'),
'help' => t('The job of the person'), 'help' => t('The job of the person'),
'field' => array( 'field' => array(
'handler' => 'views_handler_field', 'plugin_id' => 'standard',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
'argument' => array( 'argument' => array(
...@@ -190,7 +190,7 @@ protected function viewsData() { ...@@ -190,7 +190,7 @@ protected function viewsData() {
'title' => t('Created'), 'title' => t('Created'),
'help' => t('The creation date of this record'), 'help' => t('The creation date of this record'),
'field' => array( 'field' => array(
'handler' => 'views_handler_field_date', 'plugin_id' => 'date',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
'argument' => array( 'argument' => array(
......
...@@ -33,7 +33,7 @@ function aggregator_views_data() { ...@@ -33,7 +33,7 @@ function aggregator_views_data() {
'title' => t('Feed Item ID'), 'title' => t('Feed Item ID'),
'help' => t('The unique ID of the aggregator item.'), 'help' => t('The unique ID of the aggregator item.'),
'field' => array( 'field' => array(
'handler' => 'views_handler_field_numeric', 'plugin_id' => 'numeric',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
'argument' => array( 'argument' => array(
...@@ -54,7 +54,7 @@ function aggregator_views_data() { ...@@ -54,7 +54,7 @@ function aggregator_views_data() {
'help' => t('The unique ID of the aggregator item.'), // The help that appears on the UI, 'help' => t('The unique ID of the aggregator item.'), // The help that appears on the UI,
// Information for displaying the iid // Information for displaying the iid
'field' => array( 'field' => array(
'handler' => 'views_handler_field_numeric', 'plugin_id' => 'numeric',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
// Information for accepting a iid as an argument // Information for accepting a iid as an argument
...@@ -97,7 +97,7 @@ function aggregator_views_data() { ...@@ -97,7 +97,7 @@ function aggregator_views_data() {
'title' => t('Link'), // The item it appears as on the UI, 'title' => t('Link'), // The item it appears as on the UI,
'help' => t('The link to the original source URL of the item.'), 'help' => t('The link to the original source URL of the item.'),
'field' => array( 'field' => array(
'handler' => 'views_handler_field_url', 'plugin_id' => 'url',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
'sort' => array( 'sort' => array(
...@@ -172,7 +172,7 @@ function aggregator_views_data() { ...@@ -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.)'), '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 // Information for displaying a title as a field
'field' => array( 'field' => array(
'handler' => 'views_handler_field_date', 'plugin_id' => 'date',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
'sort' => array( 'sort' => array(
...@@ -207,7 +207,7 @@ function aggregator_views_data() { ...@@ -207,7 +207,7 @@ function aggregator_views_data() {
'help' => t('The unique ID of the aggregator feed.'), // The help that appears on the UI, 'help' => t('The unique ID of the aggregator feed.'), // The help that appears on the UI,
// Information for displaying the fid // Information for displaying the fid
'field' => array( 'field' => array(
'handler' => 'views_handler_field_numeric', 'plugin_id' => 'numeric',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
// Information for accepting a fid as an argument // Information for accepting a fid as an argument
...@@ -254,7 +254,7 @@ function aggregator_views_data() { ...@@ -254,7 +254,7 @@ function aggregator_views_data() {
'help' => t('The link to the source URL of the feed.'), 'help' => t('The link to the source URL of the feed.'),
// Information for displaying a title as a field // Information for displaying a title as a field
'field' => array( 'field' => array(
'handler' => 'views_handler_field_url', 'plugin_id' => 'url',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
'sort' => array( 'sort' => array(
...@@ -271,7 +271,7 @@ function aggregator_views_data() { ...@@ -271,7 +271,7 @@ function aggregator_views_data() {
'help' => t('The date the feed was last checked for new content.'), 'help' => t('The date the feed was last checked for new content.'),
// Information for displaying a title as a field // Information for displaying a title as a field
'field' => array( 'field' => array(
'handler' => 'views_handler_field_date', 'plugin_id' => 'date',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
'sort' => array( 'sort' => array(
...@@ -305,7 +305,7 @@ function aggregator_views_data() { ...@@ -305,7 +305,7 @@ function aggregator_views_data() {
'help' => t('The date of the most recent new content on the feed.'), 'help' => t('The date of the most recent new content on the feed.'),
// Information for displaying a title as a field // Information for displaying a title as a field
'field' => array( 'field' => array(
'handler' => 'views_handler_field_date', 'plugin_id' => 'date',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
'sort' => array( 'sort' => array(
...@@ -348,7 +348,7 @@ function aggregator_views_data() { ...@@ -348,7 +348,7 @@ function aggregator_views_data() {
'title' => t('Category ID'), 'title' => t('Category ID'),
'help' => t('The unique ID of the aggregator category.'), 'help' => t('The unique ID of the aggregator category.'),
'field' => array( 'field' => array(
'handler' => 'views_handler_field_numeric', 'plugin_id' => 'numeric',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
'argument' => array( 'argument' => array(
......
...@@ -52,7 +52,7 @@ function book_views_data() { ...@@ -52,7 +52,7 @@ function book_views_data() {
'title