function breakpoints_admin_breakpoint_group_import_form_validate

cis7 breakpoints.admin.inc breakpoints_admin_breakpoint_group_import_form_validate($form, &$form_state)

Validate a breakpoint group import.

File

sites/all/modules/local_contrib/breakpoints/breakpoints.admin.inc, line 899
Breakpoints - admin settings

Code

function breakpoints_admin_breakpoint_group_import_form_validate($form, &$form_state) {
  ctools_include('export');
  $code = $form_state['values']['import'];
  $group = ctools_export_crud_import('breakpoint_group', $code);
  if (!breakpoints_breakpoint_group_validate($group)) {
    form_set_error('import', t('Not a valid group object'));
    return;
  }
  if (breakpoints_breakpoint_group_name_exists($group->machine_name)) {
    form_set_error('import', t('A group with machine name %name already exists', array('%name' => $group->machine_name)));
    return;
  }
  foreach ($group->breakpoints as $key => $breakpoint) {
    // check if the breakpoint is a fully loaded object.
    if (is_array($breakpoint) || is_object($breakpoint)) {
      if (!breakpoints_breakpoint_validate($breakpoint)) {
        form_set_error('import', t('The breakpoint group contains an invalid breakpoint.'));
        return;
      }
    }
  }
  // Manually imported groups are the same as custom made groups.
  $group->type = BREAKPOINTS_SOURCE_TYPE_CUSTOM;
  form_set_value($form['import'], $group, $form_state);
}
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.