Skip to content

Commit

Permalink
Add option to set platform string
Browse files Browse the repository at this point in the history
- for internal use by Smartsupp plugins
  • Loading branch information
marekgach committed Nov 8, 2018
1 parent cfcfd6f commit b73c3ea
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Smartsupp/ChatGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,26 @@ class ChatGenerator
*/
protected $hide_widget = false;

/**
* @var null|string plugin platform
*/
protected $platform = null;

public function __construct($key = null)
{
$this->key = $key;
}

/**
* Set platform - serves as internal information for Smartsupp to identify which CMS and version is used.
*
* @param string $platform
*/
public function setPlatform($platform)
{
$this->platform = $platform;
}

/**
* Set chat language. Also is checking if language is one of allowed values.
*
Expand Down Expand Up @@ -387,6 +402,10 @@ public function render($print_out = false)
$params[] = "_smartsupp.offsetY = " . (int)$this->offset_y . "; // offset from top, default 100";
}

if ($this->platform) {
$params[] = "_smartsupp.sitePlatform = " . self::javascriptEscape($this->platform) . ";";
}

// set detailed visitor's info
// basic info
if ($this->email) {
Expand Down

0 comments on commit b73c3ea

Please sign in to comment.