mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 12:32:14 +09:00
issue 160, fix a bug related multi language management page
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9361 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
17803c5a14
commit
ed1a4543b5
2 changed files with 9 additions and 3 deletions
|
|
@ -4,7 +4,7 @@ jQuery(function($){
|
||||||
$('#langList')
|
$('#langList')
|
||||||
.find('form').hide().attr('aria-hidden','true').end() // collapse all language input control
|
.find('form').hide().attr('aria-hidden','true').end() // collapse all language input control
|
||||||
.delegate('button._edit', 'click', function(){
|
.delegate('button._edit', 'click', function(){
|
||||||
var $this = $(this), $form = $this.next('form');
|
var $this = $(this), $form = $this.parent().next('form');
|
||||||
|
|
||||||
// toggle input control
|
// toggle input control
|
||||||
if($form.attr('aria-hidden') == 'false') {
|
if($form.attr('aria-hidden') == 'false') {
|
||||||
|
|
@ -22,14 +22,14 @@ $('#langList')
|
||||||
function on_complete(ret) {
|
function on_complete(ret) {
|
||||||
var name = ret['lang_name'], list = ret['lang_list']['item'], elems = $form[0].elements, item;
|
var name = ret['lang_name'], list = ret['lang_list']['item'], elems = $form[0].elements, item;
|
||||||
|
|
||||||
$form.find('label+textarea').prev('label').css('visibility','hidden');
|
$form.find('label+textarea').prev('label').css('visibility','visible');
|
||||||
|
|
||||||
if(!$.isArray(list)) list = [list];
|
if(!$.isArray(list)) list = [list];
|
||||||
for(var i=0,c=list.length; i < c; i++) {
|
for(var i=0,c=list.length; i < c; i++) {
|
||||||
item = list[i];
|
item = list[i];
|
||||||
if(item && item.lang_code && elems[item.lang_code]) {
|
if(item && item.lang_code && elems[item.lang_code]) {
|
||||||
elems[item.lang_code].value = item.value;
|
elems[item.lang_code].value = item.value;
|
||||||
if(!item.value) $(elems[item.lang_code]).prev('label').css('visibility','visible');
|
if(item.value) $(elems[item.lang_code]).prev('label').css('visibility','hidden');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,12 @@
|
||||||
<input type="hidden" name="act" value="procModuleAdminInsertLang" />
|
<input type="hidden" name="act" value="procModuleAdminInsertLang" />
|
||||||
<input type="hidden" name="lang_name" value="{$langName}" />
|
<input type="hidden" name="lang_name" value="{$langName}" />
|
||||||
<ul>
|
<ul>
|
||||||
|
{@
|
||||||
|
/* move current language to the top */
|
||||||
|
$a = array($lang_type=>$lang_supported[$lang_type]);
|
||||||
|
unset($lang_supported[$lang_type]);
|
||||||
|
$lang_supported = array_merge($a, $lang_supported);
|
||||||
|
}
|
||||||
<li class="{$key2}" loop="$lang_supported=>$key2,$value2"><label for="{$langName}_{$key2}">{$value2}</label> <textarea rows="1" cols="42" name="{$key2}" id="{$langName}_{$key2}"></textarea></li>
|
<li class="{$key2}" loop="$lang_supported=>$key2,$value2"><label for="{$langName}_{$key2}">{$value2}</label> <textarea rows="1" cols="42" name="{$key2}" id="{$langName}_{$key2}"></textarea></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="btnArea">
|
<div class="btnArea">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue