This repository has been archived by the owner on Mar 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
btrClient.install
61 lines (52 loc) · 1.55 KB
/
btrClient.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
<?php
/**
* @file
* Install and update functions for the module btrClient.
*/
/**
* Implements hook_install().
*/
function btrClient_install() {
// Set some default values for the variables.
variable_set('oauth2_server_url', '');
// Set some test/dummy values for oauth2 variables.
$server_url = 'http://dev.btranslator.org';
$client_id = 'client1';
$client_secret = '0123456789';
$skip_ssl = 1;
// Set the B-Translator API server.
variable_set('btrClient_server', $server_url);
// Set configuration variables of oauth2_login.
variable_set('oauth2_login_oauth2_server', $server_url);
variable_set('oauth2_login_client_id', $client_id);
variable_set('oauth2_login_client_secret', $client_secret);
variable_set('oauth2_login_skipssl', $skip_ssl);
// Set the settings to hybridauth and call hook enabled.
module_load_include('inc', 'oauth2_login', 'oauth2_login.admin');
variable_set('oauth2_login_enabled', TRUE);
oauth2_login_admin_set_settings();
oauth2_login_call_hook_enabled();
}
/**
* Implements hook_uninstall().
*/
function btrClient_uninstall() {
// Delete variables that were used for this module.
$variables = array(
'btrClient_translation_lng',
'btrClient_server',
'btrClient_topcontrib_size',
'btrClient_topcontrib_period',
);
foreach ($variables as $var) {
variable_del($var);
}
}
/**
* Implements hook_schema().
*/
function btrClient_schema() {
// Create a cache table for this module.
$schema['cache_btrClient'] = drupal_get_schema_unprocessed('system', 'cache');
return $schema;
}