Revision 170
Added by ryan about 20 years ago
| trunk/wb/admin/templates/uninstall.php | ||
|---|---|---|
| 61 | 61 |
// Try to delete the template dir |
| 62 | 62 |
if(!rm_full_dir(WB_PATH.'/templates/'.$file)) {
|
| 63 | 63 |
$admin->print_error($MESSAGE['GENERIC']['CANNOT_UNINSTALL']); |
| 64 |
} else {
|
|
| 65 |
// Remove entry from DB |
|
| 66 |
$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE directory = '".$file."' AND type = 'template' LIMIT 0,1");
|
|
| 64 | 67 |
} |
| 65 | 68 |
|
| 66 | 69 |
// Update pages that use this template with default template |
| trunk/wb/admin/templates/install.php | ||
|---|---|---|
| 119 | 119 |
} |
| 120 | 120 |
} |
| 121 | 121 |
|
| 122 |
// Load template info into DB |
|
| 123 |
load_module(WB_PATH.'/templates/'.$template_directory); |
|
| 124 |
|
|
| 122 | 125 |
// Print success message |
| 123 | 126 |
$admin->print_success($success_message); |
| 124 | 127 |
|
| trunk/wb/admin/settings/index.php | ||
|---|---|---|
| 141 | 141 |
|
| 142 | 142 |
// Insert language values |
| 143 | 143 |
$template->set_block('main_block', 'language_list_block', 'language_list');
|
| 144 |
if($handle = opendir(WB_PATH.'/languages/')) {
|
|
| 145 |
while (false !== ($file = readdir($handle))) {
|
|
| 146 |
if($file != '.' AND $file != '..' AND !is_dir($file) AND $file != 'index.php') {
|
|
| 147 |
// Get language name |
|
| 148 |
require(WB_PATH.'/languages/'.$file); |
|
| 149 |
// Insert code and name |
|
| 150 |
$template->set_var(array( |
|
| 151 |
'CODE' => $language_code, |
|
| 152 |
'NAME' => $language_name |
|
| 153 |
) |
|
| 154 |
); |
|
| 155 |
// Check if it is selected |
|
| 156 |
if(DEFAULT_LANGUAGE == $language_code) {
|
|
| 157 |
$template->set_var('SELECTED', ' selected');
|
|
| 158 |
} else {
|
|
| 159 |
$template->set_var('SELECTED', '');
|
|
| 160 |
} |
|
| 161 |
$template->parse('language_list', 'language_list_block', true);
|
|
| 144 |
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language'");
|
|
| 145 |
if($result->numRows() > 0) {
|
|
| 146 |
while ($addon = $result->fetchRow()) {
|
|
| 147 |
// Insert code and name |
|
| 148 |
$template->set_var(array( |
|
| 149 |
'CODE' => $addon['directory'], |
|
| 150 |
'NAME' => $addon['name'] |
|
| 151 |
)); |
|
| 152 |
// Check if it is selected |
|
| 153 |
if(DEFAULT_LANGUAGE == $addon['directory']) {
|
|
| 154 |
$template->set_var('SELECTED', ' selected');
|
|
| 155 |
} else {
|
|
| 156 |
$template->set_var('SELECTED', '');
|
|
| 162 | 157 |
} |
| 158 |
$template->parse('language_list', 'language_list_block', true);
|
|
| 163 | 159 |
} |
| 164 |
// Restore language to original file |
|
| 165 |
require(WB_PATH.'/languages/'.LANGUAGE.'.php'); |
|
| 166 | 160 |
} |
| 167 | 161 |
|
| 168 | 162 |
// Insert default timezone values |
| ... | ... | |
| 222 | 216 |
|
| 223 | 217 |
// Insert templates |
| 224 | 218 |
$template->set_block('main_block', 'template_list_block', 'template_list');
|
| 225 |
if($handle = opendir(WB_PATH.'/templates/')) {
|
|
| 226 |
while (false !== ($file = readdir($handle))) {
|
|
| 227 |
if($file != "." AND $file != ".." AND $file != ".svn" AND is_dir(WB_PATH."/templates/$file") AND file_exists(WB_PATH."/templates/$file/info.php")) {
|
|
| 228 |
include(WB_PATH."/templates/$file/info.php"); |
|
| 229 |
$template->set_var('FILE', $file);
|
|
| 230 |
$template->set_var('NAME', $template_name);
|
|
| 231 |
if($file == DEFAULT_TEMPLATE ? $selected = ' selected' : $selected = ''); |
|
| 232 |
$template->set_var('SELECTED', $selected);
|
|
| 233 |
$template->parse('template_list', 'template_list_block', true);
|
|
| 234 |
} |
|
| 219 |
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template'");
|
|
| 220 |
if($result->numRows() > 0) {
|
|
| 221 |
while($addon = $result->fetchRow()) {
|
|
| 222 |
$template->set_var('FILE', $addon['directory']);
|
|
| 223 |
$template->set_var('NAME', $addon['name']);
|
|
| 224 |
if($file == DEFAULT_TEMPLATE ? $selected = ' selected' : $selected = ''); |
|
| 225 |
$template->set_var('SELECTED', $selected);
|
|
| 226 |
$template->parse('template_list', 'template_list_block', true);
|
|
| 235 | 227 |
} |
| 236 | 228 |
} |
| 237 | 229 |
|
| ... | ... | |
| 581 | 573 |
|
| 582 | 574 |
$admin->print_footer(); |
| 583 | 575 |
|
| 584 |
?> |
|
| 576 |
?> |
|
| trunk/wb/admin/preferences/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 |
| trunk/wb/admin/languages/uninstall.php | ||
|---|---|---|
| 54 | 54 |
// Try to delete the language code |
| 55 | 55 |
if(!unlink(WB_PATH.'/languages/'.$_POST['code'].'.php')) {
|
| 56 | 56 |
$admin->print_error($MESSAGE['GENERIC']['CANNOT_UNINSTALL']); |
| 57 |
} else {
|
|
| 58 |
// Remove entry from DB |
|
| 59 |
$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE directory = '".$_POST['code']."' AND type = 'language' LIMIT 0,1");
|
|
| 57 | 60 |
} |
| 58 | 61 |
|
| 59 | 62 |
// Print success message |
| trunk/wb/admin/languages/install.php | ||
|---|---|---|
| 96 | 96 |
// Chmod the file |
| 97 | 97 |
change_mode($language_file, 'file'); |
| 98 | 98 |
|
| 99 |
// Load language info into DB |
|
| 100 |
load_module(WB_PATH.'/languages/'.$language_file); |
|
| 101 |
|
|
| 99 | 102 |
// Restore to correct language |
| 100 | 103 |
require(WB_PATH.'/languages/'.LANGUAGE.'.php'); |
| 101 | 104 |
|
| trunk/wb/admin/languages/index.php | ||
|---|---|---|
| 37 | 37 |
$template->set_block('main_block', 'language_list_block', 'language_list');
|
| 38 | 38 |
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language'");
|
| 39 | 39 |
if($result->numRows() > 0) {
|
| 40 |
while ($addon = $result->fetchRow()) {
|
|
| 40 |
while($addon = $result->fetchRow()) {
|
|
| 41 | 41 |
$template->set_var('VALUE', $addon['directory']);
|
| 42 | 42 |
$template->set_var('NAME', $addon['name'].' ('.$addon['directory'].')');
|
| 43 | 43 |
$template->parse('language_list', 'language_list_block', true);
|
| trunk/wb/admin/modules/uninstall.php | ||
|---|---|---|
| 54 | 54 |
$admin->print_error($MESSAGE['GENERIC']['CANNOT_UNINSTALL']); |
| 55 | 55 |
} |
| 56 | 56 |
|
| 57 |
$database->query("DELETE FROM ".TABLE_PREFIX."modules WHERE directory =
|
|
| 58 |
'$file'"); |
|
| 57 |
$database->query("DELETE FROM ".TABLE_PREFIX."modules WHERE directory = '$file'");
|
|
| 59 | 58 |
|
| 60 | 59 |
// Run the modules uninstall script if there is one |
| 61 | 60 |
if(file_exists(WB_PATH.'/modules/'.$file.'/uninstall.php')) {
|
| ... | ... | |
| 65 | 64 |
// Try to delete the module dir |
| 66 | 65 |
if(!rm_full_dir(WB_PATH.'/modules/'.$file)) {
|
| 67 | 66 |
$admin->print_error($MESSAGE['MODULES']['CANNOT_UNINSTALL']); |
| 67 |
} else {
|
|
| 68 |
// Remove entry from DB |
|
| 69 |
$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE directory = '".$file."' AND type = 'module' LIMIT 0,1");
|
|
| 68 | 70 |
} |
| 69 | 71 |
|
| 70 | 72 |
// Print success message |
| trunk/wb/admin/modules/install.php | ||
|---|---|---|
| 114 | 114 |
} |
| 115 | 115 |
} |
| 116 | 116 |
|
| 117 |
// Load module info into DB |
|
| 118 |
load_module(WB_PATH.'/modules/'.$module_directory, false); |
|
| 117 | 119 |
|
| 118 |
|
|
| 119 | 120 |
// Run the modules install // upgrade script if there is one |
| 120 | 121 |
if(file_exists(WB_PATH.'/modules/'.$module_directory.'/'.$action.'.php')) {
|
| 121 | 122 |
require(WB_PATH.'/modules/'.$module_directory.'/'.$action.'.php'); |
| ... | ... | |
| 131 | 132 |
$admin->print_success($MESSAGE['GENERIC']['UPGRADED']); |
| 132 | 133 |
} |
| 133 | 134 |
|
| 134 |
|
|
| 135 | 135 |
// Print admin footer |
| 136 | 136 |
$admin->print_footer(); |
| 137 | 137 |
|
| 138 |
?> |
|
| 138 |
?> |
|
Also available in: Unified diff
Fixed addon listing in numerous places so it now use's DB for info