You are here

function blockgroup_add in Block Group 7

Same name and namespace in other branches
  1. 7.2 blockgroup.module \blockgroup_add()

Insert new block group into database.

2 calls to blockgroup_add()
blockgroup_add_form_submit in ./blockgroup.admin.inc
Form submission handler for blockgrop_add_form().
blockgroup_features_rebuild in ./blockgroup.features.inc
Implements [component]_features_rebuild().

File

./blockgroup.module, line 508
Add block groups to block configuration page

Code

function blockgroup_add($blockgroup) {

  // Insert block-records for all themes with default values.
  $query = db_insert('block')
    ->fields(array(
    'pages',
    'title',
    'module',
    'theme',
    'delta',
  ));
  foreach (list_themes() as $key => $theme) {
    if ($theme->status) {
      $query
        ->values(array(
        'pages' => '',
        'title' => $blockgroup->title,
        'module' => 'blockgroup',
        'theme' => $theme->name,
        'delta' => $blockgroup->delta,
      ));
    }
  }
  $query
    ->execute();
  blockgroup_rebuild_data();
}