class RulesAbstractPluginUI in Rules 7.2
UI for abstract plugins (conditions & actions).
Hierarchy
- class \RulesPluginUI extends \FacesExtender implements RulesPluginUIInterface
- class \RulesAbstractPluginUI
Expanded class hierarchy of RulesAbstractPluginUI
1 string reference to 'RulesAbstractPluginUI'
- rules_rules_plugin_info in ./
rules.module - Implements hook_rules_plugin_info().
File
- ui/
ui.core.inc, line 948 - Contains core Rules UI functions.
View source
class RulesAbstractPluginUI extends RulesPluginUI {
/**
* Overrides RulesPluginUI::form().
*
* Overridden to invoke the abstract plugins form alter callback and to add
* the negation checkbox for conditions.
*/
public function form(&$form, &$form_state, $options = array()) {
parent::form($form, $form_state, $options);
if ($this->element instanceof RulesCondition) {
$form['negate'] = array(
'#title' => t('Negate'),
'#type' => 'checkbox',
'#description' => t('If checked, the condition result is negated such that it returns TRUE if it evaluates to FALSE.'),
'#default_value' => $this->element
->isNegated(),
'#weight' => 5,
);
}
$this->element
->call('form_alter', array(
&$form,
&$form_state,
$options,
));
}
/**
* @param array $form
* The form array where to add the form.
* @param array $form_state
* The current form state.
*/
public function form_extract_values($form, &$form_state) {
parent::form_extract_values($form, $form_state);
$form_values = RulesPluginUI::getFormStateValues($form, $form_state);
if ($this->element instanceof RulesCondition && isset($form_values['negate'])) {
$this->element
->negate($form_values['negate']);
}
}
/**
* @param array $form
* The form array where to add the form.
* @param array $form_state
* The current form state.
*/
public function form_validate($form, &$form_state) {
parent::form_validate($form, $form_state);
// Validate the edited element and throw validation errors if it fails.
try {
$this->element
->integrityCheck();
} catch (RulesIntegrityException $e) {
form_set_error(implode('][', $e->keys), $e
->getMessage());
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RulesAbstractPluginUI:: |
public | function |
Overrides RulesPluginUI::form(). Overrides RulesPluginUI:: |
|
RulesAbstractPluginUI:: |
public | function |
Overrides RulesPluginUI:: |
|
RulesAbstractPluginUI:: |
public | function |
Overrides RulesPluginUI:: |
|
RulesPluginUI:: |
public static | property | The base path determines where a Rules overview UI lives. | |
RulesPluginUI:: |
protected | property | ||
RulesPluginUI:: |
public | function |
Implements RulesPluginUIInterface. Overrides RulesPluginUIInterface:: |
1 |
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 | function |
Implements RulesPluginUIInterface. Overrides RulesPluginUIInterface:: |
1 |
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 |