added a language selector on multilingual search

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12060 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2012-11-03 07:58:48 +00:00
parent 9667b29c45
commit e66e10c2c7
7 changed files with 111 additions and 28 deletions

View file

@ -1085,8 +1085,8 @@ Le module [Administration des Modules] montera tous les modules installés et vo
</item>
</item>
<item name="about_multilingual_search_result">
<value xml:lang="ko"><![CDATA[<strong>%d</strong>개의 다국어 세트가 있습니다.]]></value>
<value xml:lang="en"><![CDATA[There are <strong>%d</strong> multilingual sets.]]></value>
<value xml:lang="ko"><![CDATA[<strong>%d</strong>개의 <span class="flag %s">%s</span> 다국어 세트가 있습니다.]]></value>
<value xml:lang="en"><![CDATA[There are <strong>%d</strong> <span class="flag %s">%s</span> multilingual sets.]]></value>
</item>
<item name="msg_confirm_save_and_use_multilingual">
<value xml:lang="ko"><![CDATA[현재 상태를 저장하고 사용할까요?]]></value>

View file

@ -446,7 +446,7 @@
{
$siteModuleInfo = Context::get('site_module_info');
$args->site_srl = (int)$site_module_info->site_srl;
$args->langCode = Context::get('lang_type');
$args->langCode = Context::get('lang_code');
$args->page = Context::get('page');
$args->sort_index = 'name';
$args->order_type = 'asc';
@ -455,6 +455,11 @@
$args->list_count = Context::get('list_count');
$args->page_count = 5;
if(!$args->langCode)
{
$args->langCode = Context::get('lang_type');
}
$output = $this->getLangListByLangcode($args);
Context::set('total_count', $output->total_count);

View file

@ -4,7 +4,7 @@
unset($lang_supported[$lang_type]);
$lang_supported = array_merge($a, $lang_supported);
}
<p cond="!$name">{sprintf($lang->about_multilingual_search_result, $total_count)}</p>
<p cond="!$name">{sprintf($lang->about_multilingual_search_result, $total_count, $lang_code, $lang_supported[$lang_code])}</p>
<fieldset class="list">
<form loop="$lang_code_list => $no, $val" action="" class="item">
<a class="set" href="#lang-{$no}" data-toggle="#lang-{$no}" data-lang_code="{$val->name}"><span>{$val->value}</span></a>
@ -25,7 +25,7 @@
</form>
</fieldset>
<div class="x_clearfix">
<form cond="$page_navigation" action="./" class="x_pagination x_pull-left" data-search_keyword="{htmlspecialchars($search_keyword)}" data-page="{$page}" no-error-return-url="true">
<form cond="$page_navigation" action="./" class="x_pagination x_pull-left" data-search_keyword="{htmlspecialchars($search_keyword)}" data-page="{$page}" data-current_lang="{$lang_code}" no-error-return-url="true">
<ul>
<li class="x_disabled"|cond="!$page || $page == 1"><a href="#" data-page="1" data-search_keyword="{htmlspecialchars($search_keyword)}">&laquo; {$lang->first_page}</a></li>
<block cond="$page_navigation->first_page != 1 && $page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page - 1 && $page_navigation->page_count != $page_navigation->total_page">
@ -56,6 +56,9 @@
</ul>
</form>
<form action="" class="search center x_input-append x_pull-right">
<select name="lang_code">
<option loop="$lang_supported => $code, $lname" value="{$code}" selected="selected"|cond="$code == $lang_code">{$lname}</option>
</select>
<input type="search" name="search_keyword" required title="Search" value="<!--@if($name)-->{htmlspecialchars($lang_code_list[1]->value)}<!--@else-->{htmlspecialchars($search_keyword)}<!--@end-->">
<button class="x_btn x_btn-inverse" type="submit">{$lang->cmd_search}</button>
<button cond="$search_keyword || $name" id="search_cancel" class="x_btn" type="button">{$lang->cmd_cancel}</button>