1 |
db9ffd17
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* Install, update and uninstall functions for the Date Views module.
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
/**
|
9 |
|
|
* Implements hook_install().
|
10 |
|
|
*/
|
11 |
|
|
function date_views_install() {
|
12 |
|
|
variable_set('date_views_month_format_with_year', 'F Y');
|
13 |
|
|
variable_set('date_views_month_format_without_year', 'F');
|
14 |
|
|
variable_set('date_views_day_format_with_year', 'l, F j, Y');
|
15 |
|
|
variable_set('date_views_day_format_without_year', 'l, F j');
|
16 |
|
|
variable_set('date_views_week_format_with_year', 'F j, Y');
|
17 |
|
|
variable_set('date_views_week_format_without_year', 'F j');
|
18 |
|
|
}
|
19 |
|
|
|
20 |
|
|
/**
|
21 |
|
|
* Implements hook_uninstall().
|
22 |
|
|
*/
|
23 |
|
|
function date_views_uninstall() {
|
24 |
|
|
variable_del('date_views_month_format_with_year');
|
25 |
|
|
variable_del('date_views_month_format_without_year');
|
26 |
|
|
variable_del('date_views_day_format_with_year');
|
27 |
|
|
variable_del('date_views_day_format_without_year');
|
28 |
|
|
variable_del('date_views_week_format_with_year');
|
29 |
|
|
variable_del('date_views_week_format_without_year');
|
30 |
|
|
}
|
31 |
b720ea3e
|
Assos Assos
|
|
32 |
|
|
/**
|
33 |
|
|
* Set default date views variables.
|
34 |
|
|
*/
|
35 |
|
|
function date_views_update_7200() {
|
36 |
|
|
if (!variable_get('date_views_month_format_with_year', FALSE)) {
|
37 |
|
|
variable_set('date_views_month_format_with_year', 'F Y');
|
38 |
|
|
}
|
39 |
|
|
if (!variable_get('date_views_month_format_without_year', FALSE)) {
|
40 |
|
|
variable_set('date_views_month_format_without_year', 'F');
|
41 |
|
|
}
|
42 |
|
|
if (!variable_get('date_views_day_format_with_year', FALSE)) {
|
43 |
|
|
variable_set('date_views_day_format_with_year', 'l, F j, Y');
|
44 |
|
|
}
|
45 |
|
|
if (!variable_get('date_views_day_format_without_year', FALSE)) {
|
46 |
|
|
variable_set('date_views_day_format_without_year', 'l, F j');
|
47 |
|
|
}
|
48 |
|
|
if (!variable_get('date_views_week_format_with_year', FALSE)) {
|
49 |
|
|
variable_set('date_views_week_format_with_year', 'F j, Y');
|
50 |
|
|
}
|
51 |
|
|
if (!variable_get('date_views_week_format_without_year', FALSE)) {
|
52 |
|
|
variable_set('date_views_week_format_without_year', 'F j');
|
53 |
|
|
}
|
54 |
|
|
} |