Project

General

Profile

1
<?php
2

    
3
// $Id: index.php 944 2009-02-22 09:39:58Z Ruebenwurzel $
4

    
5
/*
6

    
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2009, 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
require('../../config.php');
27
require_once(WB_PATH.'/framework/class.admin.php');
28
$admin = new admin('admintools', 'admintools');
29

    
30
// Include the WB functions file
31
require_once(WB_PATH.'/framework/functions.php');
32

    
33
// Create new template object
34
$template = new Template(THEME_PATH.'/templates');
35
$template->set_file('page', 'admintools.htt');
36
$template->set_block('page', 'main_block', 'main');
37

    
38
// Insert required template variables
39
$template->set_var('ADMIN_URL', ADMIN_URL);
40
$template->set_var('THEME_URL', THEME_URL);
41
$template->set_var('HEADING_ADMINISTRATION_TOOLS', $HEADING['ADMINISTRATION_TOOLS']);
42

    
43
// Insert tools into tool list
44
$template->set_block('main_block', 'tool_list_block', 'tool_list');
45
$results = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'tool' order by name");
46
if($results->numRows() > 0) {
47
	while($tool = $results->fetchRow()) {
48
		$template->set_var('TOOL_NAME', $tool['name']);
49
		$template->set_var('TOOL_DIR', $tool['directory']);
50
		// check if a module description exists for the displayed backend language
51
		$tool_description = false;
52
		if(function_exists('file_get_contents') && file_exists(WB_PATH.'/modules/'.$tool['directory'].'/languages/'.LANGUAGE .'.php')) {
53
			// read contents of the module language file into string
54
			$data = @file_get_contents(WB_PATH .'/modules/' .$tool['directory'] .'/languages/' .LANGUAGE .'.php');
55
			$tool_description = get_variable_content('module_description', $data, true, false);
56
		}		
57
		$template->set_var('TOOL_DESCRIPTION', ($tool_description === False)? $tool['description'] :$tool_description);
58
		$template->parse('tool_list', 'tool_list_block', true);
59
	}
60
} else {
61
	$template->set_var('TOOL_LIST', $TEXT['NONE_FOUND']);	
62
}
63

    
64
// Parse template objects output
65
$template->parse('main', 'main_block', false);
66
$template->pparse('output', 'page');
67

    
68
$admin->print_footer();
69

    
70
?>
(1-1/2)