Project

General

Profile

1
<?php
2

    
3
// $Id: details.php 223 2005-11-19 20:40:44Z 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 template 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 template exists
37
if(!file_exists(WB_PATH.'/templates/'.$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', 'templates_view');
44

    
45
// Setup template object
46
$template = new Template(ADMIN_PATH.'/templates');
47
$template->set_file('page', 'details.html');
48
$template->set_block('page', 'main_block', 'main');
49

    
50
// Insert values
51
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND directory = '$file'");
52
if($result->numRows() > 0) {
53
	$row = $result->fetchRow();
54
}
55

    
56
$template->set_var(array(
57
								'NAME' => $row['name'],
58
								'AUTHOR' => $row['author'],
59
								'DESCRIPTION' => $row['description'],
60
								'VERSION' => $row['version'],
61
								'DESIGNED_FOR' => $row['platform']
62
								)
63
						);
64

    
65
// Insert language headings
66
$template->set_var(array(
67
								'HEADING_TEMPLATE_DETAILS' => $HEADING['TEMPLATE_DETAILS']
68
								)
69
						);
70
// Insert language text and messages
71
$template->set_var(array(
72
								'TEXT_NAME' => $TEXT['NAME'],
73
								'TEXT_AUTHOR' => $TEXT['AUTHOR'],
74
								'TEXT_VERSION' => $TEXT['VERSION'],
75
								'TEXT_DESIGNED_FOR' => $TEXT['DESIGNED_FOR'],
76
								'TEXT_DESCRIPTION' => $TEXT['DESCRIPTION']
77
								)
78
						);
79

    
80
// Parse template object
81
$template->parse('main', 'main_block', false);
82
$template->pparse('output', 'page');
83

    
84
// Print admin footer
85
$admin->print_footer();
86

    
87
?>
(2-2/6)