You are here

function breakpoints_admin_breakpoints_submit_exporttotheme in Breakpoints 7

Admin form submit - Export breakpoints to theme.

1 string reference to 'breakpoints_admin_breakpoints_submit_exporttotheme'
breakpoints_admin_breakpoints in ./breakpoints.admin.inc
Admin form

File

./breakpoints.admin.inc, line 544
Breakpoints - admin settings

Code

function breakpoints_admin_breakpoints_submit_exporttotheme($form, &$form_state) {
  $group_name = $form_state['group_name'];
  $global_group = $group_name == '';
  if (!$global_group) {
    $group = breakpoints_breakpoint_group_load($group_name);
    if ($group) {
      $breakpoints = breakpoints_breakpoints_group_exporttotheme($group);
      if ($breakpoints) {
        $export = array();
        foreach ($breakpoints as $breakpoint_name => $breakpoint) {
          $export[] = 'breakpoints[' . $breakpoint_name . '] = ' . $breakpoint;
        }
        $form_state['exported_breakpoints'] = implode("\n", $export);
        $form_state['rebuild'] = TRUE;
      }
    }
  }
}