You are here

function patterns_forms_get_execution_options in Patterns 7.2

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

Builds up a fieldset containing the options for executing a pattern.

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_execution_options()
patterns_enable_pattern in ./patterns.module
Form constructor for the Patterns enabling form.
patterns_quickrun in includes/forms/quickrun.inc
Form constructor for the Quick Run form.

File

includes/forms/forms.inc, line 33

Code

function patterns_forms_get_execution_options($form = array()) {
  $form['options'] = array(
    '#type' => 'fieldset',
    '#title' => t('Options'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $options_mode = array(
    'extend' => t('Extend'),
    'runover' => t('Run-Over'),
  );
  $form['options']['execution'] = array(
    '#type' => 'radios',
    '#title' => t('Execution mode:'),
    '#description' => t('Extend mode can only add new feature to your web-site, Run-over can also delete. At the moment \'Extend\' is the only mode permitted.'),
    '#options' => $options_mode,
    '#default_value' => 'extend',
    '#disabled' => 'true',
  );
  patterns_forms_get_exec_mode_selector($form['options']);
  $options = array(
    PATTERNS_INCLUDE_NEVER => t('Never run'),
    PATTERNS_INCLUDE_FIRSTRUN => t('Only during the first run'),
    PATTERNS_INCLUDE_UPDATE => t('Only if pattern was updated'),
    PATTERNS_INCLUDE_FIRSTRUN_OR_UPDATE => t('If it is the first run or if the pattern was updated'),
    PATTERNS_INCLUDE_ATTACHED => t('Only if the pattern code is attached (no lookup to database)'),
    PATTERNS_INCLUDE_ALWAYS => t('Always'),
  );
  $form['options']['run-subpatterns'] = array(
    '#type' => 'radios',
    '#title' => t('Run sub-patterns:'),
    '#description' => t("Decide when to run sub-patterns that are called by the currently run pattern. If unsure, stick to recommended setting. Note that your choice won't have any effect if your pattern doesn't contain sub-patterns or if this setting has been defined within the pattern file itself."),
    '#options' => $options,
    '#default_value' => patterns_get_include_mode(),
  );
  return $form;
}