Project

General

Profile

1
<?php
2

    
3
// $Id: index.php 10 2005-09-04 08:59:31Z ryan $
4

    
5
/*
6

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

    
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', 'modules');
30

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

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

    
50
// Insert permissions values
51
if($admin->get_permission('modules_install') != true) {
52
	$template->set_var('DISPLAY_INSTALL', 'hide');
53
}
54
if($admin->get_permission('modules_uninstall') != true) {
55
	$template->set_var('DISPLAY_UNINSTALL', 'hide');
56
}
57
if($admin->get_permission('modules_view') != true) {
58
	$template->set_var('DISPLAY_LIST', 'hide');
59
}
60

    
61
// Insert language headings
62
$template->set_var(array(
63
								'HEADING_INSTALL_MODULE' => $HEADING['INSTALL_MODULE'],
64
								'HEADING_UNINSTALL_MODULE' => $HEADING['UNINSTALL_MODULE'],
65
								'HEADING_MODULE_DETAILS' => $HEADING['MODULE_DETAILS']
66
								)
67
						);
68
// Insert language text and messages
69
$template->set_var(array(
70
								'TEXT_INSTALL' => $TEXT['INSTALL'],
71
								'TEXT_UNINSTALL' => $TEXT['UNINSTALL'],
72
								'TEXT_VIEW_DETAILS' => $TEXT['VIEW_DETAILS'],
73
								'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT']
74
								)
75
						);
76

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

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

    
84
?>
(3-3/6)