Browse Source

Merge branch 'master' into fax_queue

Alexey Melnichuk 9 years ago
parent
commit
3978b4a148
100 changed files with 1077 additions and 97 deletions
  1. 18 0
      core/app_languages.php
  2. 20 15
      resources/classes/text.php
  3. 916 0
      resources/countries.php
  4. 1 1
      resources/install.php
  5. 121 80
      themes/enhanced/app_defaults.php
  6. 1 1
      themes/enhanced/template.php
  7. BIN
      themes/flags/Afghanistan.png
  8. BIN
      themes/flags/Aland Islands.png
  9. BIN
      themes/flags/Albania.png
  10. BIN
      themes/flags/Algeria.png
  11. BIN
      themes/flags/American Samoa.png
  12. BIN
      themes/flags/Andorra.png
  13. BIN
      themes/flags/Angola.png
  14. BIN
      themes/flags/Anguilla.png
  15. BIN
      themes/flags/Antigua and Barbuda.png
  16. BIN
      themes/flags/Argentina.png
  17. BIN
      themes/flags/Armenia.png
  18. BIN
      themes/flags/Aruba.png
  19. BIN
      themes/flags/Australia.png
  20. BIN
      themes/flags/Austria.png
  21. BIN
      themes/flags/Azerbaijan.png
  22. BIN
      themes/flags/Bahamas.png
  23. BIN
      themes/flags/Bahrain.png
  24. BIN
      themes/flags/Bangladesh.png
  25. BIN
      themes/flags/Barbados.png
  26. BIN
      themes/flags/Belarus.png
  27. BIN
      themes/flags/Belgium.png
  28. BIN
      themes/flags/Belize.png
  29. BIN
      themes/flags/Benin.png
  30. BIN
      themes/flags/Bermuda.png
  31. BIN
      themes/flags/Bhutan.png
  32. BIN
      themes/flags/Bolivia, Plurinational State of.png
  33. BIN
      themes/flags/Bosnia and Herzegovina.png
  34. BIN
      themes/flags/Botswana.png
  35. BIN
      themes/flags/Bouvet Island.png
  36. BIN
      themes/flags/Brazil.png
  37. BIN
      themes/flags/British Indian Ocean Territory.png
  38. BIN
      themes/flags/Brunei Darussalam.png
  39. BIN
      themes/flags/Bulgaria.png
  40. BIN
      themes/flags/Burkina Faso.png
  41. BIN
      themes/flags/Burundi.png
  42. BIN
      themes/flags/Cabo Verde.png
  43. BIN
      themes/flags/Cambodia.png
  44. BIN
      themes/flags/Cameroon.png
  45. BIN
      themes/flags/Canada.png
  46. BIN
      themes/flags/Cayman Islands.png
  47. BIN
      themes/flags/Central African Republic.png
  48. BIN
      themes/flags/Chad.png
  49. BIN
      themes/flags/Chile.png
  50. BIN
      themes/flags/China.png
  51. BIN
      themes/flags/Christmas Island.png
  52. BIN
      themes/flags/Cocos (Keeling) Islands.png
  53. BIN
      themes/flags/Colombia.png
  54. BIN
      themes/flags/Comoros.png
  55. BIN
      themes/flags/Congo, the Democratic Republic of the.png
  56. BIN
      themes/flags/Congo.png
  57. BIN
      themes/flags/Cook Islands.png
  58. BIN
      themes/flags/Costa Rica.png
  59. BIN
      themes/flags/Cote d'Ivoire.png
  60. BIN
      themes/flags/Croatia.png
  61. BIN
      themes/flags/Cuba.png
  62. BIN
      themes/flags/Cyprus.png
  63. BIN
      themes/flags/Czech Republic.png
  64. BIN
      themes/flags/Denmark.png
  65. BIN
      themes/flags/Djibouti.png
  66. BIN
      themes/flags/Dominica.png
  67. BIN
      themes/flags/Dominican Republic.png
  68. BIN
      themes/flags/Ecuador.png
  69. BIN
      themes/flags/Egypt.png
  70. BIN
      themes/flags/El Salvador.png
  71. BIN
      themes/flags/Equatorial Guinea.png
  72. BIN
      themes/flags/Eritrea.png
  73. BIN
      themes/flags/Estonia.png
  74. BIN
      themes/flags/Ethiopia.png
  75. BIN
      themes/flags/Falkland Islands (Malvinas).png
  76. BIN
      themes/flags/Faroe Islands.png
  77. BIN
      themes/flags/Fiji.png
  78. BIN
      themes/flags/Finland.png
  79. BIN
      themes/flags/France.png
  80. BIN
      themes/flags/French Guiana.png
  81. BIN
      themes/flags/French Polynesia.png
  82. BIN
      themes/flags/French Southern Territories.png
  83. BIN
      themes/flags/Gabon.png
  84. BIN
      themes/flags/Gambia.png
  85. BIN
      themes/flags/Georgia.png
  86. BIN
      themes/flags/Germany.png
  87. BIN
      themes/flags/Ghana.png
  88. BIN
      themes/flags/Gibraltar.png
  89. BIN
      themes/flags/Greece.png
  90. BIN
      themes/flags/Greenland.png
  91. BIN
      themes/flags/Grenada.png
  92. BIN
      themes/flags/Guadeloupe.png
  93. BIN
      themes/flags/Guam.png
  94. BIN
      themes/flags/Guatemala.png
  95. BIN
      themes/flags/Guinea-Bissau.png
  96. BIN
      themes/flags/Guinea.png
  97. BIN
      themes/flags/Guyana.png
  98. BIN
      themes/flags/Haiti.png
  99. BIN
      themes/flags/Heard Island and McDonald Islands.png
  100. BIN
      themes/flags/Holy See.png

+ 18 - 0
core/app_languages.php

@@ -0,0 +1,18 @@
+<?php
+
+// Fill in the value in the native language
+// rename the corerct flag in /theme/flags/*.png
+
+$language_name['en-us'] = "English - United States";
+$language_name['es-cl'] = "Español - Chile";
+$language_name['pt-pt'] = "Português - Portugal";
+$language_name['fr-fr'] = "Français - France";
+$language_name['nl-nl'] = "Nederlands - De Nederland";
+$language_name['pt-br'] = "Brasileiro - Português";
+$language_name['pl'] = "Polski - Polska";
+$language_name['sv-se'] = "Svenska - Sverige";
+$language_name['uk'] = "Українська - Україна";
+$language_name['de-at'] = "Deutsch - Österreich";
+$language_name['ar-eg'] = "العربية - مصر";
+
+?>

+ 20 - 15
resources/classes/text.php

@@ -1,19 +1,16 @@
 <?php
-
 /**
  * Get the text for the correct translation
  *
  * @method array get
  */
 class text {
-
 	/**
 	 * Called when the object is created
 	 */
 	public function __construct() {
 		//place holder
 	}
-
 	/**
 	 * Called when there are no references to a particular object
 	 * unset the variables used in the class
@@ -23,13 +20,14 @@ class text {
 			unset($this->$key);
 		}
 	}
-
 	/**
 	 * Get a specific item from the cache
 	 * @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) {
+		//get the global app_languages.php
+			include $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/core/app_languages.php";
 		//get the app_languages.php
 			if ($app_path != null) {
 				include $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/".$app_path."/app_languages.php";
@@ -37,7 +35,6 @@ class text {
 			else {
 				include getcwd().'/app_languages.php';
 			}
-
 		//get the available languages
 			krsort($text);
 			foreach ($text as $lang_label => $lang_codes) {
@@ -48,24 +45,32 @@ class text {
 				}
 			}
 			$_SESSION['app']['languages'] = array_unique($app_languages);
-
+		//check the session language
+			if(isset($_SESSION['domain'])){
+				$language_code = $_SESSION['domain']['language']['code'];
+			}elseif($language_code == null){
+				$language_code = 'en-us';
+			}
 		//reduce to specific language
 			if ($language_code != 'all') {
 				foreach($text as $key => $value) {
-					if ($language_code == null) {
-						$text[$key] = $value[$_SESSION['domain']['language']['code']];
-					}
-					else {
-						$text[$key] = $value[$language_code];
+					$text[$key] = $value[$language_code];
+				}
+			}
+			if ($language_code != 'all') {
+				foreach($language_name as $code => $value) {
+					$text["language-$code"] = $value;
+				}
+			}else{
+				foreach($language_name as $code => $value) {
+					foreach($language_name as $c_code => $value) {
+						$text["language-$code"][$c_code] = $value;
 					}
 				}
 			}
-
+			
 		//return the array of translations
 			return $text;
-
 	}
-
 }
-
 ?>

+ 916 - 0
resources/countries.php

@@ -0,0 +1,916 @@
+<?php
+
+$countries['AF']['country'] = 'Afghanistan';
+$countries['AF']['countrycode'] = '93';
+$countries['AF']['exitcode'] = '00';
+$countries['AF']['isocode'] = 'AF';
+$countries['AL']['country'] = 'Albania';
+$countries['AL']['countrycode'] = '355';
+$countries['AL']['exitcode'] = '00';
+$countries['AL']['isocode'] = 'AL';
+$countries['DZ']['country'] = 'Algeria';
+$countries['DZ']['countrycode'] = '213';
+$countries['DZ']['exitcode'] = '00';
+$countries['DZ']['isocode'] = 'DZ';
+$countries['AS']['country'] = 'American Samoa';
+$countries['AS']['countrycode'] = '1';
+$countries['AS']['exitcode'] = '011';
+$countries['AS']['isocode'] = 'AS';
+$countries['AD']['country'] = 'Andorra';
+$countries['AD']['countrycode'] = '376';
+$countries['AD']['exitcode'] = '00';
+$countries['AD']['isocode'] = 'AD';
+$countries['AO']['country'] = 'Angola';
+$countries['AO']['countrycode'] = '244';
+$countries['AO']['exitcode'] = '00';
+$countries['AO']['isocode'] = 'AO';
+$countries['AI']['country'] = 'Anguilla';
+$countries['AI']['countrycode'] = '1';
+$countries['AI']['exitcode'] = '011';
+$countries['AI']['isocode'] = 'AI';
+$countries['AG']['country'] = 'Antigua and Barbuda';
+$countries['AG']['countrycode'] = '1';
+$countries['AG']['exitcode'] = '011';
+$countries['AG']['isocode'] = 'AG';
+$countries['AR']['country'] = 'Argentina';
+$countries['AR']['countrycode'] = '54';
+$countries['AR']['exitcode'] = '00';
+$countries['AR']['isocode'] = 'AR';
+$countries['AM']['country'] = 'Armenia';
+$countries['AM']['countrycode'] = '374';
+$countries['AM']['exitcode'] = '00';
+$countries['AM']['isocode'] = 'AM';
+$countries['AW']['country'] = 'Aruba';
+$countries['AW']['countrycode'] = '297';
+$countries['AW']['exitcode'] = '00';
+$countries['AW']['isocode'] = 'AW';
+$countries['AC']['country'] = 'Ascension';
+$countries['AC']['countrycode'] = '247';
+$countries['AC']['exitcode'] = '00';
+$countries['AC']['isocode'] = 'AC';
+$countries['AU']['country'] = 'Australia';
+$countries['AU']['countrycode'] = '61';
+$countries['AU']['exitcode'] = '0011';
+$countries['AU']['isocode'] = 'AU';
+$countries['AT']['country'] = 'Austria';
+$countries['AT']['countrycode'] = '43';
+$countries['AT']['exitcode'] = '00';
+$countries['AT']['isocode'] = 'AT';
+$countries['AZ']['country'] = 'Azerbaijan';
+$countries['AZ']['countrycode'] = '994';
+$countries['AZ']['exitcode'] = '00';
+$countries['AZ']['isocode'] = 'AZ';
+$countries['BS']['country'] = 'Bahamas';
+$countries['BS']['countrycode'] = '1';
+$countries['BS']['exitcode'] = '011';
+$countries['BS']['isocode'] = 'BS';
+$countries['BH']['country'] = 'Bahrain';
+$countries['BH']['countrycode'] = '973';
+$countries['BH']['exitcode'] = '00';
+$countries['BH']['isocode'] = 'BH';
+$countries['BD']['country'] = 'Bangladesh';
+$countries['BD']['countrycode'] = '880';
+$countries['BD']['exitcode'] = '00';
+$countries['BD']['isocode'] = 'BD';
+$countries['BB']['country'] = 'Barbados';
+$countries['BB']['countrycode'] = '1';
+$countries['BB']['exitcode'] = '011';
+$countries['BB']['isocode'] = 'BB';
+$countries['BY']['country'] = 'Belarus';
+$countries['BY']['countrycode'] = '375';
+$countries['BY']['exitcode'] = '810';
+$countries['BY']['isocode'] = 'BY';
+$countries['BE']['country'] = 'Belgium';
+$countries['BE']['countrycode'] = '32';
+$countries['BE']['exitcode'] = '00';
+$countries['BE']['isocode'] = 'BE';
+$countries['BZ']['country'] = 'Belize';
+$countries['BZ']['countrycode'] = '501';
+$countries['BZ']['exitcode'] = '00';
+$countries['BZ']['isocode'] = 'BZ';
+$countries['BJ']['country'] = 'Benin';
+$countries['BJ']['countrycode'] = '229';
+$countries['BJ']['exitcode'] = '00';
+$countries['BJ']['isocode'] = 'BJ';
+$countries['BM']['country'] = 'Bermuda';
+$countries['BM']['countrycode'] = '1';
+$countries['BM']['exitcode'] = '011';
+$countries['BM']['isocode'] = 'BM';
+$countries['BT']['country'] = 'Bhutan';
+$countries['BT']['countrycode'] = '975';
+$countries['BT']['exitcode'] = '00';
+$countries['BT']['isocode'] = 'BT';
+$countries['BO']['country'] = 'Bolivia';
+$countries['BO']['countrycode'] = '591';
+$countries['BO']['exitcode'] = '00';
+$countries['BO']['isocode'] = 'BO';
+$countries['BA']['country'] = 'Bosnia and Herzegovina';
+$countries['BA']['countrycode'] = '387';
+$countries['BA']['exitcode'] = '00';
+$countries['BA']['isocode'] = 'BA';
+$countries['BW']['country'] = 'Botswana';
+$countries['BW']['countrycode'] = '267';
+$countries['BW']['exitcode'] = '00';
+$countries['BW']['isocode'] = 'BW';
+$countries['BR']['country'] = 'Brazil';
+$countries['BR']['countrycode'] = '55';
+$countries['BR']['exitcode'] = '0014';
+$countries['BR']['isocode'] = 'BR';
+$countries['VG']['country'] = 'British Virgin Islands';
+$countries['VG']['countrycode'] = '1';
+$countries['VG']['exitcode'] = '011';
+$countries['VG']['isocode'] = 'VG';
+$countries['BN']['country'] = 'Brunei';
+$countries['BN']['countrycode'] = '673';
+$countries['BN']['exitcode'] = '00';
+$countries['BN']['isocode'] = 'BN';
+$countries['BG']['country'] = 'Bulgaria';
+$countries['BG']['countrycode'] = '359';
+$countries['BG']['exitcode'] = '00';
+$countries['BG']['isocode'] = 'BG';
+$countries['BF']['country'] = 'Burkina Faso';
+$countries['BF']['countrycode'] = '226';
+$countries['BF']['exitcode'] = '00';
+$countries['BF']['isocode'] = 'BF';
+$countries['BI']['country'] = 'Burundi';
+$countries['BI']['countrycode'] = '257';
+$countries['BI']['exitcode'] = '00';
+$countries['BI']['isocode'] = 'BI';
+$countries['KH']['country'] = 'Cambodia';
+$countries['KH']['countrycode'] = '855';
+$countries['KH']['exitcode'] = '001, 007, 008';
+$countries['KH']['isocode'] = 'KH';
+$countries['CM']['country'] = 'Cameroon';
+$countries['CM']['countrycode'] = '237';
+$countries['CM']['exitcode'] = '00';
+$countries['CM']['isocode'] = 'CM';
+$countries['CA']['country'] = 'Canada';
+$countries['CA']['countrycode'] = '1';
+$countries['CA']['exitcode'] = '011';
+$countries['CA']['isocode'] = 'CA';
+$countries['CV']['country'] = 'Cape Verde';
+$countries['CV']['countrycode'] = '238';
+$countries['CV']['exitcode'] = '00';
+$countries['CV']['isocode'] = 'CV';
+$countries['KY']['country'] = 'Cayman Islands';
+$countries['KY']['countrycode'] = '1';
+$countries['KY']['exitcode'] = '011';
+$countries['KY']['isocode'] = 'KY';
+$countries['CF']['country'] = 'Central African Republic';
+$countries['CF']['countrycode'] = '236';
+$countries['CF']['exitcode'] = '00';
+$countries['CF']['isocode'] = 'CF';
+$countries['TD']['country'] = 'Chad';
+$countries['TD']['countrycode'] = '235';
+$countries['TD']['exitcode'] = '00';
+$countries['TD']['isocode'] = 'TD';
+$countries['CL']['country'] = 'Chile';
+$countries['CL']['countrycode'] = '56';
+$countries['CL']['exitcode'] = '1230';
+$countries['CL']['isocode'] = 'CL';
+$countries['CN']['country'] = 'China';
+$countries['CN']['countrycode'] = '86';
+$countries['CN']['exitcode'] = '00';
+$countries['CN']['isocode'] = 'CN';
+$countries['CO']['country'] = 'Colombia';
+$countries['CO']['countrycode'] = '57';
+$countries['CO']['exitcode'] = '005';
+$countries['CO']['isocode'] = 'CO';
+$countries['KM']['country'] = 'Comoros';
+$countries['KM']['countrycode'] = '269';
+$countries['KM']['exitcode'] = '00';
+$countries['KM']['isocode'] = 'KM';
+$countries['CD']['country'] = 'Congo';
+$countries['CD']['countrycode'] = '242';
+$countries['CD']['exitcode'] = '00';
+$countries['CD']['isocode'] = 'CD';
+$countries['CK']['country'] = 'Cook Islands';
+$countries['CK']['countrycode'] = '682';
+$countries['CK']['exitcode'] = '00';
+$countries['CK']['isocode'] = 'CK';
+$countries['CR']['country'] = 'Costa Rica';
+$countries['CR']['countrycode'] = '506';
+$countries['CR']['exitcode'] = '00';
+$countries['CR']['isocode'] = 'CR';
+$countries['HR']['country'] = 'Croatia';
+$countries['HR']['countrycode'] = '385';
+$countries['HR']['exitcode'] = '00';
+$countries['HR']['isocode'] = 'HR';
+$countries['CU']['country'] = 'Cuba';
+$countries['CU']['countrycode'] = '53';
+$countries['CU']['exitcode'] = '119';
+$countries['CU']['isocode'] = 'CU';
+$countries['CY']['country'] = 'Cyprus';
+$countries['CY']['countrycode'] = '357';
+$countries['CY']['exitcode'] = '00';
+$countries['CY']['isocode'] = 'CY';
+$countries['CZ']['country'] = 'Czech Republic';
+$countries['CZ']['countrycode'] = '420';
+$countries['CZ']['exitcode'] = '00';
+$countries['CZ']['isocode'] = 'CZ';
+$countries['CD']['country'] = 'Democratic Republic of Congo';
+$countries['CD']['countrycode'] = '243';
+$countries['CD']['exitcode'] = '00';
+$countries['CD']['isocode'] = 'CD';
+$countries['DK']['country'] = 'Denmark';
+$countries['DK']['countrycode'] = '45';
+$countries['DK']['exitcode'] = '00';
+$countries['DK']['isocode'] = 'DK';
+$countries['DJ']['country'] = 'Djibouti';
+$countries['DJ']['countrycode'] = '253';
+$countries['DJ']['exitcode'] = '00';
+$countries['DJ']['isocode'] = 'DJ';
+$countries['DM']['country'] = 'Dominica';
+$countries['DM']['countrycode'] = '1';
+$countries['DM']['exitcode'] = '011';
+$countries['DM']['isocode'] = 'DM';
+$countries['DO']['country'] = 'Dominican Republic';
+$countries['DO']['countrycode'] = '1';
+$countries['DO']['exitcode'] = '011';
+$countries['DO']['isocode'] = 'DO';
+$countries['TL']['country'] = 'East Timor';
+$countries['TL']['countrycode'] = '670';
+$countries['TL']['exitcode'] = '00';
+$countries['TL']['isocode'] = 'TL';
+$countries['EC']['country'] = 'Ecuador';
+$countries['EC']['countrycode'] = '593';
+$countries['EC']['exitcode'] = '00';
+$countries['EC']['isocode'] = 'EC';
+$countries['EG']['country'] = 'Egypt';
+$countries['EG']['countrycode'] = '20';
+$countries['EG']['exitcode'] = '00';
+$countries['EG']['isocode'] = 'EG';
+$countries['SV']['country'] = 'El Salvador';
+$countries['SV']['countrycode'] = '503';
+$countries['SV']['exitcode'] = '00';
+$countries['SV']['isocode'] = 'SV';
+$countries['GQ']['country'] = 'Equatorial Guinea';
+$countries['GQ']['countrycode'] = '240';
+$countries['GQ']['exitcode'] = '00';
+$countries['GQ']['isocode'] = 'GQ';
+$countries['ER']['country'] = 'Eritrea';
+$countries['ER']['countrycode'] = '291';
+$countries['ER']['exitcode'] = '00';
+$countries['ER']['isocode'] = 'ER';
+$countries['EE']['country'] = 'Estonia';
+$countries['EE']['countrycode'] = '372';
+$countries['EE']['exitcode'] = '00';
+$countries['EE']['isocode'] = 'EE';
+$countries['ET']['country'] = 'Ethiopia';
+$countries['ET']['countrycode'] = '251';
+$countries['ET']['exitcode'] = '00';
+$countries['ET']['isocode'] = 'ET';
+$countries['FK']['country'] = 'Falkland (Malvinas) Islands';
+$countries['FK']['countrycode'] = '500';
+$countries['FK']['exitcode'] = '00';
+$countries['FK']['isocode'] = 'FK';
+$countries['FO']['country'] = 'Faroe Islands';
+$countries['FO']['countrycode'] = '298';
+$countries['FO']['exitcode'] = '00';
+$countries['FO']['isocode'] = 'FO';
+$countries['FJ']['country'] = 'Fiji';
+$countries['FJ']['countrycode'] = '679';
+$countries['FJ']['exitcode'] = '00';
+$countries['FJ']['isocode'] = 'FJ';
+$countries['FI']['country'] = 'Finland';
+$countries['FI']['countrycode'] = '358';
+$countries['FI']['exitcode'] = '00, 990, 994, 999';
+$countries['FI']['isocode'] = 'FI';
+$countries['FR']['country'] = 'France';
+$countries['FR']['countrycode'] = '33';
+$countries['FR']['exitcode'] = '00';
+$countries['FR']['isocode'] = 'FR';
+$countries['GF']['country'] = 'French Guiana';
+$countries['GF']['countrycode'] = '594';
+$countries['GF']['exitcode'] = '00';
+$countries['GF']['isocode'] = 'GF';
+$countries['PF']['country'] = 'French Polynesia';
+$countries['PF']['countrycode'] = '689';
+$countries['PF']['exitcode'] = '00';
+$countries['PF']['isocode'] = 'PF';
+$countries['GA']['country'] = 'Gabon';
+$countries['GA']['countrycode'] = '241';
+$countries['GA']['exitcode'] = '00';
+$countries['GA']['isocode'] = 'GA';
+$countries['GM']['country'] = 'Gambia';
+$countries['GM']['countrycode'] = '220';
+$countries['GM']['exitcode'] = '00';
+$countries['GM']['isocode'] = 'GM';
+$countries['GE']['country'] = 'Georgia';
+$countries['GE']['countrycode'] = '995';
+$countries['GE']['exitcode'] = '00';
+$countries['GE']['isocode'] = 'GE';
+$countries['DE']['country'] = 'Germany';
+$countries['DE']['countrycode'] = '49';
+$countries['DE']['exitcode'] = '00';
+$countries['DE']['isocode'] = 'DE';
+$countries['GH']['country'] = 'Ghana';
+$countries['GH']['countrycode'] = '233';
+$countries['GH']['exitcode'] = '00';
+$countries['GH']['isocode'] = 'GH';
+$countries['GI']['country'] = 'Gibraltar';
+$countries['GI']['countrycode'] = '350';
+$countries['GI']['exitcode'] = '00';
+$countries['GI']['isocode'] = 'GI';
+$countries['GR']['country'] = 'Greece';
+$countries['GR']['countrycode'] = '30';
+$countries['GR']['exitcode'] = '00';
+$countries['GR']['isocode'] = 'GR';
+$countries['GL']['country'] = 'Greenland';
+$countries['GL']['countrycode'] = '299';
+$countries['GL']['exitcode'] = '00';
+$countries['GL']['isocode'] = 'GL';
+$countries['GD']['country'] = 'Grenada';
+$countries['GD']['countrycode'] = '1';
+$countries['GD']['exitcode'] = '011';
+$countries['GD']['isocode'] = 'GD';
+$countries['GP']['country'] = 'Guadeloupe';
+$countries['GP']['countrycode'] = '590';
+$countries['GP']['exitcode'] = '00';
+$countries['GP']['isocode'] = 'GP';
+$countries['GU']['country'] = 'Guam';
+$countries['GU']['countrycode'] = '1';
+$countries['GU']['exitcode'] = '011';
+$countries['GU']['isocode'] = 'GU';
+$countries['GT']['country'] = 'Guatemala';
+$countries['GT']['countrycode'] = '502';
+$countries['GT']['exitcode'] = '00';
+$countries['GT']['isocode'] = 'GT';
+$countries['GN']['country'] = 'Guinea';
+$countries['GN']['countrycode'] = '224';
+$countries['GN']['exitcode'] = '00';
+$countries['GN']['isocode'] = 'GN';
+$countries['GW']['country'] = 'Guinea-Bissau';
+$countries['GW']['countrycode'] = '245';
+$countries['GW']['exitcode'] = '00';
+$countries['GW']['isocode'] = 'GW';
+$countries['GY']['country'] = 'Guyana';
+$countries['GY']['countrycode'] = '592';
+$countries['GY']['exitcode'] = '001';
+$countries['GY']['isocode'] = 'GY';
+$countries['HT']['country'] = 'Haiti';
+$countries['HT']['countrycode'] = '509';
+$countries['HT']['exitcode'] = '00';
+$countries['HT']['isocode'] = 'HT';
+$countries['HN']['country'] = 'Honduras';
+$countries['HN']['countrycode'] = '504';
+$countries['HN']['exitcode'] = '00';
+$countries['HN']['isocode'] = 'HN';
+$countries['HK']['country'] = 'Hong Kong';
+$countries['HK']['countrycode'] = '852';
+$countries['HK']['exitcode'] = '001';
+$countries['HK']['isocode'] = 'HK';
+$countries['HU']['country'] = 'Hungary';
+$countries['HU']['countrycode'] = '36';
+$countries['HU']['exitcode'] = '00';
+$countries['HU']['isocode'] = 'HU';
+$countries['IS']['country'] = 'Iceland';
+$countries['IS']['countrycode'] = '354';
+$countries['IS']['exitcode'] = '00';
+$countries['IS']['isocode'] = 'IS';
+$countries['IN']['country'] = 'India';
+$countries['IN']['countrycode'] = '91';
+$countries['IN']['exitcode'] = '00';
+$countries['IN']['isocode'] = 'IN';
+$countries['ID']['country'] = 'Indonesia';
+$countries['ID']['countrycode'] = '62';
+$countries['ID']['exitcode'] = '001';
+$countries['ID']['isocode'] = 'ID';
+$countries['IR']['country'] = 'Iran';
+$countries['IR']['countrycode'] = '98';
+$countries['IR']['exitcode'] = '00';
+$countries['IR']['isocode'] = 'IR';
+$countries['IQ']['country'] = 'Iraq';
+$countries['IQ']['countrycode'] = '964';
+$countries['IQ']['exitcode'] = '00';
+$countries['IQ']['isocode'] = 'IQ';
+$countries['IE']['country'] = 'Ireland';
+$countries['IE']['countrycode'] = '353';
+$countries['IE']['exitcode'] = '00';
+$countries['IE']['isocode'] = 'IE';
+$countries['IL']['country'] = 'Israel';
+$countries['IL']['countrycode'] = '972';
+$countries['IL']['exitcode'] = '00, 012, 013, 014, 018';
+$countries['IL']['isocode'] = 'IL';
+$countries['IT']['country'] = 'Italy';
+$countries['IT']['countrycode'] = '39';
+$countries['IT']['exitcode'] = '00';
+$countries['IT']['isocode'] = 'IT';
+$countries['CI']['country'] = 'Ivory Coast';
+$countries['CI']['countrycode'] = '225';
+$countries['CI']['exitcode'] = '00';
+$countries['CI']['isocode'] = 'CI';
+$countries['JM']['country'] = 'Jamaica';
+$countries['JM']['countrycode'] = '1';
+$countries['JM']['exitcode'] = '011';
+$countries['JM']['isocode'] = 'JM';
+$countries['JP']['country'] = 'Japan';
+$countries['JP']['countrycode'] = '81';
+$countries['JP']['exitcode'] = '010';
+$countries['JP']['isocode'] = 'JP';
+$countries['JO']['country'] = 'Jordan';
+$countries['JO']['countrycode'] = '962';
+$countries['JO']['exitcode'] = '00';
+$countries['JO']['isocode'] = 'JO';
+$countries['KZ']['country'] = 'Kazakhstan';
+$countries['KZ']['countrycode'] = '7';
+$countries['KZ']['exitcode'] = '810';
+$countries['KZ']['isocode'] = 'KZ';
+$countries['KE']['country'] = 'Kenya';
+$countries['KE']['countrycode'] = '254';
+$countries['KE']['exitcode'] = '000';
+$countries['KE']['isocode'] = 'KE';
+$countries['KI']['country'] = 'Kiribati';
+$countries['KI']['countrycode'] = '686';
+$countries['KI']['exitcode'] = '00';
+$countries['KI']['isocode'] = 'KI';
+$countries['KW']['country'] = 'Kuwait';
+$countries['KW']['countrycode'] = '965';
+$countries['KW']['exitcode'] = '00';
+$countries['KW']['isocode'] = 'KW';
+$countries['KG']['country'] = 'Kyrgyzstan';
+$countries['KG']['countrycode'] = '996';
+$countries['KG']['exitcode'] = '00';
+$countries['KG']['isocode'] = 'KG';
+$countries['LA']['country'] = 'Laos';
+$countries['LA']['countrycode'] = '856';
+$countries['LA']['exitcode'] = '00';
+$countries['LA']['isocode'] = 'LA';
+$countries['LV']['country'] = 'Latvia';
+$countries['LV']['countrycode'] = '371';
+$countries['LV']['exitcode'] = '00';
+$countries['LV']['isocode'] = 'LV';
+$countries['LB']['country'] = 'Lebanon';
+$countries['LB']['countrycode'] = '961';
+$countries['LB']['exitcode'] = '00';
+$countries['LB']['isocode'] = 'LB';
+$countries['LS']['country'] = 'Lesotho';
+$countries['LS']['countrycode'] = '266';
+$countries['LS']['exitcode'] = '00';
+$countries['LS']['isocode'] = 'LS';
+$countries['LR']['country'] = 'Liberia';
+$countries['LR']['countrycode'] = '231';
+$countries['LR']['exitcode'] = '00';
+$countries['LR']['isocode'] = 'LR';
+$countries['LY']['country'] = 'Libya';
+$countries['LY']['countrycode'] = '218';
+$countries['LY']['exitcode'] = '00';
+$countries['LY']['isocode'] = 'LY';
+$countries['LI']['country'] = 'Liechtenstein';
+$countries['LI']['countrycode'] = '423';
+$countries['LI']['exitcode'] = '00';
+$countries['LI']['isocode'] = 'LI';
+$countries['LT']['country'] = 'Lithuania';
+$countries['LT']['countrycode'] = '370';
+$countries['LT']['exitcode'] = '00';
+$countries['LT']['isocode'] = 'LT';
+$countries['LU']['country'] = 'Luxembourg';
+$countries['LU']['countrycode'] = '352';
+$countries['LU']['exitcode'] = '00';
+$countries['LU']['isocode'] = 'LU';
+$countries['MO']['country'] = 'Macau';
+$countries['MO']['countrycode'] = '853';
+$countries['MO']['exitcode'] = '00';
+$countries['MO']['isocode'] = 'MO';
+$countries['MK']['country'] = 'Macedonia';
+$countries['MK']['countrycode'] = '389';
+$countries['MK']['exitcode'] = '00';
+$countries['MK']['isocode'] = 'MK';
+$countries['MG']['country'] = 'Madagascar';
+$countries['MG']['countrycode'] = '261';
+$countries['MG']['exitcode'] = '00';
+$countries['MG']['isocode'] = 'MG';
+$countries['MW']['country'] = 'Malawi';
+$countries['MW']['countrycode'] = '265';
+$countries['MW']['exitcode'] = '00';
+$countries['MW']['isocode'] = 'MW';
+$countries['MY']['country'] = 'Malaysia';
+$countries['MY']['countrycode'] = '60';
+$countries['MY']['exitcode'] = '00';
+$countries['MY']['isocode'] = 'MY';
+$countries['MV']['country'] = 'Maldives';
+$countries['MV']['countrycode'] = '960';
+$countries['MV']['exitcode'] = '00';
+$countries['MV']['isocode'] = 'MV';
+$countries['ML']['country'] = 'Mali';
+$countries['ML']['countrycode'] = '223';
+$countries['ML']['exitcode'] = '00';
+$countries['ML']['isocode'] = 'ML';
+$countries['MT']['country'] = 'Malta';
+$countries['MT']['countrycode'] = '356';
+$countries['MT']['exitcode'] = '00';
+$countries['MT']['isocode'] = 'MT';
+$countries['MH']['country'] = 'Marshall Islands';
+$countries['MH']['countrycode'] = '692';
+$countries['MH']['exitcode'] = '011';
+$countries['MH']['isocode'] = 'MH';
+$countries['MQ']['country'] = 'Martinique';
+$countries['MQ']['countrycode'] = '596';
+$countries['MQ']['exitcode'] = '00';
+$countries['MQ']['isocode'] = 'MQ';
+$countries['MR']['country'] = 'Mauritania';
+$countries['MR']['countrycode'] = '222';
+$countries['MR']['exitcode'] = '00';
+$countries['MR']['isocode'] = 'MR';
+$countries['MU']['country'] = 'Mauritius';
+$countries['MU']['countrycode'] = '230';
+$countries['MU']['exitcode'] = '00';
+$countries['MU']['isocode'] = 'MU';
+$countries['YT']['country'] = 'Mayotte';
+$countries['YT']['countrycode'] = '262';
+$countries['YT']['exitcode'] = '00';
+$countries['YT']['isocode'] = 'YT';
+$countries['MX']['country'] = 'Mexico';
+$countries['MX']['countrycode'] = '52';
+$countries['MX']['exitcode'] = '00';
+$countries['MX']['isocode'] = 'MX';
+$countries['FM']['country'] = 'Micronesia';
+$countries['FM']['countrycode'] = '691';
+$countries['FM']['exitcode'] = '011';
+$countries['FM']['isocode'] = 'FM';
+$countries['MD']['country'] = 'Moldova';
+$countries['MD']['countrycode'] = '373';
+$countries['MD']['exitcode'] = '00';
+$countries['MD']['isocode'] = 'MD';
+$countries['MC']['country'] = 'Monaco';
+$countries['MC']['countrycode'] = '377';
+$countries['MC']['exitcode'] = '00';
+$countries['MC']['isocode'] = 'MC';
+$countries['MN']['country'] = 'Mongolia';
+$countries['MN']['countrycode'] = '976';
+$countries['MN']['exitcode'] = '001';
+$countries['MN']['isocode'] = 'MN';
+$countries['ME']['country'] = 'Montenegro';
+$countries['ME']['countrycode'] = '382';
+$countries['ME']['exitcode'] = '00';
+$countries['ME']['isocode'] = 'ME';
+$countries['MS']['country'] = 'Montserrat';
+$countries['MS']['countrycode'] = '1';
+$countries['MS']['exitcode'] = '011';
+$countries['MS']['isocode'] = 'MS';
+$countries['MA']['country'] = 'Morocco';
+$countries['MA']['countrycode'] = '212';
+$countries['MA']['exitcode'] = '00';
+$countries['MA']['isocode'] = 'MA';
+$countries['MZ']['country'] = 'Mozambique';
+$countries['MZ']['countrycode'] = '258';
+$countries['MZ']['exitcode'] = '00';
+$countries['MZ']['isocode'] = 'MZ';
+$countries['MM']['country'] = 'Myanmar';
+$countries['MM']['countrycode'] = '95';
+$countries['MM']['exitcode'] = '00';
+$countries['MM']['isocode'] = 'MM';
+$countries['NA']['country'] = 'Namibia';
+$countries['NA']['countrycode'] = '264';
+$countries['NA']['exitcode'] = '00';
+$countries['NA']['isocode'] = 'NA';
+$countries['NR']['country'] = 'Nauru';
+$countries['NR']['countrycode'] = '674';
+$countries['NR']['exitcode'] = '00';
+$countries['NR']['isocode'] = 'NR';
+$countries['NP']['country'] = 'Nepal';
+$countries['NP']['countrycode'] = '977';
+$countries['NP']['exitcode'] = '00';
+$countries['NP']['isocode'] = 'NP';
+$countries['NL']['country'] = 'Netherlands';
+$countries['NL']['countrycode'] = '31';
+$countries['NL']['exitcode'] = '00';
+$countries['NL']['isocode'] = 'NL';
+$countries['AN']['country'] = 'Netherlands Antilles';
+$countries['AN']['countrycode'] = '599';
+$countries['AN']['exitcode'] = '00';
+$countries['AN']['isocode'] = 'AN';
+$countries['NC']['country'] = 'New Caledonia';
+$countries['NC']['countrycode'] = '687';
+$countries['NC']['exitcode'] = '00';
+$countries['NC']['isocode'] = 'NC';
+$countries['NZ']['country'] = 'New Zealand';
+$countries['NZ']['countrycode'] = '64';
+$countries['NZ']['exitcode'] = '00';
+$countries['NZ']['isocode'] = 'NZ';
+$countries['NI']['country'] = 'Nicaragua';
+$countries['NI']['countrycode'] = '505';
+$countries['NI']['exitcode'] = '00';
+$countries['NI']['isocode'] = 'NI';
+$countries['NE']['country'] = 'Niger';
+$countries['NE']['countrycode'] = '227';
+$countries['NE']['exitcode'] = '00';
+$countries['NE']['isocode'] = 'NE';
+$countries['NG']['country'] = 'Nigeria';
+$countries['NG']['countrycode'] = '234';
+$countries['NG']['exitcode'] = '009';
+$countries['NG']['isocode'] = 'NG';
+$countries['NU']['country'] = 'Niue';
+$countries['NU']['countrycode'] = '683';
+$countries['NU']['exitcode'] = '00';
+$countries['NU']['isocode'] = 'NU';
+$countries['NF']['country'] = 'Norfolk Island';
+$countries['NF']['countrycode'] = '6723';
+$countries['NF']['exitcode'] = '00';
+$countries['NF']['isocode'] = 'NF';
+$countries['KP']['country'] = 'North Korea';
+$countries['KP']['countrycode'] = '850';
+$countries['KP']['exitcode'] = '99';
+$countries['KP']['isocode'] = 'KP';
+$countries['NO']['country'] = 'Norway';
+$countries['NO']['countrycode'] = '47';
+$countries['NO']['exitcode'] = '00';
+$countries['NO']['isocode'] = 'NO';
+$countries['OM']['country'] = 'Oman';
+$countries['OM']['countrycode'] = '968';
+$countries['OM']['exitcode'] = '00';
+$countries['OM']['isocode'] = 'OM';
+$countries['PK']['country'] = 'Pakistan';
+$countries['PK']['countrycode'] = '92';
+$countries['PK']['exitcode'] = '00';
+$countries['PK']['isocode'] = 'PK';
+$countries['PW']['country'] = 'Palau';
+$countries['PW']['countrycode'] = '680';
+$countries['PW']['exitcode'] = '011';
+$countries['PW']['isocode'] = 'PW';
+$countries['PA']['country'] = 'Panama';
+$countries['PA']['countrycode'] = '507';
+$countries['PA']['exitcode'] = '00';
+$countries['PA']['isocode'] = 'PA';
+$countries['PG']['country'] = 'Papua New Guinea';
+$countries['PG']['countrycode'] = '675';
+$countries['PG']['exitcode'] = '00';
+$countries['PG']['isocode'] = 'PG';
+$countries['PY']['country'] = 'Paraguay';
+$countries['PY']['countrycode'] = '595';
+$countries['PY']['exitcode'] = '00';
+$countries['PY']['isocode'] = 'PY';
+$countries['PE']['country'] = 'Peru';
+$countries['PE']['countrycode'] = '51';
+$countries['PE']['exitcode'] = '00';
+$countries['PE']['isocode'] = 'PE';
+$countries['PH']['country'] = 'Philippines';
+$countries['PH']['countrycode'] = '63';
+$countries['PH']['exitcode'] = '00';
+$countries['PH']['isocode'] = 'PH';
+$countries['PL']['country'] = 'Poland';
+$countries['PL']['countrycode'] = '48';
+$countries['PL']['exitcode'] = '00';
+$countries['PL']['isocode'] = 'PL';
+$countries['PT']['country'] = 'Portugal';
+$countries['PT']['countrycode'] = '351';
+$countries['PT']['exitcode'] = '00';
+$countries['PT']['isocode'] = 'PT';
+$countries['PR']['country'] = 'Puerto Rico';
+$countries['PR']['countrycode'] = '1';
+$countries['PR']['exitcode'] = '011';
+$countries['PR']['isocode'] = 'PR';
+$countries['QA']['country'] = 'Qatar';
+$countries['QA']['countrycode'] = '974';
+$countries['QA']['exitcode'] = '00';
+$countries['QA']['isocode'] = 'QA';
+$countries['RE']['country'] = 'Reunion';
+$countries['RE']['countrycode'] = '262';
+$countries['RE']['exitcode'] = '00';
+$countries['RE']['isocode'] = 'RE';
+$countries['RO']['country'] = 'Romania';
+$countries['RO']['countrycode'] = '40';
+$countries['RO']['exitcode'] = '00';
+$countries['RO']['isocode'] = 'RO';
+$countries['RU']['country'] = 'Russian Federation';
+$countries['RU']['countrycode'] = '7';
+$countries['RU']['exitcode'] = '810';
+$countries['RU']['isocode'] = 'RU';
+$countries['RW']['country'] = 'Rwanda';
+$countries['RW']['countrycode'] = '250';
+$countries['RW']['exitcode'] = '00';
+$countries['RW']['isocode'] = 'RW';
+$countries['SH']['country'] = 'Saint Helena';
+$countries['SH']['countrycode'] = '290';
+$countries['SH']['exitcode'] = '00';
+$countries['SH']['isocode'] = 'SH';
+$countries['KN']['country'] = 'Saint Kitts and Nevis';
+$countries['KN']['countrycode'] = '1';
+$countries['KN']['exitcode'] = '011';
+$countries['KN']['isocode'] = 'KN';
+$countries['LC']['country'] = 'Saint Lucia';
+$countries['LC']['countrycode'] = '1';
+$countries['LC']['exitcode'] = '011';
+$countries['LC']['isocode'] = 'LC';
+$countries['GP']['country'] = 'Saint Barthelemy';
+$countries['GP']['countrycode'] = '590';
+$countries['GP']['exitcode'] = '00';
+$countries['GP']['isocode'] = 'GP';
+$countries['PM']['country'] = 'Saint Pierre and Miquelon';
+$countries['PM']['countrycode'] = '508';
+$countries['PM']['exitcode'] = '00';
+$countries['PM']['isocode'] = 'PM';
+$countries['VC']['country'] = 'Saint Vincent and the Grenadines';
+$countries['VC']['countrycode'] = '1';
+$countries['VC']['exitcode'] = '011';
+$countries['VC']['isocode'] = 'VC';
+$countries['WS']['country'] = 'Samoa';
+$countries['WS']['countrycode'] = '685';
+$countries['WS']['exitcode'] = '0';
+$countries['WS']['isocode'] = 'WS';
+$countries['SM']['country'] = 'San Marino';
+$countries['SM']['countrycode'] = '378';
+$countries['SM']['exitcode'] = '00';
+$countries['SM']['isocode'] = 'SM';
+$countries['ST']['country'] = 'Sao Tome and Principe';
+$countries['ST']['countrycode'] = '239';
+$countries['ST']['exitcode'] = '00';
+$countries['ST']['isocode'] = 'ST';
+$countries['SA']['country'] = 'Saudi Arabia';
+$countries['SA']['countrycode'] = '966';
+$countries['SA']['exitcode'] = '00';
+$countries['SA']['isocode'] = 'SA';
+$countries['SN']['country'] = 'Senegal';
+$countries['SN']['countrycode'] = '221';
+$countries['SN']['exitcode'] = '00';
+$countries['SN']['isocode'] = 'SN';
+$countries['RS']['country'] = 'Serbia';
+$countries['RS']['countrycode'] = '381';
+$countries['RS']['exitcode'] = '00';
+$countries['RS']['isocode'] = 'RS';
+$countries['SC']['country'] = 'Seychelles';
+$countries['SC']['countrycode'] = '248';
+$countries['SC']['exitcode'] = '00';
+$countries['SC']['isocode'] = 'SC';
+$countries['SL']['country'] = 'Sierra Leone';
+$countries['SL']['countrycode'] = '232';
+$countries['SL']['exitcode'] = '00';
+$countries['SL']['isocode'] = 'SL';
+$countries['SG']['country'] = 'Singapore';
+$countries['SG']['countrycode'] = '65';
+$countries['SG']['exitcode'] = '001, 008';
+$countries['SG']['isocode'] = 'SG';
+$countries['SK']['country'] = 'Slovakia';
+$countries['SK']['countrycode'] = '421';
+$countries['SK']['exitcode'] = '00';
+$countries['SK']['isocode'] = 'SK';
+$countries['SI']['country'] = 'Slovenia';
+$countries['SI']['countrycode'] = '386';
+$countries['SI']['exitcode'] = '00';
+$countries['SI']['isocode'] = 'SI';
+$countries['SB']['country'] = 'Solomon Islands';
+$countries['SB']['countrycode'] = '677';
+$countries['SB']['exitcode'] = '00';
+$countries['SB']['isocode'] = 'SB';
+$countries['SO']['country'] = 'Somalia';
+$countries['SO']['countrycode'] = '252';
+$countries['SO']['exitcode'] = '00';
+$countries['SO']['isocode'] = 'SO';
+$countries['ZA']['country'] = 'South Africa';
+$countries['ZA']['countrycode'] = '27';
+$countries['ZA']['exitcode'] = '00';
+$countries['ZA']['isocode'] = 'ZA';
+$countries['KR']['country'] = 'South Korea';
+$countries['KR']['countrycode'] = '82';
+$countries['KR']['exitcode'] = '001, 002';
+$countries['KR']['isocode'] = 'KR';
+$countries['ES']['country'] = 'Spain';
+$countries['ES']['countrycode'] = '34';
+$countries['ES']['exitcode'] = '00';
+$countries['ES']['isocode'] = 'ES';
+$countries['LK']['country'] = 'Sri Lanka';
+$countries['LK']['countrycode'] = '94';
+$countries['LK']['exitcode'] = '00';
+$countries['LK']['isocode'] = 'LK';
+$countries['SD']['country'] = 'Sudan';
+$countries['SD']['countrycode'] = '249';
+$countries['SD']['exitcode'] = '00';
+$countries['SD']['isocode'] = 'SD';
+$countries['SR']['country'] = 'Suriname';
+$countries['SR']['countrycode'] = '597';
+$countries['SR']['exitcode'] = '00';
+$countries['SR']['isocode'] = 'SR';
+$countries['SZ']['country'] = 'Swaziland';
+$countries['SZ']['countrycode'] = '268';
+$countries['SZ']['exitcode'] = '00';
+$countries['SZ']['isocode'] = 'SZ';
+$countries['SE']['country'] = 'Sweden';
+$countries['SE']['countrycode'] = '46';
+$countries['SE']['exitcode'] = '00';
+$countries['SE']['isocode'] = 'SE';
+$countries['CH']['country'] = 'Switzerland';
+$countries['CH']['countrycode'] = '41';
+$countries['CH']['exitcode'] = '00';
+$countries['CH']['isocode'] = 'CH';
+$countries['SY']['country'] = 'Syria';
+$countries['SY']['countrycode'] = '963';
+$countries['SY']['exitcode'] = '00';
+$countries['SY']['isocode'] = 'SY';
+$countries['TW']['country'] = 'Taiwan';
+$countries['TW']['countrycode'] = '886';
+$countries['TW']['exitcode'] = '002';
+$countries['TW']['isocode'] = 'TW';
+$countries['TJ']['country'] = 'Tajikistan';
+$countries['TJ']['countrycode'] = '992';
+$countries['TJ']['exitcode'] = '810';
+$countries['TJ']['isocode'] = 'TJ';
+$countries['TZ']['country'] = 'Tanzania';
+$countries['TZ']['countrycode'] = '255';
+$countries['TZ']['exitcode'] = '000';
+$countries['TZ']['isocode'] = 'TZ';
+$countries['TH']['country'] = 'Thailand';
+$countries['TH']['countrycode'] = '66';
+$countries['TH']['exitcode'] = '001';
+$countries['TH']['isocode'] = 'TH';
+$countries['TG']['country'] = 'Togo';
+$countries['TG']['countrycode'] = '228';
+$countries['TG']['exitcode'] = '00';
+$countries['TG']['isocode'] = 'TG';
+$countries['TK']['country'] = 'Tokelau';
+$countries['TK']['countrycode'] = '690';
+$countries['TK']['exitcode'] = '00';
+$countries['TK']['isocode'] = 'TK';
+$countries['TO']['country'] = 'Tonga';
+$countries['TO']['countrycode'] = '676';
+$countries['TO']['exitcode'] = '00';
+$countries['TO']['isocode'] = 'TO';
+$countries['TT']['country'] = 'Trinidad and Tobago';
+$countries['TT']['countrycode'] = '1';
+$countries['TT']['exitcode'] = '011';
+$countries['TT']['isocode'] = 'TT';
+$countries['TN']['country'] = 'Tunisia';
+$countries['TN']['countrycode'] = '216';
+$countries['TN']['exitcode'] = '00';
+$countries['TN']['isocode'] = 'TN';
+$countries['TR']['country'] = 'Turkey';
+$countries['TR']['countrycode'] = '90';
+$countries['TR']['exitcode'] = '00';
+$countries['TR']['isocode'] = 'TR';
+$countries['TM']['country'] = 'Turkmenistan';
+$countries['TM']['countrycode'] = '993';
+$countries['TM']['exitcode'] = '810';
+$countries['TM']['isocode'] = 'TM';
+$countries['TC']['country'] = 'Turks and Caicos Islands';
+$countries['TC']['countrycode'] = '1';
+$countries['TC']['exitcode'] = '0';
+$countries['TC']['isocode'] = 'TC';
+$countries['TV']['country'] = 'Tuvalu';
+$countries['TV']['countrycode'] = '688';
+$countries['TV']['exitcode'] = '00';
+$countries['TV']['isocode'] = 'TV';
+$countries['UG']['country'] = 'Uganda';
+$countries['UG']['countrycode'] = '256';
+$countries['UG']['exitcode'] = '000';
+$countries['UG']['isocode'] = 'UG';
+$countries['UA']['country'] = 'Ukraine';
+$countries['UA']['countrycode'] = '380';
+$countries['UA']['exitcode'] = '00';
+$countries['UA']['isocode'] = 'UA';
+$countries['AE']['country'] = 'United Arab Emirates';
+$countries['AE']['countrycode'] = '971';
+$countries['AE']['exitcode'] = '00';
+$countries['AE']['isocode'] = 'AE';
+$countries['GB']['country'] = 'United Kingdom';
+$countries['GB']['countrycode'] = '44';
+$countries['GB']['exitcode'] = '00';
+$countries['GB']['isocode'] = 'GB';
+$countries['US']['country'] = 'United States';
+$countries['US']['countrycode'] = '1';
+$countries['US']['exitcode'] = '011';
+$countries['US']['isocode'] = 'US';
+$countries['VI']['country'] = 'U.S. Virgin Islands';
+$countries['VI']['countrycode'] = '1';
+$countries['VI']['exitcode'] = '011';
+$countries['VI']['isocode'] = 'VI';
+$countries['UY']['country'] = 'Uruguay';
+$countries['UY']['countrycode'] = '598';
+$countries['UY']['exitcode'] = '00';
+$countries['UY']['isocode'] = 'UY';
+$countries['UZ']['country'] = 'Uzbekistan';
+$countries['UZ']['countrycode'] = '998';
+$countries['UZ']['exitcode'] = '8 - wait for dial tone - 10';
+$countries['UZ']['isocode'] = 'UZ';
+$countries['VU']['country'] = 'Vanuatu';
+$countries['VU']['countrycode'] = '678';
+$countries['VU']['exitcode'] = '00';
+$countries['VU']['isocode'] = 'VU';
+$countries['VA']['country'] = 'Vatican City';
+$countries['VA']['countrycode'] = '379, 39';
+$countries['VA']['exitcode'] = '00';
+$countries['VA']['isocode'] = 'VA';
+$countries['VE']['country'] = 'Venezuela';
+$countries['VE']['countrycode'] = '58';
+$countries['VE']['exitcode'] = '00';
+$countries['VE']['isocode'] = 'VE';
+$countries['VN']['country'] = 'Vietnam';
+$countries['VN']['countrycode'] = '84';
+$countries['VN']['exitcode'] = '00';
+$countries['VN']['isocode'] = 'VN';
+$countries['WF']['country'] = 'Wallis and Futuna';
+$countries['WF']['countrycode'] = '681';
+$countries['WF']['exitcode'] = '00';
+$countries['WF']['isocode'] = 'WF';
+$countries['YE']['country'] = 'Yemen';
+$countries['YE']['countrycode'] = '967';
+$countries['YE']['exitcode'] = '00';
+$countries['YE']['isocode'] = 'YE';
+$countries['ZM']['country'] = 'Zambia';
+$countries['ZM']['countrycode'] = '260';
+$countries['ZM']['exitcode'] = '00';
+$countries['ZM']['isocode'] = 'ZM';
+$countries['ZW']['country'] = 'Zimbabwe';
+$countries['ZW']['countrycode'] = '263';
+$countries['ZW']['exitcode'] = '00';
+$countries['ZW']['isocode'] = 'ZW';
+
+?>

+ 1 - 1
resources/install.php

@@ -1745,7 +1745,7 @@ EOL;
 			$theme_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/themes';
 			if ($handle = opendir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/themes')) {
 				while (false !== ($dir_name = readdir($handle))) {
-					if ($dir_name != "." && $dir_name != ".." && $dir_name != ".svn" && $dir_name != ".git" && is_readable($theme_dir.'/'.$dir_name)) {
+					if ($dir_name != "." && $dir_name != ".." && $dir_name != ".svn" && $dir_name != ".git" && $dir_name != "flags" && is_readable($theme_dir.'/'.$dir_name)) {
 						$dir_label = str_replace('_', ' ', $dir_name);
 						$dir_label = str_replace('-', ' ', $dir_label);
 						if ($dir_name == $install_template_name) {

+ 121 - 80
themes/enhanced/app_defaults.php

@@ -26,7 +26,64 @@
 
 if ($domains_processed == 1) {
 
+	//get the background images
+		$relative_path = PROJECT_PATH.'/themes/enhanced/images/backgrounds';
+		$backgrounds = opendir($_SERVER["DOCUMENT_ROOT"].'/'.$relative_path);
+		unset($array);
+		$x = 0;
+		while (false !== ($file = readdir($backgrounds))) {
+			if ($file != "." AND $file != ".."){
+				$new_path = $dir.'/'.$file;
+				$level = explode('/',$new_path);
+				$ext = pathinfo($file, PATHINFO_EXTENSION);
+				if ($ext == "png" || $ext == "jpg" || $ext == "jpeg" || $ext == "gif") {
+					$x++;
+					$array[$x]['default_setting_category'] = 'theme';
+					$array[$x]['default_setting_subcategory'] = 'background_image';
+					$array[$x]['default_setting_name'] = 'array';
+					$array[$x]['default_setting_value'] = $relative_path.'/'.$file;
+					$array[$x]['default_setting_enabled'] = 'false';
+					$array[$x]['default_setting_description'] = 'Set a relative path or URL within a selected compatible template.';
+				}
+				if ($x > 300) { break; };
+			}
+		}
+		
+		if(!$set_session_theme){
+		//get default settings
+			$sql = "select * from v_default_settings ";
+			$sql .= "where default_setting_category = 'theme' ";
+			$sql .= "and default_setting_subcategory = 'background_image' ";
+			$prep_statement = $db->prepare(check_sql($sql));
+			$prep_statement->execute();
+			$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+			unset($prep_statement);
+	
+			$background_image_enabled = false;
+		//add theme default settings
+			foreach ($array as $row) {
+				$found = false;
+				foreach ($default_settings as $field) {
+					if ($field["default_setting_value"] == $row["default_setting_value"]) {
+						$found = true;
+					}
+					//enable_background_image is a new setting, if a user has any background images enabled we should turn it on
+					if ($field["default_setting_enabled"] == 'enabled') {
+						$background_image_enabled = true;
+					}
+				}
+				if (!$found) {
+					$orm = new orm;
+					$orm->name('default_settings');
+					$orm->save($row);
+					$message = $orm->message;
+					//print_r($message);
+				}
+			}
+		}
+
 	//define array of settings
+		unset($array);
 		$x = 0;
 		$array[$x]['default_setting_category'] = 'theme';
 		$array[$x]['default_setting_subcategory'] = 'login_opacity';
@@ -181,25 +238,46 @@ if ($domains_processed == 1) {
 		$array[$x]['default_setting_value'] = '0.96';
 		$array[$x]['default_setting_enabled'] = 'false';
 		$array[$x]['default_setting_description'] = 'Set the opacity of the main menu (decimal, Minimized theme only).';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'background_image_enabled';
+		$array[$x]['default_setting_name'] = 'boolean';
+		$array[$x]['default_setting_value'] = 'true';
+		$array[$x]['default_setting_enabled'] = 'false';
+		if($background_image_enabled) { $array[$x]['default_setting_enabled'] = 'true'; }
+		$array[$x]['default_setting_description'] = 'Enable use of background images.';
 
-	//iterate and add each, if necessary
-		foreach ($array as $index => $default_settings) {
-			//add theme default settings
-			$sql = "select count(*) as num_rows from v_default_settings ";
-			$sql .= "where default_setting_category = 'theme' ";
-			$sql .= "and default_setting_subcategory = '".$default_settings['default_setting_subcategory']."' ";
-			$prep_statement = $db->prepare($sql);
-			if ($prep_statement) {
-				$prep_statement->execute();
-				$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
-				unset($prep_statement);
-				if ($row['num_rows'] == 0) {
-					$orm = new orm;
-					$orm->name('default_settings');
-					$orm->save($array[$index]);
-					$message = $orm->message;
+		if($set_session_theme){
+			foreach ($array as $index => $default_settings) {
+				$sub_category = $array[$index]['default_setting_subcategory'];
+				$name = $array[$index]['default_setting_name'];
+				if($array[$index]['default_setting_enabled'] == 'true'){
+					$_SESSION['theme'][$sub_category][$name] = $array[$index]['default_setting_value'];
+				}else{
+					$_SESSION['theme'][$sub_category][$name] = '';
+				}
+			}
+		}
+		else{
+		//iterate and add each, if necessary
+			foreach ($array as $index => $default_settings) {
+				//add theme default settings
+				$sql = "select count(*) as num_rows from v_default_settings ";
+				$sql .= "where default_setting_category = 'theme' ";
+				$sql .= "and default_setting_subcategory = '".$default_settings['default_setting_subcategory']."' ";
+				$prep_statement = $db->prepare($sql);
+				if ($prep_statement) {
+					$prep_statement->execute();
+					$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
+					unset($prep_statement);
+					if ($row['num_rows'] == 0) {
+						$orm = new orm;
+						$orm->name('default_settings');
+						$orm->save($array[$index]);
+						$message = $orm->message;
+					}
+					unset($row);
 				}
-				unset($row);
 			}
 		}
 
@@ -222,73 +300,36 @@ if ($domains_processed == 1) {
 		$array[$x]['default_setting_enabled'] = 'true';
 		$array[$x]['default_setting_description'] = 'Set a secondary background (HTML compatible) color, for a gradient effect.';
 
-	//add secondary background color separately, if missing
-		$sql = "select count(*) as num_rows from v_default_settings ";
-		$sql .= "where default_setting_category = 'theme' ";
-		$sql .= "and default_setting_subcategory = 'background_color' ";
-		$prep_statement = $db->prepare($sql);
-		if ($prep_statement) {
-			$prep_statement->execute();
-			$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
-			unset($prep_statement);
-			if ($row['num_rows'] == 0) {
-				$orm = new orm;
-				$orm->name('default_settings');
-				foreach ($array as $index => $null) {
-					$orm->save($array[$index]);
-				}
-				$message = $orm->message;
-				//print_r($message);
-			}
-			unset($row);
-		}
-
-	//get the background images
-		$relative_path = PROJECT_PATH.'/themes/enhanced/images/backgrounds';
-		$backgrounds = opendir($_SERVER["DOCUMENT_ROOT"].'/'.$relative_path);
-		unset($array);
-		$x = 0;
-		while (false !== ($file = readdir($backgrounds))) {
-			if ($file != "." AND $file != ".."){
-				$new_path = $dir.'/'.$file;
-				$level = explode('/',$new_path);
-				$ext = pathinfo($file, PATHINFO_EXTENSION);
-				if ($ext == "png" || $ext == "jpg" || $ext == "jpeg" || $ext == "gif") {
-					$x++;
-					$array[$x]['default_setting_category'] = 'theme';
-					$array[$x]['default_setting_subcategory'] = 'background_image';
-					$array[$x]['default_setting_name'] = 'array';
-					$array[$x]['default_setting_value'] = $relative_path.'/'.$file;
-					$array[$x]['default_setting_enabled'] = 'false';
-					$array[$x]['default_setting_description'] = 'Set a relative path or URL within a selected compatible template.';
+		if($set_session_theme){
+			foreach ($array as $index => $default_settings) {
+				$sub_category = $array[$index]['default_setting_subcategory'];
+				$idx = $array[$index]['default_setting_order'];
+				if($array[$index]['default_setting_enabled'] == 'true'){
+					$_SESSION['theme'][$sub_category][$idx] = $array[$index]['default_setting_value'];
 				}
-				if ($x > 300) { break; };
 			}
+			return;
 		}
-
-	//get default settings
-		$sql = "select * from v_default_settings ";
-		$sql .= "where default_setting_category = 'theme' ";
-		$sql .= "and default_setting_subcategory = 'background_image' ";
-		$prep_statement = $db->prepare(check_sql($sql));
-		$prep_statement->execute();
-		$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-		unset($prep_statement);
-
-	//add theme default settings
-		foreach ($array as $row) {
-			$found = false;
-			foreach ($default_settings as $field) {
-				if ($field["default_setting_value"] == $row["default_setting_value"]) {
-					$found = true;
+		else{
+		//add secondary background color separately, if missing
+			$sql = "select count(*) as num_rows from v_default_settings ";
+			$sql .= "where default_setting_category = 'theme' ";
+			$sql .= "and default_setting_subcategory = 'background_color' ";
+			$prep_statement = $db->prepare($sql);
+			if ($prep_statement) {
+				$prep_statement->execute();
+				$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
+				unset($prep_statement);
+				if ($row['num_rows'] == 0) {
+					$orm = new orm;
+					$orm->name('default_settings');
+					foreach ($array as $index => $null) {
+						$orm->save($array[$index]);
+					}
+					$message = $orm->message;
+					//print_r($message);
 				}
-			}
-			if (!$found) {
-				$orm = new orm;
-				$orm->name('default_settings');
-				$orm->save($row);
-				$message = $orm->message;
-				//print_r($message);
+				unset($row);
 			}
 		}
 

+ 1 - 1
themes/enhanced/template.php

@@ -1424,7 +1424,7 @@ if (strlen($_SESSION['message']) > 0) {
 
 	<?php
 	// check for background image
-	if (isset($_SESSION['theme']['background_image'])) {
+	if (isset($_SESSION['theme']['background_image_enabled']['boolean']) and $_SESSION['theme']['background_image_enabled']['boolean'] == 'true') {
 		// background image is enabled
 		$image_extensions = array('jpg','jpeg','png','gif');
 

BIN
themes/flags/Afghanistan.png


BIN
themes/flags/Aland Islands.png


BIN
themes/flags/Albania.png


BIN
themes/flags/Algeria.png


BIN
themes/flags/American Samoa.png


BIN
themes/flags/Andorra.png


BIN
themes/flags/Angola.png


BIN
themes/flags/Anguilla.png


BIN
themes/flags/Antigua and Barbuda.png


BIN
themes/flags/Argentina.png


BIN
themes/flags/Armenia.png


BIN
themes/flags/Aruba.png


BIN
themes/flags/Australia.png


BIN
themes/flags/Austria.png


BIN
themes/flags/Azerbaijan.png


BIN
themes/flags/Bahamas.png


BIN
themes/flags/Bahrain.png


BIN
themes/flags/Bangladesh.png


BIN
themes/flags/Barbados.png


BIN
themes/flags/Belarus.png


BIN
themes/flags/Belgium.png


BIN
themes/flags/Belize.png


BIN
themes/flags/Benin.png


BIN
themes/flags/Bermuda.png


BIN
themes/flags/Bhutan.png


BIN
themes/flags/Bolivia, Plurinational State of.png


BIN
themes/flags/Bosnia and Herzegovina.png


BIN
themes/flags/Botswana.png


BIN
themes/flags/Bouvet Island.png


BIN
themes/flags/Brazil.png


BIN
themes/flags/British Indian Ocean Territory.png


BIN
themes/flags/Brunei Darussalam.png


BIN
themes/flags/Bulgaria.png


BIN
themes/flags/Burkina Faso.png


BIN
themes/flags/Burundi.png


BIN
themes/flags/Cabo Verde.png


BIN
themes/flags/Cambodia.png


BIN
themes/flags/Cameroon.png


BIN
themes/flags/Canada.png


BIN
themes/flags/Cayman Islands.png


BIN
themes/flags/Central African Republic.png


BIN
themes/flags/Chad.png


BIN
themes/flags/Chile.png


BIN
themes/flags/China.png


BIN
themes/flags/Christmas Island.png


BIN
themes/flags/Cocos (Keeling) Islands.png


BIN
themes/flags/Colombia.png


BIN
themes/flags/Comoros.png


BIN
themes/flags/Congo, the Democratic Republic of the.png


BIN
themes/flags/Congo.png


BIN
themes/flags/Cook Islands.png


BIN
themes/flags/Costa Rica.png


BIN
themes/flags/Cote d'Ivoire.png


BIN
themes/flags/Croatia.png


BIN
themes/flags/Cuba.png


BIN
themes/flags/Cyprus.png


BIN
themes/flags/Czech Republic.png


BIN
themes/flags/Denmark.png


BIN
themes/flags/Djibouti.png


BIN
themes/flags/Dominica.png


BIN
themes/flags/Dominican Republic.png


BIN
themes/flags/Ecuador.png


BIN
themes/flags/Egypt.png


BIN
themes/flags/El Salvador.png


BIN
themes/flags/Equatorial Guinea.png


BIN
themes/flags/Eritrea.png


BIN
themes/flags/Estonia.png


BIN
themes/flags/Ethiopia.png


BIN
themes/flags/Falkland Islands (Malvinas).png


BIN
themes/flags/Faroe Islands.png


BIN
themes/flags/Fiji.png


BIN
themes/flags/Finland.png


BIN
themes/flags/France.png


BIN
themes/flags/French Guiana.png


BIN
themes/flags/French Polynesia.png


BIN
themes/flags/French Southern Territories.png


BIN
themes/flags/Gabon.png


BIN
themes/flags/Gambia.png


BIN
themes/flags/Georgia.png


BIN
themes/flags/Germany.png


BIN
themes/flags/Ghana.png


BIN
themes/flags/Gibraltar.png


BIN
themes/flags/Greece.png


BIN
themes/flags/Greenland.png


BIN
themes/flags/Grenada.png


BIN
themes/flags/Guadeloupe.png


BIN
themes/flags/Guam.png


BIN
themes/flags/Guatemala.png


BIN
themes/flags/Guinea-Bissau.png


BIN
themes/flags/Guinea.png


BIN
themes/flags/Guyana.png


BIN
themes/flags/Haiti.png


BIN
themes/flags/Heard Island and McDonald Islands.png


BIN
themes/flags/Holy See.png


Some files were not shown because too many files changed in this diff