-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig_form.php
317 lines (300 loc) · 16.2 KB
/
config_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
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
<?php
$language_page_statement = get_option('default_language_page_statement');
$contributor_page_statement = get_option('default_contributor_page_statement');
$coverage_page_statement = get_option('default_coverage_page_statement');
$creator_page_statement = get_option('default_creator_page_statement');
$date_page_statement = get_option('default_date_page_statement');
$description_page_statement = get_option('default_description_page_statement');
$format_page_statement = get_option('default_format_page_statement');
$identifier_page_statement = get_option('default_identifier_page_statement');
$publisher_page_statement = get_option('default_publisher_page_statement');
$relation_page_statement = get_option('default_relation_page_statement');
$rights_page_statement = get_option('default_rights_page_statement');
$source_page_statement = get_option('default_source_page_statement');
$subject_page_statement = get_option('default_subject_page_statement');
$title_page_statement = get_option('default_title_page_statement');
$type_page_statement = get_option('default_type_page_statement');
$view = get_view();
?>
<div class="field">
<h3>Default Contributor</h3>
<div class="inputs">
<div class="input-block">
<div class="input">
<?php echo $view->formTextarea('contributor_page_statement', $contributor_page_statement, array('rows' => '3', 'cols' => '50', 'class' => array('textinput'))); ?>
</div>
<label class="use-html">Use HTML
<input type="hidden" name="contributor_page_statement-html" value="0">
<input type="checkbox" name="contributor_page_statement-html" id="contributor_page_statement-html" value="1" class="use-html-checkbox" <?php if($this->isHTML(get_option('default_contributor_page_statement'))):?>checked="checked" <?php endif;?>>
</label>
<p class="explanation">
Add or edit this Contributor entry. This will be added to the Dublin Core Contributor field automatically when a new or exising record is saved, but if and only if that field is empty.
</p>
</div>
</div>
</div>
<div class="field">
<h3>Default Coverage</h3>
<div class="inputs">
<div class="input-block">
<div class="input">
<?php echo $view->formTextarea('coverage_page_statement', $coverage_page_statement, array('rows' => '3', 'cols' => '50', 'class' => array('textinput'))); ?>
</div>
<label class="use-html">Use HTML
<input type="hidden" name="coverage_page_statement-html" value="0">
<input type="checkbox" name="coverage_page_statement-html" id="coverage_page_statement-html" value="1" class="use-html-checkbox" <?php if($this->isHTML(get_option('default_coverage_page_statement'))):?>checked="checked" <?php endif;?>>
</label>
<p class="explanation">
Add or edit this Coverage entry. This will be added to the Dublin Core Coverage field automatically when a new or exising record is saved, but if and only if that field is empty. Consult http://www.getty.edu/research/tools/vocabularies/tgn/index.html for help with geographic names.
</p>
</div>
</div>
</div>
<div class="field">
<h3>Default Creator</h3>
<div class="inputs">
<div class="input-block">
<div class="input">
<?php echo $view->formTextarea('creator_page_statement', $creator_page_statement, array('rows' => '3', 'cols' => '50', 'class' => array('textinput'))); ?>
</div>
<label class="use-html">Use HTML
<input type="hidden" name="creator_page_statement-html" value="0">
<input type="checkbox" name="creator_page_statement-html" id="creator_page_statement-html" value="1" class="use-html-checkbox" <?php if($this->isHTML(get_option('default_creator_page_statement'))):?>checked="checked" <?php endif;?>>
</label>
<p class="explanation">
Add or edit this Creator entry. This will be added to the Dublin Core Creator field automatically when a new or exising record is saved, but if and only if that field is empty.
</p>
</div>
</div>
</div>
<div class="field">
<h3>Default Date</h3>
<div class="inputs">
<div class="input-block">
<div class="input">
<?php echo $view->formTextarea('date_page_statement', $date_page_statement, array('rows' => '3', 'cols' => '50', 'class' => array('textinput'))); ?>
</div>
<label class="use-html">Use HTML
<input type="hidden" name="date_page_statement-html" value="0">
<input type="checkbox" name="date_page_statement-html" id="date_page_statement-html" value="1" class="use-html-checkbox" <?php if($this->isHTML(get_option('default_date_page_statement'))):?>checked="checked" <?php endif;?>>
</label>
<p class="explanation">
Add or edit this Date entry. This will be added to the Dublin Core Date field automatically when a new or exising record is saved, but if and only if that field is empty. Consulte https://www.w3.org/TR/NOTE-datetime for help with standard date formats.
</p>
</div>
</div>
</div>
<div class="field">
<h3>Default Description</h3>
<div class="inputs">
<div class="input-block">
<div class="input">
<?php echo $view->formTextarea('description_page_statement', $description_page_statement, array('rows' => '3', 'cols' => '50', 'class' => array('textinput'))); ?>
</div>
<label class="use-html">Use HTML
<input type="hidden" name="description_page_statement-html" value="0">
<input type="checkbox" name="description_page_statement-html" id="description_page_statement-html" value="1" class="use-html-checkbox" <?php if($this->isHTML(get_option('default_description_page_statement'))):?>checked="checked" <?php endif;?>>
</label>
<p class="explanation">
Add or edit this Description entry. This will be added to the Dublin Core Description field automatically when a new or exising record is saved, but if and only if that field is empty.
</p>
</div>
</div>
</div>
<div class="field">
<h3>Default Format</h3>
<div class="inputs">
<div class="input-block">
<div class="input">
<?php echo $view->formTextarea('format_page_statement', $format_page_statement, array('rows' => '3', 'cols' => '50', 'class' => array('textinput'))); ?>
</div>
<label class="use-html">Use HTML
<input type="hidden" name="format_page_statement-html" value="0">
<input type="checkbox" name="format_page_statement-html" id="format_page_statement-html" value="1" class="use-html-checkbox" <?php if($this->isHTML(get_option('default_format_page_statement'))):?>checked="checked" <?php endif;?>>
</label>
<p class="explanation">
Add or edit this Format entry. This will be added to the Dublin Core Format field automatically when a new or exising record is saved, but if and only if that field is empty. Consult https://www.iana.org/assignments/media-types/media-types.xhtml for help with media types.
</p>
</div>
</div>
</div>
<div class="field">
<h3>Default Identifier</h3>
<div class="inputs">
<div class="input-block">
<div class="input">
<?php echo $view->formTextarea('identifier_page_statement', $identifier_page_statement, array('rows' => '3', 'cols' => '50', 'class' => array('textinput'))); ?>
</div>
<label class="use-html">Use HTML
<input type="hidden" name="identifier_page_statement-html" value="0">
<input type="checkbox" name="identifier_page_statement-html" id="identifier_page_statement-html" value="1" class="use-html-checkbox" <?php if($this->isHTML(get_option('default_identifier_page_statement'))):?>checked="checked" <?php endif;?>>
</label>
<p class="explanation">
Add or edit this Identifier entry. This will be added to the Dublin Core Identifier field automatically when a new or exising record is saved, but if and only if that field is empty.
</p>
</div>
</div>
</div>
<div class="field">
<h3>Default Language</h3>
<div class="inputs">
<div class="input-block">
<div class="input">
<?php echo $view->formTextarea('language_page_statement', $language_page_statement, array('rows' => '3', 'cols' => '50', 'class' => array('textinput'))); ?>
</div>
<label class="use-html">Use HTML
<input type="hidden" name="language_page_statement-html" value="0">
<input type="checkbox" name="language_page_statement-html" id="language_page_statement-html" value="1" class="use-html-checkbox" <?php if($this->isHTML(get_option('default_language_page_statement'))):?>checked="checked" <?php endif;?>>
</label>
<p class="explanation">
Add or edit this Language entry. This will be added to the Dublin Core Language field automatically when a new or exising record is saved, but if and only if that field is empty. Consult https://www.ietf.org/rfc/rfc4646.txt for help with language standards.
</p>
</div>
</div>
</div>
<div class="field">
<h3>Default Publisher</h3>
<div class="inputs">
<div class="input-block">
<div class="input">
<?php echo $view->formTextarea('publisher_page_statement', $publisher_page_statement, array('rows' => '3', 'cols' => '50', 'class' => array('textinput'))); ?>
</div>
<label class="use-html">Use HTML
<input type="hidden" name="publisher_page_statement-html" value="0">
<input type="checkbox" name="publisher_page_statement-html" id="publisher_page_statement-html" value="1" class="use-html-checkbox" <?php if($this->isHTML(get_option('default_publisher_page_statement'))):?>checked="checked" <?php endif;?>>
</label>
<p class="explanation">
Add or edit this Publisher entry. This will be added to the Dublin Core Publisher field automatically when a new or exising record is saved, but if and only if that field is empty.
</p>
</div>
</div>
</div>
<div class="field">
<h3>Default Relation</h3>
<div class="inputs">
<div class="input-block">
<div class="input">
<?php echo $view->formTextarea('relation_page_statement', $relation_page_statement, array('rows' => '3', 'cols' => '50', 'class' => array('textinput'))); ?>
</div>
<label class="use-html">Use HTML
<input type="hidden" name="relation_page_statement-html" value="0">
<input type="checkbox" name="relation_page_statement-html" id="relation_page_statement-html" value="1" class="use-html-checkbox" <?php if($this->isHTML(get_option('default_relation_page_statement'))):?>checked="checked" <?php endif;?>>
</label>
<p class="explanation">
Add or edit this Relation entry. This will be added to the Dublin Core Relation field automatically when a new or exising record is saved, but if and only if that field is empty.
</p>
</div>
</div>
</div>
<div class="field">
<h3>Default Rights</h3>
<div class="inputs">
<div class="input-block">
<div class="input">
<?php echo $view->formTextarea('rights_page_statement', $rights_page_statement, array('rows' => '3', 'cols' => '50', 'class' => array('textinput'))); ?>
</div>
<label class="use-html">Use HTML
<input type="hidden" name="rights_page_statement-html" value="0">
<input type="checkbox" name="rights_page_statement-html" id="rights_page_statement-html" value="1" class="use-html-checkbox" <?php if($this->isHTML(get_option('default_rights_page_statement'))):?>checked="checked" <?php endif;?>>
</label>
<p class="explanation">
Add or edit this Rights entry. This will be added to the Dublin Core Rights field automatically when a new or exising record is saved, but if and only if that field is empty.
</p>
</div>
</div>
</div>
<div class="field">
<h3>Default Source</h3>
<div class="inputs">
<div class="input-block">
<div class="input">
<?php echo $view->formTextarea('source_page_statement', $source_page_statement, array('rows' => '3', 'cols' => '50', 'class' => array('textinput'))); ?>
</div>
<label class="use-html">Use HTML
<input type="hidden" name="source_page_statement-html" value="0">
<input type="checkbox" name="source_page_statement-html" id="source_page_statement-html" value="1" class="use-html-checkbox" <?php if($this->isHTML(get_option('default_source_page_statement'))):?>checked="checked" <?php endif;?>>
</label>
<p class="explanation">
Add or edit this Source entry. This will be added to the Dublin Core Source field automatically when a new or exising record is saved, but if and only if that field is empty.
</p>
</div>
</div>
</div>
<div class="field">
<h3>Default Subject</h3>
<div class="inputs">
<div class="input-block">
<div class="input">
<?php echo $view->formTextarea('subject_page_statement', $subject_page_statement, array('rows' => '3', 'cols' => '50', 'class' => array('textinput'))); ?>
</div>
<label class="use-html">Use HTML
<input type="hidden" name="subject_page_statement-html" value="0">
<input type="checkbox" name="subject_page_statement-html" id="subject_page_statement-html" value="1" class="use-html-checkbox" <?php if($this->isHTML(get_option('default_subject_page_statement'))):?>checked="checked" <?php endif;?>>
</label>
<p class="explanation">
Add or edit this Subject entry. This will be added to the Dublin Core Subject field automatically when a new or exising record is saved, but if and only if that field is empty.
</p>
</div>
</div>
</div>
<div class="field">
<h3>Default Title</h3>
<div class="inputs">
<div class="input-block">
<div class="input">
<?php echo $view->formTextarea('title_page_statement', $title_page_statement, array('rows' => '3', 'cols' => '50', 'class' => array('textinput'))); ?>
</div>
<label class="use-html">Use HTML
<input type="hidden" name="title_page_statement-html" value="0">
<input type="checkbox" name="title_page_statement-html" id="title_page_statement-html" value="1" class="use-html-checkbox" <?php if($this->isHTML(get_option('default_title_page_statement'))):?>checked="checked" <?php endif;?>>
</label>
<p class="explanation">
Add or edit this Title entry. This will be added to the Dublin Core Title field automatically when a new or exising record is saved, but if and only if that field is empty.
</p>
</div>
</div>
</div>
<div class="field">
<h3>Default Type</h3>
<div class="inputs">
<div class="input-block">
<div class="input">
<?php echo $view->formTextarea('type_page_statement', $type_page_statement, array('rows' => '3', 'cols' => '50', 'class' => array('textinput'))); ?>
</div>
<label class="use-html">Use HTML
<input type="hidden" name="type_page_statement-html" value="0">
<input type="checkbox" name="type_page_statement-html" id="type_page_statement-html" value="1" class="use-html-checkbox" <?php if($this->isHTML(get_option('default_type_page_statement'))):?>checked="checked" <?php endif;?>>
</label>
<p class="explanation">
Add or edit this Type entry. This will be added to the Dublin Core Type field automatically when a new or exising record is saved, but if and only if that field is empty. Consulte http://dublincore.org/documents/dcmi-type-vocabulary/ for type vocabulary.
</p>
</div>
</div>
</div>
<script>
jQuery( document ).ready(function() {
Omeka.wysiwyg({
selector: false,
menubar: 'edit view insert format table',
plugins: 'lists link code paste media autoresize image table charmap hr',
browser_spellcheck: true
});
var inputs = jQuery(document).find('div.inputs .use-html-checkbox');
inputs.each(function () {
var textarea = jQuery(this).parents('.input-block').find('textarea');
if (textarea.length) {
var textareaId = textarea.attr('id');
var enableIfChecked = function () {
if (this.checked) {
tinyMCE.EditorManager.execCommand("mceAddEditor", true, textareaId);
} else {
tinyMCE.EditorManager.execCommand("mceRemoveEditor", true, textareaId);
}
};
enableIfChecked.call(this);
// Whenever the checkbox is toggled, toggle the WYSIWYG editor.
jQuery(this).click(enableIfChecked);
}
});
});
</script>