You are here

function block_class_features_rebuild in Block Class 7

Implements hook_features_rebuild().

1 call to block_class_features_rebuild()
block_class_features_revert in ./block_class.features.inc
Implements hook_features_revert().

File

./block_class.features.inc, line 69
Integration with the Features module API.

Code

function block_class_features_rebuild($module) {
  $blocks = module_invoke($module, 'block_class_features_default_class');
  if ($blocks) {
    foreach ($blocks as $block) {
      db_delete('block_class')
        ->condition('module', $block['module'])
        ->condition('delta', $block['delta'])
        ->execute();
      if (!empty($block['css_classes'])) {
        $id = db_insert('block_class')
          ->fields(array(
          'module' => $block['module'],
          'delta' => $block['delta'],
          'css_class' => $block['css_classes'],
        ))
          ->execute();
      }
    }
  }
}