-
Notifications
You must be signed in to change notification settings - Fork 13
/
search-sidebar.php
95 lines (94 loc) · 4.41 KB
/
search-sidebar.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
<?php
/*
* Osclass – software for creating and publishing online classified
* advertising platforms
*
* Copyright (C) 2014 OSCLASS
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
$category = (array) __get("category");
if(!isset($category['pk_i_id']) ) {
$category['pk_i_id'] = null;
}
?>
<div id="sidebar">
<?php osc_alert_form(); ?>
<div class="filters">
<form action="<?php echo osc_base_url(true); ?>" method="get" class="nocsrf">
<input type="hidden" name="page" value="search"/>
<input type="hidden" name="sOrder" value="<?php echo osc_search_order(); ?>" />
<input type="hidden" name="iOrderType" value="<?php $allowedTypesForSorting = Search::getAllowedTypesForSorting() ; echo $allowedTypesForSorting[osc_search_order_type()]; ?>" />
<?php foreach(osc_search_user() as $userId) { ?>
<input type="hidden" name="sUser[]" value="<?php echo $userId; ?>"/>
<?php } ?>
<fieldset class="first">
<h3><?php _e('Your search', 'bender'); ?></h3>
<div class="row">
<input class="input-text" type="text" name="sPattern" id="query" value="<?php echo osc_esc_html(osc_search_pattern()); ?>" />
</div>
</fieldset>
<fieldset>
<h3><?php _e('City', 'bender'); ?></h3>
<div class="row">
<input class="input-text" type="hidden" id="sRegion" name="sRegion" value="<?php echo osc_esc_html(Params::getParam('sRegion')); ?>" />
<input class="input-text" type="text" id="sCity" name="sCity" value="<?php echo osc_esc_html(osc_search_city()); ?>" />
</div>
</fieldset>
<?php if( osc_images_enabled_at_items() ) { ?>
<fieldset>
<h3><?php _e('Show only', 'bender') ; ?></h3>
<div class="row">
<input type="checkbox" name="bPic" id="withPicture" value="1" <?php echo (osc_search_has_pic() ? 'checked' : ''); ?> />
<label for="withPicture"><?php _e('listings with pictures', 'bender') ; ?></label>
</div>
</fieldset>
<?php } ?>
<?php if( osc_price_enabled_at_items() ) { ?>
<fieldset>
<div class="row price-slice">
<h3><?php _e('Price', 'bender') ; ?></h3>
<span><?php _e('Min', 'bender') ; ?>.</span>
<input class="input-text" type="text" id="priceMin" name="sPriceMin" value="<?php echo osc_esc_html(osc_search_price_min()); ?>" size="6" maxlength="6" />
<span><?php _e('Max', 'bender') ; ?>.</span>
<input class="input-text" type="text" id="priceMax" name="sPriceMax" value="<?php echo osc_esc_html(osc_search_price_max()); ?>" size="6" maxlength="6" />
</div>
</fieldset>
<?php } ?>
<div class="plugin-hooks">
<?php
if(osc_search_category_id()) {
osc_run_hook('search_form', osc_search_category_id()) ;
} else {
osc_run_hook('search_form') ;
}
?>
</div>
<?php
$aCategories = osc_search_category();
foreach($aCategories as $cat_id) { ?>
<input type="hidden" name="sCategory[]" value="<?php echo osc_esc_html($cat_id); ?>"/>
<?php } ?>
<div class="actions">
<button type="submit"><?php _e('Apply', 'bender') ; ?></button>
</div>
</form>
<fieldset>
<div class="row ">
<h3><?php _e('Refine category', 'bender') ; ?></h3>
<?php bender_sidebar_category_search($category['pk_i_id']); ?>
</div>
</fieldset>
</div>
</div>