You are here

hijri.install in Hijri 8

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

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

File

hijri.install
View source
<?php

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

/**
 * Implements hook_install().
 */
function hijri_install() {

  // Set default values for config which require dynamic values.
  \Drupal::configFactory()
    ->getEditable('hijri.config')
    ->set('correction_value', 0)
    ->set('hijri_types', NULL)
    ->set('hijri_display', 'full')
    ->set('hijri_comment_display', 'full')
    ->set('hijri_display_block', 'full')
    ->save();
}

/**
 * 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');*/
}

Functions

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