You are here

social_auth_linkedin.install in Social Auth LinkedIn 8

Same filename and directory in other branches
  1. 8.2 social_auth_linkedin.install
  2. 3.x social_auth_linkedin.install

Install and uninstall functions for the LinkedIn Login module.

File

social_auth_linkedin.install
View source
<?php

/**
 * @file
 * Install and uninstall functions for the LinkedIn Login module.
 */
use Drupal\social_api\Utility\SocialApiImplementerInstaller;
use Drupal\social_auth\Controller\SocialAuthController;

/**
 * Implements hook_requirements().
 */
function social_auth_linkedin_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_linkedin', 'Social Auth Linkedin', 'linkedinapi/linkedin', '1.1.0.0', '2.0.0.0');
  }
  return $requirements;
}

/**
 * Implements hook_install().
 */
function social_auth_linkedin_install() {
  SocialAuthController::setLoginButtonSettings('social_auth_linkedin', 'social_auth_linkedin.redirect_to_linkedin', 'img/linkedin_logo.svg');
}

/**
 * Implements hook_uninstall().
 */
function social_auth_linkedin_uninstall() {
  SocialAuthController::deleteLoginButtonSettings('social_auth_linkedin');
}