You are here

function breakpoints_breakpoints_group_duplicate in Breakpoints 7

Duplicate a group.

1 call to breakpoints_breakpoints_group_duplicate()
breakpoints_admin_breakpoint_group_duplicate_form_submit in ./breakpoints.admin.inc
Duplicate group form submit.

File

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

Code

function breakpoints_breakpoints_group_duplicate($group, $new_name, $new_machine_name) {
  $new_group = breakpoints_breakpoint_group_empty_object();
  $new_group->machine_name = $new_machine_name;
  $new_group->name = $new_name;
  $new_group->type = BREAKPOINTS_SOURCE_TYPE_CUSTOM;
  $new_group->breakpoints = $group->breakpoints;
  breakpoints_breakpoint_group_save($new_group);
  return $new_group;
}