date_views.install in Date 7.3
Same filename and directory in other branches
Install, update and uninstall functions for the Date Views module.
File
date_views/date_views.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the Date Views module.
*/
/**
* Implements hook_install().
*/
function date_views_install() {
variable_set('date_views_month_format_with_year', 'F Y');
variable_set('date_views_month_format_without_year', 'F');
variable_set('date_views_day_format_with_year', 'l, F j, Y');
variable_set('date_views_day_format_without_year', 'l, F j');
variable_set('date_views_week_format_with_year', 'F j, Y');
variable_set('date_views_week_format_without_year', 'F j');
}
/**
* Implements hook_uninstall().
*/
function date_views_uninstall() {
variable_del('date_views_month_format_with_year');
variable_del('date_views_month_format_without_year');
variable_del('date_views_day_format_with_year');
variable_del('date_views_day_format_without_year');
variable_del('date_views_week_format_with_year');
variable_del('date_views_week_format_without_year');
}
/**
* Set default date views variables.
*/
function date_views_update_7200() {
if (!variable_get('date_views_month_format_with_year', FALSE)) {
variable_set('date_views_month_format_with_year', 'F Y');
}
if (!variable_get('date_views_month_format_without_year', FALSE)) {
variable_set('date_views_month_format_without_year', 'F');
}
if (!variable_get('date_views_day_format_with_year', FALSE)) {
variable_set('date_views_day_format_with_year', 'l, F j, Y');
}
if (!variable_get('date_views_day_format_without_year', FALSE)) {
variable_set('date_views_day_format_without_year', 'l, F j');
}
if (!variable_get('date_views_week_format_with_year', FALSE)) {
variable_set('date_views_week_format_with_year', 'F j, Y');
}
if (!variable_get('date_views_week_format_without_year', FALSE)) {
variable_set('date_views_week_format_without_year', 'F j');
}
}
Functions
Name | Description |
---|---|
date_views_install | Implements hook_install(). |
date_views_uninstall | Implements hook_uninstall(). |
date_views_update_7200 | Set default date views variables. |