function rest_admin_form_submit

Form submission handler for rest_admin_form().

File

drupal/core/modules/rest/rest.admin.inc, line 52
Admin pages for REST module.

Code

function rest_admin_form_submit($form, &$form_state) {
  $resources = array_filter($form_state['values']['entity_resources']);
  if (!empty($form_state['values']['other_resources'])) {
    $resources += array_filter($form_state['values']['other_resources']);
  }
  $config = config('rest');
  $config
    ->set('resources', $resources);
  $config
    ->save();

  // Rebuild routing cache.
  drupal_container()
    ->get('router.builder')
    ->rebuild();
}