-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbigbuttons.php
58 lines (49 loc) · 1.63 KB
/
bigbuttons.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
<?
require_once("config.php");
require_once("common.php");
$pluginSettings = array();
$pluginConfigFile = $settings['configDirectory'] . "/plugin." . $_GET['plugin'];
if (file_exists($pluginConfigFile))
$pluginSettings = parse_ini_file($pluginConfigFile);
?>
<script type="text/javascript">
var pluginSettings = new Array();
<?
foreach ($pluginSettings as $key => $value) {
printf(" pluginSettings['%s'] = \"%s\";\n", $key, $value);
}
?>
function buttonClicked(cell, x)
{
$(cell).animate({'opacity':'0.5'}, 100);
$.get("runEventScript.php?scriptName=" + pluginSettings["button" + x + "script"]);
$(cell).animate({'opacity':'1.0'}, 100);
}
</script>
<center><b><font size='<?=$pluginSettings['buttonFontSize'];?>px'><?
if (isset($pluginSettings['buttonTitle']) && ($pluginSettings['buttonTitle'] != ''))
echo $pluginSettings['buttonTitle'];
else
echo $settings['HostName'] . " - Big Buttons Plugin";
?></b></font>
<table border=1 width='100%' height='90%' bgcolor='#000000'>
<tr>
<?
$buttonCount = 0;
if (isset($pluginSettings['buttonCount']))
$buttonCount = $pluginSettings['buttonCount'];
for ($x = 1; isset($pluginSettings[sprintf("button%02ddesc", $x)]); $x++)
{
if (($x > 1) && (($x % 2) == 1))
echo "</tr><tr>\n";
printf( "<td width='50%%' bgcolor='%s' align='center' onClick='buttonClicked(this, \"%02d\");'><b><font size='%spx'>%s</font></b></td>\n",
$pluginSettings[sprintf("button%02dcolor", $x)], $x,
$pluginSettings["buttonFontSize"],
$pluginSettings[sprintf("button%02ddesc", $x)]);
}
if (($x % 2) == 0)
echo "<td bgcolor='black'> </td>\n";
?>
</tr>
</table>