Issue #2002972 by lokapujya, tvlooy, elvis2, jibran: Rename Views method tokenize_value() to tokenizeValue().

8.0.x
Alex Pott 2013-05-30 00:35:31 +01:00
parent 1f684ba3b2
commit 861277341c
7 changed files with 11 additions and 11 deletions

View File

@ -96,7 +96,7 @@ class Entity extends AreaPluginBase {
if (!$empty || !empty($this->options['empty'])) { if (!$empty || !empty($this->options['empty'])) {
$entity_id = $this->options['entity_id']; $entity_id = $this->options['entity_id'];
if ($this->options['tokenize']) { if ($this->options['tokenize']) {
$entity_id = $this->view->style_plugin->tokenize_value($entity_id, 0); $entity_id = $this->view->style_plugin->tokenizeValue($entity_id, 0);
} }
$entity_id = $this->globalTokenReplace($entity_id); $entity_id = $this->globalTokenReplace($entity_id);
if ($entity = entity_load($this->entityType, $entity_id)) { if ($entity = entity_load($this->entityType, $entity_id)) {

View File

@ -67,7 +67,7 @@ class Text extends AreaPluginBase {
public function renderTextarea($value, $format) { public function renderTextarea($value, $format) {
if ($value) { if ($value) {
if ($this->options['tokenize']) { if ($this->options['tokenize']) {
$value = $this->view->style_plugin->tokenize_value($value, 0); $value = $this->view->style_plugin->tokenizeValue($value, 0);
} }
return check_markup($this->globalTokenReplace($value), $format, '', FALSE); return check_markup($this->globalTokenReplace($value), $format, '', FALSE);
} }

View File

@ -61,7 +61,7 @@ class TextCustom extends AreaPluginBase {
public function renderTextarea($value) { public function renderTextarea($value) {
if ($value) { if ($value) {
if ($this->options['tokenize']) { if ($this->options['tokenize']) {
$value = $this->view->style_plugin->tokenize_value($value, 0); $value = $this->view->style_plugin->tokenizeValue($value, 0);
} }
return $this->sanitizeValue($this->globalTokenReplace($value), 'xss_admin'); return $this->sanitizeValue($this->globalTokenReplace($value), 'xss_admin');
} }

View File

@ -290,7 +290,7 @@ abstract class FieldPluginBase extends HandlerBase {
function element_classes($row_index = NULL) { function element_classes($row_index = NULL) {
$classes = explode(' ', $this->options['element_class']); $classes = explode(' ', $this->options['element_class']);
foreach ($classes as &$class) { foreach ($classes as &$class) {
$class = $this->tokenize_value($class, $row_index); $class = $this->tokenizeValue($class, $row_index);
$class = drupal_clean_css_identifier($class); $class = drupal_clean_css_identifier($class);
} }
return implode(' ', $classes); return implode(' ', $classes);
@ -302,7 +302,7 @@ abstract class FieldPluginBase extends HandlerBase {
* This function actually figures out which field was last and uses its * This function actually figures out which field was last and uses its
* tokens so they will all be available. * tokens so they will all be available.
*/ */
function tokenize_value($value, $row_index = NULL) { public function tokenizeValue($value, $row_index = NULL) {
if (strpos($value, '[') !== FALSE || strpos($value, '!') !== FALSE || strpos($value, '%') !== FALSE) { if (strpos($value, '[') !== FALSE || strpos($value, '!') !== FALSE || strpos($value, '%') !== FALSE) {
$fake_item = array( $fake_item = array(
'alter_text' => TRUE, 'alter_text' => TRUE,
@ -340,7 +340,7 @@ abstract class FieldPluginBase extends HandlerBase {
public function elementLabelClasses($row_index = NULL) { public function elementLabelClasses($row_index = NULL) {
$classes = explode(' ', $this->options['element_label_class']); $classes = explode(' ', $this->options['element_label_class']);
foreach ($classes as &$class) { foreach ($classes as &$class) {
$class = $this->tokenize_value($class, $row_index); $class = $this->tokenizeValue($class, $row_index);
$class = drupal_clean_css_identifier($class); $class = drupal_clean_css_identifier($class);
} }
return implode(' ', $classes); return implode(' ', $classes);
@ -352,7 +352,7 @@ abstract class FieldPluginBase extends HandlerBase {
public function elementWrapperClasses($row_index = NULL) { public function elementWrapperClasses($row_index = NULL) {
$classes = explode(' ', $this->options['element_wrapper_class']); $classes = explode(' ', $this->options['element_wrapper_class']);
foreach ($classes as &$class) { foreach ($classes as &$class) {
$class = $this->tokenize_value($class, $row_index); $class = $this->tokenizeValue($class, $row_index);
$class = drupal_clean_css_identifier($class); $class = drupal_clean_css_identifier($class);
} }
return implode(' ', $classes); return implode(' ', $classes);

View File

@ -102,7 +102,7 @@ class Rss extends StylePluginBase {
$description = $this->options['description']; $description = $this->options['description'];
// Allow substitutions from the first row. // Allow substitutions from the first row.
$description = $this->tokenize_value($description, 0); $description = $this->tokenizeValue($description, 0);
return $description; return $description;
} }

View File

@ -186,7 +186,7 @@ abstract class StylePluginBase extends PluginBase {
if ($this->usesRowClass()) { if ($this->usesRowClass()) {
$class = $this->options['row_class']; $class = $this->options['row_class'];
if ($this->usesFields() && $this->view->field) { if ($this->usesFields() && $this->view->field) {
$class = strip_tags($this->tokenize_value($class, $row_index)); $class = strip_tags($this->tokenizeValue($class, $row_index));
} }
$classes = explode(' ', $class); $classes = explode(' ', $class);
@ -200,7 +200,7 @@ abstract class StylePluginBase extends PluginBase {
/** /**
* Take a value and apply token replacement logic to it. * Take a value and apply token replacement logic to it.
*/ */
function tokenize_value($value, $row_index) { public function tokenizeValue($value, $row_index) {
if (strpos($value, '[') !== FALSE || strpos($value, '!') !== FALSE || strpos($value, '%') !== FALSE) { if (strpos($value, '[') !== FALSE || strpos($value, '!') !== FALSE || strpos($value, '%') !== FALSE) {
$fake_item = array( $fake_item = array(
'alter_text' => TRUE, 'alter_text' => TRUE,

View File

@ -1529,7 +1529,7 @@ class ViewExecutable {
// Allow substitutions from the first row. // Allow substitutions from the first row.
if ($this->initStyle()) { if ($this->initStyle()) {
$title = $this->style_plugin->tokenize_value($title, 0); $title = $this->style_plugin->tokenizeValue($title, 0);
} }
return $title; return $title;
} }