mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
parent
cdd7f81857
commit
e3cf2a68be
@ -42,7 +42,6 @@
|
||||
<script>
|
||||
var select_trans = "{{ trans('visiosoft.module.advs::field.pick_option') }}";
|
||||
var searchedCountry = {{ searchedCountry }};
|
||||
var useDefault = {{ useDefault }};
|
||||
</script>
|
||||
|
||||
{% if entries('advs').isEnabled('favs') %}
|
||||
|
||||
@ -147,10 +147,15 @@ class AdvsController extends PublicController
|
||||
|
||||
$param = $this->requestHttp->toArray();
|
||||
if (!isset($param['country'])) {
|
||||
$param['country'] = setting_value('visiosoft.module.advs::default_country');
|
||||
$useDefault = 1;
|
||||
if (is_null(Cookie::get('country'))) {
|
||||
$param['country'] = setting_value('visiosoft.module.advs::default_country');
|
||||
} else {
|
||||
$param['country'] = Cookie::get('country');
|
||||
}
|
||||
} else {
|
||||
$useDefault = 0;
|
||||
if ($param['country'] != setting_value('visiosoft.module.advs::default_country')) {
|
||||
Cookie::queue(Cookie::make('country', $param['country'], 84000));
|
||||
}
|
||||
}
|
||||
$searchedCountry = $param['country'];
|
||||
|
||||
@ -220,7 +225,7 @@ class AdvsController extends PublicController
|
||||
}
|
||||
|
||||
$compact = compact('advs', 'countries', 'mainCats', 'subCats', 'textfields', 'checkboxes', 'request',
|
||||
'user', 'userProfile', 'featured_advs', 'type', 'topfields', 'ranges', 'seenList', 'searchedCountry', 'useDefault');
|
||||
'user', 'userProfile', 'featured_advs', 'type', 'topfields', 'ranges', 'seenList', 'searchedCountry');
|
||||
|
||||
Cookie::queue(Cookie::make('last_search', $this->requestHttp->getRequestUri(), 84000));
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ FindLocations = (id, table, typeDb, divId, paramName = null) => {
|
||||
};
|
||||
|
||||
// Set selected country in the select menu
|
||||
if (useDefault) {
|
||||
if (searchParams.get('country') == null) {
|
||||
$('#cities').empty();
|
||||
var table = "cities";
|
||||
var typeDb = 'parent_country_id';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user