Project

General

Profile

« Previous | Next » 

Revision 718

Added by thorn almost 17 years ago

added workaround for language sorting-problem

View differences:

index.php
33 33

  
34 34
// Include the WB functions file
35 35
require_once(WB_PATH.'/framework/functions.php');
36
require_once(WB_PATH.'/framework/functions-utf8.php');
36 37

  
37 38
// Create new template object
38 39
$template = new Template(ADMIN_PATH.'/settings');
......
135 136
$template->set_block('main_block', 'language_list_block', 'language_list');
136 137
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' order by name");
137 138
if($result->numRows() > 0) {
138
	while ($addon = $result->fetchRow()) {
139
	while($addon = $result->fetchRow()) {
140
		$l_codes[$addon['name']] = $addon['directory'];
141
		$l_names[$addon['name']] = entities_to_7bit($addon['name']); // sorting-problem workaround
142
	}
143
	asort($l_names);
144
	foreach($l_names as $l_name=>$v) {
139 145
		// Insert code and name
140 146
		$template->set_var(array(
141
								'CODE' => $addon['directory'],
142
								'NAME' => $addon['name']
147
								'CODE' => $l_codes[$l_name],
148
								'NAME' => $l_name
143 149
								));
144 150
		// Check if it is selected
145
		if(DEFAULT_LANGUAGE == $addon['directory']) {
151
		if(DEFAULT_LANGUAGE == $l_codes[$l_name]) {
146 152
			$template->set_var('SELECTED', ' selected');
147 153
		} else {
148 154
			$template->set_var('SELECTED', '');

Also available in: Unified diff