You are here

function entity_translation_disable in Entity Translation 7

Implements hook_disable().

File

./entity_translation.install, line 277
Installation functions for Entity Translation module.

Code

function entity_translation_disable() {

  // Store record of which types are using entity translation, and set those
  // types to not be translated. These content types will be reset to use entity
  // translation again if the module is later re-enabled, unless they have been
  // changed by the user in the meantime.
  $entity_translation_types = array();
  foreach (node_type_get_types() as $type => $object) {
    if (variable_get("language_content_type_{$type}", 0) == ENTITY_TRANSLATION_ENABLED) {
      $entity_translation_types[] = $type;
      variable_set("language_content_type_{$type}", 0);
    }
  }
  if ($entity_translation_types) {
    variable_set('entity_translation_disabled_content_types', $entity_translation_types);
    drupal_set_message(t('All content types configured to use field translation now have multilingual support disabled. This change will be reverted if the entity translation module is enabled again.'), 'warning');
  }
}