Changeset 9520 for trunk/admin
- Timestamp:
- Mar 4, 2011, 12:35:38 PM (14 years ago)
- Location:
- trunk/admin
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/languages.class.php
r9518 r9520 33 33 function languages($target_charset = null) 34 34 { 35 $this-> fs_languages = $this->get_fs_languages($target_charset);35 $this->get_fs_languages($target_charset); 36 36 } 37 37 … … 48 48 $tabsheet = new tabsheet(); 49 49 $tabsheet->add('languages_installed', l10n('Installed Languages'), $link.'languages_installed'); 50 $tabsheet->add('languages_update', l10n('Check for updates'), $link.'languages_update'); 50 51 $tabsheet->add('languages_new', l10n('Add New Language'), $link.'languages_new'); 51 52 $tabsheet->select($selected); … … 171 172 { 172 173 $language = array( 174 'name'=>$file, 173 175 'code'=>$file, 174 176 'version'=>'0', … … 212 214 closedir($dir); 213 215 @uasort($this->fs_languages, 'name_compare'); 214 215 return $this->fs_languages;216 216 } 217 217 … … 283 283 'version' => implode(',', $versions_to_check), 284 284 'lang' => $user['language'], 285 'get_nb_downloads' => 'true', 285 286 ) 286 287 ); … … 308 309 if (preg_match('/^.*? \[[A-Z]{2}\]$/', $language['extension_name'])) 309 310 { 310 $this->server_languages[$language['extension_ name']] = $language;311 } 312 } 313 @ ksort($this->server_languages);311 $this->server_languages[$language['extension_id']] = $language; 312 } 313 } 314 @uasort($this->server_languages, array($this, 'extension_name_compare')); 314 315 return true; 315 316 } … … 379 380 if ($status == 'ok') 380 381 { 381 $this->fs_languages = $this->get_fs_languages(); 382 $this->perform_action('activate', $dest); 382 $this->get_fs_languages(); 383 if ($action == 'install') 384 { 385 $this->perform_action('activate', $dest); 386 } 383 387 } 384 388 if (file_exists($extract_path.'/obsolete.list') … … 472 476 } 473 477 } 478 479 /** 480 * Sort functions 481 */ 482 function language_version_compare($a, $b) 483 { 484 $pattern = array('/([a-z])/ei', '/\.+/', '/\.\Z|\A\./'); 485 $replacement = array( "'.'.intval('\\1', 36).'.'", '.', ''); 486 487 $array = preg_replace($pattern, $replacement, array($a, $b)); 488 489 return version_compare($array[0], $array[1], '>='); 490 } 491 492 function extension_name_compare($a, $b) 493 { 494 return strcmp(strtolower($a['extension_name']), strtolower($b['extension_name'])); 495 } 474 496 } 475 497 ?>
Note: See TracChangeset
for help on using the changeset viewer.