You are here

function breakpoints_breakpoint_group_name_exists in Breakpoints 7

Check if a group name already exists.

1 call to breakpoints_breakpoint_group_name_exists()
breakpoints_admin_breakpoint_group_import_form_validate in ./breakpoints.admin.inc
Validate a breakpoint group import.
2 string references to 'breakpoints_breakpoint_group_name_exists'
breakpoints_admin_breakpoint_group_duplicate_form in ./breakpoints.admin.inc
Duplicate group form.
breakpoints_admin_breakpoint_group_edit_form in ./breakpoints.admin.inc

File

./breakpoints.module, line 595
Breakpoints @todo: provide button to reload breakpoints from theme

Code

function breakpoints_breakpoint_group_name_exists($machine_name) {

  // Check for reserved words.
  if ($machine_name == 'global' || $machine_name == 'add') {
    return TRUE;
  }

  // Check if group name is used before.
  $group_check = breakpoints_breakpoint_group_load($machine_name);
  if ($group_check && isset($group_check->machine_name) && !empty($group_check->machine_name)) {
    return TRUE;
  }
  return FALSE;
}