-
Notifications
You must be signed in to change notification settings - Fork 3
/
new.php
77 lines (74 loc) · 1.92 KB
/
new.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
<?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\Project;
include_once __DIR__ . "/utils.php";
if(getProject() instanceof Project){
include "utils.php";
return;
}
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style/form.css">
<title>Create New Project</title>
<?= INCLUDE_JQUERY ?>
<script>
function validateName(name){
return name.replace(/[^A-Za-z0-9_]/g, "");
}
$("#submitButton").click(function(){
var nameInput = $("#nameInput");
nameInput.val(validateName(nameInput.val()));
});
</script>
</head>
<body>
<h1>Start New Plugin Project</h1>
<hr>
<?php if(isset($_GET["err"])): ?>
<div>
<a class="error"><?= $_GET["err"] ?></a>
</div>
<?php endif ?>
<form action="initProject.php" method="post">
<table>
<tr>
<td class="left"><label for="name">Plugin Name:</label></td>
<td class="right">
<input class="textbox" type="text" name="name" id="nameInput" placeholder="Can only be A-Z, a-z, 0-9 and _">
</td>
</tr>
<tr>
<td class="left"><label for="authors">Author(s):</label></td>
<td class="right">
<input class="textbox" type="text" name="authors" placeholder="Separate names by commas">
</td>
</tr>
<tr>
<td class="left"><label for="version">Version:</label></td>
<td class="right"><input class="textbox" type="text" name="version" value="1.0.0"></td>
</tr>
<tr>
<td class="left"><label for="website">Website:</label></td>
<td class="right">
<input class="codebox" type="url" name="website" placeholder="(Optional)">
</td>
</tr>
</table>
<p>
<input class="button" type="submit" id="submitButton" value="Start">
</p>
</form>
</body>
</html>