You are here

public function ViewsConditionalHandler::admin_summary in Views Conditional 7

Defines summary text for Fields category in Views.

Overrides views_handler_field::admin_summary

File

includes/views/handlers/views_conditional_handler.inc, line 158
Handles conditionals in Views. IF xxx THEN yyy...

Class

ViewsConditionalHandler
@file Handles conditionals in Views. IF xxx THEN yyy...

Code

public function admin_summary() {

  // We using there is_numeric because values '0', '0.0' counting as empty in PHP language.
  if (!empty($this->options['if']) && !empty($this->options['condition']) && (!empty($this->options['equalto']) || in_array($this->options['condition'], array(
    5,
    6,
  )) || is_numeric($this->options['equalto'])) && trim($this->options['then']) != '') {
    return t('If !if is !condition !equalto, output !then, else output !or', array(
      '!if' => $this->options['if'],
      '!condition' => $this->conditions[$this->options['condition']],
      '!equalto' => $this->options['equalto'],
      '!then' => strip_tags($this->options['then']),
      '!or' => strip_tags($this->options['or']),
    ));
  }
  else {
    return t('Invalid field selection');
  }
}