| 1 | <?php
 | 
  
    | 2 | /**
 | 
  
    | 3 |  *
 | 
  
    | 4 |  * @category        admin
 | 
  
    | 5 |  * @package         languages
 | 
  
    | 6 |  * @author          WebsiteBaker Project
 | 
  
    | 7 |  * @copyright       2004-2009, Ryan Djurovich
 | 
  
    | 8 |  * @copyright       2009-2011, Website Baker Org. e.V.
 | 
  
    | 9 |  * @link            http://www.websitebaker2.org/
 | 
  
    | 10 |  * @license         http://www.gnu.org/licenses/gpl.html
 | 
  
    | 11 |  * @platform        WebsiteBaker 2.8.x
 | 
  
    | 12 |  * @requirements    PHP 5.2.2 and higher
 | 
  
    | 13 |  * @version         $Id: details.php 1467 2011-07-02 00:06:53Z Luisehahne $
 | 
  
    | 14 |  * @filesource      $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/languages/details.php $
 | 
  
    | 15 |  * @lastmodified    $Date: 2011-07-02 02:06:53 +0200 (Sat, 02 Jul 2011) $
 | 
  
    | 16 |  * @description
 | 
  
    | 17 |  *
 | 
  
    | 18 |  */
 | 
  
    | 19 | 
 | 
  
    | 20 | // Include the config code
 | 
  
    | 21 | require('../../config.php');
 | 
  
    | 22 | 
 | 
  
    | 23 | // Print admin header
 | 
  
    | 24 | require_once(WB_PATH.'/framework/class.admin.php');
 | 
  
    | 25 | $admin = new admin('Addons', 'languages_view', false);
 | 
  
    | 26 | if( !$admin->checkFTAN() )
 | 
  
    | 27 | {
 | 
  
    | 28 | 	$admin->print_header();
 | 
  
    | 29 | 	$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']);
 | 
  
    | 30 | }
 | 
  
    | 31 | // After check print the header
 | 
  
    | 32 | $admin->print_header();
 | 
  
    | 33 | 
 | 
  
    | 34 | // Get language name
 | 
  
    | 35 | if(!isset($_POST['code']) OR $_POST['code'] == "") {
 | 
  
    | 36 | 	$code = '';
 | 
  
    | 37 | } else {
 | 
  
    | 38 | 	$code = $_POST['code'];
 | 
  
    | 39 | }
 | 
  
    | 40 | 
 | 
  
    | 41 | // fix secunia 2010-93-2
 | 
  
    | 42 | if (!preg_match('/^[A-Z]{2}$/', $code)) {
 | 
  
    | 43 | 	header("Location: index.php");
 | 
  
    | 44 | 	exit(0);
 | 
  
    | 45 | }
 | 
  
    | 46 | 
 | 
  
    | 47 | // Check if the language exists
 | 
  
    | 48 | if(!file_exists(WB_PATH.'/languages/'.$code.'.php')) {
 | 
  
    | 49 | 	header("Location: index.php");
 | 
  
    | 50 | 	exit(0);
 | 
  
    | 51 | }
 | 
  
    | 52 | 
 | 
  
    | 53 | // Setup language object
 | 
  
    | 54 | $template = new Template(THEME_PATH.'/templates');
 | 
  
    | 55 | $template->set_file('page', 'languages_details.htt');
 | 
  
    | 56 | $template->set_block('page', 'main_block', 'main');
 | 
  
    | 57 | 
 | 
  
    | 58 | // Insert values
 | 
  
    | 59 | require(WB_PATH.'/languages/'.$code.'.php');
 | 
  
    | 60 | $template->set_var(array(
 | 
  
    | 61 | 								'CODE' => $language_code,
 | 
  
    | 62 | 								'NAME' => $language_name,
 | 
  
    | 63 | 								'AUTHOR' => $language_author,
 | 
  
    | 64 | 								'VERSION' => $language_version,
 | 
  
    | 65 | 								'DESIGNED_FOR' => $language_platform,
 | 
  
    | 66 | 								'ADMIN_URL' => ADMIN_URL,
 | 
  
    | 67 | 								'WB_URL' => WB_URL,
 | 
  
    | 68 | 								'THEME_URL' => THEME_URL
 | 
  
    | 69 | 								)
 | 
  
    | 70 | 						);
 | 
  
    | 71 | 
 | 
  
    | 72 | // Restore language to original code
 | 
  
    | 73 | require(WB_PATH.'/languages/'.LANGUAGE.'.php');
 | 
  
    | 74 | 
 | 
  
    | 75 | // Insert language headings
 | 
  
    | 76 | $template->set_var(array(
 | 
  
    | 77 | 								'HEADING_LANGUAGE_DETAILS' => $HEADING['LANGUAGE_DETAILS']
 | 
  
    | 78 | 								)
 | 
  
    | 79 | 						);
 | 
  
    | 80 | // Insert language text and messages
 | 
  
    | 81 | $template->set_var(array(
 | 
  
    | 82 | 								'TEXT_CODE' => $TEXT['CODE'],
 | 
  
    | 83 | 								'TEXT_NAME' => $TEXT['NAME'],
 | 
  
    | 84 | 								'TEXT_TYPE' => $TEXT['TYPE'],
 | 
  
    | 85 | 								'TEXT_AUTHOR' => $TEXT['AUTHOR'],
 | 
  
    | 86 | 								'TEXT_VERSION' => $TEXT['VERSION'],
 | 
  
    | 87 | 								'TEXT_DESIGNED_FOR' => $TEXT['DESIGNED_FOR'],
 | 
  
    | 88 | 								'TEXT_BACK' => $TEXT['BACK']
 | 
  
    | 89 | 								)
 | 
  
    | 90 | 						);
 | 
  
    | 91 | 
 | 
  
    | 92 | // Parse language object
 | 
  
    | 93 | $template->parse('main', 'main_block', false);
 | 
  
    | 94 | $template->pparse('output', 'page');
 | 
  
    | 95 | 
 | 
  
    | 96 | // Print admin footer
 | 
  
    | 97 | $admin->print_footer();
 |