Commit de9f13c1 authored by catch's avatar catch

Issue #2062131 by danylevskyi, NonProfit: In MachineName Class Rename Views...

Issue #2062131 by danylevskyi, NonProfit: In MachineName Class Rename Views properties to core standards.
parent 928a366d
......@@ -25,23 +25,23 @@ class MachineName extends FieldPluginBase {
/**
* @var array Stores the available options.
*/
var $value_options;
protected $valueOptions;
public function getValueOptions() {
if (isset($this->value_options)) {
if (isset($this->valueOptions)) {
return;
}
if (isset($this->definition['options callback']) && is_callable($this->definition['options callback'])) {
if (isset($this->definition['options arguments']) && is_array($this->definition['options arguments'])) {
$this->value_options = call_user_func_array($this->definition['options callback'], $this->definition['options arguments']);
$this->valueOptions = call_user_func_array($this->definition['options callback'], $this->definition['options arguments']);
}
else {
$this->value_options = call_user_func($this->definition['options callback']);
$this->valueOptions = call_user_func($this->definition['options callback']);
}
}
else {
$this->value_options = array();
$this->valueOptions = array();
}
}
......@@ -72,11 +72,11 @@ public function preRender(&$values) {
*/
public function render(ResultRow $values) {
$value = $values->{$this->field_alias};
if (!empty($this->options['machine_name']) || !isset($this->value_options[$value])) {
if (!empty($this->options['machine_name']) || !isset($this->valueOptions[$value])) {
$result = check_plain($value);
}
else {
$result = $this->value_options[$value];
$result = $this->valueOptions[$value];
}
return $result;
......
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