Project

General

Profile

1
<?php
2

    
3
/*
4

    
5
 Website Baker Project <http://www.websitebaker.org/>
6
 Copyright (C) 2004-2005, Ryan Djurovich
7

    
8
 Website Baker is free software; you can redistribute it and/or modify
9
 it under the terms of the GNU General Public License as published by
10
 the Free Software Foundation; either version 2 of the License, or
11
 (at your option) any later version.
12

    
13
 Website Baker is distributed in the hope that it will be useful,
14
 but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 GNU General Public License for more details.
17

    
18
 You should have received a copy of the GNU General Public License
19
 along with Website Baker; if not, write to the Free Software
20
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21

    
22
*/
23

    
24
// Print admin header
25
require('../../config.php');
26
require_once(WB_PATH.'/framework/class.admin.php');
27
$admin = new admin('Addons', 'templates');
28

    
29
// Setup template object
30
$template = new Template(ADMIN_PATH.'/templates');
31
$template->set_file('page', 'template.html');
32
$template->set_block('page', 'main_block', 'main');
33

    
34
// Insert values into template list
35
$template->set_block('main_block', 'template_list_block', 'template_list');
36
if($handle = opendir(WB_PATH.'/templates/')) {
37
	while (false !== ($file = readdir($handle))) {
38
		if($file != "." AND $file != ".." AND $file != ".svn" AND is_dir(WB_PATH."/templates/$file") AND file_exists(WB_PATH."/templates/$file/info.php")) {
39
			// Include the templates info file
40
			require(WB_PATH.'/templates/'.$file.'/info.php');
41
			$template->set_var('VALUE', $file);
42
			$template->set_var('NAME', $template_name);
43
			$template->parse('template_list', 'template_list_block', true);
44
		}
45
	}
46
}
47

    
48
// Insert permissions values
49
if($admin->get_permission('templates_install') != true) {
50
	$template->set_var('DISPLAY_INSTALL', 'hide');
51
}
52
if($admin->get_permission('templates_uninstall') != true) {
53
	$template->set_var('DISPLAY_UNINSTALL', 'hide');
54
}
55
if($admin->get_permission('templates_view') != true) {
56
	$template->set_var('DISPLAY_LIST', 'hide');
57
}
58

    
59
// Insert language headings
60
$template->set_var(array(
61
								'HEADING_INSTALL_TEMPLATE' => $HEADING['INSTALL_TEMPLATE'],
62
								'HEADING_UNINSTALL_TEMPLATE' => $HEADING['UNINSTALL_TEMPLATE'],
63
								'HEADING_TEMPLATE_DETAILS' => $HEADING['TEMPLATE_DETAILS']
64
								)
65
						);
66
// Insert language text and messages
67
$template->set_var(array(
68
								'TEXT_INSTALL' => $TEXT['INSTALL'],
69
								'TEXT_UNINSTALL' => $TEXT['UNINSTALL'],
70
								'TEXT_VIEW_DETAILS' => $TEXT['VIEW_DETAILS'],
71
								'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
72
								'CHANGE_TEMPLATE_NOTICE' => $MESSAGE['TEMPLATES']['CHANGE_TEMPLATE_NOTICE']
73
								)
74
						);
75

    
76
// Parse template object
77
$template->parse('main', 'main_block', false);
78
$template->pparse('output', 'page');
79

    
80
// Print admin footer
81
$admin->print_footer();
82

    
83
?>
(3-3/6)