class RulesLoopUI in Rules 7.2
UI for Rules loops.
Hierarchy
- class \RulesPluginUI extends \FacesExtender implements RulesPluginUIInterface
- class \RulesContainerPluginUI
- class \RulesActionContainerUI
- class \RulesLoopUI
- class \RulesActionContainerUI
- class \RulesContainerPluginUI
Expanded class hierarchy of RulesLoopUI
1 string reference to 'RulesLoopUI'
- rules_rules_plugin_info in ./
rules.module - Implements hook_rules_plugin_info().
File
- ui/
ui.plugins.inc, line 203 - Contains UI for diverse plugins provided by Rules.
View source
class RulesLoopUI extends RulesActionContainerUI {
public function form(&$form, &$form_state, $options = array(), $iterator = NULL) {
parent::form($form, $form_state, $options);
$settings = $this->element->settings;
$form['item'] = array(
'#type' => 'fieldset',
'#title' => t('Current list item'),
'#description' => t('The variable used for holding each list item in the loop. This variable will be available inside the loop only.'),
'#tree' => TRUE,
);
$form['item']['label'] = array(
'#type' => 'textfield',
'#title' => t('Variable label'),
'#default_value' => $settings['item:label'],
'#required' => TRUE,
);
$form['item']['var'] = array(
'#type' => 'textfield',
'#title' => t('Variable name'),
'#default_value' => $settings['item:var'],
'#description' => t('The variable name must contain only lowercase letters, numbers, and underscores and must be unique in the current scope.'),
'#element_validate' => array(
'rules_ui_element_machine_name_validate',
),
'#required' => TRUE,
);
}
public function form_extract_values($form, &$form_state) {
parent::form_extract_values($form, $form_state);
$form_values = RulesPluginUI::getFormStateValues($form, $form_state);
$this->element->settings['item:var'] = $form_values['item']['var'];
$this->element->settings['item:label'] = $form_values['item']['label'];
}
public function form_validate($form, &$form_state) {
parent::form_validate($form, $form_state);
$vars = $this->element
->availableVariables();
$name = $this->element->settings['item:var'];
if (isset($vars[$name])) {
form_error($form['item']['var'], t('The variable name %name is already taken.', array(
'%name' => $name,
)));
}
}
public function buildContent() {
$content = parent::buildContent();
$content['description']['item'] = array(
'#caption' => t('List item'),
'#theme' => 'rules_content_group',
);
$content['description']['item']['var'] = array(
'#theme' => 'rules_variable_view',
'#info' => $this->element
->listItemInfo(),
'#name' => $this->element->settings['item:var'],
);
return $content;
}
}
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 |
RulesLoopUI:: |
public | function |
Implements RulesPluginUIInterface. Overrides RulesContainerPluginUI:: |
|
RulesLoopUI:: |
public | function |
Implements RulesPluginUIInterface::form(). Overrides RulesActionContainerUI:: |
|
RulesLoopUI:: |
public | function |
Applies the values of the form to the given rule configuration. Overrides RulesContainerPluginUI:: |
|
RulesLoopUI:: |
public | function |
Implements RulesPluginUIInterface. Overrides RulesPluginUI:: |
|
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 | 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 | ||
RulesPluginUI:: |
public | function | Provide $this->element to make the code more meaningful. | 1 |