class RuleConditionSetUI in Conditional Rules 7
Same name and namespace in other branches
- 8 includes/rules_conditional.ui.inc \RuleConditionSetUI
UI for rule condition set.
This UI is adapted from RulesRuleUI by swapping conditions for actions.
Hierarchy
- class \RulesPluginUI extends \FacesExtender implements RulesPluginUIInterface
- class \RulesContainerPluginUI
- class \RulesConditionContainerUI
- class \RuleConditionSetUI
- class \RulesConditionContainerUI
- class \RulesContainerPluginUI
Expanded class hierarchy of RuleConditionSetUI
1 string reference to 'RuleConditionSetUI'
- rules_conditional_rules_plugin_info in ./
rules_conditional.rules.inc - Implements hook_rules_plugin_info().
File
- includes/
rules_conditional.ui.inc, line 227 - Plugin UI implementation.
View source
class RuleConditionSetUI extends RulesConditionContainerUI {
/** @var RulesActionContainer */
protected $actions;
/** @var RuleConditionSet */
protected $set;
public function __construct(FacesExtendable $object) {
parent::__construct($object);
$this->set = $object;
/** @var RuleConditionSet $object */
$this->actions = $object
->actionContainer();
}
public function form(&$form, &$form_state, $options = array(), $iterator = NULL) {
$form_state['rules_element'] = $this->set;
$form += array(
'actions' => array(
'#weight' => -5,
'#tree' => TRUE,
),
);
$this->actions
->form($form['actions'], $form_state);
// Add condition result form.
$iterator = new RecursiveIteratorIterator($this->set
->conditions(), RecursiveIteratorIterator::SELF_FIRST);
parent::form($form, $form_state, $options, $iterator);
$form['elements']['#caption'] = t('Result conditions');
$form['negate']['#weight'] = 1;
// Hide nested elements during creation.
$form['elements']['#access'] = empty($options['init']);
$form['actions']['elements']['#access'] = empty($options['init']);
$form['help']['#markup'] = t('A rule condition set evaluates the actions first. Variables provided by the actions then can be used to evaluate the result conditions (as an "AND", i.e. evaluating to TRUE if conditions are empty).');
$form['help']['#weight'] = -5;
$form_state['redirect'] = RulesPluginUI::path($this->element
->root()->name);
if (!empty($options['button'])) {
$form['submit']['#value'] = t('Save changes');
}
}
/**
* Applies the values of the form to the rule configuration.
*/
function form_extract_values($form, &$form_state) {
// Extract action container values.
if (isset($form['actions'])) {
$this->actions
->extender('RulesActionContainerUI')
->form_extract_values($form['actions'], $form_state);
}
// Extract condition container values.
parent::form_extract_values($form, $form_state);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RuleConditionSetUI:: |
protected | property | @var RulesActionContainer | |
RuleConditionSetUI:: |
protected | property | @var RuleConditionSet | |
RuleConditionSetUI:: |
public | function |
Implements RulesPluginUIInterface::form(). Overrides RulesConditionContainerUI:: |
|
RuleConditionSetUI:: |
function |
Applies the values of the form to the rule configuration. Overrides RulesConditionContainerUI:: |
||
RuleConditionSetUI:: |
public | function |
Provide $this->element to make the code more meaningful. Overrides RulesPluginUI:: |
|
RulesContainerPluginUI:: |
public | function | Gets the Add-* operations for the given element. | |
RulesContainerPluginUI:: |
public | function |
Implements RulesPluginUIInterface. Overrides RulesPluginUI:: |
1 |
RulesContainerPluginUI:: |
public | function |
Implements RulesPluginUIInterface. Overrides RulesPluginUI:: |
1 |
RulesPluginUI:: |
public static | property | The base path determines where a Rules overview UI lives. | |
RulesPluginUI:: |
protected | property | ||
RulesPluginUI:: |
public static | function | Determines the default redirect target for an edited/deleted element. | |
RulesPluginUI:: |
public static | function | ||
RulesPluginUI:: |
public | function |
Implements RulesPluginUIInterface. Overrides RulesPluginUIInterface:: |
|
RulesPluginUI:: |
public | function |
Implements RulesPluginUIInterface. Overrides RulesPluginUIInterface:: |
2 |
RulesPluginUI:: |
public | function | Returns the name of class for the given data type. | |
RulesPluginUI:: |
public static | function | Returns the state values for $form, possibly only a part of the whole form. | |
RulesPluginUI:: |
public static | function | ||
RulesPluginUI:: |
protected | function | Actually generates the parameter form for the given data type. | |
RulesPluginUI:: |
public static | function | ||
RulesPluginUI:: |
public | function | Returns the form for configuring the info of a single variable. | |
RulesPluginUI:: |
public | function |
Implements RulesPluginUIInterface. Overrides RulesPluginUIInterface:: |
|
RulesPluginUI:: |
public static | function | Deprecated by the controllers overviewTable() method. | |
RulesPluginUI:: |
public static | function | Generates an operation path. | |
RulesPluginUI:: |
public | function | Adds the configuration settings form (label, tags, description, ...). | 1 |
RulesPluginUI:: |
public | function | 1 | |
RulesPluginUI:: |
protected | function | Provides a matrix permission for the component based in the existing roles. | |
RulesPluginUI:: |
public | function | ||
RulesPluginUI:: |
public | function |