1 |
4
|
ryan
|
<?php
|
2 |
|
|
|
3 |
223
|
stefan
|
// $Id$
|
4 |
4
|
ryan
|
|
5 |
|
|
/*
|
6 |
|
|
|
7 |
|
|
Website Baker Project <http://www.websitebaker.org/>
|
8 |
|
|
Copyright (C) 2004-2005, Ryan Djurovich
|
9 |
|
|
|
10 |
|
|
Website Baker is free software; you can redistribute it and/or modify
|
11 |
|
|
it under the terms of the GNU General Public License as published by
|
12 |
|
|
the Free Software Foundation; either version 2 of the License, or
|
13 |
|
|
(at your option) any later version.
|
14 |
|
|
|
15 |
|
|
Website Baker is distributed in the hope that it will be useful,
|
16 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18 |
|
|
GNU General Public License for more details.
|
19 |
|
|
|
20 |
|
|
You should have received a copy of the GNU General Public License
|
21 |
|
|
along with Website Baker; if not, write to the Free Software
|
22 |
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
23 |
|
|
|
24 |
|
|
*/
|
25 |
|
|
|
26 |
|
|
// Include the config file
|
27 |
|
|
require('../../config.php');
|
28 |
|
|
|
29 |
|
|
// Get module name
|
30 |
|
|
if(!isset($_POST['file']) OR $_POST['file'] == "") {
|
31 |
|
|
header("Location: index.php");
|
32 |
|
|
} else {
|
33 |
|
|
$file = $_POST['file'];
|
34 |
|
|
}
|
35 |
|
|
|
36 |
|
|
// Check if the module exists
|
37 |
|
|
if(!file_exists(WB_PATH.'/modules/'.$file)) {
|
38 |
|
|
header("Location: index.php");
|
39 |
|
|
}
|
40 |
|
|
|
41 |
|
|
// Print admin header
|
42 |
|
|
require_once(WB_PATH.'/framework/class.admin.php');
|
43 |
|
|
$admin = new admin('Addons', 'modules_view');
|
44 |
|
|
|
45 |
|
|
// Setup module object
|
46 |
|
|
$template = new Template(ADMIN_PATH.'/modules');
|
47 |
|
|
$template->set_file('page', 'details.html');
|
48 |
|
|
$template->set_block('page', 'main_block', 'main');
|
49 |
|
|
|
50 |
|
|
// Insert values
|
51 |
223
|
stefan
|
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND directory = '$file'");
|
52 |
|
|
if($result->numRows() > 0) {
|
53 |
|
|
$module = $result->fetchRow();
|
54 |
|
|
}
|
55 |
|
|
|
56 |
4
|
ryan
|
$template->set_var(array(
|
57 |
223
|
stefan
|
'NAME' => $module['name'],
|
58 |
|
|
'AUTHOR' => $module['author'],
|
59 |
|
|
'DESCRIPTION' => $module['description'],
|
60 |
|
|
'VERSION' => $module['version'],
|
61 |
|
|
'DESIGNED_FOR' => $module['platform']
|
62 |
4
|
ryan
|
)
|
63 |
|
|
);
|
64 |
223
|
stefan
|
|
65 |
|
|
switch ($module['function']) {
|
66 |
|
|
case NULL:
|
67 |
|
|
$type_name = $TEXT['UNKNOWN'];
|
68 |
|
|
break;
|
69 |
|
|
case 'page':
|
70 |
|
|
$type_name = $TEXT['PAGE'];
|
71 |
|
|
break;
|
72 |
|
|
case 'wysiwyg':
|
73 |
|
|
$type_name = $TEXT['WYSIWYG_EDITOR'];
|
74 |
|
|
break;
|
75 |
|
|
case 'tool':
|
76 |
|
|
$type_name = $TEXT['ADMINISTRATION_TOOL'];
|
77 |
|
|
break;
|
78 |
|
|
case 'admin':
|
79 |
|
|
$type_name = $TEXT['ADMIN'];
|
80 |
|
|
break;
|
81 |
|
|
case 'administration':
|
82 |
|
|
$type_name = $TEXT['ADMINISTRATION'];
|
83 |
|
|
break;
|
84 |
|
|
$type_name = $TEXT['unknown'];
|
85 |
4
|
ryan
|
}
|
86 |
|
|
$template->set_var('TYPE', $type_name);
|
87 |
|
|
|
88 |
|
|
// Insert language headings
|
89 |
|
|
$template->set_var(array(
|
90 |
|
|
'HEADING_MODULE_DETAILS' => $HEADING['MODULE_DETAILS']
|
91 |
|
|
)
|
92 |
|
|
);
|
93 |
|
|
// Insert language text and messages
|
94 |
|
|
$template->set_var(array(
|
95 |
|
|
'TEXT_NAME' => $TEXT['NAME'],
|
96 |
|
|
'TEXT_TYPE' => $TEXT['TYPE'],
|
97 |
|
|
'TEXT_AUTHOR' => $TEXT['AUTHOR'],
|
98 |
|
|
'TEXT_VERSION' => $TEXT['VERSION'],
|
99 |
|
|
'TEXT_DESIGNED_FOR' => $TEXT['DESIGNED_FOR'],
|
100 |
|
|
'TEXT_DESCRIPTION' => $TEXT['DESCRIPTION']
|
101 |
|
|
)
|
102 |
|
|
);
|
103 |
|
|
|
104 |
|
|
// Parse module object
|
105 |
|
|
$template->parse('main', 'main_block', false);
|
106 |
|
|
$template->pparse('output', 'page');
|
107 |
|
|
|
108 |
|
|
// Print admin footer
|
109 |
|
|
$admin->print_footer();
|
110 |
|
|
|
111 |
|
|
?>
|