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
20d028f5
Commit
20d028f5
authored
May 28, 2013
by
alexpott
Browse files
Issue
#2002276
by elvis2: Rename Views method add_self_tokens() to addSelfTokens().
parent
16c85cea
Changes
6
Show whitespace changes
Inline
Side-by-side
core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php
View file @
20d028f5
...
@@ -808,7 +808,7 @@ function document_self_tokens(&$tokens) {
...
@@ -808,7 +808,7 @@ function document_self_tokens(&$tokens) {
}
}
}
}
function
add
_s
elf
_t
okens
(
&
$tokens
,
$item
)
{
protected
function
add
S
elf
T
okens
(
&
$tokens
,
$item
)
{
$field
=
$this
->
field_info
;
$field
=
$this
->
field_info
;
foreach
(
$field
[
'columns'
]
as
$id
=>
$column
)
{
foreach
(
$field
[
'columns'
]
as
$id
=>
$column
)
{
// Use filter_xss_admin because it's user data and we can't be sure it is safe.
// Use filter_xss_admin because it's user data and we can't be sure it is safe.
...
...
core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/field/TaxonomyIndexTid.php
View file @
20d028f5
...
@@ -141,7 +141,7 @@ function document_self_tokens(&$tokens) {
...
@@ -141,7 +141,7 @@ function document_self_tokens(&$tokens) {
$tokens
[
'['
.
$this
->
options
[
'id'
]
.
'-vocabulary'
.
']'
]
=
t
(
'The name for the vocabulary the term belongs to.'
);
$tokens
[
'['
.
$this
->
options
[
'id'
]
.
'-vocabulary'
.
']'
]
=
t
(
'The name for the vocabulary the term belongs to.'
);
}
}
function
add
_s
elf
_t
okens
(
&
$tokens
,
$item
)
{
protected
function
add
S
elf
T
okens
(
&
$tokens
,
$item
)
{
foreach
(
array
(
'tid'
,
'name'
,
'vocabulary_vid'
,
'vocabulary'
)
as
$token
)
{
foreach
(
array
(
'tid'
,
'name'
,
'vocabulary_vid'
,
'vocabulary'
)
as
$token
)
{
// Replace _ with - for the vocabulary vid.
// Replace _ with - for the vocabulary vid.
$tokens
[
'['
.
$this
->
options
[
'id'
]
.
'-'
.
str_replace
(
'_'
,
'-'
,
$token
)
.
']'
]
=
isset
(
$item
[
$token
])
?
$item
[
$token
]
:
''
;
$tokens
[
'['
.
$this
->
options
[
'id'
]
.
'-'
.
str_replace
(
'_'
,
'-'
,
$token
)
.
']'
]
=
isset
(
$item
[
$token
])
?
$item
[
$token
]
:
''
;
...
...
core/modules/user/lib/Drupal/user/Plugin/views/field/Permissions.php
View file @
20d028f5
...
@@ -80,7 +80,7 @@ function document_self_tokens(&$tokens) {
...
@@ -80,7 +80,7 @@ function document_self_tokens(&$tokens) {
$tokens['[' . $this->options['id'] . '-rid' . ']'] = t('The role ID of the role.');
$tokens['[' . $this->options['id'] . '-rid' . ']'] = t('The role ID of the role.');
}
}
function add
_s
elf
_t
okens(&$tokens, $item) {
protected
function add
S
elf
T
okens(&$tokens, $item) {
$tokens['[' . $this->options['id'] . '-role' . ']'] = $item['role'];
$tokens['[' . $this->options['id'] . '-role' . ']'] = $item['role'];
$tokens['[' . $this->options['id'] . '-rid' . ']'] = $item['rid'];
$tokens['[' . $this->options['id'] . '-rid' . ']'] = $item['rid'];
}
}
...
...
core/modules/user/lib/Drupal/user/Plugin/views/field/Roles.php
View file @
20d028f5
...
@@ -76,7 +76,7 @@ function document_self_tokens(&$tokens) {
...
@@ -76,7 +76,7 @@ function document_self_tokens(&$tokens) {
$tokens
[
'['
.
$this
->
options
[
'id'
]
.
'-rid'
.
']'
]
=
t
(
'The role machine-name of the role.'
);
$tokens
[
'['
.
$this
->
options
[
'id'
]
.
'-rid'
.
']'
]
=
t
(
'The role machine-name of the role.'
);
}
}
function
add
_s
elf
_t
okens
(
&
$tokens
,
$item
)
{
protected
function
add
S
elf
T
okens
(
&
$tokens
,
$item
)
{
if
(
!
empty
(
$item
[
'role'
]))
{
if
(
!
empty
(
$item
[
'role'
]))
{
$tokens
[
'['
.
$this
->
options
[
'id'
]
.
'-role'
.
']'
]
=
$item
[
'role'
];
$tokens
[
'['
.
$this
->
options
[
'id'
]
.
'-role'
.
']'
]
=
$item
[
'role'
];
$tokens
[
'['
.
$this
->
options
[
'id'
]
.
'-rid'
.
']'
]
=
$item
[
'rid'
];
$tokens
[
'['
.
$this
->
options
[
'id'
]
.
'-rid'
.
']'
]
=
$item
[
'rid'
];
...
...
core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php
View file @
20d028f5
...
@@ -1497,7 +1497,7 @@ function get_render_tokens($item) {
...
@@ -1497,7 +1497,7 @@ function get_render_tokens($item) {
$this
->
view
->
style_plugin
->
render_tokens
[
$this
->
view
->
row_index
]
=
$tokens
;
$this
->
view
->
style_plugin
->
render_tokens
[
$this
->
view
->
row_index
]
=
$tokens
;
$this
->
last_tokens
=
$tokens
;
$this
->
last_tokens
=
$tokens
;
if
(
!
empty
(
$item
))
{
if
(
!
empty
(
$item
))
{
$this
->
add
_s
elf
_t
okens
(
$tokens
,
$item
);
$this
->
add
S
elf
T
okens
(
$tokens
,
$item
);
}
}
return
$tokens
;
return
$tokens
;
...
@@ -1572,12 +1572,12 @@ function get_token_values_recursive(array $array, array $parent_keys = array())
...
@@ -1572,12 +1572,12 @@ function get_token_values_recursive(array $array, array $parent_keys = array())
* where token is the field ID and subtoken is the field. If the
* where token is the field ID and subtoken is the field. If the
* field ID is terms, then the tokens might be [terms-tid] and [terms-name].
* field ID is terms, then the tokens might be [terms-tid] and [terms-name].
*/
*/
function
add
_s
elf
_t
okens
(
&
$tokens
,
$item
)
{
}
protected
function
add
S
elf
T
okens
(
&
$tokens
,
$item
)
{
}
/**
/**
* Document any special tokens this field might use for itself.
* Document any special tokens this field might use for itself.
*
*
* @see add
_s
elf
_t
okens()
* @see add
S
elf
T
okens()
*/
*/
function
document_self_tokens
(
&
$tokens
)
{
}
function
document_self_tokens
(
&
$tokens
)
{
}
...
...
core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/field/FieldTest.php
View file @
20d028f5
...
@@ -43,9 +43,9 @@ public function getTestValue() {
...
@@ -43,9 +43,9 @@ public function getTestValue() {
}
}
/**
/**
* Overrides Drupal\views\Plugin\views\field\FieldPluginBase::add
_s
elf
_t
okens().
* Overrides Drupal\views\Plugin\views\field\FieldPluginBase::add
S
elf
T
okens().
*/
*/
function
add
_s
elf
_t
okens
(
&
$tokens
,
$item
)
{
protected
function
add
S
elf
T
okens
(
&
$tokens
,
$item
)
{
$tokens
[
'[test-token]'
]
=
$this
->
getTestValue
();
$tokens
[
'[test-token]'
]
=
$this
->
getTestValue
();
}
}
...
...
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