| 1 | <?php
 | 
  
    | 2 | 
 | 
  
    | 3 | /*
 | 
  
    | 4 | 
 | 
  
    | 5 |  Website Baker Project <http://www.websitebaker.org/>
 | 
  
    | 6 |  Copyright (C) 2004-2006, Ryan Djurovich
 | 
  
    | 7 | 
 | 
  
    | 8 |  Website Baker is free software; you can redistribute it and/or modify
 | 
  
    | 9 |  it under the terms of the GNU General Public License as published by
 | 
  
    | 10 |  the Free Software Foundation; either version 2 of the License, or
 | 
  
    | 11 |  (at your option) any later version.
 | 
  
    | 12 | 
 | 
  
    | 13 |  Website Baker is distributed in the hope that it will be useful,
 | 
  
    | 14 |  but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
  
    | 15 |  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
  
    | 16 |  GNU General Public License for more details.
 | 
  
    | 17 | 
 | 
  
    | 18 |  You should have received a copy of the GNU General Public License
 | 
  
    | 19 |  along with Website Baker; if not, write to the Free Software
 | 
  
    | 20 |  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 | 
  
    | 21 | 
 | 
  
    | 22 | */
 | 
  
    | 23 | 
 | 
  
    | 24 | // Print admin header
 | 
  
    | 25 | require('../../config.php');
 | 
  
    | 26 | require_once(WB_PATH.'/framework/class.admin.php');
 | 
  
    | 27 | $admin = new admin('Addons', 'templates');
 | 
  
    | 28 | 
 | 
  
    | 29 | // Setup template object
 | 
  
    | 30 | $template = new Template(ADMIN_PATH.'/templates');
 | 
  
    | 31 | $template->set_file('page', 'template.html');
 | 
  
    | 32 | $template->set_block('page', 'main_block', 'main');
 | 
  
    | 33 | 
 | 
  
    | 34 | // Insert values into template list
 | 
  
    | 35 | $template->set_block('main_block', 'template_list_block', 'template_list');
 | 
  
    | 36 | $result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template'");
 | 
  
    | 37 | if($result->numRows() > 0) {
 | 
  
    | 38 | 	while($addon = $result->fetchRow()) {
 | 
  
    | 39 | 		$template->set_var('VALUE', $addon['directory']);
 | 
  
    | 40 | 		$template->set_var('NAME', $addon['name']);
 | 
  
    | 41 | 		$template->parse('template_list', 'template_list_block', true);
 | 
  
    | 42 | 	}
 | 
  
    | 43 | }
 | 
  
    | 44 | 
 | 
  
    | 45 | // Insert permissions values
 | 
  
    | 46 | if($admin->get_permission('templates_install') != true) {
 | 
  
    | 47 | 	$template->set_var('DISPLAY_INSTALL', 'hide');
 | 
  
    | 48 | }
 | 
  
    | 49 | if($admin->get_permission('templates_uninstall') != true) {
 | 
  
    | 50 | 	$template->set_var('DISPLAY_UNINSTALL', 'hide');
 | 
  
    | 51 | }
 | 
  
    | 52 | if($admin->get_permission('templates_view') != true) {
 | 
  
    | 53 | 	$template->set_var('DISPLAY_LIST', 'hide');
 | 
  
    | 54 | }
 | 
  
    | 55 | 
 | 
  
    | 56 | // Insert language headings
 | 
  
    | 57 | $template->set_var(array(
 | 
  
    | 58 | 								'HEADING_INSTALL_TEMPLATE' => $HEADING['INSTALL_TEMPLATE'],
 | 
  
    | 59 | 								'HEADING_UNINSTALL_TEMPLATE' => $HEADING['UNINSTALL_TEMPLATE'],
 | 
  
    | 60 | 								'HEADING_TEMPLATE_DETAILS' => $HEADING['TEMPLATE_DETAILS']
 | 
  
    | 61 | 								)
 | 
  
    | 62 | 						);
 | 
  
    | 63 | // Insert language text and messages
 | 
  
    | 64 | $template->set_var(array(
 | 
  
    | 65 | 								'TEXT_INSTALL' => $TEXT['INSTALL'],
 | 
  
    | 66 | 								'TEXT_UNINSTALL' => $TEXT['UNINSTALL'],
 | 
  
    | 67 | 								'TEXT_VIEW_DETAILS' => $TEXT['VIEW_DETAILS'],
 | 
  
    | 68 | 								'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
 | 
  
    | 69 | 								'CHANGE_TEMPLATE_NOTICE' => $MESSAGE['TEMPLATES']['CHANGE_TEMPLATE_NOTICE']
 | 
  
    | 70 | 								)
 | 
  
    | 71 | 						);
 | 
  
    | 72 | 
 | 
  
    | 73 | // Parse template object
 | 
  
    | 74 | $template->parse('main', 'main_block', false);
 | 
  
    | 75 | $template->pparse('output', 'page');
 | 
  
    | 76 | 
 | 
  
    | 77 | // Print admin footer
 | 
  
    | 78 | $admin->print_footer();
 | 
  
    | 79 | 
 | 
  
    | 80 | ?>
 |