You are here

function rules_core_action_execute_form in Rules 6

Action form implementation: Get the core actions form

Related topics

File

rules/modules/rules.rules.inc, line 366
rules integration for the rules module

Code

function rules_core_action_execute_form($settings, &$form, &$form_state) {
  $element = $form_state['element'];
  $info = rules_get_element_info($element);
  if ($info['configurable']) {
    $function = $info['action_name'] . '_form';
    $form['settings'] = $function($settings);
  }
  if ($info['arguments']) {
    $arg = array_shift($info['arguments']);
    $data_type = rules_get_data_types($arg['type']);
    if (isset($data_type['savable']) && $data_type['savable']) {
      $settings += array(
        'auto_save' => TRUE,
      );
      $form['settings']['auto_save'] = array(
        '#type' => 'checkbox',
        '#title' => t('Permanently apply changes'),
        '#description' => t('If checked, changes to the argument are saved automatically.'),
        '#default_value' => $settings['auto_save'],
        '#weight' => -10,
      );
    }
  }
}