function ajax_forms_test_lazy_load_form_submit

Form submit handler: Adds JavaScript and CSS that wasn't on the original form.

1 string reference to 'ajax_forms_test_lazy_load_form_submit'
FrameworkTest::testLazyLoad in drupal/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
Tests that new JavaScript and CSS files are lazy-loaded on an AJAX request.

File

drupal/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module, line 540
Simpletest mock module for Ajax forms testing.

Code

function ajax_forms_test_lazy_load_form_submit($form, &$form_state) {
  if ($form_state['values']['add_files']) {
    drupal_add_js(array(
      'ajax_forms_test_lazy_load_form_submit' => 'executed',
    ), 'setting');
    drupal_add_css(drupal_get_path('module', 'system') . '/css/system.admin.css');
    drupal_add_js(drupal_get_path('module', 'system') . '/system.js');
  }
  $form_state['rebuild'] = TRUE;
}