function RulesPluginUI::getFormStateValues

Returns the state values for $form, possibly only a part of the whole form.

In case the form is embedded somewhere, this function figures out the location of its form values and returns them for further use.

Parameters

array $form: A form array, or an array of form elements to get the value for.

array $form_state: The form state as usual.

11 calls to RulesPluginUI::getFormStateValues()
RulesAbstractPluginUI::form_extract_values in ui/ui.core.inc
RulesConditionContainerUI::form_extract_values in ui/ui.core.inc
RulesContainerPluginUI::form_extract_values in ui/ui.core.inc
Applies the values of the form to the given rule configuration.
RulesLoopUI::form_extract_values in ui/ui.plugins.inc
Applies the values of the form to the given rule configuration.
RulesPluginUI::form_extract_values in ui/ui.core.inc
Applies the values of the form to the element.

... See full list

File

ui/ui.core.inc, line 196

Class

RulesPluginUI
Faces UI extender for all kind of Rules plugins.

Code

public static function &getFormStateValues($form, &$form_state) {
    $values = NULL;
    if (isset($form_state['values'])) {
        // Assume the top level if parents are not yet set.
        $form += array(
            '#parents' => array(),
        );
        $values =& $form_state['values'];
        foreach ($form['#parents'] as $parent) {
            $values =& $values[$parent];
        }
    }
    return $values;
}