-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform.php
executable file
·181 lines (180 loc) · 10.6 KB
/
form.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
<?php
function show_query_form() {
$generator_url = parse_url(plugin_dir_url(__FILE__) . 'generate.php');
$generator_url = $generator_url['path'];
?>
<form class="form-horizontal" id="query-form">
<fieldset>
<div class="control-group" id="term-1">
<label class="control-label" for="term-1">Term 1</label>
<div class="controls">
<input type="text" name="term-1" placeholder="Term 1"><br>
<label class="radio inline">
<input type="radio" name="term-1-match" value="exact"> Exact match</input>
</label>
<label class="radio inline">
<input type="radio" name="term-1-match" value="broad" class="radiogroup-default"> Broad match</input>
</label><br>
<label class="radio inline">
<input type="radio" name="term-1-in" value="inurl"> inUrl</input>
</label>
<label class="radio inline">
<input type="radio" name="term-1-in" value="intitle"> inTitle</input>
</label>
<label class="radio inline">
<input type="radio" name="term-1-in" value="inanchor"> inAnchor</input>
</label>
<label class="radio inline">
<input type="radio" name="term-1-in" value="inpostauthor"> inPostAuthor</input>
</label>
<label class="radio inline">
<input type="radio" name="term-1-in" value="none" class="radiogroup-default"> None</input>
</label>
</div>
</div>
<div class="control-group" id="term-2">
<label class="control-label" for="term-2">Term 2</label>
<div class="controls">
<input type="text" name="term-2" placeholder="Term 2"><br>
<label class="radio inline">
<input type="radio" name="term-2-match" value="exact"> Exact match</input>
</label>
<label class="radio inline">
<input type="radio" name="term-2-match" value="broad" class="radiogroup-default"> Broad match</input>
</label><br>
<label class="radio inline">
<input type="radio" name="term-2-in" value="inurl"> inUrl</input>
</label>
<label class="radio inline">
<input type="radio" name="term-2-in" value="intitle"> inTitle</input>
</label>
<label class="radio inline">
<input type="radio" name="term-2-in" value="inanchor"> inAnchor</input>
</label>
<label class="radio inline">
<input type="radio" name="term-2-in" value="inpostauthor"> inPostAuthor</input>
</label>
<label class="radio inline">
<input type="radio" name="term-2-in" value="none" class="radiogroup-default"> None</input>
</label>
</div>
</div>
<div class="control-group" id="term-3">
<label class="control-label" for="term-3">Term 3</label>
<div class="controls">
<input type="text" name="term-3" placeholder="Term 3"><br>
<label class="radio inline">
<input type="radio" name="term-3-match" value="exact"> Exact match</input>
</label>
<label class="radio inline">
<input type="radio" name="term-3-match" value="broad" class="radiogroup-default"> Broad match</input>
</label><br>
<label class="radio inline">
<input type="radio" name="term-3-in" value="inurl"> inUrl</input>
</label>
<label class="radio inline">
<input type="radio" name="term-3-in" value="intitle"> inTitle</input>
</label>
<label class="radio inline">
<input type="radio" name="term-3-in" value="inanchor"> inAnchor</input>
</label>
<label class="radio inline">
<input type="radio" name="term-3-in" value="inpostauthor"> inPostAuthor</input>
</label>
<label class="radio inline">
<input type="radio" name="term-3-in" value="none" class="radiogroup-default"> None</input>
</label>
</div>
</div>
<div class="control-group" id="filetype">
<label class="control-label" for="filetype">Filetype</label>
<div class="controls">
<input type="text" name="filetype" placeholder="Filetype">
</div>
</div>
<div class="control-group" id="tld">
<label class="control-label" for="tld">TLD</label>
<div class="controls">
<label class="radio inline">
<input type="radio" name="tld" value="com"> .com</input>
</label>
<label class="radio inline">
<input type="radio" name="tld" value="net"> .net</input>
</label>
<label class="radio inline">
<input type="radio" name="tld" value="org"> .org</input>
</label>
<label class="radio inline">
<input type="radio" name="tld" value="gov"> .gov</input>
</label>
<label class="radio inline">
<input type="radio" name="tld" value="edu"> .edu</input>
</label>
<label class="radio inline">
<input type="radio" name="tld" value="any" class="radiogroup-default"> No preference</input>
</label>
</div>
</div>
<div class="control-group" id="negative-keywords">
<label class="control-label" for="negative-keywords">Negative keywords</label>
<div class="controls">
<input type="text" name="negative-keywords" placeholder="Separate with commas"><br />
<label class="radio inline">
<input type="radio" name="negative-match" value="exact"> Exact match</input>
</label>
<label class="radio inline">
<input type="radio" name="negative-match" value="broad" class="radiogroup-default"> Broad match</input>
</label><br>
<label class="radio inline">
<input type="radio" name="negative-in" value="inurl"> inUrl</input>
</label>
<label class="radio inline">
<input type="radio" name="negative-in" value="intitle"> inTitle</input>
</label>
<label class="radio inline">
<input type="radio" name="negative-in" value="inanchor"> inAnchor</input>
</label>
<label class="radio inline">
<input type="radio" name="negative-in" value="inpostauthor"> inPostAuthor</input>
</label>
<label class="radio inline">
<input type="radio" name="negative-in" value="none" class="radiogroup-default"> None</input>
</label>
</div>
</div>
<div class="control-group" id="andor">
<div class="controls">
<label class="radio">
<input type="radio" name="andor" value="or"> Add OR between terms?</input>
</label>
<label class="radio">
<input type="radio" name="andor" value="none" class="radiogroup-default"> None</input>
</label>
</div>
</div>
<div class="control-group">
<div class="controls">
<button type="button" id="submit" class="btn btn-primary" onclick="getQuery('<?php echo $generator_url; ?>');">Submit</button>
<button type="button" id="clear" class="btn btn-danger" onclick="clearForm();">Clear</button>
</div>
</div>
</fieldset>
</form>
<?php
}
function show_output_modal() {
?>
<div id="output-modal" class="modal hide">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h3 id="output-modal-label">Generated Query</label>
</div>
<div class="modal-body">
<span id="query-output"></span>
</div>
<div class="modal-footer">
<button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
<?php
}