Project

General

Profile

« Previous | Next » 

Revision 1435

Added by Dietmar over 13 years ago

fix entities converting in select languages (Tks to the community)
see http://www.websitebaker2.org/forum/index.php/topic,20547.msg140512.html#msg140512

View differences:

index.php
155 155
					 ));
156 156

  
157 157
	// Insert language values
158
	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' ORDER BY name");
158
	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' ORDER BY directory");
159 159
	if($result->numRows() > 0)
160 160
	{
161 161
		while($addon = $result->fetchRow()) {
162
			$l_codes[$addon['name']] = $addon['directory'];
163
			$l_names[$addon['name']] = entities_to_7bit($addon['name']); // sorting-problem workaround
164
		}
165
		asort($l_names);
166
		foreach($l_names as $l_name=>$v) {
167
			// Insert code and name
168
			$template->set_var(array(
169
									'CODE' => $l_codes[$l_name],
170
									'NAME' => $l_name,
171
									'FLAG' => THEME_URL.'/images/flags/'.strtolower($l_codes[$l_name]),
172
									));
173
			// Check if it is selected
174
			if(DEFAULT_LANGUAGE == $l_codes[$l_name]) {
175
				$template->set_var('SELECTED', ' selected="selected"');
176
			} else {
177
				$template->set_var('SELECTED', '');
178
			}
162
			$template->set_var('CODE',        $addon['directory']);
163
			$template->set_var('NAME',        $addon['name']);
164
			$template->set_var('FLAG',        THEME_URL.'/images/flags/'.strtolower($addon['directory']));
165
			$template->set_var('SELECTED',    (DEFAULT_LANGUAGE == $addon['directory'] ? ' selected="selected"' : '') );
179 166
			$template->parse('language_list', 'language_list_block', true);
180 167
		}
181 168
	}

Also available in: Unified diff