You are here

function hijri_uninstall in Hijri 7

Same name and namespace in other branches
  1. 8 hijri.install \hijri_uninstall()

Implements hook_uninstall().

File

./hijri.install, line 11
This module convert to Hijri date in nodes,comments and a block.

Code

function hijri_uninstall() {

  // Get all content type with hijri field.
  $node_types = variable_get('hijri_types', array());
  foreach ($node_types as $type) {
    $instance = array(
      'field_name' => 'field_hijri_correction',
      'entity_type' => 'node',
      'bundle' => $type,
      'label' => t('Hijri Date Correction'),
      'description' => t('This field will save the Correction and different between months'),
      'required' => FALSE,
    );

    // Delete the instance.
    field_delete_instance($instance);
  }

  // Delete all vars in hijri module.
  variable_del('hijri_display_block');
  variable_del('hijri_correction_value');
  variable_del('hijri_types');
  variable_del('hijri_display');
  variable_del('hijri_comment_display');
}