1
|
<?php
|
2
|
|
3
|
// $Id: details.php 286 2006-01-23 21:15:10Z stefan $
|
4
|
|
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
|
exit(0);
|
33
|
} else {
|
34
|
$file = $_POST['file'];
|
35
|
}
|
36
|
|
37
|
// Check if the module exists
|
38
|
if(!file_exists(WB_PATH.'/modules/'.$file)) {
|
39
|
header("Location: index.php");
|
40
|
exit(0);
|
41
|
}
|
42
|
|
43
|
// Print admin header
|
44
|
require_once(WB_PATH.'/framework/class.admin.php');
|
45
|
$admin = new admin('Addons', 'modules_view');
|
46
|
|
47
|
// Setup module object
|
48
|
$template = new Template(ADMIN_PATH.'/modules');
|
49
|
$template->set_file('page', 'details.html');
|
50
|
$template->set_block('page', 'main_block', 'main');
|
51
|
|
52
|
// Insert values
|
53
|
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND directory = '$file'");
|
54
|
if($result->numRows() > 0) {
|
55
|
$module = $result->fetchRow();
|
56
|
}
|
57
|
|
58
|
$template->set_var(array(
|
59
|
'NAME' => $module['name'],
|
60
|
'AUTHOR' => $module['author'],
|
61
|
'DESCRIPTION' => $module['description'],
|
62
|
'VERSION' => $module['version'],
|
63
|
'DESIGNED_FOR' => $module['platform']
|
64
|
)
|
65
|
);
|
66
|
|
67
|
switch ($module['function']) {
|
68
|
case NULL:
|
69
|
$type_name = $TEXT['UNKNOWN'];
|
70
|
break;
|
71
|
case 'page':
|
72
|
$type_name = $TEXT['PAGE'];
|
73
|
break;
|
74
|
case 'wysiwyg':
|
75
|
$type_name = $TEXT['WYSIWYG_EDITOR'];
|
76
|
break;
|
77
|
case 'tool':
|
78
|
$type_name = $TEXT['ADMINISTRATION_TOOL'];
|
79
|
break;
|
80
|
case 'admin':
|
81
|
$type_name = $TEXT['ADMIN'];
|
82
|
break;
|
83
|
case 'administration':
|
84
|
$type_name = $TEXT['ADMINISTRATION'];
|
85
|
break;
|
86
|
$type_name = $TEXT['unknown'];
|
87
|
}
|
88
|
$template->set_var('TYPE', $type_name);
|
89
|
|
90
|
// Insert language headings
|
91
|
$template->set_var(array(
|
92
|
'HEADING_MODULE_DETAILS' => $HEADING['MODULE_DETAILS']
|
93
|
)
|
94
|
);
|
95
|
// Insert language text and messages
|
96
|
$template->set_var(array(
|
97
|
'TEXT_NAME' => $TEXT['NAME'],
|
98
|
'TEXT_TYPE' => $TEXT['TYPE'],
|
99
|
'TEXT_AUTHOR' => $TEXT['AUTHOR'],
|
100
|
'TEXT_VERSION' => $TEXT['VERSION'],
|
101
|
'TEXT_DESIGNED_FOR' => $TEXT['DESIGNED_FOR'],
|
102
|
'TEXT_DESCRIPTION' => $TEXT['DESCRIPTION'],
|
103
|
'TEXT_BACK' => $TEXT['BACK']
|
104
|
)
|
105
|
);
|
106
|
|
107
|
// Parse module object
|
108
|
$template->parse('main', 'main_block', false);
|
109
|
$template->pparse('output', 'page');
|
110
|
|
111
|
// Print admin footer
|
112
|
$admin->print_footer();
|
113
|
|
114
|
?>
|