Browse Source

BugFix [master] - Convert all menus to 2-2 format (#2627)

convert all app_menu.php files to have all placeholders and languages and use 2-2 format for languages
update app_defaults to convert any items found using legacy values in user_setings, domain_settings and default_settings
Mafoo 8 years ago
parent
commit
8cb32b8e99

+ 51 - 37
core/apps/app_menu.php

@@ -1,41 +1,55 @@
 <?php
 <?php
 
 
-$apps[$x]['menu'][0]['title']['en-us'] = "Apps";
-$apps[$x]['menu'][0]['title']['es-cl'] = "Aplicaciones";
-$apps[$x]['menu'][0]['title']['fr-fr'] = "Apps";
-$apps[$x]['menu'][0]['title']['pt-pt'] = "Aplicações";
-$apps[$x]['menu'][0]['title']['pt-br'] = "Aplicações";
-$apps[$x]['menu'][0]['title']['pl'] = "Aplikacje";
-$apps[$x]['menu'][0]['title']['ru-ru'] = "Приложения";
-$apps[$x]['menu'][0]['title']['sv-se'] = "Appar";
-$apps[$x]['menu'][0]['title']['uk'] = "Додатки";
-$apps[$x]['menu'][0]['title']['de-de'] = "Applikationen";
-$apps[$x]['menu'][0]['title']['de-at'] = "Applikationen";
-$apps[$x]['menu'][0]['uuid'] = "fd29e39c-c936-f5fc-8e2b-611681b266b5";
-$apps[$x]['menu'][0]['parent_uuid'] = "";
-$apps[$x]['menu'][0]['category'] = "internal";
-$apps[$x]['menu'][0]['icon'] = "glyphicon-send";
-$apps[$x]['menu'][0]['path'] = "";
-$apps[$x]['menu'][0]['order'] = "20";
-$apps[$x]['menu'][0]['groups'][] = "user";
-$apps[$x]['menu'][0]['groups'][] = "admin";
-$apps[$x]['menu'][0]['groups'][] = "superadmin";
-
-$apps[$x]['menu'][1]['title']['en-us'] = "App Manager";
-$apps[$x]['menu'][1]['title']['es-cl'] = "Administrador de Aplicaciones";
-$apps[$x]['menu'][1]['title']['fr-fr'] = "Gestion App";
-$apps[$x]['menu'][1]['title']['pt-pt'] = "Gestor de Aplicações";
-$apps[$x]['menu'][1]['title']['pt-br'] = "Gerenciador de aplicações";
-$apps[$x]['menu'][1]['title']['pl'] = "Menedżer aplikacji";
-$apps[$x]['menu'][1]['title']['ru-ru'] = "Менеджер приложений";
-$apps[$x]['menu'][1]['title']['sv-se'] = "App Inställningar";
-$apps[$x]['menu'][1]['title']['uk'] = "Керування додатками";
-$apps[$x]['menu'][1]['title']['de-de'] = "Applikation Verwalten";
-$apps[$x]['menu'][1]['title']['de-at'] = "Applikation Verwalten";
-$apps[$x]['menu'][1]['uuid'] = "ef00f229-7890-00c2-bf23-fed5b8fa9fe7";
-$apps[$x]['menu'][1]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
-$apps[$x]['menu'][1]['category'] = "internal";
-$apps[$x]['menu'][1]['path'] = "/core/apps/apps.php";
-$apps[$x]['menu'][1]['groups'][] = "superadmin";
+	$y=0;
+	$apps[$x]['menu'][$y]['title']['en-us'] = "Apps";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Applikationen";
+	$apps[$x]['menu'][$y]['title']['de-de'] = "Applikationen";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Aplicaciones";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "Apps";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "Aplikacje";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "Aplicações";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "Aplicações";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Приложения";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "Appar";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = "Додатки";
+	$apps[$x]['menu'][$y]['uuid'] = "fd29e39c-c936-f5fc-8e2b-611681b266b5";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['icon'] = "glyphicon-send";
+	$apps[$x]['menu'][$y]['path'] = "";
+	$apps[$x]['menu'][$y]['order'] = "20";
+	$apps[$x]['menu'][$y]['groups'][] = "user";
+	$apps[$x]['menu'][$y]['groups'][] = "admin";
+	$apps[$x]['menu'][$y]['groups'][] = "superadmin";
+	$y++;	
+	$apps[$x]['menu'][$y]['title']['en-us'] = "App Manager";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Applikation Verwalten";
+	$apps[$x]['menu'][$y]['title']['de-de'] = "Applikation Verwalten";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Administrador de Aplicaciones";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "Gestion App";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "Menedżer aplikacji";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "Gerenciador de aplicações";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "Gestor de Aplicações";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Менеджер приложений";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "App Inställningar";
+	$apps[$x]['menu'][$y]['uuid'] = "ef00f229-7890-00c2-bf23-fed5b8fa9fe7";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['path'] = "/core/apps/apps.php";
+	$apps[$x]['menu'][$y]['groups'][] = "superadmin";
 
 
 ?>
 ?>

+ 24 - 17
core/databases/app_menu.php

@@ -1,21 +1,28 @@
 <?php
 <?php
 
 
-$apps[$x]['menu'][0]['title']['en-us'] = "Databases";
-$apps[$x]['menu'][0]['title']['es-cl'] = "Bases de datos";
-$apps[$x]['menu'][0]['title']['fr-fr'] = "BDD";
-$apps[$x]['menu'][0]['title']['pt-pt'] = "Base de Dados";
-$apps[$x]['menu'][0]['title']['pt-br'] = "Base de dados";
-$apps[$x]['menu'][0]['title']['pl'] = "Bazy danych";
-$apps[$x]['menu'][0]['title']['ru-ru'] = "Базы данных";
-$apps[$x]['menu'][0]['title']['sv-se'] = "Databaser";
-$apps[$x]['menu'][0]['title']['uk'] = "Бази даних";
-$apps[$x]['menu'][0]['title']['de-de'] = "Datenbanken";
-$apps[$x]['menu'][0]['title']['de-at'] = "Datenbanken";
-$apps[$x]['menu'][0]['title']['ar-eg'] = "قواعد البيانات";
-$apps[$x]['menu'][0]['uuid'] = "ebbd754d-ca74-d5b1-a77e-9206ba3ecc3f";
-$apps[$x]['menu'][0]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
-$apps[$x]['menu'][0]['category'] = "internal";
-$apps[$x]['menu'][0]['path'] = "/core/databases/databases.php";
-$apps[$x]['menu'][0]['groups'][] = "superadmin";
+	$y=0;
+	$apps[$x]['menu'][$y]['title']['en-us'] = "Databases";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "قواعد البيانات";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Datenbanken";
+	$apps[$x]['menu'][$y]['title']['de-de'] = "Datenbanken";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Bases de datos";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "BDD";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "Bazy danych";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "Base de dados";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "Base de Dados";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Базы данных";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "Databaser";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = "Бази даних";
+	$apps[$x]['menu'][$y]['uuid'] = "ebbd754d-ca74-d5b1-a77e-9206ba3ecc3f";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['path'] = "/core/databases/databases.php";
+	$apps[$x]['menu'][$y]['groups'][] = "superadmin";
 
 
 ?>
 ?>

+ 528 - 519
core/default_settings/app_defaults.php

@@ -1,519 +1,528 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2016
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-
-//process this only one time
-if ($domains_processed == 1) {
-
-	//set domains with enabled status of empty or null to true
-		$sql = "delete from v_default_settings ";
-		$sql .= "where (default_setting_category is null and default_setting_subcategory is null) ";
-		$sql .= "or (default_setting_category = '' and default_setting_subcategory = '') ";
-		$db->exec(check_sql($sql));
-		unset($sql);
-
-	//move the dynamic provision variables that from v_vars table to v_default_settings
-		/* if (count($_SESSION['provision']) == 0) {
-			$sql = "select * from v_vars ";
-			$sql .= "where var_cat = 'Provision' ";
-			$prep_statement = $db->prepare(check_sql($sql));
-			$prep_statement->execute();
-			$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-			foreach ($result as &$row) {
-				//set the variable
-					$var_name = check_str($row['var_name']);
-				//remove the 'v_' prefix from the variable name
-					if (substr($var_name, 0, 2) == "v_") {
-						$var_name = substr($var_name, 2);
-					}
-				//add the provision variable to the default settings table
-					$sql = "insert into v_default_settings ";
-					$sql .= "(";
-					$sql .= "default_setting_uuid, ";
-					$sql .= "default_setting_category, ";
-					$sql .= "default_setting_subcategory, ";
-					$sql .= "default_setting_name, ";
-					$sql .= "default_setting_value, ";
-					$sql .= "default_setting_enabled, ";
-					$sql .= "default_setting_description ";
-					$sql .= ") ";
-					$sql .= "values ";
-					$sql .= "(";
-					$sql .= "'".uuid()."', ";
-					$sql .= "'provision', ";
-					$sql .= "'".$var_name."', ";
-					$sql .= "'var', ";
-					$sql .= "'".check_str($row['var_value'])."', ";
-					$sql .= "'".check_str($row['var_enabled'])."', ";
-					$sql .= "'".check_str($row['var_description'])."' ";
-					$sql .= ")";
-					$db->exec(check_sql($sql));
-					unset($sql);
-			}
-			unset($prep_statement);
-			//delete the provision variables from system -> variables
-			//$sql = "delete from v_vars ";
-			//$sql .= "where var_cat = 'Provision' ";
-			//echo $sql ."\n";
-			//$db->exec(check_sql($sql));
-			//echo "$var_name $var_value \n";
-		}
-		*/
-
-	//populate the languages table, if necessary
-		$sql = "select count(*) as num_rows from v_languages";
-		$prep_statement = $db->prepare($sql);
-		if ($prep_statement) {
-			$prep_statement->execute();
-			$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
-			if ($row['num_rows'] == 0) {
-				$sql = "insert into v_languages (language_uuid, language, code) values ";
-				$sql .= "('".uuid()."', 'Afrikaans', 'af'), ";
-				$sql .= "('".uuid()."', 'Albanian', 'sq'), ";
-				$sql .= "('".uuid()."', 'Amharic', 'am'), ";
-				$sql .= "('".uuid()."', 'Arabic - Algeria', 'ar-dz'), ";
-				$sql .= "('".uuid()."', 'Arabic - Bahrain', 'ar-bh'), ";
-				$sql .= "('".uuid()."', 'Arabic - Egypt', 'ar-eg'), ";
-				$sql .= "('".uuid()."', 'Arabic - Iraq', 'ar-iq'), ";
-				$sql .= "('".uuid()."', 'Arabic - Jordan', 'ar-jo'), ";
-				$sql .= "('".uuid()."', 'Arabic - Kuwait', 'ar-kw'), ";
-				$sql .= "('".uuid()."', 'Arabic - Lebanon', 'ar-lb'), ";
-				$sql .= "('".uuid()."', 'Arabic - Libya', 'ar-ly'), ";
-				$sql .= "('".uuid()."', 'Arabic - Morocco', 'ar-ma'), ";
-				$sql .= "('".uuid()."', 'Arabic - Oman', 'ar-om'), ";
-				$sql .= "('".uuid()."', 'Arabic - Qatar', 'ar-qa'), ";
-				$sql .= "('".uuid()."', 'Arabic - Saudi Arabia', 'ar-sa'), ";
-				$sql .= "('".uuid()."', 'Arabic - Syria', 'ar-sy'), ";
-				$sql .= "('".uuid()."', 'Arabic - Tunisia', 'ar-tn'), ";
-				$sql .= "('".uuid()."', 'Arabic - United Arab Emirates', 'ar-ae'), ";
-				$sql .= "('".uuid()."', 'Arabic - Yemen', 'ar-ye'), ";
-				$sql .= "('".uuid()."', 'Armenian', 'hy'), ";
-				$sql .= "('".uuid()."', 'Assamese', 'as'), ";
-				$sql .= "('".uuid()."', 'Azeri - Cyrillic, Latin', 'az-az'), ";
-				$sql .= "('".uuid()."', 'Basque', 'eu'), ";
-				$sql .= "('".uuid()."', 'Belarusian', 'be'), ";
-				$sql .= "('".uuid()."', 'Bengali - India, Bangladesh', 'bn'), ";
-				$sql .= "('".uuid()."', 'Bosnian', 'bs'), ";
-				$sql .= "('".uuid()."', 'Bulgarian', 'bg'), ";
-				$sql .= "('".uuid()."', 'Burmese', 'my'), ";
-				$sql .= "('".uuid()."', 'Catalan', 'ca'), ";
-				$sql .= "('".uuid()."', 'Chinese - China', 'zh-cn'), ";
-				$sql .= "('".uuid()."', 'Chinese - Hong Kong SAR', 'zh-hk'), ";
-				$sql .= "('".uuid()."', 'Chinese - Macau SAR', 'zh-mo'), ";
-				$sql .= "('".uuid()."', 'Chinese - Singapore', 'zh-sg'), ";
-				$sql .= "('".uuid()."', 'Chinese - Taiwan', 'zh-tw'), ";
-				$sql .= "('".uuid()."', 'Croatian', 'hr'), ";
-				$sql .= "('".uuid()."', 'Czech', 'cs'), ";
-				$sql .= "('".uuid()."', 'Danish', 'da'), ";
-				$sql .= "('".uuid()."', 'Divehi, Dhivehi, Maldivian', 'dv'), ";
-				$sql .= "('".uuid()."', 'Dutch - Belgium', 'nl-be'), ";
-				$sql .= "('".uuid()."', 'Dutch - Netherlands', 'nl-nl'), ";
-				$sql .= "('".uuid()."', 'English - Australia', 'en-au'), ";
-				$sql .= "('".uuid()."', 'English - Belize', 'en-bz'), ";
-				$sql .= "('".uuid()."', 'English - Canada', 'en-ca'), ";
-				$sql .= "('".uuid()."', 'English - Caribbean', 'en-cb'), ";
-				$sql .= "('".uuid()."', 'English - Great Britain', 'en-gb'), ";
-				$sql .= "('".uuid()."', 'English - India', 'en-in'), ";
-				$sql .= "('".uuid()."', 'English - Ireland', 'en-ie'), ";
-				$sql .= "('".uuid()."', 'English - Jamaica', 'en-jm'), ";
-				$sql .= "('".uuid()."', 'English - New Zealand', 'en-nz'), ";
-				$sql .= "('".uuid()."', 'English - Phillippines', 'en-ph'), ";
-				$sql .= "('".uuid()."', 'English - Southern Africa', 'en-za'), ";
-				$sql .= "('".uuid()."', 'English - Trinidad', 'en-tt'), ";
-				$sql .= "('".uuid()."', 'English - United States', 'en-us'), ";
-				$sql .= "('".uuid()."', 'Estonian', 'et'), ";
-				$sql .= "('".uuid()."', 'Faroese', 'fo'), ";
-				$sql .= "('".uuid()."', 'Farsi - Persian', 'fa'), ";
-				$sql .= "('".uuid()."', 'Finnish', 'fi'), ";
-				$sql .= "('".uuid()."', 'French - Belgium', 'fr-be'), ";
-				$sql .= "('".uuid()."', 'French - Canada', 'fr-ca'), ";
-				$sql .= "('".uuid()."', 'French - France', 'fr-fr'), ";
-				$sql .= "('".uuid()."', 'French - Luxembourg', 'fr-lu'), ";
-				$sql .= "('".uuid()."', 'French - Switzerland', 'fr-ch'), ";
-				$sql .= "('".uuid()."', 'FYRO Macedonia', 'mk'), ";
-				$sql .= "('".uuid()."', 'Gaelic - Ireland', 'gd-ie'), ";
-				$sql .= "('".uuid()."', 'Gaelic - Scotland', 'gd'), ";
-				$sql .= "('".uuid()."', 'German - Austria', 'de-at'), ";
-				$sql .= "('".uuid()."', 'German - Germany', 'de-de'), ";
-				$sql .= "('".uuid()."', 'German - Liechtenstein', 'de-li'), ";
-				$sql .= "('".uuid()."', 'German - Luxembourg', 'de-lu'), ";
-				$sql .= "('".uuid()."', 'German - Switzerland', 'de-ch'), ";
-				$sql .= "('".uuid()."', 'Greek', 'el'), ";
-				$sql .= "('".uuid()."', 'Guarani - Paraguay', 'gn'), ";
-				$sql .= "('".uuid()."', 'Gujarati', 'gu'), ";
-				$sql .= "('".uuid()."', 'Hebrew', 'he'), ";
-				$sql .= "('".uuid()."', 'Hindi', 'hi'), ";
-				$sql .= "('".uuid()."', 'Hungarian', 'hu'), ";
-				$sql .= "('".uuid()."', 'Icelandic', 'is'), ";
-				$sql .= "('".uuid()."', 'Indonesian', 'id'), ";
-				$sql .= "('".uuid()."', 'Italian - Italy', 'it-it'), ";
-				$sql .= "('".uuid()."', 'Italian - Switzerland', 'it-ch'), ";
-				$sql .= "('".uuid()."', 'Japanese', 'ja'), ";
-				$sql .= "('".uuid()."', 'Kannada', 'kn'), ";
-				$sql .= "('".uuid()."', 'Kashmiri', 'ks'), ";
-				$sql .= "('".uuid()."', 'Kazakh', 'kk'), ";
-				$sql .= "('".uuid()."', 'Khmer', 'km'), ";
-				$sql .= "('".uuid()."', 'Korean', 'ko'), ";
-				$sql .= "('".uuid()."', 'Lao', 'lo'), ";
-				$sql .= "('".uuid()."', 'Latin', 'la'), ";
-				$sql .= "('".uuid()."', 'Latvian', 'lv'), ";
-				$sql .= "('".uuid()."', 'Lithuanian', 'lt'), ";
-				$sql .= "('".uuid()."', 'Malayalam', 'ml'), ";
-				$sql .= "('".uuid()."', 'Malay - Brunei', 'ms-bn'), ";
-				$sql .= "('".uuid()."', 'Malay - Malaysia', 'ms-my'), ";
-				$sql .= "('".uuid()."', 'Maltese', 'mt'), ";
-				$sql .= "('".uuid()."', 'Maori', 'mi'), ";
-				$sql .= "('".uuid()."', 'Marathi', 'mr'), ";
-				$sql .= "('".uuid()."', 'Nepali', 'ne'), ";
-				$sql .= "('".uuid()."', 'Norwegian - Bokml, Nynorsk', 'no-no'), ";
-				$sql .= "('".uuid()."', 'Oriya', 'or'), ";
-				$sql .= "('".uuid()."', 'Polish', 'pl'), ";
-				$sql .= "('".uuid()."', 'Portuguese - Brazil', 'pt-br'), ";
-				$sql .= "('".uuid()."', 'Portuguese - Portugal', 'pt-pt'), ";
-				$sql .= "('".uuid()."', 'Punjabi', 'pa'), ";
-				$sql .= "('".uuid()."', 'Raeto-Romance', 'rm'), ";
-				$sql .= "('".uuid()."', 'Romanian - Moldova', 'ro-mo'), ";
-				$sql .= "('".uuid()."', 'Romanian - Romania', 'ro'), ";
-				$sql .= "('".uuid()."', 'Russian', 'ru-ru'), ";
-				$sql .= "('".uuid()."', 'Russian - Moldova', 'ru-mo'), ";
-				$sql .= "('".uuid()."', 'Sanskrit', 'sa'), ";
-				$sql .= "('".uuid()."', 'Serbian - Cyrillic, Latin', 'sr-sp'), ";
-				$sql .= "('".uuid()."', 'Setsuana', 'tn'), ";
-				$sql .= "('".uuid()."', 'Sindhi', 'sd'), ";
-				$sql .= "('".uuid()."', 'Sinhala, Sinhalese', 'si'), ";
-				$sql .= "('".uuid()."', 'Slovak', 'sk'), ";
-				$sql .= "('".uuid()."', 'Slovenian', 'sl'), ";
-				$sql .= "('".uuid()."', 'Somali', 'so'), ";
-				$sql .= "('".uuid()."', 'Sorbian', 'sb'), ";
-				$sql .= "('".uuid()."', 'Spanish - Argentina', 'es-ar'), ";
-				$sql .= "('".uuid()."', 'Spanish - Bolivia', 'es-bo'), ";
-				$sql .= "('".uuid()."', 'Spanish - Chile', 'es-cl'), ";
-				$sql .= "('".uuid()."', 'Spanish - Colombia', 'es-co'), ";
-				$sql .= "('".uuid()."', 'Spanish - Costa Rica', 'es-cr'), ";
-				$sql .= "('".uuid()."', 'Spanish - Dominican Republic', 'es-do'), ";
-				$sql .= "('".uuid()."', 'Spanish - Ecuador', 'es-ec'), ";
-				$sql .= "('".uuid()."', 'Spanish - El Salvador', 'es-sv'), ";
-				$sql .= "('".uuid()."', 'Spanish - Guatemala', 'es-gt'), ";
-				$sql .= "('".uuid()."', 'Spanish - Honduras', 'es-hn'), ";
-				$sql .= "('".uuid()."', 'Spanish - Mexico', 'es-mx'), ";
-				$sql .= "('".uuid()."', 'Spanish - Nicaragua', 'es-ni'), ";
-				$sql .= "('".uuid()."', 'Spanish - Panama', 'es-pa'), ";
-				$sql .= "('".uuid()."', 'Spanish - Paraguay', 'es-py'), ";
-				$sql .= "('".uuid()."', 'Spanish - Peru', 'es-pe'), ";
-				$sql .= "('".uuid()."', 'Spanish - Puerto Rico', 'es-pr'), ";
-				$sql .= "('".uuid()."', 'Spanish - Spain (Traditional)', 'es-es'), ";
-				$sql .= "('".uuid()."', 'Spanish - Uruguay', 'es-uy'), ";
-				$sql .= "('".uuid()."', 'Spanish - Venezuela', 'es-ve'), ";
-				$sql .= "('".uuid()."', 'Swahili', 'sw'), ";
-				$sql .= "('".uuid()."', 'Swedish - Finland', 'sv-fi'), ";
-				$sql .= "('".uuid()."', 'Swedish - Sweden', 'sv-se'), ";
-				$sql .= "('".uuid()."', 'Tajik', 'tg'), ";
-				$sql .= "('".uuid()."', 'Tamil', 'ta'), ";
-				$sql .= "('".uuid()."', 'Tatar', 'tt'), ";
-				$sql .= "('".uuid()."', 'Telugu', 'te'), ";
-				$sql .= "('".uuid()."', 'Thai', 'th'), ";
-				$sql .= "('".uuid()."', 'Tibetan', 'bo'), ";
-				$sql .= "('".uuid()."', 'Tsonga', 'ts'), ";
-				$sql .= "('".uuid()."', 'Turkish', 'tr'), ";
-				$sql .= "('".uuid()."', 'Turkmen', 'tk'), ";
-				$sql .= "('".uuid()."', 'Ukrainian', 'uk'), ";
-				$sql .= "('".uuid()."', 'Urdu', 'ur'), ";
-				$sql .= "('".uuid()."', 'Uzbek - Cyrillic, Latin', 'uz-uz'), ";
-				$sql .= "('".uuid()."', 'Vietnamese', 'vi'), ";
-				$sql .= "('".uuid()."', 'Welsh', 'cy'), ";
-				$sql .= "('".uuid()."', 'Xhosa', 'xh'), ";
-				$sql .= "('".uuid()."', 'Yiddish', 'yi') ";
-				$db->exec(check_sql($sql));
-				unset($sql);
-			}
-			unset($prep_statement, $row);
-		}
-
-	//populate the countries table, if necessary
-		$sql = "select count(*) as num_rows from v_countries";
-		$prep_statement = $db->prepare($sql);
-		if ($prep_statement) {
-			$prep_statement->execute();
-			$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
-			if ($row['num_rows'] == 0) {
-				$sql = "insert into v_countries (country_uuid, country, iso_a2, iso_a3, num, calling_code) values ";
-				$sql .= "('".uuid()."', 'Afghanistan', 'AF', 'AFG', 4, '93'), ";
-				$sql .= "('".uuid()."', 'Albania', 'AL', 'ALB', 8, '355'), ";
-				$sql .= "('".uuid()."', 'Algeria', 'DZ', 'DZA', 12, '213'), ";
-				$sql .= "('".uuid()."', 'American Samoa', 'AS', 'ASM', 16, '1-684'), ";
-				$sql .= "('".uuid()."', 'Andorra', 'AD', 'AND', 20, '376'), ";
-				$sql .= "('".uuid()."', 'Angola', 'AO', 'AGO', 24, '244'), ";
-				$sql .= "('".uuid()."', 'Anguilla', 'AI', 'AIA', 660, '1-264'), ";
-				$sql .= "('".uuid()."', 'Antarctica', 'AQ', 'ATA', 10, '672'), ";
-				$sql .= "('".uuid()."', 'Antigua and Barbuda', 'AG', 'ATG', 28, '1-268'), ";
-				$sql .= "('".uuid()."', 'Argentina', 'AR', 'ARG', 32, '54'), ";
-				$sql .= "('".uuid()."', 'Armenia', 'AM', 'ARM', 51, '374'), ";
-				$sql .= "('".uuid()."', 'Aruba', 'AW', 'ABW', 533, '297'), ";
-				$sql .= "('".uuid()."', 'Australia', 'AU', 'AUS', 36, '61'), ";
-				$sql .= "('".uuid()."', 'Austria', 'AT', 'AUT', 40, '43'), ";
-				$sql .= "('".uuid()."', 'Azerbaijan', 'AZ', 'AZE', 31, '994'), ";
-				$sql .= "('".uuid()."', 'Bahamas', 'BS', 'BHS', 44, '1-242'), ";
-				$sql .= "('".uuid()."', 'Bahrain', 'BH', 'BHR', 48, '973'), ";
-				$sql .= "('".uuid()."', 'Bangladesh', 'BD', 'BGD', 50, '880'), ";
-				$sql .= "('".uuid()."', 'Barbados', 'BB', 'BRB', 52, '1-246'), ";
-				$sql .= "('".uuid()."', 'Belarus', 'BY', 'BLR', 112, '375'), ";
-				$sql .= "('".uuid()."', 'Belgium', 'BE', 'BEL', 56, '32'), ";
-				$sql .= "('".uuid()."', 'Belize', 'BZ', 'BLZ', 84, '501'), ";
-				$sql .= "('".uuid()."', 'Benin', 'BJ', 'BEN', 204, '229'), ";
-				$sql .= "('".uuid()."', 'Bermuda', 'BM', 'BMU', 60, '1-441'), ";
-				$sql .= "('".uuid()."', 'Bhutan', 'BT', 'BTN', 64, '975'), ";
-				$sql .= "('".uuid()."', 'Bolivia', 'BO', 'BOL', 68, '591'), ";
-				$sql .= "('".uuid()."', 'Bonaire', 'BQ', 'BES', 535, '599'), ";
-				$sql .= "('".uuid()."', 'Bosnia and Herzegovina', 'BA', 'BIH', 70, '387'), ";
-				$sql .= "('".uuid()."', 'Botswana', 'BW', 'BWA', 72, '267'), ";
-				$sql .= "('".uuid()."', 'Bouvet Island', 'BV', 'BVT', 74, '47'), ";
-				$sql .= "('".uuid()."', 'Brazil', 'BR', 'BRA', 76, '55'), ";
-				$sql .= "('".uuid()."', 'British Indian Ocean Territory', 'IO', 'IOT', 86, '246'), ";
-				$sql .= "('".uuid()."', 'Brunei Darussalam', 'BN', 'BRN', 96, '673'), ";
-				$sql .= "('".uuid()."', 'Bulgaria', 'BG', 'BGR', 100, '359'), ";
-				$sql .= "('".uuid()."', 'Burkina Faso', 'BF', 'BFA', 854, '226'), ";
-				$sql .= "('".uuid()."', 'Burundi', 'BI', 'BDI', 108, '257'), ";
-				$sql .= "('".uuid()."', 'Cambodia', 'KH', 'KHM', 116, '855'), ";
-				$sql .= "('".uuid()."', 'Cameroon', 'CM', 'CMR', 120, '237'), ";
-				$sql .= "('".uuid()."', 'Canada', 'CA', 'CAN', 124, '1'), ";
-				$sql .= "('".uuid()."', 'Cape Verde', 'CV', 'CPV', 132, '238'), ";
-				$sql .= "('".uuid()."', 'Cayman Islands', 'KY', 'CYM', 136, '1-345'), ";
-				$sql .= "('".uuid()."', 'Central African Republic', 'CF', 'CAF', 140, '236'), ";
-				$sql .= "('".uuid()."', 'Chad', 'TD', 'TCD', 148, '235'), ";
-				$sql .= "('".uuid()."', 'Chile', 'CL', 'CHL', 152, '56'), ";
-				$sql .= "('".uuid()."', 'China', 'CN', 'CHN', 156, '86'), ";
-				$sql .= "('".uuid()."', 'Christmas Island', 'CX', 'CXR', 162, '61'), ";
-				$sql .= "('".uuid()."', 'Cocos (Keeling) Islands', 'CC', 'CCK', 166, '61'), ";
-				$sql .= "('".uuid()."', 'Colombia', 'CO', 'COL', 170, '57'), ";
-				$sql .= "('".uuid()."', 'Comoros', 'KM', 'COM', 174, '269'), ";
-				$sql .= "('".uuid()."', 'Congo', 'CG', 'COG', 178, '242'), ";
-				$sql .= "('".uuid()."', 'Democratic Republic of the Congo', 'CD', 'COD', 180, '243'), ";
-				$sql .= "('".uuid()."', 'Cook Islands', 'CK', 'COK', 184, '682'), ";
-				$sql .= "('".uuid()."', 'Costa Rica', 'CR', 'CRI', 188, '506'), ";
-				$sql .= "('".uuid()."', 'Croatia', 'HR', 'HRV', 191, '385'), ";
-				$sql .= "('".uuid()."', 'Cuba', 'CU', 'CUB', 192, '53'), ";
-				$sql .= "('".uuid()."', 'Curaçao', 'CW', 'CUW', 531, '599'), ";
-				$sql .= "('".uuid()."', 'Cyprus', 'CY', 'CYP', 196, '357'), ";
-				$sql .= "('".uuid()."', 'Czech Republic', 'CZ', 'CZE', 203, '420'), ";
-				$sql .= "('".uuid()."', 'Côte d''Ivoire', 'CI', 'CIV', 384, '225'), ";
-				$sql .= "('".uuid()."', 'Denmark', 'DK', 'DNK', 208, '45'), ";
-				$sql .= "('".uuid()."', 'Djibouti', 'DJ', 'DJI', 262, '253'), ";
-				$sql .= "('".uuid()."', 'Dominica', 'DM', 'DMA', 212, '1-767'), ";
-				$sql .= "('".uuid()."', 'Dominican Republic', 'DO', 'DOM', 214, '1-809,1-829,1-849'), ";
-				$sql .= "('".uuid()."', 'Ecuador', 'EC', 'ECU', 218, '593'), ";
-				$sql .= "('".uuid()."', 'Egypt', 'EG', 'EGY', 818, '20'), ";
-				$sql .= "('".uuid()."', 'El Salvador', 'SV', 'SLV', 222, '503'), ";
-				$sql .= "('".uuid()."', 'Equatorial Guinea', 'GQ', 'GNQ', 226, '240'), ";
-				$sql .= "('".uuid()."', 'Eritrea', 'ER', 'ERI', 232, '291'), ";
-				$sql .= "('".uuid()."', 'Estonia', 'EE', 'EST', 233, '372'), ";
-				$sql .= "('".uuid()."', 'Ethiopia', 'ET', 'ETH', 231, '251'), ";
-				$sql .= "('".uuid()."', 'Falkland Islands (Malvinas)', 'FK', 'FLK', 238, '500'), ";
-				$sql .= "('".uuid()."', 'Faroe Islands', 'FO', 'FRO', 234, '298'), ";
-				$sql .= "('".uuid()."', 'Fiji', 'FJ', 'FJI', 242, '679'), ";
-				$sql .= "('".uuid()."', 'Finland', 'FI', 'FIN', 246, '358'), ";
-				$sql .= "('".uuid()."', 'France', 'FR', 'FRA', 250, '33'), ";
-				$sql .= "('".uuid()."', 'French Guiana', 'GF', 'GUF', 254, '594'), ";
-				$sql .= "('".uuid()."', 'French Polynesia', 'PF', 'PYF', 258, '689'), ";
-				$sql .= "('".uuid()."', 'French Southern Territories', 'TF', 'ATF', 260, '262'), ";
-				$sql .= "('".uuid()."', 'Gabon', 'GA', 'GAB', 266, '241'), ";
-				$sql .= "('".uuid()."', 'Gambia', 'GM', 'GMB', 270, '220'), ";
-				$sql .= "('".uuid()."', 'Georgia', 'GE', 'GEO', 268, '995'), ";
-				$sql .= "('".uuid()."', 'Germany', 'DE', 'DEU', 276, '49'), ";
-				$sql .= "('".uuid()."', 'Ghana', 'GH', 'GHA', 288, '233'), ";
-				$sql .= "('".uuid()."', 'Gibraltar', 'GI', 'GIB', 292, '350'), ";
-				$sql .= "('".uuid()."', 'Greece', 'GR', 'GRC', 300, '30'), ";
-				$sql .= "('".uuid()."', 'Greenland', 'GL', 'GRL', 304, '299'), ";
-				$sql .= "('".uuid()."', 'Grenada', 'GD', 'GRD', 308, '1-473'), ";
-				$sql .= "('".uuid()."', 'Guadeloupe', 'GP', 'GLP', 312, '590'), ";
-				$sql .= "('".uuid()."', 'Guam', 'GU', 'GUM', 316, '1-671'), ";
-				$sql .= "('".uuid()."', 'Guatemala', 'GT', 'GTM', 320, '502'), ";
-				$sql .= "('".uuid()."', 'Guernsey', 'GG', 'GGY', 831, '44'), ";
-				$sql .= "('".uuid()."', 'Guinea', 'GN', 'GIN', 324, '224'), ";
-				$sql .= "('".uuid()."', 'Guinea-Bissau', 'GW', 'GNB', 624, '245'), ";
-				$sql .= "('".uuid()."', 'Guyana', 'GY', 'GUY', 328, '592'), ";
-				$sql .= "('".uuid()."', 'Haiti', 'HT', 'HTI', 332, '509'), ";
-				$sql .= "('".uuid()."', 'Heard Island and McDonald Islands', 'HM', 'HMD', 334, '672'), ";
-				$sql .= "('".uuid()."', 'Holy See (Vatican City State)', 'VA', 'VAT', 336, '379'), ";
-				$sql .= "('".uuid()."', 'Honduras', 'HN', 'HND', 340, '504'), ";
-				$sql .= "('".uuid()."', 'Hong Kong', 'HK', 'HKG', 344, '852'), ";
-				$sql .= "('".uuid()."', 'Hungary', 'HU', 'HUN', 348, '36'), ";
-				$sql .= "('".uuid()."', 'Iceland', 'IS', 'ISL', 352, '354'), ";
-				$sql .= "('".uuid()."', 'India', 'IN', 'IND', 356, '91'), ";
-				$sql .= "('".uuid()."', 'Indonesia', 'ID', 'IDN', 360, '62'), ";
-				$sql .= "('".uuid()."', 'Iran, Islamic Republic of', 'IR', 'IRN', 364, '98'), ";
-				$sql .= "('".uuid()."', 'Iraq', 'IQ', 'IRQ', 368, '964'), ";
-				$sql .= "('".uuid()."', 'Ireland', 'IE', 'IRL', 372, '353'), ";
-				$sql .= "('".uuid()."', 'Isle of Man', 'IM', 'IMN', 833, '44'), ";
-				$sql .= "('".uuid()."', 'Israel', 'IL', 'ISR', 376, '972'), ";
-				$sql .= "('".uuid()."', 'Italy', 'IT', 'ITA', 380, '39'), ";
-				$sql .= "('".uuid()."', 'Jamaica', 'JM', 'JAM', 388, '1-876'), ";
-				$sql .= "('".uuid()."', 'Japan', 'JP', 'JPN', 392, '81'), ";
-				$sql .= "('".uuid()."', 'Jersey', 'JE', 'JEY', 832, '44'), ";
-				$sql .= "('".uuid()."', 'Jordan', 'JO', 'JOR', 400, '962'), ";
-				$sql .= "('".uuid()."', 'Kazakhstan', 'KZ', 'KAZ', 398, '7'), ";
-				$sql .= "('".uuid()."', 'Kenya', 'KE', 'KEN', 404, '254'), ";
-				$sql .= "('".uuid()."', 'Kiribati', 'KI', 'KIR', 296, '686'), ";
-				$sql .= "('".uuid()."', 'Korea, Democratic People''s Republic of', 'KP', 'PRK', 408, '850'), ";
-				$sql .= "('".uuid()."', 'Korea, Republic of', 'KR', 'KOR', 410, '82'), ";
-				$sql .= "('".uuid()."', 'Kuwait', 'KW', 'KWT', 414, '965'), ";
-				$sql .= "('".uuid()."', 'Kyrgyzstan', 'KG', 'KGZ', 417, '996'), ";
-				$sql .= "('".uuid()."', 'Lao People''s Democratic Republic', 'LA', 'LAO', 418, '856'), ";
-				$sql .= "('".uuid()."', 'Latvia', 'LV', 'LVA', 428, '371'), ";
-				$sql .= "('".uuid()."', 'Lebanon', 'LB', 'LBN', 422, '961'), ";
-				$sql .= "('".uuid()."', 'Lesotho', 'LS', 'LSO', 426, '266'), ";
-				$sql .= "('".uuid()."', 'Liberia', 'LR', 'LBR', 430, '231'), ";
-				$sql .= "('".uuid()."', 'Libya', 'LY', 'LBY', 434, '218'), ";
-				$sql .= "('".uuid()."', 'Liechtenstein', 'LI', 'LIE', 438, '423'), ";
-				$sql .= "('".uuid()."', 'Lithuania', 'LT', 'LTU', 440, '370'), ";
-				$sql .= "('".uuid()."', 'Luxembourg', 'LU', 'LUX', 442, '352'), ";
-				$sql .= "('".uuid()."', 'Macao', 'MO', 'MAC', 446, '853'), ";
-				$sql .= "('".uuid()."', 'Macedonia, the Former Yugoslav Republic of', 'MK', 'MKD', 807, '389'), ";
-				$sql .= "('".uuid()."', 'Madagascar', 'MG', 'MDG', 450, '261'), ";
-				$sql .= "('".uuid()."', 'Malawi', 'MW', 'MWI', 454, '265'), ";
-				$sql .= "('".uuid()."', 'Malaysia', 'MY', 'MYS', 458, '60'), ";
-				$sql .= "('".uuid()."', 'Maldives', 'MV', 'MDV', 462, '960'), ";
-				$sql .= "('".uuid()."', 'Mali', 'ML', 'MLI', 466, '223'), ";
-				$sql .= "('".uuid()."', 'Malta', 'MT', 'MLT', 470, '356'), ";
-				$sql .= "('".uuid()."', 'Marshall Islands', 'MH', 'MHL', 584, '692'), ";
-				$sql .= "('".uuid()."', 'Martinique', 'MQ', 'MTQ', 474, '596'), ";
-				$sql .= "('".uuid()."', 'Mauritania', 'MR', 'MRT', 478, '222'), ";
-				$sql .= "('".uuid()."', 'Mauritius', 'MU', 'MUS', 480, '230'), ";
-				$sql .= "('".uuid()."', 'Mayotte', 'YT', 'MYT', 175, '262'), ";
-				$sql .= "('".uuid()."', 'Mexico', 'MX', 'MEX', 484, '52'), ";
-				$sql .= "('".uuid()."', 'Micronesia, Federated States of', 'FM', 'FSM', 583, '691'), ";
-				$sql .= "('".uuid()."', 'Moldova, Republic of', 'MD', 'MDA', 498, '373'), ";
-				$sql .= "('".uuid()."', 'Monaco', 'MC', 'MCO', 492, '377'), ";
-				$sql .= "('".uuid()."', 'Mongolia', 'MN', 'MNG', 496, '976'), ";
-				$sql .= "('".uuid()."', 'Montenegro', 'ME', 'MNE', 499, '382'), ";
-				$sql .= "('".uuid()."', 'Montserrat', 'MS', 'MSR', 500, '1-664'), ";
-				$sql .= "('".uuid()."', 'Morocco', 'MA', 'MAR', 504, '212'), ";
-				$sql .= "('".uuid()."', 'Mozambique', 'MZ', 'MOZ', 508, '258'), ";
-				$sql .= "('".uuid()."', 'Myanmar', 'MM', 'MMR', 104, '95'), ";
-				$sql .= "('".uuid()."', 'Namibia', 'NA', 'NAM', 516, '264'), ";
-				$sql .= "('".uuid()."', 'Nauru', 'NR', 'NRU', 520, '674'), ";
-				$sql .= "('".uuid()."', 'Nepal', 'NP', 'NPL', 524, '977'), ";
-				$sql .= "('".uuid()."', 'Netherlands', 'NL', 'NLD', 528, '31'), ";
-				$sql .= "('".uuid()."', 'New Caledonia', 'NC', 'NCL', 540, '687'), ";
-				$sql .= "('".uuid()."', 'New Zealand', 'NZ', 'NZL', 554, '64'), ";
-				$sql .= "('".uuid()."', 'Nicaragua', 'NI', 'NIC', 558, '505'), ";
-				$sql .= "('".uuid()."', 'Niger', 'NE', 'NER', 562, '227'), ";
-				$sql .= "('".uuid()."', 'Nigeria', 'NG', 'NGA', 566, '234'), ";
-				$sql .= "('".uuid()."', 'Niue', 'NU', 'NIU', 570, '683'), ";
-				$sql .= "('".uuid()."', 'Norfolk Island', 'NF', 'NFK', 574, '672'), ";
-				$sql .= "('".uuid()."', 'Northern Mariana Islands', 'MP', 'MNP', 580, '1-670'), ";
-				$sql .= "('".uuid()."', 'Norway', 'NO', 'NOR', 578, '47'), ";
-				$sql .= "('".uuid()."', 'Oman', 'OM', 'OMN', 512, '968'), ";
-				$sql .= "('".uuid()."', 'Pakistan', 'PK', 'PAK', 586, '92'), ";
-				$sql .= "('".uuid()."', 'Palau', 'PW', 'PLW', 585, '680'), ";
-				$sql .= "('".uuid()."', 'Palestine, State of', 'PS', 'PSE', 275, '970'), ";
-				$sql .= "('".uuid()."', 'Panama', 'PA', 'PAN', 591, '507'), ";
-				$sql .= "('".uuid()."', 'Papua New Guinea', 'PG', 'PNG', 598, '675'), ";
-				$sql .= "('".uuid()."', 'Paraguay', 'PY', 'PRY', 600, '595'), ";
-				$sql .= "('".uuid()."', 'Peru', 'PE', 'PER', 604, '51'), ";
-				$sql .= "('".uuid()."', 'Philippines', 'PH', 'PHL', 608, '63'), ";
-				$sql .= "('".uuid()."', 'Pitcairn', 'PN', 'PCN', 612, '870'), ";
-				$sql .= "('".uuid()."', 'Poland', 'PL', 'POL', 616, '48'), ";
-				$sql .= "('".uuid()."', 'Portugal', 'PT', 'PRT', 620, '351'), ";
-				$sql .= "('".uuid()."', 'Puerto Rico', 'PR', 'PRI', 630, '1'), ";
-				$sql .= "('".uuid()."', 'Qatar', 'QA', 'QAT', 634, '974'), ";
-				$sql .= "('".uuid()."', 'Romania', 'RO', 'ROU', 642, '40'), ";
-				$sql .= "('".uuid()."', 'Russian Federation', 'RU', 'RUS', 643, '7'), ";
-				$sql .= "('".uuid()."', 'Rwanda', 'RW', 'RWA', 646, '250'), ";
-				$sql .= "('".uuid()."', 'Reunion', 'RE', 'REU', 638, '262'), ";
-				$sql .= "('".uuid()."', 'Saint Barthelemy', 'BL', 'BLM', 652, '590'), ";
-				$sql .= "('".uuid()."', 'Saint Helena', 'SH', 'SHN', 654, '290'), ";
-				$sql .= "('".uuid()."', 'Saint Kitts and Nevis', 'KN', 'KNA', 659, '1-869'), ";
-				$sql .= "('".uuid()."', 'Saint Lucia', 'LC', 'LCA', 662, '1-758'), ";
-				$sql .= "('".uuid()."', 'Saint Martin (French part)', 'MF', 'MAF', 663, '590'), ";
-				$sql .= "('".uuid()."', 'Saint Pierre and Miquelon', 'PM', 'SPM', 666, '508'), ";
-				$sql .= "('".uuid()."', 'Saint Vincent and the Grenadines', 'VC', 'VCT', 670, '1-784'), ";
-				$sql .= "('".uuid()."', 'Samoa', 'WS', 'WSM', 882, '685'), ";
-				$sql .= "('".uuid()."', 'San Marino', 'SM', 'SMR', 674, '378'), ";
-				$sql .= "('".uuid()."', 'Sao Tome and Principe', 'ST', 'STP', 678, '239'), ";
-				$sql .= "('".uuid()."', 'Saudi Arabia', 'SA', 'SAU', 682, '966'), ";
-				$sql .= "('".uuid()."', 'Senegal', 'SN', 'SEN', 686, '221'), ";
-				$sql .= "('".uuid()."', 'Serbia', 'RS', 'SRB', 688, '381'), ";
-				$sql .= "('".uuid()."', 'Seychelles', 'SC', 'SYC', 690, '248'), ";
-				$sql .= "('".uuid()."', 'Sierra Leone', 'SL', 'SLE', 694, '232'), ";
-				$sql .= "('".uuid()."', 'Singapore', 'SG', 'SGP', 702, '65'), ";
-				$sql .= "('".uuid()."', 'Sint Maarten (Dutch part)', 'SX', 'SXM', 534, '1-721'), ";
-				$sql .= "('".uuid()."', 'Slovakia', 'SK', 'SVK', 703, '421'), ";
-				$sql .= "('".uuid()."', 'Slovenia', 'SI', 'SVN', 705, '386'), ";
-				$sql .= "('".uuid()."', 'Solomon Islands', 'SB', 'SLB', 90, '677'), ";
-				$sql .= "('".uuid()."', 'Somalia', 'SO', 'SOM', 706, '252'), ";
-				$sql .= "('".uuid()."', 'South Africa', 'ZA', 'ZAF', 710, '27'), ";
-				$sql .= "('".uuid()."', 'South Georgia and the South Sandwich Islands', 'GS', 'SGS', 239, '500'), ";
-				$sql .= "('".uuid()."', 'South Sudan', 'SS', 'SSD', 728, '211'), ";
-				$sql .= "('".uuid()."', 'Spain', 'ES', 'ESP', 724, '34'), ";
-				$sql .= "('".uuid()."', 'Sri Lanka', 'LK', 'LKA', 144, '94'), ";
-				$sql .= "('".uuid()."', 'Sudan', 'SD', 'SDN', 729, '249'), ";
-				$sql .= "('".uuid()."', 'Suriname', 'SR', 'SUR', 740, '597'), ";
-				$sql .= "('".uuid()."', 'Svalbard and Jan Mayen', 'SJ', 'SJM', 744, '47'), ";
-				$sql .= "('".uuid()."', 'Swaziland', 'SZ', 'SWZ', 748, '268'), ";
-				$sql .= "('".uuid()."', 'Sweden', 'SE', 'SWE', 752, '46'), ";
-				$sql .= "('".uuid()."', 'Switzerland', 'CH', 'CHE', 756, '41'), ";
-				$sql .= "('".uuid()."', 'Syrian Arab Republic', 'SY', 'SYR', 760, '963'), ";
-				$sql .= "('".uuid()."', 'Taiwan, Province of China', 'TW', 'TWN', 158, '886'), ";
-				$sql .= "('".uuid()."', 'Tajikistan', 'TJ', 'TJK', 762, '992'), ";
-				$sql .= "('".uuid()."', 'United Republic of Tanzania', 'TZ', 'TZA', 834, '255'), ";
-				$sql .= "('".uuid()."', 'Thailand', 'TH', 'THA', 764, '66'), ";
-				$sql .= "('".uuid()."', 'Timor-Leste', 'TL', 'TLS', 626, '670'), ";
-				$sql .= "('".uuid()."', 'Togo', 'TG', 'TGO', 768, '228'), ";
-				$sql .= "('".uuid()."', 'Tokelau', 'TK', 'TKL', 772, '690'), ";
-				$sql .= "('".uuid()."', 'Tonga', 'TO', 'TON', 776, '676'), ";
-				$sql .= "('".uuid()."', 'Trinidad and Tobago', 'TT', 'TTO', 780, '1-868'), ";
-				$sql .= "('".uuid()."', 'Tunisia', 'TN', 'TUN', 788, '216'), ";
-				$sql .= "('".uuid()."', 'Turkey', 'TR', 'TUR', 792, '90'), ";
-				$sql .= "('".uuid()."', 'Turkmenistan', 'TM', 'TKM', 795, '993'), ";
-				$sql .= "('".uuid()."', 'Turks and Caicos Islands', 'TC', 'TCA', 796, '1-649'), ";
-				$sql .= "('".uuid()."', 'Tuvalu', 'TV', 'TUV', 798, '688'), ";
-				$sql .= "('".uuid()."', 'Uganda', 'UG', 'UGA', 800, '256'), ";
-				$sql .= "('".uuid()."', 'Ukraine', 'UA', 'UKR', 804, '380'), ";
-				$sql .= "('".uuid()."', 'United Arab Emirates', 'AE', 'ARE', 784, '971'), ";
-				$sql .= "('".uuid()."', 'United Kingdom', 'GB', 'GBR', 826, '44'), ";
-				$sql .= "('".uuid()."', 'United States', 'US', 'USA', 840, '1'), ";
-				$sql .= "('".uuid()."', 'United States Minor Outlying Islands', 'UM', 'UMI', 581, '1'), ";
-				$sql .= "('".uuid()."', 'Uruguay', 'UY', 'URY', 858, '598'), ";
-				$sql .= "('".uuid()."', 'Uzbekistan', 'UZ', 'UZB', 860, '998'), ";
-				$sql .= "('".uuid()."', 'Vanuatu', 'VU', 'VUT', 548, '678'), ";
-				$sql .= "('".uuid()."', 'Venezuela', 'VE', 'VEN', 862, '58'), ";
-				$sql .= "('".uuid()."', 'Viet Nam', 'VN', 'VNM', 704, '84'), ";
-				$sql .= "('".uuid()."', 'British Virgin Islands', 'VG', 'VGB', 92, '1-284'), ";
-				$sql .= "('".uuid()."', 'US Virgin Islands', 'VI', 'VIR', 850, '1-340'), ";
-				$sql .= "('".uuid()."', 'Wallis and Futuna', 'WF', 'WLF', 876, '681'), ";
-				$sql .= "('".uuid()."', 'Western Sahara', 'EH', 'ESH', 732, '212'), ";
-				$sql .= "('".uuid()."', 'Yemen', 'YE', 'YEM', 887, '967'), ";
-				$sql .= "('".uuid()."', 'Zambia', 'ZM', 'ZMB', 894, '260'), ";
-				$sql .= "('".uuid()."', 'Zimbabwe', 'ZW', 'ZWE', 716, '263'), ";
-				$sql .= "('".uuid()."', 'Aland Islands', 'AX', 'ALA', 248, '358') ";
-				$db->exec(check_sql($sql));
-				unset($sql);
-			}
-			unset($prep_statement, $row);
-		}
-
-}
-
-?>
+<?php
+/*
+	FusionPBX
+	Version: MPL 1.1
+
+	The contents of this file are subject to the Mozilla Public License Version
+	1.1 (the "License"); you may not use this file except in compliance with
+	the License. You may obtain a copy of the License at
+	http://www.mozilla.org/MPL/
+
+	Software distributed under the License is distributed on an "AS IS" basis,
+	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+	for the specific language governing rights and limitations under the
+	License.
+
+	The Original Code is FusionPBX
+
+	The Initial Developer of the Original Code is
+	Mark J Crane <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2008-2017
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
+
+//process this only one time
+	if ($domains_processed == 1) {
+	
+		//set domains with enabled status of empty or null to true
+			$sql = "delete from v_default_settings ";
+			$sql .= "where (default_setting_category is null and default_setting_subcategory is null) ";
+			$sql .= "or (default_setting_category = '' and default_setting_subcategory = '') ";
+			$db->exec(check_sql($sql));
+			unset($sql);
+
+		//move the dynamic provision variables that from v_vars table to v_default_settings
+			/* if (count($_SESSION['provision']) == 0) {
+				$sql = "select * from v_vars ";
+				$sql .= "where var_cat = 'Provision' ";
+				$prep_statement = $db->prepare(check_sql($sql));
+				$prep_statement->execute();
+				$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+				foreach ($result as &$row) {
+					//set the variable
+						$var_name = check_str($row['var_name']);
+					//remove the 'v_' prefix from the variable name
+						if (substr($var_name, 0, 2) == "v_") {
+							$var_name = substr($var_name, 2);
+						}
+					//add the provision variable to the default settings table
+						$sql = "insert into v_default_settings ";
+						$sql .= "(";
+						$sql .= "default_setting_uuid, ";
+						$sql .= "default_setting_category, ";
+						$sql .= "default_setting_subcategory, ";
+						$sql .= "default_setting_name, ";
+						$sql .= "default_setting_value, ";
+						$sql .= "default_setting_enabled, ";
+						$sql .= "default_setting_description ";
+						$sql .= ") ";
+						$sql .= "values ";
+						$sql .= "(";
+						$sql .= "'".uuid()."', ";
+						$sql .= "'provision', ";
+						$sql .= "'".$var_name."', ";
+						$sql .= "'var', ";
+						$sql .= "'".check_str($row['var_value'])."', ";
+						$sql .= "'".check_str($row['var_enabled'])."', ";
+						$sql .= "'".check_str($row['var_description'])."' ";
+						$sql .= ")";
+						$db->exec(check_sql($sql));
+						unset($sql);
+				}
+				unset($prep_statement);
+				//delete the provision variables from system -> variables
+				//$sql = "delete from v_vars ";
+				//$sql .= "where var_cat = 'Provision' ";
+				//echo $sql ."\n";
+				//$db->exec(check_sql($sql));
+				//echo "$var_name $var_value \n";
+			}
+			*/
+
+		//populate the languages table, if necessary
+			$sql = "select count(*) as num_rows from v_languages";
+			$prep_statement = $db->prepare($sql);
+			if ($prep_statement) {
+				$prep_statement->execute();
+				$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
+				if ($row['num_rows'] == 0) {
+					$sql = "insert into v_languages (language_uuid, language, code) values ";
+					$sql .= "('".uuid()."', 'Afrikaans', 'af'), ";
+					$sql .= "('".uuid()."', 'Albanian', 'sq'), ";
+					$sql .= "('".uuid()."', 'Amharic', 'am'), ";
+					$sql .= "('".uuid()."', 'Arabic - Algeria', 'ar-dz'), ";
+					$sql .= "('".uuid()."', 'Arabic - Bahrain', 'ar-bh'), ";
+					$sql .= "('".uuid()."', 'Arabic - Egypt', 'ar-eg'), ";
+					$sql .= "('".uuid()."', 'Arabic - Iraq', 'ar-iq'), ";
+					$sql .= "('".uuid()."', 'Arabic - Jordan', 'ar-jo'), ";
+					$sql .= "('".uuid()."', 'Arabic - Kuwait', 'ar-kw'), ";
+					$sql .= "('".uuid()."', 'Arabic - Lebanon', 'ar-lb'), ";
+					$sql .= "('".uuid()."', 'Arabic - Libya', 'ar-ly'), ";
+					$sql .= "('".uuid()."', 'Arabic - Morocco', 'ar-ma'), ";
+					$sql .= "('".uuid()."', 'Arabic - Oman', 'ar-om'), ";
+					$sql .= "('".uuid()."', 'Arabic - Qatar', 'ar-qa'), ";
+					$sql .= "('".uuid()."', 'Arabic - Saudi Arabia', 'ar-sa'), ";
+					$sql .= "('".uuid()."', 'Arabic - Syria', 'ar-sy'), ";
+					$sql .= "('".uuid()."', 'Arabic - Tunisia', 'ar-tn'), ";
+					$sql .= "('".uuid()."', 'Arabic - United Arab Emirates', 'ar-ae'), ";
+					$sql .= "('".uuid()."', 'Arabic - Yemen', 'ar-ye'), ";
+					$sql .= "('".uuid()."', 'Armenian', 'hy'), ";
+					$sql .= "('".uuid()."', 'Assamese', 'as'), ";
+					$sql .= "('".uuid()."', 'Azeri - Cyrillic, Latin', 'az-az'), ";
+					$sql .= "('".uuid()."', 'Basque', 'eu'), ";
+					$sql .= "('".uuid()."', 'Belarusian', 'be'), ";
+					$sql .= "('".uuid()."', 'Bengali - India, Bangladesh', 'bn'), ";
+					$sql .= "('".uuid()."', 'Bosnian', 'bs'), ";
+					$sql .= "('".uuid()."', 'Bulgarian', 'bg'), ";
+					$sql .= "('".uuid()."', 'Burmese', 'my'), ";
+					$sql .= "('".uuid()."', 'Catalan', 'ca'), ";
+					$sql .= "('".uuid()."', 'Chinese - China', 'zh-cn'), ";
+					$sql .= "('".uuid()."', 'Chinese - Hong Kong SAR', 'zh-hk'), ";
+					$sql .= "('".uuid()."', 'Chinese - Macau SAR', 'zh-mo'), ";
+					$sql .= "('".uuid()."', 'Chinese - Singapore', 'zh-sg'), ";
+					$sql .= "('".uuid()."', 'Chinese - Taiwan', 'zh-tw'), ";
+					$sql .= "('".uuid()."', 'Croatian', 'hr'), ";
+					$sql .= "('".uuid()."', 'Czech', 'cs'), ";
+					$sql .= "('".uuid()."', 'Danish', 'da'), ";
+					$sql .= "('".uuid()."', 'Divehi, Dhivehi, Maldivian', 'dv'), ";
+					$sql .= "('".uuid()."', 'Dutch - Belgium', 'nl-be'), ";
+					$sql .= "('".uuid()."', 'Dutch - Netherlands', 'nl-nl'), ";
+					$sql .= "('".uuid()."', 'English - Australia', 'en-au'), ";
+					$sql .= "('".uuid()."', 'English - Belize', 'en-bz'), ";
+					$sql .= "('".uuid()."', 'English - Canada', 'en-ca'), ";
+					$sql .= "('".uuid()."', 'English - Caribbean', 'en-cb'), ";
+					$sql .= "('".uuid()."', 'English - Great Britain', 'en-gb'), ";
+					$sql .= "('".uuid()."', 'English - India', 'en-in'), ";
+					$sql .= "('".uuid()."', 'English - Ireland', 'en-ie'), ";
+					$sql .= "('".uuid()."', 'English - Jamaica', 'en-jm'), ";
+					$sql .= "('".uuid()."', 'English - New Zealand', 'en-nz'), ";
+					$sql .= "('".uuid()."', 'English - Phillippines', 'en-ph'), ";
+					$sql .= "('".uuid()."', 'English - Southern Africa', 'en-za'), ";
+					$sql .= "('".uuid()."', 'English - Trinidad', 'en-tt'), ";
+					$sql .= "('".uuid()."', 'English - United States', 'en-us'), ";
+					$sql .= "('".uuid()."', 'Estonian', 'et'), ";
+					$sql .= "('".uuid()."', 'Faroese', 'fo'), ";
+					$sql .= "('".uuid()."', 'Farsi - Persian', 'fa'), ";
+					$sql .= "('".uuid()."', 'Finnish', 'fi'), ";
+					$sql .= "('".uuid()."', 'French - Belgium', 'fr-be'), ";
+					$sql .= "('".uuid()."', 'French - Canada', 'fr-ca'), ";
+					$sql .= "('".uuid()."', 'French - France', 'fr-fr'), ";
+					$sql .= "('".uuid()."', 'French - Luxembourg', 'fr-lu'), ";
+					$sql .= "('".uuid()."', 'French - Switzerland', 'fr-ch'), ";
+					$sql .= "('".uuid()."', 'FYRO Macedonia', 'mk'), ";
+					$sql .= "('".uuid()."', 'Gaelic - Ireland', 'gd-ie'), ";
+					$sql .= "('".uuid()."', 'Gaelic - Scotland', 'gd'), ";
+					$sql .= "('".uuid()."', 'German - Austria', 'de-at'), ";
+					$sql .= "('".uuid()."', 'German - Germany', 'de-de'), ";
+					$sql .= "('".uuid()."', 'German - Liechtenstein', 'de-li'), ";
+					$sql .= "('".uuid()."', 'German - Luxembourg', 'de-lu'), ";
+					$sql .= "('".uuid()."', 'German - Switzerland', 'de-ch'), ";
+					$sql .= "('".uuid()."', 'Greek', 'el'), ";
+					$sql .= "('".uuid()."', 'Guarani - Paraguay', 'gn'), ";
+					$sql .= "('".uuid()."', 'Gujarati', 'gu'), ";
+					$sql .= "('".uuid()."', 'Hebrew', 'he'), ";
+					$sql .= "('".uuid()."', 'Hindi', 'hi'), ";
+					$sql .= "('".uuid()."', 'Hungarian', 'hu'), ";
+					$sql .= "('".uuid()."', 'Icelandic', 'is'), ";
+					$sql .= "('".uuid()."', 'Indonesian', 'id'), ";
+					$sql .= "('".uuid()."', 'Italian - Italy', 'it-it'), ";
+					$sql .= "('".uuid()."', 'Italian - Switzerland', 'it-ch'), ";
+					$sql .= "('".uuid()."', 'Japanese', 'ja'), ";
+					$sql .= "('".uuid()."', 'Kannada', 'kn'), ";
+					$sql .= "('".uuid()."', 'Kashmiri', 'ks'), ";
+					$sql .= "('".uuid()."', 'Kazakh', 'kk'), ";
+					$sql .= "('".uuid()."', 'Khmer', 'km'), ";
+					$sql .= "('".uuid()."', 'Korean', 'ko'), ";
+					$sql .= "('".uuid()."', 'Lao', 'lo'), ";
+					$sql .= "('".uuid()."', 'Latin', 'la'), ";
+					$sql .= "('".uuid()."', 'Latvian', 'lv'), ";
+					$sql .= "('".uuid()."', 'Lithuanian', 'lt'), ";
+					$sql .= "('".uuid()."', 'Malayalam', 'ml'), ";
+					$sql .= "('".uuid()."', 'Malay - Brunei', 'ms-bn'), ";
+					$sql .= "('".uuid()."', 'Malay - Malaysia', 'ms-my'), ";
+					$sql .= "('".uuid()."', 'Maltese', 'mt'), ";
+					$sql .= "('".uuid()."', 'Maori', 'mi'), ";
+					$sql .= "('".uuid()."', 'Marathi', 'mr'), ";
+					$sql .= "('".uuid()."', 'Nepali', 'ne'), ";
+					$sql .= "('".uuid()."', 'Norwegian - Bokml, Nynorsk', 'no-no'), ";
+					$sql .= "('".uuid()."', 'Oriya', 'or'), ";
+					$sql .= "('".uuid()."', 'Polish', 'pl'), ";
+					$sql .= "('".uuid()."', 'Portuguese - Brazil', 'pt-br'), ";
+					$sql .= "('".uuid()."', 'Portuguese - Portugal', 'pt-pt'), ";
+					$sql .= "('".uuid()."', 'Punjabi', 'pa'), ";
+					$sql .= "('".uuid()."', 'Raeto-Romance', 'rm'), ";
+					$sql .= "('".uuid()."', 'Romanian - Moldova', 'ro-mo'), ";
+					$sql .= "('".uuid()."', 'Romanian - Romania', 'ro'), ";
+					$sql .= "('".uuid()."', 'Russian', 'ru-ru'), ";
+					$sql .= "('".uuid()."', 'Russian - Moldova', 'ru-mo'), ";
+					$sql .= "('".uuid()."', 'Sanskrit', 'sa'), ";
+					$sql .= "('".uuid()."', 'Serbian - Cyrillic, Latin', 'sr-sp'), ";
+					$sql .= "('".uuid()."', 'Setsuana', 'tn'), ";
+					$sql .= "('".uuid()."', 'Sindhi', 'sd'), ";
+					$sql .= "('".uuid()."', 'Sinhala, Sinhalese', 'si'), ";
+					$sql .= "('".uuid()."', 'Slovak', 'sk'), ";
+					$sql .= "('".uuid()."', 'Slovenian', 'sl'), ";
+					$sql .= "('".uuid()."', 'Somali', 'so'), ";
+					$sql .= "('".uuid()."', 'Sorbian', 'sb'), ";
+					$sql .= "('".uuid()."', 'Spanish - Argentina', 'es-ar'), ";
+					$sql .= "('".uuid()."', 'Spanish - Bolivia', 'es-bo'), ";
+					$sql .= "('".uuid()."', 'Spanish - Chile', 'es-cl'), ";
+					$sql .= "('".uuid()."', 'Spanish - Colombia', 'es-co'), ";
+					$sql .= "('".uuid()."', 'Spanish - Costa Rica', 'es-cr'), ";
+					$sql .= "('".uuid()."', 'Spanish - Dominican Republic', 'es-do'), ";
+					$sql .= "('".uuid()."', 'Spanish - Ecuador', 'es-ec'), ";
+					$sql .= "('".uuid()."', 'Spanish - El Salvador', 'es-sv'), ";
+					$sql .= "('".uuid()."', 'Spanish - Guatemala', 'es-gt'), ";
+					$sql .= "('".uuid()."', 'Spanish - Honduras', 'es-hn'), ";
+					$sql .= "('".uuid()."', 'Spanish - Mexico', 'es-mx'), ";
+					$sql .= "('".uuid()."', 'Spanish - Nicaragua', 'es-ni'), ";
+					$sql .= "('".uuid()."', 'Spanish - Panama', 'es-pa'), ";
+					$sql .= "('".uuid()."', 'Spanish - Paraguay', 'es-py'), ";
+					$sql .= "('".uuid()."', 'Spanish - Peru', 'es-pe'), ";
+					$sql .= "('".uuid()."', 'Spanish - Puerto Rico', 'es-pr'), ";
+					$sql .= "('".uuid()."', 'Spanish - Spain (Traditional)', 'es-es'), ";
+					$sql .= "('".uuid()."', 'Spanish - Uruguay', 'es-uy'), ";
+					$sql .= "('".uuid()."', 'Spanish - Venezuela', 'es-ve'), ";
+					$sql .= "('".uuid()."', 'Swahili', 'sw'), ";
+					$sql .= "('".uuid()."', 'Swedish - Finland', 'sv-fi'), ";
+					$sql .= "('".uuid()."', 'Swedish - Sweden', 'sv-se'), ";
+					$sql .= "('".uuid()."', 'Tajik', 'tg'), ";
+					$sql .= "('".uuid()."', 'Tamil', 'ta'), ";
+					$sql .= "('".uuid()."', 'Tatar', 'tt'), ";
+					$sql .= "('".uuid()."', 'Telugu', 'te'), ";
+					$sql .= "('".uuid()."', 'Thai', 'th'), ";
+					$sql .= "('".uuid()."', 'Tibetan', 'bo'), ";
+					$sql .= "('".uuid()."', 'Tsonga', 'ts'), ";
+					$sql .= "('".uuid()."', 'Turkish', 'tr'), ";
+					$sql .= "('".uuid()."', 'Turkmen', 'tk'), ";
+					$sql .= "('".uuid()."', 'Ukrainian', 'uk'), ";
+					$sql .= "('".uuid()."', 'Urdu', 'ur'), ";
+					$sql .= "('".uuid()."', 'Uzbek - Cyrillic, Latin', 'uz-uz'), ";
+					$sql .= "('".uuid()."', 'Vietnamese', 'vi'), ";
+					$sql .= "('".uuid()."', 'Welsh', 'cy'), ";
+					$sql .= "('".uuid()."', 'Xhosa', 'xh'), ";
+					$sql .= "('".uuid()."', 'Yiddish', 'yi') ";
+					$db->exec(check_sql($sql));
+					unset($sql);
+				}
+				unset($prep_statement, $row);
+			}
+
+		//populate the countries table, if necessary
+			$sql = "select count(*) as num_rows from v_countries";
+			$prep_statement = $db->prepare($sql);
+			if ($prep_statement) {
+				$prep_statement->execute();
+				$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
+				if ($row['num_rows'] == 0) {
+					$sql = "insert into v_countries (country_uuid, country, iso_a2, iso_a3, num, calling_code) values ";
+					$sql .= "('".uuid()."', 'Afghanistan', 'AF', 'AFG', 4, '93'), ";
+					$sql .= "('".uuid()."', 'Albania', 'AL', 'ALB', 8, '355'), ";
+					$sql .= "('".uuid()."', 'Algeria', 'DZ', 'DZA', 12, '213'), ";
+					$sql .= "('".uuid()."', 'American Samoa', 'AS', 'ASM', 16, '1-684'), ";
+					$sql .= "('".uuid()."', 'Andorra', 'AD', 'AND', 20, '376'), ";
+					$sql .= "('".uuid()."', 'Angola', 'AO', 'AGO', 24, '244'), ";
+					$sql .= "('".uuid()."', 'Anguilla', 'AI', 'AIA', 660, '1-264'), ";
+					$sql .= "('".uuid()."', 'Antarctica', 'AQ', 'ATA', 10, '672'), ";
+					$sql .= "('".uuid()."', 'Antigua and Barbuda', 'AG', 'ATG', 28, '1-268'), ";
+					$sql .= "('".uuid()."', 'Argentina', 'AR', 'ARG', 32, '54'), ";
+					$sql .= "('".uuid()."', 'Armenia', 'AM', 'ARM', 51, '374'), ";
+					$sql .= "('".uuid()."', 'Aruba', 'AW', 'ABW', 533, '297'), ";
+					$sql .= "('".uuid()."', 'Australia', 'AU', 'AUS', 36, '61'), ";
+					$sql .= "('".uuid()."', 'Austria', 'AT', 'AUT', 40, '43'), ";
+					$sql .= "('".uuid()."', 'Azerbaijan', 'AZ', 'AZE', 31, '994'), ";
+					$sql .= "('".uuid()."', 'Bahamas', 'BS', 'BHS', 44, '1-242'), ";
+					$sql .= "('".uuid()."', 'Bahrain', 'BH', 'BHR', 48, '973'), ";
+					$sql .= "('".uuid()."', 'Bangladesh', 'BD', 'BGD', 50, '880'), ";
+					$sql .= "('".uuid()."', 'Barbados', 'BB', 'BRB', 52, '1-246'), ";
+					$sql .= "('".uuid()."', 'Belarus', 'BY', 'BLR', 112, '375'), ";
+					$sql .= "('".uuid()."', 'Belgium', 'BE', 'BEL', 56, '32'), ";
+					$sql .= "('".uuid()."', 'Belize', 'BZ', 'BLZ', 84, '501'), ";
+					$sql .= "('".uuid()."', 'Benin', 'BJ', 'BEN', 204, '229'), ";
+					$sql .= "('".uuid()."', 'Bermuda', 'BM', 'BMU', 60, '1-441'), ";
+					$sql .= "('".uuid()."', 'Bhutan', 'BT', 'BTN', 64, '975'), ";
+					$sql .= "('".uuid()."', 'Bolivia', 'BO', 'BOL', 68, '591'), ";
+					$sql .= "('".uuid()."', 'Bonaire', 'BQ', 'BES', 535, '599'), ";
+					$sql .= "('".uuid()."', 'Bosnia and Herzegovina', 'BA', 'BIH', 70, '387'), ";
+					$sql .= "('".uuid()."', 'Botswana', 'BW', 'BWA', 72, '267'), ";
+					$sql .= "('".uuid()."', 'Bouvet Island', 'BV', 'BVT', 74, '47'), ";
+					$sql .= "('".uuid()."', 'Brazil', 'BR', 'BRA', 76, '55'), ";
+					$sql .= "('".uuid()."', 'British Indian Ocean Territory', 'IO', 'IOT', 86, '246'), ";
+					$sql .= "('".uuid()."', 'Brunei Darussalam', 'BN', 'BRN', 96, '673'), ";
+					$sql .= "('".uuid()."', 'Bulgaria', 'BG', 'BGR', 100, '359'), ";
+					$sql .= "('".uuid()."', 'Burkina Faso', 'BF', 'BFA', 854, '226'), ";
+					$sql .= "('".uuid()."', 'Burundi', 'BI', 'BDI', 108, '257'), ";
+					$sql .= "('".uuid()."', 'Cambodia', 'KH', 'KHM', 116, '855'), ";
+					$sql .= "('".uuid()."', 'Cameroon', 'CM', 'CMR', 120, '237'), ";
+					$sql .= "('".uuid()."', 'Canada', 'CA', 'CAN', 124, '1'), ";
+					$sql .= "('".uuid()."', 'Cape Verde', 'CV', 'CPV', 132, '238'), ";
+					$sql .= "('".uuid()."', 'Cayman Islands', 'KY', 'CYM', 136, '1-345'), ";
+					$sql .= "('".uuid()."', 'Central African Republic', 'CF', 'CAF', 140, '236'), ";
+					$sql .= "('".uuid()."', 'Chad', 'TD', 'TCD', 148, '235'), ";
+					$sql .= "('".uuid()."', 'Chile', 'CL', 'CHL', 152, '56'), ";
+					$sql .= "('".uuid()."', 'China', 'CN', 'CHN', 156, '86'), ";
+					$sql .= "('".uuid()."', 'Christmas Island', 'CX', 'CXR', 162, '61'), ";
+					$sql .= "('".uuid()."', 'Cocos (Keeling) Islands', 'CC', 'CCK', 166, '61'), ";
+					$sql .= "('".uuid()."', 'Colombia', 'CO', 'COL', 170, '57'), ";
+					$sql .= "('".uuid()."', 'Comoros', 'KM', 'COM', 174, '269'), ";
+					$sql .= "('".uuid()."', 'Congo', 'CG', 'COG', 178, '242'), ";
+					$sql .= "('".uuid()."', 'Democratic Republic of the Congo', 'CD', 'COD', 180, '243'), ";
+					$sql .= "('".uuid()."', 'Cook Islands', 'CK', 'COK', 184, '682'), ";
+					$sql .= "('".uuid()."', 'Costa Rica', 'CR', 'CRI', 188, '506'), ";
+					$sql .= "('".uuid()."', 'Croatia', 'HR', 'HRV', 191, '385'), ";
+					$sql .= "('".uuid()."', 'Cuba', 'CU', 'CUB', 192, '53'), ";
+					$sql .= "('".uuid()."', 'Curaçao', 'CW', 'CUW', 531, '599'), ";
+					$sql .= "('".uuid()."', 'Cyprus', 'CY', 'CYP', 196, '357'), ";
+					$sql .= "('".uuid()."', 'Czech Republic', 'CZ', 'CZE', 203, '420'), ";
+					$sql .= "('".uuid()."', 'Côte d''Ivoire', 'CI', 'CIV', 384, '225'), ";
+					$sql .= "('".uuid()."', 'Denmark', 'DK', 'DNK', 208, '45'), ";
+					$sql .= "('".uuid()."', 'Djibouti', 'DJ', 'DJI', 262, '253'), ";
+					$sql .= "('".uuid()."', 'Dominica', 'DM', 'DMA', 212, '1-767'), ";
+					$sql .= "('".uuid()."', 'Dominican Republic', 'DO', 'DOM', 214, '1-809,1-829,1-849'), ";
+					$sql .= "('".uuid()."', 'Ecuador', 'EC', 'ECU', 218, '593'), ";
+					$sql .= "('".uuid()."', 'Egypt', 'EG', 'EGY', 818, '20'), ";
+					$sql .= "('".uuid()."', 'El Salvador', 'SV', 'SLV', 222, '503'), ";
+					$sql .= "('".uuid()."', 'Equatorial Guinea', 'GQ', 'GNQ', 226, '240'), ";
+					$sql .= "('".uuid()."', 'Eritrea', 'ER', 'ERI', 232, '291'), ";
+					$sql .= "('".uuid()."', 'Estonia', 'EE', 'EST', 233, '372'), ";
+					$sql .= "('".uuid()."', 'Ethiopia', 'ET', 'ETH', 231, '251'), ";
+					$sql .= "('".uuid()."', 'Falkland Islands (Malvinas)', 'FK', 'FLK', 238, '500'), ";
+					$sql .= "('".uuid()."', 'Faroe Islands', 'FO', 'FRO', 234, '298'), ";
+					$sql .= "('".uuid()."', 'Fiji', 'FJ', 'FJI', 242, '679'), ";
+					$sql .= "('".uuid()."', 'Finland', 'FI', 'FIN', 246, '358'), ";
+					$sql .= "('".uuid()."', 'France', 'FR', 'FRA', 250, '33'), ";
+					$sql .= "('".uuid()."', 'French Guiana', 'GF', 'GUF', 254, '594'), ";
+					$sql .= "('".uuid()."', 'French Polynesia', 'PF', 'PYF', 258, '689'), ";
+					$sql .= "('".uuid()."', 'French Southern Territories', 'TF', 'ATF', 260, '262'), ";
+					$sql .= "('".uuid()."', 'Gabon', 'GA', 'GAB', 266, '241'), ";
+					$sql .= "('".uuid()."', 'Gambia', 'GM', 'GMB', 270, '220'), ";
+					$sql .= "('".uuid()."', 'Georgia', 'GE', 'GEO', 268, '995'), ";
+					$sql .= "('".uuid()."', 'Germany', 'DE', 'DEU', 276, '49'), ";
+					$sql .= "('".uuid()."', 'Ghana', 'GH', 'GHA', 288, '233'), ";
+					$sql .= "('".uuid()."', 'Gibraltar', 'GI', 'GIB', 292, '350'), ";
+					$sql .= "('".uuid()."', 'Greece', 'GR', 'GRC', 300, '30'), ";
+					$sql .= "('".uuid()."', 'Greenland', 'GL', 'GRL', 304, '299'), ";
+					$sql .= "('".uuid()."', 'Grenada', 'GD', 'GRD', 308, '1-473'), ";
+					$sql .= "('".uuid()."', 'Guadeloupe', 'GP', 'GLP', 312, '590'), ";
+					$sql .= "('".uuid()."', 'Guam', 'GU', 'GUM', 316, '1-671'), ";
+					$sql .= "('".uuid()."', 'Guatemala', 'GT', 'GTM', 320, '502'), ";
+					$sql .= "('".uuid()."', 'Guernsey', 'GG', 'GGY', 831, '44'), ";
+					$sql .= "('".uuid()."', 'Guinea', 'GN', 'GIN', 324, '224'), ";
+					$sql .= "('".uuid()."', 'Guinea-Bissau', 'GW', 'GNB', 624, '245'), ";
+					$sql .= "('".uuid()."', 'Guyana', 'GY', 'GUY', 328, '592'), ";
+					$sql .= "('".uuid()."', 'Haiti', 'HT', 'HTI', 332, '509'), ";
+					$sql .= "('".uuid()."', 'Heard Island and McDonald Islands', 'HM', 'HMD', 334, '672'), ";
+					$sql .= "('".uuid()."', 'Holy See (Vatican City State)', 'VA', 'VAT', 336, '379'), ";
+					$sql .= "('".uuid()."', 'Honduras', 'HN', 'HND', 340, '504'), ";
+					$sql .= "('".uuid()."', 'Hong Kong', 'HK', 'HKG', 344, '852'), ";
+					$sql .= "('".uuid()."', 'Hungary', 'HU', 'HUN', 348, '36'), ";
+					$sql .= "('".uuid()."', 'Iceland', 'IS', 'ISL', 352, '354'), ";
+					$sql .= "('".uuid()."', 'India', 'IN', 'IND', 356, '91'), ";
+					$sql .= "('".uuid()."', 'Indonesia', 'ID', 'IDN', 360, '62'), ";
+					$sql .= "('".uuid()."', 'Iran, Islamic Republic of', 'IR', 'IRN', 364, '98'), ";
+					$sql .= "('".uuid()."', 'Iraq', 'IQ', 'IRQ', 368, '964'), ";
+					$sql .= "('".uuid()."', 'Ireland', 'IE', 'IRL', 372, '353'), ";
+					$sql .= "('".uuid()."', 'Isle of Man', 'IM', 'IMN', 833, '44'), ";
+					$sql .= "('".uuid()."', 'Israel', 'IL', 'ISR', 376, '972'), ";
+					$sql .= "('".uuid()."', 'Italy', 'IT', 'ITA', 380, '39'), ";
+					$sql .= "('".uuid()."', 'Jamaica', 'JM', 'JAM', 388, '1-876'), ";
+					$sql .= "('".uuid()."', 'Japan', 'JP', 'JPN', 392, '81'), ";
+					$sql .= "('".uuid()."', 'Jersey', 'JE', 'JEY', 832, '44'), ";
+					$sql .= "('".uuid()."', 'Jordan', 'JO', 'JOR', 400, '962'), ";
+					$sql .= "('".uuid()."', 'Kazakhstan', 'KZ', 'KAZ', 398, '7'), ";
+					$sql .= "('".uuid()."', 'Kenya', 'KE', 'KEN', 404, '254'), ";
+					$sql .= "('".uuid()."', 'Kiribati', 'KI', 'KIR', 296, '686'), ";
+					$sql .= "('".uuid()."', 'Korea, Democratic People''s Republic of', 'KP', 'PRK', 408, '850'), ";
+					$sql .= "('".uuid()."', 'Korea, Republic of', 'KR', 'KOR', 410, '82'), ";
+					$sql .= "('".uuid()."', 'Kuwait', 'KW', 'KWT', 414, '965'), ";
+					$sql .= "('".uuid()."', 'Kyrgyzstan', 'KG', 'KGZ', 417, '996'), ";
+					$sql .= "('".uuid()."', 'Lao People''s Democratic Republic', 'LA', 'LAO', 418, '856'), ";
+					$sql .= "('".uuid()."', 'Latvia', 'LV', 'LVA', 428, '371'), ";
+					$sql .= "('".uuid()."', 'Lebanon', 'LB', 'LBN', 422, '961'), ";
+					$sql .= "('".uuid()."', 'Lesotho', 'LS', 'LSO', 426, '266'), ";
+					$sql .= "('".uuid()."', 'Liberia', 'LR', 'LBR', 430, '231'), ";
+					$sql .= "('".uuid()."', 'Libya', 'LY', 'LBY', 434, '218'), ";
+					$sql .= "('".uuid()."', 'Liechtenstein', 'LI', 'LIE', 438, '423'), ";
+					$sql .= "('".uuid()."', 'Lithuania', 'LT', 'LTU', 440, '370'), ";
+					$sql .= "('".uuid()."', 'Luxembourg', 'LU', 'LUX', 442, '352'), ";
+					$sql .= "('".uuid()."', 'Macao', 'MO', 'MAC', 446, '853'), ";
+					$sql .= "('".uuid()."', 'Macedonia, the Former Yugoslav Republic of', 'MK', 'MKD', 807, '389'), ";
+					$sql .= "('".uuid()."', 'Madagascar', 'MG', 'MDG', 450, '261'), ";
+					$sql .= "('".uuid()."', 'Malawi', 'MW', 'MWI', 454, '265'), ";
+					$sql .= "('".uuid()."', 'Malaysia', 'MY', 'MYS', 458, '60'), ";
+					$sql .= "('".uuid()."', 'Maldives', 'MV', 'MDV', 462, '960'), ";
+					$sql .= "('".uuid()."', 'Mali', 'ML', 'MLI', 466, '223'), ";
+					$sql .= "('".uuid()."', 'Malta', 'MT', 'MLT', 470, '356'), ";
+					$sql .= "('".uuid()."', 'Marshall Islands', 'MH', 'MHL', 584, '692'), ";
+					$sql .= "('".uuid()."', 'Martinique', 'MQ', 'MTQ', 474, '596'), ";
+					$sql .= "('".uuid()."', 'Mauritania', 'MR', 'MRT', 478, '222'), ";
+					$sql .= "('".uuid()."', 'Mauritius', 'MU', 'MUS', 480, '230'), ";
+					$sql .= "('".uuid()."', 'Mayotte', 'YT', 'MYT', 175, '262'), ";
+					$sql .= "('".uuid()."', 'Mexico', 'MX', 'MEX', 484, '52'), ";
+					$sql .= "('".uuid()."', 'Micronesia, Federated States of', 'FM', 'FSM', 583, '691'), ";
+					$sql .= "('".uuid()."', 'Moldova, Republic of', 'MD', 'MDA', 498, '373'), ";
+					$sql .= "('".uuid()."', 'Monaco', 'MC', 'MCO', 492, '377'), ";
+					$sql .= "('".uuid()."', 'Mongolia', 'MN', 'MNG', 496, '976'), ";
+					$sql .= "('".uuid()."', 'Montenegro', 'ME', 'MNE', 499, '382'), ";
+					$sql .= "('".uuid()."', 'Montserrat', 'MS', 'MSR', 500, '1-664'), ";
+					$sql .= "('".uuid()."', 'Morocco', 'MA', 'MAR', 504, '212'), ";
+					$sql .= "('".uuid()."', 'Mozambique', 'MZ', 'MOZ', 508, '258'), ";
+					$sql .= "('".uuid()."', 'Myanmar', 'MM', 'MMR', 104, '95'), ";
+					$sql .= "('".uuid()."', 'Namibia', 'NA', 'NAM', 516, '264'), ";
+					$sql .= "('".uuid()."', 'Nauru', 'NR', 'NRU', 520, '674'), ";
+					$sql .= "('".uuid()."', 'Nepal', 'NP', 'NPL', 524, '977'), ";
+					$sql .= "('".uuid()."', 'Netherlands', 'NL', 'NLD', 528, '31'), ";
+					$sql .= "('".uuid()."', 'New Caledonia', 'NC', 'NCL', 540, '687'), ";
+					$sql .= "('".uuid()."', 'New Zealand', 'NZ', 'NZL', 554, '64'), ";
+					$sql .= "('".uuid()."', 'Nicaragua', 'NI', 'NIC', 558, '505'), ";
+					$sql .= "('".uuid()."', 'Niger', 'NE', 'NER', 562, '227'), ";
+					$sql .= "('".uuid()."', 'Nigeria', 'NG', 'NGA', 566, '234'), ";
+					$sql .= "('".uuid()."', 'Niue', 'NU', 'NIU', 570, '683'), ";
+					$sql .= "('".uuid()."', 'Norfolk Island', 'NF', 'NFK', 574, '672'), ";
+					$sql .= "('".uuid()."', 'Northern Mariana Islands', 'MP', 'MNP', 580, '1-670'), ";
+					$sql .= "('".uuid()."', 'Norway', 'NO', 'NOR', 578, '47'), ";
+					$sql .= "('".uuid()."', 'Oman', 'OM', 'OMN', 512, '968'), ";
+					$sql .= "('".uuid()."', 'Pakistan', 'PK', 'PAK', 586, '92'), ";
+					$sql .= "('".uuid()."', 'Palau', 'PW', 'PLW', 585, '680'), ";
+					$sql .= "('".uuid()."', 'Palestine, State of', 'PS', 'PSE', 275, '970'), ";
+					$sql .= "('".uuid()."', 'Panama', 'PA', 'PAN', 591, '507'), ";
+					$sql .= "('".uuid()."', 'Papua New Guinea', 'PG', 'PNG', 598, '675'), ";
+					$sql .= "('".uuid()."', 'Paraguay', 'PY', 'PRY', 600, '595'), ";
+					$sql .= "('".uuid()."', 'Peru', 'PE', 'PER', 604, '51'), ";
+					$sql .= "('".uuid()."', 'Philippines', 'PH', 'PHL', 608, '63'), ";
+					$sql .= "('".uuid()."', 'Pitcairn', 'PN', 'PCN', 612, '870'), ";
+					$sql .= "('".uuid()."', 'Poland', 'PL', 'POL', 616, '48'), ";
+					$sql .= "('".uuid()."', 'Portugal', 'PT', 'PRT', 620, '351'), ";
+					$sql .= "('".uuid()."', 'Puerto Rico', 'PR', 'PRI', 630, '1'), ";
+					$sql .= "('".uuid()."', 'Qatar', 'QA', 'QAT', 634, '974'), ";
+					$sql .= "('".uuid()."', 'Romania', 'RO', 'ROU', 642, '40'), ";
+					$sql .= "('".uuid()."', 'Russian Federation', 'RU', 'RUS', 643, '7'), ";
+					$sql .= "('".uuid()."', 'Rwanda', 'RW', 'RWA', 646, '250'), ";
+					$sql .= "('".uuid()."', 'Reunion', 'RE', 'REU', 638, '262'), ";
+					$sql .= "('".uuid()."', 'Saint Barthelemy', 'BL', 'BLM', 652, '590'), ";
+					$sql .= "('".uuid()."', 'Saint Helena', 'SH', 'SHN', 654, '290'), ";
+					$sql .= "('".uuid()."', 'Saint Kitts and Nevis', 'KN', 'KNA', 659, '1-869'), ";
+					$sql .= "('".uuid()."', 'Saint Lucia', 'LC', 'LCA', 662, '1-758'), ";
+					$sql .= "('".uuid()."', 'Saint Martin (French part)', 'MF', 'MAF', 663, '590'), ";
+					$sql .= "('".uuid()."', 'Saint Pierre and Miquelon', 'PM', 'SPM', 666, '508'), ";
+					$sql .= "('".uuid()."', 'Saint Vincent and the Grenadines', 'VC', 'VCT', 670, '1-784'), ";
+					$sql .= "('".uuid()."', 'Samoa', 'WS', 'WSM', 882, '685'), ";
+					$sql .= "('".uuid()."', 'San Marino', 'SM', 'SMR', 674, '378'), ";
+					$sql .= "('".uuid()."', 'Sao Tome and Principe', 'ST', 'STP', 678, '239'), ";
+					$sql .= "('".uuid()."', 'Saudi Arabia', 'SA', 'SAU', 682, '966'), ";
+					$sql .= "('".uuid()."', 'Senegal', 'SN', 'SEN', 686, '221'), ";
+					$sql .= "('".uuid()."', 'Serbia', 'RS', 'SRB', 688, '381'), ";
+					$sql .= "('".uuid()."', 'Seychelles', 'SC', 'SYC', 690, '248'), ";
+					$sql .= "('".uuid()."', 'Sierra Leone', 'SL', 'SLE', 694, '232'), ";
+					$sql .= "('".uuid()."', 'Singapore', 'SG', 'SGP', 702, '65'), ";
+					$sql .= "('".uuid()."', 'Sint Maarten (Dutch part)', 'SX', 'SXM', 534, '1-721'), ";
+					$sql .= "('".uuid()."', 'Slovakia', 'SK', 'SVK', 703, '421'), ";
+					$sql .= "('".uuid()."', 'Slovenia', 'SI', 'SVN', 705, '386'), ";
+					$sql .= "('".uuid()."', 'Solomon Islands', 'SB', 'SLB', 90, '677'), ";
+					$sql .= "('".uuid()."', 'Somalia', 'SO', 'SOM', 706, '252'), ";
+					$sql .= "('".uuid()."', 'South Africa', 'ZA', 'ZAF', 710, '27'), ";
+					$sql .= "('".uuid()."', 'South Georgia and the South Sandwich Islands', 'GS', 'SGS', 239, '500'), ";
+					$sql .= "('".uuid()."', 'South Sudan', 'SS', 'SSD', 728, '211'), ";
+					$sql .= "('".uuid()."', 'Spain', 'ES', 'ESP', 724, '34'), ";
+					$sql .= "('".uuid()."', 'Sri Lanka', 'LK', 'LKA', 144, '94'), ";
+					$sql .= "('".uuid()."', 'Sudan', 'SD', 'SDN', 729, '249'), ";
+					$sql .= "('".uuid()."', 'Suriname', 'SR', 'SUR', 740, '597'), ";
+					$sql .= "('".uuid()."', 'Svalbard and Jan Mayen', 'SJ', 'SJM', 744, '47'), ";
+					$sql .= "('".uuid()."', 'Swaziland', 'SZ', 'SWZ', 748, '268'), ";
+					$sql .= "('".uuid()."', 'Sweden', 'SE', 'SWE', 752, '46'), ";
+					$sql .= "('".uuid()."', 'Switzerland', 'CH', 'CHE', 756, '41'), ";
+					$sql .= "('".uuid()."', 'Syrian Arab Republic', 'SY', 'SYR', 760, '963'), ";
+					$sql .= "('".uuid()."', 'Taiwan, Province of China', 'TW', 'TWN', 158, '886'), ";
+					$sql .= "('".uuid()."', 'Tajikistan', 'TJ', 'TJK', 762, '992'), ";
+					$sql .= "('".uuid()."', 'United Republic of Tanzania', 'TZ', 'TZA', 834, '255'), ";
+					$sql .= "('".uuid()."', 'Thailand', 'TH', 'THA', 764, '66'), ";
+					$sql .= "('".uuid()."', 'Timor-Leste', 'TL', 'TLS', 626, '670'), ";
+					$sql .= "('".uuid()."', 'Togo', 'TG', 'TGO', 768, '228'), ";
+					$sql .= "('".uuid()."', 'Tokelau', 'TK', 'TKL', 772, '690'), ";
+					$sql .= "('".uuid()."', 'Tonga', 'TO', 'TON', 776, '676'), ";
+					$sql .= "('".uuid()."', 'Trinidad and Tobago', 'TT', 'TTO', 780, '1-868'), ";
+					$sql .= "('".uuid()."', 'Tunisia', 'TN', 'TUN', 788, '216'), ";
+					$sql .= "('".uuid()."', 'Turkey', 'TR', 'TUR', 792, '90'), ";
+					$sql .= "('".uuid()."', 'Turkmenistan', 'TM', 'TKM', 795, '993'), ";
+					$sql .= "('".uuid()."', 'Turks and Caicos Islands', 'TC', 'TCA', 796, '1-649'), ";
+					$sql .= "('".uuid()."', 'Tuvalu', 'TV', 'TUV', 798, '688'), ";
+					$sql .= "('".uuid()."', 'Uganda', 'UG', 'UGA', 800, '256'), ";
+					$sql .= "('".uuid()."', 'Ukraine', 'UA', 'UKR', 804, '380'), ";
+					$sql .= "('".uuid()."', 'United Arab Emirates', 'AE', 'ARE', 784, '971'), ";
+					$sql .= "('".uuid()."', 'United Kingdom', 'GB', 'GBR', 826, '44'), ";
+					$sql .= "('".uuid()."', 'United States', 'US', 'USA', 840, '1'), ";
+					$sql .= "('".uuid()."', 'United States Minor Outlying Islands', 'UM', 'UMI', 581, '1'), ";
+					$sql .= "('".uuid()."', 'Uruguay', 'UY', 'URY', 858, '598'), ";
+					$sql .= "('".uuid()."', 'Uzbekistan', 'UZ', 'UZB', 860, '998'), ";
+					$sql .= "('".uuid()."', 'Vanuatu', 'VU', 'VUT', 548, '678'), ";
+					$sql .= "('".uuid()."', 'Venezuela', 'VE', 'VEN', 862, '58'), ";
+					$sql .= "('".uuid()."', 'Viet Nam', 'VN', 'VNM', 704, '84'), ";
+					$sql .= "('".uuid()."', 'British Virgin Islands', 'VG', 'VGB', 92, '1-284'), ";
+					$sql .= "('".uuid()."', 'US Virgin Islands', 'VI', 'VIR', 850, '1-340'), ";
+					$sql .= "('".uuid()."', 'Wallis and Futuna', 'WF', 'WLF', 876, '681'), ";
+					$sql .= "('".uuid()."', 'Western Sahara', 'EH', 'ESH', 732, '212'), ";
+					$sql .= "('".uuid()."', 'Yemen', 'YE', 'YEM', 887, '967'), ";
+					$sql .= "('".uuid()."', 'Zambia', 'ZM', 'ZMB', 894, '260'), ";
+					$sql .= "('".uuid()."', 'Zimbabwe', 'ZW', 'ZWE', 716, '263'), ";
+					$sql .= "('".uuid()."', 'Aland Islands', 'AX', 'ALA', 248, '358') ";
+					$db->exec(check_sql($sql));
+					unset($sql);
+				}
+				unset($prep_statement, $row);
+			}
+		//update any defaults set to legacy languages
+			$language = new text;
+			foreach ($language->legacy_map as $language_code => $legacy_code) {
+				if(strlen($legacy_code) == 5)
+					continue;
+				$sql = "update v_default_settings set default_setting_value = '$language_code' where default_setting_value = '$legacy_code' and deafult_setting_name = 'code' and default_setting_dubcategory = 'language' and default_setting_category = 'domain'";
+				$db->exec(check_sql($sql));
+				unset($sql);
+			}
+	
+	}
+
+?>

+ 24 - 16
core/default_settings/app_menu.php

@@ -1,20 +1,28 @@
 <?php
 <?php
 
 
-$apps[$x]['menu'][0]['title']['en-us'] = "Default Settings";
-$apps[$x]['menu'][0]['title']['es-cl'] = "Conf. Predeterminada";
-$apps[$x]['menu'][0]['title']['fr-fr'] = "Confs par Défaut";
-$apps[$x]['menu'][0]['title']['pt-pt'] = "Predefinições";
-$apps[$x]['menu'][0]['title']['pt-br'] = "Configurações";
-$apps[$x]['menu'][0]['title']['pl'] = "Ustawienia domyślne";
-$apps[$x]['menu'][0]['title']['ru-ru'] = "Настройки по умолчанию";
-$apps[$x]['menu'][0]['title']['sv-se'] = "Standard Inställningar";
-$apps[$x]['menu'][0]['title']['uk'] = "Налаштування за замовчуванням";
-$apps[$x]['menu'][0]['title']['de-de'] = "Standardeinstellungen";
-$apps[$x]['menu'][0]['title']['de-at'] = "Standardeinstellungen";
-$apps[$x]['menu'][0]['uuid'] = "834b2739-9e99-4345-9b0b-7ec3ca332b67";
-$apps[$x]['menu'][0]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
-$apps[$x]['menu'][0]['category'] = "internal";
-$apps[$x]['menu'][0]['path'] = "/core/default_settings/default_settings.php";
-$apps[$x]['menu'][0]['groups'][] = "superadmin";
+	$y=0;
+	$apps[$x]['menu'][$y]['title']['en-us'] = "Default Settings";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Standardeinstellungen";
+	$apps[$x]['menu'][$y]['title']['de-de'] = "Standardeinstellungen";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Conf. Predeterminada";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "Confs par Défaut";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "Ustawienia domyślne";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "Configurações";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "Predefinições";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Настройки по умолчанию";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "Standard Inställningar";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = "Налаштування за замовчуванням";
+	$apps[$x]['menu'][$y]['uuid'] = "834b2739-9e99-4345-9b0b-7ec3ca332b67";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['path'] = "/core/default_settings/default_settings.php";
+	$apps[$x]['menu'][$y]['groups'][] = "superadmin";
 
 
 ?>
 ?>

+ 10 - 1
core/domain_settings/app_defaults.php

@@ -17,7 +17,7 @@
 
 
 	The Initial Developer of the Original Code is
 	The Initial Developer of the Original Code is
 	Mark J Crane <[email protected]>
 	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2010
+	Portions created by the Initial Developer are Copyright (C) 2008-2017
 	the Initial Developer. All Rights Reserved.
 	the Initial Developer. All Rights Reserved.
 
 
 	Contributor(s):
 	Contributor(s):
@@ -30,6 +30,15 @@
 			$sql = "update v_domains set domain_enabled = 'true' where domain_enabled = '' or domain_enabled is null";
 			$sql = "update v_domains set domain_enabled = 'true' where domain_enabled = '' or domain_enabled is null";
 			$db->exec(check_sql($sql));
 			$db->exec(check_sql($sql));
 			unset($sql);
 			unset($sql);
+		//update any domains set to legacy languages
+			$language = new text;
+			foreach ($language->legacy_map as $language_code => $legacy_code) {
+				if(strlen($legacy_code) == 5)
+					continue;
+				$sql = "update v_domain_settings set domain_setting_value = '$language_code' where domain_setting_value = '$legacy_code' and deafult_setting_name = 'code' and domain_setting_dubcategory = 'language' and domain_setting_category = 'domain'";
+				$db->exec(check_sql($sql));
+				unset($sql);
+			}
 	}
 	}
 
 
 ?>
 ?>

+ 48 - 33
core/domain_settings/app_menu.php

@@ -1,37 +1,52 @@
 <?php
 <?php
 
 
-$apps[$x]['menu'][0]['title']['en-us'] = "Domains";
-$apps[$x]['menu'][0]['title']['es-cl'] = "Dominios";
-$apps[$x]['menu'][0]['title']['fr-fr'] = "domaines";
-$apps[$x]['menu'][0]['title']['pt-pt'] = "Domínios";
-$apps[$x]['menu'][0]['title']['pt-br'] = "Dominios";
-$apps[$x]['menu'][0]['title']['pl'] = "Domeny";
-$apps[$x]['menu'][0]['title']['ru-ru'] = "Домены";
-$apps[$x]['menu'][0]['title']['sv-se'] = "Domäner";
-$apps[$x]['menu'][0]['title']['uk'] = "Домени";
-$apps[$x]['menu'][0]['title']['de-de'] = "Domänen";
-$apps[$x]['menu'][0]['title']['de-at'] = "Domänen";
-$apps[$x]['menu'][0]['uuid'] = "4fa7e90b-6d6c-12d4-712f-62857402b801";
-$apps[$x]['menu'][0]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
-$apps[$x]['menu'][0]['category'] = "internal";
-$apps[$x]['menu'][0]['path'] = "/core/domain_settings/domains.php";
-$apps[$x]['menu'][0]['groups'][] = "superadmin";
-
-$apps[$x]['menu'][1]['title']['en-us'] = "Domain Settings";
-$apps[$x]['menu'][1]['title']['es-cl'] = "Configuraciones de Dominio";
-$apps[$x]['menu'][1]['title']['fr-fr'] = "Paramètres du Domaine";
-$apps[$x]['menu'][1]['title']['pt-pt'] = "Definições do Domínio";
-$apps[$x]['menu'][1]['title']['pt-br'] = "Configurações do Dominio";
-$apps[$x]['menu'][1]['title']['pl'] = "Ustawienia Domen";
-$apps[$x]['menu'][1]['title']['ru-ru'] = "Параметры домена";
-$apps[$x]['menu'][1]['title']['sv-se'] = "Domän Inställning";
-$apps[$x]['menu'][1]['title']['uk'] = "Налаштування доменів";
-$apps[$x]['menu'][1]['title']['de-de'] = "Domänen Einstellungen";
-$apps[$x]['menu'][1]['title']['de-at'] = "Domänen Einstellungen";
-$apps[$x]['menu'][1]['uuid'] = "0869ac79-4af3-498f-af65-69662280d74e";
-$apps[$x]['menu'][1]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
-$apps[$x]['menu'][1]['category'] = "internal";
-$apps[$x]['menu'][1]['path'] = "/core/domain_settings/domain_edit.php";
-$apps[$x]['menu'][1]['groups'][] = "admin";
+	$y=0;
+	$apps[$x]['menu'][$y]['title']['en-us'] = "Domains";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Domänen";
+	$apps[$x]['menu'][$y]['title']['de-de'] = "Domänen";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Dominios";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "domaines";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "Domeny";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "Dominios";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "Domínios";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Домены";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "Domäner";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = "Домени";
+	$apps[$x]['menu'][$y]['uuid'] = "4fa7e90b-6d6c-12d4-712f-62857402b801";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['path'] = "/core/domain_settings/domains.php";
+	$apps[$x]['menu'][$y]['groups'][] = "superadmin";
+	$y++;
+	$apps[$x]['menu'][$y]['title']['en-us'] = "Domain Settings";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Domänen Einstellungen";
+	$apps[$x]['menu'][$y]['title']['de-de'] = "Domänen Einstellungen";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Configuraciones de Dominio";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "Paramètres du Domaine";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "Ustawienia Domen";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "Configurações do Dominio";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "Definições do Domínio";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Параметры домена";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "Domän Inställning";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = "Налаштування доменів";
+	$apps[$x]['menu'][$y]['uuid'] = "0869ac79-4af3-498f-af65-69662280d74e";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['path'] = "/core/domain_settings/domain_edit.php";
+	$apps[$x]['menu'][$y]['groups'][] = "admin";
 
 
 ?>
 ?>

+ 187 - 140
core/menu/app_menu.php

@@ -1,143 +1,190 @@
 <?php
 <?php
-
-$apps[$x]['menu'][0]['title']['en-us'] = "Menu Manager";
-$apps[$x]['menu'][0]['title']['es-cl'] = "Gestor de Menú";
-$apps[$x]['menu'][0]['title']['fr-fr'] = "Gestion des Menus";
-$apps[$x]['menu'][0]['title']['pt-pt'] = "Gestor de Menus";
-$apps[$x]['menu'][0]['title']['pt-br'] = "Menu Admistrador";
-$apps[$x]['menu'][0]['title']['pl'] = "Menedżer menu";
-$apps[$x]['menu'][0]['title']['ru-ru'] = "Управление меню";
-$apps[$x]['menu'][0]['title']['uk'] = "Менеджер меню";
-$apps[$x]['menu'][0]['title']['sv-se'] = "Meny Inställningar";
-$apps[$x]['menu'][0]['title']['de-de'] = "Menü Einstellungen";
-$apps[$x]['menu'][0]['title']['de-at'] = "Menü Einstellungen";
-$apps[$x]['menu'][0]['uuid'] = "da3a9ab4-c28e-ea8d-50cc-e8405ac8e76e";
-$apps[$x]['menu'][0]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
-$apps[$x]['menu'][0]['category'] = "internal";
-$apps[$x]['menu'][0]['path'] = "/core/menu/menu.php";
-$apps[$x]['menu'][0]['groups'][] = "superadmin";
-
-$apps[$x]['menu'][1]['title']['en-us'] = "Home";
-$apps[$x]['menu'][1]['title']['es-cl'] = "Casa";
-$apps[$x]['menu'][1]['title']['fr-fr'] = "Maison";
-$apps[$x]['menu'][1]['title']['pt-pt'] = "Casa";
-$apps[$x]['menu'][1]['title']['pt-br'] = "Casa";
-$apps[$x]['menu'][1]['title']['pl'] = "Dom";
-$apps[$x]['menu'][1]['title']['ru-ru'] = "Основные";
-$apps[$x]['menu'][1]['title']['uk'] = "Основне";
-$apps[$x]['menu'][1]['title']['sv-se'] = "Hem";
-$apps[$x]['menu'][1]['title']['de-de'] = "Home";
-$apps[$x]['menu'][1]['title']['de-at'] = "Home";
-$apps[$x]['menu'][1]['uuid'] = "02194288-6d56-6d3e-0b1a-d53a2bc10788";
-$apps[$x]['menu'][1]['parent_uuid'] = "";
-$apps[$x]['menu'][1]['category'] = "internal";
-$apps[$x]['menu'][1]['icon'] = "glyphicon-home";
-$apps[$x]['menu'][1]['path'] = "";
-$apps[$x]['menu'][1]['order'] = "5";
-$apps[$x]['menu'][1]['groups'][] = "user";
-$apps[$x]['menu'][1]['groups'][] = "admin";
-$apps[$x]['menu'][1]['groups'][] = "superadmin";
-
-$apps[$x]['menu'][2]['title']['en-us'] = "Accounts";
-$apps[$x]['menu'][2]['title']['es-cl'] = "Cuentas";
-$apps[$x]['menu'][2]['title']['fr-fr'] = "Comptes";
-$apps[$x]['menu'][2]['title']['pt-pt'] = "Contas";
-$apps[$x]['menu'][2]['title']['pt-br'] = "Contas";
-$apps[$x]['menu'][2]['title']['pl'] = "Konta";
-$apps[$x]['menu'][2]['title']['ru-ru'] = "Учетные Записи";
-$apps[$x]['menu'][2]['title']['uk'] = "Облікові записи";
-$apps[$x]['menu'][2]['title']['sv-se'] = "Konton";
-$apps[$x]['menu'][2]['title']['de-de'] = "Konten";
-$apps[$x]['menu'][2]['title']['de-at'] = "Konten";
-$apps[$x]['menu'][2]['uuid'] = "bc96d773-ee57-0cdd-c3ac-2d91aba61b55";
-$apps[$x]['menu'][2]['parent_uuid'] = "";
-$apps[$x]['menu'][2]['category'] = "internal";
-$apps[$x]['menu'][2]['icon'] = "glyphicon-user";
-$apps[$x]['menu'][2]['path'] = "";
-$apps[$x]['menu'][2]['order'] = "10";
-$apps[$x]['menu'][2]['groups'][] = "admin";
-$apps[$x]['menu'][2]['groups'][] = "superadmin";
-
-$apps[$x]['menu'][3]['title']['en-us'] = "Status";
-$apps[$x]['menu'][3]['title']['es-cl'] = "Estado";
-$apps[$x]['menu'][3]['title']['fr-fr'] = "Etat";
-$apps[$x]['menu'][3]['title']['pt-pt'] = "Estado";
-$apps[$x]['menu'][3]['title']['pt-br'] = "Estados";
-$apps[$x]['menu'][3]['title']['pl'] = "Status ";
-$apps[$x]['menu'][3]['title']['ru-ru'] = "Статус";
-$apps[$x]['menu'][3]['title']['uk'] = "Статус";
-$apps[$x]['menu'][3]['title']['sv-se'] = "Status";
-$apps[$x]['menu'][3]['title']['de-de'] = "Status";
-$apps[$x]['menu'][3]['title']['de-at'] = "Status";
-$apps[$x]['menu'][3]['uuid'] = "0438b504-8613-7887-c420-c837ffb20cb1";
-$apps[$x]['menu'][3]['parent_uuid'] = "";
-$apps[$x]['menu'][3]['category'] = "internal";
-$apps[$x]['menu'][3]['icon'] = "glyphicon-equalizer";
-$apps[$x]['menu'][3]['path'] = "";
-$apps[$x]['menu'][3]['order'] = "25";
-$apps[$x]['menu'][3]['groups'][] = "user";
-$apps[$x]['menu'][3]['groups'][] = "admin";
-$apps[$x]['menu'][3]['groups'][] = "superadmin";
-
-$apps[$x]['menu'][4]['title']['en-us'] = "Advanced";
-$apps[$x]['menu'][4]['title']['es-cl'] = "Avanzado";
-$apps[$x]['menu'][4]['title']['fr-fr'] = "Avancé";
-$apps[$x]['menu'][4]['title']['pt-pt'] = "Avançado";
-$apps[$x]['menu'][4]['title']['pt-br'] = "Avançado";
-$apps[$x]['menu'][4]['title']['pl'] = "Zaawansowany";
-$apps[$x]['menu'][4]['title']['ru-ru'] = "Дополнительные";
-$apps[$x]['menu'][4]['title']['uk'] = "Розширені";
-$apps[$x]['menu'][4]['title']['sv-se'] = "Avancerad";
-$apps[$x]['menu'][4]['title']['de-de'] = "Erweitert";
-$apps[$x]['menu'][4]['title']['de-at'] = "Erweitert";
-$apps[$x]['menu'][4]['uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
-$apps[$x]['menu'][4]['parent_uuid'] = "";
-$apps[$x]['menu'][4]['category'] = "internal";
-$apps[$x]['menu'][4]['icon'] = "glyphicon-cog";
-$apps[$x]['menu'][4]['path'] = "";
-$apps[$x]['menu'][4]['order'] = "30";
-$apps[$x]['menu'][4]['groups'][] = "superadmin";
-$apps[$x]['menu'][4]['groups'][] = "admin";
-
-$apps[$x]['menu'][5]['title']['en-us'] = "Login";
-$apps[$x]['menu'][5]['title']['es-cl'] = "Ingresar";
-$apps[$x]['menu'][5]['title']['es-mx'] = "";
-$apps[$x]['menu'][5]['title']['de-de'] = "";
-$apps[$x]['menu'][5]['title']['de-ch'] = "";
-$apps[$x]['menu'][5]['title']['de-de'] = "Anmelden";
-$apps[$x]['menu'][5]['title']['de-at'] = "Anmelden";
-$apps[$x]['menu'][5]['title']['fr-fr'] = "Connexion";
-$apps[$x]['menu'][5]['title']['fr-ca'] = "";
-$apps[$x]['menu'][5]['title']['fr-ch'] = "";
-$apps[$x]['menu'][5]['title']['pt-pt'] = "Entrar";
-$apps[$x]['menu'][5]['title']['pt-br'] = "";
-$apps[$x]['menu'][5]['title']['ru-ru'] = "Войти";
-$apps[$x]['menu'][5]['uuid'] = "c85bf816-b88d-40fa-8634-11b456928afa";
-$apps[$x]['menu'][5]['parent_uuid'] = "";
-$apps[$x]['menu'][5]['category'] = "internal";
-$apps[$x]['menu'][5]['icon'] = "glyphicon-log-in";
-$apps[$x]['menu'][5]['path'] = "/login.php";
-$apps[$x]['menu'][5]['groups'][] = "public";
-$apps[$x]['menu'][5]['order'] = "99";
-
-$apps[$x]['menu'][6]['title']['en-us'] = 'Logout';
-$apps[$x]['menu'][6]['title']['es-mx'] = 'Salir';
-$apps[$x]['menu'][6]['title']['pt-pt'] = 'Sair';
-$apps[$x]['menu'][6]['title']['pt-br'] = '';
-$apps[$x]['menu'][6]['title']['de-de'] = 'Abmelden';
-$apps[$x]['menu'][6]['title']['de-at'] = 'Abmelden';
-$apps[$x]['menu'][6]['title']['fr-fr'] = 'Déconnexion';
-$apps[$x]['menu'][6]['title']['pl'] = 'Wyloguj';
-$apps[$x]['menu'][6]['title']['ru-ru'] = 'Выйти';
-$apps[$x]['menu'][6]['title']['uk'] = 'вийти';
-$apps[$x]['menu'][6]['title']['uk'] = 'Logga Ut';
-$apps[$x]['menu'][6]['uuid'] = '0d29e9f4-0c9b-9d8d-cd2d-454899dc9bc4';
-$apps[$x]['menu'][6]['parent_uuid'] = '02194288-6d56-6d3e-0b1a-d53a2bc10788';
-$apps[$x]['menu'][6]['category'] = 'internal';
-$apps[$x]['menu'][6]['icon'] = "glyphicon-log-out";
-$apps[$x]['menu'][6]['path'] = '/logout.php';
-$apps[$x]['menu'][6]['groups'][] = 'user';
-$apps[$x]['menu'][6]['groups'][] = 'admin';
-$apps[$x]['menu'][6]['groups'][] = 'superadmin';
+	$y=0;
+	$apps[$x]['menu'][$y]['title']['en-us'] = "Menu Manager";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Menü Einstellungen";
+	$apps[$x]['menu'][$y]['title']['de-de'] = "Menü Einstellungen";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Gestor de Menú";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "Gestion des Menus";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "Menedżer menu";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "Menu Admistrador";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "Gestor de Menus";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Управление меню";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "Meny Inställningar";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = "Менеджер меню";
+	$apps[$x]['menu'][$y]['uuid'] = "da3a9ab4-c28e-ea8d-50cc-e8405ac8e76e";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['path'] = "/core/menu/menu.php";
+	$apps[$x]['menu'][$y]['groups'][] = "superadmin";
+	$y++;
+	$apps[$x]['menu'][$y]['title']['en-us'] = "Home";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Home";
+	$apps[$x]['menu'][$y]['title']['de-de'] = "Home";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Casa";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "Maison";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "Dom";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "Casa";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "Casa";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Основные";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "Hem";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = "Основне";
+	$apps[$x]['menu'][$y]['uuid'] = "02194288-6d56-6d3e-0b1a-d53a2bc10788";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['icon'] = "glyphicon-home";
+	$apps[$x]['menu'][$y]['path'] = "";
+	$apps[$x]['menu'][$y]['order'] = "5";
+	$apps[$x]['menu'][$y]['groups'][] = "user";
+	$apps[$x]['menu'][$y]['groups'][] = "admin";
+	$apps[$x]['menu'][$y]['groups'][] = "superadmin";
+	$y++;
+	$apps[$x]['menu'][$y]['title']['en-us'] = "Accounts";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Konten";
+	$apps[$x]['menu'][$y]['title']['de-de'] = "Konten";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Cuentas";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "Comptes";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "Konta";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "Contas";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "Contas";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Учетные Записи";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "Konton";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = "Облікові записи";
+	$apps[$x]['menu'][$y]['uuid'] = "bc96d773-ee57-0cdd-c3ac-2d91aba61b55";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['icon'] = "glyphicon-user";
+	$apps[$x]['menu'][$y]['path'] = "";
+	$apps[$x]['menu'][$y]['order'] = "10";
+	$apps[$x]['menu'][$y]['groups'][] = "admin";
+	$apps[$x]['menu'][$y]['groups'][] = "superadmin";
+	$y++;
+	$apps[$x]['menu'][$y]['title']['en-us'] = "Status";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Status";
+	$apps[$x]['menu'][$y]['title']['de-de'] = "Status";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Estado";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "Etat";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "Status ";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "Estados";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "Estado";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Статус";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "Status";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = "Статус";
+	$apps[$x]['menu'][$y]['uuid'] = "0438b504-8613-7887-c420-c837ffb20cb1";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['icon'] = "glyphicon-equalizer";
+	$apps[$x]['menu'][$y]['path'] = "";
+	$apps[$x]['menu'][$y]['order'] = "25";
+	$apps[$x]['menu'][$y]['groups'][] = "user";
+	$apps[$x]['menu'][$y]['groups'][] = "admin";
+	$apps[$x]['menu'][$y]['groups'][] = "superadmin";
+	$y++;
+	$apps[$x]['menu'][$y]['title']['en-us'] = "Advanced";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Erweitert";
+	$apps[$x]['menu'][$y]['title']['de-de'] = "Erweitert";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Avanzado";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "Avancé";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "Zaawansowany";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "Avançado";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "Avançado";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Дополнительные";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "Avancerad";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = "Розширені";
+	$apps[$x]['menu'][$y]['uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['icon'] = "glyphicon-cog";
+	$apps[$x]['menu'][$y]['path'] = "";
+	$apps[$x]['menu'][$y]['order'] = "30";
+	$apps[$x]['menu'][$y]['groups'][] = "superadmin";
+	$apps[$x]['menu'][$y]['groups'][] = "admin";
+	$y++;
+	$apps[$x]['menu'][$y]['title']['en-us'] = "Login";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Anmelden";
+	$apps[$x]['menu'][$y]['title']['de-de'] = "Anmelden";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Ingresar";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "Connexion";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "Entrar";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Войти";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = "";
+	$apps[$x]['menu'][$y]['uuid'] = "c85bf816-b88d-40fa-8634-11b456928afa";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['icon'] = "glyphicon-log-in";
+	$apps[$x]['menu'][$y]['path'] = "/login.php";
+	$apps[$x]['menu'][$y]['groups'][] = "public";
+	$apps[$x]['menu'][$y]['order'] = "99";
+	$y++;
+	$apps[$x]['menu'][$y]['title']['en-us'] = 'Logout';
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
+	$apps[$x]['menu'][$y]['title']['de-at'] = 'Abmelden';
+	$apps[$x]['menu'][$y]['title']['de-de'] = 'Abmelden';
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = 'Salir';
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = 'Déconnexion';
+	$apps[$x]['menu'][$y]['title']['he-il'] = "";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = 'Wyloguj';
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = 'Sair';
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = 'Выйти';
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = 'вийти';
+	$apps[$x]['menu'][$y]['uuid'] = '0d29e9f4-0c9b-9d8d-cd2d-454899dc9bc4';
+	$apps[$x]['menu'][$y]['parent_uuid'] = '02194288-6d56-6d3e-0b1a-d53a2bc10788';
+	$apps[$x]['menu'][$y]['category'] = 'internal';
+	$apps[$x]['menu'][$y]['icon'] = "glyphicon-log-out";
+	$apps[$x]['menu'][$y]['path'] = '/logout.php';
+	$apps[$x]['menu'][$y]['groups'][] = 'user';
+	$apps[$x]['menu'][$y]['groups'][] = 'admin';
+	$apps[$x]['menu'][$y]['groups'][] = 'superadmin';
 
 
 ?>
 ?>

+ 24 - 15
core/notifications/app_menu.php

@@ -1,19 +1,28 @@
 <?php
 <?php
 
 
-$apps[$x]['menu'][0]['title']['en-us'] = "Notifications";
-$apps[$x]['menu'][0]['title']['es-cl'] = "Notificaciones";
-$apps[$x]['menu'][0]['title']['fr-fr'] = "Notifications";
-$apps[$x]['menu'][0]['title']['fr-ca'] = "Notifications";
-$apps[$x]['menu'][0]['title']['pl'] = "Powiadomienia";
-$apps[$x]['menu'][0]['title']['ru-ru'] = "Уведомления";
-$apps[$x]['menu'][0]['title']['uk'] = "Сповіщення";
-$apps[$x]['menu'][0]['title']['sv-se'] = "Meddelanden";
-$apps[$x]['menu'][0]['title']['de-de'] = "Benachrichtigungen";
-$apps[$x]['menu'][0]['title']['de-at'] = "Benachrichtigungen";
-$apps[$x]['menu'][0]['uuid'] = "f8d65f91-0f4a-405a-b5ac-24cb3c4f10ba";
-$apps[$x]['menu'][0]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
-$apps[$x]['menu'][0]['category'] = "internal";
-$apps[$x]['menu'][0]['path'] = "/core/notifications/notification_edit.php";
-$apps[$x]['menu'][0]['groups'][] = "superadmin";
+	$y = 0;
+	$apps[$x]['menu'][$y]['title']['en-us'] = "Notifications";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Benachrichtigungen";
+	$apps[$x]['menu'][$y]['title']['de-de'] = "Benachrichtigungen";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Notificaciones";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "Notifications";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "Notifications";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "Powiadomienia";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Уведомления";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "Meddelanden";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = "Сповіщення";
+	$apps[$x]['menu'][$y]['uuid'] = "f8d65f91-0f4a-405a-b5ac-24cb3c4f10ba";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['path'] = "/core/notifications/notification_edit.php";
+	$apps[$x]['menu'][$y]['groups'][] = "superadmin";
 
 
 ?>
 ?>

+ 24 - 16
core/upgrade/app_menu.php

@@ -1,20 +1,28 @@
 <?php
 <?php
 
 
-$apps[$x]['menu'][0]['title']['en-us'] = "Upgrade";
-$apps[$x]['menu'][0]['title']['es-cl'] = "Actualizar";
-$apps[$x]['menu'][0]['title']['fr-fr'] = "Mise à jour";
-$apps[$x]['menu'][0]['title']['pt-pt'] = "Actualizar BD";
-$apps[$x]['menu'][0]['title']['pt-br'] = "Atualizar banco de dados";
-$apps[$x]['menu'][0]['title']['pl'] = "Aktualizacja";
-$apps[$x]['menu'][0]['title']['ru-ru'] = "Обновление";
-$apps[$x]['menu'][0]['title']['sv-se'] = "Uppgardera";
-$apps[$x]['menu'][0]['title']['uk'] = "Оновлення";
-$apps[$x]['menu'][0]['title']['de-de'] = "Aktualisierung";
-$apps[$x]['menu'][0]['title']['de-at'] = "Aktualisierung";
-$apps[$x]['menu'][0]['uuid'] = "8c826e92-be3c-0944-669a-24e5b915d562";
-$apps[$x]['menu'][0]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
-$apps[$x]['menu'][0]['category'] = "internal";
-$apps[$x]['menu'][0]['path'] = "/core/upgrade/index.php";
-$apps[$x]['menu'][0]['groups'][] = "superadmin";
+	$y = 0;
+	$apps[$x]['menu'][$y]['title']['en-us'] = "Upgrade";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Aktualisierung";
+	$apps[$x]['menu'][$y]['title']['de-de'] = "Aktualisierung";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Actualizar";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "Mise à jour";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "Aktualizacja";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "Atualizar banco de dados";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "Actualizar BD";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Обновление";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "Uppgardera";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = "Оновлення";
+	$apps[$x]['menu'][$y]['uuid'] = "8c826e92-be3c-0944-669a-24e5b915d562";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['path'] = "/core/upgrade/index.php";
+	$apps[$x]['menu'][$y]['groups'][] = "superadmin";
 
 
 ?>
 ?>

+ 40 - 0
core/user_settings/app_defaults.php

@@ -0,0 +1,40 @@
+<?php
+/*
+	FusionPBX
+	Version: MPL 1.1
+
+	The contents of this file are subject to the Mozilla Public License Version
+	1.1 (the "License"); you may not use this file except in compliance with
+	the License. You may obtain a copy of the License at
+	http://www.mozilla.org/MPL/
+
+	Software distributed under the License is distributed on an "AS IS" basis,
+	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+	for the specific language governing rights and limitations under the
+	License.
+
+	The Original Code is FusionPBX
+
+	The Initial Developer of the Original Code is
+	Mark J Crane <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2008-2017
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
+
+//proccess this only one time
+	if ($domains_processed == 1) {
+		//update any users set to legacy languages
+			$language = new text;
+			foreach ($language->legacy_map as $language_code => $legacy_code) {
+				if(strlen($legacy_code) == 5)
+					continue;
+				$sql = "update v_user_settings set user_setting_value = '$language_code' where user_setting_value = '$legacy_code' and deafult_setting_name = 'code' and user_setting_dubcategory = 'language' and user_setting_category = 'domain'";
+				$db->exec(check_sql($sql));
+				unset($sql);
+			}
+	}
+
+?>

+ 29 - 24
core/user_settings/app_menu.php

@@ -1,25 +1,30 @@
-<?php
-
-$apps[$x]['menu'][1]['title']['en-us'] = "Dashboard";
-$apps[$x]['menu'][1]['title']['es-cl'] = "Dashboard Usuario";
-$apps[$x]['menu'][1]['title']['fr-fr'] = "Tableau de bord de l'utilisateur";
-$apps[$x]['menu'][1]['title']['pt-pt'] = "Painel de Controle do Usuário";
-$apps[$x]['menu'][1]['title']['pt-br'] = "Painel de controle do usuário (Dashboard)";
-$apps[$x]['menu'][1]['title']['pl'] = "Panel użytkowników";
-$apps[$x]['menu'][1]['title']['ru-ru'] = "Панель пользователя";
-$apps[$x]['menu'][1]['title']['he'] = "ממשק משתמש";
-$apps[$x]['menu'][1]['title']['uk'] = "Панель користувача";
-$apps[$x]['menu'][1]['title']['sv-se'] = "Användarpanel";
-$apps[$x]['menu'][1]['title']['de-de'] = "Benutzerübersicht";
-$apps[$x]['menu'][1]['title']['de-at'] = "Benutzerübersicht";
-$apps[$x]['menu'][1]['title']['ro'] = "Panou control utilizator";
-$apps[$x]['menu'][1]['title']['ar-eg'] = "الصفحه الرئيسيه للمستخدم";
-$apps[$x]['menu'][1]['uuid'] = "92c8ffdb-3c82-4f08-aec0-82421ec41bb5";
-$apps[$x]['menu'][1]['parent_uuid'] = "02194288-6d56-6d3e-0b1a-d53a2bc10788";
-$apps[$x]['menu'][1]['category'] = "internal";
-$apps[$x]['menu'][1]['path'] = "/core/user_settings/user_dashboard.php";
-$apps[$x]['menu'][1]['groups'][] = "user";
-$apps[$x]['menu'][1]['groups'][] = "admin";
-$apps[$x]['menu'][1]['groups'][] = "superadmin";
-
+<?php
+
+	$y = 0;
+	$apps[$x]['menu'][$y]['title']['en-us'] = "Dashboard";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "الصفحه الرئيسيه للمستخدم";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Benutzerübersicht";
+	$apps[$x]['menu'][$y]['title']['de-de'] = "Benutzerübersicht";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Dashboard Usuario";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "Tableau de bord de l'utilisateur";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "ממשק משתמש";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "Panel użytkowników";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "Painel de controle do usuário (Dashboard)";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "Painel de Controle do Usuário";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "Panou control utilizator";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Панель пользователя";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "Användarpanel";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = "Панель користувача";
+	$apps[$x]['menu'][$y]['uuid'] = "92c8ffdb-3c82-4f08-aec0-82421ec41bb5";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "02194288-6d56-6d3e-0b1a-d53a2bc10788";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['path'] = "/core/user_settings/user_dashboard.php";
+	$apps[$x]['menu'][$y]['groups'][] = "user";
+	$apps[$x]['menu'][$y]['groups'][] = "admin";
+	$apps[$x]['menu'][$y]['groups'][] = "superadmin";
+
 ?>
 ?>

+ 51 - 40
core/users/app_menu.php

@@ -1,44 +1,55 @@
 <?php
 <?php
 
 
-$apps[$x]['menu'][2]['title']['en-us'] = "Users";
-$apps[$x]['menu'][2]['title']['es-cl'] = "Gestor de Usuarios";
-$apps[$x]['menu'][2]['title']['fr-fr'] = "Gestion des utilisteurs";
-$apps[$x]['menu'][2]['title']['pt-pt'] = "Gestão de Utilizadores";
-$apps[$x]['menu'][2]['title']['pt-br'] = "Gerencir utiliários";
-$apps[$x]['menu'][2]['title']['pl'] = "Menedżer użytkowników";
-$apps[$x]['menu'][2]['title']['ru-ru'] = "Пользователи";
-$apps[$x]['menu'][2]['title']['uk'] = "Користувачі";
-$apps[$x]['menu'][2]['title']['sv-se'] = "Användar Inställningar";
-$apps[$x]['menu'][2]['title']['de-de'] = "Benutzerverwaltung";
-$apps[$x]['menu'][2]['title']['de-at'] = "Benutzerverwaltung";
-$apps[$x]['menu'][2]['title']['he'] = "מנהל משתמש";
-$apps[$x]['menu'][2]['uuid'] = "0d57cc1e-1874-47b9-7ddd-fe1f57cec99b";
-$apps[$x]['menu'][2]['parent_uuid'] = "bc96d773-ee57-0cdd-c3ac-2d91aba61b55";
-$apps[$x]['menu'][2]['category'] = "internal";
-$apps[$x]['menu'][2]['path'] = "/core/users/users.php";
-$apps[$x]['menu'][2]['groups'][] = "admin";
-$apps[$x]['menu'][2]['groups'][] = "superadmin";
-
-$apps[$x]['menu'][0]['title']['en-us'] = "Account Settings";
-$apps[$x]['menu'][0]['title']['es-cl'] = "Config de Cuenta";
-$apps[$x]['menu'][0]['title']['fr-fr'] = "Configuration du Compte";
-$apps[$x]['menu'][0]['title']['pt-pt'] = "Configurações da Conta";
-$apps[$x]['menu'][0]['title']['pt-br'] = "Configurações da conta";
-$apps[$x]['menu'][0]['title']['pl'] = "Ustawienia konta";
-$apps[$x]['menu'][0]['title']['ru-ru'] = "Настройка учетной записи";
-$apps[$x]['menu'][0]['title']['he'] = "הגדרת חשבון";
-$apps[$x]['menu'][0]['title']['uk'] = "Обліковий запис";
-$apps[$x]['menu'][0]['title']['sv-se'] = "Kontoinställningar";
-$apps[$x]['menu'][0]['title']['de-de'] = "Kontoeinstellungen";
-$apps[$x]['menu'][0]['title']['de-at'] = "Kontoeinstellungen";
-$apps[$x]['menu'][0]['title']['ro'] = "Setări cont";
-$apps[$x]['menu'][0]['title']['ar-eg'] = "إعدادات الحساب";
-$apps[$x]['menu'][0]['uuid'] = "4d532f0b-c206-c39d-ff33-fc67d668fb69";
-$apps[$x]['menu'][0]['parent_uuid'] = "02194288-6d56-6d3e-0b1a-d53a2bc10788";
-$apps[$x]['menu'][0]['category'] = "internal";
-$apps[$x]['menu'][0]['path'] = "/core/users/user_edit.php?id=user";
-$apps[$x]['menu'][0]['groups'][] = "user";
-$apps[$x]['menu'][0]['groups'][] = "admin";
-$apps[$x]['menu'][0]['groups'][] = "superadmin";
+	$y = 0;
+	$apps[$x]['menu'][$y]['title']['en-us'] = "Users";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Benutzerverwaltung";
+	$apps[$x]['menu'][$y]['title']['de-de'] = "Benutzerverwaltung";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Gestor de Usuarios";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "Gestion des utilisteurs";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "מנהל משתמש";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "Menedżer użytkowników";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "Gerencir utiliários";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "Gestão de Utilizadores";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Пользователи";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "Användar Inställningar";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = "Користувачі";
+	$apps[$x]['menu'][$y]['uuid'] = "0d57cc1e-1874-47b9-7ddd-fe1f57cec99b";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "bc96d773-ee57-0cdd-c3ac-2d91aba61b55";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['path'] = "/core/users/users.php";
+	$apps[$x]['menu'][$y]['groups'][] = "admin";
+	$apps[$x]['menu'][$y]['groups'][] = "superadmin";
+	$y++;	
+	$apps[$x]['menu'][$y]['title']['en-us'] = "Account Settings";
+	$apps[$x]['menu'][$y]['title']['ar-eg'] = "إعدادات الحساب";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "";
+	$apps[$x]['menu'][$y]['title']['de-at'] = "Kontoeinstellungen";
+	$apps[$x]['menu'][$y]['title']['es-cl'] = "Config de Cuenta";
+	$apps[$x]['menu'][$y]['title']['es-mx'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
+	$apps[$x]['menu'][$y]['title']['fr-fr'] = "Configuration du Compte";
+	$apps[$x]['menu'][$y]['title']['he-il'] = "הגדרת חשבון";
+	$apps[$x]['menu'][$y]['title']['it-it'] = "";
+	$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
+	$apps[$x]['menu'][$y]['title']['pl-pl'] = "Ustawienia konta";
+	$apps[$x]['menu'][$y]['title']['pt-br'] = "Configurações da conta";
+	$apps[$x]['menu'][$y]['title']['pt-pt'] = "Configurações da Conta";
+	$apps[$x]['menu'][$y]['title']['ro-ro'] = "Setări cont";
+	$apps[$x]['menu'][$y]['title']['ru-ru'] = "Настройка учетной записи";
+	$apps[$x]['menu'][$y]['title']['sv-se'] = "Kontoinställningar";
+	$apps[$x]['menu'][$y]['title']['uk-ua'] = "Обліковий запис";
+	$apps[$x]['menu'][$y]['uuid'] = "4d532f0b-c206-c39d-ff33-fc67d668fb69";
+	$apps[$x]['menu'][$y]['parent_uuid'] = "02194288-6d56-6d3e-0b1a-d53a2bc10788";
+	$apps[$x]['menu'][$y]['category'] = "internal";
+	$apps[$x]['menu'][$y]['path'] = "/core/users/user_edit.php?id=user";
+	$apps[$x]['menu'][$y]['groups'][] = "user";
+	$apps[$x]['menu'][$y]['groups'][] = "admin";
+	$apps[$x]['menu'][$y]['groups'][] = "superadmin";
 
 
 ?>
 ?>

+ 1 - 1
resources/classes/menu.php

@@ -404,7 +404,7 @@ if (!class_exists('menu')) {
 				//get the database connnection
 				//get the database connnection
 					$db = $this->db;
 					$db = $this->db;
 
 
-				//database ojbect does not exist return immediately
+				//database object does not exist return immediately
 					if (!$db) { return Array(); }
 					if (!$db) { return Array(); }
 
 
 				//if there are no groups then set the public group
 				//if there are no groups then set the public group