You are here

function blockgroup_features_rebuild in Block Group 7.2

Same name and namespace in other branches
  1. 7 blockgroup.features.inc \blockgroup_features_rebuild()

Implements [component]_features_rebuild().

1 call to blockgroup_features_rebuild()
blockgroup_features_revert in ./blockgroup.features.inc
Implements [component]_features_revert().

File

./blockgroup.features.inc, line 74
Features integration for Block Group module.

Code

function blockgroup_features_rebuild($module) {
  $blockgroups = blockgroup_list();
  $default_blockgroups = module_invoke($module, 'default_blockgroups');
  foreach ($default_blockgroups as $delta => $title) {
    $blockgroup = blockgroup_load($delta);

    // Prepare the block if it doesn't exist
    if (!isset($blockgroup->bid)) {
      $blockgroup = (object) array(
        'title' => $title,
        'delta' => $delta,
      );
      blockgroup_add($blockgroup);
    }
  }
}