Commit 20d028f5 authored by alexpott's avatar alexpott

Issue #2002276 by elvis2: Rename Views method add_self_tokens() to addSelfTokens().

parent 16c85cea
......@@ -808,7 +808,7 @@ function document_self_tokens(&$tokens) {
}
}
function add_self_tokens(&$tokens, $item) {
protected function addSelfTokens(&$tokens, $item) {
$field = $this->field_info;
foreach ($field['columns'] as $id => $column) {
// Use filter_xss_admin because it's user data and we can't be sure it is safe.
......
......@@ -141,7 +141,7 @@ function document_self_tokens(&$tokens) {
$tokens['[' . $this->options['id'] . '-vocabulary' . ']'] = t('The name for the vocabulary the term belongs to.');
}
function add_self_tokens(&$tokens, $item) {
protected function addSelfTokens(&$tokens, $item) {
foreach (array('tid', 'name', 'vocabulary_vid', 'vocabulary') as $token) {
// Replace _ with - for the vocabulary vid.
$tokens['[' . $this->options['id'] . '-' . str_replace('_', '-', $token) . ']'] = isset($item[$token]) ? $item[$token] : '';
......
......@@ -80,7 +80,7 @@ function document_self_tokens(&$tokens) {
$tokens['[' . $this->options['id'] . '-rid' . ']'] = t('The role ID of the role.');
}
function add_self_tokens(&$tokens, $item) {
protected function addSelfTokens(&$tokens, $item) {
$tokens['[' . $this->options['id'] . '-role' . ']'] = $item['role'];
$tokens['[' . $this->options['id'] . '-rid' . ']'] = $item['rid'];
}
......
......@@ -76,7 +76,7 @@ function document_self_tokens(&$tokens) {
$tokens['[' . $this->options['id'] . '-rid' . ']'] = t('The role machine-name of the role.');
}
function add_self_tokens(&$tokens, $item) {
protected function addSelfTokens(&$tokens, $item) {
if (!empty($item['role'])) {
$tokens['[' . $this->options['id'] . '-role' . ']'] = $item['role'];
$tokens['[' . $this->options['id'] . '-rid' . ']'] = $item['rid'];
......
......@@ -1497,7 +1497,7 @@ function get_render_tokens($item) {
$this->view->style_plugin->render_tokens[$this->view->row_index] = $tokens;
$this->last_tokens = $tokens;
if (!empty($item)) {
$this->add_self_tokens($tokens, $item);
$this->addSelfTokens($tokens, $item);
}
return $tokens;
......@@ -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
* field ID is terms, then the tokens might be [terms-tid] and [terms-name].
*/
function add_self_tokens(&$tokens, $item) { }
protected function addSelfTokens(&$tokens, $item) { }
/**
* Document any special tokens this field might use for itself.
*
* @see add_self_tokens()
* @see addSelfTokens()
*/
function document_self_tokens(&$tokens) { }
......
......@@ -43,9 +43,9 @@ public function getTestValue() {
}
/**
* Overrides Drupal\views\Plugin\views\field\FieldPluginBase::add_self_tokens().
* Overrides Drupal\views\Plugin\views\field\FieldPluginBase::addSelfTokens().
*/
function add_self_tokens(&$tokens, $item) {
protected function addSelfTokens(&$tokens, $item) {
$tokens['[test-token]'] = $this->getTestValue();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment