Commit d72064fa authored by alexpott's avatar alexpott

Issue #2003458 by Dan Reinders: Rename Views method operator_values() to operatorValues().

parent c481e2fd
......@@ -153,7 +153,7 @@ public function operatorOptions($which = 'title') {
return $options;
}
function operator_values($values = 1) {
protected function operatorValues($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_values(1)) ? 'value' : 'none';
$which = in_array($this->operator, $this->operatorValues(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_values(1) as $operator) {
foreach ($this->operatorValues(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_values(1))) {
if (in_array($this->operator, $this->operatorValues(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_values(0))) {
if (in_array($this->operator, $this->operatorValues(0))) {
return array();
}
if (!in_array($this->operator, $this->operator_values(1))) {
if (!in_array($this->operator, $this->operatorValues(1))) {
$errors[] = t('The operator is invalid on filter: @filter.', array('@filter' => $this->adminLabel(TRUE)));
}
if (is_array($this->value)) {
......
......@@ -132,7 +132,7 @@ public function operatorOptions($which = 'title') {
return $options;
}
function operator_values($values = 1) {
protected function operatorValues($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_values(2)) ? 'minmax' : 'value';
$which = in_array($this->operator, $this->operatorValues(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_values(1) as $operator) {
foreach ($this->operatorValues(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_values(2) as $operator) {
foreach ($this->operatorValues(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_values(2))) {
if (in_array($this->operator, $this->operatorValues(2))) {
$output .= ' ' . t('@min and @max', array('@min' => $this->value['min'], '@max' => $this->value['max']));
}
elseif (in_array($this->operator, $this->operator_values(1))) {
elseif (in_array($this->operator, $this->operatorValues(1))) {
$output .= ' ' . check_plain($this->value['value']);
}
return $output;
......
......@@ -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_values(1))) {
if (in_array($this->operator, $this->operatorValues(1))) {
$output .= ' ' . check_plain($this->value);
}
return $output;
}
function operator_values($values = 1) {
protected function operatorValues($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_values(1)) ? 'value' : 'none';
$which = in_array($this->operator, $this->operatorValues(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_values(1) as $operator) {
foreach ($this->operatorValues(1) as $operator) {
$form['value']['#states']['visible'][] = array(
$source => array('value' => $operator),
);
......
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