-
Notifications
You must be signed in to change notification settings - Fork 1
/
config_form.php
217 lines (213 loc) · 6.5 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
<?php
$view = get_view();
$dateFields = array('Date', 'Date Available', 'Date Created', 'Date Accepted', 'Date Copyrighted', 'Date Submitted', 'Date Issued', 'Date Modified', 'Date Valid');
?>
<style type = "text/css">
.boxes, .boxes-left, .boxes-nowrap {
vertical-align: middle;
}
.boxes, .boxes-nowrap {
text-align: center;
}
.boxes-nowrap {
white-space: nowrap;
}
.boxes input {
margin-bottom: 0;
text-align: right;
width: 5em!important;
}
</style>
<div class="field">
<div class="two columns alpha">
<?php echo $view->formLabel('related_content_limit', __('Items Limit')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php echo __('The maximum amount of related Items to be suggested.'); ?>
</p>
<?php echo $view->formText('related_content_limit', get_option('related_content_limit')); ?>
</div>
</div>
<div class="field">
<div class="two columns alpha">
<?php echo $view->formLabel('related_content_square_thumbnails', __('Use Square Thumbnails')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php echo __('If checked, cropped square thumbnails are displayed.'); ?>
</p>
<?php echo $view->formCheckbox('related_content_square_thumbnails', get_option('related_content_square_thumbnails'), null, array('1', '0')); ?>
</div>
</div>
<div class="field">
<div class="two columns alpha">
<?php echo $view->formLabel('related_content_short_date', __('Use Short Date')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php echo __('If checked, just the year (first 4 digits) will be considered for date similarity.'); ?>
</p>
<?php echo $view->formCheckbox('related_content_short_date', get_option('related_content_short_date'), null, array('1', '0')); ?>
</div>
</div>
<div class="field">
<div class="two columns alpha">
<?php echo $view->formLabel('related_content_criteria', __('Criteria')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php echo __('The search criterias\'s relative weights (if blank, criteria will not be considered) and constraint rule. See plugin\'s documentation for detailed instructions.'); ?>
</p>
<table id="related_content-table">
<thead>
<tr>
<th class="boxes-nowrap"><?php echo __('Criterion'); ?></th>
<th class="boxes"><?php echo __('Weight'); ?></th>
<th class="boxes"><?php echo __('Constraint'); ?></th>
<th class="boxes-nowrap"><?php echo __('Is Date'); ?></th>
</tr>
</thead>
<tbody>
<?php
$current_element_set = null;
foreach ($elements as $element):
if ($element->set_name != $current_element_set):
$current_element_set = $element->set_name;
?>
<tr>
<th colspan="4">
<strong><?php echo __($current_element_set); ?></strong>
</th>
</tr>
<?php endif; ?>
<tr>
<td class="boxes-left"><?php echo __($element->name); ?></td>
<td class="boxes">
<?php echo $view->formText(
"criteria[elements][{$element->id}][weight]",
isset($criteria['elements'][$element->id]['weight']) ? $criteria['elements'][$element->id]['weight'] : ''
); ?>
</td>
<td class="boxes">
<?php echo $view->formCheckbox(
"criteria[elements][{$element->id}][constraint]",
'1',
array(
'disableHidden' => true,
'checked' => isset($criteria['elements'][$element->id]['constraint'])
)
); ?>
</td>
<td class="boxes">
<?php echo $view->formCheckbox(
"criteria[elements][{$element->id}][isDate]",
'1',
array(
'disableHidden' => true,
'checked' => (($element->set_name == "Dublin Core" && in_array($element->name, $dateFields)) || isset($criteria['elements'][$element->id]['isDate'])),
'disable' => ($element->set_name == "Dublin Core" && in_array($element->name, $dateFields))
)
); ?>
</td>
</tr>
<?php endforeach; ?>
<tr>
<th colspan="4">
<strong><?php echo __('Other criteria'); ?></strong>
</th>
</tr>
<tr>
<td class="boxes-left"><?php echo __('Item Type'); ?></td>
<td class="boxes">
<?php echo $view->formText(
"criteria[item type][weight]",
$criteria['item type']['weight']
); ?>
</td>
<td class="boxes">
<?php echo $view->formCheckbox(
"criteria[item type][constraint]",
'1',
array(
'disableHidden' => true,
'checked' => isset($criteria['item type']['constraint'])
)
); ?>
</td>
<td class="boxes">
<?php echo $view->formCheckbox(
"criteria[item type][isDate]",
'1',
array(
'disableHidden' => true,
'checked' => (isset($criteria['item type']['isDate'])),
'disable' => true
)
); ?>
</td>
</tr>
<tr>
<td><?php echo __('Collection'); ?></td>
<td class="boxes">
<?php echo $view->formText(
"criteria[collection][weight]",
$criteria['collection']['weight']
); ?>
</td>
<td class="boxes">
<?php echo $view->formCheckbox(
"criteria[collection][constraint]",
'1',
array(
'disableHidden' => true,
'checked' => isset($criteria['collection']['constraint'])
)
); ?>
</td>
<td class="boxes">
<?php echo $view->formCheckbox(
"criteria[collection][isDate]",
'1',
array(
'disableHidden' => true,
'checked' => (isset($criteria['collection']['isDate'])),
'disable' => true
)
); ?>
</td>
</tr>
<tr>
<td><?php echo __('Tags'); ?></td>
<td class="boxes">
<?php echo $view->formText(
"criteria[tags][weight]",
$criteria['tags']['weight']
); ?>
</td>
<td class="boxes">
<?php echo $view->formCheckbox(
"criteria[tags][constraint]",
'1',
array(
'disableHidden' => true,
'checked' => isset($criteria['tags']['constraint'])
)
); ?>
</td>
<td class="boxes">
<?php echo $view->formCheckbox(
"criteria[tags][isDate]",
'1',
array(
'disableHidden' => true,
'checked' => (isset($criteria['tags']['isDate'])),
'disable' => true
)
); ?>
</td>
</tr>
</tbody>
</table>
</div>
</div>