-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathevents.php
70 lines (67 loc) · 1.65 KB
/
events.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
<?php
/*
* pmt.mcpe.me
*
* Copyright (C) 2015 PEMapModder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PEMapModder
*/
use pg\lib\Event;
require_once __DIR__ . "/utils.php";
?>
<html>
<head>
<link rel="stylesheet" href="style/normal.css" type="text/css">
<link rel="stylesheet" href="style/form.css" type="text/css">
<?= INCLUDE_JQUERY ?>
<script>
$(document).ready(function(){
var hidden = true;
$(".spoiler").each(function(){
var link = $(this).attr("data-spoiler-link");
var content = $(".spoiler-content[data-spoiler-link=" + link + "]");
content.prop("hidden", true);
$(this).click(function(){
hidden = !hidden;
content.prop("hidden", hidden);
});
});
});
</script>
<style>
body{
text-align: left;
}
</style>
</head>
<body>
<form method="get">
<?php
$i = 0;
function echoTree($array){
global $i;
foreach($array as $k => $v){
if(is_array($v)){
$myIndice = $i++;
echo "<div class='spoiler' data-spoiler-link='$myIndice'>$k: <button type='button' class='button'>Open</button></div>";
echo "<ul class='spoiler-content' data-spoiler-link='$myIndice'>";
echoTree($v);
echo "</ul>";
}else{
$short = end(explode("\\", $k));
echo "<li><input type='radio' name='event' value='$k'><strong>$short</strong>: $v</li>";
}
}
}
$array = ["Events" => Event::EVENT_EXPLANATIONS];
echoTree($array);
?>
<input type="submit" class="button">
</form>
</body>
</html>