-
Notifications
You must be signed in to change notification settings - Fork 0
/
layout.php
76 lines (72 loc) · 3.66 KB
/
layout.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* ClickHeat : Mise à jour des informations d'un groupe / Group info update
*
* @author Yvan Taviaud - LabsMedia - www.labsmedia.com
* @since 04/04/2007
**/
/** Direct call forbidden */
if (!defined('CLICKHEAT_LANGUAGE'))
{
exit;
}
$group = isset($_GET['group']) ? str_replace('/', '', $_GET['group']) : '';
if (IS_PIWIK_MODULE === true)
{
$clickheatConf = Piwik_ClickHeat_Controller::conf();
}
if (file_exists($clickheatConf['logPath'].$group.'/url.txt'))
{
$f = @fopen($clickheatConf['logPath'].$group.'/url.txt', 'r');
$webPage = trim(fgets($f, 1024));
fclose($f);
}
else
{
$webPage = '';
}
$webPage = explode('>', $webPage);
if (count($webPage) !== 4)
{
$webPage = array('../', 0, 0, 0);
}
$url = &$webPage[0];
$left = (int) $webPage[1];
$center = (int) $webPage[2];
$right = (int) $webPage[3];
unset($webPage);
$pos = strpos($group, ',');
if ($pos === false)
{
$groupTitle = &$group;
}
else
{
$groupTitle = substr($group, $pos + 1);
}
?>
<span class="float-right"><a href="#" onclick="hideGroupLayout(); return false;"><img src="<?php echo CLICKHEAT_PATH ?>images/ko.png" width="16" height="16" align="absmiddle" alt="Close" /></a></span>
<h1><?php echo LANG_LAYOUT ?> '<em><?php echo htmlspecialchars($groupTitle); ?></em>'</h1>
<form action="#" method="get" onsubmit="return false;">
<?php echo LANG_EXAMPLE_URL ?> <input type="text" name="url" id="formUrl" value="<?php echo htmlspecialchars($url); ?>" size="50" /> <a href="#" onclick="saveGroupLayout(); return false;"><img src="<?php echo CLICKHEAT_PATH ?>images/save.png" width="16" height="16" alt="Save" /></a><br />
<span class="layout-left-fixed"><?php echo LANG_LAYOUT_FIXED ?></span> <span class="layout-left-liquid"><?php echo LANG_LAYOUT_LIQUID ?></span> <span class="layout-left-empty"><?php echo LANG_LAYOUT_NONE ?></span><br />
<table cellpadding="0" cellspacing="2" border="0">
<?php
for ($i = 0; $i < 7; $i++)
{
$leftFixed = ($i & 1) === 1;
$centerFixed = ($i & 2) === 2;
$rightFixed = ($i & 4) === 4;
$selected = ($leftFixed === false && $left === 0 || $leftFixed === true && $left !== 0) && ($centerFixed === false && $center === 0 || $centerFixed === true && $center !== 0) && ($rightFixed === false && $right === 0 || $rightFixed === true && $right !== 0);
echo '<tr><td><div class="layout-left-', $leftFixed ? 'fixed' : ($centerFixed ? 'empty' : 'liquid'), '"><div class="layout-center-', $centerFixed ? 'fixed' : 'liquid', '"><div class="layout-right-', $rightFixed ? 'fixed' : ($centerFixed ? 'empty' : 'liquid'), '"></div></div></div></td>';
echo '<td>', constant('LANG_LAYOUT_'.$i), '</td>';
echo '<td><span id="layout-span-', $i, '" style="display:none;">';
echo $leftFixed ? LANG_LAYOUT_LEFT.' <input type="text" name="left-'.$i.'" id="layout-left-'.$i.'" size="3" value="'.$left.'" /> ' : '<input type="hidden" name="left-'.$i.'" id="layout-left-'.$i.'" value="0" />';
echo $centerFixed && !$leftFixed && !$rightFixed ? LANG_LAYOUT_CENTER.' <input type="text" name="center-'.$i.'" id="layout-center-'.$i.'" size="3" value="'.$center.'" /> ' : '<input type="hidden" name="center-'.$i.'" id="layout-center-'.$i.'" value="0" />';
echo $rightFixed ? LANG_LAYOUT_RIGHT.' <input type="text" name="right-'.$i.'" id="layout-right-'.$i.'" size="3" value="'.$right.'" />' : '<input type="hidden" name="right-'.$i.'" id="layout-right-'.$i.'" value="0" />';
echo '<a href="#" onclick="saveGroupLayout(); return false;"><img src="', CLICKHEAT_PATH, 'images/save.png" width="16" height="16" align="absmiddle" alt="Save" /></a></span></td>';
echo '<td><input type="radio" name="layout-radio" id="layout-radio-', $i, '"', $selected ? ' checked="checked"' : '', ' onclick="showRadioLayout(', $i, ');" /></td></tr>';
}
?>
</table>
</form>