Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Matthew Vale */ require_once "root.php"; require_once "resources/require.php"; //check permissions require_once "resources/check_auth.php"; if (permission_exists('languages_view')) { //access granted } else { echo "access denied"; exit; } //get http post variables and set them to php variables $reference_language = $_SESSION['domain']['language']['code']; $target_language = check_str($_GET["target_language"]); $app_target = 'resources'; if (count($_POST) > 0) { //set the variables $reference_language = check_str($_POST["reference_language"]); $target_language = check_str($_POST["target_language"]); $app_target = check_str($_POST["app_target"]); $organize_app = check_str($_POST["organize_app"]); $organize_all = check_str($_POST["organize_all"]); } //add multi-lingual support $language = new text; $text = $language->get(); //collect languages $language_text = $language->get('all', $app_target, true); foreach ($language_text as $lang_label => $lang_codes) { $language_labels[] = $lang_label; $reference_text[$lang_label] = $lang_codes[$reference_language]; $target_text[$lang_label] = $lang_codes[$target_language]; } asort($language_labels); if($app_target != 'resources'){ $global_text = $language->get($reference_language, 'resources', true); } unset($language_text); if($organize_app and strlen($app_target) > 0) { $language->organize_language($app_target, false); messages::add("Updated $app_target's app_languages.php"); } if($organize_all) { $files = glob($_SERVER["PROJECT_ROOT"] . "/*/*/app_languages.php"); foreach($files as $file) { $file = preg_replace('/\A.*(\/.*\/.*)\z/', '$1', dirname($file)); $language->organize_language($file, true); } $language->organize_language('resources', true); messages::add("Updated All app_languages.php's"); } //get the list of installed apps from the core and mod directories $config_list = glob($_SERVER["PROJECT_ROOT"] . "/*/*/app_config.php"); $app_list; $x=0; foreach ($config_list as $config_path) { include($config_path); $dirs = explode("/", $config_path); $app_path = $dirs[(sizeof($dirs)-3)] . "/" . $dirs[(sizeof($dirs)-2)]; $app_name = $apps[$x]['name']; if( strlen($app_name) == 0) { $app_name = $app_path; } $app_list[$app_name] = $app_path; $x++; } $theme_list = glob($_SERVER["PROJECT_ROOT"] . "/themes/*/app_languages.php"); foreach ($theme_list as $config_path) { $dirs = explode("/", $config_path); $app_path = $dirs[(sizeof($dirs)-3)] . "/" . $dirs[(sizeof($dirs)-2)]; $app_name = 'Theme - ' . $dirs[(sizeof($dirs)-2)]; $app_list[$app_name] = $app_path; } unset($apps); ksort($app_list); //additional includes require_once "resources/header.php"; require_once "resources/paging.php"; //get variables used to control the order $order_by = $_GET["order_by"]; $order = $_GET["order"]; //show the content echo "

\n"; echo "".$text['title-compare_languages']."
\n"; echo $text['description-compare_languages']."\n"; echo "

\n"; //select comparison echo "".$text['header-compare_languages']."
\n"; echo "
\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; foreach($language->languages as $lang_code){ echo " \n"; echo " \n"; echo " \n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo " ".$text['label-reference_language']."\n"; echo " \n"; echo " ".$text['description-reference_language']."\n"; echo " \n"; echo " ".$text['label-target_language']."\n"; echo " \n"; echo " ".$text['description-target_language']."\n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " ".$text['label-app_target']."\n"; echo "\n"; echo " \n"; echo "
".$text['description-app_target']."\n"; echo "
\n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo "
\n"; echo "
\n"; //render the texts echo "".$text['header-language_results']." for '$app_target/app_languages.php'
\n"; echo "\n"; echo "\n"; echo ""; echo "\n"; if(strlen($target_language) > 0) { echo "\n"; } echo "\n"; $language_count = 0; foreach ($language_labels as $lang_label){ if( preg_match( '/\Alanguage-\w{2}(?:-\w{2})?\z/', $lang_label) ) { continue; } echo "\n"; echo "\n"; echo "\n"; if(strlen($target_language) > 0 ) { echo "\n"; } echo "\n"; $language_count++; } if($language_count == 0){ echo "\n"; } echo "
".$text['label-tag']."$reference_language ".$text["language-$reference_language"]."$target_language ".$text["language-$target_language"]."
$lang_label"; if(isset($global_text[$lang_label])){ echo " !"; } echo ""; if(strlen($reference_text[$lang_label]) == 0) { echo "Missing!"; }else{ echo $reference_text[$lang_label]; } echo ""; if(strlen($target_text[$lang_label]) == 0) { echo "Missing!"; }else{ echo $target_text[$lang_label]; } echo "
Sorry, this app hasn't defined any text
\n"; //include the footer require_once "resources/footer.php"; ?>