phpfm
phpfm copied to clipboard
unicode chars on buttons + FIX
If you are using unicode chars on buttons, your code with javascript switch statements isnt working as expected with the button's values, because somewhere the special characters on the buttons are converted to html entities (so "Ford& iacute; t" isnt will be equal to "Fordít"):
$et['hu']['SelInverse'] = 'Fordít'; //í
This is your code:
// Select all/none/inverse
.....
switch (Butt.value){
case '".et('SelAll')."':
if (select(entry_list[Row.id])) newClassName = 'entrySelected';
break;
case '".et('SelNone')."':
if (unselect(entry_list[Row.id])) newClassName = 'entryUnselected';
break;
case '".et('SelInverse')."':
if (entry_list[Row.id].selected){
if (unselect(entry_list[Row.id])) newClassName = 'entryUnselected';
} else {
if (select(entry_list[Row.id])) newClassName = 'entrySelected';
}
break;
}
....
Fix: You should use html_entity_decode on all similar cases like this, for example:
switch (Butt.value){
case '".html_entity_decode(et('SelAll'))."':
if (select(entry_list[Row.id])) newClassName = 'entrySelected';
break;
case '".html_entity_decode(et('SelNone'))."':
if (unselect(entry_list[Row.id])) newClassName = 'entryUnselected';
break;
case '".html_entity_decode(et('SelInverse'))."':
if (entry_list[Row.id].selected){
if (unselect(entry_list[Row.id])) newClassName = 'entryUnselected';
} else {
if (select(entry_list[Row.id])) newClassName = 'entrySelected';
}
break;
}
On long term try to change your code to check button ids instead of their values.
Thanks for the notice! I will check this out and fix it for the next release.