You are here

function patterns_forms_get_execution_options in Patterns 7

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

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


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/
Form constructor for the Quick Run form.


includes/forms/, line 33


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',
  $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)'),
  $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;