Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
d21b6884
Commit
d21b6884
authored
Jul 28, 2012
by
dawehner
Committed by
tim.plunkett
Oct 21, 2012
Browse files
convert more filters to annotations
parent
d8bfd3b9
Changes
19
Hide whitespace changes
Inline
Side-by-side
lib/Drupal/views/Plugins/views/filter/BooleanOperator.php
View file @
d21b6884
...
...
@@ -7,6 +7,8 @@
namespace
Drupal\views\Plugins\views\filter
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Simple filter to handle matching of boolean values
*
...
...
@@ -23,6 +25,12 @@
*
* @ingroup views_filter_handlers
*/
/**
* @plugin(
* plugin_id = "boolean"
* )
*/
class
BooleanOperator
extends
FilterPluginBase
{
// exposed filter options
...
...
lib/Drupal/views/Plugins/views/filter/BooleanOperatorString.php
View file @
d21b6884
...
...
@@ -7,6 +7,8 @@
namespace
Drupal\views\Plugins\views\filter
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Simple filter to handle matching of boolean values.
*
...
...
@@ -18,6 +20,12 @@
*
* @ingroup views_filter_handlers
*/
/**
* @plugin(
* plugid_id = "boolean_string"
* )
*/
class
BooleanOperatorString
extends
BooleanOperator
{
function
query
()
{
$this
->
ensure_my_table
();
...
...
lib/Drupal/views/Plugins/views/filter/Combine.php
View file @
d21b6884
...
...
@@ -7,11 +7,19 @@
namespace
Drupal\views\Plugins\views\filter
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Filter handler which allows to search on multiple fields.
*
* @ingroup views_field_handlers
*/
/**
* @plugin(
* plugin_id = "combine"
* )
*/
class
Combine
extends
String
{
/**
* @var views_plugin_query_default
...
...
lib/Drupal/views/Plugins/views/filter/Equality.php
View file @
d21b6884
...
...
@@ -7,11 +7,19 @@
namespace
Drupal\views\Plugins\views\filter
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Simple filter to handle equal to / not equal to filters
*
* @ingroup views_filter_handlers
*/
/**
* @plugin(
* plugin_id = "equality"
* )
*/
class
Equality
extends
FilterPluginBase
{
// exposed filter options
var
$always_multiple
=
TRUE
;
...
...
lib/Drupal/views/Plugins/views/filter/GroupByNumeric.php
View file @
d21b6884
...
...
@@ -7,11 +7,19 @@
namespace
Drupal\views\Plugins\views\filter
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Simple filter to handle greater than/less than filters
*
* @ingroup views_filter_handlers
*/
/**
* @plugin(
* plugin_id = "groupby_numeric"
* )
*/
class
GroupByNumeric
extends
Numeric
{
function
query
()
{
$this
->
ensure_my_table
();
...
...
lib/Drupal/views/Plugins/views/filter/InOperator.php
View file @
d21b6884
...
...
@@ -7,6 +7,8 @@
namespace
Drupal\views\Plugins\views\filter
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Simple filter to handle matching of multiple options selectable via checkboxes
*
...
...
@@ -16,6 +18,12 @@
*
* @ingroup views_filter_handlers
*/
/**
* @plugin(
* plugin_id = "in_operator"
* )
*/
class
InOperator
extends
FilterPluginBase
{
var
$value_form_type
=
'checkboxes'
;
...
...
lib/Drupal/views/Plugins/views/filter/ManyToOne.php
View file @
d21b6884
...
...
@@ -7,6 +7,8 @@
namespace
Drupal\views\Plugins\views\filter
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Complex filter to handle filtering for many to one relationships,
* such as terms (many terms per node) or roles (many roles per user).
...
...
@@ -17,6 +19,12 @@
*
* @ingroup views_filter_handlers
*/
/**
* @plugin(
* plugin_id = "many_to_one"
* )
*/
class
ManyToOne
extends
InOperator
{
/**
* @var views_many_to_one_helper
...
...
lib/Drupal/views/Plugins/views/query/Sql.php
View file @
d21b6884
...
...
@@ -1532,7 +1532,7 @@ function get_aggregation_info() {
'handler'
=>
array
(
'argument'
=>
'views_handler_argument_group_by_numeric'
,
'field'
=>
'views_handler_field_numeric'
,
'filter'
=>
'
views_handler_filter_
group
_
by_numeric'
,
'filter'
=>
'groupby_numeric'
,
'sort'
=>
'groupby_numeric'
,
),
),
...
...
@@ -1542,7 +1542,7 @@ function get_aggregation_info() {
'handler'
=>
array
(
'argument'
=>
'views_handler_argument_group_by_numeric'
,
'field'
=>
'views_handler_field_numeric'
,
'filter'
=>
'
views_handler_filter_
group
_
by_numeric'
,
'filter'
=>
'groupby_numeric'
,
'sort'
=>
'groupby_numeric'
,
),
),
...
...
@@ -1551,7 +1551,7 @@ function get_aggregation_info() {
'method'
=>
'views_query_default_aggregation_method_simple'
,
'handler'
=>
array
(
'argument'
=>
'views_handler_argument_group_by_numeric'
,
'filter'
=>
'
views_handler_filter_
group
_
by_numeric'
,
'filter'
=>
'groupby_numeric'
,
'sort'
=>
'groupby_numeric'
,
),
),
...
...
@@ -1560,7 +1560,7 @@ function get_aggregation_info() {
'method'
=>
'views_query_default_aggregation_method_simple'
,
'handler'
=>
array
(
'argument'
=>
'views_handler_argument_group_by_numeric'
,
'filter'
=>
'
views_handler_filter_
group
_
by_numeric'
,
'filter'
=>
'groupby_numeric'
,
'sort'
=>
'groupby_numeric'
,
),
),
...
...
@@ -1569,7 +1569,7 @@ function get_aggregation_info() {
'method'
=>
'views_query_default_aggregation_method_simple'
,
'handler'
=>
array
(
'argument'
=>
'views_handler_argument_group_by_numeric'
,
'filter'
=>
'
views_handler_filter_
group
_
by_numeric'
,
'filter'
=>
'groupby_numeric'
,
'sort'
=>
'groupby_numeric'
,
),
),
...
...
@@ -1578,7 +1578,7 @@ function get_aggregation_info() {
'method'
=>
'views_query_default_aggregation_method_simple'
,
'handler'
=>
array
(
'argument'
=>
'views_handler_argument_group_by_numeric'
,
'filter'
=>
'
views_handler_filter_
group
_
by_numeric'
,
'filter'
=>
'groupby_numeric'
,
'sort'
=>
'groupby_numeric'
,
),
),
...
...
@@ -1587,7 +1587,7 @@ function get_aggregation_info() {
'method'
=>
'views_query_default_aggregation_method_simple'
,
'handler'
=>
array
(
'argument'
=>
'views_handler_argument_group_by_numeric'
,
'filter'
=>
'
views_handler_filter_
group
_
by_numeric'
,
'filter'
=>
'groupby_numeric'
,
'sort'
=>
'groupby_numeric'
,
),
)
...
...
modules/comment.views.inc
View file @
d21b6884
...
...
@@ -279,7 +279,7 @@ function comment_views_data() {
),
),
'filter'
=>
array
(
'
handler'
=>
'views_handler_filter_boolean_operator
'
,
'
plugin_id'
=>
'boolean
'
,
'label'
=>
t
(
'Approved comment'
),
'type'
=>
'yes-no'
,
),
...
...
modules/locale.views.inc
View file @
d21b6884
...
...
@@ -184,7 +184,7 @@ function locale_views_data() {
'click sortable'
=>
TRUE
,
),
'filter'
=>
array
(
'
handler'
=>
'views_handler_filter_boolean_operator
'
,
'
plugin_id'
=>
'boolean
'
,
'label'
=>
t
(
'Plural'
),
'type'
=>
'yes-no'
,
),
...
...
modules/node.views.inc
View file @
d21b6884
...
...
@@ -105,7 +105,7 @@ function node_views_data() {
'plugin_id'
=>
'date'
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\D
ate'
,
'
plugin_id'
=>
'd
ate'
,
),
);
...
...
@@ -121,7 +121,7 @@ function node_views_data() {
'plugin_id'
=>
'date'
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\D
ate'
,
'
plugin_id'
=>
'd
ate'
,
),
);
...
...
@@ -156,7 +156,7 @@ function node_views_data() {
),
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\BooleanOperator
'
,
'
plugin_id'
=>
'boolean
'
,
'label'
=>
t
(
'Published'
),
'type'
=>
'yes-no'
,
'use equal'
=>
TRUE
,
// Use status = 1 instead of status <> 0 in WHERE statment
...
...
@@ -189,7 +189,7 @@ function node_views_data() {
),
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\BooleanOperator
'
,
'
plugin_id'
=>
'boolean
'
,
'label'
=>
t
(
'Promoted to front page'
),
'type'
=>
'yes-no'
,
),
...
...
@@ -211,7 +211,7 @@ function node_views_data() {
),
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\BooleanOperator
'
,
'
plugin_id'
=>
'boolean
'
,
'label'
=>
t
(
'Sticky'
),
'type'
=>
'yes-no'
,
),
...
...
@@ -535,7 +535,7 @@ function node_views_data() {
'plugin_id'
=>
'date'
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\D
ate'
,
'
plugin_id'
=>
'd
ate'
,
),
);
...
...
modules/poll.views.inc
View file @
d21b6884
...
...
@@ -34,7 +34,7 @@ function poll_views_data() {
'click sortable'
=>
TRUE
,
),
'filter'
=>
array
(
'
handler'
=>
'views_handler_filter_boolean_operator
'
,
'
plugin_id'
=>
'boolean
'
,
'label'
=>
t
(
'Active'
),
'type'
=>
'yes-no'
,
),
...
...
modules/search.views.inc
View file @
d21b6884
...
...
@@ -89,7 +89,7 @@ function search_views_data() {
'handler'
=>
'views_handler_argument_node_nid'
,
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\E
quality'
,
'
plugin_id'
=>
'e
quality'
,
),
);
...
...
@@ -107,7 +107,7 @@ function search_views_data() {
'handler'
=>
'views_handler_argument_node_nid'
,
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\E
quality'
,
'
plugin_id'
=>
'e
quality'
,
),
);
...
...
modules/statistics.views.inc
View file @
d21b6884
...
...
@@ -70,7 +70,7 @@ function statistics_views_data() {
'click sortable'
=>
TRUE
,
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\D
ate'
,
'
plugin_id'
=>
'd
ate'
,
),
'sort'
=>
array
(
'plugin_id'
=>
'standard'
,
...
...
@@ -254,7 +254,7 @@ function statistics_views_data() {
'plugin_id'
=>
'standard'
,
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\D
ate'
,
'
plugin_id'
=>
'd
ate'
,
),
);
...
...
modules/system.views.inc
View file @
d21b6884
...
...
@@ -163,7 +163,7 @@ function system_views_data() {
'plugin_id'
=>
'date'
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\D
ate'
,
'
plugin_id'
=>
'd
ate'
,
),
);
...
...
@@ -535,7 +535,7 @@ function system_views_data() {
'name field'
=>
'status'
,
// the field to display in the summary.
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\BooleanOperator
'
,
'
plugin_id'
=>
'boolean
'
,
),
'sort'
=>
array
(
'plugin_id'
=>
'standard'
,
...
...
modules/translation.views.inc
View file @
d21b6884
...
...
@@ -98,7 +98,7 @@ function translation_views_data_alter(&$data) {
'click sortable'
=>
TRUE
,
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\BooleanOperator
'
,
'
plugin_id'
=>
'boolean
'
,
'label'
=>
t
(
'Outdated'
),
'type'
=>
'yes-no'
,
),
...
...
modules/user.views.inc
View file @
d21b6884
...
...
@@ -183,7 +183,7 @@ function user_views_data() {
'plugin_id'
=>
'standard'
,
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\BooleanOperator
'
,
'
plugin_id'
=>
'boolean
'
,
'label'
=>
t
(
'Has Avatar'
),
'type'
=>
'yes-no'
,
),
...
...
@@ -210,7 +210,7 @@ function user_views_data() {
'plugin_id'
=>
'date'
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\D
ate'
,
'
plugin_id'
=>
'd
ate'
,
),
);
...
...
@@ -281,7 +281,7 @@ function user_views_data() {
'plugin_id'
=>
'date'
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\D
ate'
,
'
plugin_id'
=>
'd
ate'
,
),
);
...
...
@@ -297,7 +297,7 @@ function user_views_data() {
'plugin_id'
=>
'date'
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\D
ate'
,
'
plugin_id'
=>
'd
ate'
,
),
);
...
...
@@ -314,7 +314,7 @@ function user_views_data() {
),
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\BooleanOperator
'
,
'
plugin_id'
=>
'boolean
'
,
'label'
=>
t
(
'Active'
),
'type'
=>
'yes-no'
,
),
...
...
modules/views.views.inc
View file @
d21b6884
...
...
@@ -95,7 +95,7 @@ function views_views_data() {
'title'
=>
t
(
'Combine fields filter'
),
'help'
=>
t
(
'Combine two fields together and search by them.'
),
'filter'
=>
array
(
'
handler'
=>
'Drupal\views\Plugins\views\filter\C
ombine'
,
'
plugin_id'
=>
'c
ombine'
,
),
);
...
...
views.api.php
View file @
d21b6884
...
...
@@ -423,7 +423,7 @@ function hook_views_data() {
'click sortable'
=>
TRUE
,
),
'filter'
=>
array
(
'
handler'
=>
'views_handler_filter_boolean_operator
'
,
'
plugin_id'
=>
'boolean
'
,
// Note that you can override the field-wide label:
'label'
=>
t
(
'Published'
),
// This setting is used by the boolean filter handler, as possible option.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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