Skip to content

Commit 64501ea

Browse files
Merge branch 'drupal-forms-api-usage' of github.com:alvinjohnsonso/tawk-drupal into pattern-matching
2 parents b9a8d78 + 9a4004c commit 64501ea

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

includes/tawk_to.helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static function get_iframe_url() {
5454
'widget_id' => '',
5555
);
5656
}
57-
return TawkHelper::get_base_url() . '/generic/widgets?currentWidgetId=' . $widget['widget_id'] . '&currentPageId=' . $widget['page_id'];
57+
return TawkHelper::get_base_url() . '/generic/widgets?currentWidgetId=' . $widget['widget_id'] . '&currentPageId=' . $widget['page_id'] . '&pltf=drupal';
5858
}
5959

6060
/**

js/tawk_to.admin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jQuery(document).ready(function() {
77
tawktoSettings = Drupal.settings.tawkto || {};
88

99
var currentHost = window.location.protocol + "//" + window.location.host;
10-
var url = tawktoSettings.iframeUrl + "&pltf=drupal&parentDomain=" + currentHost;
10+
var url = tawktoSettings.iframeUrl + "&parentDomain=" + currentHost;
1111

1212
jQuery("#tawkIframe").attr("src", url);
1313

tawk_to.module

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,13 @@ function tawk_to_preprocess_page(&$variables) {
4848
}
4949

5050
// prepare visibility
51-
$currentUrl = $base_url.$_SERVER['REQUEST_URI'];
51+
$current_url = $base_url.$_SERVER['REQUEST_URI'];
5252

5353
if (false === $options->always_display) {
54-
$showPages = json_decode($options->show_oncustom);
54+
$show_pages = json_decode($options->show_oncustom);
5555
$show = false;
5656

57-
58-
if (UrlPatternMatcher::match($currentUrl, $showPages)) {
57+
if (UrlPatternMatcher::match($current_url, $show_pages)) {
5958
$show = true;
6059
}
6160

@@ -80,9 +79,9 @@ function tawk_to_preprocess_page(&$variables) {
8079
$hide_pages = json_decode($options->hide_oncustom);
8180
$show = true;
8281

83-
$currentUrl = (string) $currentUrl;
82+
$current_url = (string) $current_url;
8483

85-
if (UrlPatternMatcher::match($currentUrl, $hide_pages)) {
84+
if (UrlPatternMatcher::match($current_url, $hide_pages)) {
8685
$show = false;
8786
}
8887

0 commit comments

Comments
 (0)