| 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 | 887 | aldus | $results = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'tool' order by name");
 | 
      
        | 45 | 536 | doc | 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 | 587 | doc | 		// check if a module description exists for the displayed backend language
 | 
      
        | 50 |  |  | 		$tool_description = false;
 | 
      
        | 51 |  |  | 		if(function_exists('file_get_contents') && file_exists(WB_PATH.'/modules/'.$tool['directory'].'/languages/'.LANGUAGE .'.php')) {
 | 
      
        | 52 |  |  | 			// read contents of the module language file into string
 | 
      
        | 53 |  |  | 			$data = @file_get_contents(WB_PATH .'/modules/' .$tool['directory'] .'/languages/' .LANGUAGE .'.php');
 | 
      
        | 54 |  |  | 			$tool_description = get_variable_content('module_description', $data, true, false);
 | 
      
        | 55 |  |  | 		}
 | 
      
        | 56 |  |  | 		$template->set_var('TOOL_DESCRIPTION', ($tool_description === False)? $tool['description'] :$tool_description);
 | 
      
        | 57 | 536 | doc | 		$template->parse('tool_list', 'tool_list_block', true);
 | 
      
        | 58 |  |  | 	}
 | 
      
        | 59 |  |  | } else {
 | 
      
        | 60 |  |  | 	$template->set_var('TOOL_LIST', $TEXT['NONE_FOUND']);
 | 
      
        | 61 |  |  | }
 | 
      
        | 62 |  |  | 
 | 
      
        | 63 |  |  | // Parse template objects output
 | 
      
        | 64 |  |  | $template->parse('main', 'main_block', false);
 | 
      
        | 65 |  |  | $template->pparse('output', 'page');
 | 
      
        | 66 |  |  | 
 | 
      
        | 67 |  |  | $admin->print_footer();
 | 
      
        | 68 |  |  | 
 | 
      
        | 69 |  |  | ?>
 |