You are here

function lingotek_uninstall in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 6 lingotek.install \lingotek_uninstall()
  2. 7.2 lingotek.install \lingotek_uninstall()
  3. 7.3 lingotek.install \lingotek_uninstall()
  4. 7.4 lingotek.install \lingotek_uninstall()
  5. 7.5 lingotek.install \lingotek_uninstall()
  6. 7.6 lingotek.install \lingotek_uninstall()

Implements hook_uninstall().

File

./lingotek.install, line 55

Code

function lingotek_uninstall() {
  global $conf;
  foreach (array_keys($conf) as $key) {
    if (strpos($key, 'lingotek_') === 0) {

      // It's important to use === instead of == with strpos()
      variable_del($key);
    }
  }
  db_drop_field('languages', 'lingotek_enabled');
  db_drop_field('languages', 'lingotek_locale');
  db_drop_field('locales_target', 'translation_agent_id');
  db_drop_table('lingotek');

  // leave this here until we move it to an update function
  db_drop_table('lingotek_config_metadata');
  db_drop_table('lingotek_entity_metadata');
  db_drop_table('lingotek_translation_agent');
}