1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Install tasks for flexslider_example
|
6
|
*
|
7
|
* @author Mathew Winstone <mwinstone@coldfrontlabs.ca>
|
8
|
*/
|
9
|
|
10
|
/**
|
11
|
* Implements hook_uninstall().
|
12
|
*/
|
13
|
function flexslider_example_uninstall() {
|
14
|
// Collect all the example nodes and delete them since core/features won't do
|
15
|
// this for us
|
16
|
// @see [#1840288]
|
17
|
|
18
|
$query = new EntityFieldQuery();
|
19
|
$query->entityCondition('entity_type', 'node')
|
20
|
->entityCondition('bundle', 'flexslider_example');
|
21
|
|
22
|
$results = $query->execute();
|
23
|
|
24
|
// Ensure we have some nodes
|
25
|
if (!empty($results['node'])) {
|
26
|
$nids = array_keys($results['node']);
|
27
|
node_delete_multiple($nids);
|
28
|
}
|
29
|
}
|
30
|
|
31
|
|
32
|
|
33
|
/**
|
34
|
* Implements hook_update_N().
|
35
|
*
|
36
|
* Checks for the Context module. Disables if not present.
|
37
|
*/
|
38
|
function flexslider_example_update_7001(&$sandbox) {
|
39
|
if (!module_exists('context')) {
|
40
|
module_disable(array('flexslider_example'));
|
41
|
drupal_set_message(t('FlexSlider Example has been disabled as it now requires the !context module which is not currently available. Please download and enable the !context module and re-enable the FlexSlider Example module', array('!context' => l('Context', 'http://drupal.org/project/context'))), 'warning');
|
42
|
}
|
43
|
}
|
44
|
|