-
Notifications
You must be signed in to change notification settings - Fork 0
/
ding_social.install
64 lines (58 loc) · 1.77 KB
/
ding_social.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
<?php
/**
* @file
*
* This file is part of ding_social module.
*
* ding_social module is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* ding_social module is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along with
* ding_social module. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* Implements hook_enable().
*/
function ding_social_enable() {
// Change the weight of module in system.
db_update('system')
->fields([
'weight' => 9999,
])
->condition('name', 'ding_social', '=')
->execute();
// Enabling option in easyOPAC IPE Filter module.
if (module_exists('ding_ipe_filter')) {
$opts = variable_get('ding_ipe_filter_panes_selected', []);
$opts['miscellaneous:instagram_block-instagram_block'] = 'miscellaneous:instagram_block-instagram_block';
variable_set('ding_ipe_filter_panes_selected', $opts);
}
}
/**
* Implements hook_uninstall().
*/
function ding_social_uninstall() {
// Remove rules configuration for fb_autopost.
$rule = rules_config_load('rules_post_news_to_facebook');
if (!empty($rule)) {
rules_config_delete([$rule->id]);
}
}
/**
* Change the weight of module in system.
*/
function ding_social_update_7001(&$sandbox) {
db_update('system')
->fields([
'weight' => 9999,
])
->condition('name', 'ding_social', '=')
->execute();
}