class RulesReactionRuleUI in Rules 7.2
Reaction rule specific UI.
Hierarchy
- class \RulesPluginUI extends \FacesExtender implements RulesPluginUIInterface
- class \RulesContainerPluginUI
- class \RulesActionContainerUI
- class \RulesRuleUI
- class \RulesReactionRuleUI
- class \RulesRuleUI
- class \RulesActionContainerUI
- class \RulesContainerPluginUI
Expanded class hierarchy of RulesReactionRuleUI
1 string reference to 'RulesReactionRuleUI'
- rules_rules_plugin_info in ./
rules.module - Implements hook_rules_plugin_info().
File
- ui/
ui.plugins.inc, line 92 - Contains UI for diverse plugins provided by Rules.
View source
class RulesReactionRuleUI extends RulesRuleUI {
public function form(&$form, &$form_state, $options = array(), $iterator = NULL) {
$form['events'] = array(
'#type' => 'container',
'#weight' => -10,
'#access' => empty($options['init']),
);
$form['events']['table'] = array(
'#theme' => 'table',
'#caption' => 'Events',
'#header' => array(
t('Event'),
t('Operations'),
),
'#empty' => t('None'),
);
$form['events']['table']['#attributes']['class'][] = 'rules-elements-table';
foreach ($this->rule
->events() as $event_name) {
$event_handler = rules_get_event_handler($event_name, $this->rule
->getEventSettings($event_name));
$event_operations = array(
'#theme' => 'links__rules',
'#attributes' => array(
'class' => array(
'rules-operations',
'action-links',
'rules_rule_event',
),
),
'#links' => array(
'delete_event' => array(
'title' => t('delete'),
'href' => RulesPluginUI::path($this->rule->name, 'delete/event/' . $event_name),
'query' => drupal_get_destination(),
),
),
);
$form['events']['table']['#rows'][$event_name] = array(
'data' => array(
$event_handler
->summary(),
array(
'data' => $event_operations,
),
),
);
}
// Add the "add event" row.
$cell['colspan'] = 3;
$cell['data']['#theme'] = 'links__rules';
$cell['data']['#attributes']['class'][] = 'rules-operations-add';
$cell['data']['#attributes']['class'][] = 'action-links';
$cell['data']['#links']['add_event'] = array(
'title' => t('Add event'),
'href' => RulesPluginUI::path($this->rule->name, 'add/event'),
'query' => drupal_get_destination(),
);
$form['events']['table']['#rows'][] = array(
'data' => array(
$cell,
),
'class' => array(
'rules-elements-add',
),
);
parent::form($form, $form_state, $options);
unset($form['label']);
}
/**
* Adds the configuration settings form (label, tags, description, ..).
*/
public function settingsForm(&$form, &$form_state) {
parent::settingsForm($form, $form_state);
$form['settings']['active'] = array(
'#type' => 'checkbox',
'#title' => t('Active'),
'#default_value' => !isset($this->rule->active) || $this->rule->active,
);
$form['settings']['weight'] = array(
'#type' => 'weight',
'#title' => t('Weight'),
'#default_value' => $this->element->weight,
'#weight' => 5,
'#delta' => 10,
'#description' => t('Order rules that react on the same event. Rules with a higher weight are evaluated after rules with less weight.'),
);
unset($form['settings']['component_provides']);
}
public function settingsFormExtractValues($form, &$form_state) {
$form_values = RulesPluginUI::getFormStateValues($form['settings'], $form_state);
parent::settingsFormExtractValues($form, $form_state);
$this->rule->active = $form_values['active'];
$this->rule->weight = $form_values['weight'];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RulesContainerPluginUI:: |
public | function | Gets the Add-* operations for the given element. | |
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:: |
protected | function | Provides a matrix permission for the component based in the existing roles. | |
RulesPluginUI:: |
public | function | ||
RulesPluginUI:: |
public | function | ||
RulesReactionRuleUI:: |
public | function |
Implements RulesPluginUIInterface::form(). Overrides RulesRuleUI:: |
|
RulesReactionRuleUI:: |
public | function |
Adds the configuration settings form (label, tags, description, ..). Overrides RulesPluginUI:: |
|
RulesReactionRuleUI:: |
public | function |
Overrides RulesPluginUI:: |
|
RulesRuleUI:: |
protected | property | ||
RulesRuleUI:: |
protected | property | ||
RulesRuleUI:: |
public | function |
Applies the values of the form to the rule configuration. Overrides RulesContainerPluginUI:: |
|
RulesRuleUI:: |
public | function |
Implements RulesPluginUIInterface. Overrides RulesContainerPluginUI:: |
|
RulesRuleUI:: |
public | function |
Constructs a RulesRuleUI object. Overrides RulesPluginUI:: |