function RulesPluginUI::formDefaults

Parameters

array $form: The form array where to add the form.

array $form_state: The current form state.

8 calls to RulesPluginUI::formDefaults()
RulesPluginUI::form in ui/ui.core.inc
Implements RulesPluginUIInterface::form().
rules_admin_add_component in rules_admin/rules_admin.inc
Add component form.
rules_admin_add_reaction_rule in rules_admin/rules_admin.inc
Add reaction rules form.
rules_admin_components_overview in rules_admin/rules_admin.inc
Components overview.
rules_admin_reaction_overview in rules_admin/rules_admin.inc
Reaction rules overview.

... See full list

File

ui/ui.core.inc, line 911

Class

RulesPluginUI
Faces UI extender for all kind of Rules plugins.

Code

public static function formDefaults(&$form, &$form_state) {
    form_load_include($form_state, 'inc', 'rules', 'ui/ui.forms');
    // Add our own css.
    $form['#attached']['css'][] = drupal_get_path('module', 'rules') . '/ui/rules.ui.css';
    // Workaround for problems with jquery css in seven theme and the core
    // autocomplete.
    if ($GLOBALS['theme'] == 'seven') {
        $form['#attached']['css'][] = drupal_get_path('module', 'rules') . '/ui/rules.ui.seven.css';
    }
    // Specify the wrapper div used by #ajax.
    $form['#prefix'] = '<div id="rules-form-wrapper">';
    $form['#suffix'] = '</div>';
    // Preserve the base path in the form state. The after build handler will
    // set self::$basePath again for cached forms.
    if (isset(self::$basePath)) {
        $form_state['_rules_base_path'] = RulesPluginUI::$basePath;
        $form['#after_build'][] = 'rules_form_after_build_restore_base_path';
    }
}