Revision 16
Added by stefan about 20 years ago
| index.php | ||
|---|---|---|
| 1 |
<?php |
|
| 2 |
|
|
| 3 |
// $Id: index.php,v 1.2 2005/04/02 06:25:37 rdjurovich Exp $
|
|
| 4 |
|
|
| 5 |
/* |
|
| 6 |
|
|
| 7 |
Website Baker Project <http://www.websitebaker.org/> |
|
| 8 |
Copyright (C) 2004-2005, 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('Addons', 'languages');
|
|
| 30 |
|
|
| 31 |
// Setup template object |
|
| 32 |
$template = new Template(ADMIN_PATH.'/languages'); |
|
| 33 |
$template->set_file('page', 'template.html');
|
|
| 34 |
$template->set_block('page', 'main_block', 'main');
|
|
| 35 |
|
|
| 36 |
// Insert values into language list |
|
| 37 |
$template->set_block('main_block', 'language_list_block', 'language_list');
|
|
| 1 |
<?php
|
|
| 2 |
|
|
| 3 |
// $Id$
|
|
| 4 |
|
|
| 5 |
/*
|
|
| 6 |
|
|
| 7 |
Website Baker Project <http://www.websitebaker.org/>
|
|
| 8 |
Copyright (C) 2004-2005, 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('Addons', 'languages');
|
|
| 30 |
|
|
| 31 |
// Setup template object
|
|
| 32 |
$template = new Template(ADMIN_PATH.'/languages');
|
|
| 33 |
$template->set_file('page', 'template.html');
|
|
| 34 |
$template->set_block('page', 'main_block', 'main');
|
|
| 35 |
|
|
| 36 |
// Insert values into language list
|
|
| 37 |
$template->set_block('main_block', 'language_list_block', 'language_list');
|
|
| 38 | 38 |
if ($handle = opendir(WB_PATH.'/languages/')) {
|
| 39 | 39 |
while (false !== ($file = readdir($handle))) {
|
| 40 |
if($file != '.' AND $file != '..' AND $file != 'CVS' AND $file != 'index.php') {
|
|
| 41 |
// Include the languages info file |
|
| 42 |
require(WB_PATH.'/languages/'.$file); |
|
| 43 |
$template->set_var('VALUE', $language_code);
|
|
| 44 |
$template->set_var('NAME', $language_name.' ('.$language_code.')');
|
|
| 45 |
$template->parse('language_list', 'language_list_block', true);
|
|
| 46 |
} |
|
| 47 |
} |
|
| 48 |
// Restore language to original file |
|
| 49 |
require(WB_PATH.'/languages/'.LANGUAGE.'.php'); |
|
| 50 |
} |
|
| 51 |
|
|
| 52 |
// Insert permissions values |
|
| 53 |
if($admin->get_permission('languages_install') != true) {
|
|
| 54 |
$template->set_var('DISPLAY_INSTALL', 'hide');
|
|
| 55 |
} |
|
| 56 |
if($admin->get_permission('languages_uninstall') != true) {
|
|
| 57 |
$template->set_var('DISPLAY_UNINSTALL', 'hide');
|
|
| 58 |
} |
|
| 59 |
if($admin->get_permission('languages_view') != true) {
|
|
| 60 |
$template->set_var('DISPLAY_LIST', 'hide');
|
|
| 61 |
} |
|
| 62 |
|
|
| 63 |
// Insert language headings |
|
| 64 |
$template->set_var(array( |
|
| 65 |
'HEADING_INSTALL_LANGUAGE' => $HEADING['INSTALL_LANGUAGE'], |
|
| 66 |
'HEADING_UNINSTALL_LANGUAGE' => $HEADING['UNINSTALL_LANGUAGE'], |
|
| 67 |
'HEADING_LANGUAGE_DETAILS' => $HEADING['LANGUAGE_DETAILS'] |
|
| 68 |
) |
|
| 69 |
); |
|
| 70 |
// Insert language text and messages |
|
| 71 |
$template->set_var(array( |
|
| 72 |
'TEXT_INSTALL' => $TEXT['INSTALL'], |
|
| 73 |
'TEXT_UNINSTALL' => $TEXT['UNINSTALL'], |
|
| 74 |
'TEXT_VIEW_DETAILS' => $TEXT['VIEW_DETAILS'], |
|
| 75 |
'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'] |
|
| 76 |
) |
|
| 77 |
); |
|
| 78 |
|
|
| 79 |
// Parse template object |
|
| 80 |
$template->parse('main', 'main_block', false);
|
|
| 81 |
$template->pparse('output', 'page');
|
|
| 82 |
|
|
| 83 |
// Print admin footer |
|
| 84 |
$admin->print_footer(); |
|
| 85 |
|
|
| 86 |
?> |
|
| 40 |
if($file != '.' AND $file != '..' AND $file != '.svn' AND $file != 'index.php') {
|
|
| 41 |
// Include the languages info file |
|
| 42 |
require(WB_PATH.'/languages/'.$file); |
|
| 43 |
$template->set_var('VALUE', $language_code);
|
|
| 44 |
$template->set_var('NAME', $language_name.' ('.$language_code.')');
|
|
| 45 |
$template->parse('language_list', 'language_list_block', true);
|
|
| 46 |
} |
|
| 47 |
} |
|
| 48 |
// Restore language to original file |
|
| 49 |
require(WB_PATH.'/languages/'.LANGUAGE.'.php'); |
|
| 50 |
} |
|
| 51 |
|
|
| 52 |
// Insert permissions values |
|
| 53 |
if($admin->get_permission('languages_install') != true) {
|
|
| 54 |
$template->set_var('DISPLAY_INSTALL', 'hide');
|
|
| 55 |
} |
|
| 56 |
if($admin->get_permission('languages_uninstall') != true) {
|
|
| 57 |
$template->set_var('DISPLAY_UNINSTALL', 'hide');
|
|
| 58 |
} |
|
| 59 |
if($admin->get_permission('languages_view') != true) {
|
|
| 60 |
$template->set_var('DISPLAY_LIST', 'hide');
|
|
| 61 |
} |
|
| 62 |
|
|
| 63 |
// Insert language headings |
|
| 64 |
$template->set_var(array( |
|
| 65 |
'HEADING_INSTALL_LANGUAGE' => $HEADING['INSTALL_LANGUAGE'], |
|
| 66 |
'HEADING_UNINSTALL_LANGUAGE' => $HEADING['UNINSTALL_LANGUAGE'], |
|
| 67 |
'HEADING_LANGUAGE_DETAILS' => $HEADING['LANGUAGE_DETAILS'] |
|
| 68 |
) |
|
| 69 |
); |
|
| 70 |
// Insert language text and messages |
|
| 71 |
$template->set_var(array( |
|
| 72 |
'TEXT_INSTALL' => $TEXT['INSTALL'], |
|
| 73 |
'TEXT_UNINSTALL' => $TEXT['UNINSTALL'], |
|
| 74 |
'TEXT_VIEW_DETAILS' => $TEXT['VIEW_DETAILS'], |
|
| 75 |
'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'] |
|
| 76 |
) |
|
| 77 |
); |
|
| 78 |
|
|
| 79 |
// Parse template object |
|
| 80 |
$template->parse('main', 'main_block', false);
|
|
| 81 |
$template->pparse('output', 'page');
|
|
| 82 |
|
|
| 83 |
// Print admin footer |
|
| 84 |
$admin->print_footer(); |
|
| 85 |
|
|
| 86 |
?> |
|
Also available in: Unified diff
Reduced redundant initialization code, removed further 'CVS' occurrences. Made $admin accessible in page_content function.