Project

General

Profile

« Previous | Next » 

Revision 718

Added by thorn almost 17 years ago

added workaround for language sorting-problem

View differences:

trunk/CHANGELOG
10 10
# = Bugfix
11 11
! = Update/Change
12 12

  
13
------------------------------------- 2.7.0 -------------------------------------
13
------------------------------------- 2.7.0 -------------------------------------
14
20-Feb-2008 Thomas Hornik
15
!	added workaround for language sorting-problem
14 16
20-Feb-2008	Christian Sommer
15 17
#	added the FCKEditor module PHP connector fix found by the forum member Luisehahne (thanks man)
16 18
!	Updated upgrade script (added WB2.7 basic styles, pre-checks and disclaimer)
trunk/wb/admin/settings/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', '');
trunk/wb/admin/preferences/index.php
27 27
require_once(WB_PATH.'/framework/class.admin.php');
28 28
$admin = new admin('Preferences');
29 29

  
30
require_once(WB_PATH.'/framework/functions-utf8.php');
31

  
30 32
// Create new template object for the preferences form
31 33
$template = new Template(ADMIN_PATH.'/preferences');
32 34
$template->set_file('page', 'template.html');
......
50 52
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' order by name");
51 53
if($result->numRows() > 0) {
52 54
	while($addon = $result->fetchRow()) {
55
		$l_codes[$addon['name']] = $addon['directory'];
56
		$l_names[$addon['name']] = entities_to_7bit($addon['name']); // sorting-problem workaround
57
	}
58
	asort($l_names);
59
	foreach($l_names as $l_name=>$v) {
53 60
		// Insert code and name
54 61
		$template->set_var(array(
55
								'CODE' => $addon['directory'],
56
								'NAME' => $addon['name']
62
								'CODE' => $l_codes[$l_name],
63
								'NAME' => $l_name
57 64
								));
58 65
		// Check if it is selected
59
		if(LANGUAGE == $addon['directory']) {
66
		if(LANGUAGE == $l_codes[$l_name]) {
60 67
			$template->set_var('SELECTED', ' selected');
61 68
		} else {
62 69
			$template->set_var('SELECTED', '');

Also available in: Unified diff