-
Notifications
You must be signed in to change notification settings - Fork 6
/
ting_infomedia.install
65 lines (57 loc) · 1.35 KB
/
ting_infomedia.install
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
62
63
64
65
<?php
/**
* @file
* Install, update and uninstall functions for the ting ting_infomedia module.
*/
/**
* Implements hook_uninstall().
*/
function ting_infomedia_uninstall() {
}
/**
* Implements hook_ding_entity_fields().
*/
function ting_infomedia_ding_entity_fields() {
return array(
'ting_infomedia' => array(
'field' => array(
'locked' => TRUE,
'storage' => array(
'type' => 'virtual_field',
),
),
'instance' => array(
'label' => t('Link to infomedia articles'),
),
),
);
}
/**
* Implementing hook_requirements()
*/
function ting_infomedia_requirements($phase) {
$requirements = array();
if ($phase == 'runtime') {
$url = variable_get('ting_infomedia_url');
if( !isset($url) ) {
$requirements['ting_infomedia_url'] = array(
'title' => t('Infomedia settings'),
'value' => l(t('Url to infomedia webservice must be set in admin'), 'admin/config/ting/settings'),
'severity' => REQUIREMENT_ERROR
);
}
}
return $requirements;
}
/**
* Convert blackhole field storage to virtual field.
*/
function ting_infomedia_update_7000() {
return db_update('field_config')
->fields(array(
'storage_type' => 'virtual_field',
'storage_module' => 'virtual_field',
))
->condition('module', 'ting_infomedia')
->execute();
}