You are here

hijri.install in Hijri 7

Same filename and directory in other branches
  1. 8 hijri.install
  2. 3.0.x hijri.install
  3. 1.0.x hijri.install

This module convert to Hijri date in nodes,comments and a block.

File

hijri.install
View source
<?php

/**
 * @file
 * This module convert to Hijri date in nodes,comments and a block.
 *  */

/**
 * Implements hook_uninstall().
 */
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');
}

/**
 * @file
 * Mostly The hook_update_7001().
 *
 * This will fix the Hijri value NOT to repeat(Day & Time) in the full format.
 */
function hijri_update_7001() {
  variable_set('date_format_long', 'l, F j, Y');
}

/**
 * @file
 * Mostly The hook_update_7002().
 *
 * This will fix the Drupal Core var in the full format.
 */
function hijri_update_7002() {
  variable_set('date_format_long', 'l, F j, Y - H:i');
}

/**
 * @file
 * Mostly The hook_update_7003().
 *
 * This will fix our (medium - short) format to have d/m insteaf of the m/d.
 */
function hijri_update_7003() {
  variable_set('date_format_medium', 'D, d/m/Y - H:i');
  variable_set('date_format_short', 'd/m/Y - H:i');
}

Functions

Namesort descending Description
hijri_uninstall Implements hook_uninstall().
hijri_update_7001 @file Mostly The hook_update_7001().
hijri_update_7002 @file Mostly The hook_update_7002().
hijri_update_7003 @file Mostly The hook_update_7003().