Project

General

Profile

1 238 stefan
<?php
2
3 399 Ruebenwurz
// $Id$
4
5 238 stefan
/*
6
7
 Website Baker Project <http://www.websitebaker.org/>
8 915 Ruebenwurz
 Copyright (C) 2004-2009, Ryan Djurovich
9 238 stefan
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
// Print admin header
27
require('../../config.php');
28
require_once(WB_PATH.'/framework/class.admin.php');
29
$admin = new admin('Addons', 'templates');
30
31
// Setup template object
32 944 Ruebenwurz
$template = new Template(THEME_PATH.'/templates');
33
$template->set_file('page', 'templates.htt');
34 238 stefan
$template->set_block('page', 'main_block', 'main');
35 1355 FrankH
$template->set_var('FTAN', $admin->getFTAN());
36 238 stefan
37
// Insert values into template list
38
$template->set_block('main_block', 'template_list_block', 'template_list');
39 384 Ruebenwurz
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' order by name");
40 238 stefan
if($result->numRows() > 0) {
41
	while($addon = $result->fetchRow()) {
42
		$template->set_var('VALUE', $addon['directory']);
43
		$template->set_var('NAME', $addon['name']);
44
		$template->parse('template_list', 'template_list_block', true);
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 1457 Luisehahne
					'HEADING_INSTALL_TEMPLATE' => $HEADING['INSTALL_TEMPLATE'],
62
					'HEADING_UNINSTALL_TEMPLATE' => $HEADING['UNINSTALL_TEMPLATE'],
63
					'HEADING_TEMPLATE_DETAILS' => $HEADING['TEMPLATE_DETAILS']
64
				)
65
			);
66
// insert urls
67
$template->set_var(array(
68
					'ADMIN_URL' => ADMIN_URL,
69
					'WB_URL' => WB_URL,
70
					'THEME_URL' => THEME_URL,
71
					'FTAN' => $admin->getFTAN()
72
				)
73
			);
74 238 stefan
// Insert language text and messages
75
$template->set_var(array(
76 928 doc
	'URL_MODULES' => $admin->get_permission('modules') ?
77
		'<a href="' . ADMIN_URL . '/modules/index.php">' . $MENU['MODULES'] . '</a>' : '',
78 1457 Luisehahne
	'URL_LANGUAGES' => $admin->get_permission('languages') ?
79 928 doc
		'<a href="' . ADMIN_URL . '/languages/index.php">' . $MENU['LANGUAGES'] . '</a>' : '',
80 1035 Ruebenwurz
	'URL_ADVANCED' => $admin->get_permission('admintools') ?
81
	'<a href="' . ADMIN_URL . '/modules/index.php?advanced">' . $TEXT['ADVANCED'] . '</a>' : '',
82 928 doc
	'TEXT_INSTALL' => $TEXT['INSTALL'],
83
	'TEXT_UNINSTALL' => $TEXT['UNINSTALL'],
84
	'TEXT_VIEW_DETAILS' => $TEXT['VIEW_DETAILS'],
85
	'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
86 933 doc
	'CHANGE_TEMPLATE_NOTICE' => $MESSAGE['TEMPLATES']['CHANGE_TEMPLATE_NOTICE']
87 928 doc
	)
88
);
89 238 stefan
90
// Parse template object
91
$template->parse('main', 'main_block', false);
92
$template->pparse('output', 'page');
93
94
// Print admin footer
95
$admin->print_footer();