You are here

public function TawktoGenerator::getWidgetVars in tawk.to Live Chat (Drupal 8) 8

3 calls to TawktoGenerator::getWidgetVars()
TawktoGenerator::getIframe in tawk_to/src/core/TawktoGenerator.php
TawktoGenerator::getIframeUrl in tawk_to/src/core/TawktoGenerator.php
Constructs url for configuration iframe.
TawktoGenerator::getWidget in tawk_to/src/core/TawktoGenerator.php
Return widget details from the database.

File

tawk_to/src/core/TawktoGenerator.php, line 322

Class

TawktoGenerator

Namespace

Drupal\tawk_to\core

Code

public function getWidgetVars() {

  // return array(
  //         'page_id' => \Drupal::state()->get(TAWK_TO_WIDGET_PID),
  //         'widget_id' => \Drupal::state()->get(TAWK_TO_WIDGET_WID),
  //     );
  $config = \Drupal::service('config.factory')
    ->getEditable('tawk_to.settings');
  return array(
    'page_id' => $config
      ->get('tawk_to.page_id'),
    'widget_id' => $config
      ->get('tawk_to.widget_id'),
    'user_id' => $config
      ->get('tawk_to.user_id'),
    'options' => $config
      ->get('tawk_to.options'),
  );
}