Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
eb3e8563
Commit
eb3e8563
authored
Jul 29, 2012
by
Daniel Wehner
Committed by
Tim Plunkett
Oct 21, 2012
Browse files
convert contact, field filter plugins
parent
d6fc9251
Changes
10
Hide whitespace changes
Inline
Side-by-side
lib/Drupal/field/Plugin/views/argument/
views_handler_argument_f
ield
_l
ist.
inc
→
lib/Drupal/field/Plugin/views/argument/
F
ield
L
ist.
php
View file @
eb3e8563
...
...
@@ -5,7 +5,10 @@
* Definition of views_handler_argument_field_list.
*/
namespace
Drupal\field\Plugin\views\argument
;
use
Drupal\views\Plugins\views\argument\Numeric
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Argument handler for list field to show the human readable name in the
...
...
@@ -13,7 +16,13 @@
*
* @ingroup views_argument_handlers
*/
class
views_handler_argument_field_list
extends
Numeric
{
/**
* @Plugin(
* plugin_id = "field_list"
* )
*/
class
FieldList
extends
Numeric
{
/**
* Stores the allowed values of this field.
*
...
...
lib/Drupal/field/Plugin/views/argument/
views_handler_argument_field_l
ist
_s
tring.
inc
→
lib/Drupal/field/Plugin/views/argument/
L
ist
S
tring.
php
View file @
eb3e8563
...
...
@@ -5,7 +5,10 @@
* Definition of views_handler_argument_field_list_text.
*/
namespace
Drupal\field\Plugin\views\argument
;
use
Drupal\views\Plugins\views\argument\String
;
use
Drupal\Core\Annotation\Plugin
;
/**
...
...
@@ -14,7 +17,13 @@
*
* @ingroup views_argument_handlers
*/
class
views_handler_argument_field_list_string
extends
String
{
/**
* @Plugin(
* plugin_id = "field_list_string"
* )
*/
class
ListString
extends
String
{
/**
* Stores the allowed values of this field.
*
...
...
lib/Drupal/field/Plugin/views/field/
views_handler_field_f
ield.
inc
→
lib/Drupal/field/Plugin/views/field/
F
ield.
php
View file @
eb3e8563
...
...
@@ -5,7 +5,10 @@
* Definition of views_handler_field_field.
*/
namespace
Drupal\field\Plugin\views\field
;
use
Drupal\views\Plugins\views\field\FieldPluginBase
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Helper function: Return an array of formatter options for a field type.
...
...
@@ -39,7 +42,13 @@ function _field_view_formatter_options($field_type = NULL) {
*
* @ingroup views_field_handlers
*/
class
views_handler_field_field
extends
FieldPluginBase
{
/**
* @Plugin(
* plugin_id = "field"
* )
*/
class
Field
extends
FieldPluginBase
{
/**
* An array to store field renderable arrays for use by render_items.
* @var array
...
...
lib/Drupal/field/Plugin/views/filter/
views_handler_filter_f
ield
_l
ist.
inc
→
lib/Drupal/field/Plugin/views/filter/
F
ield
L
ist.
php
View file @
eb3e8563
...
...
@@ -5,14 +5,23 @@
* Definition of views_handler_filter_field_list.
*/
namespace
Drupal\field\Plugin\views\filter
;
use
Drupal\views\Plugins\views\filter\InOperator
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Filter handler which uses list-fields as options.
*
* @ingroup views_filter_handlers
*/
class
views_handler_filter_field_list
extends
InOperator
{
/**
* @Plugin(
* plugin_id = "field_list"
* )
*/
class
FieldList
extends
InOperator
{
function
get_value_options
()
{
$field
=
field_info_field
(
$this
->
definition
[
'field_name'
]);
$this
->
value_options
=
list_allowed_values
(
$field
);
...
...
lib/Drupal/field/Plugin/views/relationship/
views_handler_relationship_e
ntity
_r
everse.
inc
→
lib/Drupal/field/Plugin/views/relationship/
E
ntity
R
everse.
php
View file @
eb3e8563
...
...
@@ -5,15 +5,24 @@
* Definition of views_handler_relationship_entity_reverse.
*/
namespace
Drupal\field\Plugin\views\relationship
;
use
Drupal\views\Join
;
use
Drupal\views\Plugins\views\relationship\RelationshipPluginBase
;
use
Drupal\Core\Annotation\Plugin
;
/**
* A relationship handlers which reverse entity references.
*
* @ingroup views_relationship_handlers
*/
class
views_handler_relationship_entity_reverse
extends
RelationshipPluginBase
{
/**
* @Plugin(
* plugin_id = "entity_reverse"
* )
*/
class
EntityReverse
extends
RelationshipPluginBase
{
function
init
(
&
$view
,
&
$options
)
{
parent
::
init
(
$view
,
$options
);
...
...
lib/Drupal/filter/Plugin/views/field/
views_handler_field_filter_f
ormat
_n
ame.
inc
→
lib/Drupal/filter/Plugin/views/field/
F
ormat
N
ame.
php
View file @
eb3e8563
...
...
@@ -5,12 +5,23 @@
* Definition of views_handler_field_filter_format_name.
*/
namespace
Drupal\filter\Plugin\views\field
;
use
Drupal\views\Plugins\views\field\FieldPluginBase
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Field handler to output the name of an input format.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_filter_format_name
extends
views_handler_field
{
/**
* @Plugin(
* plugin_id = "filter_format_name"
* )
*/
class
FormatName
extends
FieldPluginBase
{
function
construct
()
{
parent
::
construct
();
// Be explicit about the table we are using.
...
...
lib/Drupal/views/Plugins/views/row/RowPluginBase.php
View file @
eb3e8563
...
...
@@ -37,7 +37,7 @@ function init(&$view, &$display, $options = NULL) {
}
function
uses_fields
()
{
return
!
empty
(
$this
->
definition
[
'uses
fields'
]);
return
!
empty
(
$this
->
definition
[
'uses
_
fields'
]);
}
...
...
lib/Drupal/views/Plugins/views/style/StylePluginBase.php
View file @
eb3e8563
...
...
@@ -106,7 +106,7 @@ function uses_fields() {
$row_uses_fields
=
$this
->
row_plugin
->
uses_fields
();
}
// Otherwise, check the definition or the option.
return
$row_uses_fields
||
!
empty
(
$this
->
definition
[
'uses
fields'
])
||
!
empty
(
$this
->
options
[
'uses_fields'
]);
return
$row_uses_fields
||
!
empty
(
$this
->
definition
[
'uses
_
fields'
])
||
!
empty
(
$this
->
options
[
'uses_fields'
]);
}
/**
...
...
modules/field.views.inc
View file @
eb3e8563
...
...
@@ -234,7 +234,7 @@ function field_views_field_default_views_data($field) {
$real_field
=
reset
(
$keys
);
$data
[
$table
][
$column
][
'field'
]
=
array
(
'table'
=>
$table
,
'
handler'
=>
'views_handler_field_
field'
,
'
plugin_id'
=>
'
field'
,
'click sortable'
=>
TRUE
,
'field_name'
=>
$field
[
'field_name'
],
// Provide a real field for group by.
...
...
@@ -259,18 +259,18 @@ function field_views_field_default_views_data($field) {
case
'serial'
:
case
'numeric'
:
case
'float'
:
$filter
=
'
views_handler_filter_
numeric'
;
$argument
=
'
views_handler_argument_
numeric'
;
$sort
=
'
views_handler_sort
'
;
$filter
=
'numeric'
;
$argument
=
'numeric'
;
$sort
=
'
standard
'
;
break
;
case
'text'
:
case
'blob'
:
// It does not make sense to sort by blob or text.
$allow_sort
=
FALSE
;
default
:
$filter
=
'
views_handler_filter_
string'
;
$argument
=
'
views_handler_argument_
string'
;
$sort
=
'
views_handler_sort
'
;
$filter
=
'string'
;
$argument
=
'string'
;
$sort
=
'
standard
'
;
break
;
}
...
...
@@ -335,7 +335,7 @@ function field_views_field_default_views_data($field) {
$data
[
$table
][
$column_real_name
][
'argument'
]
=
array
(
'field'
=>
$column_real_name
,
'table'
=>
$table
,
'
handler
'
=>
$argument
,
'
plugin_id
'
=>
$argument
,
'additional fields'
=>
$additional_fields
,
'field_name'
=>
$field
[
'field_name'
],
'empty field name'
=>
t
(
'- No value -'
),
...
...
@@ -343,7 +343,7 @@ function field_views_field_default_views_data($field) {
$data
[
$table
][
$column_real_name
][
'filter'
]
=
array
(
'field'
=>
$column_real_name
,
'table'
=>
$table
,
'
handler
'
=>
$filter
,
'
plugin_id
'
=>
$filter
,
'additional fields'
=>
$additional_fields
,
'field_name'
=>
$field
[
'field_name'
],
'allow empty'
=>
TRUE
,
...
...
@@ -352,7 +352,7 @@ function field_views_field_default_views_data($field) {
$data
[
$table
][
$column_real_name
][
'sort'
]
=
array
(
'field'
=>
$column_real_name
,
'table'
=>
$table
,
'
handler
'
=>
$sort
,
'
plugin_id
'
=>
$sort
,
'additional fields'
=>
$additional_fields
,
'field_name'
=>
$field
[
'field_name'
],
);
...
...
@@ -410,14 +410,14 @@ function list_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_
field_list'
;
$data
[
$table_name
][
$field_name
][
'filter'
][
'
plugin_id'
]
=
'
field_list'
;
}
if
(
isset
(
$field_data
[
'argument'
])
&&
$field_name
!=
'delta'
)
{
if
(
$field
[
'type'
]
==
'list_text'
)
{
$data
[
$table_name
][
$field_name
][
'argument'
][
'
handler'
]
=
'views_handler_argument_
field_list_string'
;
$data
[
$table_name
][
$field_name
][
'argument'
][
'
plugin_id'
]
=
'
field_list_string'
;
}
else
{
$data
[
$table_name
][
$field_name
][
'argument'
][
'
handler'
]
=
'views_handler_argument_
field_list'
;
$data
[
$table_name
][
$field_name
][
'argument'
][
'
plugin_id'
]
=
'
field_list'
;
}
}
}
...
...
views.api.php
View file @
eb3e8563
...
...
@@ -578,14 +578,14 @@ function hook_views_data_alter(&$data) {
* - Used by style plugins:
* - uses_row_plugin: Set to TRUE to allow row plugins for this style.
* - uses_row_class: Set to TRUE to allow the CSS class settings for rows.
* - uses
fields: Set to TRUE to have the style plugin accept field
* - uses
_
fields: Set to TRUE to have the style plugin accept field
* handlers.
* - uses grouping: Set to TRUE to allow the grouping settings for rows.
* - even empty: May have the value 'even empty' to tell Views that the style
* should be rendered even if there are no results.
*
* - Used by row plugins:
* - uses
fields: Set to TRUE to have the row plugin accept field handlers.
* - uses
_
fields: Set to TRUE to have the row plugin accept field handlers.
*/
function
hook_views_plugins
()
{
$plugins
=
array
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment