You are here

public static function mo_saml_visualTour::genArray in OAuth2 Login 8

2 calls to mo_saml_visualTour::genArray()
MiniorangeConfigOAuthClient::buildForm in src/Form/MiniorangeConfigOAuthClient.php
Form constructor.
MiniorangeLicensing::buildForm in src/Form/MiniorangeLicensing.php
Form constructor.

File

src/mo_saml_visualTour.php, line 6

Class

mo_saml_visualTour

Namespace

Drupal\oauth2_login

Code

public static function genArray($overAllTour = 'tabTour') {
  $link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
  $exploded = explode('/', $link);
  $getPageName = end($exploded);
  $Tour_Token = \Drupal::config('oauth2_login.settings')
    ->get('mo_saml_tourTaken_' . $getPageName);
  if ($overAllTour == 'overAllTour') {
    $getPageName = 'overAllTour';
  }

  //\Drupal::configFactory()->getEditable('oauth2_login.settings')->set('mo_saml_tourTaken_' . $getPageName, TRUE)->save();
  $moTourArr = array(
    'pageID' => $getPageName,
    'tourData' => mo_saml_visualTour::getTourData($getPageName),
    'tourTaken' => $Tour_Token,
    'addID' => mo_saml_visualTour::addID(),
    'pageURL' => $_SERVER['REQUEST_SCHEME'] . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
  );
  \Drupal::configFactory()
    ->getEditable('oauth2_login.settings')
    ->set('mo_saml_tourTaken_' . $getPageName, TRUE)
    ->save();
  $moTour = json_encode($moTourArr);
  return $moTour;
}