You are here

public function ViewsRulesLoopUI::buildContent in Views Rules 7

Implements RulesPluginUIInterface.

Shows a preview of the configuration settings.

Overrides RulesContainerPluginUI::buildContent

File

rules/views_rules.ui.inc, line 109
Rules UI implementation for Views Rules plugins.

Class

ViewsRulesLoopUI
Views loop administrative UI.

Code

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

  // Build row variables.

  /** @var $display views_rules_iterator */
  $display = $this->element
    ->getViewIterator();
  $content['description']['views_row'] = array(
    '#caption' => t('Row variables'),
    '#theme' => 'rules_content_group',
  );
  foreach ($display
    ->get_rules_variable_info() as $var_name => $var_info) {
    if (isset($this->element->settings[$var_name . ':var'])) {
      $content['description']['views_row'][$var_name] = array(
        '#theme' => 'rules_variable_view',
        '#info' => array(
          'type' => $var_info['type'],
          'label' => $this->element->settings[$var_name . ':label'],
        ),
        '#name' => $this->element->settings[$var_name . ':var'],
      );
    }
  }
  return $content;
}