You are here

function google_cse_uninstall in Google Custom Search Engine 7.2

Same name and namespace in other branches
  1. 5 google_cse.install \google_cse_uninstall()
  2. 6 google_cse.install \google_cse_uninstall()
  3. 7.3 google_cse.install \google_cse_uninstall()
  4. 7 google_cse.install \google_cse_uninstall()

Implements hook_uninstall().

File

./google_cse.install, line 60
Installation functions.

Code

function google_cse_uninstall() {
  db_delete('variable')
    ->condition('name', db_like('google_cse_') . '%', 'LIKE')
    ->execute();

  // Delete Google CSE from active search modules, if it exists.
  $active_search = variable_get('search_active_modules');
  if (array_key_exists('google_cse', $active_search)) {
    unset($active_search['google_cse']);
    variable_set('search_active_modules', $active_search);
  }

  // Delete Google CSE from being default search module.
  if (variable_get('search_default_module') == 'google_cse') {
    variable_del('search_default_module');
  }
}