You are here

private function LivechatWidgetHandler::setJavascriptParams in Rocket.Chat 8

Same name and namespace in other branches
  1. 8.2 modules/livechat/src/LivechatWidgetHandler.php \Drupal\livechat\LivechatWidgetHandler::setJavascriptParams()

Setter Javascript Parameters.

@TODO Extend this to include Department setting and theme setting.

Parameters

string $key: String representing the key.

1 call to LivechatWidgetHandler::setJavascriptParams()
LivechatWidgetHandler::renderWidgetWithJavaScriptKeys in modules/livechat/src/LivechatWidgetHandler.php
Render Widget.

File

modules/livechat/src/LivechatWidgetHandler.php, line 176
Contains \Drupal\rocket_chat\WidgetHandler.

Class

LivechatWidgetHandler
Glue class to make the widget dynamically build the javascript file.

Namespace

Drupal\livechat

Code

private function setJavascriptParams($key) {
  if (!empty($key) && !is_null($key)) {
    switch ($key) {
      case 'server':
        $this
          ->buildJavaScriptArray('server', \Drupal::config('rocket_chat.settings')
          ->get('server'));
        break;
      default:
        return;
    }
  }
}