You are here

function breakpoints_breakpoints_group_reload in Breakpoints 7

Reload the breakpoints as defined by the group.

4 calls to breakpoints_breakpoints_group_reload()
breakpoints_admin_breakpoints_submit_reload in ./breakpoints.admin.inc
Admin form submit - Reload theme breakpoints.
breakpoints_breakpoints_group_revert in ./breakpoints.module
Revert the breakpoints of a group.
breakpoints_flush_caches in ./breakpoints.module
Implements hook_flush_caches().
breakpoints_form_system_theme_settings_alter_submit in ./breakpoints.module

File

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

Code

function breakpoints_breakpoints_group_reload(&$group, $force = TRUE) {
  switch ($group->type) {
    case BREAKPOINTS_SOURCE_TYPE_THEME:

      // delete all breakpoints defined by this theme.
      $breakpoints = breakpoints_breakpoint_load_all_theme($group->machine_name);
      foreach ($breakpoints as $breakpoint) {
        breakpoints_breakpoint_delete($breakpoint);
      }

      // Reload all breakpoints from theme.info.
      $reloaded_group = breakpoints_breakpoints_group_reload_from_theme($group->machine_name);

      // Reset the breakpoints for this group.
      if ($force) {
        $group->breakpoints = $reloaded_group->breakpoints;
        breakpoints_breakpoint_group_save($group);
      }
      break;
  }
}