You are here

function patterns_forms_get_validation_level_selector in Patterns 7.2

Builds a HTML select element with all the currently available patterns validation levels.

Parameters

array $form (optional) If specified, the select form is appended here.:

mixed $default (optional) The default value for the selector.:

Return value

array $form The form containing the select element.

3 calls to patterns_forms_get_validation_level_selector()
patterns_edit in includes/forms/editor.inc
Form constructor for editing a pattern. TODO:params
patterns_import_source in includes/forms/import.inc
Form constructor for the Pattern import form.
patterns_quickrun in includes/forms/quickrun.inc
Form constructor for the Quick Run form.

File

includes/forms/forms.inc, line 155

Code

function patterns_forms_get_validation_level_selector(&$form = array(), $default = PATTERNS_VALIDATE_SYNTAX) {
  $available_formats = array(
    PATTERNS_VALIDATE_TAG_SYNTAX => t('Syntax only'),
    PATTERNS_VALIDATE_SEMANTIC => t('Semantic and Syntax'),
  );
  $form['validation'] = array(
    '#type' => 'select',
    '#title' => t('Validation Level'),
    '#options' => $available_formats,
    '#description' => t('Choose the level of validation. Patterns validated semantically will run without errors,
      but they only need to be syntactically valid in order to be run.'),
  );
  return $form;
}