You are here

function patterns_forms_get_exec_mode_selector in Patterns 7

Same name and namespace in other branches
  1. 7.2 includes/forms/forms.inc \patterns_forms_get_exec_mode_selector()

Creates the radio buttons to select the pattern exec mode

@TODO: doc

Parameters

array $form An array element representing a form. If specified,: the execution options are appended here.

Return value

array $form The form containing the pattern execution options.

2 calls to patterns_forms_get_exec_mode_selector()
patterns_export_page1 in patterns_export/patterns_export.module
patterns_forms_get_execution_options in includes/forms/forms.inc
Builds up a fieldset containing the options for executing a pattern.

File

includes/forms/forms.inc, line 88

Code

function patterns_forms_get_exec_mode_selector(&$form = array(), $default = NULL, $title = NULL, $descr = NULL) {
  $options_run_mode = array(
    PATTERNS_EXEC_BATCH => t('Batch'),
    PATTERNS_EXEC_PHP => t('PHP'),
  );
  $default = empty($default) ? variable_get('patterns_default_running_mode', PATTERNS_EXEC_PHP) : $default;
  $title = empty($title) ? t('Running mode:') : $title;
  $descr = empty($descr) ? t('Batch mode uses the Batch API provided by Drupal thus providing intermediate feedback about the progress. PHP will only return when every action has been processed (or in case of error).') : $decr;
  $form['mode'] = array(
    '#type' => 'radios',
    '#title' => $title,
    '#description' => $descr,
    '#options' => $options_run_mode,
    '#default_value' => $default,
  );
  return $form;
}