This repository has been archived by the owner on Feb 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qtrClient.install
61 lines (52 loc) · 1.55 KB
/
qtrClient.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 qtrClient.
*/
/**
* Implements hook_install().
*/
function qtrClient_install() {
// Set some default values for the variables.
variable_set('oauth2_server_url', '');
// Set some test/dummy values for oauth2 variables.
$server_url = 'https://dev.qtranslate.org';
$client_id = 'client1';
$client_secret = '0123456789';
$skip_ssl = 0;
// Set the Q-Translate API server.
variable_set('qtrClient_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 qtrClient_uninstall() {
// Delete variables that were used for this module.
$variables = array(
'qtrClient_translation_lng',
'qtrClient_server',
'qtrClient_topusers_size',
'qtrClient_topusers_period',
);
foreach ($variables as $var) {
variable_del($var);
}
}
/**
* Implements hook_schema().
*/
function qtrClient_schema() {
// Create a cache table for this module.
$schema['cache_qtrClient'] = drupal_get_schema_unprocessed('system', 'cache');
return $schema;
}