-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathting_sfx.install
More file actions
61 lines (55 loc) · 1.26 KB
/
ting_sfx.install
File metadata and controls
61 lines (55 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* @file
* Install, update and uninstall functions for the ting ting_infomedia module.
*/
/**
* Implements hook_ding_entity_fields().
*
* field-definitions.
*/
function ting_sfx_ding_entity_fields() {
return array(
'ting_sfx' => array(
'field' => array(
'locked' => TRUE,
'storage' => array(
'type' => 'virtual_field',
),
),
'instance' => array(
'label' => t('Search other sites'),
),
),
);
}
/**
* Implements hook_requirements().
*/
function ting_sfx_requirements($phase) {
$requirements = array();
if ($phase == 'runtime') {
$url = variable_get('ting_sfx_url');
if (!isset($url)) {
$t = get_t();
$requirements['service_urls'] = array(
'title' => $t('SFX settings'),
'value' => l($t('Url for SFX link resolver must be set in admin'), 'admin/config/ting/settings'),
'severity' => REQUIREMENT_ERROR,
);
}
}
return $requirements;
}
/**
* Convert blackhole field storage to virtual field.
*/
function ting_sfx_update_7000() {
return db_update('field_config')
->fields(array(
'storage_type' => 'virtual_field',
'storage_module' => 'virtual_field',
))
->condition('module', 'ting_sfx')
->execute();
}