This commit is contained in:
qronald
2016-08-10 13:26:42 -04:00
parent 62b958f812
commit f370b7b5c2

View File

@@ -498,7 +498,7 @@ class Translation extends BaseTranslation
}
}
return $environments;
return $this->sort_col($environments, 'LANGUAGE');
/*
G::LoadSystem('dbMaintenance');
@@ -520,6 +520,31 @@ class Translation extends BaseTranslation
*/
}
/**
* Sorts an array according to a specified column
* Params : array $table
* string $colname
* bool $numeric
**/
function sort_col($table, $colname) {
$tn = $ts = $temp_num = $temp_str = array();
foreach ($table as $key => $row) {
if(is_numeric(substr($row[$colname], 0, 1))) {
$tn[$key] = $row[$colname];
$temp_num[$key] = $row;
}
else {
$ts[$key] = $row[$colname];
$temp_str[$key] = $row;
}
}
unset($table);
array_multisort($tn, SORT_ASC, SORT_NUMERIC, $temp_num);
array_multisort($ts, SORT_ASC, SORT_STRING, $temp_str);
return array_merge($temp_num, $temp_str);
}
public function getInfoFromPOFile ($file)
{
G::loadClass( 'i18n_po' );