Revision 178
Added by ryan about 19 years ago
trunk/wb/modules/reload/tool.php | ||
---|---|---|
38 | 38 |
if($handle = opendir(WB_PATH.'/modules/')) { |
39 | 39 |
while(false !== ($file = readdir($handle))) { |
40 | 40 |
if($file != '' AND substr($file, 0, 1) != '.' AND $file != 'admin.php' AND $file != 'index.php') { |
41 |
load_module(WB_PATH.'/modules/'.$file, true);
|
|
41 |
load_module(WB_PATH.'/modules/'.$file); |
|
42 | 42 |
} |
43 | 43 |
} |
44 | 44 |
closedir($handle); |
45 | 45 |
} |
46 |
echo $TEXT['MODULES_RELOADED'];
|
|
46 |
echo '<br />'.$MESSAGE['MOD_RELOAD']['MODULES_RELOADED'];
|
|
47 | 47 |
} |
48 | 48 |
if(isset($_POST['reload_templates'])) { |
49 |
|
|
50 |
echo $TEXT['TEMPLATES_RELOADED']; |
|
49 |
// Remove all templates |
|
50 |
$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE type = 'template'"); |
|
51 |
// Load all templates |
|
52 |
if($handle = opendir(WB_PATH.'/templates/')) { |
|
53 |
while(false !== ($file = readdir($handle))) { |
|
54 |
if($file != '' AND substr($file, 0, 1) != '.' AND $file != 'index.php') { |
|
55 |
load_template(WB_PATH.'/templates/'.$file); |
|
56 |
} |
|
57 |
} |
|
58 |
closedir($handle); |
|
59 |
} |
|
60 |
echo '<br />'.$MESSAGE['MOD_RELOAD']['TEMPLATES_RELOADED']; |
|
51 | 61 |
} |
52 | 62 |
if(isset($_POST['reload_languages'])) { |
53 |
|
|
54 |
echo $TEXT['LANGAUGES_RELOADED']; |
|
63 |
// Remove all languages |
|
64 |
$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE type = 'language'"); |
|
65 |
// Load all languages |
|
66 |
if($handle = opendir(WB_PATH.'/languages/')) { |
|
67 |
while(false !== ($file = readdir($handle))) { |
|
68 |
if($file != '' AND substr($file, 0, 1) != '.' AND $file != 'index.php') { |
|
69 |
load_language(WB_PATH.'/languages/'.$file); |
|
70 |
} |
|
71 |
} |
|
72 |
closedir($handle); |
|
73 |
} |
|
74 |
echo '<br />'.$MESSAGE['MOD_RELOAD']['LANGUAGES_RELOADED']; |
|
55 | 75 |
} |
76 |
?> |
|
77 |
<br /><br /> |
|
78 |
<a href="<?php echo $_SERVER['REQUEST_URI']; ?>"><?php echo $TEXT['BACK']; ?></a> |
|
79 |
<?php |
|
56 | 80 |
} else { |
57 |
// Display confirmation |
|
81 |
// Display form |
|
82 |
?> |
|
83 |
<br /> |
|
84 |
<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post"> |
|
85 |
<table cellpadding="4" cellspacing="0" border="0"> |
|
86 |
<tr> |
|
87 |
<td colspan="2"><?php echo $MESSAGE['MOD_RELOAD']['PLEASE_SELECT']; ?>:</td> |
|
88 |
</tr> |
|
89 |
<tr> |
|
90 |
<td width="20"><input type="checkbox" name="reload_modules" id="reload_modules" value="true" /></td> |
|
91 |
<td><label for="reload_modules"><?php echo $MENU['MODULES']; ?></label></td> |
|
92 |
</tr> |
|
93 |
<tr> |
|
94 |
<td><input type="checkbox" name="reload_templates" id="reload_templates" value="true" /></td> |
|
95 |
<td><label for="reload_templates"><?php echo $MENU['TEMPLATES']; ?></label></td> |
|
96 |
</tr> |
|
97 |
<tr> |
|
98 |
<td><input type="checkbox" name="reload_languages" id="reload_languages" value="true" /></td> |
|
99 |
<td><label for="reload_languages"><?php echo $MENU['LANGUAGES']; ?></label></td> |
|
100 |
</tr> |
|
101 |
<tr> |
|
102 |
<td> </td> |
|
103 |
<td> |
|
104 |
<input type="submit" name="submit" value="<?php echo $TEXT['RELOAD']; ?>" onClick="javascript: if(!confirm('<?php echo $TEXT['ARE_YOU_SURE']; ?>')) { return false; }" /> |
|
105 |
</td> |
|
106 |
</tr> |
|
107 |
</table> |
|
108 |
</form> |
|
109 |
<?php |
|
58 | 110 |
} |
59 | 111 |
|
60 | 112 |
?> |
Also available in: Unified diff
Finished reload module