index.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. /*
  3. FusionPBX
  4. Version: MPL 1.1
  5. The contents of this file are subject to the Mozilla Public License Version
  6. 1.1 (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.mozilla.org/MPL/
  9. Software distributed under the License is distributed on an "AS IS" basis,
  10. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. for the specific language governing rights and limitations under the
  12. License.
  13. The Original Code is FusionPBX
  14. The Initial Developer of the Original Code is
  15. Mark J Crane <[email protected]>
  16. Portions created by the Initial Developer are Copyright (C) 2008-2012
  17. the Initial Developer. All Rights Reserved.
  18. Contributor(s):
  19. Matthew Vale <[email protected]>
  20. */
  21. require_once "root.php";
  22. require_once "resources/require.php";
  23. //check permissions
  24. require_once "resources/check_auth.php";
  25. if (permission_exists('languages_view')) {
  26. //access granted
  27. }
  28. else {
  29. echo "access denied";
  30. exit;
  31. }
  32. //add multi-lingual support
  33. $language = new text;
  34. $text = $language->get();
  35. //additional includes
  36. require_once "resources/header.php";
  37. require_once "resources/paging.php";
  38. //get variables used to control the order
  39. $order_by = $_GET["order_by"];
  40. $order = $_GET["order"];
  41. //show the content
  42. echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>\n";
  43. echo " <tr>\n";
  44. echo " <td width='50%' align='left' nowrap='nowrap'><b>".$text['title-languages']."</b></td>\n";
  45. echo " <td width='50%' align='right'>&nbsp;</td>\n";
  46. echo " </tr>\n";
  47. echo " <tr>\n";
  48. echo " <td align='left' colspan='2'>\n";
  49. echo " ".$text['description-languages']."<br /><br />\n";
  50. echo " </td>\n";
  51. echo " </tr>\n";
  52. echo "</table>\n";
  53. //table headers
  54. echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
  55. echo "<tr>\n";
  56. echo "<th nowrap='' style='width:2em'>".$text['label-flag']."</th>\n";
  57. echo th_order_by('language_code', $text['label-culture_code'], $order_by, $order, '', "style='width:4em;'");
  58. echo th_order_by('language_name', $text['label-name'], $order_by, $order);
  59. echo "</tr>\n";
  60. $c= 0;
  61. $warn_about_wrong_culture = false;
  62. foreach($_SESSION['app']['languages'] as $lang_code){ //TODO add sorting
  63. $tr_link = "href='languages_compare.php?target_language=$lang_code'";
  64. echo "<tr $tr_link>\n";
  65. echo "<td class='row_style".($c%2)."'>";
  66. echo "<img src='$project_path/themes/flags/$lang_code.png' alt='$lang_code'/></td>";
  67. echo "<td class='row_style".($c%2)."'>$lang_code";
  68. if(strlen($lang_code) < 5){
  69. $warn_about_wrong_culture = true;
  70. echo "$nbsp;<sup>*1</sup>";
  71. }
  72. echo "</td>";
  73. echo "<td class='row_style".($c%2)."'>".$text["language-$lang_code"]."</td>";
  74. echo "</tr>\n";
  75. $c++;
  76. }
  77. //complete the content
  78. echo "</table>";
  79. if($warn_about_wrong_culture){
  80. $lang_code = $_SESSION['domain']['language']['code'];
  81. echo "<p><sup>*1</sup>&nbsp;".$text['warning-incorrect_language_culture_code']."<a href='https://msdn.microsoft.com/$lang_code/library/ee825488%28v=cs.20%29.aspx'>https://msdn.microsoft.com/$lang_code/library/ee825488%28v=cs.20%29.aspx</a></p>";
  82. }
  83. //include the footer
  84. require_once "resources/footer.php";
  85. ?>