-
Notifications
You must be signed in to change notification settings - Fork 3
/
viewer_ui.php
executable file
·143 lines (140 loc) · 5.36 KB
/
viewer_ui.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
<?php
session_start();
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15"/>
<title>(PHP) TMX Viewer [by sebbu]</title>
</head>
<style>
TABLE, TD {
border: 2px solid #000000;
border-collapse: collapse;
empty-cells: show;
padding: 2px;
}
#f1_list TR,
#f1_list TD {
display: none;
border-collapse: collapse;
border: 0px none #FFFFFF;
}
#f1_url TR,
#f1_url TD {
display: none;
border-collapse: collapse;
border: 0px none #FFFFFF;
}
#f1_file TR,
#f1_file TD {
display: none;
border-collapse: collapse;
border: 0px none #FFFFFF;
}
</style>
<body>
<script type="text/javascript">
function show_f1_choice_list() {
/*show list */
document.getElementById('f1_list' ).cells.item(0)/*td*/.style.display="table-cell";
document.getElementById('f1_list' ).cells.item(0)/*td*/.style.visibility="visible";
/*hide url */
document.getElementById('f1_url' ).cells.item(0)/*td*/.style.display="none";
document.getElementById('f1_url' ).cells.item(0)/*td*/.style.visibility="hidden";
/*hide file*/
document.getElementById('f1_file').cells.item(0)/*td*/.style.display="none";
document.getElementById('f1_file').cells.item(0)/*td*/.style.visibility="hidden";
}
function show_f1_choice_url() {
/*show url */
document.getElementById('f1_url' ).cells.item(0)/*td*/.style.display="table-cell";
document.getElementById('f1_url' ).cells.item(0)/*td*/.style.visibility="visible";
/*hide list */
document.getElementById('f1_list' ).cells.item(0)/*td*/.style.display="none";
document.getElementById('f1_list' ).cells.item(0)/*td*/.style.visibility="hidden";
/*hide file*/
document.getElementById('f1_file').cells.item(0)/*td*/.style.display="none";
document.getElementById('f1_file').cells.item(0)/*td*/.style.visibility="hidden";
}
function show_f1_choice_file() {
/*show file*/
document.getElementById('f1_file').cells.item(0)/*td*/.style.display="table-cell";
document.getElementById('f1_file').cells.item(0)/*td*/.style.visibility="visible";
/*hide list */
document.getElementById('f1_list' ).cells.item(0)/*td*/.style.display="none";
document.getElementById('f1_list' ).cells.item(0)/*td*/.style.visibility="hidden";
/*hide url */
document.getElementById('f1_url' ).cells.item(0)/*td*/.style.display="none";
document.getElementById('f1_url' ).cells.item(0)/*td*/.style.visibility="hidden";
}
function show_f1_choice_NONE() {
/*hide list */
document.getElementById('f1_list' ).cells.item(0)/*td*/.style.display="none";
document.getElementById('f1_list' ).cells.item(0)/*td*/.style.visibility="hidden";
/*hide url */
document.getElementById('f1_url' ).cells.item(0)/*td*/.style.display="none";
document.getElementById('f1_url' ).cells.item(0)/*td*/.style.visibility="hidden";
/*hide file*/
document.getElementById('f1_file').cells.item(0)/*td*/.style.display="none";
document.getElementById('f1_file').cells.item(0)/*td*/.style.visibility="hidden";
}
window.onload=function() {
/*force none selected*/
document.getElementById('f1_choice_list' ).checked=false;
document.getElementById('f1_choice_url' ).checked=false;
document.getElementById('f1_choice_file').checked=false;
/*event handler*/
document.getElementById('f1_choice_list' ).onclick=show_f1_choice_list;
document.getElementById('f1_choice_url' ).onclick=show_f1_choice_url;
document.getElementById('f1_choice_file').onclick=show_f1_choice_file;
document.getElementById('reset1').onclick=show_f1_choice_NONE;
/* force hide form parts*/
show_f1_choice_NONE();
};
</script>
<h1>MAP</h1>
<form id="form1" action="viewer_view.php" method="POST" enctype="multipart/form-data">
<input type="hidden" name="called_from" value="script"/>
<table id="table1">
<tr>
<td colspan="2"><label for="f1_choice_list"><input type="radio" name="choice" value="LIST" id="f1_choice_list"/>LIST</label></td>
<td colspan="2"><label for="f1_choice_url"><input type="radio" name="choice" value="URL" id="f1_choice_url"/>URL</label></td>
<td colspan="2"><label for="f1_choice_file"><input type="radio" name="choice" value="FILE" id="f1_choice_file" disabled="disabled"/>FILE</label></td>
</tr>
<tr id="f1_list">
<td colspan="6"><select name="list" size="1">
<option value=""> </option>
<?php
$files=array();
$files=array_merge($files, glob('../../tmw/*.tmx'));
$files=array_merge($files, glob('../../tmx/*.tmx'));
$files=array_merge($files, glob('../../maps/*.tmx'));
$files=array_merge($files, glob('../tmw/*.tmx'));
$files=array_merge($files, glob('../tmx/*.tmx'));
$files=array_merge($files, glob('../maps/*.tmx'));
$files=array_merge($files, glob('../*.tmx'));
$files=array_merge($files, glob('tmw/*.tmx'));
$files=array_merge($files, glob('tmx/*.tmx'));
$files=array_merge($files, glob('maps/*.tmx'));
//$files=array_merge($files, glob('*/*.tmx'));
$files=array_merge($files, glob('*.tmx'));
$files=array_values(array_unique($files));
foreach($files as $file) {
echo '<option value="'.$file.'">'.$file.'</option>'."\r\n";
}
?></select></td>
</tr>
<tr id="f1_url">
<td colspan="6"><input type="text" name="url" size="50"/></td>
</tr>
<tr id="f1_file">
<td colspan="6"><input type="file" name="file" size="10"/></td>
</tr>
<tr>
<td colspan="3"><input type="submit" id="submit1" value="Envoyer"/></td>
<td colspan="3"><input type="reset" id="reset1" value="Remettre à zéro"/></td>
</tr>
</table>
</form>
</body>
</html>