diff --git a/app/languages/app_config.php b/app/languages/app_config.php new file mode 100644 index 0000000000..70a4f3594d --- /dev/null +++ b/app/languages/app_config.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/app/languages/app_languages.php b/app/languages/app_languages.php new file mode 100644 index 0000000000..0ec13a9de0 --- /dev/null +++ b/app/languages/app_languages.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/app/languages/app_menu.php b/app/languages/app_menu.php new file mode 100644 index 0000000000..56ca2215b0 --- /dev/null +++ b/app/languages/app_menu.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/app/languages/index.php b/app/languages/index.php new file mode 100644 index 0000000000..3cb3919319 --- /dev/null +++ b/app/languages/index.php @@ -0,0 +1,100 @@ + + 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; + } + +//add multi-lingual support + $language = new text; + $text = $language->get(); + +//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 " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "
".$text['title-languages']." 
\n"; + echo " ".$text['description-languages']."

\n"; + echo "
\n"; + + +//table headers + echo "\n"; + echo "\n"; + echo "\n"; + echo th_order_by('language_code', $text['label-culture_code'], $order_by, $order, '', "style='width:4em;'"); + echo th_order_by('language_name', $text['label-name'], $order_by, $order); + echo "\n"; + + $c= 0; + $warn_about_wrong_culture = false; + foreach($_SESSION['app']['languages'] as $lang_code){ //TODO add sorting + $tr_link = "href='languages_compare.php?target_language=$lang_code'"; + echo "\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + $c++; + } +//complete the content + echo "
".$text['label-flag']."
"; + echo "$lang_code$lang_code"; + if(strlen($lang_code) < 5){ + $warn_about_wrong_culture = true; + echo "$nbsp;*1"; + } + echo "".$text["language-$lang_code"]."
"; + if($warn_about_wrong_culture){ + $lang_code = $_SESSION['domain']['language']['code']; + echo "

*1 ".$text['warning-incorrect_language_culture_code']."https://msdn.microsoft.com/$lang_code/library/ee825488%28v=cs.20%29.aspx

"; + } + +//include the footer + require_once "resources/footer.php"; + +?> \ No newline at end of file diff --git a/app/languages/languages_compare.php b/app/languages/languages_compare.php new file mode 100644 index 0000000000..a1fe994ac7 --- /dev/null +++ b/app/languages/languages_compare.php @@ -0,0 +1,230 @@ + + 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"]); + } + +//collect languages + $language = new text; + + $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]; + } + sort($language_labels); + + if($app_target != 'resources'){ + $global_text = $language->get($reference_language, 'resources', true); + } + unset($language_text); + +//add multi-lingual support + $text = $language->get(); + +//get the list of installed apps from the core and mod directories + $config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/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["DOCUMENT_ROOT"] . PROJECT_PATH . "/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"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo " ".$text['label-reference_language']."\n"; + echo "\n"; + echo "
"; + foreach($_SESSION['app']['languages'] as $lang_code){ + echo "
"; + echo " \n"; + echo "
"; + } + echo "
"; + echo "
".$text['description-reference_language']."\n"; + echo "
\n"; + echo " ".$text['label-target_language']."\n"; + echo "\n"; + echo "
"; + foreach($_SESSION['app']['languages'] as $lang_code){ + echo "
"; + echo " \n"; + echo "
"; + } + echo "
"; + echo "
".$text['description-app_target']."\n"; + echo "
\n"; + echo " ".$text['label-application']."\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"; + +//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) ) { break; } + 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"; + +?> \ No newline at end of file diff --git a/app/languages/root.php b/app/languages/root.php new file mode 100644 index 0000000000..e791876a14 --- /dev/null +++ b/app/languages/root.php @@ -0,0 +1,52 @@ + + Portions created by the Initial Developer are Copyright (C) 2008-2012 + the Initial Developer. All Rights Reserved. + + Contributor(s): + Mark J Crane + + Callblock is written by Gerrit Visser +*/ + +// make sure the PATH_SEPARATOR is defined + if (!defined("PATH_SEPARATOR")) { + if ( strpos( $_ENV[ "OS" ], "Win" ) !== false ) { define("PATH_SEPARATOR", ";"); } else { define("PATH_SEPARATOR", ":"); } + } + +// make sure the document_root is set + $_SERVER["SCRIPT_FILENAME"] = str_replace("\\", "/", $_SERVER["SCRIPT_FILENAME"]); + $_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]); + $_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]); + //echo "DOCUMENT_ROOT: ".$_SERVER["DOCUMENT_ROOT"]."
\n"; + //echo "PHP_SELF: ".$_SERVER["PHP_SELF"]."
\n"; + //echo "SCRIPT_FILENAME: ".$_SERVER["SCRIPT_FILENAME"]."
\n"; + +// if the project directory exists then add it to the include path otherwise add the document root to the include path + if (is_dir($_SERVER["DOCUMENT_ROOT"].'/fusionpbx')){ + if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', '/fusionpbx'); } + set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER["DOCUMENT_ROOT"].'/fusionpbx' ); + } + else { + if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', ''); } + set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] ); + } + +?> \ No newline at end of file diff --git a/resources/classes/text.php b/resources/classes/text.php index 737dda4844..39f5ec4b2f 100644 --- a/resources/classes/text.php +++ b/resources/classes/text.php @@ -25,9 +25,11 @@ class text { * @var string $language_code examples: en-us, es-cl, fr-fr, pt-pt * @var string $app_path examples: app/exec or core/domains */ - public function get($language_code = null, $app_path = null) { + public function get($language_code = null, $app_path = null, $exclude_global = false) { //get the global app_languages.php - include $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/app_languages.php"; + if(!$exclude_global){ + include $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/app_languages.php"; + } //get the app_languages.php if ($app_path != null) { $lang_path = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/".$app_path."/app_languages.php"; diff --git a/themes/accessible/images/warning.png b/themes/accessible/images/warning.png new file mode 100644 index 0000000000..628cf2dae3 Binary files /dev/null and b/themes/accessible/images/warning.png differ diff --git a/themes/enhanced/images/warning.png b/themes/enhanced/images/warning.png new file mode 100644 index 0000000000..628cf2dae3 Binary files /dev/null and b/themes/enhanced/images/warning.png differ diff --git a/themes/minimized/images/warning.png b/themes/minimized/images/warning.png new file mode 100644 index 0000000000..628cf2dae3 Binary files /dev/null and b/themes/minimized/images/warning.png differ