function accessibility_test_edit_form

cis7 accessibility.module accessibility_test_edit_form($form, &$form_state, $test)
cle7 accessibility.module accessibility_test_edit_form($form, &$form_state, $test)
elmsmedia7 accessibility.module accessibility_test_edit_form($form, &$form_state, $test)
icor7 accessibility.module accessibility_test_edit_form($form, &$form_state, $test)
meedjum_blog7 accessibility.module accessibility_test_edit_form($form, &$form_state, $test)
mooc7 accessibility.module accessibility_test_edit_form($form, &$form_state, $test)

Edit form for accessibility tests.

1 string reference to 'accessibility_test_edit_form'
accessibility_menu in sites/all/modules/ulmus/accessibility/accessibility.module
Implements hook_menu().

File

sites/all/modules/ulmus/accessibility/accessibility.module, line 299

Code

function accessibility_test_edit_form($form, &$form_state, $test) {
  // Add the default field elements.
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Test name'),
    '#default_value' => isset($test->name) ? $test->name : '',
    '#maxlength' => 255,
    '#required' => TRUE,
    '#weight' => -5,
  );

  $form['quail_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Machine name'),
    '#default_value' => isset($test->quail_name) ? $test->quail_name : '',
    '#maxlength' => 255,
    '#required' => TRUE,
    '#weight' => -5,
  );

  $form['severity'] = array(
    '#type' => 'select',
    '#title' => t('Severity'),
    '#required' => TRUE,
    '#default_value' => isset($test->severity) ? $test->severity : '',
    '#options' => array(
      ACCESSIBILITY_TEST_SEVERE => t('Severe'),
      ACCESSIBILITY_TEST_MODERATE => t('Moderate'),
      ACCESSIBILITY_TEST_SUGGESTION => t('Suggestion'),
    ),
  );


  $form['status'] = array(
    '#type' => 'checkbox',
    '#title' => t('Test is active'),
    '#default_value' => isset($test->status) ? $test->status : 0,
  );

  $form_state['accessibility_test'] = $test;
  field_attach_form('accessibility_test', $test, $form, $form_state);

  $form['actions'] = array(
    '#type' => 'container',
    '#attributes' => array('class' => array('form-actions')),
    '#weight' => 400,
  );

  // We add the form's #submit array to this button along with the actual submit
  // handler to preserve any submit handlers added by a form callback_wrapper.
  $submit = array();

  if (!empty($form['#submit'])) {
    $submit += $form['#submit'];
  }

  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save test'),
    '#submit' => $submit + array('accessibility_test_edit_form_submit'),
  );

  if (!empty($test->name)) {
    $form['actions']['delete'] = array(
      '#type' => 'submit',
      '#value' => t('Delete test'),
      '#suffix' => l(t('Cancel'), 'admin/config/accessibility/tests/existing'),
      '#submit' => $submit + array('accessibility_test_form_submit_delete'),
      '#weight' => 45,
    );
  }

  // We append the validate handler to #validate in case a form callback_wrapper
  // is used to add validate handlers earlier.
  $form['#validate'][] = 'accessibility_test_edit_form_validate';
  return $form;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.