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
d72064fa
Commit
d72064fa
authored
Jun 05, 2013
by
alexpott
Browse files
Issue
#2003458
by Dan Reinders: Rename Views method operator_values() to operatorValues().
parent
c481e2fd
Changes
3
Hide whitespace changes
Inline
Side-by-side
core/modules/views/lib/Drupal/views/Plugin/views/filter/InOperator.php
View file @
d72064fa
...
...
@@ -153,7 +153,7 @@ public function operatorOptions($which = 'title') {
return
$options
;
}
function
operator
_v
alues
(
$values
=
1
)
{
protected
function
operator
V
alues
(
$values
=
1
)
{
$options
=
array
();
foreach
(
$this
->
operators
()
as
$id
=>
$info
)
{
if
(
isset
(
$info
[
'values'
])
&&
$info
[
'values'
]
==
$values
)
{
...
...
@@ -186,7 +186,7 @@ protected function valueForm(&$form, &$form_state) {
if
(
empty
(
$this
->
options
[
'expose'
][
'use_operator'
])
||
empty
(
$this
->
options
[
'expose'
][
'operator_id'
]))
{
// exposed and locked.
$which
=
in_array
(
$this
->
operator
,
$this
->
operator
_v
alues
(
1
))
?
'value'
:
'none'
;
$which
=
in_array
(
$this
->
operator
,
$this
->
operator
V
alues
(
1
))
?
'value'
:
'none'
;
}
else
{
$source
=
':input[name="'
.
$this
->
options
[
'expose'
][
'operator_id'
]
.
'"]'
;
...
...
@@ -235,7 +235,7 @@ protected function valueForm(&$form, &$form_state) {
$form
[
'value'
][
'#suffix'
]
=
'</div>'
;
}
// Setup #states for all operators with one value.
foreach
(
$this
->
operator
_v
alues
(
1
)
as
$operator
)
{
foreach
(
$this
->
operator
V
alues
(
1
)
as
$operator
)
{
$form
[
'value'
][
'#states'
][
'visible'
][]
=
array
(
$source
=>
array
(
'value'
=>
$operator
),
);
...
...
@@ -324,7 +324,7 @@ public function adminSummary() {
$operator
=
check_plain
(
$info
[
$this
->
operator
][
'short'
]);
$values
=
''
;
if
(
in_array
(
$this
->
operator
,
$this
->
operator
_v
alues
(
1
)))
{
if
(
in_array
(
$this
->
operator
,
$this
->
operator
V
alues
(
1
)))
{
// Remove every element which is not known.
foreach
(
$this
->
value
as
$value
)
{
if
(
!
isset
(
$this
->
value_options
[
$value
]))
{
...
...
@@ -405,11 +405,11 @@ public function validate() {
// If the operator is an operator which doesn't require a value, there is
// no need for additional validation.
if
(
in_array
(
$this
->
operator
,
$this
->
operator
_v
alues
(
0
)))
{
if
(
in_array
(
$this
->
operator
,
$this
->
operator
V
alues
(
0
)))
{
return
array
();
}
if
(
!
in_array
(
$this
->
operator
,
$this
->
operator
_v
alues
(
1
)))
{
if
(
!
in_array
(
$this
->
operator
,
$this
->
operator
V
alues
(
1
)))
{
$errors
[]
=
t
(
'The operator is invalid on filter: @filter.'
,
array
(
'@filter'
=>
$this
->
adminLabel
(
TRUE
)));
}
if
(
is_array
(
$this
->
value
))
{
...
...
core/modules/views/lib/Drupal/views/Plugin/views/filter/Numeric.php
View file @
d72064fa
...
...
@@ -132,7 +132,7 @@ public function operatorOptions($which = 'title') {
return
$options
;
}
function
operator
_v
alues
(
$values
=
1
)
{
protected
function
operator
V
alues
(
$values
=
1
)
{
$options
=
array
();
foreach
(
$this
->
operators
()
as
$id
=>
$info
)
{
if
(
$info
[
'values'
]
==
$values
)
{
...
...
@@ -162,7 +162,7 @@ protected function valueForm(&$form, &$form_state) {
if
(
empty
(
$this
->
options
[
'expose'
][
'use_operator'
])
||
empty
(
$this
->
options
[
'expose'
][
'operator_id'
]))
{
// exposed and locked.
$which
=
in_array
(
$this
->
operator
,
$this
->
operator
_v
alues
(
2
))
?
'minmax'
:
'value'
;
$which
=
in_array
(
$this
->
operator
,
$this
->
operator
V
alues
(
2
))
?
'minmax'
:
'value'
;
}
else
{
$source
=
':input[name="'
.
$this
->
options
[
'expose'
][
'operator_id'
]
.
'"]'
;
...
...
@@ -177,7 +177,7 @@ protected function valueForm(&$form, &$form_state) {
'#default_value'
=>
$this
->
value
[
'value'
],
);
// Setup #states for all operators with one value.
foreach
(
$this
->
operator
_v
alues
(
1
)
as
$operator
)
{
foreach
(
$this
->
operator
V
alues
(
1
)
as
$operator
)
{
$form
[
'value'
][
'value'
][
'#states'
][
'visible'
][]
=
array
(
$source
=>
array
(
'value'
=>
$operator
),
);
...
...
@@ -216,7 +216,7 @@ protected function valueForm(&$form, &$form_state) {
if
(
$which
==
'all'
)
{
$states
=
array
();
// Setup #states for all operators with two values.
foreach
(
$this
->
operator
_v
alues
(
2
)
as
$operator
)
{
foreach
(
$this
->
operator
V
alues
(
2
)
as
$operator
)
{
$states
[
'#states'
][
'visible'
][]
=
array
(
$source
=>
array
(
'value'
=>
$operator
),
);
...
...
@@ -289,10 +289,10 @@ public function adminSummary() {
$options
=
$this
->
operatorOptions
(
'short'
);
$output
=
check_plain
(
$options
[
$this
->
operator
]);
if
(
in_array
(
$this
->
operator
,
$this
->
operator
_v
alues
(
2
)))
{
if
(
in_array
(
$this
->
operator
,
$this
->
operator
V
alues
(
2
)))
{
$output
.
=
' '
.
t
(
'@min and @max'
,
array
(
'@min'
=>
$this
->
value
[
'min'
],
'@max'
=>
$this
->
value
[
'max'
]));
}
elseif
(
in_array
(
$this
->
operator
,
$this
->
operator
_v
alues
(
1
)))
{
elseif
(
in_array
(
$this
->
operator
,
$this
->
operator
V
alues
(
1
)))
{
$output
.
=
' '
.
check_plain
(
$this
->
value
[
'value'
]);
}
return
$output
;
...
...
core/modules/views/lib/Drupal/views/Plugin/views/filter/String.php
View file @
d72064fa
...
...
@@ -168,13 +168,13 @@ public function adminSummary() {
if
(
!
empty
(
$options
[
$this
->
operator
]))
{
$output
=
check_plain
(
$options
[
$this
->
operator
]);
}
if
(
in_array
(
$this
->
operator
,
$this
->
operator
_v
alues
(
1
)))
{
if
(
in_array
(
$this
->
operator
,
$this
->
operator
V
alues
(
1
)))
{
$output
.
=
' '
.
check_plain
(
$this
->
value
);
}
return
$output
;
}
function
operator
_v
alues
(
$values
=
1
)
{
protected
function
operator
V
alues
(
$values
=
1
)
{
$options
=
array
();
foreach
(
$this
->
operators
()
as
$id
=>
$info
)
{
if
(
isset
(
$info
[
'values'
])
&&
$info
[
'values'
]
==
$values
)
{
...
...
@@ -202,7 +202,7 @@ protected function valueForm(&$form, &$form_state) {
if
(
empty
(
$this
->
options
[
'expose'
][
'use_operator'
])
||
empty
(
$this
->
options
[
'expose'
][
'operator_id'
]))
{
// exposed and locked.
$which
=
in_array
(
$this
->
operator
,
$this
->
operator
_v
alues
(
1
))
?
'value'
:
'none'
;
$which
=
in_array
(
$this
->
operator
,
$this
->
operator
V
alues
(
1
))
?
'value'
:
'none'
;
}
else
{
$source
=
':input[name="'
.
$this
->
options
[
'expose'
][
'operator_id'
]
.
'"]'
;
...
...
@@ -222,7 +222,7 @@ protected function valueForm(&$form, &$form_state) {
if
(
$which
==
'all'
)
{
// Setup #states for all operators with one value.
foreach
(
$this
->
operator
_v
alues
(
1
)
as
$operator
)
{
foreach
(
$this
->
operator
V
alues
(
1
)
as
$operator
)
{
$form
[
'value'
][
'#states'
][
'visible'
][]
=
array
(
$source
=>
array
(
'value'
=>
$operator
),
);
...
...
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