Project

General

Profile

1
<?php
2

    
3
// $Id: index.php 310 2006-02-19 05:31:10Z ryan $
4

    
5
/*
6

    
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2006, 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('Media', 'media');
30

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

    
36
// Include the WB functions file
37
require_once(WB_PATH.'/framework/functions.php');
38

    
39
// Get home folder not to show
40
$home_folders = get_home_folders();
41

    
42
// Insert values
43
$template->set_block('main_block', 'dir_list_block', 'dir_list');
44
foreach(directory_list(WB_PATH.MEDIA_DIRECTORY) AS $name) {
45
	if(!isset($home_folders[str_replace(WB_PATH.MEDIA_DIRECTORY, '', $name)])) {
46
		$template->set_var('NAME', str_replace(WB_PATH, '', $name));
47
		$template->parse('dir_list', 'dir_list_block', true);
48
	}
49
}
50

    
51
// Insert permissions values
52
if($admin->get_permission('media_create') != true) {
53
	$template->set_var('DISPLAY_CREATE', 'hide');
54
}
55
if($admin->get_permission('media_upload') != true) {
56
	$template->set_var('DISPLAY_UPLOAD', 'hide');
57
}
58

    
59
// Insert language headings
60
$template->set_var(array(
61
								'HEADING_BROWSE_MEDIA' => $HEADING['BROWSE_MEDIA'],
62
								'HEADING_CREATE_FOLDER' => $HEADING['CREATE_FOLDER'],
63
								'HEADING_UPLOAD_FILES' => $HEADING['UPLOAD_FILES']
64
								)
65
						);
66
// Insert language text and messages
67
$template->set_var(array(
68
								'MEDIA_DIRECTORY' => MEDIA_DIRECTORY,
69
								'TEXT_NAME' => $TEXT['TITLE'],
70
								'TEXT_TARGET_FOLDER' => $TEXT['TARGET_FOLDER'],
71
								'TEXT_OVERWRITE_EXISTING' => $TEXT['OVERWRITE_EXISTING'],
72
								'TEXT_FILES' => $TEXT['FILES'],
73
								'TEXT_CREATE_FOLDER' => $TEXT['CREATE_FOLDER'],
74
								'TEXT_UPLOAD_FILES' => $TEXT['UPLOAD_FILES']
75
								)
76
						);
77

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

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

    
85
?>
(6-6/11)