You are here

function vertical_tabs_config_save_config in Vertical Tabs Config 7

Save all visibility configuration.

Parameters

array $config: The array ready to save to database.

1 call to vertical_tabs_config_save_config()
vertical_tabs_config_admin_settings_submit in ./vertical_tabs_config.admin.inc
Configuration form submit.

File

./vertical_tabs_config.module, line 228
Vertical tabs config main file.

Code

function vertical_tabs_config_save_config(array $config) {
  $query = db_insert('vertical_tabs_config')
    ->fields(array(
    'vertical_tab',
    'content_type',
    'roles',
    'hidden',
  ));
  foreach ($config as $record) {
    $query
      ->values($record);
  }
  try {
    db_delete('vertical_tabs_config')
      ->execute();
    $query
      ->execute();
  } catch (Exception $e) {
    watchdog('vertical_tabs_config', $e
      ->getMessage());
  }
}