Revision 170
Added by ryan about 19 years ago
index.php | ||
---|---|---|
45 | 45 |
|
46 | 46 |
// Insert language values |
47 | 47 |
$template->set_block('main_block', 'language_list_block', 'language_list'); |
48 |
if($handle = opendir(WB_PATH.'/languages/')) { |
|
49 |
while (false !== ($file = readdir($handle))) { |
|
50 |
if($file != '.' AND $file != '..' AND !is_dir($file) AND $file != 'index.php') { |
|
51 |
// Get language name |
|
52 |
require(WB_PATH.'/languages/'.$file); |
|
53 |
// Insert code and name |
|
54 |
$template->set_var(array( |
|
55 |
'CODE' => $language_code, |
|
56 |
'NAME' => $language_name |
|
57 |
) |
|
58 |
); |
|
59 |
// Check if it is selected |
|
60 |
if(LANGUAGE == $language_code) { |
|
61 |
$template->set_var('SELECTED', ' selected'); |
|
62 |
} else { |
|
63 |
$template->set_var('SELECTED', ''); |
|
64 |
} |
|
65 |
$template->parse('language_list', 'language_list_block', true); |
|
48 |
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language'"); |
|
49 |
if($result->numRows() > 0) { |
|
50 |
while($addon = $result->fetchRow()) { |
|
51 |
// Insert code and name |
|
52 |
$template->set_var(array( |
|
53 |
'CODE' => $addon['directory'], |
|
54 |
'NAME' => $addon['name'] |
|
55 |
)); |
|
56 |
// Check if it is selected |
|
57 |
if(LANGUAGE == $addon['directory']) { |
|
58 |
$template->set_var('SELECTED', ' selected'); |
|
59 |
} else { |
|
60 |
$template->set_var('SELECTED', ''); |
|
66 | 61 |
} |
62 |
$template->parse('language_list', 'language_list_block', true); |
|
67 | 63 |
} |
68 |
// Restore language to original file |
|
69 |
require(WB_PATH.'/languages/'.LANGUAGE.'.php'); |
|
70 | 64 |
} |
71 | 65 |
|
72 | 66 |
// Insert default timezone values |
Also available in: Unified diff
Fixed addon listing in numerous places so it now use's DB for info