Skip to content
Permalink
Browse files

corrected handling of search for all countries or languages; updates #48

  • Loading branch information...
following5 committed Sep 12, 2015
1 parent f34525a commit 6e6a790daff65fcc0fad5c5f78ee4f38f738525d
Showing with 10 additions and 18 deletions.
  1. +8 −16 htdocs/search.php
  2. +2 −2 htdocs/templates2/ocstyle/search.tpl
@@ -1542,23 +1542,13 @@ function outputSearchForm($options)
$tpl->assign('f_geokrets_checked', $options['f_geokrets'] == 1);
$tpl->assign('hidopt_geokrets', ($options['f_geokrets'] == 1) ? '1' : '0');
if (isset($options['country']))
{
$tpl->assign('country', htmlspecialchars($options['country'], ENT_COMPAT, 'UTF-8'));
}
else
{
$tpl->assign('country', '');
}
if (!isset($options['country']))
$options['country'] = '';
$tpl->assign('country', htmlspecialchars($options['country'], ENT_COMPAT, 'UTF-8'));
if (isset($options['language']))
{
$tpl->assign('language', htmlspecialchars($options['language'], ENT_COMPAT, 'UTF-8'));
}
else
{
$tpl->assign('language', '');
}
if (!isset($options['language']))
$options['language'] = '';
$tpl->assign('language', htmlspecialchars($options['language'], ENT_COMPAT, 'UTF-8'));
if (isset($options['cachetype']))
{
@@ -1667,6 +1657,7 @@ function outputSearchForm($options)
$opt['template']['locale'], $options['country']);
$tpl->assign_rs('countryoptions',$rs);
sql_free_result($rs);
$tpl->assign('all_countries', $options['country'] == '');
// language options
$rs = sql("
@@ -1682,6 +1673,7 @@ function outputSearchForm($options)
$opt['template']['locale'], $options['language']);
$tpl->assign_rs('languageoptions',$rs);
sql_free_result($rs);
$tpl->assign('all_languages', $options['language'] == '');
// cachetype
$rs = sql("SELECT `id` FROM `cache_type` ORDER BY `ordinal`");
@@ -400,15 +400,15 @@ function switchAttributeCat2()
<td class="formlabel">{t}Country:{/t}&nbsp;&nbsp;</td>
<td>
<select name="country" onchange="sync_options(this)">
<option value="" selected="selected">{t}All countries{/t}</option>
<option value="" {if $all_countries}selected="selected"{/if}>{t}All countries{/t}</option>
{foreach from=$countryoptions item=countryoption}
<option value="{$countryoption.short|escape}" {if $countryoption.selected}selected="selected"{/if}>{$countryoption.name|escape}</option>
{/foreach}
</select>
&nbsp; &nbsp; &nbsp; &nbsp;
<span class="formlabel">{t}Language:{/t}&nbsp;&nbsp;</span>
<select name="language" onchange="sync_options(this)">
<option value="" selected="selected">{t}All languages{/t}</option>
<option value="" {if $all_languages}selected="selected"{/if}>{t}All languages{/t}</option>
{foreach from=$languageoptions item=languageoption}
<option value="{$languageoption.short|escape}" {if $languageoption.selected}selected="selected"{/if}>{$languageoption.name|escape}</option>
{/foreach}

0 comments on commit 6e6a790

Please sign in to comment.
You can’t perform that action at this time.