Révision 599a39cd
Ajouté par Assos Assos il y a environ 3 ans
drupal7/sites/all/modules/date/date_repeat_field/date_repeat_field.devel_generate.inc | ||
---|---|---|
1 | 1 |
<?php |
2 |
|
|
2 | 3 |
/** |
3 | 4 |
* @file |
4 | 5 |
* Handling of devel generate functionality for repeating dates. |
... | ... | |
6 | 7 |
|
7 | 8 |
/** |
8 | 9 |
* Implements hook_date_field_insert(). |
9 |
* |
|
10 |
* A substitute for hook_devel_generate to handle repeating dates. |
|
11 | 10 |
*/ |
12 | 11 |
function date_repeat_field_date_field_insert(&$items, $context) { |
13 |
|
|
12 |
// A substitute for hook_devel_generate to handle repeating dates. |
|
14 | 13 |
$entity_type = $context['entity_type']; |
15 | 14 |
$entity = $context['entity']; |
16 | 15 |
$field = $context['field']; |
... | ... | |
103 | 102 |
$freq = $options[$freq]; |
104 | 103 |
$form_values['FREQ'] = $freq; |
105 | 104 |
$form_values['BYDAY'] = array($dow); |
106 |
break; |
|
107 | 105 |
} |
108 | 106 |
|
109 | 107 |
$form_values['INTERVAL'] = $interval; |
... | ... | |
123 | 121 |
|
124 | 122 |
default: |
125 | 123 |
$period = 'day'; |
126 |
break; |
|
127 | 124 |
} |
128 | 125 |
|
129 | 126 |
$form_values['UNTIL'] = array(); |
... | ... | |
135 | 132 |
$values = date_repeat_build_dates($field, $item, $rrule, $form_values); |
136 | 133 |
|
137 | 134 |
$items += $values; |
138 |
|
|
139 | 135 |
} |
140 | 136 |
|
141 | 137 |
/** |
142 | 138 |
* Generate a random content keys. |
139 |
* |
|
140 |
* @return string |
|
141 |
* A random string generated by mt_rand(). |
|
143 | 142 |
*/ |
144 | 143 |
function date_content_generate_key($array) { |
145 | 144 |
$keys = array_keys($array); |
... | ... | |
151 | 150 |
/** |
152 | 151 |
* Helper function for BYDAY options. |
153 | 152 |
* |
154 |
* Creates options like -1SU and 2TU |
|
155 |
* Omit options that won't find many matches, like 5th Sunday. |
|
153 |
* @return array |
|
154 |
* Creates options like -1SU and 2TU. Omits options that won't find many |
|
155 |
* matches, like 5th Sunday. |
|
156 | 156 |
*/ |
157 | 157 |
function date_content_repeat_dow_options() { |
158 | 158 |
$options = array(); |
Formats disponibles : Unified diff
Weekly update of contrib modules