forked from OpenRailwayMap/OpenRailwayMap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmobile.php
216 lines (210 loc) · 8.31 KB
/
mobile.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<?php
/*
OpenRailwayMap Copyright (C) 2012 Alexander Matheisen
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under certain conditions.
See http://wiki.openstreetmap.org/wiki/OpenRailwayMap for details.
*/
require_once("api/functions.php");
if (isset($_GET['lang']) && array_key_exists($_GET['lang'], $langs))
$lang = $_GET['lang'];
else
$lang = getUserLang();
includeLocale($lang);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<? echo $lang; ?>" lang="<? echo $lang; ?>">
<head>
<title>OpenRailwayMap</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-language" content="<? echo $lang; ?>" />
<meta name="keywords" content="openstreetmap, openrailwaymap, alexander matheisen, rurseekatze, openlayers, osm, matheisen, orm, eisenbahnkarte, bahnkarte, railmap, railway, railways, eisenbahn, streckenkarte" />
<meta name="title" content="OpenRailwayMap" />
<meta name="author" content="rurseekatze, Alexander Matheisen" />
<meta name="publisher" content="rurseekatze, Alexander Matheisen" />
<meta name="copyright" content="GNU General Public License v3" />
<meta name="revisit-after" content="after 90 days" />
<meta name="date" content="2010-01-01" />
<meta name="page-topic" content="OpenRailwayMap" />
<meta name="robots" content="index,follow" />
<link rel="alternate" type="application/rss+xml" title="OpenRailwayMap RSS Feed" href="http://www.matheisen.org/<? echo ($lang == 'de') ? 'de' : 'en'; ?>/orm.rss" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="shortcut icon" href="img/favicon.ico" type="image/vnd.microsoft.icon" />
<link rel="icon" href="img/favicon.ico" type="image/vnd.microsoft.icon" />
<meta http-equiv="content-script-type" content="text/javascript" />
<meta http-equiv="content-style-type" content="text/css" />
<link rel="stylesheet" type="text/css" href="css/mobile.css" />
<link rel="stylesheet" href="css/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="css/leaflet.ie.css" />
<![endif]-->
<script type="text/javascript" src="js/leaflet-0.6.2.js"></script>
<script type="text/javascript" src="js/L.TileLayer.Grayscale.js"></script>
<script>L_DISABLE_3D = true;</script>
<?php
// params
echo "<script type=\"text/javascript\">\n";
echo "var params={\n";
echo "id : ".(isValidId('id') ? ($_GET['id']) : ("null")).",\n";
echo "type : ".(isValidType('type') ? ("'".$_GET['type']."'") : ("null")).",\n";
echo "lat : ";
if (isValidCoordinate('lat'))
echo $_GET['lat'].",\n";
else
{
$latlon = getLatLon('id', isset($type) ? $type : "");
if ($latlon)
echo $latlon[1].",\n";
else
echo "null,\n";
}
echo "lon : ";
if (isValidCoordinate('lon'))
echo $_GET['lon'].",\n";
else
{
$latlon = getLatLon('id', isset($type) ? $type : "");
if ($latlon)
echo $latlon[0].",\n";
else
echo "null,\n";
}
echo "zoom : ".(isValidZoom('zoom') ? ($_GET['zoom']) : ("null")).",\n";
echo "offset : ".(isValidOffset('offset') ? ($_GET['offset']) : ("null")).",\n";
echo "searchquery : ".(isset($_GET['q']) ? (json_encode($_GET['q'])) : ("''")).",\n";
echo "lang : '".$lang."',\n";
echo "ref : ".(isset($_GET['ref']) ? (json_encode($_GET['ref'])) : ("null")).",\n";
echo "name : ".(isset($_GET['name']) ? (json_encode($_GET['name'])) : ("null")).",\n";
echo "line : ".(isset($_GET['line']) ? (json_encode($_GET['line'])) : ("null")).",\n";
echo "operator : ".(isset($_GET['operator']) ? (json_encode($_GET['operator'])) : ("null")).",\n";
echo "style : ".(isset($_GET['style']) ? (json_encode($_GET['style'])) : ("null")).",\n";
echo "mobile : ".(isset($_GET['mobile']) ? (($_GET['mobile'] != '0' && $_GET['mobile'] != 'false') ? "true" : "false") : ("null"))."\n";
echo "};\n";
echo "</script>\n";
switch ($lang)
{
case "de":
$paypalbuttonlang = "de_DE";
break;
case "en":
$paypalbuttonlang = "en_US";
break;
case "fr":
$paypalbuttonlang = "fr_FR";
break;
case "es":
$paypalbuttonlang = "es_ES";
break;
case "nl":
$paypalbuttonlang = "nl_NL";
break;
case "it":
$paypalbuttonlang = "it_IT";
break;
case "ru":
$paypalbuttonlang = "ru_RU";
break;
case "pl":
$paypalbuttonlang = "pl_PL";
break;
default:
$paypalbuttonlang = "en_US";
break;
}
?>
<script type="text/javascript" src="api/jstranslations.php?lang=<? echo $lang; ?>"></script>
<script type="text/javascript" src="js/search.js"></script>
<script type="text/javascript" src="js/startposition.js"></script>
<script type="text/javascript" src="js/timestamp.js"></script>
<script type="text/javascript" src="js/mobilemenu.js"></script>
<script type="text/javascript" src="js/functions.js"></script>
<script type="text/javascript" src="js/mobile.js"></script>
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function() {
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://piwik.openlinkmap.org/";
_paq.push(["setTrackerUrl", u+"piwik.php"]);
_paq.push(["setSiteId", "2"]);
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Piwik Code -->
</head>
<body onload="createMap(false);">
<div id="header">
<b>OpenRailwayMap</b>
<div id="menuButton"></div>
</div>
<div id="menu" class="menuOut">
<div class="box">
<div class="headEntry"><?=_("Style")?></div>
<div id="styleSelectionBar"></div>
</div>
<div class="box">
<div class="headEntry"><?=_("Search")?></div>
<div class="headEntry">
<div>
<input type="text" id="searchBox" size="21" placeholder="<?=_('Search')?>" />
</div>
<div id="clearButton" onclick="Search.clear();">
<b>❌</b>
</div>
<div id="searchButton" onclick="Search.request();">
<b>↵</b>
</div>
</div>
<div id="searchBar" class="infoBarOut"></div>
</div>
<div class="box">
<div class="headEntry"><?=_("Legend")?></div>
<div id="legendBar">
<iframe id="legend" scrolling="no" onload="setIframeHeight(this.id)" src=""></iframe>
</div>
</div>
<div class="box">
<div class="headEntry"><?=_("Last update")?></div>
<p id="info"></p>
</div>
<div class="box">
<div class="headEntry"><?=_("Language")?></div>
<?php
foreach ($langs as $short => $name)
{
if ($short == $lang)
echo '<div class="resultEntry">'.$name[1].'<small>✓</small></div>';
else
echo '<div class="resultEntry" onclick="changeLanguage(\''.$short.'\')">'.$name[1].'</div>';
}
?>
</div>
<hr class="separator" />
<div class="box">
<a style="display:block" class="resultEntry" id="infoButton" href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap"><?=_("More Info")?></a>
<a style="display:block" class="resultEntry" id="infoButton" href="http://blog.openrailwaymap.org/"><?=_("Blog")?></a>
<a style="display:block" class="resultEntry" id="contactButton" href="#"><?=_("Contact")?></a>
<a style="display:block" class="resultEntry" id="permalinkButton" href=""><?=_("Permalink")?></a>
<a style="display:block" class="resultEntry" id="desktopButton" href=""><?=_("Desktop version")?></a>
<script language="javascript">
var usr = "info";
var dom = "openrailwaymap";
var tld = "org";
gEBI("contactButton").href = "mailto:"+usr+"@"+dom+"."+tld;
</script>
</div>
</div>
<div id="locateButton"></div>
<script language="javascript">
if (isMobileDevice())
gEBI("locateButton").className = "leaflet-touch";
</script>
<div id="mapFrame">
<noscript>
<p><b><?=_("Javascript is not activated")?></b><br /><?=_("Javascript is needed to show the map and run this website. Please turn on Javascript in your browser settings.")?></p>
</noscript>
</div>
</body>
</html>