| 1 | 536 | doc | <?php
 | 
      
        | 2 |  |  | 
 | 
      
        | 3 | 548 | Ruebenwurz | // $Id$
 | 
      
        | 4 | 536 | doc | 
 | 
      
        | 5 |  |  | /*
 | 
      
        | 6 |  |  | 
 | 
      
        | 7 |  |  |  Website Baker Project <http://www.websitebaker.org/>
 | 
      
        | 8 |  |  |  Copyright (C) 2004-2008, 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(ADMIN_PATH.'/admintools');
 | 
      
        | 35 |  |  | $template->set_file('page', 'template.html');
 | 
      
        | 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('HEADING_ADMINISTRATION_TOOLS', $HEADING['ADMINISTRATION_TOOLS']);
 | 
      
        | 41 |  |  | 
 | 
      
        | 42 |  |  | // Insert tools into tool list
 | 
      
        | 43 |  |  | $template->set_block('main_block', 'tool_list_block', 'tool_list');
 | 
      
        | 44 |  |  | $results = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'tool'");
 | 
      
        | 45 |  |  | if($results->numRows() > 0) {
 | 
      
        | 46 |  |  | 	while($tool = $results->fetchRow()) {
 | 
      
        | 47 |  |  | 		$template->set_var('TOOL_NAME', $tool['name']);
 | 
      
        | 48 |  |  | 		$template->set_var('TOOL_DIR', $tool['directory']);
 | 
      
        | 49 |  |  | 		$template->set_var('TOOL_DESCRIPTION', $tool['description']);
 | 
      
        | 50 |  |  | 		$template->parse('tool_list', 'tool_list_block', true);
 | 
      
        | 51 |  |  | 	}
 | 
      
        | 52 |  |  | } else {
 | 
      
        | 53 |  |  | 	$template->set_var('TOOL_LIST', $TEXT['NONE_FOUND']);
 | 
      
        | 54 |  |  | }
 | 
      
        | 55 |  |  | 
 | 
      
        | 56 |  |  | // Parse template objects output
 | 
      
        | 57 |  |  | $template->parse('main', 'main_block', false);
 | 
      
        | 58 |  |  | $template->pparse('output', 'page');
 | 
      
        | 59 |  |  | 
 | 
      
        | 60 |  |  | $admin->print_footer();
 | 
      
        | 61 |  |  | 
 | 
      
        | 62 |  |  | ?>
 |