fix for 4825

This commit is contained in:
toyomoyo 2006-02-23 02:56:07 +00:00
parent f055d14bed
commit 2786ff706d

View file

@ -70,6 +70,7 @@
break; break;
case INSTALLED: case INSTALLED:
print_string('langpackupdated','admin',$pack); print_string('langpackupdated','admin',$pack);
@unlink($CFG->dataroot.'/cache/languages');
print_continue('langimport.php'); print_continue('langimport.php');
break; break;
default: default:
@ -134,6 +135,9 @@
print_simple_box_end(); print_simple_box_end();
} }
else if (confirm_sesskey()) { else if (confirm_sesskey()) {
if ($uninstalllang == 'en_utf8') {
error ('en_utf8 can not be uninstalled!');
}
$dest1 = $CFG->dataroot.'/lang/'.$uninstalllang; $dest1 = $CFG->dataroot.'/lang/'.$uninstalllang;
$dest2 = $CFG->dirroot.'/lang/'.$uninstalllang; $dest2 = $CFG->dirroot.'/lang/'.$uninstalllang;
$rm1 = false; $rm1 = false;
@ -155,6 +159,7 @@
error ('An error has occurred, language pack is not completely uninstalled, please check file permission'); error ('An error has occurred, language pack is not completely uninstalled, please check file permission');
} }
} }
@unlink($CFG->dataroot.'/cache/languages');
break; break;
case UPDATE_ALL_LANG: //1 click update for all updatable language packs case UPDATE_ALL_LANG: //1 click update for all updatable language packs
@ -302,10 +307,8 @@
echo '<select name="uninstalllang" size="15">'; echo '<select name="uninstalllang" size="15">';
foreach ($installedlangs as $clang =>$ilang){ foreach ($installedlangs as $clang =>$ilang){
if ($clang != "en_utf8") {
echo '<option value="'.$clang.'">'.$ilang.'</option>'; echo '<option value="'.$clang.'">'.$ilang.'</option>';
} }
}
echo '</select>'; echo '</select>';
echo '<br /><input type="submit" value="'.get_string('uninstall','admin').'" />'; echo '<br /><input type="submit" value="'.get_string('uninstall','admin').'" />';
echo '</form>'; echo '</form>';
@ -348,7 +351,7 @@
} }
foreach ($availablelangs as $alang) { foreach ($availablelangs as $alang) {
if ($clang != "en_utf8") { if ($alang[0] != "en_utf8") {
if ($remote){ if ($remote){
if (!is_installed_lang($alang[0], $alang[1])){ //if not already installed if (!is_installed_lang($alang[0], $alang[1])){ //if not already installed
echo '<option value="'.$alang[0].'">'.$alang[2].' ('.$alang[0].')</option>'; echo '<option value="'.$alang[0].'">'.$alang[2].' ('.$alang[0].')</option>';