Project

General

Profile

1 238 stefan
<?php
2 1467 Luisehahne
/**
3
 *
4
 * @category        admin
5
 * @package         templates
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 */
18 238 stefan
19
// Print admin header
20
require('../../config.php');
21
require_once(WB_PATH.'/framework/class.admin.php');
22
$admin = new admin('Addons', 'templates');
23
24
// Setup template object
25 944 Ruebenwurz
$template = new Template(THEME_PATH.'/templates');
26
$template->set_file('page', 'templates.htt');
27 238 stefan
$template->set_block('page', 'main_block', 'main');
28 1355 FrankH
$template->set_var('FTAN', $admin->getFTAN());
29 238 stefan
30
// Insert values into template list
31
$template->set_block('main_block', 'template_list_block', 'template_list');
32 384 Ruebenwurz
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' order by name");
33 238 stefan
if($result->numRows() > 0) {
34
	while($addon = $result->fetchRow()) {
35
		$template->set_var('VALUE', $addon['directory']);
36
		$template->set_var('NAME', $addon['name']);
37
		$template->parse('template_list', 'template_list_block', true);
38
	}
39
}
40
41
// Insert permissions values
42
if($admin->get_permission('templates_install') != true) {
43
	$template->set_var('DISPLAY_INSTALL', 'hide');
44
}
45
if($admin->get_permission('templates_uninstall') != true) {
46
	$template->set_var('DISPLAY_UNINSTALL', 'hide');
47
}
48
if($admin->get_permission('templates_view') != true) {
49
	$template->set_var('DISPLAY_LIST', 'hide');
50
}
51
52
// Insert language headings
53
$template->set_var(array(
54 1457 Luisehahne
					'HEADING_INSTALL_TEMPLATE' => $HEADING['INSTALL_TEMPLATE'],
55
					'HEADING_UNINSTALL_TEMPLATE' => $HEADING['UNINSTALL_TEMPLATE'],
56
					'HEADING_TEMPLATE_DETAILS' => $HEADING['TEMPLATE_DETAILS']
57
				)
58
			);
59
// insert urls
60
$template->set_var(array(
61
					'ADMIN_URL' => ADMIN_URL,
62
					'WB_URL' => WB_URL,
63
					'THEME_URL' => THEME_URL,
64
					'FTAN' => $admin->getFTAN()
65
				)
66
			);
67 238 stefan
// Insert language text and messages
68
$template->set_var(array(
69 928 doc
	'URL_MODULES' => $admin->get_permission('modules') ?
70
		'<a href="' . ADMIN_URL . '/modules/index.php">' . $MENU['MODULES'] . '</a>' : '',
71 1457 Luisehahne
	'URL_LANGUAGES' => $admin->get_permission('languages') ?
72 928 doc
		'<a href="' . ADMIN_URL . '/languages/index.php">' . $MENU['LANGUAGES'] . '</a>' : '',
73 1035 Ruebenwurz
	'URL_ADVANCED' => $admin->get_permission('admintools') ?
74
	'<a href="' . ADMIN_URL . '/modules/index.php?advanced">' . $TEXT['ADVANCED'] . '</a>' : '',
75 928 doc
	'TEXT_INSTALL' => $TEXT['INSTALL'],
76
	'TEXT_UNINSTALL' => $TEXT['UNINSTALL'],
77
	'TEXT_VIEW_DETAILS' => $TEXT['VIEW_DETAILS'],
78
	'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
79 933 doc
	'CHANGE_TEMPLATE_NOTICE' => $MESSAGE['TEMPLATES']['CHANGE_TEMPLATE_NOTICE']
80 928 doc
	)
81
);
82 238 stefan
83
// Parse template object
84
$template->parse('main', 'main_block', false);
85
$template->pparse('output', 'page');
86
87
// Print admin footer
88
$admin->print_footer();