Project

General

Profile

1
<?php
2
/**
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: index.php 1467 2011-07-02 00:06:53Z Luisehahne $
14
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/templates/index.php $
15
 * @lastmodified    $Date: 2011-07-02 02:06:53 +0200 (Sat, 02 Jul 2011) $
16
 *
17
 */
18

    
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
$template = new Template(THEME_PATH.'/templates');
26
$template->set_file('page', 'templates.htt');
27
$template->set_block('page', 'main_block', 'main');
28
$template->set_var('FTAN', $admin->getFTAN());
29

    
30
// Insert values into template list
31
$template->set_block('main_block', 'template_list_block', 'template_list');
32
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' order by name");
33
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
					'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
// Insert language text and messages
68
$template->set_var(array(
69
	'URL_MODULES' => $admin->get_permission('modules') ? 
70
		'<a href="' . ADMIN_URL . '/modules/index.php">' . $MENU['MODULES'] . '</a>' : '',
71
	'URL_LANGUAGES' => $admin->get_permission('languages') ?
72
		'<a href="' . ADMIN_URL . '/languages/index.php">' . $MENU['LANGUAGES'] . '</a>' : '',
73
	'URL_ADVANCED' => $admin->get_permission('admintools') ? 
74
	'<a href="' . ADMIN_URL . '/modules/index.php?advanced">' . $TEXT['ADVANCED'] . '</a>' : '',
75
	'TEXT_INSTALL' => $TEXT['INSTALL'],
76
	'TEXT_UNINSTALL' => $TEXT['UNINSTALL'],
77
	'TEXT_VIEW_DETAILS' => $TEXT['VIEW_DETAILS'],
78
	'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
79
	'CHANGE_TEMPLATE_NOTICE' => $MESSAGE['TEMPLATES']['CHANGE_TEMPLATE_NOTICE']
80
	)
81
);
82

    
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();
(2-2/4)