Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         templates
6
 * @author          Ryan Djurovich, WebsiteBaker Project
7
 * @copyright       2009-2011, Website Baker Org. e.V.
8
 * @link			http://www.websitebaker2.org/
9
 * @license         http://www.gnu.org/licenses/gpl.html
10
 * @platform        WebsiteBaker 2.8.x
11
 * @requirements    PHP 5.2.2 and higher
12
 * @version         $Id: index.php 1529 2011-11-25 05:03:32Z Luisehahne $
13
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/templates/index.php $
14
 * @lastmodified    $Date: 2011-11-25 06:03:32 +0100 (Fri, 25 Nov 2011) $
15
 *
16
 */
17

    
18
// Print admin header
19
require('../../config.php');
20
require_once(WB_PATH.'/framework/class.admin.php');
21
$admin = new admin('Addons', 'templates');
22

    
23
// Setup template object, parse vars to it, then parse it
24
$ThemePath = realpath(WB_PATH.$admin->correct_theme_source('templates.htt'));
25
// Create new template object
26
$template = new Template($ThemePath);
27
// $template->debug = true;
28
$template->set_file('page', 'templates.htt');
29
$template->set_block('page', 'main_block', 'main');
30
$template->set_var('FTAN', $admin->getFTAN());
31

    
32
// Insert values into template list
33
$template->set_block('main_block', 'template_list_block', 'template_list');
34
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' order by name");
35
if($result->numRows() > 0) {
36
	while($addon = $result->fetchRow()) {
37
		$template->set_var('VALUE', $addon['directory']);
38
		$template->set_var('NAME', $addon['name']);
39
		$template->parse('template_list', 'template_list_block', true);
40
	}
41
}
42

    
43
// Insert permissions values
44
if($admin->get_permission('templates_install') != true) {
45
	$template->set_var('DISPLAY_INSTALL', 'hide');
46
}
47
if($admin->get_permission('templates_uninstall') != true) {
48
	$template->set_var('DISPLAY_UNINSTALL', 'hide');
49
}
50
if($admin->get_permission('templates_view') != true) {
51
	$template->set_var('DISPLAY_LIST', 'hide');
52
}
53

    
54
// Insert language headings
55
$template->set_var(array(
56
					'HEADING_INSTALL_TEMPLATE' => $HEADING['INSTALL_TEMPLATE'],
57
					'HEADING_UNINSTALL_TEMPLATE' => $HEADING['UNINSTALL_TEMPLATE'],
58
					'HEADING_TEMPLATE_DETAILS' => $HEADING['TEMPLATE_DETAILS']
59
				)
60
			);
61
// insert urls
62
$template->set_var(array(
63
					'ADMIN_URL' => ADMIN_URL,
64
					'WB_URL' => WB_URL,
65
					'THEME_URL' => THEME_URL,
66
					'FTAN' => $admin->getFTAN()
67
				)
68
			);
69
// Insert language text and messages
70
$template->set_var(array(
71
	'URL_MODULES' => $admin->get_permission('modules') ? 
72
		'<a href="' . ADMIN_URL . '/modules/index.php">' . $MENU['MODULES'] . '</a>' : '',
73
	'URL_LANGUAGES' => $admin->get_permission('languages') ?
74
		'<a href="' . ADMIN_URL . '/languages/index.php">' . $MENU['LANGUAGES'] . '</a>' : '',
75
	'URL_ADVANCED' => '&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;',
76
	'TEXT_INSTALL' => $TEXT['INSTALL'],
77
	'TEXT_UNINSTALL' => $TEXT['UNINSTALL'],
78
	'TEXT_VIEW_DETAILS' => $TEXT['VIEW_DETAILS'],
79
	'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
80
	'CHANGE_TEMPLATE_NOTICE' => $MESSAGE['TEMPLATES']['CHANGE_TEMPLATE_NOTICE']
81
	)
82
);
83

    
84
// Parse template object
85
$template->parse('main', 'main_block', false);
86
$template->pparse('output', 'page');
87

    
88
// Print admin footer
89
$admin->print_footer();
(2-2/4)