Revision 1923
Added by darkviper over 11 years ago
details.php | ||
---|---|---|
17 | 17 |
|
18 | 18 |
// Include the config file |
19 | 19 |
require('../../config.php'); |
20 |
$mLang = Translate::getinstance(); |
|
21 |
$mLang->enableAddon('admin\addons'); |
|
20 | 22 |
require_once(WB_PATH .'/framework/functions.php'); |
21 | 23 |
require_once(WB_PATH.'/framework/class.admin.php'); |
22 | 24 |
// No print admin header |
... | ... | |
24 | 26 |
if( !$admin->checkFTAN() ) |
25 | 27 |
{ |
26 | 28 |
$admin->print_header(); |
27 |
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']);
|
|
29 |
$admin->print_error($mLang->MESSAGE_GENERIC_SECURITY_ACCESS);
|
|
28 | 30 |
} |
29 | 31 |
// After check print the header |
30 | 32 |
$admin->print_header(); |
31 | 33 |
|
32 |
//$mLang = ModLanguage::getInstance(); |
|
33 |
//$mLang->setLanguage(ADMIN_PATH.'/addons/languages/', LANGUAGE, DEFAULT_LANGUAGE); |
|
34 |
$mLang = Translate::getinstance(); |
|
35 |
$mLang->enableAddon('admin\addons'); |
|
36 |
|
|
37 | 34 |
if(!isset($_POST['file']) OR $_POST['file'] == "") { |
38 |
$admin->print_error($MESSAGE['GENERIC_FORGOT_OPTIONS']);
|
|
35 |
$admin->print_error($mLang->MESSAGE_GENERIC_FORGOT_OPTIONS);
|
|
39 | 36 |
} else { |
40 | 37 |
$file = preg_replace('/[^a-z0-9_-]/i', "", $_POST['file']); // fix secunia 2010-92-2 |
41 | 38 |
} |
42 | 39 |
|
43 | 40 |
// Check if the template exists |
44 | 41 |
if(!is_dir(WB_PATH.'/modules/'.$file)) { |
45 |
$admin->print_error($MESSAGE['GENERIC_NOT_INSTALLED']);
|
|
42 |
$admin->print_error($mLang->MESSAGE_GENERIC_NOT_INSTALLED);
|
|
46 | 43 |
} |
47 | 44 |
|
48 | 45 |
// Check if the template exists |
49 | 46 |
if(!is_readable(WB_PATH.'/modules/'.$file)) { |
50 |
$admin->print_error($MESSAGE['ADMIN_INSUFFICIENT_PRIVELLIGES']);
|
|
47 |
$admin->print_error($mLang->MESSAGE_ADMIN_INSUFFICIENT_PRIVELLIGES);
|
|
51 | 48 |
} |
52 |
|
|
53 |
/* |
|
54 |
// Get module name |
|
55 |
if(!isset($_POST['file']) OR $_POST['file'] == "") |
|
56 |
{ |
|
57 |
header("Location: index.php"); |
|
58 |
exit(0); |
|
59 |
} |
|
60 |
else |
|
61 |
{ |
|
62 |
$file = preg_replace('/[^a-z0-9_-]/i', "", $_POST['file']); // fix secunia 2010-92-1 |
|
63 |
} |
|
64 |
|
|
65 |
// Check if the module exists |
|
66 |
if(!is_readable(WB_PATH.'/modules/'.$file)) { |
|
67 |
header("Location: index.php"); |
|
68 |
exit(0); |
|
69 |
} |
|
70 |
*/ |
|
71 |
|
|
72 | 49 |
// Setup template object, parse vars to it, then parse it |
73 | 50 |
// Create new template object |
74 | 51 |
$template = new Template(dirname($admin->correct_theme_source('modules_details.htt')),'keep'); |
... | ... | |
77 | 54 |
$template->set_block('page', 'main_block', 'main'); |
78 | 55 |
|
79 | 56 |
// Insert values |
80 |
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND directory = '$file'"); |
|
81 |
if($result->numRows() > 0) { |
|
82 |
$module = $result->fetchRow(); |
|
57 |
$module = false; |
|
58 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'addons` ' |
|
59 |
. 'WHERE `type`=\'module\' AND `directory`=\''.$file.'\''; |
|
60 |
if( ($result = $database->query($sql)) ){ |
|
61 |
$module = $result->fetchRow(MYSQL_ASSOC); |
|
83 | 62 |
} |
84 |
|
|
63 |
if(!$module) { $admin->print_error($mLang->MESSAGE_GENERIC_NOT_INSTALLED); } |
|
85 | 64 |
/*-- insert all needed vars from language files ----------------------------------------*/ |
86 | 65 |
$template->set_var($mLang->getLangArray()); |
87 | 66 |
|
... | ... | |
147 | 126 |
// Parse module object |
148 | 127 |
$template->parse('main', 'main_block', false); |
149 | 128 |
$template->pparse('output', 'page'); |
150 |
|
|
151 | 129 |
// Print admin footer |
152 | 130 |
$admin->print_footer(); |
Also available in: Unified diff
syncronize project and some small typo corrections in /admin/