You are here

public function RbViewsArgumentValidator::__construct in Rules Bonus Pack 7

Override to set the provided and required variables to fixed sets.

Overrides RulesActionContainer::__construct

File

./rb_views.module, line 177
Globally available functions for Rules' Views integration.

Class

RbViewsArgumentValidator
Class defining the Views argument validator plugin.

Code

public function __construct($variables = array(), $providesVars = array()) {

  // Set some fixed variables used by this type of plugin. (Editing of these
  // is disabled.)
  $variables = array(
    'arg' => array(
      'type' => 'text',
      'label' => t('Argument'),
    ),
    'args' => array(
      'type' => 'list<text>',
      'label' => t('All arguments'),
    ),
    'validation' => array(
      'type' => 'boolean',
      'label' => t('Validation value'),
      'parameter' => FALSE,
    ),
  );
  $providesVars = array(
    'arg',
    'args',
    'validation',
  );
  parent::__construct($variables);

  // The provided vars of a component are the names of variables, which should
  // be provided to the caller. See rule().
  if ($providesVars) {
    $this->info['provides'] = $providesVars;
  }
}