function RulesContainerPluginUI::form_extract_values

Applies the values of the form to the given rule configuration.

Overrides RulesPluginUI::form_extract_values

3 calls to RulesContainerPluginUI::form_extract_values()
RulesConditionContainerUI::form_extract_values in ui/ui.core.inc
RulesLoopUI::form_extract_values in ui/ui.plugins.inc
Applies the values of the form to the given rule configuration.
RulesRuleUI::form_extract_values in ui/ui.plugins.inc
Applies the values of the form to the rule configuration.
3 methods override RulesContainerPluginUI::form_extract_values()
RulesConditionContainerUI::form_extract_values in ui/ui.core.inc
RulesLoopUI::form_extract_values in ui/ui.plugins.inc
Applies the values of the form to the given rule configuration.
RulesRuleUI::form_extract_values in ui/ui.plugins.inc
Applies the values of the form to the rule configuration.

File

ui/ui.core.inc, line 1067

Class

RulesContainerPluginUI
UI for Rules Container.

Code

public function form_extract_values($form, &$form_state) {
    parent::form_extract_values($form, $form_state);
    $values = RulesPluginUI::getFormStateValues($form, $form_state);
    // Now apply the new hierarchy.
    if (isset($values['elements'])) {
        foreach ($values['elements'] as $id => $data) {
            $child = $this->element
                ->elementMap()
                ->lookup($id);
            $child->weight = $data['weight'];
            $parent = $this->element
                ->elementMap()
                ->lookup($data['parent_id']);
            $child->setParent($parent ? $parent : $this->element);
        }
        $this->element
            ->sortChildren(TRUE);
    }
}