Revision 1712
Added by Dietmar about 12 years ago
details.php | ||
---|---|---|
4 | 4 |
* @category admin |
5 | 5 |
* @package modules |
6 | 6 |
* @author Ryan Djurovich, WebsiteBaker Project |
7 |
* @copyright 2009-2011, Website Baker Org. e.V.
|
|
7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V.
|
|
8 | 8 |
* @link http://www.websitebaker2.org/ |
9 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
10 | 10 |
* @platform WebsiteBaker 2.8.x |
... | ... | |
29 | 29 |
// After check print the header |
30 | 30 |
$admin->print_header(); |
31 | 31 |
|
32 |
$mLang = ModLanguage::getInstance(); |
|
33 |
$mLang->setLanguage(ADMIN_PATH.'/addons/languages/', LANGUAGE, DEFAULT_LANGUAGE); |
|
34 |
|
|
35 |
if(!isset($_POST['file']) OR $_POST['file'] == "") { |
|
36 |
$admin->print_error($MESSAGE['GENERIC_FORGOT_OPTIONS']); |
|
37 |
} else { |
|
38 |
$file = preg_replace('/[^a-z0-9_-]/i', "", $_POST['file']); // fix secunia 2010-92-2 |
|
39 |
} |
|
40 |
|
|
41 |
// Check if the template exists |
|
42 |
if(!is_dir(WB_PATH.'/modules/'.$file)) { |
|
43 |
$admin->print_error($MESSAGE['GENERIC_NOT_INSTALLED']); |
|
44 |
} |
|
45 |
|
|
46 |
// Check if the template exists |
|
47 |
if(!is_readable(WB_PATH.'/modules/'.$file)) { |
|
48 |
$admin->print_error($MESSAGE['ADMIN_INSUFFICIENT_PRIVELLIGES']); |
|
49 |
} |
|
50 |
|
|
51 |
/* |
|
32 | 52 |
// Get module name |
33 | 53 |
if(!isset($_POST['file']) OR $_POST['file'] == "") |
34 | 54 |
{ |
... | ... | |
41 | 61 |
} |
42 | 62 |
|
43 | 63 |
// Check if the module exists |
44 |
if(!file_exists(WB_PATH.'/modules/'.$file)) {
|
|
64 |
if(!is_readable(WB_PATH.'/modules/'.$file)) {
|
|
45 | 65 |
header("Location: index.php"); |
46 | 66 |
exit(0); |
47 | 67 |
} |
68 |
*/ |
|
48 | 69 |
|
49 | 70 |
// Setup template object, parse vars to it, then parse it |
50 | 71 |
// Create new template object |
51 |
$template = new Template(dirname($admin->correct_theme_source('modules_details.htt'))); |
|
72 |
$template = new Template(dirname($admin->correct_theme_source('modules_details.htt')),'keep');
|
|
52 | 73 |
// $template->debug = true; |
53 | 74 |
$template->set_file('page', 'modules_details.htt'); |
54 | 75 |
$template->set_block('page', 'main_block', 'main'); |
... | ... | |
59 | 80 |
$module = $result->fetchRow(); |
60 | 81 |
} |
61 | 82 |
|
83 |
/*-- insert all needed vars from language files ----------------------------------------*/ |
|
84 |
$template->set_var($mLang->getLangArray()); |
|
85 |
|
|
62 | 86 |
// check if a module description exists for the displayed backend language |
63 | 87 |
$tool_description = false; |
64 | 88 |
if(function_exists('file_get_contents') && file_exists(WB_PATH.'/modules/'.$file.'/languages/'.LANGUAGE .'.php')) { |
... | ... | |
72 | 96 |
} else { |
73 | 97 |
$tool_description = false; |
74 | 98 |
} |
75 |
}
|
|
99 |
} |
|
76 | 100 |
if($tool_description !== false) { |
77 | 101 |
// Override the module-description with correct desription in users language |
78 | 102 |
$module['description'] = $tool_description; |
... | ... | |
89 | 113 |
'THEME_URL' => THEME_URL |
90 | 114 |
) |
91 | 115 |
); |
92 |
|
|
116 |
|
|
93 | 117 |
switch ($module['function']) { |
94 | 118 |
case NULL: |
95 | 119 |
$type_name = $TEXT['UNKNOWN']; |
... | ... | |
117 | 141 |
} |
118 | 142 |
$template->set_var('TYPE', $type_name); |
119 | 143 |
|
120 |
// Insert language headings |
|
121 |
$template->set_var(array( |
|
122 |
'HEADING_MODULE_DETAILS' => $HEADING['MODULE_DETAILS'] |
|
123 |
) |
|
124 |
); |
|
125 |
// Insert language text and messages |
|
126 |
$template->set_var(array( |
|
127 |
'TEXT_NAME' => $TEXT['NAME'], |
|
128 |
'TEXT_TYPE' => $TEXT['TYPE'], |
|
129 |
'TEXT_AUTHOR' => $TEXT['AUTHOR'], |
|
130 |
'TEXT_VERSION' => $TEXT['VERSION'], |
|
131 |
'TEXT_DESIGNED_FOR' => $TEXT['DESIGNED_FOR'], |
|
132 |
'TEXT_DESCRIPTION' => $TEXT['DESCRIPTION'], |
|
133 |
'TEXT_BACK' => $TEXT['BACK'] |
|
134 |
) |
|
135 |
); |
|
136 |
|
|
144 |
//// Insert language headings
|
|
145 |
//$template->set_var(array(
|
|
146 |
// 'HEADING_MODULE_DETAILS' => $HEADING['MODULE_DETAILS']
|
|
147 |
// )
|
|
148 |
// );
|
|
149 |
//// Insert language text and messages
|
|
150 |
//$template->set_var(array(
|
|
151 |
// 'TEXT_NAME' => $TEXT['NAME'],
|
|
152 |
// 'TEXT_TYPE' => $TEXT['TYPE'],
|
|
153 |
// 'TEXT_AUTHOR' => $TEXT['AUTHOR'],
|
|
154 |
// 'TEXT_VERSION' => $TEXT['VERSION'],
|
|
155 |
// 'TEXT_DESIGNED_FOR' => $TEXT['DESIGNED_FOR'],
|
|
156 |
// 'TEXT_DESCRIPTION' => $TEXT['DESCRIPTION'],
|
|
157 |
// 'TEXT_BACK' => $TEXT['BACK']
|
|
158 |
// )
|
|
159 |
// );
|
|
160 |
// |
|
137 | 161 |
// Parse module object |
138 | 162 |
$template->parse('main', 'main_block', false); |
139 | 163 |
$template->pparse('output', 'page'); |
Also available in: Unified diff
! update folder admin/addons admin/skel/htt