Revision 2098
Added by darkviper almost 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 |
$oTrans = Translate::getInstance();
|
|
21 |
$oTrans->enableAddon('admin\\modules');
|
|
22 | 22 |
require_once(WB_PATH .'/framework/functions.php'); |
23 | 23 |
require_once(WB_PATH.'/framework/class.admin.php'); |
24 | 24 |
// No print admin header |
... | ... | |
26 | 26 |
if( !$admin->checkFTAN() ) |
27 | 27 |
{ |
28 | 28 |
$admin->print_header(); |
29 |
$admin->print_error($mLang->MESSAGE_GENERIC_SECURITY_ACCESS);
|
|
29 |
$admin->print_error($oTrans->MESSAGE_GENERIC_SECURITY_ACCESS);
|
|
30 | 30 |
} |
31 | 31 |
// After check print the header |
32 | 32 |
$admin->print_header(); |
33 | 33 |
|
34 | 34 |
if(!isset($_POST['file']) OR $_POST['file'] == "") { |
35 |
$admin->print_error($mLang->MESSAGE_GENERIC_FORGOT_OPTIONS);
|
|
35 |
$admin->print_error($oTrans->MESSAGE_GENERIC_FORGOT_OPTIONS);
|
|
36 | 36 |
} else { |
37 | 37 |
$file = preg_replace('/[^a-z0-9_-]/i', "", $_POST['file']); // fix secunia 2010-92-2 |
38 | 38 |
} |
39 | 39 |
|
40 | 40 |
// Check if the template exists |
41 | 41 |
if(!is_dir(WB_PATH.'/modules/'.$file)) { |
42 |
$admin->print_error($file.'::'.$mLang->MESSAGE_GENERIC_NOT_INSTALLED);
|
|
42 |
$admin->print_error($file.'::'.$oTrans->MESSAGE_GENERIC_NOT_INSTALLED);
|
|
43 | 43 |
} |
44 | 44 |
|
45 | 45 |
// Check if the template exists |
46 | 46 |
if(!is_readable(WB_PATH.'/modules/'.$file)) { |
47 |
$admin->print_error($mLang->MESSAGE_ADMIN_INSUFFICIENT_PRIVELLIGES);
|
|
47 |
$admin->print_error($oTrans->MESSAGE_ADMIN_INSUFFICIENT_PRIVELLIGES);
|
|
48 | 48 |
} |
49 | 49 |
// Setup template object, parse vars to it, then parse it |
50 | 50 |
// Create new template object |
... | ... | |
52 | 52 |
// $template->debug = true; |
53 | 53 |
$template->set_file('page', 'modules_details.htt'); |
54 | 54 |
$template->set_block('page', 'main_block', 'main'); |
55 |
|
|
55 |
$template->set_var($oTrans->getLangArray()); |
|
56 | 56 |
// Insert values |
57 | 57 |
$module = false; |
58 | 58 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'addons` ' |
... | ... | |
61 | 61 |
if( ($result = $database->query($sql)) ){ |
62 | 62 |
$module = $result->fetchRow(MYSQL_ASSOC); |
63 | 63 |
} |
64 |
if(!$module) { $admin->print_error($mLang->MESSAGE_GENERIC_NOT_INSTALLED); }
|
|
64 |
if(!$module) { $admin->print_error($oTrans->MESSAGE_GENERIC_NOT_INSTALLED); }
|
|
65 | 65 |
/*-- insert all needed vars from language files ----------------------------------------*/ |
66 |
$template->set_var($mLang->getLangArray());
|
|
66 |
$template->set_var($oTrans->getLangArray());
|
|
67 | 67 |
|
68 | 68 |
// check if a module description exists for the displayed backend language |
69 | 69 |
$tool_description = false; |
... | ... | |
98 | 98 |
|
99 | 99 |
switch ($module['function']) { |
100 | 100 |
case NULL: |
101 |
$type_name = $mLang->TEXT_UNKNOWN;
|
|
101 |
$type_name = $oTrans->TEXT_UNKNOWN;
|
|
102 | 102 |
break; |
103 | 103 |
case 'page': |
104 |
$type_name = $mLang->TEXT_PAGE;
|
|
104 |
$type_name = $oTrans->TEXT_PAGE;
|
|
105 | 105 |
break; |
106 | 106 |
case 'wysiwyg': |
107 |
$type_name = $mLang->TEXT_WYSIWYG_EDITOR;
|
|
107 |
$type_name = $oTrans->TEXT_WYSIWYG_EDITOR;
|
|
108 | 108 |
break; |
109 | 109 |
case 'tool': |
110 |
$type_name = $mLang->TEXT_ADMINISTRATION_TOOL;
|
|
110 |
$type_name = $oTrans->TEXT_ADMINISTRATION_TOOL;
|
|
111 | 111 |
break; |
112 | 112 |
case 'admin': |
113 |
$type_name = $mLang->TEXT_ADMIN;
|
|
113 |
$type_name = $oTrans->TEXT_ADMIN;
|
|
114 | 114 |
break; |
115 | 115 |
case 'administration': |
116 |
$type_name = $mLang->TEXT_ADMINISTRATION;
|
|
116 |
$type_name = $oTrans->TEXT_ADMINISTRATION;
|
|
117 | 117 |
break; |
118 | 118 |
case 'snippet': |
119 |
$type_name = $mLang->TEXT_CODE_SNIPPET;
|
|
119 |
$type_name = $oTrans->TEXT_CODE_SNIPPET;
|
|
120 | 120 |
break; |
121 | 121 |
default: |
122 |
$type_name = $mLang->TEXT_UNKNOWN;
|
|
122 |
$type_name = $oTrans->TEXT_UNKNOWN;
|
|
123 | 123 |
} |
124 | 124 |
$template->set_var('TYPE', $type_name); |
125 | 125 |
|
Also available in: Unified diff
! activate class Translate for all addons in admin/ (except pages/)
! class.admin >> add translation of the current theme to Translate