Révision 204e4d33
Ajouté par Assos Assos il y a presque 9 ans
drupal7/sites/all/modules/date_ical/date_ical.install | ||
---|---|---|
9 | 9 |
*/ |
10 | 10 |
function date_ical_requirements($phase) { |
11 | 11 |
$requirements = array(); |
12 |
|
|
12 |
|
|
13 | 13 |
// Ensure translations don't break at install time. |
14 | 14 |
$t = get_t(); |
15 |
|
|
15 |
|
|
16 | 16 |
if ($phase == 'runtime') { |
17 | 17 |
if (!function_exists('libraries_detect')) { |
18 | 18 |
$requirements['date_ical'] = array( |
... | ... | |
26 | 26 |
// Return immediately, since we can't even attempt to determine if iCalcreator is installed. |
27 | 27 |
return $requirements; |
28 | 28 |
} |
29 |
|
|
29 |
|
|
30 | 30 |
$library = libraries_detect('iCalcreator'); |
31 | 31 |
if ($library && !empty($library['installed'])) { |
32 | 32 |
$requirements['date_ical'] = array( |
... | ... | |
46 | 46 |
); |
47 | 47 |
} |
48 | 48 |
} |
49 |
|
|
49 |
|
|
50 | 50 |
return $requirements; |
51 | 51 |
} |
52 | 52 |
|
... | ... | |
73 | 73 |
// Drupal attempts to instantiate the old feeds plugin classes. |
74 | 74 |
registry_rebuild(); |
75 | 75 |
cache_clear_all('plugins:feeds:plugins', 'cache'); |
76 |
|
|
76 |
|
|
77 | 77 |
// Update all the importers which used DateIcalIcalcreatorParser to use |
78 | 78 |
// DateiCalFeedsParser instead. |
79 | 79 |
$importer_data = ctools_export_load_object('feeds_importer', 'all'); |
... | ... | |
81 | 81 |
$importer = feeds_importer($key); |
82 | 82 |
$importer_config = $importer->getConfig(); |
83 | 83 |
$needs_update = ($importer_config['parser']['plugin_key'] == 'DateIcalIcalcreatorParser'); |
84 |
|
|
84 |
|
|
85 | 85 |
$processor = $importer->processor; |
86 | 86 |
$processor_config = $processor->getconfig(); |
87 | 87 |
// Also update importers which use the new parser, but have un-capitalized |
... | ... | |
91 | 91 |
&& !empty($processor_config['mappings'][0]['source'])) { |
92 | 92 |
$needs_update = (strtoupper($processor_config['mappings'][0]['source']) != $processor_config['mappings'][0]['source']); |
93 | 93 |
} |
94 |
|
|
94 |
|
|
95 | 95 |
if ($needs_update) { |
96 | 96 |
$importer->setPlugin('DateiCalFeedsParser'); |
97 |
|
|
97 |
|
|
98 | 98 |
// Source keys are now capitalized, so we need to update the mappings. |
99 | 99 |
foreach ($processor_config['mappings'] as &$mapping) { |
100 | 100 |
$mapping['source'] = strtoupper($mapping['source']); |
101 | 101 |
} |
102 | 102 |
$processor->setConfig($processor_config); |
103 |
|
|
103 |
|
|
104 | 104 |
$importer->save(); |
105 |
|
|
105 |
|
|
106 | 106 |
// When this importer object got created, a warning was issued about its |
107 | 107 |
// parser plugin being missing. We corrected that warning above, so we |
108 | 108 |
// should clear it out to avoid potential confusion. |
Formats disponibles : Unified diff
Weekly update of contrib modules