-
Notifications
You must be signed in to change notification settings - Fork 0
/
social_auth_foursquare.install
45 lines (35 loc) · 1.25 KB
/
social_auth_foursquare.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
<?php
/**
* @file
* Install, update, and uninstall functions for the Social Auth Foursquare module.
*/
use Drupal\social_api\Utility\SocialApiImplementerInstaller;
use Drupal\social_auth\Controller\SocialAuthController;
/**
* Implements hook_requirements().
*
* Checks that a compatible version of oAuth2 Foursquare library for the
* stevenmaguire OAuth2 client with Composer. Check installation instructions
* from the README.txt.
*/
function social_auth_foursquare_requirements($phase) {
$requirements = [];
// Social API should be installed at this point in order to check library.
\Drupal::service('module_installer')->install(['social_api']);
if ($phase == 'install') {
$requirements = SocialApiImplementerInstaller::checkLibrary('social_auth_foursquare', 'Social Auth Foursquare', 'stevenmaguire/oauth2-foursquare', 2.0);
}
return $requirements;
}
/**
* Implements hook_install().
*/
function social_auth_foursquare_install() {
SocialAuthController::setLoginButtonSettings('social_auth_foursquare', 'social_auth_foursquare.redirect_to_foursquare', 'img/foursquare.svg');
}
/**
* Implements hook_uninstall().
*/
function social_auth_foursquare_uninstall() {
SocialAuthController::deleteLoginButtonSettings('social_auth_foursquare');
}