diff options
author | filip <filip.komar@gmail.com> | 2016-07-06 23:14:44 +0200 |
---|---|---|
committer | filip <filip.komar@gmail.com> | 2016-07-06 23:14:44 +0200 |
commit | adfbcb8f9a868b7723bd7285f1cadbd4564c8720 (patch) | |
tree | 515965362de9e3ed42a87572e6ffdf9c2473ae94 | |
parent | ea858e88684c4edee358b4271058e4e224ec2a07 (diff) | |
download | www-adfbcb8f9a868b7723bd7285f1cadbd4564c8720.tar www-adfbcb8f9a868b7723bd7285f1cadbd4564c8720.tar.gz www-adfbcb8f9a868b7723bd7285f1cadbd4564c8720.tar.bz2 www-adfbcb8f9a868b7723bd7285f1cadbd4564c8720.tar.xz www-adfbcb8f9a868b7723bd7285f1cadbd4564c8720.zip |
accept only languages or resource that are present and warn if not
-rw-r--r-- | langs/report.php | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/langs/report.php b/langs/report.php index bb14bd3e6..74bc56f68 100644 --- a/langs/report.php +++ b/langs/report.php @@ -48,18 +48,24 @@ $one_language_all_resources = FALSE; $all_languages_only_one_resource = FALSE; + $otherLangs = get_other_langs(); if (isset($one_language) && $one_language != 'all') { - $one_language_all_resources = TRUE; - $otherLangs = array('en', $one_language); - } else { - $otherLangs = get_other_langs(); + if (in_array($one_language, $otherLangs)) { + $one_language_all_resources = TRUE; + $otherLangs = array('en', $one_language); + } else { + echo "<p>Language $one_language is not present in our web site yet.</p>"; + } } + $enFiles = array_merge(array('../_nav/langs/en.pot'), get_lang_references('*.pot')); // added navigation file if (isset($one_resource) && $one_resource != 'all') { - $all_languages_only_one_resource = TRUE; - $enFiles = array($one_resource); - } else { - $enFiles = array_merge(array('../_nav/langs/en.pot'), get_lang_references('*.pot')); // added navigation file + if (in_array($one_resource, $enFiles)) { + $all_languages_only_one_resource = TRUE; + $enFiles = array($one_resource); + } else { + echo "<p>Resource $one_resource is not present in our web site yet.</p>"; + } } $num_of_enFiles = count($enFiles); |