function RulesPluginUI::defaultRedirect

Determines the default redirect target for an edited/deleted element.

This is a parent element which is either a rule or the configuration root.

3 calls to RulesPluginUI::defaultRedirect()
rules_ui_delete_element_submit in ui/ui.forms.inc
Rule config deletion form submit callback.
rules_ui_edit_element_submit in ui/ui.forms.inc
Submit the element configuration.
rules_ui_form_edit_rules_config_submit in ui/ui.forms.inc
Edit a rules configuration form submit callback.

File

ui/ui.core.inc, line 888

Class

RulesPluginUI
Faces UI extender for all kind of Rules plugins.

Code

public static function defaultRedirect(RulesPlugin $element) {
    while (!$element->isRoot()) {
        if ($element instanceof Rule) {
            return self::path($element->root()->name, 'edit', $element);
        }
        $element = $element->parentElement();
    }
    return self::path($element->name);
}