social_auth_vipps-8.x-2.1/social_auth_vipps.install

social_auth_vipps.install
<?php

/**
 * @file
 * Install, update, and uninstall functions for the Social Auth Vipps module.
 */

use Drupal\social_auth\Controller\SocialAuthController;

/**
 * Implements hook_install().
 */
function social_auth_vipps_install() {
  SocialAuthController::setLoginButtonSettings('social_auth_vipps', 'social_auth_vipps.redirect_to_vipps', 'img/vipps_logo.png');

  $config = \Drupal::configFactory()->getEditable('social_auth.settings');
  $imgPath = \Drupal::service('extension.list.module')->getPath('social_auth_vipps') . '/img/log_in_with_vipps_btn.svg';
  $config->set('log_in_with_vipps_btn', $imgPath)->save();
}

/**
 * Implements hook_uninstall().
 */
function social_auth_vipps_uninstall() {
  SocialAuthController::deleteLoginButtonSettings('social_auth_vipps');
}

/**
 * Implements hook_update_N().
 *
 * The key api_calls was changed to endpoints. This update copies the values
 * in 'api_calls' to 'endpoints'.
 */
function social_auth_vipps_update_8201(&$sandbox) {
  $config = \Drupal::configFactory()->getEditable('social_auth_vipps.settings');
  $endpoints = $config->get('api_calls');

  $config->set('endpoints', $endpoints)->save();
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc