-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSTOMT.php
41 lines (36 loc) · 1.16 KB
/
STOMT.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* Created by STOMT.
* User: philippzentner
* Date: 10.10.17
* Time: 17:57
*/
function STOMT($pagename,
$widgetType = 'addTab',
$position = 'right',
$label = 'Quick Feedback',
$colorText = '#ffffff',
$colorBackground ='#000000',
$colorHover = '#ccc') {
// To keep it compatible with older PHP versions we make use of array() instead of []
$config = array(
'targetId' => $pagename,
'position' => $position,
'label' => $label,
'colorText' => $colorText,
'colorBackground' => $colorBackground,
'colorHover' => $colorHover
);
echo "<script>
// Include the STOMT JavaScript SDK
(function(w, d, n, r, t, s){
w.Stomt = w.Stomt||[];
t = d.createElement(n);
s = d.getElementsByTagName(n)[0];
t.async=1;
t.src=r;
s.parentNode.insertBefore(t,s);
})(window, document, 'script', 'https://www.stomt.com/widget.js');
Stomt.push(['".$widgetType."', ".json_encode($config)."]);
</script>";
}