You are here

public function RulesConditionalCaseUI::buildContent in Conditional Rules 8

Same name and namespace in other branches
  1. 7 includes/rules_conditional.ui.inc \RulesConditionalCaseUI::buildContent()

File

includes/rules_conditional.ui.inc, line 166
Plugin UI implementation.

Class

RulesConditionalCaseUI
UI for supporting option lists in the case value.

Code

public function buildContent() {
  $content = parent::buildContent();

  // Use option label for text.
  if (isset($this->element->settings['value'])) {
    $value = $this->element->settings['value'];
    $labels = $this
      ->getValueOptionLabels();
    $content['label']['#markup'] = t('@plugin: @case', array(
      '@plugin' => $this->element
        ->label(),
      '@case' => isset($labels[$value]) ? $labels[$value] : $value,
    ));
    unset($content['description']['parameter']['value']);
  }
  return $content;
}