-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig_form.php
113 lines (102 loc) · 5.11 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
<div class="field">
<div class="two columns alpha">
<?php echo get_view()->formLabel('date_search_use_gregjul_prefixes', __('Use Gregorian / Julian Prefixes')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php
echo __('Check this if you want to use [G] / [J] prefixes to indicate that a date '
.'is meant to be specifying a Gregorian or a Julian date or timespan.');
?>
</p>
<?php echo get_view()->formRadio('date_search_use_gregjul_prefixes', $useGregJulPrefixes, array(), array(0 => __("no"), 1 => __("yes") ,2 => __("optional")) ); ?>
</div>
<div class="two columns alpha">
<?php echo get_view()->formLabel('date_search_search_all_fields', __('Scan All Text Fields')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php
echo __('Check this if you want date / timespan processing to be carried out within all of an item\'s text fields.');
?>
</p>
<?php echo get_view()->formCheckbox('date_search_search_all_fields', null, array('checked' => $searchAllFields)); ?>
</div>
<div id="shownHiddenSeachAll">
<div class="two columns alpha">
<?php echo get_view()->formLabel('date_search_limit_fields', __('Limit Scan to Fields')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php
echo __('Please select the elements i.e. fields that the scan for dates should be limited to.<br>'.
'<em>Please note:</em> To select multiple entries, try holding '.
'the Ctrl key (Windows) or the Cmd key (Mac) while clicking.');
?>
</p>
<?php echo get_view()->formSelect('date_search_limit_fields', $LimitFields, array('multiple' => true, 'size' => 10), $searchElements); ?>
</div>
<?php if ($withRelComments): ?>
<div class="two columns alpha">
<?php echo get_view()->formLabel('date_search_search_rel_comments', __('Scan Inside Relationship Comments')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php
echo __('The Item Relationships add-on is installed, and it has been patched to feature relationship comments. '.
'Check this if you want Date Search to scan inside relationship comments.');
?>
</p>
<?php echo get_view()->formCheckbox('date_search_search_rel_comments', null, array('checked' => $searchRelComments)); ?>
</div>
<?php else: ?>
<input type="hidden" name="date_search_search_rel_comments" id="date_search_search_rel_comments" value="<?php echo $searchRelComments; ?>">
<?php endif;?>
</div>
<script type="text/javascript">
// <!--
jQuery(document).ready(function() {
var $ = jQuery; // use noConflict version of jQuery as the short $ within this block
showHideShownHiddenSearchAll();
$("input[name=date_search_use_gregjul_prefixes]:radio").change(function () { activateReindexCheckbox(); } );
$("#date_search_search_all_fields").change( function() { showHideShownHiddenSearchAll(); activateReindexCheckbox(); } );
$("#date_search_limit_fields").change( function() { activateReindexCheckbox(); } );
$("#date_search_search_rel_comments").change( function() { activateReindexCheckbox(); } );
function showHideShownHiddenSearchAll() {
var searchAllPreset = $("#date_search_search_all_fields").is(":checked");
// alert("foo: "+searchAllPreset);
if (searchAllPreset) { $("#shownHiddenSeachAll").slideUp(); } else { $("#shownHiddenSeachAll").slideDown(); }
}
function activateReindexCheckbox() { $("#date_search_trigger_reindex").prop('checked', true); }
} );
// -->
</script>
<hr>
<div class="two columns alpha">
<?php echo get_view()->formLabel('date_search_trigger_reindex', __('Trigger Re-indexing of Existing Content')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php
echo __('<strong>Please note:</strong> Checking this box will re-generate the index <em>now</em> and '.
'exactly <em>once</em>. This action will be carried out as soon as you click on "Save Changes".');
?>
</p>
<?php echo get_view()->formCheckbox('date_search_trigger_reindex', null, array('checked' => false)); ?>
<p class="explanation">
<?php
echo __('<em>Explanation:</em> Date Search relies on a search index that is being created during content'.
' maintenance in the background. However, existing content will not be re-indexed automatically. '.
'So if you have existing content or modify your settings, you should re-generate the search index.');
?>
</p>
</div>
<?php if (isset($debugOutput)) { ?>
<div class="two columns alpha">
<?php echo get_view()->formLabel('date_search_debug_output', __('Debug Output')); ?>
</div>
<div class="inputs five columns omega">
<?php echo get_view()->formCheckbox('date_search_debug_output', null, array('checked' => $debugOutput)); ?>
</div>
<?php } ?>
</div>