forked from wp-plugins/dsidxpress
/
widget-idx-guided-search.php
437 lines (394 loc) · 20.4 KB
/
widget-idx-guided-search.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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
<?php
add_action('wp_head', array('dsSearchAgent_IdxGuidedSearchWidget', 'LoadScripts'), 100);
class dsSearchAgent_IdxGuidedSearchWidget extends WP_Widget {
function dsSearchAgent_IdxGuidedSearchWidget() {
$this->WP_Widget("dsidx-search", "IDX Guided Search", array(
"classname" => "dsidx-widget-guided-search",
"description" => "Allow users to search from a curated list of cities, communites, tracts and/or zip codes."
));
}
public static function LoadScripts(){
dsidxpress_autocomplete::AddScripts(true);
}
function widget($args, $instance) {
extract($args);
extract($instance);
$title = apply_filters("widget_title", $title);
$options = get_option(DSIDXPRESS_OPTION_NAME);
if (!$options["Activated"])
return;
$pluginUrl = plugins_url() . '/dsidxpress/';
wp_enqueue_script('dsidxpress_widget_search_view', $pluginUrl . 'js/widget-client.js', array('jquery'), DSIDXPRESS_PLUGIN_VERSION, true);
$formAction = get_home_url() . "/idx/";
$capabilities = dsSearchAgent_ApiRequest::FetchData('MlsCapabilities');
$capabilities = json_decode($capabilities['body'], true);
$defaultSearchPanels = dsSearchAgent_ApiRequest::FetchData("AccountSearchPanelsDefault", array(), false, 60 * 60 * 24);
$defaultSearchPanels = $defaultSearchPanels["response"]["code"] == "200" ? json_decode($defaultSearchPanels["body"]) : null;
$propertyTypes = dsSearchAgent_ApiRequest::FetchData("AccountSearchSetupFilteredPropertyTypes", array(), false, 60 * 60 * 24);
$propertyTypes = $propertyTypes["response"]["code"] == "200" ? json_decode($propertyTypes["body"]) : null;
$account_options = dsSearchAgent_ApiRequest::FetchData("AccountOptions", array(), false);
$account_options = $account_options["response"]["code"] == "200" ? json_decode($account_options["body"]) : null;
$values =array();
$values['idx-q-Locations'] = isset($_GET['idx-q-Locations']) ? $_GET['idx-q-Locations'] : null;
$values['idx-q-PropertyTypes'] = isset($_GET['idx-q-PropertyTypes']) ? $_GET['idx-q-PropertyTypes'] : null;
$values['idx-q-Cities'] = isset($_GET['idx-q-Cities']) ? $_GET['idx-q-Cities'] : null;
$values['idx-q-Communities'] = isset($_GET['idx-q-Communities']) ? $_GET['idx-q-Communities'] : null;
$values['idx-q-TractIdentifiers'] = isset($_GET['idx-q-TractIdentifiers']) ? $_GET['idx-q-TractIdentifiers'] : null;
$values['idx-q-ZipCodes'] = isset($_GET['idx-q-ZipCodes']) ? $_GET['idx-q-ZipCodes'] : null;
$values['idx-q-PriceMin'] = isset($_GET['idx-q-PriceMin']) ? $_GET['idx-q-PriceMin'] : null;
$values['idx-q-PriceMax'] = isset($_GET['idx-q-PriceMax']) ? $_GET['idx-q-PriceMax'] : null;
$values['idx-q-BedsMin'] = isset($_GET['idx-q-BedsMin']) ? $_GET['idx-q-BedsMin'] : null;
$values['idx-q-BathsMin'] = isset($_GET['idx-q-BathsMin']) ? $_GET['idx-q-BathsMin'] : null;
$values['idx-q-ImprovedSqFtMin'] = isset($_GET['idx-q-ImprovedSqFtMin']) ? $_GET['idx-q-ImprovedSqFtMin'] : null;
$values['idx-q-MlsNumbers'] = isset($_GET['idx-q-MlsNumbers']) ? $_GET['idx-q-MlsNumbers'] : null;
$specialSlugs = array(
'city' => 'idx-q-Cities',
'community' => 'idx-q-Communities',
'tract' => 'idx-q-TractIdentifiers',
'zip' => 'idx-q-ZipCodes'
);
$urlParts = explode('/', $_SERVER['REQUEST_URI']);
$count = 0;
foreach($urlParts as $p){
if(array_key_exists($p, $specialSlugs) && isset($urlParts[$count + 1])){
$values[$specialSlugs[$p]] = $urlParts[$count + 1];
}
$count++;
}
echo $before_widget;
if ($title)
echo $before_title . $title . $after_title;
echo <<<HTML
<div class="dsidx-resp-search-box dsidx-widget dsidx-resp-vertical">
<label id="idx-search-invalid-msg" style="color:red"></label>
<form class="dsidx-resp-search-form" action="{$formAction}" method="get" onsubmit="return dsidx_w.searchWidget.validate();" >
<fieldset>
<div class="dsidx-resp-area">
<label>Property Type</label>
<select name="idx-q-PropertyTypes" class="dsidx-search-widget-propertyTypes">
<option value="">Any</option>
HTML;
if (is_array($propertyTypes)) {
foreach ($propertyTypes as $propertyType) {
$name = htmlentities($propertyType->DisplayName);
$selected = $propertyType->SearchSetupPropertyTypeID == $values['idx-q-PropertyTypes']?' selected="selected"':'';
echo "<option value=\"{$propertyType->SearchSetupPropertyTypeID}\"{$selected}>{$name}</option>";
}
}
echo <<<HTML
</select>
</div>
<div class="dsidx-resp-area">
HTML;
if ($searchOptions['show_cities'] == 'yes' && !empty($searchOptions['cities'])) {
echo <<<HTML
<label>City</label>
<select id="idx-q-Cities" name="idx-q-Cities" class="idx-q-Location-Filter">
<option value="">Any</option>
HTML;
foreach ($searchOptions["cities"] as $city) {
// there's an extra trim here in case the data was corrupted before the trim was added in the update code below
$city = htmlentities(trim($city));
$selected = strtolower($city) == strtolower($values['idx-q-Cities'])?' selected="selected"':'';
echo "<option value=\"{$city}\"{$selected}>{$city}</option>";
}
echo '</select>';
echo '</div>';
}
if($searchOptions['show_communities'] == 'yes' && !empty($searchOptions['communities'])) {
echo <<<HTML
<div class="dsidx-resp-area">
<label>Community</label>
<select id="idx-q-Communities" name="idx-q-Communities" class="idx-q-Location-Filter">
<option value="">Any</option>
HTML;
foreach ($searchOptions['communities'] as $community) {
// there's an extra trim here in case the data was corrupted before the trim was added in the update code below
$community = htmlentities(trim($community));
$selected = strtolower($community) == strtolower($values['idx-q-Communities'])?' selected="selected"':'';
echo "<option value=\"{$community}\"{$selected}>{$community}</option>";
}
echo '</select>';
echo '</div>';
}
if($searchOptions['show_tracts'] == 'yes' && !empty($searchOptions['tracts'])) {
echo <<<HTML
<div class="dsidx-resp-area">
<label>Tract</label>
<select id="idx-q-TractIdentifiers" name="idx-q-TractIdentifiers" class="idx-q-Location-Filter">
<option value="">Any</option>
HTML;
foreach ($searchOptions["tracts"] as $tract) {
// there's an extra trim here in case the data was corrupted before the trim was added in the update code below
$tract = htmlentities(trim($tract));
$selected = strtolower($tract) == strtolower($values['idx-q-TractIdentifiers']) ? ' selected="selected"' : '';
echo "<option value=\"{$tract}\"{$selected}>{$tract}</option>";
}
echo '</select>';
echo '</div>';
}
if($searchOptions['show_zips'] == 'yes' && !empty($searchOptions['zips'])) {
echo <<<HTML
<div class="dsidx-resp-area">
<label>Zip</label>
<select id="idx-q-ZipCodes" name="idx-q-ZipCodes" class="idx-q-Location-Filter">
<option value="">Any</option>
HTML;
foreach ($searchOptions["zips"] as $zip) {
// there's an extra trim here in case the data was corrupted before the trim was added in the update code below
$zip = htmlentities(trim($zip));
$selected = strtolower($zip) == strtolower($values['idx-q-ZipCodes']) ? ' selected="selected"' : '';
echo "<option value=\"{$zip}\"{$selected}>{$zip}</option>";
}
echo '</select>';
echo '</div>';
}
if($searchOptions["show_mlsnumber"] == "yes") {
echo <<<HTML
<div class="dsidx-resp-area">
<label for="idx-q-MlsNumbers">MLS #</label>
<input id="idx-q-MlsNumbers" name="idx-q-MlsNumbers" type="text" class="dsidx-mlsnumber" value="{$values['idx-q-MlsNumbers']}" />
</div>
HTML;
}
echo <<<HTML
<div class="dsidx-resp-area dsidx-resp-area-half dsidx-resp-area-half dsidx-resp-area-left">
<label for="idx-q-PriceMin">Price From</label>
<input id="idx-q-PriceMin" name="idx-q-PriceMin" type="text" class="dsidx-price" placeholder="Any" value="{$values['idx-q-PriceMin']}" />
</div>
<div class="dsidx-resp-area dsidx-resp-area-half dsidx-resp-area-half dsidx-resp-area-right">
<label for="idx-q-PriceMin">To</label>
<input id="idx-q-PriceMax" name="idx-q-PriceMax" type="text" class="dsidx-price" placeholder="Any" value="{$values['idx-q-PriceMax']}" />
</div>
HTML;
echo <<<HTML
<div class="dsidx-resp-area dsidx-resp-min-baths-area dsidx-resp-area-half dsidx-resp-area-left">
<label for="idx-q-BedsMin">Beds</label>
<select id="idx-q-BedsMin" name="idx-q-BedsMin" class="dsidx-beds">
<option value="">Any</option>
HTML;
for($i=1; $i<=9; $i++){
$selected = $i == $values['idx-q-BedsMin']?' selected="selected"':'';
echo '<option value="'.$i.'"'.$selected.'>'.$i.'+</option>';
}
echo <<<HTML
</select>
</div>
<div class="dsidx-resp-area dsidx-resp-min-baths-area dsidx-resp-area-half dsidx-resp-area-right">
<label for="idx-q-BathsMin">Baths</label>
<select id="idx-q-BathsMin" name="idx-q-BathsMin" class="dsidx-baths">
<option value="">Any</option>
HTML;
for($i=1; $i<=9; $i++){
$selected = $i == $values['idx-q-BathsMin']?' selected="selected"':'';
echo '<option value="'.$i.'"'.$selected.'>'.$i.'+</option>';
}
echo <<<HTML
</select>
</div>
HTML;
if(isset($defaultSearchPanels)){
foreach ($defaultSearchPanels as $key => $value) {
if ($value->DomIdentifier == "search-input-home-size" && isset($capabilities['MinImprovedSqFt']) && $capabilities['MinImprovedSqFt'] > 0) {
echo <<<HTML
<div class="dsidx-resp-area">
<label for="idx-q-ImprovedSqFtMin">Min Sqft</label>
<input id="idx-q-ImprovedSqFtMin" name="idx-q-ImprovedSqFtMin" type="text" class="dsidx-improvedsqft" placeholder="Any" value="{$values['idx-q-ImprovedSqFtMin']}" />
</div>
HTML;
break;
}
}
}
echo <<<HTML
<div class="dsidx-resp-area dsidx-resp-area-submit">
<label for="idx-q-PriceMin"> </label>
<input type="submit" class="submit" value="Search for properties" />
</div>
HTML;
if($options["HasSearchAgentPro"] == "yes" && $searchOptions["show_advanced"] == "yes"){
echo <<<HTML
<div style="float: right;">
try our <a href="{$formAction}advanced/"><img src="{$pluginUrl}assets/adv_search-16.png" /> Advanced Search</a>
</div>
HTML;
}
if($account_options->EulaLink){
$eula_url = $account_options->EulaLink;
echo <<<HTML
<p>By searching, you agree to the <a href="{$eula_url}" target="_blank">EULA</a></p>
HTML;
}
echo <<<HTML
</fieldset>
</form>
</div>
HTML;
echo $after_widget;
dsidx_footer::ensure_disclaimer_exists("search");
}
function update($new_instance, $old_instance) {
$new_instance["title"] = strip_tags($new_instance["title"]);
$new_instance["searchOptions"]["cities"] = explode("\n", $new_instance["searchOptions"]["cities"]);
$new_instance["searchOptions"]["zips"] = explode("\n", $new_instance["searchOptions"]["zips"]);
$new_instance["searchOptions"]["tracts"] = explode("\n", $new_instance["searchOptions"]["tracts"]);
$new_instance["searchOptions"]["communities"] = explode("\n", $new_instance["searchOptions"]["communities"]);
if ($new_instance["searchOptions"]["sortZips"])
sort($new_instance["searchOptions"]["zips"]);
if ($new_instance["searchOptions"]["sortCities"])
sort($new_instance["searchOptions"]["cities"]);
if ($new_instance["searchOptions"]["sortTracts"])
sort($new_instance["searchOptions"]["tracts"]);
if ($new_instance["searchOptions"]["sortCommunities"])
sort($new_instance["searchOptions"]["communities"]);
// we don't need to store this option
unset($new_instance["searchOptions"]["sortCities"]);
unset($new_instance["searchOptions"]["sortTracts"]);
unset($new_instance["searchOptions"]["sortCommunities"]);
unset($new_instance["searchOptions"]["sortZips"]);
foreach ($new_instance["searchOptions"]["cities"] as &$area)
$area = trim($area);
foreach ($new_instance["searchOptions"]["tracts"] as &$area)
$area = trim($area);
foreach ($new_instance["searchOptions"]["communities"] as &$area)
$area = trim($area);
foreach ($new_instance["searchOptions"]["zips"] as &$area)
$area = trim($area);
/* we're doing this conversion from on/null to yes/no so that we can detect if the show_cities has never been
* set, because if it's never been set we want it to show */
if($new_instance["searchOptions"]["show_cities"] == "on") $new_instance["searchOptions"]["show_cities"] = "yes";
else $new_instance["searchOptions"]["show_cities"] = "no";
if($new_instance["searchOptions"]["show_communities"] == "on") $new_instance["searchOptions"]["show_communities"] = "yes";
else $new_instance["searchOptions"]["show_communities"] = "no";
if($new_instance["searchOptions"]["show_tracts"] == "on") $new_instance["searchOptions"]["show_tracts"] = "yes";
else $new_instance["searchOptions"]["show_tracts"] = "no";
if($new_instance["searchOptions"]["show_zips"] == "on") $new_instance["searchOptions"]["show_zips"] = "yes";
else $new_instance["searchOptions"]["show_zips"] = "no";
if($new_instance["searchOptions"]["show_mlsnumber"] == "on") $new_instance["searchOptions"]["show_mlsnumber"] = "yes";
else $new_instance["searchOptions"]["show_mlsnumber"] = "no";
if($new_instance["searchOptions"]["show_advanced"] == "on") $new_instance["searchOptions"]["show_advanced"] = "yes";
else $new_instance["searchOptions"]["show_advanced"] = "no";
return $new_instance;
}
function form($instance) {
wp_enqueue_script('dsidxpress_widget_search', DSIDXPRESS_PLUGIN_URL . 'js/widget-search.js', array('jquery'), DSIDXPRESS_PLUGIN_VERSION, true);
$pluginUrl = DSIDXPRESS_PLUGIN_URL;
$options = get_option(DSIDXPRESS_OPTION_NAME);
$instance = wp_parse_args($instance, array(
"title" => "Real Estate Search",
"searchOptions" => array(
"cities" => array(),
"communities" => array(),
"tracts" => array(),
"zips" => array(),
"show_cities" => 'yes',
"show_communities" => 'no',
"show_tracts" => 'no',
"show_zips" => 'no',
"show_mlsnumber" => 'no',
"show_advanced" => 'no'
)
));
$title = htmlspecialchars($instance["title"]);
$cities = htmlspecialchars(implode("\n", (array)$instance["searchOptions"]["cities"]));
$communities = htmlspecialchars(implode("\n", (array)$instance["searchOptions"]["communities"]));
$tracts = htmlspecialchars(implode("\n", (array)$instance["searchOptions"]["tracts"]));
$zips = htmlspecialchars(implode("\n", (array)$instance["searchOptions"]["zips"]));
$titleFieldId = $this->get_field_id("title");
$titleFieldName = $this->get_field_name("title");
$searchOptionsFieldId = $this->get_field_id("searchOptions");
$searchOptionsFieldName = $this->get_field_name("searchOptions");
$show_cities = $instance["searchOptions"]["show_cities"] == "yes" || !isset($instance["searchOptions"]["show_cities"]) ? "checked=\"checked\" " : "";
$show_communities = $instance["searchOptions"]["show_communities"] == "yes" ? "checked=\"checked\" " : "";
$show_tracts = $instance["searchOptions"]["show_tracts"] == "yes" ? "checked=\"checked\" " : "";
$show_zips = $instance["searchOptions"]["show_zips"] == "yes" ? "checked=\"checked\" " : "";
$show_mlsnumber = $instance["searchOptions"]["show_mlsnumber"] == "yes" ? "checked=\"checked\" " : "";
$show_advanced = $instance["searchOptions"]["show_advanced"] == "yes" ? "checked=\"checked\" " : "";
echo <<<HTML
<p>
<label for="{$titleFieldId}">Widget title</label>
<input id="{$titleFieldId}" name="{$titleFieldName}" value="{$title}" class="widefat" type="text" />
</p>
<p>
<h4>Fields to Display</h4>
<div id="{$searchOptionsFieldId}-show_checkboxes" class="search-widget-searchOptions">
<input type="checkbox" id="{$searchOptionsFieldId}-show_cities" name="{$searchOptionsFieldName}[show_cities]" {$show_cities} onclick="dsWidgetSearch.ShowBlock(this);"/>
<label for="{$searchOptionsFieldId}-show_cities">Cities</label><br />
<input type="checkbox" id="{$searchOptionsFieldId}-show_communities" name="{$searchOptionsFieldName}[show_communities]" {$show_communities} onclick="dsWidgetSearch.ShowBlock(this);"/>
<label for="{$searchOptionsFieldId}-show_communities">Communities</label><br />
<input type="checkbox" id="{$searchOptionsFieldId}-show_tracts" name="{$searchOptionsFieldName}[show_tracts]" {$show_tracts} onclick="dsWidgetSearch.ShowBlock(this);"/>
<label for="{$searchOptionsFieldId}-show_tracts">Tracts</label><br />
<input type="checkbox" id="{$searchOptionsFieldId}-show_zips" name="{$searchOptionsFieldName}[show_zips]" {$show_zips} onclick="dsWidgetSearch.ShowBlock(this);"/>
<label for="{$searchOptionsFieldId}-show_zips">Zips</label><br />
<input type="checkbox" id="{$searchOptionsFieldId}-show_mlsnumber" name="{$searchOptionsFieldName}[show_mlsnumber]" {$show_mlsnumber} onclick="dsWidgetSearch.ShowBlock(this);"/>
<label for="{$searchOptionsFieldId}-show_mlsnumber">MLS #'s</label><br />
HTML;
if($options["HasSearchAgentPro"] == "yes") {
echo <<<HTML
<input id="{$searchOptionsFieldId}-show-advanced" name="{$searchOptionsFieldName}[show_advanced]" class="checkbox" type="checkbox" {$show_advanced} onclick="dsWidgetSearch.ShowBlock(this);"/>
<label for="{$searchOptionsFieldId}-show-advanced">Show Advanced Option</label>
HTML;
}
echo <<<HTML
</div>
</p>
<div id="{$searchOptionsFieldId}-cities_block">
<h4>Cities (one per line)</h4>
<p>
<textarea id="{$searchOptionsFieldId}[cities]" name="{$searchOptionsFieldName}[cities]" class="widefat" rows="10">{$cities}</textarea>
</p>
<p>
<label for="{$searchOptionsFieldId}[sortCities]">Sort Cities</label>
<input id="{$searchOptionsFieldId}[sortCities]" name="{$searchOptionsFieldName}[sortCities]" class="checkbox" type="checkbox" />
</p>
<p>
<span class="description">See all City Names <a href="javascript:void(0);" onclick="dsWidgetSearch.LaunchLookupList('{$pluginUrl}locations.php?type=city')">here</a></span>
</p>
<hr noshade="noshade" />
</div>
<div id="{$searchOptionsFieldId}-communities_block">
<h3>Communities (one per line)</h3>
<p>
<textarea id="{$searchOptionsFieldId}[communities]" name="{$searchOptionsFieldName}[communities]" class="widefat" rows="10">{$communities}</textarea>
</p>
<p>
<label for="{$searchOptionsFieldId}[sortCommunities]">Sort Communities</label>
<input id="{$searchOptionsFieldId}[sortCommunities]" name="{$searchOptionsFieldName}[sortCommunities]" class="checkbox" type="checkbox" />
</p>
<p>
<span class="description">See all Community Names <a href="javascript:void(0);" onclick="dsWidgetSearch.LaunchLookupList('{$pluginUrl}locations.php?type=community')">here</a></span>
</p>
<hr noshade="noshade" />
</div>
<div id="{$searchOptionsFieldId}-tracts_block">
<h3>Tracts (one per line)</h3>
<p>
<textarea id="{$searchOptionsFieldId}[tracts]" name="{$searchOptionsFieldName}[tracts]" class="widefat" rows="10">{$tracts}</textarea>
</p>
<p>
<label for="{$searchOptionsFieldId}[sortTracts]">Sort Tracts</label>
<input id="{$searchOptionsFieldId}[sortTracts]" name="{$searchOptionsFieldName}[sortTracts]" class="checkbox" type="checkbox" />
</p>
<p>
<span class="description">See all Tract Names <a href="javascript:void(0);" onclick="dsWidgetSearch.LaunchLookupList('{$pluginUrl}locations.php?type=tract')">here</a></span>
</p>
<hr noshade="noshade" />
</div>
<div id="{$searchOptionsFieldId}-zips_block">
<h3>Zips (one per line)</h3>
<p>
<textarea id="{$searchOptionsFieldId}[zips]" name="{$searchOptionsFieldName}[zips]" class="widefat" rows="10">{$zips}</textarea>
</p>
<p>
<label for="{$searchOptionsFieldId}[sortZips]">Sort Zips</label>
<input id="{$searchOptionsFieldId}[sortZips]" name="{$searchOptionsFieldName}[sortZips]" class="checkbox" type="checkbox" />
</p>
<p>
<span class="description">See all Zips <a href="javascript:void(0);" onclick="dsWidgetSearch.LaunchLookupList('{$pluginUrl}locations.php?type=zip')">here</a></span>
</p>
</div>
<script> jQuery(document).ready(function() { if(typeof dsWidgetSearch != "undefined") { dsWidgetSearch.InitFields(); } }); </script>
HTML;
}
}
?>