Explorar o código

\r\n --> \n

Cause all the .php files containing lines ending with \r\n to instead end with \n.

DYI with:

find fusionpbx -type f -name '*.php' -exec dos2unix '{}' \;
Harry G. Coin %!s(int64=9) %!d(string=hai) anos
pai
achega
f7257446d7
Modificáronse 48 ficheiros con 18261 adicións e 18261 borrados
  1. 564 564
      core/default_settings/app_defaults.php
  2. 432 432
      core/default_settings/app_languages.php
  3. 71 71
      core/default_settings/default_setting_toggle.php
  4. 50 50
      core/default_settings/default_settings_reload.php
  5. 34 34
      core/domain_settings/app_defaults.php
  6. 444 444
      core/domain_settings/app_languages.php
  7. 163 163
      core/events/resources/classes/events.php
  8. 420 420
      core/install/app_languages.php
  9. 82 82
      core/install/index.php
  10. 366 366
      core/install/install.php
  11. 169 169
      core/install/resources/classes/detect_switch.php
  12. 213 213
      core/install/resources/classes/global_settings.php
  13. 952 952
      core/install/resources/classes/install_fusionpbx.php
  14. 145 145
      core/install/resources/classes/install_switch.php
  15. 251 251
      core/install/resources/classes/iso_countries.php
  16. 275 275
      core/install/resources/page_parts/install_config_database.php
  17. 149 149
      core/install/resources/page_parts/install_config_detail.php
  18. 136 136
      core/install/resources/page_parts/install_event_socket.php
  19. 64 64
      core/install/resources/page_parts/install_select_language.php
  20. 460 460
      core/notifications/notification_edit.php
  21. 248 248
      core/upgrade/index.php
  22. 1259 1259
      core/user_settings/app_languages.php
  23. 42 42
      core/user_settings/app_menu.php
  24. 421 421
      core/users/app_config.php
  25. 1072 1072
      core/users/app_languages.php
  26. 35 35
      core/users/app_menu.php
  27. 311 311
      core/users/groupedit.php
  28. 747 747
      resources/app_languages.php
  29. 138 138
      resources/classes/cache.php
  30. 126 126
      resources/classes/config.php
  31. 280 280
      resources/classes/destinations.php
  32. 190 190
      resources/classes/groups.php
  33. 104 104
      resources/classes/permissions.php
  34. 286 286
      resources/classes/switch_settings.php
  35. 101 101
      resources/classes/template.php
  36. 82 82
      resources/classes/text.php
  37. 76 76
      resources/classes/users.php
  38. 915 915
      resources/countries.php
  39. 51 51
      resources/fpdi/filters/FilterASCIIHexDecode.php
  40. 694 694
      resources/fpdi/fpdi.php
  41. 353 353
      resources/fpdi/fpdi_pdf_parser.php
  42. 152 152
      resources/fpdi/pdf_context.php
  43. 912 912
      resources/fpdi/pdf_parser.php
  44. 393 393
      resources/templates/engine/smarty/sysplugins/smarty_internal_parsetree.php
  45. 822 822
      resources/templates/engine/smarty/sysplugins/smarty_internal_templatebase.php
  46. 809 809
      resources/templates/engine/smarty/sysplugins/smarty_internal_templatecompilerbase.php
  47. 822 822
      resources/templates/engine/smarty/sysplugins/smarty_internal_utility.php
  48. 1380 1380
      themes/default/app_defaults.php

+ 564 - 564
core/default_settings/app_defaults.php

@@ -1,565 +1,565 @@
-<?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-2015
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-
-//process this only one time
-if ($domains_processed == 1) {
-
-	//define array of settings
-		$x = 0;
-		$array[$x]['default_setting_category'] = 'domain';
-		$array[$x]['default_setting_subcategory'] = 'time_zone';
-		$array[$x]['default_setting_name'] = 'name';
-		$array[$x]['default_setting_value'] = '';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = '';
-		$x++;
-		$array[$x]['default_setting_category'] = 'domain';
-		$array[$x]['default_setting_subcategory'] = 'language';
-		$array[$x]['default_setting_name'] = 'code';
-		$array[$x]['default_setting_value'] = 'en-us';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = '';
-		$x++;
-		$array[$x]['default_setting_category'] = 'domain';
-		$array[$x]['default_setting_subcategory'] = 'bridge';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'outbound';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'outbound,loopback,lcr';
-		$x++;
-		$array[$x]['default_setting_category'] = 'domain';
-		$array[$x]['default_setting_subcategory'] = 'paging';
-		$array[$x]['default_setting_name'] = 'numeric';
-		$array[$x]['default_setting_value'] = '100';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the maximum number of records displayed per page. (Default: 50)';
-		$x++;
-		$array[$x]['default_setting_category'] = 'security';
-		$array[$x]['default_setting_subcategory'] = 'password_length';
-		$array[$x]['default_setting_name'] = 'var';
-		$array[$x]['default_setting_value'] = '10';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Sets the default length for system generated passwords.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'security';
-		$array[$x]['default_setting_subcategory'] = 'password_strength';
-		$array[$x]['default_setting_name'] = 'var';
-		$array[$x]['default_setting_value'] = '4';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the default strength for system generated passwords.  Valid Options: 1 - Numeric Only, 2 - Include Lower Apha, 3 - Include Upper Alpha, 4 - Include Special Characters.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'security';
-		$array[$x]['default_setting_subcategory'] = 'session_rotate';
-		$array[$x]['default_setting_name'] = 'boolean';
-		$array[$x]['default_setting_value'] = 'true';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Whether to regenerate the session ID.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'email';
-		$array[$x]['default_setting_subcategory'] = 'smtp_auth';
-		$array[$x]['default_setting_name'] = 'var';
-		$array[$x]['default_setting_value'] = 'true';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = '';
-		$x++;
-		$array[$x]['default_setting_category'] = 'email';
-		$array[$x]['default_setting_subcategory'] = 'smtp_from';
-		$array[$x]['default_setting_name'] = 'var';
-		$array[$x]['default_setting_value'] = '';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = '';
-		$x++;
-		$array[$x]['default_setting_category'] = 'email';
-		$array[$x]['default_setting_subcategory'] = 'smtp_from_name';
-		$array[$x]['default_setting_name'] = 'var';
-		$array[$x]['default_setting_value'] = '';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = '';
-		$x++;
-		$array[$x]['default_setting_category'] = 'email';
-		$array[$x]['default_setting_subcategory'] = 'smtp_host';
-		$array[$x]['default_setting_name'] = 'var';
-		$array[$x]['default_setting_value'] = '';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = '';
-		$x++;
-		$array[$x]['default_setting_category'] = 'email';
-		$array[$x]['default_setting_subcategory'] = 'smtp_username';
-		$array[$x]['default_setting_name'] = 'var';
-		$array[$x]['default_setting_value'] = '';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = '';
-		$x++;
-		$array[$x]['default_setting_category'] = 'email';
-		$array[$x]['default_setting_subcategory'] = 'smtp_password';
-		$array[$x]['default_setting_name'] = 'var';
-		$array[$x]['default_setting_value'] = '';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = '';
-		$x++;
-		$array[$x]['default_setting_category'] = 'email';
-		$array[$x]['default_setting_subcategory'] = 'smtp_secure';
-		$array[$x]['default_setting_name'] = 'var';
-		$array[$x]['default_setting_value'] = 'true';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = '';
-		$x++;
-		$array[$x]['default_setting_category'] = 'login';
-		$array[$x]['default_setting_subcategory'] = 'password_reset_key';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = generate_password('20', '4');
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Display a Reset Password link on the login box (requires smtp_host be defined).';
-		$x++;
-		$array[$x]['default_setting_category'] = 'login';
-		$array[$x]['default_setting_subcategory'] = 'domain_name_visible';
-		$array[$x]['default_setting_name'] = 'boolean';
-		$array[$x]['default_setting_value'] = 'true';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Displays a domain input or select box (if domain_name array defined) on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'login';
-		$array[$x]['default_setting_subcategory'] = 'domain_name';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'pbx1.yourdomain.com';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Domain select option displayed on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'admin';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'voicemail';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Voicemail block for users in the admin group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'admin';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'missed';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Missed Calls block for users in the admin group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'admin';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'recent';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Recent Calls block for users in the admin group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'admin';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'limits';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Domain Limits block for users in the admin group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'admin';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'counts';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Domain Counts block for users in the admin group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'admin';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'call_routing';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Call Routing controls for users in the admin group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'admin';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'ring_groups';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Ring Group Forwarding controls for users in the admin group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'superadmin';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'voicemail';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Voicemail block for users in the superadmin group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'superadmin';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'missed';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Missed Calls block for users in the superadmin group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'superadmin';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'recent';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Recent Calls block for users in the superadmin group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'superadmin';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'limits';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Domain Limits block for users in the superadmin group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'superadmin';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'counts';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard System Counts block for users in the superadmin group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'superadmin';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'system';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard System Status block for users in the superadmin group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'superadmin';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'call_routing';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Call Routing controls for users in the superadmin group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'superadmin';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'ring_groups';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Ring Group Forwarding controls for users in the superadmin group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'user';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'voicemail';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Voicemail block for users in the users group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'user';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'missed';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Missed Calls block for users in the users group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'user';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'recent';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Recent Calls block for users in the users group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'user';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'call_routing';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Call Routing controls for users in the users group.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'dashboard';
-		$array[$x]['default_setting_subcategory'] = 'user';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = 'ring_groups';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Enable Dashboard Ring Group Forwarding controls for users in the users group.';
-
-	//get an array of the default settings
-		$sql = "select * from v_default_settings ";
-		$prep_statement = $db->prepare($sql);
-		$prep_statement->execute();
-		$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-		unset ($prep_statement, $sql);
-
-	//find the missing default settings
-		$x = 0;
-		foreach ($array as $setting) {
-			$found = false;
-			$missing[$x] = $setting;
-			foreach ($default_settings as $row) {
-				if (trim($row['default_setting_subcategory']) == trim($setting['default_setting_subcategory'])) {
-					$found = true;
-					//remove items from the array that were found
-					unset($missing[$x]);
-				}
-			}
-			$x++;
-		}
-
-	//get the missing count
-		$i = 0;
-		foreach ($missing as $row) { $i++; }
-		$missing_count = $i;
-
-	//add the missing default settings
-		$sql = "insert into v_default_settings (";
-		$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 .= ") values \n";
-		$i = 1;
-		foreach ($missing as $row) {
-			$sql .= "(";
-			$sql .= "'".uuid()."', ";
-			$sql .= "'".check_str($row['default_setting_category'])."', ";
-			$sql .= "'".check_str($row['default_setting_subcategory'])."', ";
-			$sql .= "'".check_str($row['default_setting_name'])."', ";
-			$sql .= "'".check_str($row['default_setting_value'])."', ";
-			$sql .= "'".check_str($row['default_setting_enabled'])."', ";
-			$sql .= "'".check_str($row['default_setting_description'])."' ";
-			$sql .= ")";
-			if ($missing_count != $i) { 
-				$sql .= ",\n";
-			}
-			$i++;
-		}
-		$db->exec(check_sql($sql));
-		unset($missing);
-
-	//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'), ";
-				$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);
-		}
-
-}
-
+<?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-2015
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
+
+//process this only one time
+if ($domains_processed == 1) {
+
+	//define array of settings
+		$x = 0;
+		$array[$x]['default_setting_category'] = 'domain';
+		$array[$x]['default_setting_subcategory'] = 'time_zone';
+		$array[$x]['default_setting_name'] = 'name';
+		$array[$x]['default_setting_value'] = '';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = '';
+		$x++;
+		$array[$x]['default_setting_category'] = 'domain';
+		$array[$x]['default_setting_subcategory'] = 'language';
+		$array[$x]['default_setting_name'] = 'code';
+		$array[$x]['default_setting_value'] = 'en-us';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = '';
+		$x++;
+		$array[$x]['default_setting_category'] = 'domain';
+		$array[$x]['default_setting_subcategory'] = 'bridge';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'outbound';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'outbound,loopback,lcr';
+		$x++;
+		$array[$x]['default_setting_category'] = 'domain';
+		$array[$x]['default_setting_subcategory'] = 'paging';
+		$array[$x]['default_setting_name'] = 'numeric';
+		$array[$x]['default_setting_value'] = '100';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the maximum number of records displayed per page. (Default: 50)';
+		$x++;
+		$array[$x]['default_setting_category'] = 'security';
+		$array[$x]['default_setting_subcategory'] = 'password_length';
+		$array[$x]['default_setting_name'] = 'var';
+		$array[$x]['default_setting_value'] = '10';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Sets the default length for system generated passwords.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'security';
+		$array[$x]['default_setting_subcategory'] = 'password_strength';
+		$array[$x]['default_setting_name'] = 'var';
+		$array[$x]['default_setting_value'] = '4';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the default strength for system generated passwords.  Valid Options: 1 - Numeric Only, 2 - Include Lower Apha, 3 - Include Upper Alpha, 4 - Include Special Characters.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'security';
+		$array[$x]['default_setting_subcategory'] = 'session_rotate';
+		$array[$x]['default_setting_name'] = 'boolean';
+		$array[$x]['default_setting_value'] = 'true';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Whether to regenerate the session ID.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'email';
+		$array[$x]['default_setting_subcategory'] = 'smtp_auth';
+		$array[$x]['default_setting_name'] = 'var';
+		$array[$x]['default_setting_value'] = 'true';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = '';
+		$x++;
+		$array[$x]['default_setting_category'] = 'email';
+		$array[$x]['default_setting_subcategory'] = 'smtp_from';
+		$array[$x]['default_setting_name'] = 'var';
+		$array[$x]['default_setting_value'] = '';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = '';
+		$x++;
+		$array[$x]['default_setting_category'] = 'email';
+		$array[$x]['default_setting_subcategory'] = 'smtp_from_name';
+		$array[$x]['default_setting_name'] = 'var';
+		$array[$x]['default_setting_value'] = '';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = '';
+		$x++;
+		$array[$x]['default_setting_category'] = 'email';
+		$array[$x]['default_setting_subcategory'] = 'smtp_host';
+		$array[$x]['default_setting_name'] = 'var';
+		$array[$x]['default_setting_value'] = '';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = '';
+		$x++;
+		$array[$x]['default_setting_category'] = 'email';
+		$array[$x]['default_setting_subcategory'] = 'smtp_username';
+		$array[$x]['default_setting_name'] = 'var';
+		$array[$x]['default_setting_value'] = '';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = '';
+		$x++;
+		$array[$x]['default_setting_category'] = 'email';
+		$array[$x]['default_setting_subcategory'] = 'smtp_password';
+		$array[$x]['default_setting_name'] = 'var';
+		$array[$x]['default_setting_value'] = '';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = '';
+		$x++;
+		$array[$x]['default_setting_category'] = 'email';
+		$array[$x]['default_setting_subcategory'] = 'smtp_secure';
+		$array[$x]['default_setting_name'] = 'var';
+		$array[$x]['default_setting_value'] = 'true';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = '';
+		$x++;
+		$array[$x]['default_setting_category'] = 'login';
+		$array[$x]['default_setting_subcategory'] = 'password_reset_key';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = generate_password('20', '4');
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Display a Reset Password link on the login box (requires smtp_host be defined).';
+		$x++;
+		$array[$x]['default_setting_category'] = 'login';
+		$array[$x]['default_setting_subcategory'] = 'domain_name_visible';
+		$array[$x]['default_setting_name'] = 'boolean';
+		$array[$x]['default_setting_value'] = 'true';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Displays a domain input or select box (if domain_name array defined) on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'login';
+		$array[$x]['default_setting_subcategory'] = 'domain_name';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'pbx1.yourdomain.com';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Domain select option displayed on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'admin';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'voicemail';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Voicemail block for users in the admin group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'admin';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'missed';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Missed Calls block for users in the admin group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'admin';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'recent';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Recent Calls block for users in the admin group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'admin';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'limits';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Domain Limits block for users in the admin group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'admin';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'counts';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Domain Counts block for users in the admin group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'admin';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'call_routing';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Call Routing controls for users in the admin group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'admin';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'ring_groups';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Ring Group Forwarding controls for users in the admin group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'superadmin';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'voicemail';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Voicemail block for users in the superadmin group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'superadmin';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'missed';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Missed Calls block for users in the superadmin group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'superadmin';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'recent';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Recent Calls block for users in the superadmin group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'superadmin';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'limits';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Domain Limits block for users in the superadmin group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'superadmin';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'counts';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard System Counts block for users in the superadmin group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'superadmin';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'system';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard System Status block for users in the superadmin group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'superadmin';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'call_routing';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Call Routing controls for users in the superadmin group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'superadmin';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'ring_groups';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Ring Group Forwarding controls for users in the superadmin group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'user';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'voicemail';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Voicemail block for users in the users group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'user';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'missed';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Missed Calls block for users in the users group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'user';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'recent';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Recent Calls block for users in the users group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'user';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'call_routing';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Call Routing controls for users in the users group.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'dashboard';
+		$array[$x]['default_setting_subcategory'] = 'user';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = 'ring_groups';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Enable Dashboard Ring Group Forwarding controls for users in the users group.';
+
+	//get an array of the default settings
+		$sql = "select * from v_default_settings ";
+		$prep_statement = $db->prepare($sql);
+		$prep_statement->execute();
+		$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+		unset ($prep_statement, $sql);
+
+	//find the missing default settings
+		$x = 0;
+		foreach ($array as $setting) {
+			$found = false;
+			$missing[$x] = $setting;
+			foreach ($default_settings as $row) {
+				if (trim($row['default_setting_subcategory']) == trim($setting['default_setting_subcategory'])) {
+					$found = true;
+					//remove items from the array that were found
+					unset($missing[$x]);
+				}
+			}
+			$x++;
+		}
+
+	//get the missing count
+		$i = 0;
+		foreach ($missing as $row) { $i++; }
+		$missing_count = $i;
+
+	//add the missing default settings
+		$sql = "insert into v_default_settings (";
+		$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 .= ") values \n";
+		$i = 1;
+		foreach ($missing as $row) {
+			$sql .= "(";
+			$sql .= "'".uuid()."', ";
+			$sql .= "'".check_str($row['default_setting_category'])."', ";
+			$sql .= "'".check_str($row['default_setting_subcategory'])."', ";
+			$sql .= "'".check_str($row['default_setting_name'])."', ";
+			$sql .= "'".check_str($row['default_setting_value'])."', ";
+			$sql .= "'".check_str($row['default_setting_enabled'])."', ";
+			$sql .= "'".check_str($row['default_setting_description'])."' ";
+			$sql .= ")";
+			if ($missing_count != $i) { 
+				$sql .= ",\n";
+			}
+			$i++;
+		}
+		$db->exec(check_sql($sql));
+		unset($missing);
+
+	//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'), ";
+				$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);
+		}
+
+}
+
 ?>

+ 432 - 432
core/default_settings/app_languages.php

@@ -1,433 +1,433 @@
-<?php
-
-$text['title-default_settings']['en-us'] = "Default Settings";
-$text['title-default_settings']['es-cl'] = "Condiciones Predeterminadas";
-$text['title-default_settings']['pt-pt'] = "Predefinições";
-$text['title-default_settings']['fr-fr'] = "Configurations par Défaut";
-$text['title-default_settings']['nl-nl'] = "";
-$text['title-default_settings']['pt-br'] = "Configurações";
-$text['title-default_settings']['pl'] = "Ustawienia domyślne";
-$text['title-default_settings']['sv-se'] = "Standard Inställningar";
-$text['title-default_settings']['uk'] = "Налаштування за замовчуванням";
-$text['title-default_settings']['de-at'] = "Standardeinstellungen";
-
-$text['title-default_setting-edit']['en-us'] = "Default Setting";
-$text['title-default_setting-edit']['es-cl'] = "Configuraciones Predeterminadas";
-$text['title-default_setting-edit']['pt-pt'] = "Predefinições";
-$text['title-default_setting-edit']['fr-fr'] = "Configurations par Défaut";
-$text['title-default_setting-edit']['nl-nl'] = "";
-$text['title-default_setting-edit']['pt-br'] = "Configurações";
-$text['title-default_setting-edit']['pl'] = "Ustawienie domyślne";
-$text['title-default_setting-edit']['sv-se'] = "Standard Inställning";
-$text['title-default_setting-edit']['uk'] = "Налаштування за замовчуванням";
-$text['title-default_setting-edit']['de-at'] = "Standardeinstellungen";
-
-$text['title-default_setting-add']['en-us'] = "Default Setting Add";
-$text['title-default_setting-add']['es-cl'] = "Agregar Configuración Predeterminada";
-$text['title-default_setting-add']['pt-pt'] = "Adicionar Predefinição";
-$text['title-default_setting-add']['fr-fr'] = "Ajouter une configuration per défaut";
-$text['title-default_setting-add']['nl-nl'] = "";
-$text['title-default_setting-add']['pt-br'] = "Adicionar Configurações";
-$text['title-default_setting-add']['pl'] = "Dodaj ustawienie domyślne";
-$text['title-default_setting-add']['sv-se'] = "Lägg Till Standard Inställning";
-$text['title-default_setting-add']['uk'] = "";
-$text['title-default_setting-add']['de-at'] = "Standardeinstellungen";
-
-$text['option-voicemail_file_listen']['en-us'] = "Listen Link (Login Required)";
-$text['option-voicemail_file_listen']['es-cl'] = "Escuchar Link (Se requiere entrar)";
-$text['option-voicemail_file_listen']['pt-pt'] = "Ouça Link (login requerido)";
-$text['option-voicemail_file_listen']['fr-fr'] = "Écouter Link (Connexion requise)";
-$text['option-voicemail_file_listen']['nl-nl'] = "";
-$text['option-voicemail_file_listen']['pt-br'] = "Arquivo Voicemail";
-$text['option-voicemail_file_listen']['pl'] = "Link do odsłuchu (po zalogowaniu)";
-$text['option-voicemail_file_listen']['sv-se'] = "Lyssna-länk (Måste Logga In)";
-$text['option-voicemail_file_listen']['uk'] = "Посилання на прослуховування (Входити обов’язково)";
-$text['option-voicemail_file_listen']['de-at'] = "Link zur Nachricht (Login erforderlich)";
-
-$text['option-voicemail_file_link']['en-us'] = "Download Link (No Login Required)";
-$text['option-voicemail_file_link']['es-cl'] = "Enlace de descarga (No se requiere conexión)";
-$text['option-voicemail_file_link']['pt-pt'] = "Link para download (Não é necessário login)";
-$text['option-voicemail_file_link']['fr-fr'] = "Lien de téléchargement (Connexion non requise)";
-$text['option-voicemail_file_link']['nl-nl'] = "";
-$text['option-voicemail_file_link']['pt-br'] = "Link para download (Não é necessário login)";
-$text['option-voicemail_file_link']['pl'] = "Link do pobrania (logowanie nie jest wymagane)";
-$text['option-voicemail_file_link']['sv-se'] = "Nedladdnings-länk (Ingen Inloggning Krävs)";
-$text['option-voicemail_file_link']['uk'] = "Посилання на завантаження (Входити не обов’язково)";
-$text['option-voicemail_file_link']['de-at'] = "Link zur Nachricht (kein Login erforderlich)";
-
-$text['option-voicemail_file_attach']['en-us'] = "Audio File Attachment";
-$text['option-voicemail_file_attach']['es-cl'] = "Archivo Adjunto Audio";
-$text['option-voicemail_file_attach']['pt-pt'] = "Anexo de arquivo de áudio";
-$text['option-voicemail_file_attach']['fr-fr'] = "Audio File Attachment";
-$text['option-voicemail_file_attach']['nl-nl'] = "";
-$text['option-voicemail_file_attach']['pt-br'] = "Anexo de arquivo de áudio";
-$text['option-voicemail_file_attach']['pl'] = "Załącznik plik audio";
-$text['option-voicemail_file_attach']['sv-se'] = "Ljudfil Bifogad";
-$text['option-voicemail_file_attach']['uk'] = "Приєднати аудіофайл";
-$text['option-voicemail_file_attach']['de-at'] = "Audiodatei als Anhang";
-
-$text['message-toggled']['en-us'] = "Toggle Completed";
-$text['message-toggled']['es-cl'] = "Alternar Completado";
-$text['message-toggled']['pt-pt'] = "Alternar Concluído";
-$text['message-toggled']['fr-fr'] = "Basculer Terminé";
-$text['message-toggled']['pt-br'] = "Alternar Concluído";
-$text['message-toggled']['pl'] = "Przegubowe Zakończony";
-$text['message-toggled']['he'] = "הושלם Toggle";
-$text['message-toggled']['uk'] = "переключити Завершений";
-$text['message-toggled']['sv-se'] = "Växla Avslutade";
-$text['message-toggled']['de-at'] = "Toggle Completed";
-$text['message-toggled']['ro'] = "Completat toggle";
-$text['message-toggled']['fa'] = "";
-$text['message-toggled']['ar-eg'] = "الانتهاء من تبديل";
-
-$text['message-settings_reloaded']['en-us'] = "Settings Reloaded";
-$text['message-settings_reloaded']['es-cl'] = "Ajustes Reloaded";
-$text['message-settings_reloaded']['pt-pt'] = "Configurações Reloaded";
-$text['message-settings_reloaded']['fr-fr'] = "Paramètres Reloaded";
-$text['message-settings_reloaded']['nl-nl'] = "";
-$text['message-settings_reloaded']['pt-br'] = "Configurações Reloaded";
-$text['message-settings_reloaded']['pl'] = "Ustawienia Reloaded";
-$text['message-settings_reloaded']['sv-se'] = "Inställningar Reloaded";
-$text['message-settings_reloaded']['uk'] = "налаштування Reloaded";
-$text['message-settings_reloaded']['de-at'] = "Einstellungen neu geladen";
-
-$text['message-delete_failed']['en-us'] = "No Settings Checked";
-$text['message-delete_failed']['es-cl'] = "No hay ajustes facturado";
-$text['message-delete_failed']['pt-pt'] = "Nenhuma configuração marcada";
-$text['message-delete_failed']['fr-fr'] = "Pas de paramètres enregistrés";
-$text['message-delete_failed']['nl-nl'] = "";
-$text['message-delete_failed']['pt-br'] = "Falha na exclusão";
-$text['message-delete_failed']['pl'] = "Próba usunięcia zakończyła się niepowodzeniem";
-$text['message-delete_failed']['sv-se'] = "Borttagning Misslyckades";
-$text['message-delete_failed']['uk'] = "Налаштування не вказано";
-$text['message-delete_failed']['de-at'] = "Löschen fehlgeschlagen";
-
-$text['message-copy_failed']['en-us'] = "No Settings Checked or Invalid Domain";
-$text['message-copy_failed']['es-cl'] = "No hay ajustes facturado o de dominio no válido";
-$text['message-copy_failed']['pt-pt'] = "Nenhuma configuração marcada ou domínio inválido";
-$text['message-copy_failed']['fr-fr'] = "Pas de paramètres enregistrés ou domaine non valide";
-$text['message-copy_failed']['nl-nl'] = "";
-$text['message-copy_failed']['pt-br'] = "Nenhuma configuração selecionada ou dominio inválido";
-$text['message-copy_failed']['pl'] = "Nie zaznaczono ustawień lub domena jest niepoprawna";
-$text['message-copy_failed']['sv-se'] = "Ingen inställning markerad eller ogiltig domän.";
-$text['message-copy_failed']['uk'] = "";
-$text['message-copy_failed']['de-at'] = "Keine Einstellungen ausgewählt oder ungültige Domain";
-
-$text['label-top']['en-us'] = "Top";
-$text['label-top']['es-cl'] = "encima";
-$text['label-top']['pt-pt'] = "Topo";
-$text['label-top']['fr-fr'] = "Meilleur";
-$text['label-top']['pt-br'] = "Topo";
-$text['label-top']['pl'] = "Top";
-$text['label-top']['he'] = "עליון";
-$text['label-top']['uk'] = "топ";
-$text['label-top']['sv-se'] = "Topp";
-$text['label-top']['de-at'] = "Oben";
-$text['label-top']['ro'] = "Top";
-$text['label-top']['fa'] = "";
-$text['label-top']['ar-eg'] = "أعلى";
-
-$text['label-text']['en-us'] = "Text";
-$text['label-text']['es-cl'] = "Texto";
-$text['label-text']['pt-pt'] = "Texto";
-$text['label-text']['fr-fr'] = "Texte";
-$text['label-text']['pt-br'] = "Texto";
-$text['label-text']['pl'] = "Tekst";
-$text['label-text']['he'] = "טֶקסט";
-$text['label-text']['uk'] = "текст";
-$text['label-text']['sv-se'] = "Text";
-$text['label-text']['de-at'] = "Text";
-$text['label-text']['ro'] = "Text";
-$text['label-text']['fa'] = "";
-$text['label-text']['ar-eg'] = "نص";
-
-$text['label-superfine']['en-us'] = "Superfine";
-$text['label-superfine']['es-cl'] = "Superfino";
-$text['label-superfine']['pt-pt'] = "Extrafino";
-$text['label-superfine']['fr-fr'] = "Superfin";
-$text['label-superfine']['nl-nl'] = "";
-$text['label-superfine']['pt-br'] = "Resumido";
-$text['label-superfine']['pl'] = "Najlepsza";
-$text['label-superfine']['sv-se'] = "Superfin";
-$text['label-superfine']['uk'] = "";
-$text['label-superfine']['de-at'] = "Superfein";
-
-$text['label-static']['en-us'] = "Static";
-$text['label-static']['es-cl'] = "Estático";
-$text['label-static']['pt-pt'] = "Estático";
-$text['label-static']['fr-fr'] = "Statique";
-$text['label-static']['pt-br'] = "Estático";
-$text['label-static']['pl'] = "Statyczny";
-$text['label-static']['he'] = "סטָטִי";
-$text['label-static']['uk'] = "статичний";
-$text['label-static']['sv-se'] = "Statisk";
-$text['label-static']['de-at'] = "Statisch";
-$text['label-static']['ro'] = "Static";
-$text['label-static']['fa'] = "";
-$text['label-static']['ar-eg'] = "ساكن";
-
-$text['label-right']['en-us'] = "Right";
-$text['label-right']['es-cl'] = "Derecha";
-$text['label-right']['pt-pt'] = "Certo";
-$text['label-right']['fr-fr'] = "Droite";
-$text['label-right']['pt-br'] = "Certo";
-$text['label-right']['pl'] = "Dobrze";
-$text['label-right']['he'] = "יָמִינָה";
-$text['label-right']['uk'] = "правий";
-$text['label-right']['sv-se'] = "Höger";
-$text['label-right']['de-at'] = "Recht";
-$text['label-right']['ro'] = "Dreapta";
-$text['label-right']['fa'] = "";
-$text['label-right']['ar-eg'] = "حق";
-
-$text['label-normal']['en-us'] = "Normal";
-$text['label-normal']['es-cl'] = "Normal";
-$text['label-normal']['pt-pt'] = "Normal";
-$text['label-normal']['fr-fr'] = "Normal";
-$text['label-normal']['nl-nl'] = "";
-$text['label-normal']['pt-br'] = "Normal";
-$text['label-normal']['pl'] = "Normalny";
-$text['label-normal']['sv-se'] = "normal";
-$text['label-normal']['uk'] = "звичайно";
-$text['label-normal']['de-at'] = "normal";
-
-$text['label-none']['en-us'] = "None";
-$text['label-none']['es-cl'] = "Ninguna";
-$text['label-none']['pt-pt'] = "Nenhum";
-$text['label-none']['fr-fr'] = "Aucun";
-$text['label-none']['pt-br'] = "Nenhum";
-$text['label-none']['pl'] = "Żaden";
-$text['label-none']['he'] = "אף לא אחד";
-$text['label-none']['uk'] = "жоден";
-$text['label-none']['sv-se'] = "Ingen";
-$text['label-none']['de-at'] = "Keiner";
-$text['label-none']['ro'] = "Nici unul";
-$text['label-none']['fa'] = "";
-$text['label-none']['ar-eg'] = "لا شيء";
-
-$text['label-left']['en-us'] = "Left";
-$text['label-left']['es-cl'] = "Izquierda";
-$text['label-left']['pt-pt'] = "Esquerda";
-$text['label-left']['fr-fr'] = "À gauche";
-$text['label-left']['pt-br'] = "Esquerda";
-$text['label-left']['pl'] = "Lewo";
-$text['label-left']['he'] = "שְׁמֹאל";
-$text['label-left']['uk'] = "лівий";
-$text['label-left']['sv-se'] = "Vänster";
-$text['label-left']['de-at'] = "Links";
-$text['label-left']['ro'] = "Stânga";
-$text['label-left']['fa'] = "";
-$text['label-left']['ar-eg'] = "اليسار";
-
-$text['label-inline']['en-us'] = "Inline";
-$text['label-inline']['es-cl'] = "En línea";
-$text['label-inline']['pt-pt'] = "Na linha";
-$text['label-inline']['fr-fr'] = "En ligne";
-$text['label-inline']['pt-br'] = "Na linha";
-$text['label-inline']['pl'] = "inline";
-$text['label-inline']['he'] = "בשורה";
-$text['label-inline']['uk'] = "В лінію";
-$text['label-inline']['sv-se'] = "I kö";
-$text['label-inline']['de-at'] = "In der Reihe";
-$text['label-inline']['ro'] = "In linie";
-$text['label-inline']['fa'] = "";
-$text['label-inline']['ar-eg'] = "في النسق";
-
-$text['label-image']['en-us'] = "Image";
-$text['label-image']['es-cl'] = "Imagen";
-$text['label-image']['pt-pt'] = "Imagem";
-$text['label-image']['fr-fr'] = "image";
-$text['label-image']['pt-br'] = "Imagem";
-$text['label-image']['pl'] = "Obraz";
-$text['label-image']['he'] = "תמונה";
-$text['label-image']['uk'] = "зображення";
-$text['label-image']['sv-se'] = "Bild";
-$text['label-image']['de-at'] = "Image";
-$text['label-image']['ro'] = "Imagine";
-$text['label-image']['fa'] = "";
-$text['label-image']['ar-eg'] = "صورة";
-
-$text['label-fixed']['en-us'] = "Fixed";
-$text['label-fixed']['es-cl'] = "Fijo";
-$text['label-fixed']['pt-pt'] = "Fixo";
-$text['label-fixed']['fr-fr'] = "Fixé";
-$text['label-fixed']['pt-br'] = "Fixo";
-$text['label-fixed']['pl'] = "Naprawiony";
-$text['label-fixed']['he'] = "קָבוּעַ";
-$text['label-fixed']['uk'] = "фіксований";
-$text['label-fixed']['sv-se'] = "Fast";
-$text['label-fixed']['de-at'] = "fest";
-$text['label-fixed']['ro'] = "Fix";
-$text['label-fixed']['fa'] = "";
-$text['label-fixed']['ar-eg'] = "ثابت";
-
-$text['label-fine']['en-us'] = "Fine";
-$text['label-fine']['es-cl'] = "Fine";
-$text['label-fine']['pt-pt'] = "Belas";
-$text['label-fine']['fr-fr'] = "Fin";
-$text['label-fine']['nl-nl'] = "";
-$text['label-fine']['pt-br'] = "Agradável ";
-$text['label-fine']['pl'] = "Dobry";
-$text['label-fine']['sv-se'] = "Fin";
-$text['label-fine']['uk'] = "";
-$text['label-fine']['de-at'] = "Fein";
-
-$text['label-center']['en-us'] = "Center";
-$text['label-center']['es-cl'] = "Centrar";
-$text['label-center']['pt-pt'] = "Centro";
-$text['label-center']['fr-fr'] = "centre";
-$text['label-center']['pt-br'] = "Centro";
-$text['label-center']['pl'] = "Centrum";
-$text['label-center']['he'] = "מֶרְכָּז";
-$text['label-center']['uk'] = "центр";
-$text['label-center']['sv-se'] = "Centrum";
-$text['label-center']['de-at'] = "Center";
-$text['label-center']['ro'] = "Centru";
-$text['label-center']['fa'] = "";
-$text['label-center']['ar-eg'] = "مركز";
-
-$text['label-bottom']['en-us'] = "Bottom";
-$text['label-bottom']['es-cl'] = "Fondo";
-$text['label-bottom']['pt-pt'] = "Inferior";
-$text['label-bottom']['fr-fr'] = "Bas";
-$text['label-bottom']['pt-br'] = "Inferior";
-$text['label-bottom']['pl'] = "Dolny";
-$text['label-bottom']['he'] = "תַחתִית";
-$text['label-bottom']['uk'] = "дно";
-$text['label-bottom']['sv-se'] = "Botten";
-$text['label-bottom']['de-at'] = "Boden";
-$text['label-bottom']['ro'] = "Fund";
-$text['label-bottom']['fa'] = "";
-$text['label-bottom']['ar-eg'] = "أسفل";
-
-$text['label-24-hour']['en-us'] = "24-Hour";
-$text['label-24-hour']['es-cl'] = "24 horas";
-$text['label-24-hour']['pt-pt'] = "24 horas";
-$text['label-24-hour']['fr-fr'] = "24 heures";
-$text['label-24-hour']['pt-br'] = "24 horas";
-$text['label-24-hour']['pl'] = "24-godzinny";
-$text['label-24-hour']['he'] = "24 שעות";
-$text['label-24-hour']['uk'] = "24-годинний";
-$text['label-24-hour']['sv-se'] = "24-timmars";
-$text['label-24-hour']['de-at'] = "24 Stunden";
-$text['label-24-hour']['ro'] = "24 de ore";
-$text['label-24-hour']['fa'] = "";
-$text['label-24-hour']['ar-eg'] = "24 ساعة";
-
-$text['label-12-hour']['en-us'] = "12-Hour";
-$text['label-12-hour']['es-cl'] = "12 horas";
-$text['label-12-hour']['pt-pt'] = "12 horas";
-$text['label-12-hour']['fr-fr'] = "12 heures";
-$text['label-12-hour']['pt-br'] = "12 horas";
-$text['label-12-hour']['pl'] = "12-godzinny";
-$text['label-12-hour']['he'] = "12 שעות";
-$text['label-12-hour']['uk'] = "12-годинний";
-$text['label-12-hour']['sv-se'] = "12-timmars";
-$text['label-12-hour']['de-at'] = "12 Stunden";
-$text['label-12-hour']['ro'] = "12 de ore";
-$text['label-12-hour']['fa'] = "";
-$text['label-12-hour']['ar-eg'] = "12 ساعة";
-
-$text['header-default_settings']['en-us'] = "Default Settings";
-$text['header-default_settings']['es-cl'] = "Condiciones Predeterminadas";
-$text['header-default_settings']['pt-pt'] = "Predefinições";
-$text['header-default_settings']['fr-fr'] = "Configurations par Défaut";
-$text['header-default_settings']['nl-nl'] = "";
-$text['header-default_settings']['pt-br'] = "Configurações";
-$text['header-default_settings']['pl'] = "Ustawienia domyślne";
-$text['header-default_settings']['sv-se'] = "Standard Inställningar";
-$text['header-default_settings']['uk'] = "";
-$text['header-default_settings']['de-at'] = "Standard Einstellungen";
-
-$text['header-default_setting-edit']['en-us'] = "Default Setting";
-$text['header-default_setting-edit']['es-cl'] = "Configuraciones Predeterminadas";
-$text['header-default_setting-edit']['pt-pt'] = "Predefinições";
-$text['header-default_setting-edit']['fr-fr'] = "Configurations par Défaut";
-$text['header-default_setting-edit']['nl-nl'] = "";
-$text['header-default_setting-edit']['pt-br'] = "Configurações";
-$text['header-default_setting-edit']['pl'] = "Ustawienie domyślne";
-$text['header-default_setting-edit']['sv-se'] = "Standard Inställning";
-$text['header-default_setting-edit']['uk'] = "";
-$text['header-default_setting-edit']['de-at'] = "Standard Einstellungen";
-
-$text['header-default_setting-add']['en-us'] = "Default Setting Add";
-$text['header-default_setting-add']['es-cl'] = "Agregar Configuración Predeterminada";
-$text['header-default_setting-add']['pt-pt'] = "Adicionar Predefinição ";
-$text['header-default_setting-add']['fr-fr'] = "Ajouter une configuration per défaut";
-$text['header-default_setting-add']['nl-nl'] = "";
-$text['header-default_setting-add']['pt-br'] = "Adicionar configurações";
-$text['header-default_setting-add']['pl'] = "Dodaj ustawienie domyślne";
-$text['header-default_setting-add']['sv-se'] = "Lägg Till Standard Inställning";
-$text['header-default_setting-add']['uk'] = "";
-$text['header-default_setting-add']['de-at'] = "Standard Einstellungen hinzufügen";
-
-$text['description-order']['en-us'] = "Set the order (index) for this array element.";
-$text['description-order']['es-cl'] = "Establecer el orden (índice) para este elemento de la matriz.";
-$text['description-order']['pt-pt'] = "Defina a ordem (índice) para este elemento da matriz.";
-$text['description-order']['fr-fr'] = "Définir l'ordre (index) pour cet élément de tableau.";
-$text['description-order']['nl-nl'] = "";
-$text['description-order']['pt-br'] = "Defina a ordem (indice) para este elemento da matriz";
-$text['description-order']['pl'] = "Wybierz kolejność.";
-$text['description-order']['sv-se'] = "Ställ in ordningen (index) för detta element.";
-$text['description-order']['uk'] = "";
-$text['description-order']['de-at'] = "Wählen Sie die Reihenfolge (Index) für das Array Element.";
-
-$text['description-enabled']['en-us'] = "Set the status of this default setting.";
-$text['description-enabled']['es-cl'] = "Ingrese el estado de esta configuración.";
-$text['description-enabled']['pt-pt'] = "Escolha o estado desta predefinição.";
-$text['description-enabled']['fr-fr'] = "Choisir l'état de ce paraètre";
-$text['description-enabled']['nl-nl'] = "";
-$text['description-enabled']['pt-br'] = "Escolha o estado desta definição";
-$text['description-enabled']['pl'] = "Ustaw status ustawienia domyślnego.";
-$text['description-enabled']['sv-se'] = "Välj status på denna standardinställning.";
-$text['description-enabled']['uk'] = "";
-$text['description-enabled']['de-at'] = "Setzen Sie den Status dieser Standardeinstellung.";
-
-$text['description-default_settings']['en-us'] = "Settings used for all domains.";
-$text['description-default_settings']['es-cl'] = "Configuraciones usadas por todos los dominios";
-$text['description-default_settings']['pt-pt'] = "Definições comuns a todos os domínios.";
-$text['description-default_settings']['fr-fr'] = "Configurations communes à tous les domaines.";
-$text['description-default_settings']['nl-nl'] = "";
-$text['description-default_settings']['pt-br'] = "Configurações comuns a todos os dominios";
-$text['description-default_settings']['pl'] = "Ustawienia stosowane dla wszystkich domen.";
-$text['description-default_settings']['sv-se'] = "Inställning används för alla domäner.";
-$text['description-default_settings']['uk'] = "Налаштування використовується для всіх доменів";
-$text['description-default_settings']['de-at'] = "Einstellungen für alle Domains.";
-
-$text['description-default_setting-edit']['en-us'] = "Settings used for all domains.";
-$text['description-default_setting-edit']['es-cl'] = "Configuraciones usadas para todos los dominios.";
-$text['description-default_setting-edit']['pt-pt'] = "Definições comuns a todos os domínios.";
-$text['description-default_setting-edit']['fr-fr'] = "Configurations communes à tous les domaines";
-$text['description-default_setting-edit']['nl-nl'] = "";
-$text['description-default_setting-edit']['pt-br'] = "Configurações comuns a todos os dominios";
-$text['description-default_setting-edit']['pl'] = "Ustawienia stosowane dla wszystkich domen.";
-$text['description-default_setting-edit']['sv-se'] = "Inställning används för alla domäner.";
-$text['description-default_setting-edit']['uk'] = "Налаштування використовується для всіх доменів";
-$text['description-default_setting-edit']['de-at'] = "Einstellungen für alle Domains.";
-
-$text['description-default_setting-add']['en-us'] = "Settings used for all domains.";
-$text['description-default_setting-add']['es-cl'] = "Configuraciones usadas para todos los dominios.";
-$text['description-default_setting-add']['pt-pt'] = "Definições comuns a todos os domínios.";
-$text['description-default_setting-add']['fr-fr'] = "Configurations communes à tous les domaines";
-$text['description-default_setting-add']['nl-nl'] = "";
-$text['description-default_setting-add']['pt-br'] = "Configurações comuns a todos os dominio";
-$text['description-default_setting-add']['pl'] = "Ustawienia stosowane dla wszystkich domen.";
-$text['description-default_setting-add']['sv-se'] = "Inställning används för alla domäner.";
-$text['description-default_setting-add']['uk'] = "Налаштування використовується для всіх доменів";
-$text['description-default_setting-add']['de-at'] = "Einstellungen für alle Domains.";
-
-$text['button-toggle']['en-us'] = "Toggle";
-$text['button-toggle']['es-cl'] = "Palanca";
-$text['button-toggle']['pt-pt'] = "Alternar";
-$text['button-toggle']['fr-fr'] = "Basculer";
-$text['button-toggle']['pt-br'] = "Alternar";
-$text['button-toggle']['pl'] = "Przełącznik";
-$text['button-toggle']['he'] = "לְמַתֵג";
-$text['button-toggle']['uk'] = "тумблер";
-$text['button-toggle']['sv-se'] = "toggle";
-$text['button-toggle']['de-at'] = "Umschalten";
-$text['button-toggle']['ro'] = "Comutare";
-$text['button-toggle']['fa'] = "";
-$text['button-toggle']['ar-eg'] = "تبديل";
-
+<?php
+
+$text['title-default_settings']['en-us'] = "Default Settings";
+$text['title-default_settings']['es-cl'] = "Condiciones Predeterminadas";
+$text['title-default_settings']['pt-pt'] = "Predefinições";
+$text['title-default_settings']['fr-fr'] = "Configurations par Défaut";
+$text['title-default_settings']['nl-nl'] = "";
+$text['title-default_settings']['pt-br'] = "Configurações";
+$text['title-default_settings']['pl'] = "Ustawienia domyślne";
+$text['title-default_settings']['sv-se'] = "Standard Inställningar";
+$text['title-default_settings']['uk'] = "Налаштування за замовчуванням";
+$text['title-default_settings']['de-at'] = "Standardeinstellungen";
+
+$text['title-default_setting-edit']['en-us'] = "Default Setting";
+$text['title-default_setting-edit']['es-cl'] = "Configuraciones Predeterminadas";
+$text['title-default_setting-edit']['pt-pt'] = "Predefinições";
+$text['title-default_setting-edit']['fr-fr'] = "Configurations par Défaut";
+$text['title-default_setting-edit']['nl-nl'] = "";
+$text['title-default_setting-edit']['pt-br'] = "Configurações";
+$text['title-default_setting-edit']['pl'] = "Ustawienie domyślne";
+$text['title-default_setting-edit']['sv-se'] = "Standard Inställning";
+$text['title-default_setting-edit']['uk'] = "Налаштування за замовчуванням";
+$text['title-default_setting-edit']['de-at'] = "Standardeinstellungen";
+
+$text['title-default_setting-add']['en-us'] = "Default Setting Add";
+$text['title-default_setting-add']['es-cl'] = "Agregar Configuración Predeterminada";
+$text['title-default_setting-add']['pt-pt'] = "Adicionar Predefinição";
+$text['title-default_setting-add']['fr-fr'] = "Ajouter une configuration per défaut";
+$text['title-default_setting-add']['nl-nl'] = "";
+$text['title-default_setting-add']['pt-br'] = "Adicionar Configurações";
+$text['title-default_setting-add']['pl'] = "Dodaj ustawienie domyślne";
+$text['title-default_setting-add']['sv-se'] = "Lägg Till Standard Inställning";
+$text['title-default_setting-add']['uk'] = "";
+$text['title-default_setting-add']['de-at'] = "Standardeinstellungen";
+
+$text['option-voicemail_file_listen']['en-us'] = "Listen Link (Login Required)";
+$text['option-voicemail_file_listen']['es-cl'] = "Escuchar Link (Se requiere entrar)";
+$text['option-voicemail_file_listen']['pt-pt'] = "Ouça Link (login requerido)";
+$text['option-voicemail_file_listen']['fr-fr'] = "Écouter Link (Connexion requise)";
+$text['option-voicemail_file_listen']['nl-nl'] = "";
+$text['option-voicemail_file_listen']['pt-br'] = "Arquivo Voicemail";
+$text['option-voicemail_file_listen']['pl'] = "Link do odsłuchu (po zalogowaniu)";
+$text['option-voicemail_file_listen']['sv-se'] = "Lyssna-länk (Måste Logga In)";
+$text['option-voicemail_file_listen']['uk'] = "Посилання на прослуховування (Входити обов’язково)";
+$text['option-voicemail_file_listen']['de-at'] = "Link zur Nachricht (Login erforderlich)";
+
+$text['option-voicemail_file_link']['en-us'] = "Download Link (No Login Required)";
+$text['option-voicemail_file_link']['es-cl'] = "Enlace de descarga (No se requiere conexión)";
+$text['option-voicemail_file_link']['pt-pt'] = "Link para download (Não é necessário login)";
+$text['option-voicemail_file_link']['fr-fr'] = "Lien de téléchargement (Connexion non requise)";
+$text['option-voicemail_file_link']['nl-nl'] = "";
+$text['option-voicemail_file_link']['pt-br'] = "Link para download (Não é necessário login)";
+$text['option-voicemail_file_link']['pl'] = "Link do pobrania (logowanie nie jest wymagane)";
+$text['option-voicemail_file_link']['sv-se'] = "Nedladdnings-länk (Ingen Inloggning Krävs)";
+$text['option-voicemail_file_link']['uk'] = "Посилання на завантаження (Входити не обов’язково)";
+$text['option-voicemail_file_link']['de-at'] = "Link zur Nachricht (kein Login erforderlich)";
+
+$text['option-voicemail_file_attach']['en-us'] = "Audio File Attachment";
+$text['option-voicemail_file_attach']['es-cl'] = "Archivo Adjunto Audio";
+$text['option-voicemail_file_attach']['pt-pt'] = "Anexo de arquivo de áudio";
+$text['option-voicemail_file_attach']['fr-fr'] = "Audio File Attachment";
+$text['option-voicemail_file_attach']['nl-nl'] = "";
+$text['option-voicemail_file_attach']['pt-br'] = "Anexo de arquivo de áudio";
+$text['option-voicemail_file_attach']['pl'] = "Załącznik plik audio";
+$text['option-voicemail_file_attach']['sv-se'] = "Ljudfil Bifogad";
+$text['option-voicemail_file_attach']['uk'] = "Приєднати аудіофайл";
+$text['option-voicemail_file_attach']['de-at'] = "Audiodatei als Anhang";
+
+$text['message-toggled']['en-us'] = "Toggle Completed";
+$text['message-toggled']['es-cl'] = "Alternar Completado";
+$text['message-toggled']['pt-pt'] = "Alternar Concluído";
+$text['message-toggled']['fr-fr'] = "Basculer Terminé";
+$text['message-toggled']['pt-br'] = "Alternar Concluído";
+$text['message-toggled']['pl'] = "Przegubowe Zakończony";
+$text['message-toggled']['he'] = "הושלם Toggle";
+$text['message-toggled']['uk'] = "переключити Завершений";
+$text['message-toggled']['sv-se'] = "Växla Avslutade";
+$text['message-toggled']['de-at'] = "Toggle Completed";
+$text['message-toggled']['ro'] = "Completat toggle";
+$text['message-toggled']['fa'] = "";
+$text['message-toggled']['ar-eg'] = "الانتهاء من تبديل";
+
+$text['message-settings_reloaded']['en-us'] = "Settings Reloaded";
+$text['message-settings_reloaded']['es-cl'] = "Ajustes Reloaded";
+$text['message-settings_reloaded']['pt-pt'] = "Configurações Reloaded";
+$text['message-settings_reloaded']['fr-fr'] = "Paramètres Reloaded";
+$text['message-settings_reloaded']['nl-nl'] = "";
+$text['message-settings_reloaded']['pt-br'] = "Configurações Reloaded";
+$text['message-settings_reloaded']['pl'] = "Ustawienia Reloaded";
+$text['message-settings_reloaded']['sv-se'] = "Inställningar Reloaded";
+$text['message-settings_reloaded']['uk'] = "налаштування Reloaded";
+$text['message-settings_reloaded']['de-at'] = "Einstellungen neu geladen";
+
+$text['message-delete_failed']['en-us'] = "No Settings Checked";
+$text['message-delete_failed']['es-cl'] = "No hay ajustes facturado";
+$text['message-delete_failed']['pt-pt'] = "Nenhuma configuração marcada";
+$text['message-delete_failed']['fr-fr'] = "Pas de paramètres enregistrés";
+$text['message-delete_failed']['nl-nl'] = "";
+$text['message-delete_failed']['pt-br'] = "Falha na exclusão";
+$text['message-delete_failed']['pl'] = "Próba usunięcia zakończyła się niepowodzeniem";
+$text['message-delete_failed']['sv-se'] = "Borttagning Misslyckades";
+$text['message-delete_failed']['uk'] = "Налаштування не вказано";
+$text['message-delete_failed']['de-at'] = "Löschen fehlgeschlagen";
+
+$text['message-copy_failed']['en-us'] = "No Settings Checked or Invalid Domain";
+$text['message-copy_failed']['es-cl'] = "No hay ajustes facturado o de dominio no válido";
+$text['message-copy_failed']['pt-pt'] = "Nenhuma configuração marcada ou domínio inválido";
+$text['message-copy_failed']['fr-fr'] = "Pas de paramètres enregistrés ou domaine non valide";
+$text['message-copy_failed']['nl-nl'] = "";
+$text['message-copy_failed']['pt-br'] = "Nenhuma configuração selecionada ou dominio inválido";
+$text['message-copy_failed']['pl'] = "Nie zaznaczono ustawień lub domena jest niepoprawna";
+$text['message-copy_failed']['sv-se'] = "Ingen inställning markerad eller ogiltig domän.";
+$text['message-copy_failed']['uk'] = "";
+$text['message-copy_failed']['de-at'] = "Keine Einstellungen ausgewählt oder ungültige Domain";
+
+$text['label-top']['en-us'] = "Top";
+$text['label-top']['es-cl'] = "encima";
+$text['label-top']['pt-pt'] = "Topo";
+$text['label-top']['fr-fr'] = "Meilleur";
+$text['label-top']['pt-br'] = "Topo";
+$text['label-top']['pl'] = "Top";
+$text['label-top']['he'] = "עליון";
+$text['label-top']['uk'] = "топ";
+$text['label-top']['sv-se'] = "Topp";
+$text['label-top']['de-at'] = "Oben";
+$text['label-top']['ro'] = "Top";
+$text['label-top']['fa'] = "";
+$text['label-top']['ar-eg'] = "أعلى";
+
+$text['label-text']['en-us'] = "Text";
+$text['label-text']['es-cl'] = "Texto";
+$text['label-text']['pt-pt'] = "Texto";
+$text['label-text']['fr-fr'] = "Texte";
+$text['label-text']['pt-br'] = "Texto";
+$text['label-text']['pl'] = "Tekst";
+$text['label-text']['he'] = "טֶקסט";
+$text['label-text']['uk'] = "текст";
+$text['label-text']['sv-se'] = "Text";
+$text['label-text']['de-at'] = "Text";
+$text['label-text']['ro'] = "Text";
+$text['label-text']['fa'] = "";
+$text['label-text']['ar-eg'] = "نص";
+
+$text['label-superfine']['en-us'] = "Superfine";
+$text['label-superfine']['es-cl'] = "Superfino";
+$text['label-superfine']['pt-pt'] = "Extrafino";
+$text['label-superfine']['fr-fr'] = "Superfin";
+$text['label-superfine']['nl-nl'] = "";
+$text['label-superfine']['pt-br'] = "Resumido";
+$text['label-superfine']['pl'] = "Najlepsza";
+$text['label-superfine']['sv-se'] = "Superfin";
+$text['label-superfine']['uk'] = "";
+$text['label-superfine']['de-at'] = "Superfein";
+
+$text['label-static']['en-us'] = "Static";
+$text['label-static']['es-cl'] = "Estático";
+$text['label-static']['pt-pt'] = "Estático";
+$text['label-static']['fr-fr'] = "Statique";
+$text['label-static']['pt-br'] = "Estático";
+$text['label-static']['pl'] = "Statyczny";
+$text['label-static']['he'] = "סטָטִי";
+$text['label-static']['uk'] = "статичний";
+$text['label-static']['sv-se'] = "Statisk";
+$text['label-static']['de-at'] = "Statisch";
+$text['label-static']['ro'] = "Static";
+$text['label-static']['fa'] = "";
+$text['label-static']['ar-eg'] = "ساكن";
+
+$text['label-right']['en-us'] = "Right";
+$text['label-right']['es-cl'] = "Derecha";
+$text['label-right']['pt-pt'] = "Certo";
+$text['label-right']['fr-fr'] = "Droite";
+$text['label-right']['pt-br'] = "Certo";
+$text['label-right']['pl'] = "Dobrze";
+$text['label-right']['he'] = "יָמִינָה";
+$text['label-right']['uk'] = "правий";
+$text['label-right']['sv-se'] = "Höger";
+$text['label-right']['de-at'] = "Recht";
+$text['label-right']['ro'] = "Dreapta";
+$text['label-right']['fa'] = "";
+$text['label-right']['ar-eg'] = "حق";
+
+$text['label-normal']['en-us'] = "Normal";
+$text['label-normal']['es-cl'] = "Normal";
+$text['label-normal']['pt-pt'] = "Normal";
+$text['label-normal']['fr-fr'] = "Normal";
+$text['label-normal']['nl-nl'] = "";
+$text['label-normal']['pt-br'] = "Normal";
+$text['label-normal']['pl'] = "Normalny";
+$text['label-normal']['sv-se'] = "normal";
+$text['label-normal']['uk'] = "звичайно";
+$text['label-normal']['de-at'] = "normal";
+
+$text['label-none']['en-us'] = "None";
+$text['label-none']['es-cl'] = "Ninguna";
+$text['label-none']['pt-pt'] = "Nenhum";
+$text['label-none']['fr-fr'] = "Aucun";
+$text['label-none']['pt-br'] = "Nenhum";
+$text['label-none']['pl'] = "Żaden";
+$text['label-none']['he'] = "אף לא אחד";
+$text['label-none']['uk'] = "жоден";
+$text['label-none']['sv-se'] = "Ingen";
+$text['label-none']['de-at'] = "Keiner";
+$text['label-none']['ro'] = "Nici unul";
+$text['label-none']['fa'] = "";
+$text['label-none']['ar-eg'] = "لا شيء";
+
+$text['label-left']['en-us'] = "Left";
+$text['label-left']['es-cl'] = "Izquierda";
+$text['label-left']['pt-pt'] = "Esquerda";
+$text['label-left']['fr-fr'] = "À gauche";
+$text['label-left']['pt-br'] = "Esquerda";
+$text['label-left']['pl'] = "Lewo";
+$text['label-left']['he'] = "שְׁמֹאל";
+$text['label-left']['uk'] = "лівий";
+$text['label-left']['sv-se'] = "Vänster";
+$text['label-left']['de-at'] = "Links";
+$text['label-left']['ro'] = "Stânga";
+$text['label-left']['fa'] = "";
+$text['label-left']['ar-eg'] = "اليسار";
+
+$text['label-inline']['en-us'] = "Inline";
+$text['label-inline']['es-cl'] = "En línea";
+$text['label-inline']['pt-pt'] = "Na linha";
+$text['label-inline']['fr-fr'] = "En ligne";
+$text['label-inline']['pt-br'] = "Na linha";
+$text['label-inline']['pl'] = "inline";
+$text['label-inline']['he'] = "בשורה";
+$text['label-inline']['uk'] = "В лінію";
+$text['label-inline']['sv-se'] = "I kö";
+$text['label-inline']['de-at'] = "In der Reihe";
+$text['label-inline']['ro'] = "In linie";
+$text['label-inline']['fa'] = "";
+$text['label-inline']['ar-eg'] = "في النسق";
+
+$text['label-image']['en-us'] = "Image";
+$text['label-image']['es-cl'] = "Imagen";
+$text['label-image']['pt-pt'] = "Imagem";
+$text['label-image']['fr-fr'] = "image";
+$text['label-image']['pt-br'] = "Imagem";
+$text['label-image']['pl'] = "Obraz";
+$text['label-image']['he'] = "תמונה";
+$text['label-image']['uk'] = "зображення";
+$text['label-image']['sv-se'] = "Bild";
+$text['label-image']['de-at'] = "Image";
+$text['label-image']['ro'] = "Imagine";
+$text['label-image']['fa'] = "";
+$text['label-image']['ar-eg'] = "صورة";
+
+$text['label-fixed']['en-us'] = "Fixed";
+$text['label-fixed']['es-cl'] = "Fijo";
+$text['label-fixed']['pt-pt'] = "Fixo";
+$text['label-fixed']['fr-fr'] = "Fixé";
+$text['label-fixed']['pt-br'] = "Fixo";
+$text['label-fixed']['pl'] = "Naprawiony";
+$text['label-fixed']['he'] = "קָבוּעַ";
+$text['label-fixed']['uk'] = "фіксований";
+$text['label-fixed']['sv-se'] = "Fast";
+$text['label-fixed']['de-at'] = "fest";
+$text['label-fixed']['ro'] = "Fix";
+$text['label-fixed']['fa'] = "";
+$text['label-fixed']['ar-eg'] = "ثابت";
+
+$text['label-fine']['en-us'] = "Fine";
+$text['label-fine']['es-cl'] = "Fine";
+$text['label-fine']['pt-pt'] = "Belas";
+$text['label-fine']['fr-fr'] = "Fin";
+$text['label-fine']['nl-nl'] = "";
+$text['label-fine']['pt-br'] = "Agradável ";
+$text['label-fine']['pl'] = "Dobry";
+$text['label-fine']['sv-se'] = "Fin";
+$text['label-fine']['uk'] = "";
+$text['label-fine']['de-at'] = "Fein";
+
+$text['label-center']['en-us'] = "Center";
+$text['label-center']['es-cl'] = "Centrar";
+$text['label-center']['pt-pt'] = "Centro";
+$text['label-center']['fr-fr'] = "centre";
+$text['label-center']['pt-br'] = "Centro";
+$text['label-center']['pl'] = "Centrum";
+$text['label-center']['he'] = "מֶרְכָּז";
+$text['label-center']['uk'] = "центр";
+$text['label-center']['sv-se'] = "Centrum";
+$text['label-center']['de-at'] = "Center";
+$text['label-center']['ro'] = "Centru";
+$text['label-center']['fa'] = "";
+$text['label-center']['ar-eg'] = "مركز";
+
+$text['label-bottom']['en-us'] = "Bottom";
+$text['label-bottom']['es-cl'] = "Fondo";
+$text['label-bottom']['pt-pt'] = "Inferior";
+$text['label-bottom']['fr-fr'] = "Bas";
+$text['label-bottom']['pt-br'] = "Inferior";
+$text['label-bottom']['pl'] = "Dolny";
+$text['label-bottom']['he'] = "תַחתִית";
+$text['label-bottom']['uk'] = "дно";
+$text['label-bottom']['sv-se'] = "Botten";
+$text['label-bottom']['de-at'] = "Boden";
+$text['label-bottom']['ro'] = "Fund";
+$text['label-bottom']['fa'] = "";
+$text['label-bottom']['ar-eg'] = "أسفل";
+
+$text['label-24-hour']['en-us'] = "24-Hour";
+$text['label-24-hour']['es-cl'] = "24 horas";
+$text['label-24-hour']['pt-pt'] = "24 horas";
+$text['label-24-hour']['fr-fr'] = "24 heures";
+$text['label-24-hour']['pt-br'] = "24 horas";
+$text['label-24-hour']['pl'] = "24-godzinny";
+$text['label-24-hour']['he'] = "24 שעות";
+$text['label-24-hour']['uk'] = "24-годинний";
+$text['label-24-hour']['sv-se'] = "24-timmars";
+$text['label-24-hour']['de-at'] = "24 Stunden";
+$text['label-24-hour']['ro'] = "24 de ore";
+$text['label-24-hour']['fa'] = "";
+$text['label-24-hour']['ar-eg'] = "24 ساعة";
+
+$text['label-12-hour']['en-us'] = "12-Hour";
+$text['label-12-hour']['es-cl'] = "12 horas";
+$text['label-12-hour']['pt-pt'] = "12 horas";
+$text['label-12-hour']['fr-fr'] = "12 heures";
+$text['label-12-hour']['pt-br'] = "12 horas";
+$text['label-12-hour']['pl'] = "12-godzinny";
+$text['label-12-hour']['he'] = "12 שעות";
+$text['label-12-hour']['uk'] = "12-годинний";
+$text['label-12-hour']['sv-se'] = "12-timmars";
+$text['label-12-hour']['de-at'] = "12 Stunden";
+$text['label-12-hour']['ro'] = "12 de ore";
+$text['label-12-hour']['fa'] = "";
+$text['label-12-hour']['ar-eg'] = "12 ساعة";
+
+$text['header-default_settings']['en-us'] = "Default Settings";
+$text['header-default_settings']['es-cl'] = "Condiciones Predeterminadas";
+$text['header-default_settings']['pt-pt'] = "Predefinições";
+$text['header-default_settings']['fr-fr'] = "Configurations par Défaut";
+$text['header-default_settings']['nl-nl'] = "";
+$text['header-default_settings']['pt-br'] = "Configurações";
+$text['header-default_settings']['pl'] = "Ustawienia domyślne";
+$text['header-default_settings']['sv-se'] = "Standard Inställningar";
+$text['header-default_settings']['uk'] = "";
+$text['header-default_settings']['de-at'] = "Standard Einstellungen";
+
+$text['header-default_setting-edit']['en-us'] = "Default Setting";
+$text['header-default_setting-edit']['es-cl'] = "Configuraciones Predeterminadas";
+$text['header-default_setting-edit']['pt-pt'] = "Predefinições";
+$text['header-default_setting-edit']['fr-fr'] = "Configurations par Défaut";
+$text['header-default_setting-edit']['nl-nl'] = "";
+$text['header-default_setting-edit']['pt-br'] = "Configurações";
+$text['header-default_setting-edit']['pl'] = "Ustawienie domyślne";
+$text['header-default_setting-edit']['sv-se'] = "Standard Inställning";
+$text['header-default_setting-edit']['uk'] = "";
+$text['header-default_setting-edit']['de-at'] = "Standard Einstellungen";
+
+$text['header-default_setting-add']['en-us'] = "Default Setting Add";
+$text['header-default_setting-add']['es-cl'] = "Agregar Configuración Predeterminada";
+$text['header-default_setting-add']['pt-pt'] = "Adicionar Predefinição ";
+$text['header-default_setting-add']['fr-fr'] = "Ajouter une configuration per défaut";
+$text['header-default_setting-add']['nl-nl'] = "";
+$text['header-default_setting-add']['pt-br'] = "Adicionar configurações";
+$text['header-default_setting-add']['pl'] = "Dodaj ustawienie domyślne";
+$text['header-default_setting-add']['sv-se'] = "Lägg Till Standard Inställning";
+$text['header-default_setting-add']['uk'] = "";
+$text['header-default_setting-add']['de-at'] = "Standard Einstellungen hinzufügen";
+
+$text['description-order']['en-us'] = "Set the order (index) for this array element.";
+$text['description-order']['es-cl'] = "Establecer el orden (índice) para este elemento de la matriz.";
+$text['description-order']['pt-pt'] = "Defina a ordem (índice) para este elemento da matriz.";
+$text['description-order']['fr-fr'] = "Définir l'ordre (index) pour cet élément de tableau.";
+$text['description-order']['nl-nl'] = "";
+$text['description-order']['pt-br'] = "Defina a ordem (indice) para este elemento da matriz";
+$text['description-order']['pl'] = "Wybierz kolejność.";
+$text['description-order']['sv-se'] = "Ställ in ordningen (index) för detta element.";
+$text['description-order']['uk'] = "";
+$text['description-order']['de-at'] = "Wählen Sie die Reihenfolge (Index) für das Array Element.";
+
+$text['description-enabled']['en-us'] = "Set the status of this default setting.";
+$text['description-enabled']['es-cl'] = "Ingrese el estado de esta configuración.";
+$text['description-enabled']['pt-pt'] = "Escolha o estado desta predefinição.";
+$text['description-enabled']['fr-fr'] = "Choisir l'état de ce paraètre";
+$text['description-enabled']['nl-nl'] = "";
+$text['description-enabled']['pt-br'] = "Escolha o estado desta definição";
+$text['description-enabled']['pl'] = "Ustaw status ustawienia domyślnego.";
+$text['description-enabled']['sv-se'] = "Välj status på denna standardinställning.";
+$text['description-enabled']['uk'] = "";
+$text['description-enabled']['de-at'] = "Setzen Sie den Status dieser Standardeinstellung.";
+
+$text['description-default_settings']['en-us'] = "Settings used for all domains.";
+$text['description-default_settings']['es-cl'] = "Configuraciones usadas por todos los dominios";
+$text['description-default_settings']['pt-pt'] = "Definições comuns a todos os domínios.";
+$text['description-default_settings']['fr-fr'] = "Configurations communes à tous les domaines.";
+$text['description-default_settings']['nl-nl'] = "";
+$text['description-default_settings']['pt-br'] = "Configurações comuns a todos os dominios";
+$text['description-default_settings']['pl'] = "Ustawienia stosowane dla wszystkich domen.";
+$text['description-default_settings']['sv-se'] = "Inställning används för alla domäner.";
+$text['description-default_settings']['uk'] = "Налаштування використовується для всіх доменів";
+$text['description-default_settings']['de-at'] = "Einstellungen für alle Domains.";
+
+$text['description-default_setting-edit']['en-us'] = "Settings used for all domains.";
+$text['description-default_setting-edit']['es-cl'] = "Configuraciones usadas para todos los dominios.";
+$text['description-default_setting-edit']['pt-pt'] = "Definições comuns a todos os domínios.";
+$text['description-default_setting-edit']['fr-fr'] = "Configurations communes à tous les domaines";
+$text['description-default_setting-edit']['nl-nl'] = "";
+$text['description-default_setting-edit']['pt-br'] = "Configurações comuns a todos os dominios";
+$text['description-default_setting-edit']['pl'] = "Ustawienia stosowane dla wszystkich domen.";
+$text['description-default_setting-edit']['sv-se'] = "Inställning används för alla domäner.";
+$text['description-default_setting-edit']['uk'] = "Налаштування використовується для всіх доменів";
+$text['description-default_setting-edit']['de-at'] = "Einstellungen für alle Domains.";
+
+$text['description-default_setting-add']['en-us'] = "Settings used for all domains.";
+$text['description-default_setting-add']['es-cl'] = "Configuraciones usadas para todos los dominios.";
+$text['description-default_setting-add']['pt-pt'] = "Definições comuns a todos os domínios.";
+$text['description-default_setting-add']['fr-fr'] = "Configurations communes à tous les domaines";
+$text['description-default_setting-add']['nl-nl'] = "";
+$text['description-default_setting-add']['pt-br'] = "Configurações comuns a todos os dominio";
+$text['description-default_setting-add']['pl'] = "Ustawienia stosowane dla wszystkich domen.";
+$text['description-default_setting-add']['sv-se'] = "Inställning används för alla domäner.";
+$text['description-default_setting-add']['uk'] = "Налаштування використовується для всіх доменів";
+$text['description-default_setting-add']['de-at'] = "Einstellungen für alle Domains.";
+
+$text['button-toggle']['en-us'] = "Toggle";
+$text['button-toggle']['es-cl'] = "Palanca";
+$text['button-toggle']['pt-pt'] = "Alternar";
+$text['button-toggle']['fr-fr'] = "Basculer";
+$text['button-toggle']['pt-br'] = "Alternar";
+$text['button-toggle']['pl'] = "Przełącznik";
+$text['button-toggle']['he'] = "לְמַתֵג";
+$text['button-toggle']['uk'] = "тумблер";
+$text['button-toggle']['sv-se'] = "toggle";
+$text['button-toggle']['de-at'] = "Umschalten";
+$text['button-toggle']['ro'] = "Comutare";
+$text['button-toggle']['fa'] = "";
+$text['button-toggle']['ar-eg'] = "تبديل";
+
 ?>

+ 71 - 71
core/default_settings/default_setting_toggle.php

@@ -1,72 +1,72 @@
-<?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]>
-*/
-require_once "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-if (permission_exists('voicemail_message_view')) {
-	//access granted
-}
-else {
-	echo "access denied";
-	exit;
-}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//get submitted variables
-	$search = $_REQUEST['search'];
-	$default_setting_uuids = $_REQUEST["id"];
-
-//toggle the setting
-	$toggled = 0;
-	if (is_array($default_setting_uuids) && sizeof($default_setting_uuids) > 0) {
-		foreach ($default_setting_uuids as $default_setting_uuid) {
-			//get current status
-				$sql = "select default_setting_enabled from v_default_settings where default_setting_uuid = '".check_str($default_setting_uuid)."'";
-				$prep_statement = $db->prepare(check_sql($sql));
-				$prep_statement->execute();
-				$row = $prep_statement->fetch(PDO::FETCH_NAMED);
-				$new_status = ($row['default_setting_enabled'] == 'true') ? 'false' : "true";
-				unset ($sql, $prep_statement, $row);
-			//set new status
-				$sql = "update v_default_settings set default_setting_enabled = '".$new_status."' where default_setting_uuid = '".check_str($default_setting_uuid)."'";
-				$prep_statement = $db->prepare(check_sql($sql));
-				$prep_statement->execute();
-				unset ($sql, $prep_statement);
-
-			$toggled++;
-		}
-	}
-
-//redirect the user
-	if ($toggled > 0) {
-		$_SESSION["message"] = $text['message-toggled'].': '.$toggled;
-	}
-	header("Location: default_settings.php".(($search != '') ? '?search='.$search : null));
-
+<?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]>
+*/
+require_once "root.php";
+require_once "resources/require.php";
+require_once "resources/check_auth.php";
+if (permission_exists('voicemail_message_view')) {
+	//access granted
+}
+else {
+	echo "access denied";
+	exit;
+}
+
+//add multi-lingual support
+	$language = new text;
+	$text = $language->get();
+
+//get submitted variables
+	$search = $_REQUEST['search'];
+	$default_setting_uuids = $_REQUEST["id"];
+
+//toggle the setting
+	$toggled = 0;
+	if (is_array($default_setting_uuids) && sizeof($default_setting_uuids) > 0) {
+		foreach ($default_setting_uuids as $default_setting_uuid) {
+			//get current status
+				$sql = "select default_setting_enabled from v_default_settings where default_setting_uuid = '".check_str($default_setting_uuid)."'";
+				$prep_statement = $db->prepare(check_sql($sql));
+				$prep_statement->execute();
+				$row = $prep_statement->fetch(PDO::FETCH_NAMED);
+				$new_status = ($row['default_setting_enabled'] == 'true') ? 'false' : "true";
+				unset ($sql, $prep_statement, $row);
+			//set new status
+				$sql = "update v_default_settings set default_setting_enabled = '".$new_status."' where default_setting_uuid = '".check_str($default_setting_uuid)."'";
+				$prep_statement = $db->prepare(check_sql($sql));
+				$prep_statement->execute();
+				unset ($sql, $prep_statement);
+
+			$toggled++;
+		}
+	}
+
+//redirect the user
+	if ($toggled > 0) {
+		$_SESSION["message"] = $text['message-toggled'].': '.$toggled;
+	}
+	header("Location: default_settings.php".(($search != '') ? '?search='.$search : null));
+
 ?>

+ 50 - 50
core/default_settings/default_settings_reload.php

@@ -1,51 +1,51 @@
-<?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-2014
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Mark J Crane <[email protected]>
-*/
-require_once "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-if (permission_exists('default_setting_view')) {
-	//access granted
-}
-else {
-	echo "access denied";
-	exit;
-}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-$search = check_str($_REQUEST['search']);
-
-require "resources/classes/domains.php";
-$domain = new domains();
-$domain->db = $db;
-$domain->set();
-
-$_SESSION["message"] = $text['message-settings_reloaded'];
-header("Location: default_settings.php".(($search != '') ? "?search=".$search : null));
-
+<?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-2014
+ the Initial Developer. All Rights Reserved.
+
+ Contributor(s):
+ Mark J Crane <[email protected]>
+*/
+require_once "root.php";
+require_once "resources/require.php";
+require_once "resources/check_auth.php";
+if (permission_exists('default_setting_view')) {
+	//access granted
+}
+else {
+	echo "access denied";
+	exit;
+}
+
+//add multi-lingual support
+	$language = new text;
+	$text = $language->get();
+
+$search = check_str($_REQUEST['search']);
+
+require "resources/classes/domains.php";
+$domain = new domains();
+$domain->db = $db;
+$domain->set();
+
+$_SESSION["message"] = $text['message-settings_reloaded'];
+header("Location: default_settings.php".(($search != '') ? "?search=".$search : null));
+
 ?>

+ 34 - 34
core/domain_settings/app_defaults.php

@@ -1,35 +1,35 @@
-<?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-2010
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-
-//proccess this only one time
-	if ($domains_processed == 1) {
-		//set domains with enabled status of empty or null to true
-			$sql = "update v_domains set domain_enabled = 'true' where domain_enabled = '' or domain_enabled is null";
-			$db->exec(check_sql($sql));
-			unset($sql);
-	}
-
+<?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-2010
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
+
+//proccess this only one time
+	if ($domains_processed == 1) {
+		//set domains with enabled status of empty or null to true
+			$sql = "update v_domains set domain_enabled = 'true' where domain_enabled = '' or domain_enabled is null";
+			$db->exec(check_sql($sql));
+			unset($sql);
+	}
+
 ?>

+ 444 - 444
core/domain_settings/app_languages.php

@@ -1,445 +1,445 @@
-<?php
-
-$text['title-domains']['en-us'] = "Domains";
-$text['title-domains']['es-cl'] = "Dominios";
-$text['title-domains']['pt-pt'] = "Domínios";
-$text['title-domains']['fr-fr'] = "Domaines";
-$text['title-domains']['pt-br'] = "Dominios";
-$text['title-domains']['pl'] = "Domeny";
-$text['title-domains']['sv-se'] = "Domäner";
-$text['title-domains']['uk'] = "Домени";
-$text['title-domains']['de-at'] = "Domains";
-
-$text['title-domain_setting-edit']['en-us'] = "Domain Setting";
-$text['title-domain_setting-edit']['es-cl'] = "Configuraciones de dominio.";
-$text['title-domain_setting-edit']['pt-pt'] = "Definições do Domínio";
-$text['title-domain_setting-edit']['fr-fr'] = "Paramètres du domaine";
-$text['title-domain_setting-edit']['pt-br'] = "Configurações do dominio";
-$text['title-domain_setting-edit']['pl'] = "Ustawienia domen";
-$text['title-domain_setting-edit']['sv-se'] = "Domän Inställning";
-$text['title-domain_setting-edit']['uk'] = "Налаштування доменів";
-$text['title-domain_setting-edit']['de-at'] = "Domain Einstellungen";
-
-$text['title-domain_setting-add']['en-us'] = "Domain Setting Add";
-$text['title-domain_setting-add']['es-cl'] = "Agregar Configuración de Dominio";
-$text['title-domain_setting-add']['pt-pt'] = "Adicionar Definição ao Domínio";
-$text['title-domain_setting-add']['fr-fr'] = "Ajouter un paramètre au domaine";
-$text['title-domain_setting-add']['pt-br'] = "Adicionar configurações do dominio";
-$text['title-domain_setting-add']['pl'] = "Dodaj ustawienie domeny";
-$text['title-domain_setting-add']['sv-se'] = "Lägg Till Domän Inställning";
-$text['title-domain_setting-add']['uk'] = "Додавання домену";
-$text['title-domain_setting-add']['de-at'] = "Domain Einstellungen hinzufügen";
-
-$text['title-domain-edit']['en-us'] = "Domain";
-$text['title-domain-edit']['es-cl'] = "Dominio";
-$text['title-domain-edit']['pt-pt'] = "Domínio";
-$text['title-domain-edit']['fr-fr'] = "Domaines";
-$text['title-domain-edit']['pt-br'] = "Dominio";
-$text['title-domain-edit']['pl'] = "Domena";
-$text['title-domain-edit']['sv-se'] = "Domän";
-$text['title-domain-edit']['uk'] = "Домен";
-$text['title-domain-edit']['de-at'] = "Domain";
-
-$text['title-domain-add']['en-us'] = "Domain Add";
-$text['title-domain-add']['es-cl'] = "Agregar Dominio";
-$text['title-domain-add']['pt-pt'] = "Adicionar Domínio";
-$text['title-domain-add']['fr-fr'] = "Ajouter un Domaine";
-$text['title-domain-add']['pt-br'] = "Adicionar dominio";
-$text['title-domain-add']['pl'] = "Dodaj domenę";
-$text['title-domain-add']['sv-se'] = "Lägg Till Domän";
-$text['title-domain-add']['uk'] = "Новий домен";
-$text['title-domain-add']['de-at'] = "Domain hinzufügen";
-
-$text['message-delete_failed']['en-us'] = "No Settings Checked";
-$text['message-delete_failed']['es-cl'] = "No hay ajustes facturado";
-$text['message-delete_failed']['pt-pt'] = "Nenhuma configuração marcada";
-$text['message-delete_failed']['fr-fr'] = "Pas de paramètres enregistrés";
-$text['message-delete_failed']['pt-br'] = "Falha na exclusão";
-$text['message-delete_failed']['pl'] = "Próba usunięcia zakończyła się niepowodzeniem";
-$text['message-delete_failed']['sv-se'] = "Ingen Inställning Markerad";
-$text['message-delete_failed']['uk'] = "Налаштування не вказано";
-$text['message-delete_failed']['de-at'] = "Keine Einstellungen ausgewählt";
-
-$text['label-top']['en-us'] = "Top";
-$text['label-top']['es-cl'] = "encima";
-$text['label-top']['pt-pt'] = "Topo";
-$text['label-top']['fr-fr'] = "Meilleur";
-$text['label-top']['pt-br'] = "Topo";
-$text['label-top']['pl'] = "Top";
-$text['label-top']['he'] = "עליון";
-$text['label-top']['uk'] = "топ";
-$text['label-top']['sv-se'] = "Topp";
-$text['label-top']['de-at'] = "Oben";
-$text['label-top']['ro'] = "Top";
-$text['label-top']['fa'] = "";
-$text['label-top']['ar-eg'] = "أعلى";
-
-$text['label-tools']['en-us'] = "Tools";
-$text['label-tools']['es-cl'] = "Herramientas";
-$text['label-tools']['pt-pt'] = "Ferramentas";
-$text['label-tools']['fr-fr'] = "Outils";
-$text['label-tools']['pt-br'] = "Ferramentas";
-$text['label-tools']['pl'] = "Narzędzia";
-$text['label-tools']['sv-se'] = "Verktyg";
-$text['label-tools']['uk'] = "Параметри";
-$text['label-tools']['de-at'] = "Werkzeug";
-
-$text['label-text']['en-us'] = "Text";
-$text['label-text']['es-cl'] = "Texto";
-$text['label-text']['pt-pt'] = "Texto";
-$text['label-text']['fr-fr'] = "Texte";
-$text['label-text']['pt-br'] = "Texto";
-$text['label-text']['pl'] = "Tekst";
-$text['label-text']['he'] = "טֶקסט";
-$text['label-text']['uk'] = "текст";
-$text['label-text']['sv-se'] = "Text";
-$text['label-text']['de-at'] = "Text";
-$text['label-text']['ro'] = "Text";
-$text['label-text']['fa'] = "";
-$text['label-text']['ar-eg'] = "نص";
-
-$text['label-static']['en-us'] = "Static";
-$text['label-static']['es-cl'] = "Estático";
-$text['label-static']['pt-pt'] = "Estático";
-$text['label-static']['fr-fr'] = "Statique";
-$text['label-static']['pt-br'] = "Estático";
-$text['label-static']['pl'] = "Statyczny";
-$text['label-static']['he'] = "סטָטִי";
-$text['label-static']['uk'] = "статичний";
-$text['label-static']['sv-se'] = "Statisk";
-$text['label-static']['de-at'] = "Statisch";
-$text['label-static']['ro'] = "Static";
-$text['label-static']['fa'] = "";
-$text['label-static']['ar-eg'] = "ساكن";
-
-$text['label-right']['en-us'] = "Right";
-$text['label-right']['es-cl'] = "Derecha";
-$text['label-right']['pt-pt'] = "Certo";
-$text['label-right']['fr-fr'] = "Droite";
-$text['label-right']['pt-br'] = "Certo";
-$text['label-right']['pl'] = "Dobrze";
-$text['label-right']['he'] = "יָמִינָה";
-$text['label-right']['uk'] = "правий";
-$text['label-right']['sv-se'] = "Höger";
-$text['label-right']['de-at'] = "Recht";
-$text['label-right']['ro'] = "Dreapta";
-$text['label-right']['fa'] = "";
-$text['label-right']['ar-eg'] = "حق";
-
-$text['label-parent_domain']['en-us'] = "Parent Domain";
-$text['label-parent_domain']['es-cl'] = "Dominio de los Padres";
-$text['label-parent_domain']['pt-pt'] = "Domínio Parent";
-$text['label-parent_domain']['fr-fr'] = "Domaine Parent";
-$text['label-parent_domain']['pt-br'] = "Dominio principal";
-$text['label-parent_domain']['pl'] = "Domena nadrzędna";
-$text['label-parent_domain']['sv-se'] = "Överordnad Domän";
-$text['label-parent_domain']['uk'] = "Батьківський домен";
-$text['label-parent_domain']['de-at'] = "Übergeordnete Domain";
-
-$text['label-none']['en-us'] = "None";
-$text['label-none']['es-cl'] = "Ninguna";
-$text['label-none']['pt-pt'] = "Nenhum";
-$text['label-none']['fr-fr'] = "Aucun";
-$text['label-none']['pt-br'] = "Nenhum";
-$text['label-none']['pl'] = "Żaden";
-$text['label-none']['he'] = "אף לא אחד";
-$text['label-none']['uk'] = "жоден";
-$text['label-none']['sv-se'] = "Ingen";
-$text['label-none']['de-at'] = "Keiner";
-$text['label-none']['ro'] = "Nici unul";
-$text['label-none']['fa'] = "";
-$text['label-none']['ar-eg'] = "لا شيء";
-
-$text['label-manage']['en-us'] = "Manage";
-$text['label-manage']['es-cl'] = "Gestionar";
-$text['label-manage']['pt-pt'] = "Gerir";
-$text['label-manage']['fr-fr'] = "Gérer";
-$text['label-manage']['pt-br'] = "Gerenciar";
-$text['label-manage']['pl'] = "Zarządzaj";
-$text['label-manage']['sv-se'] = "Hantera";
-$text['label-manage']['uk'] = "Керувати";
-$text['label-manage']['de-at'] = "Verwalten";
-
-$text['label-left']['en-us'] = "Left";
-$text['label-left']['es-cl'] = "Izquierda";
-$text['label-left']['pt-pt'] = "Esquerda";
-$text['label-left']['fr-fr'] = "À gauche";
-$text['label-left']['pt-br'] = "Esquerda";
-$text['label-left']['pl'] = "Lewo";
-$text['label-left']['he'] = "שְׁמֹאל";
-$text['label-left']['uk'] = "лівий";
-$text['label-left']['sv-se'] = "Vänster";
-$text['label-left']['de-at'] = "Links";
-$text['label-left']['ro'] = "Stânga";
-$text['label-left']['fa'] = "";
-$text['label-left']['ar-eg'] = "اليسار";
-
-$text['label-inline']['en-us'] = "Inline";
-$text['label-inline']['es-cl'] = "En línea";
-$text['label-inline']['pt-pt'] = "Na linha";
-$text['label-inline']['fr-fr'] = "En ligne";
-$text['label-inline']['pt-br'] = "Na linha";
-$text['label-inline']['pl'] = "inline";
-$text['label-inline']['he'] = "בשורה";
-$text['label-inline']['uk'] = "В лінію";
-$text['label-inline']['sv-se'] = "I kö";
-$text['label-inline']['de-at'] = "In der Reihe";
-$text['label-inline']['ro'] = "In linie";
-$text['label-inline']['fa'] = "";
-$text['label-inline']['ar-eg'] = "في النسق";
-
-$text['label-image']['en-us'] = "Image";
-$text['label-image']['es-cl'] = "Imagen";
-$text['label-image']['pt-pt'] = "Imagem";
-$text['label-image']['fr-fr'] = "image";
-$text['label-image']['pt-br'] = "Imagem";
-$text['label-image']['pl'] = "Obraz";
-$text['label-image']['he'] = "תמונה";
-$text['label-image']['uk'] = "зображення";
-$text['label-image']['sv-se'] = "Bild";
-$text['label-image']['de-at'] = "Image";
-$text['label-image']['ro'] = "Imagine";
-$text['label-image']['fa'] = "";
-$text['label-image']['ar-eg'] = "صورة";
-
-$text['label-fixed']['en-us'] = "Fixed";
-$text['label-fixed']['es-cl'] = "Fijo";
-$text['label-fixed']['pt-pt'] = "Fixo";
-$text['label-fixed']['fr-fr'] = "Fixé";
-$text['label-fixed']['pt-br'] = "Fixo";
-$text['label-fixed']['pl'] = "Naprawiony";
-$text['label-fixed']['he'] = "קָבוּעַ";
-$text['label-fixed']['uk'] = "фіксований";
-$text['label-fixed']['sv-se'] = "Fast";
-$text['label-fixed']['de-at'] = "fest";
-$text['label-fixed']['ro'] = "Fix";
-$text['label-fixed']['fa'] = "";
-$text['label-fixed']['ar-eg'] = "ثابت";
-
-$text['label-domain']['en-us'] = "Domain";
-$text['label-domain']['es-cl'] = "Dominio";
-$text['label-domain']['pt-pt'] = "Domínio";
-$text['label-domain']['fr-fr'] = "Domaine";
-$text['label-domain']['pt-br'] = "Dominio";
-$text['label-domain']['pl'] = "Domena";
-$text['label-domain']['sv-se'] = "Domän";
-$text['label-domain']['uk'] = "Домен";
-$text['label-domain']['de-at'] = "Domain";
-
-$text['label-center']['en-us'] = "Center";
-$text['label-center']['es-cl'] = "Centrar";
-$text['label-center']['pt-pt'] = "Centro";
-$text['label-center']['fr-fr'] = "centre";
-$text['label-center']['pt-br'] = "Centro";
-$text['label-center']['pl'] = "Centrum";
-$text['label-center']['he'] = "מֶרְכָּז";
-$text['label-center']['uk'] = "центр";
-$text['label-center']['sv-se'] = "Centrum";
-$text['label-center']['de-at'] = "Center";
-$text['label-center']['ro'] = "Centru";
-$text['label-center']['fa'] = "";
-$text['label-center']['ar-eg'] = "مركز";
-
-$text['label-bottom']['en-us'] = "Bottom";
-$text['label-bottom']['es-cl'] = "Fondo";
-$text['label-bottom']['pt-pt'] = "Inferior";
-$text['label-bottom']['fr-fr'] = "Bas";
-$text['label-bottom']['pt-br'] = "Inferior";
-$text['label-bottom']['pl'] = "Dolny";
-$text['label-bottom']['he'] = "תַחתִית";
-$text['label-bottom']['uk'] = "дно";
-$text['label-bottom']['sv-se'] = "Botten";
-$text['label-bottom']['de-at'] = "Boden";
-$text['label-bottom']['ro'] = "Fund";
-$text['label-bottom']['fa'] = "";
-$text['label-bottom']['ar-eg'] = "أسفل";
-
-$text['label-24-hour']['en-us'] = "24-Hour";
-$text['label-24-hour']['es-cl'] = "24 horas";
-$text['label-24-hour']['pt-pt'] = "24 horas";
-$text['label-24-hour']['fr-fr'] = "24 heures";
-$text['label-24-hour']['pt-br'] = "24 horas";
-$text['label-24-hour']['pl'] = "24-godzinny";
-$text['label-24-hour']['he'] = "24 שעות";
-$text['label-24-hour']['uk'] = "24-годинний";
-$text['label-24-hour']['sv-se'] = "24-timmars";
-$text['label-24-hour']['de-at'] = "24 Stunden";
-$text['label-24-hour']['ro'] = "24 de ore";
-$text['label-24-hour']['fa'] = "";
-$text['label-24-hour']['ar-eg'] = "24 ساعة";
-
-$text['label-12-hour']['en-us'] = "12-Hour";
-$text['label-12-hour']['es-cl'] = "12 horas";
-$text['label-12-hour']['pt-pt'] = "12 horas";
-$text['label-12-hour']['fr-fr'] = "12 heures";
-$text['label-12-hour']['pt-br'] = "12 horas";
-$text['label-12-hour']['pl'] = "12-godzinny";
-$text['label-12-hour']['he'] = "12 שעות";
-$text['label-12-hour']['uk'] = "12-годинний";
-$text['label-12-hour']['sv-se'] = "12-timmars";
-$text['label-12-hour']['de-at'] = "12 Stunden";
-$text['label-12-hour']['ro'] = "12 de ore";
-$text['label-12-hour']['fa'] = "";
-$text['label-12-hour']['ar-eg'] = "12 ساعة";
-
-$text['header-settings']['en-us'] = "Settings";
-$text['header-settings']['es-cl'] = "Configuraciones";
-$text['header-settings']['pt-pt'] = "Definições";
-$text['header-settings']['fr-fr'] = "Paramètres";
-$text['header-settings']['pt-br'] = "Configurações";
-$text['header-settings']['pl'] = "Ustawienia";
-$text['header-settings']['sv-se'] = "Inställning";
-$text['header-settings']['uk'] = "Налаштування";
-$text['header-settings']['de-at'] = "Einstellungen";
-
-$text['header-domains']['en-us'] = "Domains";
-$text['header-domains']['es-cl'] = "Dominios";
-$text['header-domains']['pt-pt'] = "Domínios";
-$text['header-domains']['fr-fr'] = "Domaines";
-$text['header-domains']['pt-br'] = "Dominios";
-$text['header-domains']['pl'] = "Domeny";
-$text['header-domains']['sv-se'] = "Domäner";
-$text['header-domains']['uk'] = "Домени";
-$text['header-domains']['de-at'] = "Domains";
-
-$text['header-domain_setting-edit']['en-us'] = "Domain Setting";
-$text['header-domain_setting-edit']['es-cl'] = "Configuraciones de dominio";
-$text['header-domain_setting-edit']['pt-pt'] = "Definições do Domínio";
-$text['header-domain_setting-edit']['fr-fr'] = "Paramètres du domaine";
-$text['header-domain_setting-edit']['pt-br'] = "Configurações do dominio";
-$text['header-domain_setting-edit']['pl'] = "Ustawienia domeny";
-$text['header-domain_setting-edit']['sv-se'] = "Domän Inställning";
-$text['header-domain_setting-edit']['uk'] = "Налаштування домену";
-$text['header-domain_setting-edit']['de-at'] = "Domain Einstellungen";
-
-$text['header-domain_setting-add']['en-us'] = "Domain Setting Add";
-$text['header-domain_setting-add']['es-cl'] = "Agregar Configuración de Dominio";
-$text['header-domain_setting-add']['pt-pt'] = "Adicionar Definição ao Domínio";
-$text['header-domain_setting-add']['fr-fr'] = "Ajouter un paramètre au domaine";
-$text['header-domain_setting-add']['pt-br'] = "Adicionar configuração ao dominio";
-$text['header-domain_setting-add']['pl'] = "Dodaj ustawienie domeny";
-$text['header-domain_setting-add']['sv-se'] = "Lägg Till Domän Inställning";
-$text['header-domain_setting-add']['uk'] = "Параметри домену";
-$text['header-domain_setting-add']['de-at'] = "Domain Einstellungen hinzufügen";
-
-$text['header-domain-edit']['en-us'] = "Domain";
-$text['header-domain-edit']['es-cl'] = "Dominio";
-$text['header-domain-edit']['pt-pt'] = "Domínio";
-$text['header-domain-edit']['fr-fr'] = "Domaine";
-$text['header-domain-edit']['pt-br'] = "Dominio";
-$text['header-domain-edit']['pl'] = "Domena";
-$text['header-domain-edit']['sv-se'] = "Domän";
-$text['header-domain-edit']['uk'] = "Домен";
-$text['header-domain-edit']['de-at'] = "Domain";
-
-$text['header-domain-add']['en-us'] = "Domain Add";
-$text['header-domain-add']['es-cl'] = "Agregar Dominio";
-$text['header-domain-add']['pt-pt'] = "Adicionar Domínio";
-$text['header-domain-add']['fr-fr'] = "Ajouter un Domaine";
-$text['header-domain-add']['pt-br'] = "Adicionar dominio";
-$text['header-domain-add']['pl'] = "Dodaj domenę";
-$text['header-domain-add']['sv-se'] = "Lägg Till Domän";
-$text['header-domain-add']['uk'] = "Новий домен";
-$text['header-domain-add']['de-at'] = "Domain hinzufügen";
-
-$text['description-setting_enabled']['en-us'] = "Set the status of this default setting.";
-$text['description-setting_enabled']['es-cl'] = "Configure el estado de esta configuración predeterminada.";
-$text['description-setting_enabled']['pt-pt'] = "Escolha o estado desta definição por omissão.";
-$text['description-setting_enabled']['fr-fr'] = "Choisir l'état de ce paramètre";
-$text['description-setting_enabled']['pt-br'] = "Escolha o estado desta configuração";
-$text['description-setting_enabled']['pl'] = "Wybierz, aby włączyć lub wyłączyć tę funkcję.";
-$text['description-setting_enabled']['sv-se'] = "Ange status på denna standard inställning.";
-$text['description-setting_enabled']['uk'] = "Встановіть стан цього параметра за замовчуванням.";
-$text['description-setting_enabled']['de-at'] = "Setzen Sie den Status dieser Standardeinstellung.";
-
-$text['description-parent_domain']['en-us'] = "Set the parent domain.";
-$text['description-parent_domain']['es-cl'] = "Establecer el dominio principal.";
-$text['description-parent_domain']['pt-pt'] = "Defina o domínio pai.";
-$text['description-parent_domain']['fr-fr'] = "Réglez le domaine parent.";
-$text['description-parent_domain']['pt-br'] = "Defina o dominio pai";
-$text['description-parent_domain']['pl'] = "Ustaw domenę nadrzędną";
-$text['description-parent_domain']['sv-se'] = "Ange Överordan Domän.";
-$text['description-parent_domain']['uk'] = "Вкажіть батьківський домен";
-$text['description-parent_domain']['de-at'] = "Setzen Sie die übergeordnete Domain.";
-
-$text['description-order']['en-us'] = "Set the order for this array element.";
-$text['description-order']['es-cl'] = "Establecer el orden para este elemento de la matriz.";
-$text['description-order']['pt-pt'] = "Definir a ordem para este elemento do array.";
-$text['description-order']['fr-fr'] = "Définissez l'ordre de cet élément de tableau.";
-$text['description-order']['pt-br'] = "Defina a ordem (indice) para este elemento da matriz";
-$text['description-order']['pl'] = "Wybierz kolejność.";
-$text['description-order']['sv-se'] = "Ställ in ordningen för detta element.";
-$text['description-order']['uk'] = "Вкажіть порядок для масиву елементів";
-$text['description-order']['de-at'] = "Wählen Sie die Reihenfolge des Array Elements.";
-
-$text['description-name']['en-us'] = "Enter the name of the domain.";
-$text['description-name']['es-cl'] = "Ingrese el nombre del dominio";
-$text['description-name']['pt-pt'] = "Introduza o nome do domínio.";
-$text['description-name']['fr-fr'] = "Entrer le nom du domaine.";
-$text['description-name']['pt-br'] = "Insira o nome do menu";
-$text['description-name']['pl'] = "Wprowadź nazwę";
-$text['description-name']['sv-se'] = "Ange namn på Domänen.";
-$text['description-name']['uk'] = "Вкажіть назву домену";
-$text['description-name']['de-at'] = "Geben Sie den Namen dieser Domain an";
-
-$text['description-domains']['en-us'] = "Control the list of domains to manage.";
-$text['description-domains']['es-cl'] = "Controlar la lista de dominios a gestionar.";
-$text['description-domains']['pt-pt'] = "Controlar a lista dos domínios a gerir";
-$text['description-domains']['fr-fr'] = "Contrôler la liste des domaines à gérer";
-$text['description-domains']['pt-br'] = "Gerencie a lista dos dominios";
-$text['description-domains']['pl'] = "Zarządzanie listą domen.";
-$text['description-domains']['sv-se'] = "Kontrollera lista med Domäner att hantera.";
-$text['description-domains']['uk'] = "Список доменів для керування";
-$text['description-domains']['de-at'] = "Eine Liste aller Domains.";
-
-$text['description-domain_setting-edit']['en-us'] = "Edit a setting for this domain.";
-$text['description-domain_setting-edit']['es-cl'] = "Edita una configuración para este dominio.";
-$text['description-domain_setting-edit']['pt-pt'] = "Editar uma definição deste domínio.";
-$text['description-domain_setting-edit']['fr-fr'] = "Editer un paramètre du domaine.";
-$text['description-domain_setting-edit']['pt-br'] = "Editar uma configuração deste dominio";
-$text['description-domain_setting-edit']['pl'] = "Edytuj ustawienia w tej domenie";
-$text['description-domain_setting-edit']['sv-se'] = "Ändra en inställning för denna Domän.";
-$text['description-domain_setting-edit']['uk'] = "Редагування параметрів для домену";
-$text['description-domain_setting-edit']['de-at'] = "Eine Einstellung für diese Domain ändern.";
-
-$text['description-domain_setting-add']['en-us'] = "Add a setting for this domain.";
-$text['description-domain_setting-add']['es-cl'] = "Agregar una configuración para este dominio.";
-$text['description-domain_setting-add']['pt-pt'] = "Adicionar uma definição a este domínio.";
-$text['description-domain_setting-add']['fr-fr'] = "";
-$text['description-domain_setting-add']['pt-br'] = "Adicionar uma configuração a este dominio";
-$text['description-domain_setting-add']['pl'] = "Dodaj ustawienie w tej domenie";
-$text['description-domain_setting-add']['sv-se'] = "Lägg Till en inställning för denna Domän.";
-$text['description-domain_setting-add']['uk'] = "Додавання параметра для домену";
-$text['description-domain_setting-add']['de-at'] = "Eine Einstellung für diese Domain hinzufügen.";
-
-$text['description-domain_enabled']['en-us'] = "Set the status of the domain.";
-$text['description-domain_enabled']['es-cl'] = "Ajuste el estado del dominio.";
-$text['description-domain_enabled']['pt-pt'] = "Definir o estado do domínio.";
-$text['description-domain_enabled']['fr-fr'] = "Régler le statut du domaine.";
-$text['description-domain_enabled']['pt-br'] = "Definir o estado do dominio";
-$text['description-domain_enabled']['pl'] = "Ustaw status tej domeny.";
-$text['description-domain_enabled']['sv-se'] = "Ange status för Domänen.";
-$text['description-domain_enabled']['uk'] = "Вкажіть стан домену";
-$text['description-domain_enabled']['de-at'] = "Den Status der Domain setzen.";
-
-$text['description-domain-edit']['en-us'] = "Edit the details of this domain.";
-$text['description-domain-edit']['es-cl'] = "Editar detalles de este dominio.";
-$text['description-domain-edit']['pt-pt'] = "Editar detalhes deste domínio.";
-$text['description-domain-edit']['fr-fr'] = "Editer les détaisl de ce domaine. ";
-$text['description-domain-edit']['pt-br'] = "Editar detalhes deste dominio";
-$text['description-domain-edit']['pl'] = "Edytuj szczegóły tej domeny.";
-$text['description-domain-edit']['sv-se'] = "Ändra detaljer för denna Domän.";
-$text['description-domain-edit']['uk'] = "Редагування деталей домену";
-$text['description-domain-edit']['de-at'] = "Die Details dieser Domain ändern.";
-
-$text['description-domain-add']['en-us'] = "Enter the domain details below.";
-$text['description-domain-add']['es-cl'] = "Ingrese los detalles del dominio a continuación.";
-$text['description-domain-add']['pt-pt'] = "Introduza os detalhes do domínio abaixo.";
-$text['description-domain-add']['fr-fr'] = "Entrer les détails du domaine ci-dessous.";
-$text['description-domain-add']['pt-br'] = "Insira os detalhes do dominio abaixo";
-$text['description-domain-add']['pl'] = "Poniżej wprowadź szczegóły domeny";
-$text['description-domain-add']['sv-se'] = "Ange domändetaljer nedan.";
-$text['description-domain-add']['uk'] = "Введіть дані домену нижче.";
-$text['description-domain-add']['de-at'] = "Geben Sie die Domain Details unten an.";
-
+<?php
+
+$text['title-domains']['en-us'] = "Domains";
+$text['title-domains']['es-cl'] = "Dominios";
+$text['title-domains']['pt-pt'] = "Domínios";
+$text['title-domains']['fr-fr'] = "Domaines";
+$text['title-domains']['pt-br'] = "Dominios";
+$text['title-domains']['pl'] = "Domeny";
+$text['title-domains']['sv-se'] = "Domäner";
+$text['title-domains']['uk'] = "Домени";
+$text['title-domains']['de-at'] = "Domains";
+
+$text['title-domain_setting-edit']['en-us'] = "Domain Setting";
+$text['title-domain_setting-edit']['es-cl'] = "Configuraciones de dominio.";
+$text['title-domain_setting-edit']['pt-pt'] = "Definições do Domínio";
+$text['title-domain_setting-edit']['fr-fr'] = "Paramètres du domaine";
+$text['title-domain_setting-edit']['pt-br'] = "Configurações do dominio";
+$text['title-domain_setting-edit']['pl'] = "Ustawienia domen";
+$text['title-domain_setting-edit']['sv-se'] = "Domän Inställning";
+$text['title-domain_setting-edit']['uk'] = "Налаштування доменів";
+$text['title-domain_setting-edit']['de-at'] = "Domain Einstellungen";
+
+$text['title-domain_setting-add']['en-us'] = "Domain Setting Add";
+$text['title-domain_setting-add']['es-cl'] = "Agregar Configuración de Dominio";
+$text['title-domain_setting-add']['pt-pt'] = "Adicionar Definição ao Domínio";
+$text['title-domain_setting-add']['fr-fr'] = "Ajouter un paramètre au domaine";
+$text['title-domain_setting-add']['pt-br'] = "Adicionar configurações do dominio";
+$text['title-domain_setting-add']['pl'] = "Dodaj ustawienie domeny";
+$text['title-domain_setting-add']['sv-se'] = "Lägg Till Domän Inställning";
+$text['title-domain_setting-add']['uk'] = "Додавання домену";
+$text['title-domain_setting-add']['de-at'] = "Domain Einstellungen hinzufügen";
+
+$text['title-domain-edit']['en-us'] = "Domain";
+$text['title-domain-edit']['es-cl'] = "Dominio";
+$text['title-domain-edit']['pt-pt'] = "Domínio";
+$text['title-domain-edit']['fr-fr'] = "Domaines";
+$text['title-domain-edit']['pt-br'] = "Dominio";
+$text['title-domain-edit']['pl'] = "Domena";
+$text['title-domain-edit']['sv-se'] = "Domän";
+$text['title-domain-edit']['uk'] = "Домен";
+$text['title-domain-edit']['de-at'] = "Domain";
+
+$text['title-domain-add']['en-us'] = "Domain Add";
+$text['title-domain-add']['es-cl'] = "Agregar Dominio";
+$text['title-domain-add']['pt-pt'] = "Adicionar Domínio";
+$text['title-domain-add']['fr-fr'] = "Ajouter un Domaine";
+$text['title-domain-add']['pt-br'] = "Adicionar dominio";
+$text['title-domain-add']['pl'] = "Dodaj domenę";
+$text['title-domain-add']['sv-se'] = "Lägg Till Domän";
+$text['title-domain-add']['uk'] = "Новий домен";
+$text['title-domain-add']['de-at'] = "Domain hinzufügen";
+
+$text['message-delete_failed']['en-us'] = "No Settings Checked";
+$text['message-delete_failed']['es-cl'] = "No hay ajustes facturado";
+$text['message-delete_failed']['pt-pt'] = "Nenhuma configuração marcada";
+$text['message-delete_failed']['fr-fr'] = "Pas de paramètres enregistrés";
+$text['message-delete_failed']['pt-br'] = "Falha na exclusão";
+$text['message-delete_failed']['pl'] = "Próba usunięcia zakończyła się niepowodzeniem";
+$text['message-delete_failed']['sv-se'] = "Ingen Inställning Markerad";
+$text['message-delete_failed']['uk'] = "Налаштування не вказано";
+$text['message-delete_failed']['de-at'] = "Keine Einstellungen ausgewählt";
+
+$text['label-top']['en-us'] = "Top";
+$text['label-top']['es-cl'] = "encima";
+$text['label-top']['pt-pt'] = "Topo";
+$text['label-top']['fr-fr'] = "Meilleur";
+$text['label-top']['pt-br'] = "Topo";
+$text['label-top']['pl'] = "Top";
+$text['label-top']['he'] = "עליון";
+$text['label-top']['uk'] = "топ";
+$text['label-top']['sv-se'] = "Topp";
+$text['label-top']['de-at'] = "Oben";
+$text['label-top']['ro'] = "Top";
+$text['label-top']['fa'] = "";
+$text['label-top']['ar-eg'] = "أعلى";
+
+$text['label-tools']['en-us'] = "Tools";
+$text['label-tools']['es-cl'] = "Herramientas";
+$text['label-tools']['pt-pt'] = "Ferramentas";
+$text['label-tools']['fr-fr'] = "Outils";
+$text['label-tools']['pt-br'] = "Ferramentas";
+$text['label-tools']['pl'] = "Narzędzia";
+$text['label-tools']['sv-se'] = "Verktyg";
+$text['label-tools']['uk'] = "Параметри";
+$text['label-tools']['de-at'] = "Werkzeug";
+
+$text['label-text']['en-us'] = "Text";
+$text['label-text']['es-cl'] = "Texto";
+$text['label-text']['pt-pt'] = "Texto";
+$text['label-text']['fr-fr'] = "Texte";
+$text['label-text']['pt-br'] = "Texto";
+$text['label-text']['pl'] = "Tekst";
+$text['label-text']['he'] = "טֶקסט";
+$text['label-text']['uk'] = "текст";
+$text['label-text']['sv-se'] = "Text";
+$text['label-text']['de-at'] = "Text";
+$text['label-text']['ro'] = "Text";
+$text['label-text']['fa'] = "";
+$text['label-text']['ar-eg'] = "نص";
+
+$text['label-static']['en-us'] = "Static";
+$text['label-static']['es-cl'] = "Estático";
+$text['label-static']['pt-pt'] = "Estático";
+$text['label-static']['fr-fr'] = "Statique";
+$text['label-static']['pt-br'] = "Estático";
+$text['label-static']['pl'] = "Statyczny";
+$text['label-static']['he'] = "סטָטִי";
+$text['label-static']['uk'] = "статичний";
+$text['label-static']['sv-se'] = "Statisk";
+$text['label-static']['de-at'] = "Statisch";
+$text['label-static']['ro'] = "Static";
+$text['label-static']['fa'] = "";
+$text['label-static']['ar-eg'] = "ساكن";
+
+$text['label-right']['en-us'] = "Right";
+$text['label-right']['es-cl'] = "Derecha";
+$text['label-right']['pt-pt'] = "Certo";
+$text['label-right']['fr-fr'] = "Droite";
+$text['label-right']['pt-br'] = "Certo";
+$text['label-right']['pl'] = "Dobrze";
+$text['label-right']['he'] = "יָמִינָה";
+$text['label-right']['uk'] = "правий";
+$text['label-right']['sv-se'] = "Höger";
+$text['label-right']['de-at'] = "Recht";
+$text['label-right']['ro'] = "Dreapta";
+$text['label-right']['fa'] = "";
+$text['label-right']['ar-eg'] = "حق";
+
+$text['label-parent_domain']['en-us'] = "Parent Domain";
+$text['label-parent_domain']['es-cl'] = "Dominio de los Padres";
+$text['label-parent_domain']['pt-pt'] = "Domínio Parent";
+$text['label-parent_domain']['fr-fr'] = "Domaine Parent";
+$text['label-parent_domain']['pt-br'] = "Dominio principal";
+$text['label-parent_domain']['pl'] = "Domena nadrzędna";
+$text['label-parent_domain']['sv-se'] = "Överordnad Domän";
+$text['label-parent_domain']['uk'] = "Батьківський домен";
+$text['label-parent_domain']['de-at'] = "Übergeordnete Domain";
+
+$text['label-none']['en-us'] = "None";
+$text['label-none']['es-cl'] = "Ninguna";
+$text['label-none']['pt-pt'] = "Nenhum";
+$text['label-none']['fr-fr'] = "Aucun";
+$text['label-none']['pt-br'] = "Nenhum";
+$text['label-none']['pl'] = "Żaden";
+$text['label-none']['he'] = "אף לא אחד";
+$text['label-none']['uk'] = "жоден";
+$text['label-none']['sv-se'] = "Ingen";
+$text['label-none']['de-at'] = "Keiner";
+$text['label-none']['ro'] = "Nici unul";
+$text['label-none']['fa'] = "";
+$text['label-none']['ar-eg'] = "لا شيء";
+
+$text['label-manage']['en-us'] = "Manage";
+$text['label-manage']['es-cl'] = "Gestionar";
+$text['label-manage']['pt-pt'] = "Gerir";
+$text['label-manage']['fr-fr'] = "Gérer";
+$text['label-manage']['pt-br'] = "Gerenciar";
+$text['label-manage']['pl'] = "Zarządzaj";
+$text['label-manage']['sv-se'] = "Hantera";
+$text['label-manage']['uk'] = "Керувати";
+$text['label-manage']['de-at'] = "Verwalten";
+
+$text['label-left']['en-us'] = "Left";
+$text['label-left']['es-cl'] = "Izquierda";
+$text['label-left']['pt-pt'] = "Esquerda";
+$text['label-left']['fr-fr'] = "À gauche";
+$text['label-left']['pt-br'] = "Esquerda";
+$text['label-left']['pl'] = "Lewo";
+$text['label-left']['he'] = "שְׁמֹאל";
+$text['label-left']['uk'] = "лівий";
+$text['label-left']['sv-se'] = "Vänster";
+$text['label-left']['de-at'] = "Links";
+$text['label-left']['ro'] = "Stânga";
+$text['label-left']['fa'] = "";
+$text['label-left']['ar-eg'] = "اليسار";
+
+$text['label-inline']['en-us'] = "Inline";
+$text['label-inline']['es-cl'] = "En línea";
+$text['label-inline']['pt-pt'] = "Na linha";
+$text['label-inline']['fr-fr'] = "En ligne";
+$text['label-inline']['pt-br'] = "Na linha";
+$text['label-inline']['pl'] = "inline";
+$text['label-inline']['he'] = "בשורה";
+$text['label-inline']['uk'] = "В лінію";
+$text['label-inline']['sv-se'] = "I kö";
+$text['label-inline']['de-at'] = "In der Reihe";
+$text['label-inline']['ro'] = "In linie";
+$text['label-inline']['fa'] = "";
+$text['label-inline']['ar-eg'] = "في النسق";
+
+$text['label-image']['en-us'] = "Image";
+$text['label-image']['es-cl'] = "Imagen";
+$text['label-image']['pt-pt'] = "Imagem";
+$text['label-image']['fr-fr'] = "image";
+$text['label-image']['pt-br'] = "Imagem";
+$text['label-image']['pl'] = "Obraz";
+$text['label-image']['he'] = "תמונה";
+$text['label-image']['uk'] = "зображення";
+$text['label-image']['sv-se'] = "Bild";
+$text['label-image']['de-at'] = "Image";
+$text['label-image']['ro'] = "Imagine";
+$text['label-image']['fa'] = "";
+$text['label-image']['ar-eg'] = "صورة";
+
+$text['label-fixed']['en-us'] = "Fixed";
+$text['label-fixed']['es-cl'] = "Fijo";
+$text['label-fixed']['pt-pt'] = "Fixo";
+$text['label-fixed']['fr-fr'] = "Fixé";
+$text['label-fixed']['pt-br'] = "Fixo";
+$text['label-fixed']['pl'] = "Naprawiony";
+$text['label-fixed']['he'] = "קָבוּעַ";
+$text['label-fixed']['uk'] = "фіксований";
+$text['label-fixed']['sv-se'] = "Fast";
+$text['label-fixed']['de-at'] = "fest";
+$text['label-fixed']['ro'] = "Fix";
+$text['label-fixed']['fa'] = "";
+$text['label-fixed']['ar-eg'] = "ثابت";
+
+$text['label-domain']['en-us'] = "Domain";
+$text['label-domain']['es-cl'] = "Dominio";
+$text['label-domain']['pt-pt'] = "Domínio";
+$text['label-domain']['fr-fr'] = "Domaine";
+$text['label-domain']['pt-br'] = "Dominio";
+$text['label-domain']['pl'] = "Domena";
+$text['label-domain']['sv-se'] = "Domän";
+$text['label-domain']['uk'] = "Домен";
+$text['label-domain']['de-at'] = "Domain";
+
+$text['label-center']['en-us'] = "Center";
+$text['label-center']['es-cl'] = "Centrar";
+$text['label-center']['pt-pt'] = "Centro";
+$text['label-center']['fr-fr'] = "centre";
+$text['label-center']['pt-br'] = "Centro";
+$text['label-center']['pl'] = "Centrum";
+$text['label-center']['he'] = "מֶרְכָּז";
+$text['label-center']['uk'] = "центр";
+$text['label-center']['sv-se'] = "Centrum";
+$text['label-center']['de-at'] = "Center";
+$text['label-center']['ro'] = "Centru";
+$text['label-center']['fa'] = "";
+$text['label-center']['ar-eg'] = "مركز";
+
+$text['label-bottom']['en-us'] = "Bottom";
+$text['label-bottom']['es-cl'] = "Fondo";
+$text['label-bottom']['pt-pt'] = "Inferior";
+$text['label-bottom']['fr-fr'] = "Bas";
+$text['label-bottom']['pt-br'] = "Inferior";
+$text['label-bottom']['pl'] = "Dolny";
+$text['label-bottom']['he'] = "תַחתִית";
+$text['label-bottom']['uk'] = "дно";
+$text['label-bottom']['sv-se'] = "Botten";
+$text['label-bottom']['de-at'] = "Boden";
+$text['label-bottom']['ro'] = "Fund";
+$text['label-bottom']['fa'] = "";
+$text['label-bottom']['ar-eg'] = "أسفل";
+
+$text['label-24-hour']['en-us'] = "24-Hour";
+$text['label-24-hour']['es-cl'] = "24 horas";
+$text['label-24-hour']['pt-pt'] = "24 horas";
+$text['label-24-hour']['fr-fr'] = "24 heures";
+$text['label-24-hour']['pt-br'] = "24 horas";
+$text['label-24-hour']['pl'] = "24-godzinny";
+$text['label-24-hour']['he'] = "24 שעות";
+$text['label-24-hour']['uk'] = "24-годинний";
+$text['label-24-hour']['sv-se'] = "24-timmars";
+$text['label-24-hour']['de-at'] = "24 Stunden";
+$text['label-24-hour']['ro'] = "24 de ore";
+$text['label-24-hour']['fa'] = "";
+$text['label-24-hour']['ar-eg'] = "24 ساعة";
+
+$text['label-12-hour']['en-us'] = "12-Hour";
+$text['label-12-hour']['es-cl'] = "12 horas";
+$text['label-12-hour']['pt-pt'] = "12 horas";
+$text['label-12-hour']['fr-fr'] = "12 heures";
+$text['label-12-hour']['pt-br'] = "12 horas";
+$text['label-12-hour']['pl'] = "12-godzinny";
+$text['label-12-hour']['he'] = "12 שעות";
+$text['label-12-hour']['uk'] = "12-годинний";
+$text['label-12-hour']['sv-se'] = "12-timmars";
+$text['label-12-hour']['de-at'] = "12 Stunden";
+$text['label-12-hour']['ro'] = "12 de ore";
+$text['label-12-hour']['fa'] = "";
+$text['label-12-hour']['ar-eg'] = "12 ساعة";
+
+$text['header-settings']['en-us'] = "Settings";
+$text['header-settings']['es-cl'] = "Configuraciones";
+$text['header-settings']['pt-pt'] = "Definições";
+$text['header-settings']['fr-fr'] = "Paramètres";
+$text['header-settings']['pt-br'] = "Configurações";
+$text['header-settings']['pl'] = "Ustawienia";
+$text['header-settings']['sv-se'] = "Inställning";
+$text['header-settings']['uk'] = "Налаштування";
+$text['header-settings']['de-at'] = "Einstellungen";
+
+$text['header-domains']['en-us'] = "Domains";
+$text['header-domains']['es-cl'] = "Dominios";
+$text['header-domains']['pt-pt'] = "Domínios";
+$text['header-domains']['fr-fr'] = "Domaines";
+$text['header-domains']['pt-br'] = "Dominios";
+$text['header-domains']['pl'] = "Domeny";
+$text['header-domains']['sv-se'] = "Domäner";
+$text['header-domains']['uk'] = "Домени";
+$text['header-domains']['de-at'] = "Domains";
+
+$text['header-domain_setting-edit']['en-us'] = "Domain Setting";
+$text['header-domain_setting-edit']['es-cl'] = "Configuraciones de dominio";
+$text['header-domain_setting-edit']['pt-pt'] = "Definições do Domínio";
+$text['header-domain_setting-edit']['fr-fr'] = "Paramètres du domaine";
+$text['header-domain_setting-edit']['pt-br'] = "Configurações do dominio";
+$text['header-domain_setting-edit']['pl'] = "Ustawienia domeny";
+$text['header-domain_setting-edit']['sv-se'] = "Domän Inställning";
+$text['header-domain_setting-edit']['uk'] = "Налаштування домену";
+$text['header-domain_setting-edit']['de-at'] = "Domain Einstellungen";
+
+$text['header-domain_setting-add']['en-us'] = "Domain Setting Add";
+$text['header-domain_setting-add']['es-cl'] = "Agregar Configuración de Dominio";
+$text['header-domain_setting-add']['pt-pt'] = "Adicionar Definição ao Domínio";
+$text['header-domain_setting-add']['fr-fr'] = "Ajouter un paramètre au domaine";
+$text['header-domain_setting-add']['pt-br'] = "Adicionar configuração ao dominio";
+$text['header-domain_setting-add']['pl'] = "Dodaj ustawienie domeny";
+$text['header-domain_setting-add']['sv-se'] = "Lägg Till Domän Inställning";
+$text['header-domain_setting-add']['uk'] = "Параметри домену";
+$text['header-domain_setting-add']['de-at'] = "Domain Einstellungen hinzufügen";
+
+$text['header-domain-edit']['en-us'] = "Domain";
+$text['header-domain-edit']['es-cl'] = "Dominio";
+$text['header-domain-edit']['pt-pt'] = "Domínio";
+$text['header-domain-edit']['fr-fr'] = "Domaine";
+$text['header-domain-edit']['pt-br'] = "Dominio";
+$text['header-domain-edit']['pl'] = "Domena";
+$text['header-domain-edit']['sv-se'] = "Domän";
+$text['header-domain-edit']['uk'] = "Домен";
+$text['header-domain-edit']['de-at'] = "Domain";
+
+$text['header-domain-add']['en-us'] = "Domain Add";
+$text['header-domain-add']['es-cl'] = "Agregar Dominio";
+$text['header-domain-add']['pt-pt'] = "Adicionar Domínio";
+$text['header-domain-add']['fr-fr'] = "Ajouter un Domaine";
+$text['header-domain-add']['pt-br'] = "Adicionar dominio";
+$text['header-domain-add']['pl'] = "Dodaj domenę";
+$text['header-domain-add']['sv-se'] = "Lägg Till Domän";
+$text['header-domain-add']['uk'] = "Новий домен";
+$text['header-domain-add']['de-at'] = "Domain hinzufügen";
+
+$text['description-setting_enabled']['en-us'] = "Set the status of this default setting.";
+$text['description-setting_enabled']['es-cl'] = "Configure el estado de esta configuración predeterminada.";
+$text['description-setting_enabled']['pt-pt'] = "Escolha o estado desta definição por omissão.";
+$text['description-setting_enabled']['fr-fr'] = "Choisir l'état de ce paramètre";
+$text['description-setting_enabled']['pt-br'] = "Escolha o estado desta configuração";
+$text['description-setting_enabled']['pl'] = "Wybierz, aby włączyć lub wyłączyć tę funkcję.";
+$text['description-setting_enabled']['sv-se'] = "Ange status på denna standard inställning.";
+$text['description-setting_enabled']['uk'] = "Встановіть стан цього параметра за замовчуванням.";
+$text['description-setting_enabled']['de-at'] = "Setzen Sie den Status dieser Standardeinstellung.";
+
+$text['description-parent_domain']['en-us'] = "Set the parent domain.";
+$text['description-parent_domain']['es-cl'] = "Establecer el dominio principal.";
+$text['description-parent_domain']['pt-pt'] = "Defina o domínio pai.";
+$text['description-parent_domain']['fr-fr'] = "Réglez le domaine parent.";
+$text['description-parent_domain']['pt-br'] = "Defina o dominio pai";
+$text['description-parent_domain']['pl'] = "Ustaw domenę nadrzędną";
+$text['description-parent_domain']['sv-se'] = "Ange Överordan Domän.";
+$text['description-parent_domain']['uk'] = "Вкажіть батьківський домен";
+$text['description-parent_domain']['de-at'] = "Setzen Sie die übergeordnete Domain.";
+
+$text['description-order']['en-us'] = "Set the order for this array element.";
+$text['description-order']['es-cl'] = "Establecer el orden para este elemento de la matriz.";
+$text['description-order']['pt-pt'] = "Definir a ordem para este elemento do array.";
+$text['description-order']['fr-fr'] = "Définissez l'ordre de cet élément de tableau.";
+$text['description-order']['pt-br'] = "Defina a ordem (indice) para este elemento da matriz";
+$text['description-order']['pl'] = "Wybierz kolejność.";
+$text['description-order']['sv-se'] = "Ställ in ordningen för detta element.";
+$text['description-order']['uk'] = "Вкажіть порядок для масиву елементів";
+$text['description-order']['de-at'] = "Wählen Sie die Reihenfolge des Array Elements.";
+
+$text['description-name']['en-us'] = "Enter the name of the domain.";
+$text['description-name']['es-cl'] = "Ingrese el nombre del dominio";
+$text['description-name']['pt-pt'] = "Introduza o nome do domínio.";
+$text['description-name']['fr-fr'] = "Entrer le nom du domaine.";
+$text['description-name']['pt-br'] = "Insira o nome do menu";
+$text['description-name']['pl'] = "Wprowadź nazwę";
+$text['description-name']['sv-se'] = "Ange namn på Domänen.";
+$text['description-name']['uk'] = "Вкажіть назву домену";
+$text['description-name']['de-at'] = "Geben Sie den Namen dieser Domain an";
+
+$text['description-domains']['en-us'] = "Control the list of domains to manage.";
+$text['description-domains']['es-cl'] = "Controlar la lista de dominios a gestionar.";
+$text['description-domains']['pt-pt'] = "Controlar a lista dos domínios a gerir";
+$text['description-domains']['fr-fr'] = "Contrôler la liste des domaines à gérer";
+$text['description-domains']['pt-br'] = "Gerencie a lista dos dominios";
+$text['description-domains']['pl'] = "Zarządzanie listą domen.";
+$text['description-domains']['sv-se'] = "Kontrollera lista med Domäner att hantera.";
+$text['description-domains']['uk'] = "Список доменів для керування";
+$text['description-domains']['de-at'] = "Eine Liste aller Domains.";
+
+$text['description-domain_setting-edit']['en-us'] = "Edit a setting for this domain.";
+$text['description-domain_setting-edit']['es-cl'] = "Edita una configuración para este dominio.";
+$text['description-domain_setting-edit']['pt-pt'] = "Editar uma definição deste domínio.";
+$text['description-domain_setting-edit']['fr-fr'] = "Editer un paramètre du domaine.";
+$text['description-domain_setting-edit']['pt-br'] = "Editar uma configuração deste dominio";
+$text['description-domain_setting-edit']['pl'] = "Edytuj ustawienia w tej domenie";
+$text['description-domain_setting-edit']['sv-se'] = "Ändra en inställning för denna Domän.";
+$text['description-domain_setting-edit']['uk'] = "Редагування параметрів для домену";
+$text['description-domain_setting-edit']['de-at'] = "Eine Einstellung für diese Domain ändern.";
+
+$text['description-domain_setting-add']['en-us'] = "Add a setting for this domain.";
+$text['description-domain_setting-add']['es-cl'] = "Agregar una configuración para este dominio.";
+$text['description-domain_setting-add']['pt-pt'] = "Adicionar uma definição a este domínio.";
+$text['description-domain_setting-add']['fr-fr'] = "";
+$text['description-domain_setting-add']['pt-br'] = "Adicionar uma configuração a este dominio";
+$text['description-domain_setting-add']['pl'] = "Dodaj ustawienie w tej domenie";
+$text['description-domain_setting-add']['sv-se'] = "Lägg Till en inställning för denna Domän.";
+$text['description-domain_setting-add']['uk'] = "Додавання параметра для домену";
+$text['description-domain_setting-add']['de-at'] = "Eine Einstellung für diese Domain hinzufügen.";
+
+$text['description-domain_enabled']['en-us'] = "Set the status of the domain.";
+$text['description-domain_enabled']['es-cl'] = "Ajuste el estado del dominio.";
+$text['description-domain_enabled']['pt-pt'] = "Definir o estado do domínio.";
+$text['description-domain_enabled']['fr-fr'] = "Régler le statut du domaine.";
+$text['description-domain_enabled']['pt-br'] = "Definir o estado do dominio";
+$text['description-domain_enabled']['pl'] = "Ustaw status tej domeny.";
+$text['description-domain_enabled']['sv-se'] = "Ange status för Domänen.";
+$text['description-domain_enabled']['uk'] = "Вкажіть стан домену";
+$text['description-domain_enabled']['de-at'] = "Den Status der Domain setzen.";
+
+$text['description-domain-edit']['en-us'] = "Edit the details of this domain.";
+$text['description-domain-edit']['es-cl'] = "Editar detalles de este dominio.";
+$text['description-domain-edit']['pt-pt'] = "Editar detalhes deste domínio.";
+$text['description-domain-edit']['fr-fr'] = "Editer les détaisl de ce domaine. ";
+$text['description-domain-edit']['pt-br'] = "Editar detalhes deste dominio";
+$text['description-domain-edit']['pl'] = "Edytuj szczegóły tej domeny.";
+$text['description-domain-edit']['sv-se'] = "Ändra detaljer för denna Domän.";
+$text['description-domain-edit']['uk'] = "Редагування деталей домену";
+$text['description-domain-edit']['de-at'] = "Die Details dieser Domain ändern.";
+
+$text['description-domain-add']['en-us'] = "Enter the domain details below.";
+$text['description-domain-add']['es-cl'] = "Ingrese los detalles del dominio a continuación.";
+$text['description-domain-add']['pt-pt'] = "Introduza os detalhes do domínio abaixo.";
+$text['description-domain-add']['fr-fr'] = "Entrer les détails du domaine ci-dessous.";
+$text['description-domain-add']['pt-br'] = "Insira os detalhes do dominio abaixo";
+$text['description-domain-add']['pl'] = "Poniżej wprowadź szczegóły domeny";
+$text['description-domain-add']['sv-se'] = "Ange domändetaljer nedan.";
+$text['description-domain-add']['uk'] = "Введіть дані домену нижче.";
+$text['description-domain-add']['de-at'] = "Geben Sie die Domain Details unten an.";
+
 ?>

+ 163 - 163
core/events/resources/classes/events.php

@@ -1,164 +1,164 @@
-<?php
-
-/**
- * events class provides an event system
- *
- * @method void load_plugins
- * @method dynamic __call
- */
-class events {
-
-	/**
-	 * @var obj $db 			Database connnection object
-	 * @var array $plugins		Store available plugin classes
-	 * @var array $methods		store methods found on each plugin
-	 * @var array $headers		headers provide information about the events
-	 * @var array $required		array of items that are required
-	 * @var string $content		optional additional data about the event
-	 */
-	public $db;
-	private $plugins = array();
-	private $methods = array();
-	public  $headers = array();
-	public  $required = array();
-	private $content;
-
-	/**
-	 * Called when the object is created
-	 * Creates the database connection object
-	 */
-	public function __construct() {
-		//create the database connection
-			include "root.php";
-			require_once "resources/classes/database.php";
-			$database = new database;
-			$database->connect();
-			$this->db = $database->db;
-			return $this->db = $database->db;
-
-		//load the plugins
-			$this->load_plugins();
-
-		//add values to the required array
-			$this->required['headers'][] = "content-type";
-			$this->required['headers'][] = "date";
-			$this->required['headers'][] = "host";
-			$this->required['headers'][] = "status";
-			$this->required['headers'][] = "app_name";
-			$this->required['headers'][] = "app_uuid";
-			$this->required['headers'][] = "domain_uuid";
-			$this->required['headers'][] = "user_uuid";
-	}
-
-	/**
-	 * Called when there are no references to a particular object
-	 * unset the variables used in the class
-	 */
-	public function __destruct() {
-		foreach ($this as $key => $value) {
-			unset($this->$key);
-		}
-	}
-
-	/**
-	 * This function will load all available plugins into the memory
-	 * Rules:
-	 * 		plugins are stored in ./plugins
-	 * 		plugin class is named plugin_<name>
-	 * 		php file is named <name>.php
-	 */
-	private function load_plugins() {
-		$base = realpath(dirname(__FILE__)) . "/plugins";
-		$this->plugins = glob($base . "/*.php");
-		foreach($this->plugins as $plugin) {
-			//include the plugin php file and define the class name
-				include_once $plugin;
-				$plugin_name = basename($plugin, ".php");
-				$class_name = "plugin_".$plugin_name;
-
-			//create the plugin object so that it can be stored and called later
-				$obj = new $class_name();
-				$this->plugins[$plugin_name] = $obj;
-
-			//store all methods found in the plugin
-				foreach (get_class_methods($obj) as $method ) {
-					$this->methods[$method] = $plugin_name;
-				}
-
-		}
-	}
-
-	/**
-	 * Run the plugin method
-	 * @param strint $method
-	 * @param string $args
-	 *
-	 */
-	public function __call($method, $args) {
-		if (! key_exists($method, $this->methods)) {
-			throw new Exception ("Call to undefined method: " . $method);
-		}
-		array_unshift($args, $this);
-		try {
-			$obj = call_user_func_array(array($this->plugins[$this->methods[$method]], $method), $args);
-		}
-		catch (Exception $e) {
-			echo 'Exception: ',  $e->getMessage(), "\n";
-		}
-		return $obj;
-	}
-
-	/**
-	 * Set a new event header
-	 * @param string $category
-	 * @param string $name
-	 * @param string $value
-	 */
-	public function set_header($category, $name, $value) {
-		$this->headers[$category][$name] = $value;
-	}
-
-	/**
-	 * check for required headers
-	 * @param string $category
-	 * @return bolean $value
-	 */
-	public function check_required($category) {
-		foreach ($this->required['headers'] as &$header) {
-			if ($category == $header) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	/**
-	 * Send the event
-	 */
-	public function send() {
-		//check for required headers are present return false if any are missing
-			foreach ($this->headers as &$header) {
-				if (!$this->check_required($header)) {
-					return false;
-				}
-			}
-
-		//$this->content;
-	}
-
-	/**
-	 * Serialize the event headers
-	 * @param string $type  values: array, json
-	 */
-	public function serialize($type) {
-		$array = $this->headers;
-		if ($type == "array") {
-			return $array;
-		} elseif ($type == "json") {
-			return json_encode($array);
-		}
-	}
-
-}
-
+<?php
+
+/**
+ * events class provides an event system
+ *
+ * @method void load_plugins
+ * @method dynamic __call
+ */
+class events {
+
+	/**
+	 * @var obj $db 			Database connnection object
+	 * @var array $plugins		Store available plugin classes
+	 * @var array $methods		store methods found on each plugin
+	 * @var array $headers		headers provide information about the events
+	 * @var array $required		array of items that are required
+	 * @var string $content		optional additional data about the event
+	 */
+	public $db;
+	private $plugins = array();
+	private $methods = array();
+	public  $headers = array();
+	public  $required = array();
+	private $content;
+
+	/**
+	 * Called when the object is created
+	 * Creates the database connection object
+	 */
+	public function __construct() {
+		//create the database connection
+			include "root.php";
+			require_once "resources/classes/database.php";
+			$database = new database;
+			$database->connect();
+			$this->db = $database->db;
+			return $this->db = $database->db;
+
+		//load the plugins
+			$this->load_plugins();
+
+		//add values to the required array
+			$this->required['headers'][] = "content-type";
+			$this->required['headers'][] = "date";
+			$this->required['headers'][] = "host";
+			$this->required['headers'][] = "status";
+			$this->required['headers'][] = "app_name";
+			$this->required['headers'][] = "app_uuid";
+			$this->required['headers'][] = "domain_uuid";
+			$this->required['headers'][] = "user_uuid";
+	}
+
+	/**
+	 * Called when there are no references to a particular object
+	 * unset the variables used in the class
+	 */
+	public function __destruct() {
+		foreach ($this as $key => $value) {
+			unset($this->$key);
+		}
+	}
+
+	/**
+	 * This function will load all available plugins into the memory
+	 * Rules:
+	 * 		plugins are stored in ./plugins
+	 * 		plugin class is named plugin_<name>
+	 * 		php file is named <name>.php
+	 */
+	private function load_plugins() {
+		$base = realpath(dirname(__FILE__)) . "/plugins";
+		$this->plugins = glob($base . "/*.php");
+		foreach($this->plugins as $plugin) {
+			//include the plugin php file and define the class name
+				include_once $plugin;
+				$plugin_name = basename($plugin, ".php");
+				$class_name = "plugin_".$plugin_name;
+
+			//create the plugin object so that it can be stored and called later
+				$obj = new $class_name();
+				$this->plugins[$plugin_name] = $obj;
+
+			//store all methods found in the plugin
+				foreach (get_class_methods($obj) as $method ) {
+					$this->methods[$method] = $plugin_name;
+				}
+
+		}
+	}
+
+	/**
+	 * Run the plugin method
+	 * @param strint $method
+	 * @param string $args
+	 *
+	 */
+	public function __call($method, $args) {
+		if (! key_exists($method, $this->methods)) {
+			throw new Exception ("Call to undefined method: " . $method);
+		}
+		array_unshift($args, $this);
+		try {
+			$obj = call_user_func_array(array($this->plugins[$this->methods[$method]], $method), $args);
+		}
+		catch (Exception $e) {
+			echo 'Exception: ',  $e->getMessage(), "\n";
+		}
+		return $obj;
+	}
+
+	/**
+	 * Set a new event header
+	 * @param string $category
+	 * @param string $name
+	 * @param string $value
+	 */
+	public function set_header($category, $name, $value) {
+		$this->headers[$category][$name] = $value;
+	}
+
+	/**
+	 * check for required headers
+	 * @param string $category
+	 * @return bolean $value
+	 */
+	public function check_required($category) {
+		foreach ($this->required['headers'] as &$header) {
+			if ($category == $header) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * Send the event
+	 */
+	public function send() {
+		//check for required headers are present return false if any are missing
+			foreach ($this->headers as &$header) {
+				if (!$this->check_required($header)) {
+					return false;
+				}
+			}
+
+		//$this->content;
+	}
+
+	/**
+	 * Serialize the event headers
+	 * @param string $type  values: array, json
+	 */
+	public function serialize($type) {
+		$array = $this->headers;
+		if ($type == "array") {
+			return $array;
+		} elseif ($type == "json") {
+			return json_encode($array);
+		}
+	}
+
+}
+
 ?>

+ 420 - 420
core/install/app_languages.php

@@ -1,421 +1,421 @@
-<?php
-
-$text['title-install']['en-us'] = "Install";
-$text['title-install']['es-cl'] = "Instale";
-$text['title-install']['pt-pt'] = "Installation";
-$text['title-install']['fr-fr'] = "Installation";
-$text['title-install']['pt-br'] = "Installation";
-$text['title-install']['pl'] = "Zainstalować";
-$text['title-install']['sv-se'] = "Installera";
-$text['title-install']['uk'] = "Перший раз Встановіть";
-$text['title-install']['de-at'] = "Erstinstallation";
-$text['title-install']['ar-eg'] = "للمرة الأولى قم بتثبيت";
-
-$text['title-detected_configuration']['en-us'] = "Detected Configuration";
-$text['title-detected_configuration']['es-cl'] = "Configuración detectado";
-$text['title-detected_configuration']['pt-pt'] = "Configuração detectado";
-$text['title-detected_configuration']['fr-fr'] = "Detected Configuration";
-$text['title-detected_configuration']['pt-br'] = "Configuração detectado";
-$text['title-detected_configuration']['pl'] = "Wykryto Konfiguracja";
-$text['title-detected_configuration']['sv-se'] = "Detekterad Konfiguration";
-$text['title-detected_configuration']['uk'] = "виявлено Конфігурація";
-$text['title-detected_configuration']['de-at'] = "Erkannt Configuration";
-$text['title-detected_configuration']['ar-eg'] = "تكوين الكشف عن";
-
-$text['title-assumed_configuration']['en-us'] = "Assumed Configuration";
-$text['title-assumed_configuration']['es-cl'] = "Configuración adoptada";
-$text['title-assumed_configuration']['pt-pt'] = "Assumed Configuration";
-$text['title-assumed_configuration']['fr-fr'] = "Configuration supposée";
-$text['title-assumed_configuration']['pt-br'] = "Assumed Configuration";
-$text['title-assumed_configuration']['pl'] = "Zakładana Konfiguracja";
-$text['title-assumed_configuration']['sv-se'] = "Antagen Konfiguration";
-$text['title-assumed_configuration']['uk'] = "передбачуваний Конфігурація";
-$text['title-assumed_configuration']['de-at'] = "Angenommene Configuration";
-$text['title-assumed_configuration']['ar-eg'] = "تكوين المفترضة";
-
-$text['label-ft-install']['en-us'] = "First Time Install";
-$text['label-ft-install']['es-cl'] = "La primera instalación";
-$text['label-ft-install']['pt-pt'] = "First Time Install";
-$text['label-ft-install']['fr-fr'] = "Première installation";
-$text['label-ft-install']['pt-br'] = "First Time Install";
-$text['label-ft-install']['pl'] = "Zainstalować";
-$text['label-ft-install']['sv-se'] = "Första gången Installera";
-$text['label-ft-install']['uk'] = "Перший раз Встановіть";
-$text['label-ft-install']['de-at'] = "Erstinstallation";
-$text['label-ft-install']['ar-eg'] = "للمرة الأولى قم بتثبيت";
-
-$text['description-ft-install']['en-us'] = "Perform all actions for a First Time Install";
-$text['description-ft-install']['es-cl'] = "Realizar todas las acciones para una primera instalación";
-$text['description-ft-install']['pt-pt'] = "Executar todas as ações para uma primeira vez Instalar";
-$text['description-ft-install']['fr-fr'] = "Effectuer toutes les actions pour une première installation";
-$text['description-ft-install']['pt-br'] = "Executar todas as ações para uma primeira vez Instalar";
-$text['description-ft-install']['pl'] = "Wykonać wszystkie czynności dla pierwszy raz zainstalować";
-$text['description-ft-install']['sv-se'] = "Utföra alla åtgärder för första gången Installera";
-$text['description-ft-install']['uk'] = "Виконайте всі дії для першого разу Встановіть";
-$text['description-ft-install']['de-at'] = "Führen Sie alle Aktionen für einen ersten Mal installieren";
-$text['description-ft-install']['ar-eg'] = "تنفيذ كافة الإجراءات لأول مرة التثبيت";
-
-$text['label-add-switch']['en-us'] = "Add a new switch";
-$text['label-add-switch']['es-cl'] = "Añadir un nuevo conmutador";
-$text['label-add-switch']['pt-pt'] = "Adicionar um novo switch";
-$text['label-add-switch']['fr-fr'] = "Ajouter un nouveau commutateur";
-$text['label-add-switch']['pt-br'] = "Adicionar um novo switch";
-$text['label-add-switch']['pl'] = "Dodaj nowy przełącznik";
-$text['label-add-switch']['sv-se'] = "Lägg till en ny switch";
-$text['label-add-switch']['uk'] = "Додати новий перемикач";
-$text['label-add-switch']['de-at'] = "Fügen Sie einen neuen Schalter";
-$text['label-add-switch']['ar-eg'] = "إضافة مفتاح جديد";
-
-$text['label-select_language']['en-us'] = "Language";
-$text['label-select_language']['es-cl'] = "Idioma";
-$text['label-select_language']['pt-pt'] = "Idioma";
-$text['label-select_language']['fr-fr'] = "Langue";
-$text['label-select_language']['pt-br'] = "Idioma";
-$text['label-select_language']['pl'] = "Język";
-$text['label-select_language']['sv-se'] = "Språk";
-$text['label-select_language']['uk'] = "Мова";
-$text['label-select_language']['de-at'] = "Sprache";
-$text['label-select_language']['ar-eg'] = "لغة";
-
-$text['label-event_host']['en-us'] = "Host address";
-$text['label-event_host']['es-cl'] = "Dirección de host";
-$text['label-event_host']['pt-pt'] = "Endereço do host";
-$text['label-event_host']['fr-fr'] = "Adresse de l'hôte";
-$text['label-event_host']['pt-br'] = "Endereço do host";
-$text['label-event_host']['pl'] = "Adres hosta";
-$text['label-event_host']['sv-se'] = "Host adress";
-$text['label-event_host']['uk'] = "адреса хоста";
-$text['label-event_host']['de-at'] = "Host-Adresse";
-$text['label-event_host']['ar-eg'] = "عنوان المضيف";
-
-$text['label-event_port']['en-us'] = "Port";
-$text['label-event_port']['es-cl'] = "Puerto";
-$text['label-event_port']['pt-pt'] = "Porto";
-$text['label-event_port']['fr-fr'] = "Port";
-$text['label-event_port']['pt-br'] = "Porta";
-$text['label-event_port']['pl'] = "Port";
-$text['label-event_port']['sv-se'] = "Port";
-$text['label-event_port']['uk'] = "Порт";
-$text['label-event_port']['de-at'] = "Port";
-$text['label-event_port']['ar-eg'] = "منفذ";
-
-$text['label-event_password']['en-us'] = "Password";
-$text['label-event_password']['es-cl'] = "Contreseña";
-$text['label-event_password']['pt-pt'] = "Palavra-Chave";
-$text['label-event_password']['fr-fr'] = "Mot de Passe";
-$text['label-event_password']['pt-br'] = "Senha";
-$text['label-event_password']['pl'] = "Hasło";
-$text['label-event_password']['sv-se'] = "Lösenord";
-$text['label-event_password']['uk'] = "Пароль";
-$text['label-event_password']['de-at'] = "Passwort";
-$text['label-event_password']['ar-eg'] = "كلمة السر";
-
-$text['label-username']['en-us'] = "Username";
-$text['label-username']['es-cl'] = "Nombre de usuario";
-$text['label-username']['pt-pt'] = "Utilizador";
-$text['label-username']['fr-fr'] = "Utilisateur";
-$text['label-username']['pt-br'] = "Nome do Usuário";
-$text['label-username']['pl'] = "Użytkownik";
-$text['label-username']['sv-se'] = "Användarnamn";
-$text['label-username']['uk'] = "Ім’я користувача";
-$text['label-username']['de-at'] = "Benutzername";
-$text['label-username']['ar-eg'] = "اسم المستخدم";
-
-$text['label-port']['en-us'] = "Port";
-$text['label-port']['es-cl'] = "Puerto";
-$text['label-port']['pt-pt'] = "Porto";
-$text['label-port']['fr-fr'] = "Port";
-$text['label-port']['pt-br'] = "Porta";
-$text['label-port']['pl'] = "Port";
-$text['label-port']['sv-se'] = "Port";
-$text['label-port']['uk'] = "Порт";
-$text['label-port']['de-at'] = "Port";
-$text['label-port']['ar-eg'] = "منفذ";
-
-$text['label-path']['en-us'] = "Path";
-$text['label-path']['es-cl'] = "Ruta";
-$text['label-path']['pt-pt'] = "Caminho";
-$text['label-path']['fr-fr'] = "Chemin";
-$text['label-path']['pt-br'] = "Caminho";
-$text['label-path']['pl'] = "Ścieżka";
-$text['label-path']['sv-se'] = "Sökväg";
-$text['label-path']['uk'] = "Шлях";
-$text['label-path']['de-at'] = "Pfad";
-$text['label-path']['ar-eg'] = "مسار";
-
-$text['label-host']['en-us'] = "Host";
-$text['label-host']['es-cl'] = "Host";
-$text['label-host']['pt-pt'] = "Máquina";
-$text['label-host']['fr-fr'] = "Hôte";
-$text['label-host']['pt-br'] = "Máquina";
-$text['label-host']['pl'] = "Host";
-$text['label-host']['sv-se'] = "Värd";
-$text['label-host']['uk'] = "Хост";
-$text['label-host']['de-at'] = "Host";
-$text['label-host']['ar-eg'] = "مضيف";
-
-$text['label-driver']['en-us'] = "Driver";
-$text['label-driver']['es-cl'] = "Controlador";
-$text['label-driver']['pt-pt'] = "Driver";
-$text['label-driver']['fr-fr'] = "Driver";
-$text['label-driver']['pt-br'] = "Driver";
-$text['label-driver']['pl'] = "Sterownik";
-$text['label-driver']['sv-se'] = "Drivrutin";
-$text['label-driver']['uk'] = "Драйвер";
-$text['label-driver']['de-at'] = "Treiber";
-$text['label-driver']['ar-eg'] = "سائق";
-
-$text['header-install']['en-us'] = "Install";
-$text['header-install']['es-cl'] = "Instalar";
-$text['header-install']['pt-pt'] = "Instalar";
-$text['header-install']['fr-fr'] = "Installer";
-$text['header-install']['pt-br'] = "Instalar";
-$text['header-install']['pl'] = "Zainstalować";
-$text['header-install']['sv-se'] = "Installera";
-$text['header-install']['uk'] = "встановлювати";
-$text['header-install']['de-at'] = "Installieren";
-$text['header-install']['ar-eg'] = "تثبيت";
-
-$text['header-select_language']['en-us'] = "Select Language";
-$text['header-select_language']['es-cl'] = "Selecciona idioma";
-$text['header-select_language']['pt-pt'] = "Selecione o idioma";
-$text['header-select_language']['fr-fr'] = "Sélectionnez la langue";
-$text['header-select_language']['pt-br'] = "Selecione o idioma";
-$text['header-select_language']['pl'] = "Wybierz język";
-$text['header-select_language']['sv-se'] = "Välj språk";
-$text['header-select_language']['uk'] = "вибір мови";
-$text['header-select_language']['de-at'] = "Sprache wählen";
-$text['header-select_language']['ar-eg'] = "اختار اللغة";
-
-$text['header-event_socket']['en-us'] = "Event Socket Configuration";
-$text['header-event_socket']['es-cl'] = "Configuración del zócalo evento";
-$text['header-event_socket']['pt-pt'] = "Configuração soquete evento";
-$text['header-event_socket']['fr-fr'] = "Event Configuration Socket";
-$text['header-event_socket']['pt-br'] = "Configuração soquete evento";
-$text['header-event_socket']['pl'] = "Zdarzenie Gniazdo Konfiguracja";
-$text['header-event_socket']['sv-se'] = "Händelse Socket Konfiguration";
-$text['header-event_socket']['uk'] = "Конфігурація гніздо Подія";
-$text['header-event_socket']['de-at'] = "Veranstaltungssockelkonfiguration";
-$text['header-event_socket']['ar-eg'] = "تكوين المقبس الحدث";
-
-$text['header-config_detail']['en-us'] = "Admin Configuration";
-$text['header-config_detail']['es-cl'] = "Configuración de administración";
-$text['header-config_detail']['pt-pt'] = "Configuração de administrador";
-$text['header-config_detail']['fr-fr'] = "Configuration Admin";
-$text['header-config_detail']['pt-br'] = "Configuração de administrador";
-$text['header-config_detail']['pl'] = "Konfiguracja Admin";
-$text['header-config_detail']['sv-se'] = "Admin Konfiguration";
-$text['header-config_detail']['uk'] = "конфігурація Адмін";
-$text['header-config_detail']['de-at'] = "Admin-Konfiguration";
-$text['header-config_detail']['ar-eg'] = "تكوين المشرف";
-
-$text['header-config_database']['en-us'] = "Database Configuration";
-$text['header-config_database']['es-cl'] = "Configuración de la base de datos";
-$text['header-config_database']['pt-pt'] = "Configuration Database";
-$text['header-config_database']['fr-fr'] = "Configuration de base de données";
-$text['header-config_database']['pt-br'] = "Configuration Database";
-$text['header-config_database']['pl'] = "Konfiguracja bazy danych";
-$text['header-config_database']['sv-se'] = "Databaskonfiguration ";
-$text['header-config_database']['uk'] = "конфігурація бази даних";
-$text['header-config_database']['de-at'] = "Datenbankkonfiguration ";
-$text['header-config_database']['ar-eg'] = "تكوين قاعدة بيانات";
-
-$text['header-installing']['en-us'] = "Executing Install";
-$text['header-installing']['es-cl'] = "Instalar la ejecución";
-$text['header-installing']['pt-pt'] = "Execução Instalar";
-$text['header-installing']['fr-fr'] = "Installez exécution";
-$text['header-installing']['pt-br'] = "Execução Instalar";
-$text['header-installing']['pl'] = "Wykonywanie Install";
-$text['header-installing']['sv-se'] = "Exekvera Installera";
-$text['header-installing']['uk'] = "виконання Встановіть";
-$text['header-installing']['de-at'] = "Ausführen Installieren";
-$text['header-installing']['ar-eg'] = "تنفيذ التثبيت";
-
-$text['description-event_host']['en-us'] = "Enter the event socket host name or IP address.";
-$text['description-event_host']['es-cl'] = "Introduzca el nombre de host toma evento o dirección IP.";
-$text['description-event_host']['pt-pt'] = "Digite o nome do host tomada evento ou endereço IP.";
-$text['description-event_host']['fr-fr'] = "Entrez le socket nom d'hôte de l'événement ou de l'adresse IP.";
-$text['description-event_host']['pt-br'] = "Digite o nome do host tomada evento ou endereço IP.";
-$text['description-event_host']['pl'] = "Wprowadź nazwę hosta gniazda wydarzenie lub adres IP.";
-$text['description-event_host']['sv-se'] = "Ange händelsen uttag värdnamn eller IP-adress.";
-$text['description-event_host']['uk'] = "Введіть проведення сокета ім'я хоста або IP-адресу.";
-$text['description-event_host']['de-at'] = "Geben Sie das Ereignis Buchse Hostnamen oder die IP-Adresse .";
-$text['description-event_host']['ar-eg'] = "أدخل اسم المضيف مأخذ الحدث.";
-
-$text['description-event_port']['en-us'] = "Enter the event socket port number.";
-$text['description-event_port']['es-cl'] = "Introduzca el número de puerto de socket evento.";
-$text['description-event_port']['pt-pt'] = "Digite o número do evento porta de soquete.";
-$text['description-event_port']['fr-fr'] = "Entrez le numéro cas de port du socket.";
-$text['description-event_port']['pt-br'] = "Digite o número do evento porta de soquete.";
-$text['description-event_port']['pl'] = "Wprowadź numer portu gniazda zdarzenia.";
-$text['description-event_port']['sv-se'] = "Ange händelsen socket portnummer.";
-$text['description-event_port']['uk'] = "Введіть номер подія гніздо порту.";
-$text['description-event_port']['de-at'] = "Geben Sie das Ereignis Socket-Portnummer.";
-$text['description-event_port']['ar-eg'] = "أدخل رقم الحدث ميناء المقبس.";
-
-$text['description-event_password']['en-us'] = "Enter the event socket password.";
-$text['description-event_password']['es-cl'] = "Introduzca la toma evento contraseña.";
-$text['description-event_password']['pt-pt'] = "Digite tomada a senha evento.";
-$text['description-event_password']['fr-fr'] = "Saisissez la prise de mot de passe de l'événement.";
-$text['description-event_password']['pt-br'] = "Digite tomada a senha evento.";
-$text['description-event_password']['pl'] = "Wprowadź hasło gniazda zdarzenia.";
-$text['description-event_password']['sv-se'] = "Ange händelsen uttag lösenord.";
-$text['description-event_password']['uk'] = "Введіть гніздо пароль подією.";
-$text['description-event_password']['de-at'] = "Geben Sie das Ereignis Passwort Steckdose.";
-$text['description-event_password']['ar-eg'] = "أدخل كلمة المرور مأخذ الحدث.";
-
-$text['description-username']['en-us'] = "Enter the database username.";
-$text['description-username']['es-cl'] = "Ingrese el nombre de usuario de la base de datos.";
-$text['description-username']['pt-pt'] = "Introduza o utilizador da base de dados.";
-$text['description-username']['fr-fr'] = "Entrer le nom d'utilisateur de la Base de données.";
-$text['description-username']['pt-br'] = "Insira o nome do usuário";
-$text['description-username']['pl'] = "Wprowadź nazwę użytkownika";
-$text['description-username']['sv-se'] = "Ange databasen användarnamn här.";
-$text['description-username']['uk'] = "Введіть ім’я користувача бази даних";
-$text['description-username']['de-at'] = "Geben Sie den Datenbank Benutzernamen an.";
-$text['description-username']['ar-eg'] = "أدخل اسم المستخدم هنا";
-
-$text['description-type']['en-us'] = "Select the database type.";
-$text['description-type']['es-cl'] = "Seleccione el tipo de base de datos";
-$text['description-type']['pt-pt'] = "Escolha o tipo de base de dados.";
-$text['description-type']['fr-fr'] = "Choisir le type de Base de données.";
-$text['description-type']['pt-br'] = "Introduza o tipo de definição.";
-$text['description-type']['pl'] = "Wprowadź rodzaj bazy danych";
-$text['description-type']['sv-se'] = "Välj databastyp";
-$text['description-type']['uk'] = "Виберіть тип бази даних";
-$text['description-type']['de-at'] = "Wählen Sie den Datenbank Typ.";
-$text['description-type']['ar-eg'] = "إختر نوع قاعدة البيانات";
-
-$text['description-port']['en-us'] = "Enter the port number.";
-$text['description-port']['es-cl'] = "Ingrese el número del puerto.";
-$text['description-port']['pt-pt'] = "Introduza o número do porto.";
-$text['description-port']['fr-fr'] = "Entrer le numéro de port.";
-$text['description-port']['pt-br'] = "Insira o número da porta";
-$text['description-port']['pl'] = "Wprowadź numer portu";
-$text['description-port']['sv-se'] = "Ange portnummer";
-$text['description-port']['uk'] = "Введіть номер порта";
-$text['description-port']['de-at'] = "Geben Sie die Port Nummer an.";
-$text['description-port']['ar-eg'] = "أدخل رقم المنفذ";
-
-$text['description-path']['en-us'] = "Enter the database file path (SQLite only).";
-$text['description-path']['es-cl'] = "Ingrese la ruta al archivo de datos (solo SQLite).";
-$text['description-path']['pt-pt'] = "Introduza o caminho da base de dados (apenas SQLite)";
-$text['description-path']['fr-fr'] = "Entrer le chemin du fichier Base de données (Spécifique SQLite).";
-$text['description-path']['pt-br'] = "Insira o caminho da base de dados (SQLite)";
-$text['description-path']['pl'] = "Wprowadź ścieżkę do pliku bazy danych (tylko SQLite)";
-$text['description-path']['sv-se'] = "Ange databasens sökväg (gäller endast SQLite).";
-$text['description-path']['uk'] = "Вкажіть шлях до файлу бази даних (тільки SQLite).";
-$text['description-path']['de-at'] = "Geben Sie den Datenbank Pfad an (nur für SQLite).";
-$text['description-path']['ar-eg'] = "أدخل مسار ملف قاعدة البيانات (سكليتي فقط).";
-
-$text['description-password']['en-us'] = "Enter the database password.";
-$text['description-password']['es-cl'] = "Ingrese la contraseña de la base de datos.";
-$text['description-password']['pt-pt'] = "Introduza a palavra-chave da base de dados.";
-$text['description-password']['fr-fr'] = "Entrer le mot de passe pour la Base de données.";
-$text['description-password']['pt-br'] = "Introduza a senha";
-$text['description-password']['pl'] = "Wpisz hasło";
-$text['description-password']['sv-se'] = "Ange databasens lösenord.";
-$text['description-password']['uk'] = "Введіть пароль бази даних.";
-$text['description-password']['de-at'] = "Geben Sie das Datenbank Passwort ein.";
-$text['description-password']['ar-eg'] = "أدخل الرقم السري الخاص بقاعدة البيانات";
-
-$text['description-name']['en-us'] = "Enter the database name.";
-$text['description-name']['es-cl'] = "Ingrese el nombre de la base de datos.";
-$text['description-name']['pt-pt'] = "Introduza o nome da base de dados.";
-$text['description-name']['fr-fr'] = "Entrer le nom de la Base de données.";
-$text['description-name']['pt-br'] = "Insira o nome do menu";
-$text['description-name']['pl'] = "Wprowadź nazwę bazy danych.";
-$text['description-name']['sv-se'] = "Ange databasens namn.";
-$text['description-name']['uk'] = "Введіть ім'я бази даних.";
-$text['description-name']['de-at'] = "Geben Sie den Namen der Datenbank an";
-$text['description-name']['ar-eg'] = "أدخل إسم قاعدة البيانات";
-
-$text['description-host']['en-us'] = "Enter the host name.";
-$text['description-host']['es-cl'] = "Ingrese el nombre de host";
-$text['description-host']['pt-pt'] = "Introduza o nome da máquina.";
-$text['description-host']['fr-fr'] = "Entrer le nom de l'hôte.";
-$text['description-host']['pt-br'] = "Insira o nome da máquina ";
-$text['description-host']['pl'] = "Wprowadź nazwę hosta.";
-$text['description-host']['sv-se'] = "Ange värdnamnet";
-$text['description-host']['uk'] = "Введіть ім'я хоста.";
-$text['description-host']['de-at'] = "Geben Sie den Host Namen ein.";
-$text['description-host']['ar-eg'] = "أدخل إسم المضيف";
-
-$text['description-driver']['en-us'] = "Select the database driver.";
-$text['description-driver']['es-cl'] = "Seleccione un controlador de base de datos.";
-$text['description-driver']['pt-pt'] = "Escolha o driver da base de dados";
-$text['description-driver']['fr-fr'] = "Choisir le driver de la Base de données.";
-$text['description-driver']['pt-br'] = "Escolha o driver da base de dados";
-$text['description-driver']['pl'] = "Wybierz sterownik bazy danych.";
-$text['description-driver']['sv-se'] = "Välj databas drivrutin.";
-$text['description-driver']['uk'] = "Виберіть драйвер бази даних.";
-$text['description-driver']['de-at'] = "Wählen Sie den Datenbank Treiber.";
-$text['description-driver']['ar-eg'] = "حدد برنامج تشغيل قاعدة البيانات.";
-
-$text['description-install']['en-us'] = "Select the action below you wish to perform.";
-$text['description-install']['es-cl'] = "Seleccione las accion a continuación que desea realizar.";
-$text['description-install']['pt-pt'] = "Selecione as ações abaixo você deseja executar.";	//action signular needed
-$text['description-install']['fr-fr'] = "Sélectionnez les action ci-dessous que vous souhaitez effectuer.";
-$text['description-install']['pt-br'] = "Seleciona as ações abaixo que deseja executar ";	//action signular needed
-$text['description-install']['pl'] = "Wybierz opcje, które chcesz wykonać.";	//action signular needed
-$text['description-install']['sv-se'] = "Välj de åtgärder nedan som du vill utföra.";	//action signular needed
-$text['description-install']['uk'] = "Виберіть об’єкти для оновлення";	//action signular needed
-$text['description-install']['de-at'] = "Wählen Sie eine Aktion.";	//action signular needed
-$text['description-install']['ar-eg'] = "حدد الإجراء أدناه كنت ترغب في القيام بها.";
-
-$text['description-database-edit']['en-us'] = "Database connection information.";
-$text['description-database-edit']['es-cl'] = "Información de conexión a base de datos.";
-$text['description-database-edit']['pt-pt'] = "Informação da ligação à base de dados.";
-$text['description-database-edit']['fr-fr'] = "Informations de connexion à la Base";
-$text['description-database-edit']['pt-br'] = "Informações da ligação na base de dados";
-$text['description-database-edit']['pl'] = "Informacje o połączeniach z bazą danych.";
-$text['description-database-edit']['sv-se'] = "Information om Databasanslutning";
-$text['description-database-edit']['uk'] = "інформація про підключення до бази даних.";
-$text['description-database-edit']['de-at'] = "Datenbank Verbindungs Information.";
-$text['description-database-edit']['ar-eg'] = "بيانات الإتصال الخاص بقاعدة البيانات";
-
-$text['description-database-add']['en-us'] = "Database connection information.";
-$text['description-database-add']['es-cl'] = "Información de conexión a base de datos.";
-$text['description-database-add']['pt-pt'] = "Informação da ligação à base de dados.";
-$text['description-database-add']['fr-fr'] = "Informations de connexion à la Base.";
-$text['description-database-add']['pt-br'] = "Informações da ligação na base de dados";
-$text['description-database-add']['pl'] = "Informacje o połączeniach z bazą danych.";
-$text['description-database-add']['sv-se'] = "Information om Databasanslutning";
-$text['description-database-add']['uk'] = "інформація про підключення до бази даних.";
-$text['description-database-add']['de-at'] = "Datenbank Verbindungs Information.";
-$text['description-database-add']['ar-eg'] = "بيانات الإتصال الخاص بقاعدة البيانات";
-
-$text['description-select_language']['en-us'] = "Please select the language you want to use";
-$text['description-select_language']['es-cl'] = "Por favor, seleccione el idioma que desea utilizar";
-$text['description-select_language']['pt-pt'] = "Por favor, selecione o idioma que deseja usar";
-$text['description-select_language']['fr-fr'] = "S'il vous plaît choisir la langue que vous souhaitez utiliser";
-$text['description-select_language']['pt-br'] = "Por favor, selecione o idioma que deseja usar";
-$text['description-select_language']['pl'] = "Wybierz język, którego chcesz używać";
-$text['description-select_language']['sv-se'] = "Välj det språk du vill använda";
-$text['description-select_language']['uk'] = "Виберіть мову, який ви хочете використовувати";
-$text['description-select_language']['de-at'] = "Bitte wählen Sie die gewünschte Sprache zu verwenden";
-$text['description-select_language']['ar-eg'] = "يرجى اختيار اللغة التي تريد استخدامها";
-
-$text['button-detect']['en-us'] = "Detect Configuration";
-$text['button-detect']['es-cl'] = "Detectar Configuración";
-$text['button-detect']['pt-pt'] = "Detectar Configuração";
-$text['button-detect']['fr-fr'] = "Détecter Configuration";
-$text['button-detect']['pt-br'] = "Detectar Configuração";
-$text['button-detect']['pl'] = "Wykrywanie Konfiguracja";
-$text['button-detect']['sv-se'] = "Detektera Konfiguration";
-$text['button-detect']['uk'] = "виявлення Конфігурація";
-$text['button-detect']['de-at'] = "Detect-Konfiguration";
-$text['button-detect']['ar-eg'] = "كشف تكوين";
-
-$text['button-select']['en-us'] = "Select";
-$text['button-select']['es-cl'] = "Seleccionar";
-$text['button-select']['pt-pt'] = "Selecionar";
-$text['button-select']['fr-fr'] = "Sélectionner";
-$text['button-select']['pt-br'] = "Selecionar";
-$text['button-select']['pl'] = "Wybierz";
-$text['button-select']['sv-se'] = "Välj";
-$text['button-select']['uk'] = "вибрати";
-$text['button-select']['de-at'] = "Wählen";
-$text['button-select']['ar-eg'] = "اختار";
-
+<?php
+
+$text['title-install']['en-us'] = "Install";
+$text['title-install']['es-cl'] = "Instale";
+$text['title-install']['pt-pt'] = "Installation";
+$text['title-install']['fr-fr'] = "Installation";
+$text['title-install']['pt-br'] = "Installation";
+$text['title-install']['pl'] = "Zainstalować";
+$text['title-install']['sv-se'] = "Installera";
+$text['title-install']['uk'] = "Перший раз Встановіть";
+$text['title-install']['de-at'] = "Erstinstallation";
+$text['title-install']['ar-eg'] = "للمرة الأولى قم بتثبيت";
+
+$text['title-detected_configuration']['en-us'] = "Detected Configuration";
+$text['title-detected_configuration']['es-cl'] = "Configuración detectado";
+$text['title-detected_configuration']['pt-pt'] = "Configuração detectado";
+$text['title-detected_configuration']['fr-fr'] = "Detected Configuration";
+$text['title-detected_configuration']['pt-br'] = "Configuração detectado";
+$text['title-detected_configuration']['pl'] = "Wykryto Konfiguracja";
+$text['title-detected_configuration']['sv-se'] = "Detekterad Konfiguration";
+$text['title-detected_configuration']['uk'] = "виявлено Конфігурація";
+$text['title-detected_configuration']['de-at'] = "Erkannt Configuration";
+$text['title-detected_configuration']['ar-eg'] = "تكوين الكشف عن";
+
+$text['title-assumed_configuration']['en-us'] = "Assumed Configuration";
+$text['title-assumed_configuration']['es-cl'] = "Configuración adoptada";
+$text['title-assumed_configuration']['pt-pt'] = "Assumed Configuration";
+$text['title-assumed_configuration']['fr-fr'] = "Configuration supposée";
+$text['title-assumed_configuration']['pt-br'] = "Assumed Configuration";
+$text['title-assumed_configuration']['pl'] = "Zakładana Konfiguracja";
+$text['title-assumed_configuration']['sv-se'] = "Antagen Konfiguration";
+$text['title-assumed_configuration']['uk'] = "передбачуваний Конфігурація";
+$text['title-assumed_configuration']['de-at'] = "Angenommene Configuration";
+$text['title-assumed_configuration']['ar-eg'] = "تكوين المفترضة";
+
+$text['label-ft-install']['en-us'] = "First Time Install";
+$text['label-ft-install']['es-cl'] = "La primera instalación";
+$text['label-ft-install']['pt-pt'] = "First Time Install";
+$text['label-ft-install']['fr-fr'] = "Première installation";
+$text['label-ft-install']['pt-br'] = "First Time Install";
+$text['label-ft-install']['pl'] = "Zainstalować";
+$text['label-ft-install']['sv-se'] = "Första gången Installera";
+$text['label-ft-install']['uk'] = "Перший раз Встановіть";
+$text['label-ft-install']['de-at'] = "Erstinstallation";
+$text['label-ft-install']['ar-eg'] = "للمرة الأولى قم بتثبيت";
+
+$text['description-ft-install']['en-us'] = "Perform all actions for a First Time Install";
+$text['description-ft-install']['es-cl'] = "Realizar todas las acciones para una primera instalación";
+$text['description-ft-install']['pt-pt'] = "Executar todas as ações para uma primeira vez Instalar";
+$text['description-ft-install']['fr-fr'] = "Effectuer toutes les actions pour une première installation";
+$text['description-ft-install']['pt-br'] = "Executar todas as ações para uma primeira vez Instalar";
+$text['description-ft-install']['pl'] = "Wykonać wszystkie czynności dla pierwszy raz zainstalować";
+$text['description-ft-install']['sv-se'] = "Utföra alla åtgärder för första gången Installera";
+$text['description-ft-install']['uk'] = "Виконайте всі дії для першого разу Встановіть";
+$text['description-ft-install']['de-at'] = "Führen Sie alle Aktionen für einen ersten Mal installieren";
+$text['description-ft-install']['ar-eg'] = "تنفيذ كافة الإجراءات لأول مرة التثبيت";
+
+$text['label-add-switch']['en-us'] = "Add a new switch";
+$text['label-add-switch']['es-cl'] = "Añadir un nuevo conmutador";
+$text['label-add-switch']['pt-pt'] = "Adicionar um novo switch";
+$text['label-add-switch']['fr-fr'] = "Ajouter un nouveau commutateur";
+$text['label-add-switch']['pt-br'] = "Adicionar um novo switch";
+$text['label-add-switch']['pl'] = "Dodaj nowy przełącznik";
+$text['label-add-switch']['sv-se'] = "Lägg till en ny switch";
+$text['label-add-switch']['uk'] = "Додати новий перемикач";
+$text['label-add-switch']['de-at'] = "Fügen Sie einen neuen Schalter";
+$text['label-add-switch']['ar-eg'] = "إضافة مفتاح جديد";
+
+$text['label-select_language']['en-us'] = "Language";
+$text['label-select_language']['es-cl'] = "Idioma";
+$text['label-select_language']['pt-pt'] = "Idioma";
+$text['label-select_language']['fr-fr'] = "Langue";
+$text['label-select_language']['pt-br'] = "Idioma";
+$text['label-select_language']['pl'] = "Język";
+$text['label-select_language']['sv-se'] = "Språk";
+$text['label-select_language']['uk'] = "Мова";
+$text['label-select_language']['de-at'] = "Sprache";
+$text['label-select_language']['ar-eg'] = "لغة";
+
+$text['label-event_host']['en-us'] = "Host address";
+$text['label-event_host']['es-cl'] = "Dirección de host";
+$text['label-event_host']['pt-pt'] = "Endereço do host";
+$text['label-event_host']['fr-fr'] = "Adresse de l'hôte";
+$text['label-event_host']['pt-br'] = "Endereço do host";
+$text['label-event_host']['pl'] = "Adres hosta";
+$text['label-event_host']['sv-se'] = "Host adress";
+$text['label-event_host']['uk'] = "адреса хоста";
+$text['label-event_host']['de-at'] = "Host-Adresse";
+$text['label-event_host']['ar-eg'] = "عنوان المضيف";
+
+$text['label-event_port']['en-us'] = "Port";
+$text['label-event_port']['es-cl'] = "Puerto";
+$text['label-event_port']['pt-pt'] = "Porto";
+$text['label-event_port']['fr-fr'] = "Port";
+$text['label-event_port']['pt-br'] = "Porta";
+$text['label-event_port']['pl'] = "Port";
+$text['label-event_port']['sv-se'] = "Port";
+$text['label-event_port']['uk'] = "Порт";
+$text['label-event_port']['de-at'] = "Port";
+$text['label-event_port']['ar-eg'] = "منفذ";
+
+$text['label-event_password']['en-us'] = "Password";
+$text['label-event_password']['es-cl'] = "Contreseña";
+$text['label-event_password']['pt-pt'] = "Palavra-Chave";
+$text['label-event_password']['fr-fr'] = "Mot de Passe";
+$text['label-event_password']['pt-br'] = "Senha";
+$text['label-event_password']['pl'] = "Hasło";
+$text['label-event_password']['sv-se'] = "Lösenord";
+$text['label-event_password']['uk'] = "Пароль";
+$text['label-event_password']['de-at'] = "Passwort";
+$text['label-event_password']['ar-eg'] = "كلمة السر";
+
+$text['label-username']['en-us'] = "Username";
+$text['label-username']['es-cl'] = "Nombre de usuario";
+$text['label-username']['pt-pt'] = "Utilizador";
+$text['label-username']['fr-fr'] = "Utilisateur";
+$text['label-username']['pt-br'] = "Nome do Usuário";
+$text['label-username']['pl'] = "Użytkownik";
+$text['label-username']['sv-se'] = "Användarnamn";
+$text['label-username']['uk'] = "Ім’я користувача";
+$text['label-username']['de-at'] = "Benutzername";
+$text['label-username']['ar-eg'] = "اسم المستخدم";
+
+$text['label-port']['en-us'] = "Port";
+$text['label-port']['es-cl'] = "Puerto";
+$text['label-port']['pt-pt'] = "Porto";
+$text['label-port']['fr-fr'] = "Port";
+$text['label-port']['pt-br'] = "Porta";
+$text['label-port']['pl'] = "Port";
+$text['label-port']['sv-se'] = "Port";
+$text['label-port']['uk'] = "Порт";
+$text['label-port']['de-at'] = "Port";
+$text['label-port']['ar-eg'] = "منفذ";
+
+$text['label-path']['en-us'] = "Path";
+$text['label-path']['es-cl'] = "Ruta";
+$text['label-path']['pt-pt'] = "Caminho";
+$text['label-path']['fr-fr'] = "Chemin";
+$text['label-path']['pt-br'] = "Caminho";
+$text['label-path']['pl'] = "Ścieżka";
+$text['label-path']['sv-se'] = "Sökväg";
+$text['label-path']['uk'] = "Шлях";
+$text['label-path']['de-at'] = "Pfad";
+$text['label-path']['ar-eg'] = "مسار";
+
+$text['label-host']['en-us'] = "Host";
+$text['label-host']['es-cl'] = "Host";
+$text['label-host']['pt-pt'] = "Máquina";
+$text['label-host']['fr-fr'] = "Hôte";
+$text['label-host']['pt-br'] = "Máquina";
+$text['label-host']['pl'] = "Host";
+$text['label-host']['sv-se'] = "Värd";
+$text['label-host']['uk'] = "Хост";
+$text['label-host']['de-at'] = "Host";
+$text['label-host']['ar-eg'] = "مضيف";
+
+$text['label-driver']['en-us'] = "Driver";
+$text['label-driver']['es-cl'] = "Controlador";
+$text['label-driver']['pt-pt'] = "Driver";
+$text['label-driver']['fr-fr'] = "Driver";
+$text['label-driver']['pt-br'] = "Driver";
+$text['label-driver']['pl'] = "Sterownik";
+$text['label-driver']['sv-se'] = "Drivrutin";
+$text['label-driver']['uk'] = "Драйвер";
+$text['label-driver']['de-at'] = "Treiber";
+$text['label-driver']['ar-eg'] = "سائق";
+
+$text['header-install']['en-us'] = "Install";
+$text['header-install']['es-cl'] = "Instalar";
+$text['header-install']['pt-pt'] = "Instalar";
+$text['header-install']['fr-fr'] = "Installer";
+$text['header-install']['pt-br'] = "Instalar";
+$text['header-install']['pl'] = "Zainstalować";
+$text['header-install']['sv-se'] = "Installera";
+$text['header-install']['uk'] = "встановлювати";
+$text['header-install']['de-at'] = "Installieren";
+$text['header-install']['ar-eg'] = "تثبيت";
+
+$text['header-select_language']['en-us'] = "Select Language";
+$text['header-select_language']['es-cl'] = "Selecciona idioma";
+$text['header-select_language']['pt-pt'] = "Selecione o idioma";
+$text['header-select_language']['fr-fr'] = "Sélectionnez la langue";
+$text['header-select_language']['pt-br'] = "Selecione o idioma";
+$text['header-select_language']['pl'] = "Wybierz język";
+$text['header-select_language']['sv-se'] = "Välj språk";
+$text['header-select_language']['uk'] = "вибір мови";
+$text['header-select_language']['de-at'] = "Sprache wählen";
+$text['header-select_language']['ar-eg'] = "اختار اللغة";
+
+$text['header-event_socket']['en-us'] = "Event Socket Configuration";
+$text['header-event_socket']['es-cl'] = "Configuración del zócalo evento";
+$text['header-event_socket']['pt-pt'] = "Configuração soquete evento";
+$text['header-event_socket']['fr-fr'] = "Event Configuration Socket";
+$text['header-event_socket']['pt-br'] = "Configuração soquete evento";
+$text['header-event_socket']['pl'] = "Zdarzenie Gniazdo Konfiguracja";
+$text['header-event_socket']['sv-se'] = "Händelse Socket Konfiguration";
+$text['header-event_socket']['uk'] = "Конфігурація гніздо Подія";
+$text['header-event_socket']['de-at'] = "Veranstaltungssockelkonfiguration";
+$text['header-event_socket']['ar-eg'] = "تكوين المقبس الحدث";
+
+$text['header-config_detail']['en-us'] = "Admin Configuration";
+$text['header-config_detail']['es-cl'] = "Configuración de administración";
+$text['header-config_detail']['pt-pt'] = "Configuração de administrador";
+$text['header-config_detail']['fr-fr'] = "Configuration Admin";
+$text['header-config_detail']['pt-br'] = "Configuração de administrador";
+$text['header-config_detail']['pl'] = "Konfiguracja Admin";
+$text['header-config_detail']['sv-se'] = "Admin Konfiguration";
+$text['header-config_detail']['uk'] = "конфігурація Адмін";
+$text['header-config_detail']['de-at'] = "Admin-Konfiguration";
+$text['header-config_detail']['ar-eg'] = "تكوين المشرف";
+
+$text['header-config_database']['en-us'] = "Database Configuration";
+$text['header-config_database']['es-cl'] = "Configuración de la base de datos";
+$text['header-config_database']['pt-pt'] = "Configuration Database";
+$text['header-config_database']['fr-fr'] = "Configuration de base de données";
+$text['header-config_database']['pt-br'] = "Configuration Database";
+$text['header-config_database']['pl'] = "Konfiguracja bazy danych";
+$text['header-config_database']['sv-se'] = "Databaskonfiguration ";
+$text['header-config_database']['uk'] = "конфігурація бази даних";
+$text['header-config_database']['de-at'] = "Datenbankkonfiguration ";
+$text['header-config_database']['ar-eg'] = "تكوين قاعدة بيانات";
+
+$text['header-installing']['en-us'] = "Executing Install";
+$text['header-installing']['es-cl'] = "Instalar la ejecución";
+$text['header-installing']['pt-pt'] = "Execução Instalar";
+$text['header-installing']['fr-fr'] = "Installez exécution";
+$text['header-installing']['pt-br'] = "Execução Instalar";
+$text['header-installing']['pl'] = "Wykonywanie Install";
+$text['header-installing']['sv-se'] = "Exekvera Installera";
+$text['header-installing']['uk'] = "виконання Встановіть";
+$text['header-installing']['de-at'] = "Ausführen Installieren";
+$text['header-installing']['ar-eg'] = "تنفيذ التثبيت";
+
+$text['description-event_host']['en-us'] = "Enter the event socket host name or IP address.";
+$text['description-event_host']['es-cl'] = "Introduzca el nombre de host toma evento o dirección IP.";
+$text['description-event_host']['pt-pt'] = "Digite o nome do host tomada evento ou endereço IP.";
+$text['description-event_host']['fr-fr'] = "Entrez le socket nom d'hôte de l'événement ou de l'adresse IP.";
+$text['description-event_host']['pt-br'] = "Digite o nome do host tomada evento ou endereço IP.";
+$text['description-event_host']['pl'] = "Wprowadź nazwę hosta gniazda wydarzenie lub adres IP.";
+$text['description-event_host']['sv-se'] = "Ange händelsen uttag värdnamn eller IP-adress.";
+$text['description-event_host']['uk'] = "Введіть проведення сокета ім'я хоста або IP-адресу.";
+$text['description-event_host']['de-at'] = "Geben Sie das Ereignis Buchse Hostnamen oder die IP-Adresse .";
+$text['description-event_host']['ar-eg'] = "أدخل اسم المضيف مأخذ الحدث.";
+
+$text['description-event_port']['en-us'] = "Enter the event socket port number.";
+$text['description-event_port']['es-cl'] = "Introduzca el número de puerto de socket evento.";
+$text['description-event_port']['pt-pt'] = "Digite o número do evento porta de soquete.";
+$text['description-event_port']['fr-fr'] = "Entrez le numéro cas de port du socket.";
+$text['description-event_port']['pt-br'] = "Digite o número do evento porta de soquete.";
+$text['description-event_port']['pl'] = "Wprowadź numer portu gniazda zdarzenia.";
+$text['description-event_port']['sv-se'] = "Ange händelsen socket portnummer.";
+$text['description-event_port']['uk'] = "Введіть номер подія гніздо порту.";
+$text['description-event_port']['de-at'] = "Geben Sie das Ereignis Socket-Portnummer.";
+$text['description-event_port']['ar-eg'] = "أدخل رقم الحدث ميناء المقبس.";
+
+$text['description-event_password']['en-us'] = "Enter the event socket password.";
+$text['description-event_password']['es-cl'] = "Introduzca la toma evento contraseña.";
+$text['description-event_password']['pt-pt'] = "Digite tomada a senha evento.";
+$text['description-event_password']['fr-fr'] = "Saisissez la prise de mot de passe de l'événement.";
+$text['description-event_password']['pt-br'] = "Digite tomada a senha evento.";
+$text['description-event_password']['pl'] = "Wprowadź hasło gniazda zdarzenia.";
+$text['description-event_password']['sv-se'] = "Ange händelsen uttag lösenord.";
+$text['description-event_password']['uk'] = "Введіть гніздо пароль подією.";
+$text['description-event_password']['de-at'] = "Geben Sie das Ereignis Passwort Steckdose.";
+$text['description-event_password']['ar-eg'] = "أدخل كلمة المرور مأخذ الحدث.";
+
+$text['description-username']['en-us'] = "Enter the database username.";
+$text['description-username']['es-cl'] = "Ingrese el nombre de usuario de la base de datos.";
+$text['description-username']['pt-pt'] = "Introduza o utilizador da base de dados.";
+$text['description-username']['fr-fr'] = "Entrer le nom d'utilisateur de la Base de données.";
+$text['description-username']['pt-br'] = "Insira o nome do usuário";
+$text['description-username']['pl'] = "Wprowadź nazwę użytkownika";
+$text['description-username']['sv-se'] = "Ange databasen användarnamn här.";
+$text['description-username']['uk'] = "Введіть ім’я користувача бази даних";
+$text['description-username']['de-at'] = "Geben Sie den Datenbank Benutzernamen an.";
+$text['description-username']['ar-eg'] = "أدخل اسم المستخدم هنا";
+
+$text['description-type']['en-us'] = "Select the database type.";
+$text['description-type']['es-cl'] = "Seleccione el tipo de base de datos";
+$text['description-type']['pt-pt'] = "Escolha o tipo de base de dados.";
+$text['description-type']['fr-fr'] = "Choisir le type de Base de données.";
+$text['description-type']['pt-br'] = "Introduza o tipo de definição.";
+$text['description-type']['pl'] = "Wprowadź rodzaj bazy danych";
+$text['description-type']['sv-se'] = "Välj databastyp";
+$text['description-type']['uk'] = "Виберіть тип бази даних";
+$text['description-type']['de-at'] = "Wählen Sie den Datenbank Typ.";
+$text['description-type']['ar-eg'] = "إختر نوع قاعدة البيانات";
+
+$text['description-port']['en-us'] = "Enter the port number.";
+$text['description-port']['es-cl'] = "Ingrese el número del puerto.";
+$text['description-port']['pt-pt'] = "Introduza o número do porto.";
+$text['description-port']['fr-fr'] = "Entrer le numéro de port.";
+$text['description-port']['pt-br'] = "Insira o número da porta";
+$text['description-port']['pl'] = "Wprowadź numer portu";
+$text['description-port']['sv-se'] = "Ange portnummer";
+$text['description-port']['uk'] = "Введіть номер порта";
+$text['description-port']['de-at'] = "Geben Sie die Port Nummer an.";
+$text['description-port']['ar-eg'] = "أدخل رقم المنفذ";
+
+$text['description-path']['en-us'] = "Enter the database file path (SQLite only).";
+$text['description-path']['es-cl'] = "Ingrese la ruta al archivo de datos (solo SQLite).";
+$text['description-path']['pt-pt'] = "Introduza o caminho da base de dados (apenas SQLite)";
+$text['description-path']['fr-fr'] = "Entrer le chemin du fichier Base de données (Spécifique SQLite).";
+$text['description-path']['pt-br'] = "Insira o caminho da base de dados (SQLite)";
+$text['description-path']['pl'] = "Wprowadź ścieżkę do pliku bazy danych (tylko SQLite)";
+$text['description-path']['sv-se'] = "Ange databasens sökväg (gäller endast SQLite).";
+$text['description-path']['uk'] = "Вкажіть шлях до файлу бази даних (тільки SQLite).";
+$text['description-path']['de-at'] = "Geben Sie den Datenbank Pfad an (nur für SQLite).";
+$text['description-path']['ar-eg'] = "أدخل مسار ملف قاعدة البيانات (سكليتي فقط).";
+
+$text['description-password']['en-us'] = "Enter the database password.";
+$text['description-password']['es-cl'] = "Ingrese la contraseña de la base de datos.";
+$text['description-password']['pt-pt'] = "Introduza a palavra-chave da base de dados.";
+$text['description-password']['fr-fr'] = "Entrer le mot de passe pour la Base de données.";
+$text['description-password']['pt-br'] = "Introduza a senha";
+$text['description-password']['pl'] = "Wpisz hasło";
+$text['description-password']['sv-se'] = "Ange databasens lösenord.";
+$text['description-password']['uk'] = "Введіть пароль бази даних.";
+$text['description-password']['de-at'] = "Geben Sie das Datenbank Passwort ein.";
+$text['description-password']['ar-eg'] = "أدخل الرقم السري الخاص بقاعدة البيانات";
+
+$text['description-name']['en-us'] = "Enter the database name.";
+$text['description-name']['es-cl'] = "Ingrese el nombre de la base de datos.";
+$text['description-name']['pt-pt'] = "Introduza o nome da base de dados.";
+$text['description-name']['fr-fr'] = "Entrer le nom de la Base de données.";
+$text['description-name']['pt-br'] = "Insira o nome do menu";
+$text['description-name']['pl'] = "Wprowadź nazwę bazy danych.";
+$text['description-name']['sv-se'] = "Ange databasens namn.";
+$text['description-name']['uk'] = "Введіть ім'я бази даних.";
+$text['description-name']['de-at'] = "Geben Sie den Namen der Datenbank an";
+$text['description-name']['ar-eg'] = "أدخل إسم قاعدة البيانات";
+
+$text['description-host']['en-us'] = "Enter the host name.";
+$text['description-host']['es-cl'] = "Ingrese el nombre de host";
+$text['description-host']['pt-pt'] = "Introduza o nome da máquina.";
+$text['description-host']['fr-fr'] = "Entrer le nom de l'hôte.";
+$text['description-host']['pt-br'] = "Insira o nome da máquina ";
+$text['description-host']['pl'] = "Wprowadź nazwę hosta.";
+$text['description-host']['sv-se'] = "Ange värdnamnet";
+$text['description-host']['uk'] = "Введіть ім'я хоста.";
+$text['description-host']['de-at'] = "Geben Sie den Host Namen ein.";
+$text['description-host']['ar-eg'] = "أدخل إسم المضيف";
+
+$text['description-driver']['en-us'] = "Select the database driver.";
+$text['description-driver']['es-cl'] = "Seleccione un controlador de base de datos.";
+$text['description-driver']['pt-pt'] = "Escolha o driver da base de dados";
+$text['description-driver']['fr-fr'] = "Choisir le driver de la Base de données.";
+$text['description-driver']['pt-br'] = "Escolha o driver da base de dados";
+$text['description-driver']['pl'] = "Wybierz sterownik bazy danych.";
+$text['description-driver']['sv-se'] = "Välj databas drivrutin.";
+$text['description-driver']['uk'] = "Виберіть драйвер бази даних.";
+$text['description-driver']['de-at'] = "Wählen Sie den Datenbank Treiber.";
+$text['description-driver']['ar-eg'] = "حدد برنامج تشغيل قاعدة البيانات.";
+
+$text['description-install']['en-us'] = "Select the action below you wish to perform.";
+$text['description-install']['es-cl'] = "Seleccione las accion a continuación que desea realizar.";
+$text['description-install']['pt-pt'] = "Selecione as ações abaixo você deseja executar.";	//action signular needed
+$text['description-install']['fr-fr'] = "Sélectionnez les action ci-dessous que vous souhaitez effectuer.";
+$text['description-install']['pt-br'] = "Seleciona as ações abaixo que deseja executar ";	//action signular needed
+$text['description-install']['pl'] = "Wybierz opcje, które chcesz wykonać.";	//action signular needed
+$text['description-install']['sv-se'] = "Välj de åtgärder nedan som du vill utföra.";	//action signular needed
+$text['description-install']['uk'] = "Виберіть об’єкти для оновлення";	//action signular needed
+$text['description-install']['de-at'] = "Wählen Sie eine Aktion.";	//action signular needed
+$text['description-install']['ar-eg'] = "حدد الإجراء أدناه كنت ترغب في القيام بها.";
+
+$text['description-database-edit']['en-us'] = "Database connection information.";
+$text['description-database-edit']['es-cl'] = "Información de conexión a base de datos.";
+$text['description-database-edit']['pt-pt'] = "Informação da ligação à base de dados.";
+$text['description-database-edit']['fr-fr'] = "Informations de connexion à la Base";
+$text['description-database-edit']['pt-br'] = "Informações da ligação na base de dados";
+$text['description-database-edit']['pl'] = "Informacje o połączeniach z bazą danych.";
+$text['description-database-edit']['sv-se'] = "Information om Databasanslutning";
+$text['description-database-edit']['uk'] = "інформація про підключення до бази даних.";
+$text['description-database-edit']['de-at'] = "Datenbank Verbindungs Information.";
+$text['description-database-edit']['ar-eg'] = "بيانات الإتصال الخاص بقاعدة البيانات";
+
+$text['description-database-add']['en-us'] = "Database connection information.";
+$text['description-database-add']['es-cl'] = "Información de conexión a base de datos.";
+$text['description-database-add']['pt-pt'] = "Informação da ligação à base de dados.";
+$text['description-database-add']['fr-fr'] = "Informations de connexion à la Base.";
+$text['description-database-add']['pt-br'] = "Informações da ligação na base de dados";
+$text['description-database-add']['pl'] = "Informacje o połączeniach z bazą danych.";
+$text['description-database-add']['sv-se'] = "Information om Databasanslutning";
+$text['description-database-add']['uk'] = "інформація про підключення до бази даних.";
+$text['description-database-add']['de-at'] = "Datenbank Verbindungs Information.";
+$text['description-database-add']['ar-eg'] = "بيانات الإتصال الخاص بقاعدة البيانات";
+
+$text['description-select_language']['en-us'] = "Please select the language you want to use";
+$text['description-select_language']['es-cl'] = "Por favor, seleccione el idioma que desea utilizar";
+$text['description-select_language']['pt-pt'] = "Por favor, selecione o idioma que deseja usar";
+$text['description-select_language']['fr-fr'] = "S'il vous plaît choisir la langue que vous souhaitez utiliser";
+$text['description-select_language']['pt-br'] = "Por favor, selecione o idioma que deseja usar";
+$text['description-select_language']['pl'] = "Wybierz język, którego chcesz używać";
+$text['description-select_language']['sv-se'] = "Välj det språk du vill använda";
+$text['description-select_language']['uk'] = "Виберіть мову, який ви хочете використовувати";
+$text['description-select_language']['de-at'] = "Bitte wählen Sie die gewünschte Sprache zu verwenden";
+$text['description-select_language']['ar-eg'] = "يرجى اختيار اللغة التي تريد استخدامها";
+
+$text['button-detect']['en-us'] = "Detect Configuration";
+$text['button-detect']['es-cl'] = "Detectar Configuración";
+$text['button-detect']['pt-pt'] = "Detectar Configuração";
+$text['button-detect']['fr-fr'] = "Détecter Configuration";
+$text['button-detect']['pt-br'] = "Detectar Configuração";
+$text['button-detect']['pl'] = "Wykrywanie Konfiguracja";
+$text['button-detect']['sv-se'] = "Detektera Konfiguration";
+$text['button-detect']['uk'] = "виявлення Конфігурація";
+$text['button-detect']['de-at'] = "Detect-Konfiguration";
+$text['button-detect']['ar-eg'] = "كشف تكوين";
+
+$text['button-select']['en-us'] = "Select";
+$text['button-select']['es-cl'] = "Seleccionar";
+$text['button-select']['pt-pt'] = "Selecionar";
+$text['button-select']['fr-fr'] = "Sélectionner";
+$text['button-select']['pt-br'] = "Selecionar";
+$text['button-select']['pl'] = "Wybierz";
+$text['button-select']['sv-se'] = "Välj";
+$text['button-select']['uk'] = "вибрати";
+$text['button-select']['de-at'] = "Wählen";
+$text['button-select']['ar-eg'] = "اختار";
+
 ?>

+ 82 - 82
core/install/index.php

@@ -1,83 +1,83 @@
-<?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-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-	Matthew Vale <[email protected]>
-*/
-require_once "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-
-//detect install state
-$install_enabled = true;
-if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
-	$install_enabled = false;
-} elseif (file_exists("/etc/fusionpbx/config.php")) {
-	//linux
-	$install_enabled = false;
-} elseif (file_exists("/usr/local/etc/fusionpbx/config.php")) {
-	$install_enabled = false;
-}
-
-if($install_enabled) {
-	header("Location: ".PROJECT_PATH."/core/install/install.php");
-	exit;
-}
-require_once "resources/check_auth.php";
-if (!if_group("superadmin")) {
-	echo "access denied";
-	exit;
-}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//includes and title
-	require_once "resources/header.php";
-	$document['title'] = $text['title-install'];
-
-	echo "<b>".$text['header-install']."</b>";
-	echo "<br><br>";
-	echo $text['description-install'];
-	echo "<br><br>";
-
-	echo "<form name='frm' method='post' action='/core/install/install.php'>\n";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	echo "	<td width='30%' class='vncell'>\n";
-	echo "		<input id='do_ft-install' type='submit' class='btn' value='".$text['label-ft-install']."'/>";
-	echo "	</td>\n";
-	echo "	<td width='70%' class='vtable' style='height: 50px;'>\n";
-	echo "		<label for='do_ft-install'>";
-	echo "			".$text['description-ft-install'];
-	echo "		</label>\n";
-	echo "	</td>\n";
-	echo "</tr>\n";
-	echo "</table>\n";
-	echo "</form>\n";
-
-//include the footer
-	require_once "resources/footer.php";
-
+<?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-2012
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+	Matthew Vale <[email protected]>
+*/
+require_once "root.php";
+require_once "resources/require.php";
+require_once "resources/check_auth.php";
+
+//detect install state
+$install_enabled = true;
+if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
+	$install_enabled = false;
+} elseif (file_exists("/etc/fusionpbx/config.php")) {
+	//linux
+	$install_enabled = false;
+} elseif (file_exists("/usr/local/etc/fusionpbx/config.php")) {
+	$install_enabled = false;
+}
+
+if($install_enabled) {
+	header("Location: ".PROJECT_PATH."/core/install/install.php");
+	exit;
+}
+require_once "resources/check_auth.php";
+if (!if_group("superadmin")) {
+	echo "access denied";
+	exit;
+}
+
+//add multi-lingual support
+	$language = new text;
+	$text = $language->get();
+
+//includes and title
+	require_once "resources/header.php";
+	$document['title'] = $text['title-install'];
+
+	echo "<b>".$text['header-install']."</b>";
+	echo "<br><br>";
+	echo $text['description-install'];
+	echo "<br><br>";
+
+	echo "<form name='frm' method='post' action='/core/install/install.php'>\n";
+	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "<tr>\n";
+	echo "	<td width='30%' class='vncell'>\n";
+	echo "		<input id='do_ft-install' type='submit' class='btn' value='".$text['label-ft-install']."'/>";
+	echo "	</td>\n";
+	echo "	<td width='70%' class='vtable' style='height: 50px;'>\n";
+	echo "		<label for='do_ft-install'>";
+	echo "			".$text['description-ft-install'];
+	echo "		</label>\n";
+	echo "	</td>\n";
+	echo "</tr>\n";
+	echo "</table>\n";
+	echo "</form>\n";
+
+//include the footer
+	require_once "resources/footer.php";
+
 ?>

+ 366 - 366
core/install/install.php

@@ -1,367 +1,367 @@
-<?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]>
-	Matthew Vale <[email protected]>
-*/
-//add the required includes
-	require_once "root.php";
-	require_once "resources/functions.php";
-	require_once "resources/classes/text.php";
-
-//initialize variables we are going to use
-	$event_host = '';
-	$event_port = '';
-	$event_password = '';
-	$install_language = 'en-us';
-	$admin_username = '';
-	$admin_password = '';
-	$install_default_country = 'US';
-	$install_template_name = '';
-	$domain_name = '';
-	$db_type = '';
-	$db_path = '';
-	$db_host = '';
-	$db_port = '';
-	$db_name = '';
-	$db_username = '';
-	$db_password = '';
-	$db_create = '';
-	$db_create_username = '';
-	$db_create_password = '';
-
-//detect the iso country code from the locale
-	//$locale = Locale::getDefault();
-	$timezone = 'UTC';
-	if (is_link('/etc/localtime')) {
-		// Mac OS X (and older Linuxes)
-		// /etc/localtime is a symlink to the
-		// timezone in /usr/share/zoneinfo.
-		$filename = readlink('/etc/localtime');
-		if (strpos($filename, '/usr/share/zoneinfo/') === 0) {
-			$timezone = substr($filename, 20);
-		}
-	} elseif (file_exists('/etc/timezone')) {
-		// Ubuntu / Debian.
-		$data = file_get_contents('/etc/timezone');
-		if ($data) {
-			$timezone = rtrim($data);
-		}
-	} elseif (file_exists('/etc/sysconfig/clock')) {
-		// RHEL / CentOS
-		$data = parse_ini_file('/etc/sysconfig/clock');
-		if (!empty($data['ZONE'])) {
-			$timezone = $data['ZONE'];
-		}
-	}
-
-//set the time zone
-	date_default_timezone_set($timezone);
-
-//if the config.php exists deny access to install.php
-	if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
-		echo "access denied";
-		exit;
-	} elseif (file_exists("/etc/fusionpbx/config.php")) {
-		echo "access denied";
-		exit;
-	} elseif (file_exists("/usr/local/etc/fusionpbx/config.php")) {
-		echo "access denied";
-		exit;
-	}
-
-//intialize variables
-	$install_step = '';
-	$return_install_step = '';
-
-//process the the HTTP POST
-	if (count($_POST) > 0) {
-		$install_language = check_str($_POST["install_language"]);
-		$install_step = check_str($_POST["install_step"]);
-		$return_install_step = check_str($_POST["return_install_step"]);
-		if(isset($_POST["event_host"])){
-			$event_host		= check_str($_POST["event_host"]);
-			$event_port		= check_str($_POST["event_port"]);
-			$event_password	= check_str($_POST["event_password"]);
-		}
-		if(isset($_POST["db_type"])){
-			$db_type					= $_POST["db_type"];
-			$admin_username				= $_POST["admin_username"];
-			$admin_password				= $_POST["admin_password"];
-			$install_default_country	= $_POST["install_default_country"];
-			$install_template_name		= $_POST["install_template_name"];
-			$domain_name				= $_POST["domain_name"];
-		}
-	}
-
-//set the install step if it is not set
-	if(!$install_step) { $install_step = 'select_language'; }
-
-//set the language for the install
-	$_SESSION['domain']['language']['code'] = $install_language;
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//set a default enviroment if first_time
-	//initialize some varibles to cut down on warnings
-	$_SESSION['message'] = '';
-	$v_link_label_play = '';
-	$v_link_label_pause = '';
-	$default_login = 0;
-	$onload = '';
-
-//buffer the content
-	ob_end_clean(); //clean the buffer
-	ob_start();
-
-	$messages = array();
-	if (!extension_loaded('PDO')) {
-		$messages[] = "<b>PHP PDO was not detected</b>. Please install it before proceeding";
-	}
-
-	echo "<div align='center'>\n";
-	$msg = '';
-	//make sure the includes directory is writable so the config.php file can be written.
-		if (!is_writable($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/pdo.php")) {
-			$messages[] = "<b>Write access to ".$_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."</b> and its sub-directories are required during the install.";
-		}
-	//test for selinux
-		if (file_exists('/usr/sbin/getenforce')) {
-			$enforcing;
-			exec('getenforce', $enforcing);
-			if($enforcing[0] == 'Enforcing'){
-				$messages[] = "<b>SELinux is enabled and enforcing</b> you must have a policy installed to let the webserver connect to the switch event socket<br/>".
-				"<sm>You can use the following to find what ports are allowed<pre>semanage port -l | grep '^http_port_t'</pre></sm>";
-			}
-		}
-	//test for windows and non sqlite
-		if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' and strlen($db_type) > 0 and $db_type !='sqlite') {
-			$messages[] = "<b>Windows requires a system DSN ODBC connection</b> this must be configured.";
-		}
-
-	//action code
-	if($return_install_step == 'config_detail'){
-		//check for all required data
-		$existing_errors = count($messages);
-		if (strlen($admin_username) == 0) { $messages[] = "Please provide the Admin Username"; }
-		if (strlen($admin_password) == 0) {	$messages[] = "Please provide the Admin Password"; }
-		elseif (strlen($admin_password) < 5) { $messages[] = "Please provide an Admin Password that is 5 or more characters.<br>\n"; }
-		if ( count($messages) > $existing_errors) { $install_step = 'config_detail'; }
-	}
-
-	if($install_step =='execute') {
-		//set the max execution time to 1 hour
-		ini_set('max_execution_time',3600);
-	}
-
-	//display messages
-	if (count($messages)>0) {
-		echo "<br />\n";
-		echo "<div align='center'>\n";
-		echo "<table width='75%'>\n";
-		echo "<tr>\n";
-		echo "<th align='left'>Messages</th>\n";
-		echo "</tr>\n";
-		echo "<tr>\n";
-		echo "<td class='row_style1'><strong><ul>\n";
-		foreach ($messages as $message){
-			echo "<li>$message</li>\n";
-		}
-		echo "</ul></strong></td>\n";
-		echo "</tr>\n";
-		echo "</table>\n";
-		echo "</div>\n";
-	}
-
-	//includes and title
-	$document['title'] = $text['title-install'];
-
-	//view code
-	if($install_step == 'select_language'){
-		echo "	<form method='post' name='frm' action=''>\n";
-		include "resources/page_parts/install_select_language.php";
-		echo "	<input type='hidden' name='return_install_step' value='select_language'/>\n";
-		echo "	<input type='hidden' name='install_step' value='detect_config'/>\n";
-		echo "</form>\n";
-	} elseif($install_step == 'detect_config'){
-		if(!($event_host == '' || $event_host == 'localhost' || $event_host == '::1' || $event_host == '127.0.0.1' )){
-			echo "<p><b>Warning</b> you have choosen a value other than localhost for event_host, this is unsoported at present</p>\n";
-		}
-		//if($detect_ok){
-			echo "<form method='post' name='frm' action=''>\n";
-			include "resources/page_parts/install_event_socket.php";
-			echo "	<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
-			echo "	<input type='hidden' name='return_install_step' value='detect_config'/>\n";
-			echo "	<input type='hidden' name='install_step' value='config_detail'/>\n";
-			echo "	<input type='hidden' name='event_host' value='$event_host'/>\n";
-			echo "	<input type='hidden' name='event_port' value='$event_port'/>\n";
-			echo "	<input type='hidden' name='event_password' value='$event_password'/>\n";
-			//echo "	<div style='text-align:right'>\n";
-			//echo "    <button type='button' class='btn' onclick=\"history.go(-1);\">".$text['button-back']."</button>\n";
-			//echo "    <button type='submit' class='btn' id='next'>".$text['button-next']."</button>\n";
-			//echo "	</div>\n";
-			echo "</form>\n";
-		//} else {
-		//	echo "<form method='post' name='frm' action=''>\n";
-		//	echo "	<div style='text-align:right'>\n";
-		//	echo "    <button type='button' class='btn' onclick=\"history.go(-1);\">".$text['button-back']."</button>\n";
-		//	echo "	</div>\n";
-		//	echo "</form>\n";
-		//}
-	}
-	elseif($install_step == 'config_detail'){
-		//get the domain
-		if(!$domain_name){
-			$domain_array = explode(":", $_SERVER["HTTP_HOST"]);
-			$domain_name = $domain_array[0];
-		}
-		include "resources/page_parts/install_config_detail.php";
-	}
-	elseif($install_step == 'config_database'){
-		include "resources/page_parts/install_config_database.php";
-	}
-	elseif($install_step == 'execute'){
-		echo "<p><b>".$text['header-installing']."</b></p>\n";
-		//$protocol = 'http';
-		//if($_SERVER['HTTPS']) { $protocol = 'https'; }
-		//echo "<iframe src='$protocol://$domain_name/core/install/install_first_time.php' style='border:solid 1px #000;width:100%;height:auto'></iframe>";
-		require_once "core/install/resources/classes/detect_switch.php";
-		$detect_switch = new detect_switch($event_host, $event_port, $event_password);
-		$detect_ok = true;
-		try {
-			$detect_switch->detect();
-		} catch(Exception $e){
-			//echo "<p>Failed to detect configuration detect_switch reported: " . $e->getMessage() . "</p>\n";
-			//$detect_ok = false;
-		}
-		if($detect_ok){
-			$install_ok = true;
-			echo "<pre style='text-align:left;'>\n";
-			function error_handler($err_severity, $errstr, $errfile, $errline ) {
-				if (0 === error_reporting()) { return false;}
-				switch($err_severity)
-				{
-					case E_ERROR:               throw new Exception ($errstr . " in $errfile line: $errline");
-					case E_PARSE:               throw new Exception ($errstr . " in $errfile line: $errline");
-					case E_CORE_ERROR:          throw new Exception ($errstr . " in $errfile line: $errline");
-					case E_COMPILE_ERROR:       throw new Exception ($errstr . " in $errfile line: $errline");
-					case E_USER_ERROR:          throw new Exception ($errstr . " in $errfile line: $errline");
-					case E_STRICT:              throw new Exception ($errstr . " in $errfile line: $errline");
-					case E_RECOVERABLE_ERROR:   throw new Exception ($errstr . " in $errfile line: $errline");
-					default:                    return false;
-				}
-			}
-			#set_error_handler("error_handler");
-			try {
-				require_once "resources/classes/global_settings.php";
-				$global_settings = new global_settings($detect_switch, $domain_name);
-				if(is_null($global_settings)){ throw new Exception("Error global_settings came back with null"); }
-				require_once "resources/classes/install_fusionpbx.php";
-				$system = new install_fusionpbx($global_settings);
-				$system->admin_username = $admin_username;
-				$system->admin_password = $admin_password;
-				$system->default_country = $install_default_country;
-				$system->install_language = $install_language;
-				$system->template_name = $install_template_name;
-
-				require_once "resources/classes/install_switch.php";
-				$switch = new install_switch($global_settings);
-				//$switch->debug = true;
-				//$system->debug = true;
-				$switch->echo_progress = true;
-				$system->echo_progress = true;
-				$system->install_phase_1();
-				$switch->install_phase_1();
-				$system->install_phase_2();
-				$switch->install_phase_2();
-			} catch(Exception $e){
-				echo "</pre>\n";
-				echo "<p><b>Failed to install</b><br/>" . $e->getMessage() . "</p>\n";
-				try {
-					require_once "resources/classes/install_fusionpbx.php";
-					$system = new install_fusionpbx($global_settings);
-					$system->remove_config();
-				} catch(Exception $e){
-					echo "<p><b>Failed to remove config:</b> " . $e->getMessage() . "</p>\n";
-				}
-				$install_ok = false;
-			}
-			restore_error_handler();
-			if($install_ok){
-				echo "</pre>\n";
-				header("Location: ".PROJECT_PATH."/logout.php");
-				$_SESSION['message'] = 'Install complete';
-			} else {
-				echo "<form method='post' name='frm' action=''>\n";
-				echo "	<div style='text-align:right'>\n";
-				echo "    <button type='button' class='btn' onclick=\"history.go(-1);\">".$text['button-back']."</button>\n";
-				echo "    <button type='button' class='btn' onclick=\"location.reload(true);\">".$text['button-execute']."</button>\n";
-				echo "	</div>\n";
-				echo "</form>\n";
-			}
-		}
-	}
-	else {
-		echo "<p>Unkown install_step '$install_step'</p>\n";
-	}
-
-//initialize some defaults so we can be 'logged in'
-	$_SESSION['username'] = 'install_enabled';
-	$_SESSION['permissions'][]['permission_name'] = 'superadmin';
-	$_SESSION['menu'] = '';
-
-//add the content to the template and then send output
-	$body = ob_get_contents(); //get the output from the buffer
-	ob_end_clean(); //clean the buffer
-
-//set a default template
-	$default_template = 'default';
-	$_SESSION['domain']['template']['name'] = $default_template;
-	$_SESSION['theme']['menu_brand_type']['text'] = "text";
-
-//set the default template path
-	$template_path = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/themes/'.$default_template.'/template.php';
-
-//get the content of the template
-	$template_content = file_get_contents($template_path);
-
-//replace the variables in the template
-	$template_content = str_replace ("<!--{title}-->", $document['title'], $template_content); //<!--{title}--> defined in each individual page
-	$template_content = str_replace ("<!--{head}-->", '', $template_content); //<!--{head}--> defined in each individual page
-	//$template_content = str_replace ("<!--{menu}-->", $_SESSION["menu"], $template_content); //included in the theme
-	$template_content = str_replace ("<!--{body}-->", $body, $template_content); //defined in /themes/default/template.php
-	$template_content = str_replace ("<!--{project_path}-->", PROJECT_PATH, $template_content); //defined in /themes/default/template.php
-
-//get the contents of the template and save it to the template variable
-	ob_start();
-	require_once "resources/classes/menu.php";
-	eval('?>' . $template_content . '<?php ');
-	$content = ob_get_contents(); //get the output from the buffer
-	ob_end_clean(); //clean the buffer
-
-//send the content to the browser and then clear the variable
-	echo $content;
-
+<?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]>
+	Matthew Vale <[email protected]>
+*/
+//add the required includes
+	require_once "root.php";
+	require_once "resources/functions.php";
+	require_once "resources/classes/text.php";
+
+//initialize variables we are going to use
+	$event_host = '';
+	$event_port = '';
+	$event_password = '';
+	$install_language = 'en-us';
+	$admin_username = '';
+	$admin_password = '';
+	$install_default_country = 'US';
+	$install_template_name = '';
+	$domain_name = '';
+	$db_type = '';
+	$db_path = '';
+	$db_host = '';
+	$db_port = '';
+	$db_name = '';
+	$db_username = '';
+	$db_password = '';
+	$db_create = '';
+	$db_create_username = '';
+	$db_create_password = '';
+
+//detect the iso country code from the locale
+	//$locale = Locale::getDefault();
+	$timezone = 'UTC';
+	if (is_link('/etc/localtime')) {
+		// Mac OS X (and older Linuxes)
+		// /etc/localtime is a symlink to the
+		// timezone in /usr/share/zoneinfo.
+		$filename = readlink('/etc/localtime');
+		if (strpos($filename, '/usr/share/zoneinfo/') === 0) {
+			$timezone = substr($filename, 20);
+		}
+	} elseif (file_exists('/etc/timezone')) {
+		// Ubuntu / Debian.
+		$data = file_get_contents('/etc/timezone');
+		if ($data) {
+			$timezone = rtrim($data);
+		}
+	} elseif (file_exists('/etc/sysconfig/clock')) {
+		// RHEL / CentOS
+		$data = parse_ini_file('/etc/sysconfig/clock');
+		if (!empty($data['ZONE'])) {
+			$timezone = $data['ZONE'];
+		}
+	}
+
+//set the time zone
+	date_default_timezone_set($timezone);
+
+//if the config.php exists deny access to install.php
+	if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
+		echo "access denied";
+		exit;
+	} elseif (file_exists("/etc/fusionpbx/config.php")) {
+		echo "access denied";
+		exit;
+	} elseif (file_exists("/usr/local/etc/fusionpbx/config.php")) {
+		echo "access denied";
+		exit;
+	}
+
+//intialize variables
+	$install_step = '';
+	$return_install_step = '';
+
+//process the the HTTP POST
+	if (count($_POST) > 0) {
+		$install_language = check_str($_POST["install_language"]);
+		$install_step = check_str($_POST["install_step"]);
+		$return_install_step = check_str($_POST["return_install_step"]);
+		if(isset($_POST["event_host"])){
+			$event_host		= check_str($_POST["event_host"]);
+			$event_port		= check_str($_POST["event_port"]);
+			$event_password	= check_str($_POST["event_password"]);
+		}
+		if(isset($_POST["db_type"])){
+			$db_type					= $_POST["db_type"];
+			$admin_username				= $_POST["admin_username"];
+			$admin_password				= $_POST["admin_password"];
+			$install_default_country	= $_POST["install_default_country"];
+			$install_template_name		= $_POST["install_template_name"];
+			$domain_name				= $_POST["domain_name"];
+		}
+	}
+
+//set the install step if it is not set
+	if(!$install_step) { $install_step = 'select_language'; }
+
+//set the language for the install
+	$_SESSION['domain']['language']['code'] = $install_language;
+
+//add multi-lingual support
+	$language = new text;
+	$text = $language->get();
+
+//set a default enviroment if first_time
+	//initialize some varibles to cut down on warnings
+	$_SESSION['message'] = '';
+	$v_link_label_play = '';
+	$v_link_label_pause = '';
+	$default_login = 0;
+	$onload = '';
+
+//buffer the content
+	ob_end_clean(); //clean the buffer
+	ob_start();
+
+	$messages = array();
+	if (!extension_loaded('PDO')) {
+		$messages[] = "<b>PHP PDO was not detected</b>. Please install it before proceeding";
+	}
+
+	echo "<div align='center'>\n";
+	$msg = '';
+	//make sure the includes directory is writable so the config.php file can be written.
+		if (!is_writable($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/pdo.php")) {
+			$messages[] = "<b>Write access to ".$_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."</b> and its sub-directories are required during the install.";
+		}
+	//test for selinux
+		if (file_exists('/usr/sbin/getenforce')) {
+			$enforcing;
+			exec('getenforce', $enforcing);
+			if($enforcing[0] == 'Enforcing'){
+				$messages[] = "<b>SELinux is enabled and enforcing</b> you must have a policy installed to let the webserver connect to the switch event socket<br/>".
+				"<sm>You can use the following to find what ports are allowed<pre>semanage port -l | grep '^http_port_t'</pre></sm>";
+			}
+		}
+	//test for windows and non sqlite
+		if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' and strlen($db_type) > 0 and $db_type !='sqlite') {
+			$messages[] = "<b>Windows requires a system DSN ODBC connection</b> this must be configured.";
+		}
+
+	//action code
+	if($return_install_step == 'config_detail'){
+		//check for all required data
+		$existing_errors = count($messages);
+		if (strlen($admin_username) == 0) { $messages[] = "Please provide the Admin Username"; }
+		if (strlen($admin_password) == 0) {	$messages[] = "Please provide the Admin Password"; }
+		elseif (strlen($admin_password) < 5) { $messages[] = "Please provide an Admin Password that is 5 or more characters.<br>\n"; }
+		if ( count($messages) > $existing_errors) { $install_step = 'config_detail'; }
+	}
+
+	if($install_step =='execute') {
+		//set the max execution time to 1 hour
+		ini_set('max_execution_time',3600);
+	}
+
+	//display messages
+	if (count($messages)>0) {
+		echo "<br />\n";
+		echo "<div align='center'>\n";
+		echo "<table width='75%'>\n";
+		echo "<tr>\n";
+		echo "<th align='left'>Messages</th>\n";
+		echo "</tr>\n";
+		echo "<tr>\n";
+		echo "<td class='row_style1'><strong><ul>\n";
+		foreach ($messages as $message){
+			echo "<li>$message</li>\n";
+		}
+		echo "</ul></strong></td>\n";
+		echo "</tr>\n";
+		echo "</table>\n";
+		echo "</div>\n";
+	}
+
+	//includes and title
+	$document['title'] = $text['title-install'];
+
+	//view code
+	if($install_step == 'select_language'){
+		echo "	<form method='post' name='frm' action=''>\n";
+		include "resources/page_parts/install_select_language.php";
+		echo "	<input type='hidden' name='return_install_step' value='select_language'/>\n";
+		echo "	<input type='hidden' name='install_step' value='detect_config'/>\n";
+		echo "</form>\n";
+	} elseif($install_step == 'detect_config'){
+		if(!($event_host == '' || $event_host == 'localhost' || $event_host == '::1' || $event_host == '127.0.0.1' )){
+			echo "<p><b>Warning</b> you have choosen a value other than localhost for event_host, this is unsoported at present</p>\n";
+		}
+		//if($detect_ok){
+			echo "<form method='post' name='frm' action=''>\n";
+			include "resources/page_parts/install_event_socket.php";
+			echo "	<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
+			echo "	<input type='hidden' name='return_install_step' value='detect_config'/>\n";
+			echo "	<input type='hidden' name='install_step' value='config_detail'/>\n";
+			echo "	<input type='hidden' name='event_host' value='$event_host'/>\n";
+			echo "	<input type='hidden' name='event_port' value='$event_port'/>\n";
+			echo "	<input type='hidden' name='event_password' value='$event_password'/>\n";
+			//echo "	<div style='text-align:right'>\n";
+			//echo "    <button type='button' class='btn' onclick=\"history.go(-1);\">".$text['button-back']."</button>\n";
+			//echo "    <button type='submit' class='btn' id='next'>".$text['button-next']."</button>\n";
+			//echo "	</div>\n";
+			echo "</form>\n";
+		//} else {
+		//	echo "<form method='post' name='frm' action=''>\n";
+		//	echo "	<div style='text-align:right'>\n";
+		//	echo "    <button type='button' class='btn' onclick=\"history.go(-1);\">".$text['button-back']."</button>\n";
+		//	echo "	</div>\n";
+		//	echo "</form>\n";
+		//}
+	}
+	elseif($install_step == 'config_detail'){
+		//get the domain
+		if(!$domain_name){
+			$domain_array = explode(":", $_SERVER["HTTP_HOST"]);
+			$domain_name = $domain_array[0];
+		}
+		include "resources/page_parts/install_config_detail.php";
+	}
+	elseif($install_step == 'config_database'){
+		include "resources/page_parts/install_config_database.php";
+	}
+	elseif($install_step == 'execute'){
+		echo "<p><b>".$text['header-installing']."</b></p>\n";
+		//$protocol = 'http';
+		//if($_SERVER['HTTPS']) { $protocol = 'https'; }
+		//echo "<iframe src='$protocol://$domain_name/core/install/install_first_time.php' style='border:solid 1px #000;width:100%;height:auto'></iframe>";
+		require_once "core/install/resources/classes/detect_switch.php";
+		$detect_switch = new detect_switch($event_host, $event_port, $event_password);
+		$detect_ok = true;
+		try {
+			$detect_switch->detect();
+		} catch(Exception $e){
+			//echo "<p>Failed to detect configuration detect_switch reported: " . $e->getMessage() . "</p>\n";
+			//$detect_ok = false;
+		}
+		if($detect_ok){
+			$install_ok = true;
+			echo "<pre style='text-align:left;'>\n";
+			function error_handler($err_severity, $errstr, $errfile, $errline ) {
+				if (0 === error_reporting()) { return false;}
+				switch($err_severity)
+				{
+					case E_ERROR:               throw new Exception ($errstr . " in $errfile line: $errline");
+					case E_PARSE:               throw new Exception ($errstr . " in $errfile line: $errline");
+					case E_CORE_ERROR:          throw new Exception ($errstr . " in $errfile line: $errline");
+					case E_COMPILE_ERROR:       throw new Exception ($errstr . " in $errfile line: $errline");
+					case E_USER_ERROR:          throw new Exception ($errstr . " in $errfile line: $errline");
+					case E_STRICT:              throw new Exception ($errstr . " in $errfile line: $errline");
+					case E_RECOVERABLE_ERROR:   throw new Exception ($errstr . " in $errfile line: $errline");
+					default:                    return false;
+				}
+			}
+			#set_error_handler("error_handler");
+			try {
+				require_once "resources/classes/global_settings.php";
+				$global_settings = new global_settings($detect_switch, $domain_name);
+				if(is_null($global_settings)){ throw new Exception("Error global_settings came back with null"); }
+				require_once "resources/classes/install_fusionpbx.php";
+				$system = new install_fusionpbx($global_settings);
+				$system->admin_username = $admin_username;
+				$system->admin_password = $admin_password;
+				$system->default_country = $install_default_country;
+				$system->install_language = $install_language;
+				$system->template_name = $install_template_name;
+
+				require_once "resources/classes/install_switch.php";
+				$switch = new install_switch($global_settings);
+				//$switch->debug = true;
+				//$system->debug = true;
+				$switch->echo_progress = true;
+				$system->echo_progress = true;
+				$system->install_phase_1();
+				$switch->install_phase_1();
+				$system->install_phase_2();
+				$switch->install_phase_2();
+			} catch(Exception $e){
+				echo "</pre>\n";
+				echo "<p><b>Failed to install</b><br/>" . $e->getMessage() . "</p>\n";
+				try {
+					require_once "resources/classes/install_fusionpbx.php";
+					$system = new install_fusionpbx($global_settings);
+					$system->remove_config();
+				} catch(Exception $e){
+					echo "<p><b>Failed to remove config:</b> " . $e->getMessage() . "</p>\n";
+				}
+				$install_ok = false;
+			}
+			restore_error_handler();
+			if($install_ok){
+				echo "</pre>\n";
+				header("Location: ".PROJECT_PATH."/logout.php");
+				$_SESSION['message'] = 'Install complete';
+			} else {
+				echo "<form method='post' name='frm' action=''>\n";
+				echo "	<div style='text-align:right'>\n";
+				echo "    <button type='button' class='btn' onclick=\"history.go(-1);\">".$text['button-back']."</button>\n";
+				echo "    <button type='button' class='btn' onclick=\"location.reload(true);\">".$text['button-execute']."</button>\n";
+				echo "	</div>\n";
+				echo "</form>\n";
+			}
+		}
+	}
+	else {
+		echo "<p>Unkown install_step '$install_step'</p>\n";
+	}
+
+//initialize some defaults so we can be 'logged in'
+	$_SESSION['username'] = 'install_enabled';
+	$_SESSION['permissions'][]['permission_name'] = 'superadmin';
+	$_SESSION['menu'] = '';
+
+//add the content to the template and then send output
+	$body = ob_get_contents(); //get the output from the buffer
+	ob_end_clean(); //clean the buffer
+
+//set a default template
+	$default_template = 'default';
+	$_SESSION['domain']['template']['name'] = $default_template;
+	$_SESSION['theme']['menu_brand_type']['text'] = "text";
+
+//set the default template path
+	$template_path = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/themes/'.$default_template.'/template.php';
+
+//get the content of the template
+	$template_content = file_get_contents($template_path);
+
+//replace the variables in the template
+	$template_content = str_replace ("<!--{title}-->", $document['title'], $template_content); //<!--{title}--> defined in each individual page
+	$template_content = str_replace ("<!--{head}-->", '', $template_content); //<!--{head}--> defined in each individual page
+	//$template_content = str_replace ("<!--{menu}-->", $_SESSION["menu"], $template_content); //included in the theme
+	$template_content = str_replace ("<!--{body}-->", $body, $template_content); //defined in /themes/default/template.php
+	$template_content = str_replace ("<!--{project_path}-->", PROJECT_PATH, $template_content); //defined in /themes/default/template.php
+
+//get the contents of the template and save it to the template variable
+	ob_start();
+	require_once "resources/classes/menu.php";
+	eval('?>' . $template_content . '<?php ');
+	$content = ob_get_contents(); //get the output from the buffer
+	ob_end_clean(); //clean the buffer
+
+//send the content to the browser and then clear the variable
+	echo $content;
+
 ?>

+ 169 - 169
core/install/resources/classes/detect_switch.php

@@ -1,170 +1,170 @@
-<?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]>
-	Copyright (C) 2010-2015
-	All Rights Reserved.
-
-	Contributor(s):
-	Matthew Vale <[email protected]>
-
-*/
-require_once "root.php";
-require_once "resources/classes/event_socket.php";
-
-//define the install class
-	class detect_switch {
-
-		// cached data
-		protected $_dirs;
-		protected $_vdirs;
-		public function get_dirs()	{ return $this->_dirs; }
-		public function get_vdirs()	{ return $this->_vdirs; }
-
-		// version information
-		protected $_major;
-		protected $_minor;
-		protected $_build;
-		protected $_bits;
-		public function major()		{ return $this->_major; }
-		public function minor()		{ return $this->_minor; }
-		public function build()		{ return $this->_build; }
-		public function bits()		{ return $this->_bits; }
-		public function version()	{ return $this->_major.".".$this->_minor.".".$this->_build." (".$this->_bits.")"; }
-
-		// dirs - detected by from the switch
-		protected $_base_dir = '';
-		protected $_cache_dir = '';
-		protected $_conf_dir = '';
-		protected $_db_dir = '';
-		protected $_grammar_dir = '';
-		protected $_htdocs_dir = '';
-		protected $_log_dir = '';
-		protected $_mod_dir = '';
-		protected $_recordings_dir = '';
-		protected $_run_dir = '';
-		protected $_script_dir = '';
-		protected $_sounds_dir = '';
-		protected $_storage_dir = '';
-		protected $_temp_dir = '';
-		public function base_dir()			{ return $this->_base_dir; }
-		public function cache_dir()			{ return $this->_cache_dir; }
-		public function conf_dir()			{ return $this->_conf_dir; }
-		public function db_dir()			{ return $this->_db_dir; }
-		public function grammar_dir()		{ return $this->_grammar_dir; }
-		public function htdocs_dir()		{ return $this->_htdocs_dir; }
-		public function log_dir()			{ return $this->_log_dir; }
-		public function mod_dir()			{ return $this->_mod_dir; }
-		public function recordings_dir()	{ return $this->_recordings_dir; }
-		public function run_dir()			{ return $this->_run_dir; }
-		public function script_dir()		{ return $this->_script_dir; }
-		public function sounds_dir()		{ return $this->_sounds_dir; }
-		public function storage_dir()		{ return $this->_storage_dir; }
-		public function temp_dir()			{ return $this->_temp_dir; }
-
-		// virtual dirs - assumed based on the detected dirs
-		protected $_voicemail_vdir = '';
-		protected $_phrases_vdir = '';
-		protected $_extensions_vdir = '';
-		protected $_sip_profiles_vdir = '';
-		protected $_dialplan_vdir = '';
-		protected $_backup_vdir = '';
-		public function voicemail_vdir()	{ return $this->_voicemail_vdir; }
-		public function phrases_vdir()		{ return $this->_phrases_vdir; }
-		public function extensions_vdir()	{ return $this->_extensions_vdir; }
-		public function sip_profiles_vdir()	{ return $this->_sip_profiles_vdir; }
-		public function dialplan_vdir()		{ return $this->_dialplan_vdir; }
-		public function backup_vdir()		{ return $this->_backup_vdir; }
-
-		// event socket
-		public $event_host = 'localhost';
-		public $event_port = '8021';
-		public $event_password = 'ClueCon';
-		protected $event_socket;
-
-		public function __construct($event_host, $event_port, $event_password) {
-			//do not take these settings from session as they be detecting a new switch
-			if($event_host){		$this->event_host = $event_host; }
-			if($event_port){		$this->event_port = $event_port; }
-			if($event_password){	$this->event_password = $event_password; }
-			$this->connect_event_socket();
-			if(!$this->event_socket){
-				$this->detect_event_socket();
-			}
-			$this->_dirs = preg_grep ('/.*_dir$/', get_class_methods('detect_switch') );
-			sort( $this->_dirs );
-			$this->_vdirs = preg_grep ('/.*_vdir$/', get_class_methods('detect_switch') );
-			sort( $this->_vdirs );
-		}
-
-		protected function detect_event_socket() {
-			//perform searches for user's config here
-		}
-
-		public function detect() {
-			$this->connect_event_socket();
-			if(!$this->event_socket){
-				throw new Exception('Failed to use event socket');
-			}
-			$FS_Version = $this->event_socket_request('api version');
-			preg_match("/FreeSWITCH Version (\d+)\.(\d+)\.(\d+(?:\.\d+)?).*\(.*?(\d+\w+)\s*\)/", $FS_Version, $matches);
-			$this->_major = $matches[1];
-			$this->_minor = $matches[2];
-			$this->_build = $matches[3];
-			$this->_bits =  $matches[4];
-			$FS_Vars = $this->event_socket_request('api global_getvar');
-			foreach (explode("\n",$FS_Vars) as $FS_Var){
-				preg_match("/(\w+_dir)=(.*)/", $FS_Var, $matches);
-				if(count($matches) > 0 and property_exists($this, "_" . $matches[1])){
-					$field = "_" . $matches[1];
-					$this->$field = normalize_path($matches[2]);
-				}
-			}
-			$this->_voicemail_vdir =	normalize_path($this->_storage_dir . DIRECTORY_SEPARATOR . "voicemail");
-			$this->_phrases_vdir =		normalize_path($this->_conf_dir . DIRECTORY_SEPARATOR . "lang");
-			$this->_extensions_vdir =	normalize_path($this->_conf_dir . DIRECTORY_SEPARATOR . "directory");
-			$this->_sip_profiles_vdir =	normalize_path($this->_conf_dir . DIRECTORY_SEPARATOR . "sip_profiles");
-			$this->_dialplan_vdir =		normalize_path($this->_conf_dir . DIRECTORY_SEPARATOR . "dialplan");
-			$this->_backup_vdir =		normalize_path(sys_get_temp_dir());
-		}
-
-		protected function connect_event_socket(){
-			$esl = new event_socket;
-			if ($esl->connect($this->event_host, $this->event_port, $this->event_password)) {
-				$this->event_socket = $esl->reset_fp();
-				return true;
-			}
-			return false;
-		}
-
-		protected function event_socket_request($cmd) {
-			$esl = new event_socket($this->event_socket);
-			$result = $esl->request($cmd);
-			$esl->reset_fp();
-			return $result;
-		}
-
-		public function restart_switch() {
-			$this->connect_event_socket();
-			if(!$this->event_socket){
-				throw new Exception('Failed to use event socket');
-			}
-			$this->event_socket_request('api fsctl shutdown restart elegant');
-		}
-	}
+<?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]>
+	Copyright (C) 2010-2015
+	All Rights Reserved.
+
+	Contributor(s):
+	Matthew Vale <[email protected]>
+
+*/
+require_once "root.php";
+require_once "resources/classes/event_socket.php";
+
+//define the install class
+	class detect_switch {
+
+		// cached data
+		protected $_dirs;
+		protected $_vdirs;
+		public function get_dirs()	{ return $this->_dirs; }
+		public function get_vdirs()	{ return $this->_vdirs; }
+
+		// version information
+		protected $_major;
+		protected $_minor;
+		protected $_build;
+		protected $_bits;
+		public function major()		{ return $this->_major; }
+		public function minor()		{ return $this->_minor; }
+		public function build()		{ return $this->_build; }
+		public function bits()		{ return $this->_bits; }
+		public function version()	{ return $this->_major.".".$this->_minor.".".$this->_build." (".$this->_bits.")"; }
+
+		// dirs - detected by from the switch
+		protected $_base_dir = '';
+		protected $_cache_dir = '';
+		protected $_conf_dir = '';
+		protected $_db_dir = '';
+		protected $_grammar_dir = '';
+		protected $_htdocs_dir = '';
+		protected $_log_dir = '';
+		protected $_mod_dir = '';
+		protected $_recordings_dir = '';
+		protected $_run_dir = '';
+		protected $_script_dir = '';
+		protected $_sounds_dir = '';
+		protected $_storage_dir = '';
+		protected $_temp_dir = '';
+		public function base_dir()			{ return $this->_base_dir; }
+		public function cache_dir()			{ return $this->_cache_dir; }
+		public function conf_dir()			{ return $this->_conf_dir; }
+		public function db_dir()			{ return $this->_db_dir; }
+		public function grammar_dir()		{ return $this->_grammar_dir; }
+		public function htdocs_dir()		{ return $this->_htdocs_dir; }
+		public function log_dir()			{ return $this->_log_dir; }
+		public function mod_dir()			{ return $this->_mod_dir; }
+		public function recordings_dir()	{ return $this->_recordings_dir; }
+		public function run_dir()			{ return $this->_run_dir; }
+		public function script_dir()		{ return $this->_script_dir; }
+		public function sounds_dir()		{ return $this->_sounds_dir; }
+		public function storage_dir()		{ return $this->_storage_dir; }
+		public function temp_dir()			{ return $this->_temp_dir; }
+
+		// virtual dirs - assumed based on the detected dirs
+		protected $_voicemail_vdir = '';
+		protected $_phrases_vdir = '';
+		protected $_extensions_vdir = '';
+		protected $_sip_profiles_vdir = '';
+		protected $_dialplan_vdir = '';
+		protected $_backup_vdir = '';
+		public function voicemail_vdir()	{ return $this->_voicemail_vdir; }
+		public function phrases_vdir()		{ return $this->_phrases_vdir; }
+		public function extensions_vdir()	{ return $this->_extensions_vdir; }
+		public function sip_profiles_vdir()	{ return $this->_sip_profiles_vdir; }
+		public function dialplan_vdir()		{ return $this->_dialplan_vdir; }
+		public function backup_vdir()		{ return $this->_backup_vdir; }
+
+		// event socket
+		public $event_host = 'localhost';
+		public $event_port = '8021';
+		public $event_password = 'ClueCon';
+		protected $event_socket;
+
+		public function __construct($event_host, $event_port, $event_password) {
+			//do not take these settings from session as they be detecting a new switch
+			if($event_host){		$this->event_host = $event_host; }
+			if($event_port){		$this->event_port = $event_port; }
+			if($event_password){	$this->event_password = $event_password; }
+			$this->connect_event_socket();
+			if(!$this->event_socket){
+				$this->detect_event_socket();
+			}
+			$this->_dirs = preg_grep ('/.*_dir$/', get_class_methods('detect_switch') );
+			sort( $this->_dirs );
+			$this->_vdirs = preg_grep ('/.*_vdir$/', get_class_methods('detect_switch') );
+			sort( $this->_vdirs );
+		}
+
+		protected function detect_event_socket() {
+			//perform searches for user's config here
+		}
+
+		public function detect() {
+			$this->connect_event_socket();
+			if(!$this->event_socket){
+				throw new Exception('Failed to use event socket');
+			}
+			$FS_Version = $this->event_socket_request('api version');
+			preg_match("/FreeSWITCH Version (\d+)\.(\d+)\.(\d+(?:\.\d+)?).*\(.*?(\d+\w+)\s*\)/", $FS_Version, $matches);
+			$this->_major = $matches[1];
+			$this->_minor = $matches[2];
+			$this->_build = $matches[3];
+			$this->_bits =  $matches[4];
+			$FS_Vars = $this->event_socket_request('api global_getvar');
+			foreach (explode("\n",$FS_Vars) as $FS_Var){
+				preg_match("/(\w+_dir)=(.*)/", $FS_Var, $matches);
+				if(count($matches) > 0 and property_exists($this, "_" . $matches[1])){
+					$field = "_" . $matches[1];
+					$this->$field = normalize_path($matches[2]);
+				}
+			}
+			$this->_voicemail_vdir =	normalize_path($this->_storage_dir . DIRECTORY_SEPARATOR . "voicemail");
+			$this->_phrases_vdir =		normalize_path($this->_conf_dir . DIRECTORY_SEPARATOR . "lang");
+			$this->_extensions_vdir =	normalize_path($this->_conf_dir . DIRECTORY_SEPARATOR . "directory");
+			$this->_sip_profiles_vdir =	normalize_path($this->_conf_dir . DIRECTORY_SEPARATOR . "sip_profiles");
+			$this->_dialplan_vdir =		normalize_path($this->_conf_dir . DIRECTORY_SEPARATOR . "dialplan");
+			$this->_backup_vdir =		normalize_path(sys_get_temp_dir());
+		}
+
+		protected function connect_event_socket(){
+			$esl = new event_socket;
+			if ($esl->connect($this->event_host, $this->event_port, $this->event_password)) {
+				$this->event_socket = $esl->reset_fp();
+				return true;
+			}
+			return false;
+		}
+
+		protected function event_socket_request($cmd) {
+			$esl = new event_socket($this->event_socket);
+			$result = $esl->request($cmd);
+			$esl->reset_fp();
+			return $result;
+		}
+
+		public function restart_switch() {
+			$this->connect_event_socket();
+			if(!$this->event_socket){
+				throw new Exception('Failed to use event socket');
+			}
+			$this->event_socket_request('api fsctl shutdown restart elegant');
+		}
+	}
 ?>

+ 213 - 213
core/install/resources/classes/global_settings.php

@@ -1,214 +1,214 @@
-<?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]>
-	Copyright (C) 2010-2015
-	All Rights Reserved.
-
-	Contributor(s):
-	Matthew Vale <[email protected]>
-
-*/
-require_once "root.php";
-
-//define the install class
-	class global_settings {
-
-		// cached data
-		protected $_switch_dirs;
-		protected $_switch_vdirs;
-		public function get_switch_dirs()	{ return $this->_switch_dirs; }
-		public function get_switch_vdirs()	{ return $this->_switch_vdirs; }
-
-		// dirs - detected from the switch
-		protected $_switch_base_dir = '';
-		protected $_switch_cache_dir = '';
-		protected $_switch_conf_dir = '';
-		protected $_switch_db_dir = '';
-		protected $_switch_grammar_dir = '';
-		protected $_switch_htdocs_dir = '';
-		protected $_switch_log_dir = '';
-		protected $_switch_mod_dir = '';
-		protected $_switch_recordings_dir = '';
-		protected $_switch_run_dir = '';
-		protected $_switch_script_dir = '';
-		protected $_switch_sounds_dir = '';
-		protected $_switch_storage_dir = '';
-		protected $_switch_temp_dir = '';
-		public function switch_base_dir()			{ return $this->_switch_base_dir; }
-		public function switch_cache_dir()			{ return $this->_switch_cache_dir; }
-		public function switch_conf_dir()			{ return $this->_switch_conf_dir; }
-		public function switch_db_dir()				{ return $this->_switch_db_dir; }
-		public function switch_grammar_dir()		{ return $this->_switch_grammar_dir; }
-		public function switch_htdocs_dir()			{ return $this->_switch_htdocs_dir; }
-		public function switch_log_dir()			{ return $this->_switch_log_dir; }
-		public function switch_mod_dir()			{ return $this->_switch_mod_dir; }
-		public function switch_recordings_dir()		{ return $this->_switch_recordings_dir; }
-		public function switch_run_dir()			{ return $this->_switch_run_dir; }
-		public function switch_script_dir()			{ return $this->_switch_script_dir; }
-		public function switch_sounds_dir()			{ return $this->_switch_sounds_dir; }
-		public function switch_storage_dir()		{ return $this->_switch_storage_dir; }
-		public function switch_temp_dir()			{ return $this->_switch_temp_dir; }
-
-		// virtual dirs - assumed based on the detected dirs
-		protected $_switch_voicemail_vdir = '';
-		protected $_switch_phrases_vdir = '';
-		protected $_switch_extensions_vdir = '';
-		protected $_switch_sip_profiles_vdir = '';
-		protected $_switch_dialplan_vdir = '';
-		protected $_switch_backup_vdir = '';
-		public function switch_voicemail_vdir()		{ return $this->_switch_voicemail_vdir; }
-		public function switch_phrases_vdir()		{ return $this->_switch_phrases_vdir; }
-		public function switch_extensions_vdir()	{ return $this->_switch_extensions_vdir; }
-		public function switch_sip_profiles_vdir()	{ return $this->_switch_sip_profiles_vdir; }
-		public function switch_dialplan_vdir()		{ return $this->_switch_dialplan_vdir; }
-		public function switch_backup_vdir()		{ return $this->_switch_backup_vdir; }
-
-		// event socket
-		protected $_switch_event_host;
-		protected $_switch_event_port;
-		protected $_switch_event_password;
-		public function switch_event_host()		{ return $this->_switch_event_host; }
-		public function switch_event_port()		{ return $this->_switch_event_port; }
-		public function switch_event_password()	{ return $this->_switch_event_password; }
-
-		// database information
-		protected $_db_type;
-		protected $_db_path;
-		protected $_db_host;
-		protected $_db_port;
-		protected $_db_name;
-		protected $_db_username;
-		protected $_db_password;
-		protected $_db_create;
-		protected $_db_create_username;
-		protected $_db_create_password;
-		public function db_type()	 			{ return $this->_db_type; }
-		public function db_path()	 			{ return $this->_db_path; }
-		public function db_host()	 			{ return $this->_db_host; }
-		public function db_port()	 			{ return $this->_db_port; }
-		public function db_name()	 			{ return $this->_db_name; }
-		public function db_username()	 		{ return $this->_db_username; }
-		public function db_password()	 		{ return $this->_db_password; }
-		public function db_create()	 			{ return $this->_db_create; }
-		public function db_create_username()	{ return $this->_db_create_username; }
-		public function db_create_password()	{ return $this->_db_create_password; }
-
-		//misc information
-		protected $_domain_uuid;
-		protected $_domain_name;
-		protected $_domain_count;
-		public function domain_uuid()	 		{ return $this->_domain_uuid; }
-		public function domain_name()	 		{ return $this->_domain_name; }
-		public function domain_count()	 		{ return $this->_domain_count; }
-		public function set_domain_uuid($domain_uuid) {
-			$e = new Exception();
-			$trace = $e->getTrace();
-			if($trace[1]['function'] != 'create_domain'){
-				throw new Exception('Only create_domain is allowed to update the domain_uuid');
-			}
-			$this->_domain_uuid = $domain_uuid;
-		}
-
-		public function __construct($detect_switch = null, $domain_name = null, $domain_uuid = null) {
-			$this->_switch_dirs = preg_grep ('/^switch_.*_dir$/', get_class_methods('global_settings') );
-			sort( $this->_switch_dirs );
-			$this->_switch_vdirs = preg_grep ('/^switch_.*_vdir$/', get_class_methods('global_settings') );
-			sort( $this->_switch_vdirs );
-			if(is_null($detect_switch)){
-				//take settings from session
-				foreach ($this->_switch_dirs as $dir){
-					$category = 'switch';
-					$session_var;
-					preg_match( '/^switch_(.*)_dir$/', $dir, $session_var);
-					$dir = "_$dir";
-					if($session_var[1] == 'script'){ $session_var[1] = 'scripts'; }
-					if($session_var[1] == 'temp'){ $category = 'server'; }
-					$this->$dir = $_SESSION[$category][$session_var[1]]['dir'];
-				}
-				foreach ($this->_switch_vdirs as $vdir){
-					$category = 'switch';
-					$session_var;
-					preg_match( '/^switch_(.*)_vdir$/', $vdir, $session_var);
-					$vdir = "_$vdir";
-					if($session_var[1] == 'backup'){ $category = 'server'; }
-					$this->$vdir = $_SESSION[$category][$session_var[1]]['dir'];
-				}
-				$this->_switch_event_host		= $_SESSION['event_socket_ip_address'];
-				$this->_switch_event_port		= $_SESSION['event_socket_port'];
-				$this->_switch_event_password	= $_SESSION['event_socket_password'];
-
-				// domain info
-				$this->_domain_name = $_SESSION['domain_name'];
-				$this->_domain_uuid = $_SESSION['domain_uuid'];
-
-				// collect misc info
-				$this->_domain_count = count($_SESSION["domains"]);
-
-				// collect db_info
-				global $db_type, $db_path, $db_host, $db_port, $db_name, $db_username, $db_password;
-				$this->_db_type = $db_type;
-				$this->_db_path = $db_path;
-				$this->_db_host = $db_host;
-				$this->_db_port = $db_port;
-				$this->_db_name = $db_name;
-				$this->_db_username = $db_username;
-				$this->_db_password = $db_password;
-
-			}elseif(!is_a($detect_switch, 'detect_switch')){
-				throw new Exception('The parameter $detect_switch must be a detect_switch object (or a subclass of)');
-
-			}else{
-				//copy from detect_switch
-				foreach($detect_switch->get_dirs() as $dir){
-					$t_dir = "_switch_$dir";
-					$this->$t_dir = $detect_switch->$dir();
-				}
-				foreach($detect_switch->get_vdirs() as $vdir){
-					$t_vdir = "_switch_$vdir";
-					$this->$t_vdir = $detect_switch->$vdir();
-				}
-				$this->_switch_event_host		= $detect_switch->event_host;
-				$this->_switch_event_port		= $detect_switch->event_port;
-				$this->_switch_event_password	= $detect_switch->event_password;
-
-				//copy from _POST
-				foreach($_POST as $key=>$value){
-					if(substr($key,0,3) == "db_"){
-						$o_key = "_$key";
-						$this->$o_key = $value;
-					}
-				}
-				if($this->_db_create and strlen($this->_db_create_username) == 0)
-				{
-					$this->_db_create_username = $this->_db_username;
-					$this->_db_create_password = $this->_db_password;
-				}
-				if (strlen($this->_db_port) == 0) { $this->_db_port = "5432"; }
-
-				// domain info
-				if(strlen($domain_uuid) == 0){ $domain_uuid = uuid(); }
-				$this->_domain_name = $domain_name;
-				$this->_domain_uuid = $domain_uuid;
-
-				//collect misc info
-				$this->_domain_count = 1;	//assumed to be one
-			}
-		}
-	}
+<?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]>
+	Copyright (C) 2010-2015
+	All Rights Reserved.
+
+	Contributor(s):
+	Matthew Vale <[email protected]>
+
+*/
+require_once "root.php";
+
+//define the install class
+	class global_settings {
+
+		// cached data
+		protected $_switch_dirs;
+		protected $_switch_vdirs;
+		public function get_switch_dirs()	{ return $this->_switch_dirs; }
+		public function get_switch_vdirs()	{ return $this->_switch_vdirs; }
+
+		// dirs - detected from the switch
+		protected $_switch_base_dir = '';
+		protected $_switch_cache_dir = '';
+		protected $_switch_conf_dir = '';
+		protected $_switch_db_dir = '';
+		protected $_switch_grammar_dir = '';
+		protected $_switch_htdocs_dir = '';
+		protected $_switch_log_dir = '';
+		protected $_switch_mod_dir = '';
+		protected $_switch_recordings_dir = '';
+		protected $_switch_run_dir = '';
+		protected $_switch_script_dir = '';
+		protected $_switch_sounds_dir = '';
+		protected $_switch_storage_dir = '';
+		protected $_switch_temp_dir = '';
+		public function switch_base_dir()			{ return $this->_switch_base_dir; }
+		public function switch_cache_dir()			{ return $this->_switch_cache_dir; }
+		public function switch_conf_dir()			{ return $this->_switch_conf_dir; }
+		public function switch_db_dir()				{ return $this->_switch_db_dir; }
+		public function switch_grammar_dir()		{ return $this->_switch_grammar_dir; }
+		public function switch_htdocs_dir()			{ return $this->_switch_htdocs_dir; }
+		public function switch_log_dir()			{ return $this->_switch_log_dir; }
+		public function switch_mod_dir()			{ return $this->_switch_mod_dir; }
+		public function switch_recordings_dir()		{ return $this->_switch_recordings_dir; }
+		public function switch_run_dir()			{ return $this->_switch_run_dir; }
+		public function switch_script_dir()			{ return $this->_switch_script_dir; }
+		public function switch_sounds_dir()			{ return $this->_switch_sounds_dir; }
+		public function switch_storage_dir()		{ return $this->_switch_storage_dir; }
+		public function switch_temp_dir()			{ return $this->_switch_temp_dir; }
+
+		// virtual dirs - assumed based on the detected dirs
+		protected $_switch_voicemail_vdir = '';
+		protected $_switch_phrases_vdir = '';
+		protected $_switch_extensions_vdir = '';
+		protected $_switch_sip_profiles_vdir = '';
+		protected $_switch_dialplan_vdir = '';
+		protected $_switch_backup_vdir = '';
+		public function switch_voicemail_vdir()		{ return $this->_switch_voicemail_vdir; }
+		public function switch_phrases_vdir()		{ return $this->_switch_phrases_vdir; }
+		public function switch_extensions_vdir()	{ return $this->_switch_extensions_vdir; }
+		public function switch_sip_profiles_vdir()	{ return $this->_switch_sip_profiles_vdir; }
+		public function switch_dialplan_vdir()		{ return $this->_switch_dialplan_vdir; }
+		public function switch_backup_vdir()		{ return $this->_switch_backup_vdir; }
+
+		// event socket
+		protected $_switch_event_host;
+		protected $_switch_event_port;
+		protected $_switch_event_password;
+		public function switch_event_host()		{ return $this->_switch_event_host; }
+		public function switch_event_port()		{ return $this->_switch_event_port; }
+		public function switch_event_password()	{ return $this->_switch_event_password; }
+
+		// database information
+		protected $_db_type;
+		protected $_db_path;
+		protected $_db_host;
+		protected $_db_port;
+		protected $_db_name;
+		protected $_db_username;
+		protected $_db_password;
+		protected $_db_create;
+		protected $_db_create_username;
+		protected $_db_create_password;
+		public function db_type()	 			{ return $this->_db_type; }
+		public function db_path()	 			{ return $this->_db_path; }
+		public function db_host()	 			{ return $this->_db_host; }
+		public function db_port()	 			{ return $this->_db_port; }
+		public function db_name()	 			{ return $this->_db_name; }
+		public function db_username()	 		{ return $this->_db_username; }
+		public function db_password()	 		{ return $this->_db_password; }
+		public function db_create()	 			{ return $this->_db_create; }
+		public function db_create_username()	{ return $this->_db_create_username; }
+		public function db_create_password()	{ return $this->_db_create_password; }
+
+		//misc information
+		protected $_domain_uuid;
+		protected $_domain_name;
+		protected $_domain_count;
+		public function domain_uuid()	 		{ return $this->_domain_uuid; }
+		public function domain_name()	 		{ return $this->_domain_name; }
+		public function domain_count()	 		{ return $this->_domain_count; }
+		public function set_domain_uuid($domain_uuid) {
+			$e = new Exception();
+			$trace = $e->getTrace();
+			if($trace[1]['function'] != 'create_domain'){
+				throw new Exception('Only create_domain is allowed to update the domain_uuid');
+			}
+			$this->_domain_uuid = $domain_uuid;
+		}
+
+		public function __construct($detect_switch = null, $domain_name = null, $domain_uuid = null) {
+			$this->_switch_dirs = preg_grep ('/^switch_.*_dir$/', get_class_methods('global_settings') );
+			sort( $this->_switch_dirs );
+			$this->_switch_vdirs = preg_grep ('/^switch_.*_vdir$/', get_class_methods('global_settings') );
+			sort( $this->_switch_vdirs );
+			if(is_null($detect_switch)){
+				//take settings from session
+				foreach ($this->_switch_dirs as $dir){
+					$category = 'switch';
+					$session_var;
+					preg_match( '/^switch_(.*)_dir$/', $dir, $session_var);
+					$dir = "_$dir";
+					if($session_var[1] == 'script'){ $session_var[1] = 'scripts'; }
+					if($session_var[1] == 'temp'){ $category = 'server'; }
+					$this->$dir = $_SESSION[$category][$session_var[1]]['dir'];
+				}
+				foreach ($this->_switch_vdirs as $vdir){
+					$category = 'switch';
+					$session_var;
+					preg_match( '/^switch_(.*)_vdir$/', $vdir, $session_var);
+					$vdir = "_$vdir";
+					if($session_var[1] == 'backup'){ $category = 'server'; }
+					$this->$vdir = $_SESSION[$category][$session_var[1]]['dir'];
+				}
+				$this->_switch_event_host		= $_SESSION['event_socket_ip_address'];
+				$this->_switch_event_port		= $_SESSION['event_socket_port'];
+				$this->_switch_event_password	= $_SESSION['event_socket_password'];
+
+				// domain info
+				$this->_domain_name = $_SESSION['domain_name'];
+				$this->_domain_uuid = $_SESSION['domain_uuid'];
+
+				// collect misc info
+				$this->_domain_count = count($_SESSION["domains"]);
+
+				// collect db_info
+				global $db_type, $db_path, $db_host, $db_port, $db_name, $db_username, $db_password;
+				$this->_db_type = $db_type;
+				$this->_db_path = $db_path;
+				$this->_db_host = $db_host;
+				$this->_db_port = $db_port;
+				$this->_db_name = $db_name;
+				$this->_db_username = $db_username;
+				$this->_db_password = $db_password;
+
+			}elseif(!is_a($detect_switch, 'detect_switch')){
+				throw new Exception('The parameter $detect_switch must be a detect_switch object (or a subclass of)');
+
+			}else{
+				//copy from detect_switch
+				foreach($detect_switch->get_dirs() as $dir){
+					$t_dir = "_switch_$dir";
+					$this->$t_dir = $detect_switch->$dir();
+				}
+				foreach($detect_switch->get_vdirs() as $vdir){
+					$t_vdir = "_switch_$vdir";
+					$this->$t_vdir = $detect_switch->$vdir();
+				}
+				$this->_switch_event_host		= $detect_switch->event_host;
+				$this->_switch_event_port		= $detect_switch->event_port;
+				$this->_switch_event_password	= $detect_switch->event_password;
+
+				//copy from _POST
+				foreach($_POST as $key=>$value){
+					if(substr($key,0,3) == "db_"){
+						$o_key = "_$key";
+						$this->$o_key = $value;
+					}
+				}
+				if($this->_db_create and strlen($this->_db_create_username) == 0)
+				{
+					$this->_db_create_username = $this->_db_username;
+					$this->_db_create_password = $this->_db_password;
+				}
+				if (strlen($this->_db_port) == 0) { $this->_db_port = "5432"; }
+
+				// domain info
+				if(strlen($domain_uuid) == 0){ $domain_uuid = uuid(); }
+				$this->_domain_name = $domain_name;
+				$this->_domain_uuid = $domain_uuid;
+
+				//collect misc info
+				$this->_domain_count = 1;	//assumed to be one
+			}
+		}
+	}
 ?>

+ 952 - 952
core/install/resources/classes/install_fusionpbx.php

@@ -1,953 +1,953 @@
-<?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]>
-	Copyright (C) 2010-2016
-	All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-	Matthew Vale <[email protected]>
-*/
-include "root.php";
-
-//define the install class
-	class install_fusionpbx {
-
-		protected $global_settings;
-		protected $config_php;
-		protected $menu_uuid = 'b4750c3f-2a86-b00d-b7d0-345c14eca286';
-		protected $dbh;
-
-		public $debug = false;
-		public $echo_progress = false;
-
-		public $install_language = 'en-us';
-		public $admin_username;
-		public $admin_password;
-		public $default_country = 'US';
-		public $template_name = 'enhanced';
-
-		function __construct($global_settings) {
-			if(is_null($global_settings)){
-				require_once "resources/classes/global_settings.php";
-				$global_settings = new global_settings();
-			}elseif(!is_a($global_settings, 'global_settings')){
-				throw new Exception('The parameter $global_settings must be a global_settings object (or a subclass of)');
-			}
-			$this->global_settings = $global_settings;
-			if (is_dir("/etc/fusionpbx")){
-				$this->config_php = "/etc/fusionpbx/config.php";
-			} elseif (is_dir("/usr/local/etc/fusionpbx")){
-				$this->config_php = "/usr/local/etc/fusionpbx/config.php";
-			}
-			elseif (is_dir($_SERVER["PROJECT_ROOT"]."/resources")) {
-				$this->config_php = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/config.php";
-			}
-			else {
-				$this->config_php = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/config.php";
-			}
-			$this->config_php = normalize_path_to_os($this->config_php);
-		}
-
-		function write_debug($message) {
-			if($this->debug){
-				echo "$message\n";
-			}
-		}
-
-		function write_progress($message) {
-			if($this->echo_progress){
-				echo "$message\n";
-			}
-		}
-
-		function install_phase_1() {
-			ini_set('max_execution_time',3600);
-			$this->write_progress("Install phase 1 started for FusionPBX");
-			$this->create_config_php();
-			$this->write_progress("\tExecuting config.php");
-			require $this->config_php;
-			global $db;
-			$db = $this->dbh;
-			$this->create_database();
-			$this->create_domain();
-			$this->create_superuser();
-			$this->app_defaults();
-			$this->write_progress("\tRunning requires");
-			require "resources/require.php";
-			$this->write_progress("Install phase 1 complete for FusionPBX");
-		}
-
-		function install_phase_2() {
-			ini_set('max_execution_time',3600);
-			$this->write_progress("Install phase 2 started for FusionPBX");
-			//$this->app_defaults();
-			$this->write_progress("Install phase 2 complete for FusionPBX");
-		}
-
-		protected function create_config_php() {
-			$this->write_progress("\tCreating " . $this->config_php);
-			$tmp_config = "<?php\n";
-			$tmp_config .= "/* \$Id\$ */\n";
-			$tmp_config .= "/*\n";
-			$tmp_config .= "	config.php\n";
-			$tmp_config .= "	Copyright (C) 2008, 2013 Mark J Crane\n";
-			$tmp_config .= "	All rights reserved.\n";
-			$tmp_config .= "\n";
-			$tmp_config .= "	Redistribution and use in source and binary forms, with or without\n";
-			$tmp_config .= "	modification, are permitted provided that the following conditions are met:\n";
-			$tmp_config .= "\n";
-			$tmp_config .= "	1. Redistributions of source code must retain the above copyright notice,\n";
-			$tmp_config .= "	   this list of conditions and the following disclaimer.\n";
-			$tmp_config .= "\n";
-			$tmp_config .= "	2. Redistributions in binary form must reproduce the above copyright\n";
-			$tmp_config .= "	   notice, this list of conditions and the following disclaimer in the\n";
-			$tmp_config .= "	   documentation and/or other materials provided with the distribution.\n";
-			$tmp_config .= "\n";
-			$tmp_config .= "	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,\n";
-			$tmp_config .= "	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n";
-			$tmp_config .= "	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n";
-			$tmp_config .= "	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n";
-			$tmp_config .= "	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n";
-			$tmp_config .= "	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n";
-			$tmp_config .= "	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n";
-			$tmp_config .= "	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n";
-			$tmp_config .= "	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n";
-			$tmp_config .= "	POSSIBILITY OF SUCH DAMAGE.\n";
-			$tmp_config .= "*/\n";
-			$tmp_config .= "\n";
-			$tmp_config .= "//-----------------------------------------------------\n";
-			$tmp_config .= "// settings:\n";
-			$tmp_config .= "//-----------------------------------------------------\n";
-			$tmp_config .= "\n";
-			$tmp_config .= "	//set the database type\n";
-			$tmp_config .= "		\$db_type = '".$this->global_settings->db_type()."'; //sqlite, mysql, pgsql, others with a manually created PDO connection\n";
-			$tmp_config .= "\n";
-			if ($this->global_settings->db_type() == "sqlite") {
-				$tmp_config .= "	//sqlite: the db_name and db_path are automatically assigned however the values can be overidden by setting the values here.\n";
-				$tmp_config .= "		\$db_name = '".$this->global_settings->db_name()."'; //host name/ip address + '.db' is the default database filename\n";
-				$tmp_config .= "		\$db_path = '".$this->global_settings->db_path()."'; //the path is determined by a php variable\n";
-			}
-			$tmp_config .= "\n";
-			$tmp_config .= "	//mysql: database connection information\n";
-			if ($this->global_settings->db_type() == "mysql") {
-				$db_host = $this->global_settings->db_host();
-				if ( $db_host == "localhost") {
-					//if localhost is used it defaults to a Unix Socket which doesn't seem to work.
-					//replace localhost with 127.0.0.1 so that it will connect using TCP
-					$db_host = "127.0.0.1";
-				}
-				$tmp_config .= "		\$db_host = '".$db_host."';\n";
-				$tmp_config .= "		\$db_port = '".$this->global_settings->db_port()."';\n";
-				$tmp_config .= "		\$db_name = '".$this->global_settings->db_name()."';\n";
-				$tmp_config .= "		\$db_username = '".$this->global_settings->db_username()."';\n";
-				$tmp_config .= "		\$db_password = '".$this->global_settings->db_password()."';\n";
-			}
-			else {
-				$tmp_config .= "		//\$db_host = '';\n";
-				$tmp_config .= "		//\$db_port = '';\n";
-				$tmp_config .= "		//\$db_name = '';\n";
-				$tmp_config .= "		//\$db_username = '';\n";
-				$tmp_config .= "		//\$db_password = '';\n";
-			}
-			$tmp_config .= "\n";
-			$tmp_config .= "	//pgsql: database connection information\n";
-			if ($this->global_settings->db_type() == "pgsql") {
-				$db_host = $this->global_settings->db_host();
-				//Unix Socket - if localhost or 127.0.0.1 we want it to default to a Unix Socket.
-				//$comment_out = '';
-				//if ( $db_host == "localhost" or $db_host == "127.0.0.1") {
-				//	$comment_out = "//";
-				//}
-				//$tmp_config .= "		$comment_out\$db_host = '".$this->global_settings->db_host()."'; //set the host only if the database is not local\n";
-				$tmp_config .= "		\$db_host = '".$this->global_settings->db_host()."'; //set the host only if the database is not local\n";
-				$tmp_config .= "		\$db_port = '".$this->global_settings->db_port()."';\n";
-				$tmp_config .= "		\$db_name = '".$this->global_settings->db_name()."';\n";
-				$tmp_config .= "		\$db_username = '".$this->global_settings->db_username()."';\n";
-				$tmp_config .= "		\$db_password = '".$this->global_settings->db_password()."';\n";
-			}
-			else {
-				$tmp_config .= "		//\$db_host = '".$this->global_settings->db_host()."'; //set the host only if the database is not local\n";
-				$tmp_config .= "		//\$db_port = '".$this->global_settings->db_port()."';\n";
-				$tmp_config .= "		//\$db_name = '".$this->global_settings->db_name()."';\n";
-				$tmp_config .= "		//\$db_username = '".$this->global_settings->db_username()."';\n";
-				$tmp_config .= "		//\$db_password = '".$this->global_settings->db_password()."';\n";
-			}
-			$tmp_config .= "\n";
-			$tmp_config .= "	//show errors\n";
-			$tmp_config .= "		ini_set('display_errors', '1');\n";
-			$tmp_config .= "		//error_reporting (E_ALL); // Report everything\n";
-			$tmp_config .= "		//error_reporting (E_ALL ^ E_NOTICE); // Report everything\n";
-			$tmp_config .= "		error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING ); //hide notices and warnings";
-			$tmp_config .= "\n";
-			$tmp_config .= "?>";
-
-			if((file_exists($this->config_php)
-				and !is_writable($this->config_php))
-				or !is_writable(dirname($this->config_php))
-				) {
-				throw new Exception("cannot write to '" . $this->config_php . "'" );
-			}
-			$fout = fopen($this->config_php,"w");
-			fwrite($fout, $tmp_config);
-			unset($tmp_config);
-			fclose($fout);
-		}
-
-		protected function create_database() {
-			$this->write_progress("\tUsing database as type " . $this->global_settings->db_type());
-			$function = "create_database_" . $this->global_settings->db_type();
-			$this->$function();
-
-			//sqlite is natively supported under all known OS'es
-			if($this->global_settings->db_type() != 'sqlite'){
-				if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'){
-				//non sqlite database support only uses ODBC under windows
-					$this->create_odbc_database_connection();
-				}elseif($this->global_settings->db_type() != 'pgsql'){
-				//switch supports postgresql natively
-					$this->create_odbc_database_connection();
-				}
-			}
-		}
-
-		protected function create_odbc_database_connection() {
-			//needed for non native database support
-				$database_uuid = uuid();
-				$sql = "insert into v_databases ";
-				$sql .= "(";
-				$sql .= "database_uuid, ";
-				$sql .= "database_driver, ";
-				$sql .= "database_type, ";
-				$sql .= "database_host, ";
-				$sql .= "database_port, ";
-				$sql .= "database_name, ";
-				$sql .= "database_username, ";
-				$sql .= "database_password, ";
-				$sql .= "database_path, ";
-				$sql .= "database_description ";
-				$sql .= ")";
-				$sql .= "values ";
-				$sql .= "(";
-				$sql .= "'$database_uuid', ";
-				$sql .= "'odbc', ";
-				$sql .= "'".$this->global_settings->db_type()."', ";
-				$sql .= "'".$this->global_settings->db_host()."', ";
-				$sql .= "'".$this->global_settings->db_port()."', ";
-				$sql .= "'".$this->global_settings->db_name()."', ";
-				$sql .= "'".$this->global_settings->db_username()."', ";
-				$sql .= "'".$this->global_settings->db_password()."', ";
-				$sql .= "'".$this->global_settings->db_path()."', ";
-				$sql .= "'Created by installer' ";
-				$sql .= ")";
-				if($this->dbh->exec(check_sql($sql)) === false){
-					throw new Exception("Failed to create odbc_database entery: " . join(":", $this->dbh->errorInfo()));
-				}
-				unset($sql);
-		}
-
-		protected function create_database_sqlite() {
-			//sqlite database will be created when the config.php is loaded and only if the database file does not exist
-				try {
-					$this->dbh = new PDO('sqlite:'.$this->global_settings->db_path().'/'.$this->global_settings->db_name()); //sqlite 3
-					//$this->dbh = new PDO('sqlite::memory:'); //sqlite 3
-				}
-				catch (PDOException $error) {
-					throw new Exception("Failed to create database: " . $error->getMessage());
-				}
-
-			//add additional functions to SQLite - bool PDO::sqliteCreateFunction ( string function_name, callback callback [, int num_args] )
-				if (!function_exists('php_now')) {
-					function php_now() {
-						if(function_exists("date_default_timezone_set") and function_exists("date_default_timezone_get")) {
-							@date_default_timezone_set(@date_default_timezone_get());
-						}
-						return date("Y-m-d H:i:s");
-					}
-				}
-				$this->dbh->sqliteCreateFunction('now', 'php_now', 0);
-
-			//add the database structure
-				require_once "resources/classes/schema.php";
-				$schema = new schema;
-				$schema->db = $this->dbh;
-				$schema->db_type = $this->global_settings->db_type();
-				$schema->sql();
-				$schema->exec();
-
-			//get the contents of the sql file
-				if (file_exists('/usr/share/examples/fusionpbx/resources/install/sql/sqlite.sql')){
-					$filename = "/usr/share/examples/fusionpbx/resources/install/sql/sqlite.sql";
-				}
-				else {
-					$filename = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/sql/sqlite.sql';
-				}
-				$file_contents = file_get_contents($filename);
-				unset($filename);
-
-			//replace \r\n with \n then explode on \n
-				$file_contents = str_replace("\r\n", "\n", $file_contents);
-
-			//loop line by line through all the lines of sql code
-				$this->dbh->beginTransaction();
-				$string_array = explode("\n", $file_contents);
-				$x = 0;
-				foreach($string_array as $sql) {
-					try {
-						$this->dbh->query($sql);
-					}
-					catch (PDOException $error) {
-						throw new Exception("error creating database: " . $error->getMessage() . "\n" . $sql );
-					}
-					$x++;
-				}
-				unset ($file_contents, $sql);
-				$this->dbh->commit();
-
-			//set the file permissions
-				chmod($this->global_settings->db_path().'/'.$this->global_settings->db_name(), 0777);
-		}
-
-		protected function create_database_pgsql() {
-			//create the database
-				if ($this->global_settings->db_create()) {
-					//attempt to create new Postgres role and database
-						$this->write_progress("\tCreating database");
-						$db_create_username = $this->global_settings->db_create_username();
-						$db_create_password = $this->global_settings->db_create_password();
-						$db_host            = $this->global_settings->db_host();
-						$db_port            = $this->global_settings->db_port();
-						if(strlen($db_create_username) == 0){
-							$db_create_username = $this->global_settings->db_username();
-							$db_create_password = $this->global_settings->db_password();
-						}
-						if (strlen($db_host) == 0) {
-							$db_host = 'localhost';
-						}
-
-						try {
-							$this->dbh = new PDO("pgsql:host=$db_host port=$db_port user=$db_create_username password=$db_create_password dbname=template1");
-						} catch (PDOException $error) {
-							throw new Exception("error connecting to database in order to create: " . $error->getMessage());
-						}
-
-					//create the database, user, grant perms
-						if($this->dbh->exec("CREATE DATABASE {$this->global_settings->db_name()}") === false) {
-							throw new Exception("Failed to create database {$this->global_settings->db_name()}: " . join(":", $this->dbh->errorInfo()));
-						}
-						if($this->global_settings->db_username() != $db_create_username){
-							if($this->dbh->exec("CREATE USER {$this->global_settings->db_username()} WITH PASSWORD '{$this->global_settings->db_password()}'") === false){
-								// user may be already exists
-								// throw new Exception("Failed to create user {$this->global_settings->db_name()}: " . join(":", $this->dbh->errorInfo()));
-							}
-							if($this->dbh->exec("GRANT ALL ON DATABASE {$this->global_settings->db_name()} TO {$this->global_settings->db_username()}") === false){
-								throw new Exception("Failed to create user {$this->global_settings->db_name()}: " . join(":", $this->dbh->errorInfo()));
-							}
-						}
-
-					//close database connection_aborted
-						$this->dbh = null;
-				}
-				$this->write_progress("\tInstalling data to database");
-
-			//open database connection with $this->global_settings->db_name()
-				try {
-					if (strlen($this->global_settings->db_host()) > 0) {
-						$this->dbh = new PDO("pgsql:host={$this->global_settings->db_host()} port={$this->global_settings->db_port()} dbname={$this->global_settings->db_name()} user={$this->global_settings->db_username()} password={$this->global_settings->db_password()}");
-					} else {
-						$this->dbh = new PDO("pgsql:host=localhost port={$this->global_settings->db_port()} user={$this->global_settings->db_username()} password={$this->global_settings->db_password()} dbname={$this->global_settings->db_name()}");
-					}
-				}
-				catch (PDOException $error) {
-					throw new Exception("error connecting to database: " . $error->getMessage());
-				}
-
-			//add the database structure
-				require_once "resources/classes/schema.php";
-				$schema = new schema;
-				$schema->db = $this->dbh;
-				$schema->db_type = $this->global_settings->db_type();
-				$schema->sql();
-				$schema->exec();
-
-			//get the contents of the sql file
-				if (file_exists('/usr/share/examples/fusionpbx/resources/install/sql/pgsql.sql')){
-					$filename = "/usr/share/examples/fusionpbx/resources/install/sql/pgsql.sql";
-				}
-				else {
-				$filename = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/sql/pgsql.sql';
-				}
-				$file_contents = file_get_contents($filename);
-
-			//replace \r\n with \n then explode on \n
-				$file_contents = str_replace("\r\n", "\n", $file_contents);
-
-			//loop line by line through all the lines of sql code
-				$string_array = explode("\n", $file_contents);
-				$x = 0;
-				foreach($string_array as $sql) {
-					if (strlen($sql) > 3) {
-						try {
-							$this->dbh->query($sql);
-						}
-						catch (PDOException $error) {
-							throw new Exception("error creating database: " . $error->getMessage() . "\n" . $sql );
-						}
-					}
-					$x++;
-				}
-				unset ($file_contents, $sql);
-		}
-
-		protected function create_database_mysql() {
-			//database connection
-				$connect_string;
-				if (strlen($this->global_settings->db_host()) == 0 && strlen($this->global_settings->db_port()) == 0) {
-					//if both host and port are empty use the unix socket
-					$connect_string = "mysql:host={$this->global_settings->db_host()};unix_socket=/var/run/mysqld/mysqld.sock;";
-				}
-				elseif (strlen($this->global_settings->db_port()) == 0) {
-					//leave out port if it is empty
-					$connect_string = "mysql:host={$this->global_settings->db_host()};";
-				}
-				else {
-					$connect_string = "mysql:host={$this->global_settings->db_host()};port={$this->global_settings->db_port()};";
-				}
-
-			//if we need create new database
-				if ($this->global_settings->db_create()) {
-					//attempt to create new user and database
-						$this->write_progress("\tCreating database");
-						$db_create_username = $this->global_settings->db_create_username();
-						$db_create_password = $this->global_settings->db_create_password();
-
-						if(strlen($db_create_username) == 0){
-							$db_create_username = $this->global_settings->db_username();
-							$db_create_password = $this->global_settings->db_password();
-						}
-
-					//connect to MySQL
-						try {
-							$this->dbh = new PDO($connect_string, $db_create_username, $db_create_password, array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
-							$this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-							$this->dbh->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
-						}
-						catch (PDOException $error) {
-							throw new Exception("error connecting to database for create: " . $error->getMessage() . "\n" . $sql );
-						}
-
-					//select the mysql database
-						try {
-							$this->dbh->query("USE mysql;");
-						}
-						catch (PDOException $error) {
-							throw new Exception("error in database: " . $error->getMessage() . "\n" . $sql );
-						}
-
-					//create user if we use separeate user to access and create
-						if($this->global_settings->db_username() != $db_create_username) {
-							//create user and set the permissions
-								try {
-									$tmp_sql = "CREATE USER '".$this->global_settings->db_username()."'@'%' IDENTIFIED BY '".$this->global_settings->db_password()."'; ";
-									$this->dbh->query($tmp_sql);
-								}
-								catch (PDOException $error) {
-									// ignore error here because user may already exists
-									// (e.g. reinstall can be done via remove db)
-									// throw new Exception("error in database: " . $error->getMessage() . "\n" . $sql );
-								}
-
-							//set account to unlimited use
-								try {
-									if ($this->global_settings->db_host() == "localhost" || $this->global_settings->db_host() == "127.0.0.1") {
-										$tmp_sql = "GRANT USAGE ON * . * TO '".$this->global_settings->db_username()."'@'localhost' ";
-										$tmp_sql .= "IDENTIFIED BY '".$this->global_settings->db_password()."' ";
-										$tmp_sql .= "WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0; ";
-										$this->dbh->query($tmp_sql);
-
-										$tmp_sql = "GRANT USAGE ON * . * TO '".$this->global_settings->db_username()."'@'127.0.0.1' ";
-										$tmp_sql .= "IDENTIFIED BY '".$this->global_settings->db_password()."' ";
-										$tmp_sql .= "WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0; ";
-										$this->dbh->query($tmp_sql);
-									}
-									else {
-										$tmp_sql = "GRANT USAGE ON * . * TO '".$this->global_settings->db_username()."'@'".$this->global_settings->db_host()."' ";
-										$tmp_sql .= "IDENTIFIED BY '".$this->global_settings->db_password()."' ";
-										$tmp_sql .= "WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0; ";
-										$this->dbh->query($tmp_sql);
-									}
-								}
-								catch (PDOException $error) {
-									throw new Exception("error in database: " . $error->getMessage() . "\n" . $sql );
-								}
-						}
-
-					//create the database and set the create user with permissions
-						try {
-							$tmp_sql = "CREATE DATABASE IF NOT EXISTS ".$this->global_settings->db_name()."; ";
-							$this->dbh->query($tmp_sql);
-						}
-						catch (PDOException $error) {
-							throw new Exception("error in database: " . $error->getMessage() . "\n" . $sql );
-						}
-
-					//set user permissions
-						if($this->global_settings->db_username() != $db_create_username) {
-							try {
-								$this->dbh->query("GRANT ALL PRIVILEGES ON ".$this->global_settings->db_name().".* TO '".$this->global_settings->db_username()."'@'%'; ");
-							}
-							catch (PDOException $error) {
-								throw new Exception("error in database: " . $error->getMessage() . "\n" . $sql );
-							}
-						}
-
-					//make the changes active
-						try {
-							$tmp_sql = "FLUSH PRIVILEGES; ";
-							$this->dbh->query($tmp_sql);
-						}
-						catch (PDOException $error) {
-							throw new Exception("error in database: " . $error->getMessage() . "\n" . $sql );
-						}
-						$this->dbh = null;
-				}
-
-				$this->write_progress("\tInstalling data to database");
-
-			//connect to the database
-				try {
-					$this->dbh = new PDO($connect_string, $this->global_settings->db_username(), $this->global_settings->db_password(), array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
-					$this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-					$this->dbh->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
-				}
-				catch (PDOException $error) {
-					throw new Exception("error connecting to database: " . $error->getMessage() . "\n" . $sql );
-				}
-
-			//select the database
-				try {
-					$this->dbh->query("USE ".$this->global_settings->db_name().";");
-				}
-				catch (PDOException $error) {
-					throw new Exception("error in database: " . $error->getMessage() . "\n" . $sql );
-				}
-
-			//add the database structure
-				require_once "resources/classes/schema.php";
-				$schema = new schema;
-				$schema->db = $this->dbh;
-				$schema->db_type = $this->global_settings->db_type();
-				$schema->sql();
-				$schema->exec();
-
-			//add the defaults data into the database
-				//get the contents of the sql file
-					if (file_exists('/usr/share/examples/fusionpbx/resources/install/sql/mysql.sql')){
-						$filename = "/usr/share/examples/fusionpbx/resources/install/sql/mysql.sql";
-					}
-					else {
-						$filename = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/sql/mysql.sql';
-					}
-					$file_contents = file_get_contents($filename);
-
-				//replace \r\n with \n then explode on \n
-					$file_contents = str_replace("\r\n", "\n", $file_contents);
-
-				//loop line by line through all the lines of sql code
-					$string_array = explode("\n", $file_contents);
-					$x = 0;
-					foreach($string_array as $sql) {
-						if (strlen($sql) > 3) {
-							try {
-								if ($this->debug) {
-									$this->write_debug( $sql."\n");
-								}
-								$this->dbh->query($sql);
-							}
-							catch (PDOException $error) {
-								//echo "error on line $x: " . $error->getMessage() . " sql: $sql<br/>";
-								//die();
-							}
-						}
-						$x++;
-					}
-					unset ($file_contents, $sql);
-		}
-
-		protected function create_domain() {
-			$this->write_progress("\tChecking if domain exists '" . $this->global_settings->domain_name() . "'");
-			$sql = "select * from v_domains ";
-			$sql .= "where domain_name = '".$this->global_settings->domain_name()."' ";
-			$sql .= "limit 1";
-			$this->write_debug($sql);
-			$prep_statement = $this->dbh->prepare(check_sql($sql));
-			if($prep_statement->execute() === false){
-				throw new Exception("Failed to search for domain: " . join(":", $this->dbh->errorInfo()));
-			}
-			$result = $prep_statement->fetch(PDO::FETCH_NAMED);
-			unset($sql, $prep_statement);
-			if ($result) {
-				$this->global_settings->set_domain_uuid($result['domain_uuid']);
-				$this->write_progress("... domain exists as '" . $this->global_settings->domain_uuid() . "'");
-				if($result['domain_enabled'] != 'true'){
-					throw new Exception("Domain already exists but is disabled, this is unexpected");
-				}
-			} else {
-				$this->write_progress("\t... creating domain");
-				$sql = "insert into v_domains ";
-				$sql .= "(";
-				$sql .= "domain_uuid, ";
-				$sql .= "domain_name, ";
-				$sql .= "domain_description ";
-				$sql .= ") ";
-				$sql .= "values ";
-				$sql .= "(";
-				$sql .= "'".$this->global_settings->domain_uuid()."', ";
-				$sql .= "'".$this->global_settings->domain_name()."', ";
-				$sql .= "'Default Domain' ";
-				$sql .= ");";
-
-				$this->write_debug($sql);
-				if($this->dbh->exec(check_sql($sql)) === false){
-					throw new Exception("Failed to execute sql statement: " . join(":", $this->dbh->errorInfo()));
-				}
-				unset($sql);
-
-				//domain settings
-				$x = 0;
-				$tmp[$x]['name'] = 'uuid';
-				$tmp[$x]['value'] = $this->menu_uuid;
-				$tmp[$x]['category'] = 'domain';
-				$tmp[$x]['subcategory'] = 'menu';
-				$tmp[$x]['enabled'] = 'true';
-				$x++;
-				$tmp[$x]['name'] = 'name';
-				$tmp[$x]['category'] = 'domain';
-				$tmp[$x]['subcategory'] = 'time_zone';
-				$tmp[$x]['enabled'] = 'true';
-				$x++;
-				$tmp[$x]['name'] = 'code';
-				$tmp[$x]['value'] = 'en-us';
-				$tmp[$x]['category'] = 'domain';
-				$tmp[$x]['subcategory'] = 'language';
-				$tmp[$x]['enabled'] = 'true';
-				$x++;
-				$tmp[$x]['name'] = 'iso_code';
-				$tmp[$x]['value'] = $this->default_country;
-				$tmp[$x]['category'] = 'domain';
-				$tmp[$x]['subcategory'] = 'country';
-				$tmp[$x]['enabled'] = 'true';
-				$x++;
-				$tmp[$x]['name'] = 'name';
-				$tmp[$x]['value'] = $this->template_name;
-				$tmp[$x]['category'] = 'domain';
-				$tmp[$x]['subcategory'] = 'template';
-				$tmp[$x]['enabled'] = 'true';
-				$x++;
-
-				//server settings
-				$tmp[$x]['name'] = 'dir';
-				$tmp[$x]['value'] = $this->global_settings->switch_temp_dir();
-				$tmp[$x]['category'] = 'server';
-				$tmp[$x]['subcategory'] = 'temp';
-				$tmp[$x]['enabled'] = 'true';
-				$x++;
-				$x++;
-				$tmp[$x]['name'] = 'dir';
-				$tmp[$x]['value'] = $this->global_settings->switch_backup_vdir();
-				$tmp[$x]['category'] = 'server';
-				$tmp[$x]['subcategory'] = 'backup';
-				$tmp[$x]['enabled'] = 'true';
-				$x++;
-
-				$this->dbh->beginTransaction();
-				foreach($tmp as $row) {
-					$sql = "insert into v_default_settings ";
-					$sql .= "(";
-					$sql .= "default_setting_uuid, ";
-					$sql .= "default_setting_name, ";
-					$sql .= "default_setting_value, ";
-					$sql .= "default_setting_category, ";
-					$sql .= "default_setting_subcategory, ";
-					$sql .= "default_setting_enabled ";
-					$sql .= ") ";
-					$sql .= "values ";
-					$sql .= "(";
-					$sql .= "'".uuid()."', ";
-					$sql .= "'".$row['name']."', ";
-					$sql .= "'".$row['value']."', ";
-					$sql .= "'".$row['category']."', ";
-					$sql .= "'".$row['subcategory']."', ";
-					$sql .= "'".$row['enabled']."' ";
-					$sql .= ");";
-					$this->write_debug($sql);
-					$this->dbh->exec(check_sql($sql));
-					unset($sql);
-				}
-				$this->dbh->commit();
-				unset($tmp);
-
-			//get the list of installed apps from the core and mod directories
-				$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php");
-				$x=0;
-				foreach ($config_list as $config_path) {
-					include($config_path);
-					$x++;
-				}
-			}
-		}
-
-		protected function create_superuser() {
-			$this->write_progress("\tChecking if superuser exists '" . $this->admin_username . "'");
-			$sql = "select * from v_users ";
-			$sql .= "where domain_uuid = '".$this->global_settings->domain_uuid()."' ";
-			$sql .= "and username = '".$this->admin_username."' ";
-			$sql .= "limit 1 ";
-			$this->write_debug($sql);
-			$prep_statement = $this->dbh->prepare(check_sql($sql));
-			$prep_statement->execute();
-			$result = $prep_statement->fetch(PDO::FETCH_NAMED);
-			unset($sql, $prep_statement);
-			$salt = generate_password('20', '4');
-			if ($result) {
-				$this->admin_uuid = $result['user_uuid'];
-				$this->write_progress("... superuser exists as '" . $this->admin_uuid . "', updating password");
-				$sql = "update v_users ";
-				$sql .= "set password = '".md5($salt.$this->admin_password)."' ";
-				$sql .= "set salt = '$salt' ";
-				$sql .= "where USER_uuid = '".$this->admin_uuid."' ";
-				$this->write_debug($sql);
-				$this->dbh->exec(check_sql($sql));
-			} else {
-				//message
-					$this->write_progress("\t... creating super user");
-				//add a user and then add the user to the superadmin group
-				//prepare the values
-					$this->admin_uuid = uuid();
-					$contact_uuid = uuid();
-				//set a sessiong variable
-					$_SESSION["user_uuid"] = $user_uuid;
-				//salt used with the password to create a one way hash
-				//add the user account
-					$sql = "insert into v_users ";
-					$sql .= "(";
-					$sql .= "domain_uuid, ";
-					$sql .= "user_uuid, ";
-					$sql .= "contact_uuid, ";
-					$sql .= "username, ";
-					$sql .= "password, ";
-					$sql .= "salt, ";
-					$sql .= "add_date, ";
-					$sql .= "add_user, ";
-					$sql .= "user_enabled ";
-					$sql .= ") ";
-					$sql .= "values ";
-					$sql .= "(";
-					$sql .= "'".$this->global_settings->domain_uuid()."', ";
-					$sql .= "'".$this->admin_uuid."', ";
-					$sql .= "'$contact_uuid', ";
-					$sql .= "'".$this->admin_username."', ";
-					$sql .= "'".md5($salt.$this->admin_password)."', ";
-					$sql .= "'$salt', ";
-					$sql .= "now(), ";
-					$sql .= "'".$this->admin_username."', ";
-					$sql .= "'true' ";
-					$sql .= ");";
-					$this->write_debug( $sql."\n");
-					$this->dbh->exec(check_sql($sql));
-					unset($sql);
-			}
-			$this->write_progress("\tChecking if superuser contact exists");
-			$sql = "select count(*) from v_contacts ";
-			$sql .= "where domain_uuid = '".$this->global_settings->domain_uuid()."' ";
-			$sql .= "and contact_name_given = '".$this->admin_username."' ";
-			$sql .= "and contact_nickname = '".$this->admin_username."' ";
-			$sql .= "limit 1 ";
-			$this->write_debug($sql);
-			$prep_statement = $this->dbh->prepare(check_sql($sql));
-			$prep_statement->execute();
-			$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
-			if ($row['count'] == 0) {
-				$sql = "insert into v_contacts ";
-				$sql .= "(";
-				$sql .= "domain_uuid, ";
-				$sql .= "contact_uuid, ";
-				$sql .= "contact_type, ";
-				$sql .= "contact_name_given, ";
-				$sql .= "contact_nickname ";
-				$sql .= ") ";
-				$sql .= "values ";
-				$sql .= "(";
-				$sql .= "'".$this->global_settings->domain_uuid()."', ";
-				$sql .= "'$contact_uuid', ";
-				$sql .= "'user', ";
-				$sql .= "'".$this->admin_username."', ";
-				$sql .= "'".$this->admin_username."' ";
-				$sql .= ")";
-				$this->dbh->exec(check_sql($sql));
-				unset($sql);
-			}
-			$this->write_progress("\tChecking if superuser is in the correct group");
-			$sql = "select count(*) from v_group_users ";
-			$sql .= "where domain_uuid = '".$this->global_settings->domain_uuid()."' ";
-			$sql .= "and user_uuid = '".$this->admin_uuid."' ";
-			$sql .= "and group_name = 'superadmin' ";
-			$sql .= "limit 1 ";
-			$this->write_debug($sql);
-			$prep_statement = $this->dbh->prepare(check_sql($sql));
-			$prep_statement->execute();
-			$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
-			if ($row['count'] == 0) {
-				//add the user to the superadmin group
-				$sql = "insert into v_group_users ";
-				$sql .= "(";
-				$sql .= "group_user_uuid, ";
-				$sql .= "domain_uuid, ";
-				$sql .= "user_uuid, ";
-				$sql .= "group_name ";
-				$sql .= ") ";
-				$sql .= "values ";
-				$sql .= "(";
-				$sql .= "'".uuid()."', ";
-				$sql .= "'".$this->global_settings->domain_uuid()."', ";
-				$sql .= "'".$this->admin_uuid."', ";
-				$sql .= "'superadmin' ";
-				$sql .= ");";
-				$this->write_debug( $sql."\n");
-				$this->dbh->exec(check_sql($sql));
-				unset($sql);
-			}
-		}
-
-		protected function app_defaults() {
-
-			//write a progress message
-				$this->write_progress("\tRunning app_defaults");
-
-			//set needed session settings
-				$_SESSION["username"] = $this->admin_username;
-				$_SESSION["domain_uuid"] = $this->global_settings->domain_uuid();
-				require $this->config_php;
-				require "resources/require.php";
-				$_SESSION['event_socket_ip_address'] = $this->global_settings->event_host;
-				$_SESSION['event_socket_port'] = $this->global_settings->event_port;
-				$_SESSION['event_socket_password'] = $this->global_settings->event_password;
-
-			//get the groups assigned to the user and then set the groups in $_SESSION["groups"]
-				$sql = "SELECT * FROM v_group_users ";
-				$sql .= "where domain_uuid=:domain_uuid ";
-				$sql .= "and user_uuid=:user_uuid ";
-				$prep_statement = $this->dbh->prepare(check_sql($sql));
-				$prep_statement->bindParam(':domain_uuid', $this->global_settings->domain_uuid);
-				$prep_statement->bindParam(':user_uuid', $this->admin_uuid);
-				$prep_statement->execute();
-				$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-				$_SESSION["groups"] = $result;
-				unset($sql, $row_count, $prep_statement);
-
-			//get the permissions assigned to the groups that the user is a member of set the permissions in $_SESSION['permissions']
-				$x = 0;
-				$sql = "select distinct(permission_name) from v_group_permissions ";
-				foreach($_SESSION["groups"] as $field) {
-					if (strlen($field['group_name']) > 0) {
-						if ($x == 0) {
-							$sql .= "where (domain_uuid = '".$this->global_settings->domain_uuid."' and group_name = '".$field['group_name']."') ";
-						}
-						else {
-							$sql .= "or (domain_uuid = '".$this->global_settings->domain_uuid."' and group_name = '".$field['group_name']."') ";
-						}
-						$x++;
-					}
-				}
-				$prep_statement_sub = $this->dbh->prepare($sql);
-				$prep_statement_sub->execute();
-				$_SESSION['permissions'] = $prep_statement_sub->fetchAll(PDO::FETCH_NAMED);
-				unset($sql, $prep_statement_sub);
-
-			//include the config.php
-				$db_type = $this->global_settings->db_type();
-				$db_path = $this->global_settings->db_path();
-				$db_host = $this->global_settings->db_host();
-				$db_port = $this->global_settings->db_port();
-				$db_name = $this->global_settings->db_name();
-				$db_username = $this->global_settings->db_username();
-				$db_password = $this->global_settings->db_password();
-
-			//add the database structure
-				require_once "resources/classes/schema.php";
-				$schema = new schema;
-				echo $schema->schema();
-
-			//run all app_defaults.php files
-				$default_language = $this->install_language;
-				$domain = new domains;
-				$domain->upgrade();
-
-			//get the switch default settings
-				$sql = "select * from v_default_settings ";
-				$sql .= "where default_setting_category = 'switch' ";
-				$sql .= "and default_setting_enabled = 'true' ";
-				$prep_statement = $this->dbh->prepare($sql);
-				$prep_statement->execute();
-				$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-				foreach($default_settings as $row) {
-					$name = $row['default_setting_name'];
-					$category = $row['default_setting_category'];
-					$subcategory = $row['default_setting_subcategory'];
-					if ($category == "switch") {
-						$_SESSION[$category][$subcategory]['uuid'] = $row['default_setting_uuid'];
-						$_SESSION[$category][$subcategory][$name] = $row['default_setting_value'];
-					}
-				}
-				unset ($prep_statement, $sql);
-
-			//update config.lua
-				$obj = new scripts;
-				$obj->copy_files();
-				$obj->write_config();
-
-			//synchronize the config with the saved settings
-				save_switch_xml();
-
-			//do not show the apply settings reminder on the login page
-				$_SESSION["reload_xml"] = false;
-
-			//clear the menu
-				$_SESSION["menu"] = "";
-
-		}
-
-		public function remove_config() {
-			if (file_exists('/bin/rm')) {
-				$this->write_debug('rm -f ' . $this->config_php);
-				exec ('rm -f ' . $this->config_php);
-			}
-			elseif(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'){
-				$this->write_debug("del /S /F /Q '$dir'");
-				exec("del /F /Q '" . $this->config_php . "'");
-			}
-			else {
-				$this->write_debug("delete file: ".$file);
-				unlink($this->config_php);
-			}
-			clearstatcache();
-		}
-	}
-
+<?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]>
+	Copyright (C) 2010-2016
+	All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+	Matthew Vale <[email protected]>
+*/
+include "root.php";
+
+//define the install class
+	class install_fusionpbx {
+
+		protected $global_settings;
+		protected $config_php;
+		protected $menu_uuid = 'b4750c3f-2a86-b00d-b7d0-345c14eca286';
+		protected $dbh;
+
+		public $debug = false;
+		public $echo_progress = false;
+
+		public $install_language = 'en-us';
+		public $admin_username;
+		public $admin_password;
+		public $default_country = 'US';
+		public $template_name = 'enhanced';
+
+		function __construct($global_settings) {
+			if(is_null($global_settings)){
+				require_once "resources/classes/global_settings.php";
+				$global_settings = new global_settings();
+			}elseif(!is_a($global_settings, 'global_settings')){
+				throw new Exception('The parameter $global_settings must be a global_settings object (or a subclass of)');
+			}
+			$this->global_settings = $global_settings;
+			if (is_dir("/etc/fusionpbx")){
+				$this->config_php = "/etc/fusionpbx/config.php";
+			} elseif (is_dir("/usr/local/etc/fusionpbx")){
+				$this->config_php = "/usr/local/etc/fusionpbx/config.php";
+			}
+			elseif (is_dir($_SERVER["PROJECT_ROOT"]."/resources")) {
+				$this->config_php = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/config.php";
+			}
+			else {
+				$this->config_php = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/config.php";
+			}
+			$this->config_php = normalize_path_to_os($this->config_php);
+		}
+
+		function write_debug($message) {
+			if($this->debug){
+				echo "$message\n";
+			}
+		}
+
+		function write_progress($message) {
+			if($this->echo_progress){
+				echo "$message\n";
+			}
+		}
+
+		function install_phase_1() {
+			ini_set('max_execution_time',3600);
+			$this->write_progress("Install phase 1 started for FusionPBX");
+			$this->create_config_php();
+			$this->write_progress("\tExecuting config.php");
+			require $this->config_php;
+			global $db;
+			$db = $this->dbh;
+			$this->create_database();
+			$this->create_domain();
+			$this->create_superuser();
+			$this->app_defaults();
+			$this->write_progress("\tRunning requires");
+			require "resources/require.php";
+			$this->write_progress("Install phase 1 complete for FusionPBX");
+		}
+
+		function install_phase_2() {
+			ini_set('max_execution_time',3600);
+			$this->write_progress("Install phase 2 started for FusionPBX");
+			//$this->app_defaults();
+			$this->write_progress("Install phase 2 complete for FusionPBX");
+		}
+
+		protected function create_config_php() {
+			$this->write_progress("\tCreating " . $this->config_php);
+			$tmp_config = "<?php\n";
+			$tmp_config .= "/* \$Id\$ */\n";
+			$tmp_config .= "/*\n";
+			$tmp_config .= "	config.php\n";
+			$tmp_config .= "	Copyright (C) 2008, 2013 Mark J Crane\n";
+			$tmp_config .= "	All rights reserved.\n";
+			$tmp_config .= "\n";
+			$tmp_config .= "	Redistribution and use in source and binary forms, with or without\n";
+			$tmp_config .= "	modification, are permitted provided that the following conditions are met:\n";
+			$tmp_config .= "\n";
+			$tmp_config .= "	1. Redistributions of source code must retain the above copyright notice,\n";
+			$tmp_config .= "	   this list of conditions and the following disclaimer.\n";
+			$tmp_config .= "\n";
+			$tmp_config .= "	2. Redistributions in binary form must reproduce the above copyright\n";
+			$tmp_config .= "	   notice, this list of conditions and the following disclaimer in the\n";
+			$tmp_config .= "	   documentation and/or other materials provided with the distribution.\n";
+			$tmp_config .= "\n";
+			$tmp_config .= "	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,\n";
+			$tmp_config .= "	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n";
+			$tmp_config .= "	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n";
+			$tmp_config .= "	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n";
+			$tmp_config .= "	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n";
+			$tmp_config .= "	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n";
+			$tmp_config .= "	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n";
+			$tmp_config .= "	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n";
+			$tmp_config .= "	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n";
+			$tmp_config .= "	POSSIBILITY OF SUCH DAMAGE.\n";
+			$tmp_config .= "*/\n";
+			$tmp_config .= "\n";
+			$tmp_config .= "//-----------------------------------------------------\n";
+			$tmp_config .= "// settings:\n";
+			$tmp_config .= "//-----------------------------------------------------\n";
+			$tmp_config .= "\n";
+			$tmp_config .= "	//set the database type\n";
+			$tmp_config .= "		\$db_type = '".$this->global_settings->db_type()."'; //sqlite, mysql, pgsql, others with a manually created PDO connection\n";
+			$tmp_config .= "\n";
+			if ($this->global_settings->db_type() == "sqlite") {
+				$tmp_config .= "	//sqlite: the db_name and db_path are automatically assigned however the values can be overidden by setting the values here.\n";
+				$tmp_config .= "		\$db_name = '".$this->global_settings->db_name()."'; //host name/ip address + '.db' is the default database filename\n";
+				$tmp_config .= "		\$db_path = '".$this->global_settings->db_path()."'; //the path is determined by a php variable\n";
+			}
+			$tmp_config .= "\n";
+			$tmp_config .= "	//mysql: database connection information\n";
+			if ($this->global_settings->db_type() == "mysql") {
+				$db_host = $this->global_settings->db_host();
+				if ( $db_host == "localhost") {
+					//if localhost is used it defaults to a Unix Socket which doesn't seem to work.
+					//replace localhost with 127.0.0.1 so that it will connect using TCP
+					$db_host = "127.0.0.1";
+				}
+				$tmp_config .= "		\$db_host = '".$db_host."';\n";
+				$tmp_config .= "		\$db_port = '".$this->global_settings->db_port()."';\n";
+				$tmp_config .= "		\$db_name = '".$this->global_settings->db_name()."';\n";
+				$tmp_config .= "		\$db_username = '".$this->global_settings->db_username()."';\n";
+				$tmp_config .= "		\$db_password = '".$this->global_settings->db_password()."';\n";
+			}
+			else {
+				$tmp_config .= "		//\$db_host = '';\n";
+				$tmp_config .= "		//\$db_port = '';\n";
+				$tmp_config .= "		//\$db_name = '';\n";
+				$tmp_config .= "		//\$db_username = '';\n";
+				$tmp_config .= "		//\$db_password = '';\n";
+			}
+			$tmp_config .= "\n";
+			$tmp_config .= "	//pgsql: database connection information\n";
+			if ($this->global_settings->db_type() == "pgsql") {
+				$db_host = $this->global_settings->db_host();
+				//Unix Socket - if localhost or 127.0.0.1 we want it to default to a Unix Socket.
+				//$comment_out = '';
+				//if ( $db_host == "localhost" or $db_host == "127.0.0.1") {
+				//	$comment_out = "//";
+				//}
+				//$tmp_config .= "		$comment_out\$db_host = '".$this->global_settings->db_host()."'; //set the host only if the database is not local\n";
+				$tmp_config .= "		\$db_host = '".$this->global_settings->db_host()."'; //set the host only if the database is not local\n";
+				$tmp_config .= "		\$db_port = '".$this->global_settings->db_port()."';\n";
+				$tmp_config .= "		\$db_name = '".$this->global_settings->db_name()."';\n";
+				$tmp_config .= "		\$db_username = '".$this->global_settings->db_username()."';\n";
+				$tmp_config .= "		\$db_password = '".$this->global_settings->db_password()."';\n";
+			}
+			else {
+				$tmp_config .= "		//\$db_host = '".$this->global_settings->db_host()."'; //set the host only if the database is not local\n";
+				$tmp_config .= "		//\$db_port = '".$this->global_settings->db_port()."';\n";
+				$tmp_config .= "		//\$db_name = '".$this->global_settings->db_name()."';\n";
+				$tmp_config .= "		//\$db_username = '".$this->global_settings->db_username()."';\n";
+				$tmp_config .= "		//\$db_password = '".$this->global_settings->db_password()."';\n";
+			}
+			$tmp_config .= "\n";
+			$tmp_config .= "	//show errors\n";
+			$tmp_config .= "		ini_set('display_errors', '1');\n";
+			$tmp_config .= "		//error_reporting (E_ALL); // Report everything\n";
+			$tmp_config .= "		//error_reporting (E_ALL ^ E_NOTICE); // Report everything\n";
+			$tmp_config .= "		error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING ); //hide notices and warnings";
+			$tmp_config .= "\n";
+			$tmp_config .= "?>";
+
+			if((file_exists($this->config_php)
+				and !is_writable($this->config_php))
+				or !is_writable(dirname($this->config_php))
+				) {
+				throw new Exception("cannot write to '" . $this->config_php . "'" );
+			}
+			$fout = fopen($this->config_php,"w");
+			fwrite($fout, $tmp_config);
+			unset($tmp_config);
+			fclose($fout);
+		}
+
+		protected function create_database() {
+			$this->write_progress("\tUsing database as type " . $this->global_settings->db_type());
+			$function = "create_database_" . $this->global_settings->db_type();
+			$this->$function();
+
+			//sqlite is natively supported under all known OS'es
+			if($this->global_settings->db_type() != 'sqlite'){
+				if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'){
+				//non sqlite database support only uses ODBC under windows
+					$this->create_odbc_database_connection();
+				}elseif($this->global_settings->db_type() != 'pgsql'){
+				//switch supports postgresql natively
+					$this->create_odbc_database_connection();
+				}
+			}
+		}
+
+		protected function create_odbc_database_connection() {
+			//needed for non native database support
+				$database_uuid = uuid();
+				$sql = "insert into v_databases ";
+				$sql .= "(";
+				$sql .= "database_uuid, ";
+				$sql .= "database_driver, ";
+				$sql .= "database_type, ";
+				$sql .= "database_host, ";
+				$sql .= "database_port, ";
+				$sql .= "database_name, ";
+				$sql .= "database_username, ";
+				$sql .= "database_password, ";
+				$sql .= "database_path, ";
+				$sql .= "database_description ";
+				$sql .= ")";
+				$sql .= "values ";
+				$sql .= "(";
+				$sql .= "'$database_uuid', ";
+				$sql .= "'odbc', ";
+				$sql .= "'".$this->global_settings->db_type()."', ";
+				$sql .= "'".$this->global_settings->db_host()."', ";
+				$sql .= "'".$this->global_settings->db_port()."', ";
+				$sql .= "'".$this->global_settings->db_name()."', ";
+				$sql .= "'".$this->global_settings->db_username()."', ";
+				$sql .= "'".$this->global_settings->db_password()."', ";
+				$sql .= "'".$this->global_settings->db_path()."', ";
+				$sql .= "'Created by installer' ";
+				$sql .= ")";
+				if($this->dbh->exec(check_sql($sql)) === false){
+					throw new Exception("Failed to create odbc_database entery: " . join(":", $this->dbh->errorInfo()));
+				}
+				unset($sql);
+		}
+
+		protected function create_database_sqlite() {
+			//sqlite database will be created when the config.php is loaded and only if the database file does not exist
+				try {
+					$this->dbh = new PDO('sqlite:'.$this->global_settings->db_path().'/'.$this->global_settings->db_name()); //sqlite 3
+					//$this->dbh = new PDO('sqlite::memory:'); //sqlite 3
+				}
+				catch (PDOException $error) {
+					throw new Exception("Failed to create database: " . $error->getMessage());
+				}
+
+			//add additional functions to SQLite - bool PDO::sqliteCreateFunction ( string function_name, callback callback [, int num_args] )
+				if (!function_exists('php_now')) {
+					function php_now() {
+						if(function_exists("date_default_timezone_set") and function_exists("date_default_timezone_get")) {
+							@date_default_timezone_set(@date_default_timezone_get());
+						}
+						return date("Y-m-d H:i:s");
+					}
+				}
+				$this->dbh->sqliteCreateFunction('now', 'php_now', 0);
+
+			//add the database structure
+				require_once "resources/classes/schema.php";
+				$schema = new schema;
+				$schema->db = $this->dbh;
+				$schema->db_type = $this->global_settings->db_type();
+				$schema->sql();
+				$schema->exec();
+
+			//get the contents of the sql file
+				if (file_exists('/usr/share/examples/fusionpbx/resources/install/sql/sqlite.sql')){
+					$filename = "/usr/share/examples/fusionpbx/resources/install/sql/sqlite.sql";
+				}
+				else {
+					$filename = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/sql/sqlite.sql';
+				}
+				$file_contents = file_get_contents($filename);
+				unset($filename);
+
+			//replace \r\n with \n then explode on \n
+				$file_contents = str_replace("\r\n", "\n", $file_contents);
+
+			//loop line by line through all the lines of sql code
+				$this->dbh->beginTransaction();
+				$string_array = explode("\n", $file_contents);
+				$x = 0;
+				foreach($string_array as $sql) {
+					try {
+						$this->dbh->query($sql);
+					}
+					catch (PDOException $error) {
+						throw new Exception("error creating database: " . $error->getMessage() . "\n" . $sql );
+					}
+					$x++;
+				}
+				unset ($file_contents, $sql);
+				$this->dbh->commit();
+
+			//set the file permissions
+				chmod($this->global_settings->db_path().'/'.$this->global_settings->db_name(), 0777);
+		}
+
+		protected function create_database_pgsql() {
+			//create the database
+				if ($this->global_settings->db_create()) {
+					//attempt to create new Postgres role and database
+						$this->write_progress("\tCreating database");
+						$db_create_username = $this->global_settings->db_create_username();
+						$db_create_password = $this->global_settings->db_create_password();
+						$db_host            = $this->global_settings->db_host();
+						$db_port            = $this->global_settings->db_port();
+						if(strlen($db_create_username) == 0){
+							$db_create_username = $this->global_settings->db_username();
+							$db_create_password = $this->global_settings->db_password();
+						}
+						if (strlen($db_host) == 0) {
+							$db_host = 'localhost';
+						}
+
+						try {
+							$this->dbh = new PDO("pgsql:host=$db_host port=$db_port user=$db_create_username password=$db_create_password dbname=template1");
+						} catch (PDOException $error) {
+							throw new Exception("error connecting to database in order to create: " . $error->getMessage());
+						}
+
+					//create the database, user, grant perms
+						if($this->dbh->exec("CREATE DATABASE {$this->global_settings->db_name()}") === false) {
+							throw new Exception("Failed to create database {$this->global_settings->db_name()}: " . join(":", $this->dbh->errorInfo()));
+						}
+						if($this->global_settings->db_username() != $db_create_username){
+							if($this->dbh->exec("CREATE USER {$this->global_settings->db_username()} WITH PASSWORD '{$this->global_settings->db_password()}'") === false){
+								// user may be already exists
+								// throw new Exception("Failed to create user {$this->global_settings->db_name()}: " . join(":", $this->dbh->errorInfo()));
+							}
+							if($this->dbh->exec("GRANT ALL ON DATABASE {$this->global_settings->db_name()} TO {$this->global_settings->db_username()}") === false){
+								throw new Exception("Failed to create user {$this->global_settings->db_name()}: " . join(":", $this->dbh->errorInfo()));
+							}
+						}
+
+					//close database connection_aborted
+						$this->dbh = null;
+				}
+				$this->write_progress("\tInstalling data to database");
+
+			//open database connection with $this->global_settings->db_name()
+				try {
+					if (strlen($this->global_settings->db_host()) > 0) {
+						$this->dbh = new PDO("pgsql:host={$this->global_settings->db_host()} port={$this->global_settings->db_port()} dbname={$this->global_settings->db_name()} user={$this->global_settings->db_username()} password={$this->global_settings->db_password()}");
+					} else {
+						$this->dbh = new PDO("pgsql:host=localhost port={$this->global_settings->db_port()} user={$this->global_settings->db_username()} password={$this->global_settings->db_password()} dbname={$this->global_settings->db_name()}");
+					}
+				}
+				catch (PDOException $error) {
+					throw new Exception("error connecting to database: " . $error->getMessage());
+				}
+
+			//add the database structure
+				require_once "resources/classes/schema.php";
+				$schema = new schema;
+				$schema->db = $this->dbh;
+				$schema->db_type = $this->global_settings->db_type();
+				$schema->sql();
+				$schema->exec();
+
+			//get the contents of the sql file
+				if (file_exists('/usr/share/examples/fusionpbx/resources/install/sql/pgsql.sql')){
+					$filename = "/usr/share/examples/fusionpbx/resources/install/sql/pgsql.sql";
+				}
+				else {
+				$filename = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/sql/pgsql.sql';
+				}
+				$file_contents = file_get_contents($filename);
+
+			//replace \r\n with \n then explode on \n
+				$file_contents = str_replace("\r\n", "\n", $file_contents);
+
+			//loop line by line through all the lines of sql code
+				$string_array = explode("\n", $file_contents);
+				$x = 0;
+				foreach($string_array as $sql) {
+					if (strlen($sql) > 3) {
+						try {
+							$this->dbh->query($sql);
+						}
+						catch (PDOException $error) {
+							throw new Exception("error creating database: " . $error->getMessage() . "\n" . $sql );
+						}
+					}
+					$x++;
+				}
+				unset ($file_contents, $sql);
+		}
+
+		protected function create_database_mysql() {
+			//database connection
+				$connect_string;
+				if (strlen($this->global_settings->db_host()) == 0 && strlen($this->global_settings->db_port()) == 0) {
+					//if both host and port are empty use the unix socket
+					$connect_string = "mysql:host={$this->global_settings->db_host()};unix_socket=/var/run/mysqld/mysqld.sock;";
+				}
+				elseif (strlen($this->global_settings->db_port()) == 0) {
+					//leave out port if it is empty
+					$connect_string = "mysql:host={$this->global_settings->db_host()};";
+				}
+				else {
+					$connect_string = "mysql:host={$this->global_settings->db_host()};port={$this->global_settings->db_port()};";
+				}
+
+			//if we need create new database
+				if ($this->global_settings->db_create()) {
+					//attempt to create new user and database
+						$this->write_progress("\tCreating database");
+						$db_create_username = $this->global_settings->db_create_username();
+						$db_create_password = $this->global_settings->db_create_password();
+
+						if(strlen($db_create_username) == 0){
+							$db_create_username = $this->global_settings->db_username();
+							$db_create_password = $this->global_settings->db_password();
+						}
+
+					//connect to MySQL
+						try {
+							$this->dbh = new PDO($connect_string, $db_create_username, $db_create_password, array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
+							$this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+							$this->dbh->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
+						}
+						catch (PDOException $error) {
+							throw new Exception("error connecting to database for create: " . $error->getMessage() . "\n" . $sql );
+						}
+
+					//select the mysql database
+						try {
+							$this->dbh->query("USE mysql;");
+						}
+						catch (PDOException $error) {
+							throw new Exception("error in database: " . $error->getMessage() . "\n" . $sql );
+						}
+
+					//create user if we use separeate user to access and create
+						if($this->global_settings->db_username() != $db_create_username) {
+							//create user and set the permissions
+								try {
+									$tmp_sql = "CREATE USER '".$this->global_settings->db_username()."'@'%' IDENTIFIED BY '".$this->global_settings->db_password()."'; ";
+									$this->dbh->query($tmp_sql);
+								}
+								catch (PDOException $error) {
+									// ignore error here because user may already exists
+									// (e.g. reinstall can be done via remove db)
+									// throw new Exception("error in database: " . $error->getMessage() . "\n" . $sql );
+								}
+
+							//set account to unlimited use
+								try {
+									if ($this->global_settings->db_host() == "localhost" || $this->global_settings->db_host() == "127.0.0.1") {
+										$tmp_sql = "GRANT USAGE ON * . * TO '".$this->global_settings->db_username()."'@'localhost' ";
+										$tmp_sql .= "IDENTIFIED BY '".$this->global_settings->db_password()."' ";
+										$tmp_sql .= "WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0; ";
+										$this->dbh->query($tmp_sql);
+
+										$tmp_sql = "GRANT USAGE ON * . * TO '".$this->global_settings->db_username()."'@'127.0.0.1' ";
+										$tmp_sql .= "IDENTIFIED BY '".$this->global_settings->db_password()."' ";
+										$tmp_sql .= "WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0; ";
+										$this->dbh->query($tmp_sql);
+									}
+									else {
+										$tmp_sql = "GRANT USAGE ON * . * TO '".$this->global_settings->db_username()."'@'".$this->global_settings->db_host()."' ";
+										$tmp_sql .= "IDENTIFIED BY '".$this->global_settings->db_password()."' ";
+										$tmp_sql .= "WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0; ";
+										$this->dbh->query($tmp_sql);
+									}
+								}
+								catch (PDOException $error) {
+									throw new Exception("error in database: " . $error->getMessage() . "\n" . $sql );
+								}
+						}
+
+					//create the database and set the create user with permissions
+						try {
+							$tmp_sql = "CREATE DATABASE IF NOT EXISTS ".$this->global_settings->db_name()."; ";
+							$this->dbh->query($tmp_sql);
+						}
+						catch (PDOException $error) {
+							throw new Exception("error in database: " . $error->getMessage() . "\n" . $sql );
+						}
+
+					//set user permissions
+						if($this->global_settings->db_username() != $db_create_username) {
+							try {
+								$this->dbh->query("GRANT ALL PRIVILEGES ON ".$this->global_settings->db_name().".* TO '".$this->global_settings->db_username()."'@'%'; ");
+							}
+							catch (PDOException $error) {
+								throw new Exception("error in database: " . $error->getMessage() . "\n" . $sql );
+							}
+						}
+
+					//make the changes active
+						try {
+							$tmp_sql = "FLUSH PRIVILEGES; ";
+							$this->dbh->query($tmp_sql);
+						}
+						catch (PDOException $error) {
+							throw new Exception("error in database: " . $error->getMessage() . "\n" . $sql );
+						}
+						$this->dbh = null;
+				}
+
+				$this->write_progress("\tInstalling data to database");
+
+			//connect to the database
+				try {
+					$this->dbh = new PDO($connect_string, $this->global_settings->db_username(), $this->global_settings->db_password(), array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
+					$this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+					$this->dbh->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
+				}
+				catch (PDOException $error) {
+					throw new Exception("error connecting to database: " . $error->getMessage() . "\n" . $sql );
+				}
+
+			//select the database
+				try {
+					$this->dbh->query("USE ".$this->global_settings->db_name().";");
+				}
+				catch (PDOException $error) {
+					throw new Exception("error in database: " . $error->getMessage() . "\n" . $sql );
+				}
+
+			//add the database structure
+				require_once "resources/classes/schema.php";
+				$schema = new schema;
+				$schema->db = $this->dbh;
+				$schema->db_type = $this->global_settings->db_type();
+				$schema->sql();
+				$schema->exec();
+
+			//add the defaults data into the database
+				//get the contents of the sql file
+					if (file_exists('/usr/share/examples/fusionpbx/resources/install/sql/mysql.sql')){
+						$filename = "/usr/share/examples/fusionpbx/resources/install/sql/mysql.sql";
+					}
+					else {
+						$filename = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/sql/mysql.sql';
+					}
+					$file_contents = file_get_contents($filename);
+
+				//replace \r\n with \n then explode on \n
+					$file_contents = str_replace("\r\n", "\n", $file_contents);
+
+				//loop line by line through all the lines of sql code
+					$string_array = explode("\n", $file_contents);
+					$x = 0;
+					foreach($string_array as $sql) {
+						if (strlen($sql) > 3) {
+							try {
+								if ($this->debug) {
+									$this->write_debug( $sql."\n");
+								}
+								$this->dbh->query($sql);
+							}
+							catch (PDOException $error) {
+								//echo "error on line $x: " . $error->getMessage() . " sql: $sql<br/>";
+								//die();
+							}
+						}
+						$x++;
+					}
+					unset ($file_contents, $sql);
+		}
+
+		protected function create_domain() {
+			$this->write_progress("\tChecking if domain exists '" . $this->global_settings->domain_name() . "'");
+			$sql = "select * from v_domains ";
+			$sql .= "where domain_name = '".$this->global_settings->domain_name()."' ";
+			$sql .= "limit 1";
+			$this->write_debug($sql);
+			$prep_statement = $this->dbh->prepare(check_sql($sql));
+			if($prep_statement->execute() === false){
+				throw new Exception("Failed to search for domain: " . join(":", $this->dbh->errorInfo()));
+			}
+			$result = $prep_statement->fetch(PDO::FETCH_NAMED);
+			unset($sql, $prep_statement);
+			if ($result) {
+				$this->global_settings->set_domain_uuid($result['domain_uuid']);
+				$this->write_progress("... domain exists as '" . $this->global_settings->domain_uuid() . "'");
+				if($result['domain_enabled'] != 'true'){
+					throw new Exception("Domain already exists but is disabled, this is unexpected");
+				}
+			} else {
+				$this->write_progress("\t... creating domain");
+				$sql = "insert into v_domains ";
+				$sql .= "(";
+				$sql .= "domain_uuid, ";
+				$sql .= "domain_name, ";
+				$sql .= "domain_description ";
+				$sql .= ") ";
+				$sql .= "values ";
+				$sql .= "(";
+				$sql .= "'".$this->global_settings->domain_uuid()."', ";
+				$sql .= "'".$this->global_settings->domain_name()."', ";
+				$sql .= "'Default Domain' ";
+				$sql .= ");";
+
+				$this->write_debug($sql);
+				if($this->dbh->exec(check_sql($sql)) === false){
+					throw new Exception("Failed to execute sql statement: " . join(":", $this->dbh->errorInfo()));
+				}
+				unset($sql);
+
+				//domain settings
+				$x = 0;
+				$tmp[$x]['name'] = 'uuid';
+				$tmp[$x]['value'] = $this->menu_uuid;
+				$tmp[$x]['category'] = 'domain';
+				$tmp[$x]['subcategory'] = 'menu';
+				$tmp[$x]['enabled'] = 'true';
+				$x++;
+				$tmp[$x]['name'] = 'name';
+				$tmp[$x]['category'] = 'domain';
+				$tmp[$x]['subcategory'] = 'time_zone';
+				$tmp[$x]['enabled'] = 'true';
+				$x++;
+				$tmp[$x]['name'] = 'code';
+				$tmp[$x]['value'] = 'en-us';
+				$tmp[$x]['category'] = 'domain';
+				$tmp[$x]['subcategory'] = 'language';
+				$tmp[$x]['enabled'] = 'true';
+				$x++;
+				$tmp[$x]['name'] = 'iso_code';
+				$tmp[$x]['value'] = $this->default_country;
+				$tmp[$x]['category'] = 'domain';
+				$tmp[$x]['subcategory'] = 'country';
+				$tmp[$x]['enabled'] = 'true';
+				$x++;
+				$tmp[$x]['name'] = 'name';
+				$tmp[$x]['value'] = $this->template_name;
+				$tmp[$x]['category'] = 'domain';
+				$tmp[$x]['subcategory'] = 'template';
+				$tmp[$x]['enabled'] = 'true';
+				$x++;
+
+				//server settings
+				$tmp[$x]['name'] = 'dir';
+				$tmp[$x]['value'] = $this->global_settings->switch_temp_dir();
+				$tmp[$x]['category'] = 'server';
+				$tmp[$x]['subcategory'] = 'temp';
+				$tmp[$x]['enabled'] = 'true';
+				$x++;
+				$x++;
+				$tmp[$x]['name'] = 'dir';
+				$tmp[$x]['value'] = $this->global_settings->switch_backup_vdir();
+				$tmp[$x]['category'] = 'server';
+				$tmp[$x]['subcategory'] = 'backup';
+				$tmp[$x]['enabled'] = 'true';
+				$x++;
+
+				$this->dbh->beginTransaction();
+				foreach($tmp as $row) {
+					$sql = "insert into v_default_settings ";
+					$sql .= "(";
+					$sql .= "default_setting_uuid, ";
+					$sql .= "default_setting_name, ";
+					$sql .= "default_setting_value, ";
+					$sql .= "default_setting_category, ";
+					$sql .= "default_setting_subcategory, ";
+					$sql .= "default_setting_enabled ";
+					$sql .= ") ";
+					$sql .= "values ";
+					$sql .= "(";
+					$sql .= "'".uuid()."', ";
+					$sql .= "'".$row['name']."', ";
+					$sql .= "'".$row['value']."', ";
+					$sql .= "'".$row['category']."', ";
+					$sql .= "'".$row['subcategory']."', ";
+					$sql .= "'".$row['enabled']."' ";
+					$sql .= ");";
+					$this->write_debug($sql);
+					$this->dbh->exec(check_sql($sql));
+					unset($sql);
+				}
+				$this->dbh->commit();
+				unset($tmp);
+
+			//get the list of installed apps from the core and mod directories
+				$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php");
+				$x=0;
+				foreach ($config_list as $config_path) {
+					include($config_path);
+					$x++;
+				}
+			}
+		}
+
+		protected function create_superuser() {
+			$this->write_progress("\tChecking if superuser exists '" . $this->admin_username . "'");
+			$sql = "select * from v_users ";
+			$sql .= "where domain_uuid = '".$this->global_settings->domain_uuid()."' ";
+			$sql .= "and username = '".$this->admin_username."' ";
+			$sql .= "limit 1 ";
+			$this->write_debug($sql);
+			$prep_statement = $this->dbh->prepare(check_sql($sql));
+			$prep_statement->execute();
+			$result = $prep_statement->fetch(PDO::FETCH_NAMED);
+			unset($sql, $prep_statement);
+			$salt = generate_password('20', '4');
+			if ($result) {
+				$this->admin_uuid = $result['user_uuid'];
+				$this->write_progress("... superuser exists as '" . $this->admin_uuid . "', updating password");
+				$sql = "update v_users ";
+				$sql .= "set password = '".md5($salt.$this->admin_password)."' ";
+				$sql .= "set salt = '$salt' ";
+				$sql .= "where USER_uuid = '".$this->admin_uuid."' ";
+				$this->write_debug($sql);
+				$this->dbh->exec(check_sql($sql));
+			} else {
+				//message
+					$this->write_progress("\t... creating super user");
+				//add a user and then add the user to the superadmin group
+				//prepare the values
+					$this->admin_uuid = uuid();
+					$contact_uuid = uuid();
+				//set a sessiong variable
+					$_SESSION["user_uuid"] = $user_uuid;
+				//salt used with the password to create a one way hash
+				//add the user account
+					$sql = "insert into v_users ";
+					$sql .= "(";
+					$sql .= "domain_uuid, ";
+					$sql .= "user_uuid, ";
+					$sql .= "contact_uuid, ";
+					$sql .= "username, ";
+					$sql .= "password, ";
+					$sql .= "salt, ";
+					$sql .= "add_date, ";
+					$sql .= "add_user, ";
+					$sql .= "user_enabled ";
+					$sql .= ") ";
+					$sql .= "values ";
+					$sql .= "(";
+					$sql .= "'".$this->global_settings->domain_uuid()."', ";
+					$sql .= "'".$this->admin_uuid."', ";
+					$sql .= "'$contact_uuid', ";
+					$sql .= "'".$this->admin_username."', ";
+					$sql .= "'".md5($salt.$this->admin_password)."', ";
+					$sql .= "'$salt', ";
+					$sql .= "now(), ";
+					$sql .= "'".$this->admin_username."', ";
+					$sql .= "'true' ";
+					$sql .= ");";
+					$this->write_debug( $sql."\n");
+					$this->dbh->exec(check_sql($sql));
+					unset($sql);
+			}
+			$this->write_progress("\tChecking if superuser contact exists");
+			$sql = "select count(*) from v_contacts ";
+			$sql .= "where domain_uuid = '".$this->global_settings->domain_uuid()."' ";
+			$sql .= "and contact_name_given = '".$this->admin_username."' ";
+			$sql .= "and contact_nickname = '".$this->admin_username."' ";
+			$sql .= "limit 1 ";
+			$this->write_debug($sql);
+			$prep_statement = $this->dbh->prepare(check_sql($sql));
+			$prep_statement->execute();
+			$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
+			if ($row['count'] == 0) {
+				$sql = "insert into v_contacts ";
+				$sql .= "(";
+				$sql .= "domain_uuid, ";
+				$sql .= "contact_uuid, ";
+				$sql .= "contact_type, ";
+				$sql .= "contact_name_given, ";
+				$sql .= "contact_nickname ";
+				$sql .= ") ";
+				$sql .= "values ";
+				$sql .= "(";
+				$sql .= "'".$this->global_settings->domain_uuid()."', ";
+				$sql .= "'$contact_uuid', ";
+				$sql .= "'user', ";
+				$sql .= "'".$this->admin_username."', ";
+				$sql .= "'".$this->admin_username."' ";
+				$sql .= ")";
+				$this->dbh->exec(check_sql($sql));
+				unset($sql);
+			}
+			$this->write_progress("\tChecking if superuser is in the correct group");
+			$sql = "select count(*) from v_group_users ";
+			$sql .= "where domain_uuid = '".$this->global_settings->domain_uuid()."' ";
+			$sql .= "and user_uuid = '".$this->admin_uuid."' ";
+			$sql .= "and group_name = 'superadmin' ";
+			$sql .= "limit 1 ";
+			$this->write_debug($sql);
+			$prep_statement = $this->dbh->prepare(check_sql($sql));
+			$prep_statement->execute();
+			$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
+			if ($row['count'] == 0) {
+				//add the user to the superadmin group
+				$sql = "insert into v_group_users ";
+				$sql .= "(";
+				$sql .= "group_user_uuid, ";
+				$sql .= "domain_uuid, ";
+				$sql .= "user_uuid, ";
+				$sql .= "group_name ";
+				$sql .= ") ";
+				$sql .= "values ";
+				$sql .= "(";
+				$sql .= "'".uuid()."', ";
+				$sql .= "'".$this->global_settings->domain_uuid()."', ";
+				$sql .= "'".$this->admin_uuid."', ";
+				$sql .= "'superadmin' ";
+				$sql .= ");";
+				$this->write_debug( $sql."\n");
+				$this->dbh->exec(check_sql($sql));
+				unset($sql);
+			}
+		}
+
+		protected function app_defaults() {
+
+			//write a progress message
+				$this->write_progress("\tRunning app_defaults");
+
+			//set needed session settings
+				$_SESSION["username"] = $this->admin_username;
+				$_SESSION["domain_uuid"] = $this->global_settings->domain_uuid();
+				require $this->config_php;
+				require "resources/require.php";
+				$_SESSION['event_socket_ip_address'] = $this->global_settings->event_host;
+				$_SESSION['event_socket_port'] = $this->global_settings->event_port;
+				$_SESSION['event_socket_password'] = $this->global_settings->event_password;
+
+			//get the groups assigned to the user and then set the groups in $_SESSION["groups"]
+				$sql = "SELECT * FROM v_group_users ";
+				$sql .= "where domain_uuid=:domain_uuid ";
+				$sql .= "and user_uuid=:user_uuid ";
+				$prep_statement = $this->dbh->prepare(check_sql($sql));
+				$prep_statement->bindParam(':domain_uuid', $this->global_settings->domain_uuid);
+				$prep_statement->bindParam(':user_uuid', $this->admin_uuid);
+				$prep_statement->execute();
+				$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+				$_SESSION["groups"] = $result;
+				unset($sql, $row_count, $prep_statement);
+
+			//get the permissions assigned to the groups that the user is a member of set the permissions in $_SESSION['permissions']
+				$x = 0;
+				$sql = "select distinct(permission_name) from v_group_permissions ";
+				foreach($_SESSION["groups"] as $field) {
+					if (strlen($field['group_name']) > 0) {
+						if ($x == 0) {
+							$sql .= "where (domain_uuid = '".$this->global_settings->domain_uuid."' and group_name = '".$field['group_name']."') ";
+						}
+						else {
+							$sql .= "or (domain_uuid = '".$this->global_settings->domain_uuid."' and group_name = '".$field['group_name']."') ";
+						}
+						$x++;
+					}
+				}
+				$prep_statement_sub = $this->dbh->prepare($sql);
+				$prep_statement_sub->execute();
+				$_SESSION['permissions'] = $prep_statement_sub->fetchAll(PDO::FETCH_NAMED);
+				unset($sql, $prep_statement_sub);
+
+			//include the config.php
+				$db_type = $this->global_settings->db_type();
+				$db_path = $this->global_settings->db_path();
+				$db_host = $this->global_settings->db_host();
+				$db_port = $this->global_settings->db_port();
+				$db_name = $this->global_settings->db_name();
+				$db_username = $this->global_settings->db_username();
+				$db_password = $this->global_settings->db_password();
+
+			//add the database structure
+				require_once "resources/classes/schema.php";
+				$schema = new schema;
+				echo $schema->schema();
+
+			//run all app_defaults.php files
+				$default_language = $this->install_language;
+				$domain = new domains;
+				$domain->upgrade();
+
+			//get the switch default settings
+				$sql = "select * from v_default_settings ";
+				$sql .= "where default_setting_category = 'switch' ";
+				$sql .= "and default_setting_enabled = 'true' ";
+				$prep_statement = $this->dbh->prepare($sql);
+				$prep_statement->execute();
+				$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+				foreach($default_settings as $row) {
+					$name = $row['default_setting_name'];
+					$category = $row['default_setting_category'];
+					$subcategory = $row['default_setting_subcategory'];
+					if ($category == "switch") {
+						$_SESSION[$category][$subcategory]['uuid'] = $row['default_setting_uuid'];
+						$_SESSION[$category][$subcategory][$name] = $row['default_setting_value'];
+					}
+				}
+				unset ($prep_statement, $sql);
+
+			//update config.lua
+				$obj = new scripts;
+				$obj->copy_files();
+				$obj->write_config();
+
+			//synchronize the config with the saved settings
+				save_switch_xml();
+
+			//do not show the apply settings reminder on the login page
+				$_SESSION["reload_xml"] = false;
+
+			//clear the menu
+				$_SESSION["menu"] = "";
+
+		}
+
+		public function remove_config() {
+			if (file_exists('/bin/rm')) {
+				$this->write_debug('rm -f ' . $this->config_php);
+				exec ('rm -f ' . $this->config_php);
+			}
+			elseif(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'){
+				$this->write_debug("del /S /F /Q '$dir'");
+				exec("del /F /Q '" . $this->config_php . "'");
+			}
+			else {
+				$this->write_debug("delete file: ".$file);
+				unlink($this->config_php);
+			}
+			clearstatcache();
+		}
+	}
+
 ?>

+ 145 - 145
core/install/resources/classes/install_switch.php

@@ -1,146 +1,146 @@
-<?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]>
-	Copyright (C) 2010-2015
-	All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-
-//define the install class
-	class install_switch {
-
-		protected $global_settings;
-		protected $dbh;
-
-		public $debug = false;
-		public $echo_progress = false;
-
-		function __construct($global_settings) {
-			if(is_null($global_settings)){
-				require_once "core/install/resources/classes/global_settings.php";
-				$global_settings = new global_settings();
-			}elseif(!is_a($global_settings, 'global_settings')){
-				throw new Exception('The parameter $global_settings must be a global_settings object (or a subclass of)');
-			}
-			$this->global_settings = $global_settings;
-		}
-
-		//utility Functions
-		function write_debug($message) {
-			if($this->debug){
-				echo "$message\n";
-			}
-		}
-
-		function write_progress($message) {
-			if($this->echo_progress){
-				echo "$message\n";
-			}
-		}
-
-		protected function backup_dir($dir, $backup_name){
-			if (!is_readable($dir)) {
-				throw new Exception("backup_dir() source directory '".$dir."' does not exist.");
-			}
-			$dst_tar = join( DIRECTORY_SEPARATOR, array(sys_get_temp_dir(), "$backup_name.tar"));
-			//pharData is the correct way to do it, but it keeps creating incomplete archives
-			//$tar = new PharData($dst_tar);
-			//$tar->buildFromDirectory($dir);
-			$this->write_debug("backing up to $dst_tar");
-			if (file_exists('/bin/tar')) {
-				exec('tar -cvf ' .$dst_tar. ' -C '.$dir .' .');
-			}else{
-				$this->write_debug('WARN: old config could not be compressed');
-				$dst_dir = join( DIRECTORY_SEPARATOR, array(sys_get_temp_dir(), "$backup_name"));
-				recursive_copy($dir, $dst_dir);
-			}
-		}
-
-		function install_phase_1() {
-			$this->write_progress("Install phase 1 started for switch");
-			$this->copy_conf();
-			$this->write_progress("Install phase 1 completed for switch");
-		}
-
-		function install_phase_2() {
-			$this->write_progress("Install phase 2 started for switch");
-			$this->restart_switch();
-			$this->write_progress("Install phase 2 completed for switch");
-		}
-
-		protected function copy_conf() {
-			//send a message
-				$this->write_progress("\tCopying Config");
-
-			//make a backup of the config
-				if (file_exists($this->global_settings->switch_conf_dir())) {
-					$this->backup_dir($this->global_settings->switch_conf_dir(), 'fusionpbx_switch_config');
-					recursive_delete($this->global_settings->switch_conf_dir());
-				}
-
-			//make sure the conf directory exists
-				if (!is_dir($this->global_settings->switch_conf_dir())) {
-					if (!mkdir($this->global_settings->switch_conf_dir(), 0774, true)) {
-						throw new Exception("Failed to create the switch conf directory '".$this->global_settings->switch_conf_dir()."'. ");
-					}
-				}
-
-			//copy resources/templates/conf to the freeswitch conf dir
-				if (file_exists('/usr/share/examples/fusionpbx/resources/templates/conf')){
-					$src_dir = "/usr/share/examples/fusionpbx/resources/templates/conf";
-				}
-				else {
-					$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf";
-				}
-				$dst_dir = $this->global_settings->switch_conf_dir();
-				if (is_readable($dst_dir)) {
-					recursive_copy($src_dir, $dst_dir);
-					unset($src_dir, $dst_dir);
-				}
-				$fax_dir = join( DIRECTORY_SEPARATOR, array($this->global_settings->switch_storage_dir(), 'fax'));
-				if (!is_readable($fax_dir)) { mkdir($fax_dir,0777,true); }
-				$voicemail_dir = join( DIRECTORY_SEPARATOR, array($this->global_settings->switch_storage_dir(), 'voicemail'));
-				if (!is_readable($voicemail_dir)) { mkdir($voicemail_dir,0777,true); }
-
-			//write the xml_cdr.conf.xml file
-				if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/xml_cdr")) {
-					xml_cdr_conf_xml();
-				}
-
-			//write the switch.conf.xml file
-				if (file_exists($this->global_settings->switch_conf_dir())) {
-					switch_conf_xml();
-				}
-		}
-
-		protected function restart_switch() {
-			$esl = new event_socket;
-			if(!$esl->connect($this->global_settings->switch_event_host(), $this->global_settings->switch_event_port(), $this->global_settings->switch_event_password())) {
-				throw new Exception("Failed to connect to switch");
-			}
-			if (!$esl->request('api fsctl shutdown restart elegant')){
-				throw new Exception("Failed to send switch restart");
-			}
-			$esl->reset_fp();
-		}
-	}
+<?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]>
+	Copyright (C) 2010-2015
+	All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
+include "root.php";
+
+//define the install class
+	class install_switch {
+
+		protected $global_settings;
+		protected $dbh;
+
+		public $debug = false;
+		public $echo_progress = false;
+
+		function __construct($global_settings) {
+			if(is_null($global_settings)){
+				require_once "core/install/resources/classes/global_settings.php";
+				$global_settings = new global_settings();
+			}elseif(!is_a($global_settings, 'global_settings')){
+				throw new Exception('The parameter $global_settings must be a global_settings object (or a subclass of)');
+			}
+			$this->global_settings = $global_settings;
+		}
+
+		//utility Functions
+		function write_debug($message) {
+			if($this->debug){
+				echo "$message\n";
+			}
+		}
+
+		function write_progress($message) {
+			if($this->echo_progress){
+				echo "$message\n";
+			}
+		}
+
+		protected function backup_dir($dir, $backup_name){
+			if (!is_readable($dir)) {
+				throw new Exception("backup_dir() source directory '".$dir."' does not exist.");
+			}
+			$dst_tar = join( DIRECTORY_SEPARATOR, array(sys_get_temp_dir(), "$backup_name.tar"));
+			//pharData is the correct way to do it, but it keeps creating incomplete archives
+			//$tar = new PharData($dst_tar);
+			//$tar->buildFromDirectory($dir);
+			$this->write_debug("backing up to $dst_tar");
+			if (file_exists('/bin/tar')) {
+				exec('tar -cvf ' .$dst_tar. ' -C '.$dir .' .');
+			}else{
+				$this->write_debug('WARN: old config could not be compressed');
+				$dst_dir = join( DIRECTORY_SEPARATOR, array(sys_get_temp_dir(), "$backup_name"));
+				recursive_copy($dir, $dst_dir);
+			}
+		}
+
+		function install_phase_1() {
+			$this->write_progress("Install phase 1 started for switch");
+			$this->copy_conf();
+			$this->write_progress("Install phase 1 completed for switch");
+		}
+
+		function install_phase_2() {
+			$this->write_progress("Install phase 2 started for switch");
+			$this->restart_switch();
+			$this->write_progress("Install phase 2 completed for switch");
+		}
+
+		protected function copy_conf() {
+			//send a message
+				$this->write_progress("\tCopying Config");
+
+			//make a backup of the config
+				if (file_exists($this->global_settings->switch_conf_dir())) {
+					$this->backup_dir($this->global_settings->switch_conf_dir(), 'fusionpbx_switch_config');
+					recursive_delete($this->global_settings->switch_conf_dir());
+				}
+
+			//make sure the conf directory exists
+				if (!is_dir($this->global_settings->switch_conf_dir())) {
+					if (!mkdir($this->global_settings->switch_conf_dir(), 0774, true)) {
+						throw new Exception("Failed to create the switch conf directory '".$this->global_settings->switch_conf_dir()."'. ");
+					}
+				}
+
+			//copy resources/templates/conf to the freeswitch conf dir
+				if (file_exists('/usr/share/examples/fusionpbx/resources/templates/conf')){
+					$src_dir = "/usr/share/examples/fusionpbx/resources/templates/conf";
+				}
+				else {
+					$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf";
+				}
+				$dst_dir = $this->global_settings->switch_conf_dir();
+				if (is_readable($dst_dir)) {
+					recursive_copy($src_dir, $dst_dir);
+					unset($src_dir, $dst_dir);
+				}
+				$fax_dir = join( DIRECTORY_SEPARATOR, array($this->global_settings->switch_storage_dir(), 'fax'));
+				if (!is_readable($fax_dir)) { mkdir($fax_dir,0777,true); }
+				$voicemail_dir = join( DIRECTORY_SEPARATOR, array($this->global_settings->switch_storage_dir(), 'voicemail'));
+				if (!is_readable($voicemail_dir)) { mkdir($voicemail_dir,0777,true); }
+
+			//write the xml_cdr.conf.xml file
+				if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/xml_cdr")) {
+					xml_cdr_conf_xml();
+				}
+
+			//write the switch.conf.xml file
+				if (file_exists($this->global_settings->switch_conf_dir())) {
+					switch_conf_xml();
+				}
+		}
+
+		protected function restart_switch() {
+			$esl = new event_socket;
+			if(!$esl->connect($this->global_settings->switch_event_host(), $this->global_settings->switch_event_port(), $this->global_settings->switch_event_password())) {
+				throw new Exception("Failed to connect to switch");
+			}
+			if (!$esl->request('api fsctl shutdown restart elegant')){
+				throw new Exception("Failed to send switch restart");
+			}
+			$esl->reset_fp();
+		}
+	}
 ?>

+ 251 - 251
core/install/resources/classes/iso_countries.php

@@ -1,252 +1,252 @@
-<?php
-
-$iso_countries = array
-(
-	'AF' => 'Afghanistan',
-	'AX' => 'Aland Islands',
-	'AL' => 'Albania',
-	'DZ' => 'Algeria',
-	'AS' => 'American Samoa',
-	'AD' => 'Andorra',
-	'AO' => 'Angola',
-	'AI' => 'Anguilla',
-	'AQ' => 'Antarctica',
-	'AG' => 'Antigua And Barbuda',
-	'AR' => 'Argentina',
-	'AM' => 'Armenia',
-	'AW' => 'Aruba',
-	'AU' => 'Australia',
-	'AT' => 'Austria',
-	'AZ' => 'Azerbaijan',
-	'BS' => 'Bahamas',
-	'BH' => 'Bahrain',
-	'BD' => 'Bangladesh',
-	'BB' => 'Barbados',
-	'BY' => 'Belarus',
-	'BE' => 'Belgium',
-	'BZ' => 'Belize',
-	'BJ' => 'Benin',
-	'BM' => 'Bermuda',
-	'BT' => 'Bhutan',
-	'BO' => 'Bolivia',
-	'BA' => 'Bosnia And Herzegovina',
-	'BW' => 'Botswana',
-	'BV' => 'Bouvet Island',
-	'BR' => 'Brazil',
-	'IO' => 'British Indian Ocean Territory',
-	'BN' => 'Brunei Darussalam',
-	'BG' => 'Bulgaria',
-	'BF' => 'Burkina Faso',
-	'BI' => 'Burundi',
-	'KH' => 'Cambodia',
-	'CM' => 'Cameroon',
-	'CA' => 'Canada',
-	'CV' => 'Cape Verde',
-	'KY' => 'Cayman Islands',
-	'CF' => 'Central African Republic',
-	'TD' => 'Chad',
-	'CL' => 'Chile',
-	'CN' => 'China',
-	'CX' => 'Christmas Island',
-	'CC' => 'Cocos (Keeling) Islands',
-	'CO' => 'Colombia',
-	'KM' => 'Comoros',
-	'CG' => 'Congo',
-	'CD' => 'Congo, Democratic Republic',
-	'CK' => 'Cook Islands',
-	'CR' => 'Costa Rica',
-	'CI' => 'Cote D\'Ivoire',
-	'HR' => 'Croatia',
-	'CU' => 'Cuba',
-	'CY' => 'Cyprus',
-	'CZ' => 'Czech Republic',
-	'DK' => 'Denmark',
-	'DJ' => 'Djibouti',
-	'DM' => 'Dominica',
-	'DO' => 'Dominican Republic',
-	'EC' => 'Ecuador',
-	'EG' => 'Egypt',
-	'SV' => 'El Salvador',
-	'GQ' => 'Equatorial Guinea',
-	'ER' => 'Eritrea',
-	'EE' => 'Estonia',
-	'ET' => 'Ethiopia',
-	'FK' => 'Falkland Islands (Malvinas)',
-	'FO' => 'Faroe Islands',
-	'FJ' => 'Fiji',
-	'FI' => 'Finland',
-	'FR' => 'France',
-	'GF' => 'French Guiana',
-	'PF' => 'French Polynesia',
-	'TF' => 'French Southern Territories',
-	'GA' => 'Gabon',
-	'GM' => 'Gambia',
-	'GE' => 'Georgia',
-	'DE' => 'Germany',
-	'GH' => 'Ghana',
-	'GI' => 'Gibraltar',
-	'GR' => 'Greece',
-	'GL' => 'Greenland',
-	'GD' => 'Grenada',
-	'GP' => 'Guadeloupe',
-	'GU' => 'Guam',
-	'GT' => 'Guatemala',
-	'GG' => 'Guernsey',
-	'GN' => 'Guinea',
-	'GW' => 'Guinea-Bissau',
-	'GY' => 'Guyana',
-	'HT' => 'Haiti',
-	'HM' => 'Heard Island & Mcdonald Islands',
-	'VA' => 'Holy See (Vatican City State)',
-	'HN' => 'Honduras',
-	'HK' => 'Hong Kong',
-	'HU' => 'Hungary',
-	'IS' => 'Iceland',
-	'IN' => 'India',
-	'ID' => 'Indonesia',
-	'IR' => 'Iran, Islamic Republic Of',
-	'IQ' => 'Iraq',
-	'IE' => 'Ireland',
-	'IM' => 'Isle Of Man',
-	'IL' => 'Israel',
-	'IT' => 'Italy',
-	'JM' => 'Jamaica',
-	'JP' => 'Japan',
-	'JE' => 'Jersey',
-	'JO' => 'Jordan',
-	'KZ' => 'Kazakhstan',
-	'KE' => 'Kenya',
-	'KI' => 'Kiribati',
-	'KR' => 'Korea',
-	'KW' => 'Kuwait',
-	'KG' => 'Kyrgyzstan',
-	'LA' => 'Lao People\'s Democratic Republic',
-	'LV' => 'Latvia',
-	'LB' => 'Lebanon',
-	'LS' => 'Lesotho',
-	'LR' => 'Liberia',
-	'LY' => 'Libyan Arab Jamahiriya',
-	'LI' => 'Liechtenstein',
-	'LT' => 'Lithuania',
-	'LU' => 'Luxembourg',
-	'MO' => 'Macao',
-	'MK' => 'Macedonia',
-	'MG' => 'Madagascar',
-	'MW' => 'Malawi',
-	'MY' => 'Malaysia',
-	'MV' => 'Maldives',
-	'ML' => 'Mali',
-	'MT' => 'Malta',
-	'MH' => 'Marshall Islands',
-	'MQ' => 'Martinique',
-	'MR' => 'Mauritania',
-	'MU' => 'Mauritius',
-	'YT' => 'Mayotte',
-	'MX' => 'Mexico',
-	'FM' => 'Micronesia, Federated States Of',
-	'MD' => 'Moldova',
-	'MC' => 'Monaco',
-	'MN' => 'Mongolia',
-	'ME' => 'Montenegro',
-	'MS' => 'Montserrat',
-	'MA' => 'Morocco',
-	'MZ' => 'Mozambique',
-	'MM' => 'Myanmar',
-	'NA' => 'Namibia',
-	'NR' => 'Nauru',
-	'NP' => 'Nepal',
-	'NL' => 'Netherlands',
-	'AN' => 'Netherlands Antilles',
-	'NC' => 'New Caledonia',
-	'NZ' => 'New Zealand',
-	'NI' => 'Nicaragua',
-	'NE' => 'Niger',
-	'NG' => 'Nigeria',
-	'NU' => 'Niue',
-	'NF' => 'Norfolk Island',
-	'MP' => 'Northern Mariana Islands',
-	'NO' => 'Norway',
-	'OM' => 'Oman',
-	'PK' => 'Pakistan',
-	'PW' => 'Palau',
-	'PS' => 'Palestinian Territory, Occupied',
-	'PA' => 'Panama',
-	'PG' => 'Papua New Guinea',
-	'PY' => 'Paraguay',
-	'PE' => 'Peru',
-	'PH' => 'Philippines',
-	'PN' => 'Pitcairn',
-	'PL' => 'Poland',
-	'PT' => 'Portugal',
-	'PR' => 'Puerto Rico',
-	'QA' => 'Qatar',
-	'RE' => 'Reunion',
-	'RO' => 'Romania',
-	'RU' => 'Russian Federation',
-	'RW' => 'Rwanda',
-	'BL' => 'Saint Barthelemy',
-	'SH' => 'Saint Helena',
-	'KN' => 'Saint Kitts And Nevis',
-	'LC' => 'Saint Lucia',
-	'MF' => 'Saint Martin',
-	'PM' => 'Saint Pierre And Miquelon',
-	'VC' => 'Saint Vincent And Grenadines',
-	'WS' => 'Samoa',
-	'SM' => 'San Marino',
-	'ST' => 'Sao Tome And Principe',
-	'SA' => 'Saudi Arabia',
-	'SN' => 'Senegal',
-	'RS' => 'Serbia',
-	'SC' => 'Seychelles',
-	'SL' => 'Sierra Leone',
-	'SG' => 'Singapore',
-	'SK' => 'Slovakia',
-	'SI' => 'Slovenia',
-	'SB' => 'Solomon Islands',
-	'SO' => 'Somalia',
-	'ZA' => 'South Africa',
-	'GS' => 'South Georgia And Sandwich Isl.',
-	'ES' => 'Spain',
-	'LK' => 'Sri Lanka',
-	'SD' => 'Sudan',
-	'SR' => 'Suriname',
-	'SJ' => 'Svalbard And Jan Mayen',
-	'SZ' => 'Swaziland',
-	'SE' => 'Sweden',
-	'CH' => 'Switzerland',
-	'SY' => 'Syrian Arab Republic',
-	'TW' => 'Taiwan',
-	'TJ' => 'Tajikistan',
-	'TZ' => 'Tanzania',
-	'TH' => 'Thailand',
-	'TL' => 'Timor-Leste',
-	'TG' => 'Togo',
-	'TK' => 'Tokelau',
-	'TO' => 'Tonga',
-	'TT' => 'Trinidad And Tobago',
-	'TN' => 'Tunisia',
-	'TR' => 'Turkey',
-	'TM' => 'Turkmenistan',
-	'TC' => 'Turks And Caicos Islands',
-	'TV' => 'Tuvalu',
-	'UG' => 'Uganda',
-	'UA' => 'Ukraine',
-	'AE' => 'United Arab Emirates',
-	'GB' => 'United Kingdom',
-	'US' => 'United States',
-	'UM' => 'United States Outlying Islands',
-	'UY' => 'Uruguay',
-	'UZ' => 'Uzbekistan',
-	'VU' => 'Vanuatu',
-	'VE' => 'Venezuela',
-	'VN' => 'Viet Nam',
-	'VG' => 'Virgin Islands, British',
-	'VI' => 'Virgin Islands, U.S.',
-	'WF' => 'Wallis And Futuna',
-	'EH' => 'Western Sahara',
-	'YE' => 'Yemen',
-	'ZM' => 'Zambia',
-	'ZW' => 'Zimbabwe',
-);
-
+<?php
+
+$iso_countries = array
+(
+	'AF' => 'Afghanistan',
+	'AX' => 'Aland Islands',
+	'AL' => 'Albania',
+	'DZ' => 'Algeria',
+	'AS' => 'American Samoa',
+	'AD' => 'Andorra',
+	'AO' => 'Angola',
+	'AI' => 'Anguilla',
+	'AQ' => 'Antarctica',
+	'AG' => 'Antigua And Barbuda',
+	'AR' => 'Argentina',
+	'AM' => 'Armenia',
+	'AW' => 'Aruba',
+	'AU' => 'Australia',
+	'AT' => 'Austria',
+	'AZ' => 'Azerbaijan',
+	'BS' => 'Bahamas',
+	'BH' => 'Bahrain',
+	'BD' => 'Bangladesh',
+	'BB' => 'Barbados',
+	'BY' => 'Belarus',
+	'BE' => 'Belgium',
+	'BZ' => 'Belize',
+	'BJ' => 'Benin',
+	'BM' => 'Bermuda',
+	'BT' => 'Bhutan',
+	'BO' => 'Bolivia',
+	'BA' => 'Bosnia And Herzegovina',
+	'BW' => 'Botswana',
+	'BV' => 'Bouvet Island',
+	'BR' => 'Brazil',
+	'IO' => 'British Indian Ocean Territory',
+	'BN' => 'Brunei Darussalam',
+	'BG' => 'Bulgaria',
+	'BF' => 'Burkina Faso',
+	'BI' => 'Burundi',
+	'KH' => 'Cambodia',
+	'CM' => 'Cameroon',
+	'CA' => 'Canada',
+	'CV' => 'Cape Verde',
+	'KY' => 'Cayman Islands',
+	'CF' => 'Central African Republic',
+	'TD' => 'Chad',
+	'CL' => 'Chile',
+	'CN' => 'China',
+	'CX' => 'Christmas Island',
+	'CC' => 'Cocos (Keeling) Islands',
+	'CO' => 'Colombia',
+	'KM' => 'Comoros',
+	'CG' => 'Congo',
+	'CD' => 'Congo, Democratic Republic',
+	'CK' => 'Cook Islands',
+	'CR' => 'Costa Rica',
+	'CI' => 'Cote D\'Ivoire',
+	'HR' => 'Croatia',
+	'CU' => 'Cuba',
+	'CY' => 'Cyprus',
+	'CZ' => 'Czech Republic',
+	'DK' => 'Denmark',
+	'DJ' => 'Djibouti',
+	'DM' => 'Dominica',
+	'DO' => 'Dominican Republic',
+	'EC' => 'Ecuador',
+	'EG' => 'Egypt',
+	'SV' => 'El Salvador',
+	'GQ' => 'Equatorial Guinea',
+	'ER' => 'Eritrea',
+	'EE' => 'Estonia',
+	'ET' => 'Ethiopia',
+	'FK' => 'Falkland Islands (Malvinas)',
+	'FO' => 'Faroe Islands',
+	'FJ' => 'Fiji',
+	'FI' => 'Finland',
+	'FR' => 'France',
+	'GF' => 'French Guiana',
+	'PF' => 'French Polynesia',
+	'TF' => 'French Southern Territories',
+	'GA' => 'Gabon',
+	'GM' => 'Gambia',
+	'GE' => 'Georgia',
+	'DE' => 'Germany',
+	'GH' => 'Ghana',
+	'GI' => 'Gibraltar',
+	'GR' => 'Greece',
+	'GL' => 'Greenland',
+	'GD' => 'Grenada',
+	'GP' => 'Guadeloupe',
+	'GU' => 'Guam',
+	'GT' => 'Guatemala',
+	'GG' => 'Guernsey',
+	'GN' => 'Guinea',
+	'GW' => 'Guinea-Bissau',
+	'GY' => 'Guyana',
+	'HT' => 'Haiti',
+	'HM' => 'Heard Island & Mcdonald Islands',
+	'VA' => 'Holy See (Vatican City State)',
+	'HN' => 'Honduras',
+	'HK' => 'Hong Kong',
+	'HU' => 'Hungary',
+	'IS' => 'Iceland',
+	'IN' => 'India',
+	'ID' => 'Indonesia',
+	'IR' => 'Iran, Islamic Republic Of',
+	'IQ' => 'Iraq',
+	'IE' => 'Ireland',
+	'IM' => 'Isle Of Man',
+	'IL' => 'Israel',
+	'IT' => 'Italy',
+	'JM' => 'Jamaica',
+	'JP' => 'Japan',
+	'JE' => 'Jersey',
+	'JO' => 'Jordan',
+	'KZ' => 'Kazakhstan',
+	'KE' => 'Kenya',
+	'KI' => 'Kiribati',
+	'KR' => 'Korea',
+	'KW' => 'Kuwait',
+	'KG' => 'Kyrgyzstan',
+	'LA' => 'Lao People\'s Democratic Republic',
+	'LV' => 'Latvia',
+	'LB' => 'Lebanon',
+	'LS' => 'Lesotho',
+	'LR' => 'Liberia',
+	'LY' => 'Libyan Arab Jamahiriya',
+	'LI' => 'Liechtenstein',
+	'LT' => 'Lithuania',
+	'LU' => 'Luxembourg',
+	'MO' => 'Macao',
+	'MK' => 'Macedonia',
+	'MG' => 'Madagascar',
+	'MW' => 'Malawi',
+	'MY' => 'Malaysia',
+	'MV' => 'Maldives',
+	'ML' => 'Mali',
+	'MT' => 'Malta',
+	'MH' => 'Marshall Islands',
+	'MQ' => 'Martinique',
+	'MR' => 'Mauritania',
+	'MU' => 'Mauritius',
+	'YT' => 'Mayotte',
+	'MX' => 'Mexico',
+	'FM' => 'Micronesia, Federated States Of',
+	'MD' => 'Moldova',
+	'MC' => 'Monaco',
+	'MN' => 'Mongolia',
+	'ME' => 'Montenegro',
+	'MS' => 'Montserrat',
+	'MA' => 'Morocco',
+	'MZ' => 'Mozambique',
+	'MM' => 'Myanmar',
+	'NA' => 'Namibia',
+	'NR' => 'Nauru',
+	'NP' => 'Nepal',
+	'NL' => 'Netherlands',
+	'AN' => 'Netherlands Antilles',
+	'NC' => 'New Caledonia',
+	'NZ' => 'New Zealand',
+	'NI' => 'Nicaragua',
+	'NE' => 'Niger',
+	'NG' => 'Nigeria',
+	'NU' => 'Niue',
+	'NF' => 'Norfolk Island',
+	'MP' => 'Northern Mariana Islands',
+	'NO' => 'Norway',
+	'OM' => 'Oman',
+	'PK' => 'Pakistan',
+	'PW' => 'Palau',
+	'PS' => 'Palestinian Territory, Occupied',
+	'PA' => 'Panama',
+	'PG' => 'Papua New Guinea',
+	'PY' => 'Paraguay',
+	'PE' => 'Peru',
+	'PH' => 'Philippines',
+	'PN' => 'Pitcairn',
+	'PL' => 'Poland',
+	'PT' => 'Portugal',
+	'PR' => 'Puerto Rico',
+	'QA' => 'Qatar',
+	'RE' => 'Reunion',
+	'RO' => 'Romania',
+	'RU' => 'Russian Federation',
+	'RW' => 'Rwanda',
+	'BL' => 'Saint Barthelemy',
+	'SH' => 'Saint Helena',
+	'KN' => 'Saint Kitts And Nevis',
+	'LC' => 'Saint Lucia',
+	'MF' => 'Saint Martin',
+	'PM' => 'Saint Pierre And Miquelon',
+	'VC' => 'Saint Vincent And Grenadines',
+	'WS' => 'Samoa',
+	'SM' => 'San Marino',
+	'ST' => 'Sao Tome And Principe',
+	'SA' => 'Saudi Arabia',
+	'SN' => 'Senegal',
+	'RS' => 'Serbia',
+	'SC' => 'Seychelles',
+	'SL' => 'Sierra Leone',
+	'SG' => 'Singapore',
+	'SK' => 'Slovakia',
+	'SI' => 'Slovenia',
+	'SB' => 'Solomon Islands',
+	'SO' => 'Somalia',
+	'ZA' => 'South Africa',
+	'GS' => 'South Georgia And Sandwich Isl.',
+	'ES' => 'Spain',
+	'LK' => 'Sri Lanka',
+	'SD' => 'Sudan',
+	'SR' => 'Suriname',
+	'SJ' => 'Svalbard And Jan Mayen',
+	'SZ' => 'Swaziland',
+	'SE' => 'Sweden',
+	'CH' => 'Switzerland',
+	'SY' => 'Syrian Arab Republic',
+	'TW' => 'Taiwan',
+	'TJ' => 'Tajikistan',
+	'TZ' => 'Tanzania',
+	'TH' => 'Thailand',
+	'TL' => 'Timor-Leste',
+	'TG' => 'Togo',
+	'TK' => 'Tokelau',
+	'TO' => 'Tonga',
+	'TT' => 'Trinidad And Tobago',
+	'TN' => 'Tunisia',
+	'TR' => 'Turkey',
+	'TM' => 'Turkmenistan',
+	'TC' => 'Turks And Caicos Islands',
+	'TV' => 'Tuvalu',
+	'UG' => 'Uganda',
+	'UA' => 'Ukraine',
+	'AE' => 'United Arab Emirates',
+	'GB' => 'United Kingdom',
+	'US' => 'United States',
+	'UM' => 'United States Outlying Islands',
+	'UY' => 'Uruguay',
+	'UZ' => 'Uzbekistan',
+	'VU' => 'Vanuatu',
+	'VE' => 'Venezuela',
+	'VN' => 'Viet Nam',
+	'VG' => 'Virgin Islands, British',
+	'VI' => 'Virgin Islands, U.S.',
+	'WF' => 'Wallis And Futuna',
+	'EH' => 'Western Sahara',
+	'YE' => 'Yemen',
+	'ZM' => 'Zambia',
+	'ZW' => 'Zimbabwe',
+);
+
 ?>

+ 275 - 275
core/install/resources/page_parts/install_config_database.php

@@ -1,276 +1,276 @@
-<?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-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-	Matthew Vale <[email protected]>
-*/
-
-	echo "<form method='post' name='frm' action=''>\n";
-	echo "<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
-	echo "<input type='hidden' name='return_install_step' value='config_database'/>\n";
-	echo "<input type='hidden' name='install_step' value='execute'/>\n";
-
-	echo "<input type='hidden' name='event_host' value='$event_host'/>\n";
-	echo "<input type='hidden' name='event_port' value='$event_port'/>\n";
-	echo "<input type='hidden' name='event_password' value='$event_password'/>\n";
-	echo "<input type='hidden' name='db_type' value='$db_type'/>\n";
-	echo "<input type='hidden' name='admin_username' value='$admin_username'/>\n";
-	echo "<input type='hidden' name='admin_password' value='$admin_password'/>\n";
-	echo "<input type='hidden' name='install_default_country' value='$install_default_country'/>\n";
-	echo "<input type='hidden' name='install_template_name' value='$install_template_name'/>\n";
-	echo "<input type='hidden' name='domain_name' value='$domain_name'/>\n";
-
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-
-	echo "<tr>\n";
-	echo "<td align='left' width='30%' nowrap><b>".$text['header-config_database']."</b></td>\n";
-	echo "<td width='70%' align='right'>\n";
-	echo "	<input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
-	echo "	<input type='submit' name='next' class='btn' value='".$text['button-next']."'/>\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	if ($db_type == "sqlite") {
-
-		echo "<tr>\n";
-		echo "<td class='vncell' 'valign='top' align='left' nowrap>\n";
-		echo "	Database Filename\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "	<input class='formfld' type='text' name='db_name' maxlength='255' value=\"$db_name\"><br />\n";
-		echo "	Set the database filename. The file extension should be '.db'.\n";
-		echo "\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "<tr>\n";
-		echo "<td class='vncell' 'valign='top' align='left' nowrap>\n";
-		echo "	Database Directory\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "	<input class='formfld' type='text' name='db_path' maxlength='255' value=\"$db_path\"><br />\n";
-		echo "	Set the path to the database directory.\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-	}
-
-	if ($db_type == "mysql") {
-
-		//set defaults
-			if (strlen($db_host) == 0) { $db_host = 'localhost'; }
-			if (strlen($db_port) == 0) { $db_port = '3306'; }
-			//if (strlen($db_name) == 0) { $db_name = 'fusionpbx'; }
-
-		echo "<tr>\n";
-		echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-		echo "		Database Host\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "		<input class='formfld' type='text' name='db_host' maxlength='255' value=\"$db_host\"><br />\n";
-		echo "		Enter the host address for the database server.\n";
-		echo "\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "<tr>\n";
-		echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-		echo "		Database Port\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "		<input class='formfld' type='text' name='db_port' maxlength='255' value=\"$db_port\"><br />\n";
-		echo "		Enter the port number. It is optional if the database is using the default port.\n";
-		echo "\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "<tr>\n";
-		echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-		echo "		Database Name\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "		<input class='formfld' type='text' name='db_name' maxlength='255' value=\"$db_name\"><br />\n";
-		echo "		Enter the name of the database.\n";
-		echo "\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "<tr>\n";
-		echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-		echo "		Database Username\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "		<input class='formfld' type='text' name='db_username' maxlength='255' value=\"$db_username\"><br />\n";
-		echo "		Enter the database username. \n";
-		echo "\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "<tr>\n";
-		echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-		echo "		Database Password\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "		<input class='formfld' type='text' name='db_password' maxlength='255' value=\"$db_password\"><br />\n";
-		echo "		Enter the database password.\n";
-		echo "\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "<tr>\n";
-		echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-		echo "		Create Database Options\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		if($db_create=='1') { $checked = "checked='checked'"; } else { $checked = ''; }
-		echo "	<label><input type='checkbox' name='db_create' value='1' $checked /> Create the database</label>\n";
-		echo "<br />\n";
-		echo "Choose whether to create the database\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "<tr>\n";
-		echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-		echo "		Create Database Username\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "		<input class='formfld' type='text' name='db_create_username' maxlength='255' value=\"$db_create_username\"><br />\n";
-		echo "		Optional, this username is used to create the database, a database user and set the permissions. \n";
-		echo "		By default this username is 'root' however it can be any account with permission to add a database, user, and grant permissions. \n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "<tr>\n";
-		echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-		echo "		Create Database Password\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "		<input class='formfld' type='text' name='db_create_password' maxlength='255' value=\"$db_create_password\"><br />\n";
-		echo "		Enter the create database password.\n";
-		echo "\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-	}
-
-	if ($db_type == "pgsql") {
-		if (strlen($db_host) == 0) { $db_host = 'localhost'; }
-		if (strlen($db_port) == 0) { $db_port = '5432'; }
-		if (strlen($db_name) == 0) { $db_name = 'fusionpbx'; }
-
-		echo "<tr>\n";
-		echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-		echo "		Database Host\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "		<input class='formfld' type='text' name='db_host' maxlength='255' value=\"$db_host\"><br />\n";
-		echo "		Enter the host address for the database server.\n";
-		echo "\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "<tr>\n";
-		echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-		echo "		Database Port\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "		<input class='formfld' type='text' name='db_port' maxlength='255' value=\"$db_port\"><br />\n";
-		echo "		Enter the port number. It is optional if the database is using the default port.\n";
-		echo "\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "<tr>\n";
-		echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-		echo "		Database Name\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "		<input class='formfld' type='text' name='db_name' maxlength='255' value=\"$db_name\"><br />\n";
-		echo "		Enter the name of the database.\n";
-		echo "\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "<tr>\n";
-		echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-		echo "		Database Username\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "		<input class='formfld' type='text' name='db_username' maxlength='255' value=\"$db_username\"><br />\n";
-		echo "		Enter the database username.\n";
-		echo "\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "<tr>\n";
-		echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-		echo "		Database Password\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "		<input class='formfld' type='text' name='db_password' maxlength='255' value=\"$db_password\"><br />\n";
-		echo "		Enter the database password.\n";
-		echo "\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "<tr>\n";
-		echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-		echo "		Create Database Options\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		if($db_create=='1') { $checked = "checked='checked'"; } else { $checked = ''; }
-		echo "	<label><input type='checkbox' name='db_create' value='1' $checked /> Create the database</label>\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "<tr>\n";
-		echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-		echo "		Create Database Username\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "		<input class='formfld' type='text' name='db_create_username' maxlength='255' value=\"$db_create_username\"><br />\n";
-		echo "		Optional, this username is used to create the database, a database user and set the permissions. \n";
-		echo "		By default this username is 'pgsql' however it can be any account with permission to add a database, user, and grant permissions. \n";
-		echo "		Leave blank to use the details above. \n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "<tr>\n";
-		echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-		echo "		Create Database Password\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "		<input class='formfld' type='text' name='db_create_password' maxlength='255' value=\"$db_create_password\"><br />\n";
-		echo "		Enter the create database password.\n";
-		echo "\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-	}
-
-	echo "</table>";
-	//echo "	<div style='text-align:right'>\n";
-	//echo "		<input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
-	//echo "		<input type='submit' name='execute' class='btn' name='".$text['button-execute']."'>\n";
-	//echo "	</div>\n";
-	echo "</form>\n";
+<?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-2012
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+	Matthew Vale <[email protected]>
+*/
+
+	echo "<form method='post' name='frm' action=''>\n";
+	echo "<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
+	echo "<input type='hidden' name='return_install_step' value='config_database'/>\n";
+	echo "<input type='hidden' name='install_step' value='execute'/>\n";
+
+	echo "<input type='hidden' name='event_host' value='$event_host'/>\n";
+	echo "<input type='hidden' name='event_port' value='$event_port'/>\n";
+	echo "<input type='hidden' name='event_password' value='$event_password'/>\n";
+	echo "<input type='hidden' name='db_type' value='$db_type'/>\n";
+	echo "<input type='hidden' name='admin_username' value='$admin_username'/>\n";
+	echo "<input type='hidden' name='admin_password' value='$admin_password'/>\n";
+	echo "<input type='hidden' name='install_default_country' value='$install_default_country'/>\n";
+	echo "<input type='hidden' name='install_template_name' value='$install_template_name'/>\n";
+	echo "<input type='hidden' name='domain_name' value='$domain_name'/>\n";
+
+	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+
+	echo "<tr>\n";
+	echo "<td align='left' width='30%' nowrap><b>".$text['header-config_database']."</b></td>\n";
+	echo "<td width='70%' align='right'>\n";
+	echo "	<input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
+	echo "	<input type='submit' name='next' class='btn' value='".$text['button-next']."'/>\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	if ($db_type == "sqlite") {
+
+		echo "<tr>\n";
+		echo "<td class='vncell' 'valign='top' align='left' nowrap>\n";
+		echo "	Database Filename\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "	<input class='formfld' type='text' name='db_name' maxlength='255' value=\"$db_name\"><br />\n";
+		echo "	Set the database filename. The file extension should be '.db'.\n";
+		echo "\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
+		echo "<tr>\n";
+		echo "<td class='vncell' 'valign='top' align='left' nowrap>\n";
+		echo "	Database Directory\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "	<input class='formfld' type='text' name='db_path' maxlength='255' value=\"$db_path\"><br />\n";
+		echo "	Set the path to the database directory.\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
+	}
+
+	if ($db_type == "mysql") {
+
+		//set defaults
+			if (strlen($db_host) == 0) { $db_host = 'localhost'; }
+			if (strlen($db_port) == 0) { $db_port = '3306'; }
+			//if (strlen($db_name) == 0) { $db_name = 'fusionpbx'; }
+
+		echo "<tr>\n";
+		echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
+		echo "		Database Host\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "		<input class='formfld' type='text' name='db_host' maxlength='255' value=\"$db_host\"><br />\n";
+		echo "		Enter the host address for the database server.\n";
+		echo "\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
+		echo "<tr>\n";
+		echo "<td class='vncell' valign='top' align='left' nowrap>\n";
+		echo "		Database Port\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "		<input class='formfld' type='text' name='db_port' maxlength='255' value=\"$db_port\"><br />\n";
+		echo "		Enter the port number. It is optional if the database is using the default port.\n";
+		echo "\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
+		echo "<tr>\n";
+		echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
+		echo "		Database Name\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "		<input class='formfld' type='text' name='db_name' maxlength='255' value=\"$db_name\"><br />\n";
+		echo "		Enter the name of the database.\n";
+		echo "\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
+		echo "<tr>\n";
+		echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
+		echo "		Database Username\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "		<input class='formfld' type='text' name='db_username' maxlength='255' value=\"$db_username\"><br />\n";
+		echo "		Enter the database username. \n";
+		echo "\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
+		echo "<tr>\n";
+		echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
+		echo "		Database Password\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "		<input class='formfld' type='text' name='db_password' maxlength='255' value=\"$db_password\"><br />\n";
+		echo "		Enter the database password.\n";
+		echo "\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
+		echo "<tr>\n";
+		echo "<td class='vncell' valign='top' align='left' nowrap>\n";
+		echo "		Create Database Options\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		if($db_create=='1') { $checked = "checked='checked'"; } else { $checked = ''; }
+		echo "	<label><input type='checkbox' name='db_create' value='1' $checked /> Create the database</label>\n";
+		echo "<br />\n";
+		echo "Choose whether to create the database\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
+		echo "<tr>\n";
+		echo "<td class='vncell' valign='top' align='left' nowrap>\n";
+		echo "		Create Database Username\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "		<input class='formfld' type='text' name='db_create_username' maxlength='255' value=\"$db_create_username\"><br />\n";
+		echo "		Optional, this username is used to create the database, a database user and set the permissions. \n";
+		echo "		By default this username is 'root' however it can be any account with permission to add a database, user, and grant permissions. \n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
+		echo "<tr>\n";
+		echo "<td class='vncell' valign='top' align='left' nowrap>\n";
+		echo "		Create Database Password\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "		<input class='formfld' type='text' name='db_create_password' maxlength='255' value=\"$db_create_password\"><br />\n";
+		echo "		Enter the create database password.\n";
+		echo "\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
+	}
+
+	if ($db_type == "pgsql") {
+		if (strlen($db_host) == 0) { $db_host = 'localhost'; }
+		if (strlen($db_port) == 0) { $db_port = '5432'; }
+		if (strlen($db_name) == 0) { $db_name = 'fusionpbx'; }
+
+		echo "<tr>\n";
+		echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
+		echo "		Database Host\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "		<input class='formfld' type='text' name='db_host' maxlength='255' value=\"$db_host\"><br />\n";
+		echo "		Enter the host address for the database server.\n";
+		echo "\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
+		echo "<tr>\n";
+		echo "<td class='vncell' valign='top' align='left' nowrap>\n";
+		echo "		Database Port\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "		<input class='formfld' type='text' name='db_port' maxlength='255' value=\"$db_port\"><br />\n";
+		echo "		Enter the port number. It is optional if the database is using the default port.\n";
+		echo "\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
+		echo "<tr>\n";
+		echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
+		echo "		Database Name\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "		<input class='formfld' type='text' name='db_name' maxlength='255' value=\"$db_name\"><br />\n";
+		echo "		Enter the name of the database.\n";
+		echo "\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
+		echo "<tr>\n";
+		echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
+		echo "		Database Username\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "		<input class='formfld' type='text' name='db_username' maxlength='255' value=\"$db_username\"><br />\n";
+		echo "		Enter the database username.\n";
+		echo "\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
+		echo "<tr>\n";
+		echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
+		echo "		Database Password\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "		<input class='formfld' type='text' name='db_password' maxlength='255' value=\"$db_password\"><br />\n";
+		echo "		Enter the database password.\n";
+		echo "\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
+		echo "<tr>\n";
+		echo "<td class='vncell' valign='top' align='left' nowrap>\n";
+		echo "		Create Database Options\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		if($db_create=='1') { $checked = "checked='checked'"; } else { $checked = ''; }
+		echo "	<label><input type='checkbox' name='db_create' value='1' $checked /> Create the database</label>\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
+		echo "<tr>\n";
+		echo "<td class='vncell' valign='top' align='left' nowrap>\n";
+		echo "		Create Database Username\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "		<input class='formfld' type='text' name='db_create_username' maxlength='255' value=\"$db_create_username\"><br />\n";
+		echo "		Optional, this username is used to create the database, a database user and set the permissions. \n";
+		echo "		By default this username is 'pgsql' however it can be any account with permission to add a database, user, and grant permissions. \n";
+		echo "		Leave blank to use the details above. \n";
+		echo "</td>\n";
+		echo "</tr>\n";
+
+		echo "<tr>\n";
+		echo "<td class='vncell' valign='top' align='left' nowrap>\n";
+		echo "		Create Database Password\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "		<input class='formfld' type='text' name='db_create_password' maxlength='255' value=\"$db_create_password\"><br />\n";
+		echo "		Enter the create database password.\n";
+		echo "\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+	}
+
+	echo "</table>";
+	//echo "	<div style='text-align:right'>\n";
+	//echo "		<input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
+	//echo "		<input type='submit' name='execute' class='btn' name='".$text['button-execute']."'>\n";
+	//echo "	</div>\n";
+	echo "</form>\n";
 ?>

+ 149 - 149
core/install/resources/page_parts/install_config_detail.php

@@ -1,150 +1,150 @@
-<?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-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-	Matthew Vale <[email protected]>
-*/
-
-	echo "<form method='post' name='frm' action=''>\n";
-	echo "<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
-	echo "<input type='hidden' name='return_install_step' value='config_detail'/>\n";
-	echo "<input type='hidden' name='install_step' value='config_database'/>\n";
-
-	echo "<input type='hidden' name='event_host' value='$event_host'/>\n";
-	echo "<input type='hidden' name='event_port' value='$event_port'/>\n";
-	echo "<input type='hidden' name='event_password' value='$event_password'/>\n";
-
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-
-	echo "<tr>\n";
-	echo "<td align='left' width='30%' nowrap><b>".$text['header-config_detail']."</b></td>\n";
-	echo "<td width='70%' align='right'>\n";
-	echo "	<input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
-	echo "	<input type='submit' name='next' class='btn' value='".$text['button-next']."'/>\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
-	echo "	Username\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	<input class='formfld' type='text' name='admin_username' maxlength='255' value=\"$admin_username\"><br />\n";
-	echo "	Enter the username to use when logging in with the browser.<br />\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
-	echo "	Password\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	<input class='formfld' type='text' name='admin_password' maxlength='255' value=\"$admin_password\"><br />\n";
-	echo "	Enter the password to use when logging in with the browser.<br />\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
-	echo "	Country\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "		<select id='install_default_country' name='install_default_country' class='formfld' style=''>\n";
-	require "resources/countries.php";
-
-	foreach ($countries as $iso_code => $country ){
-		if($iso_code == $install_default_country){
-			echo "			<option value='$iso_code' selected='selected'>".$country['country']."</option>\n";
-		}else{
-			echo "			<option value='$iso_code'>".$country['country']."</option>\n";
-		}
-	}
-	echo "		</select>\n";
-	echo "		<br />\n";
-	echo "	Select ISO country code used to initialize calling contry code variables.<br />\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "	<tr>\n";
-	echo "	<td width='20%' class=\"vncellreq\" align='left' nowrap='nowrap'>\n";
-	echo "		Theme: \n";
-	echo "	</td>\n";
-	echo "	<td class=\"vtable\" align='left'>\n";
-	echo "		<select id='install_template_name' name='install_template_name' class='formfld' style=''>\n";
-	echo "		<option value=''></option>\n";
-	//add all the themes to the list
-		$theme_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/themes';
-		if ($handle = opendir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/themes')) {
-			while (false !== ($dir_name = readdir($handle))) {
-				if ($dir_name != "." && $dir_name != ".." && $dir_name != ".svn" && $dir_name != ".git" && $dir_name != "flags" && is_readable($theme_dir.'/'.$dir_name)) {
-					$dir_label = str_replace('_', ' ', $dir_name);
-					$dir_label = str_replace('-', ' ', $dir_label);
-					if ($dir_name == 'enhanced') {
-						echo "		<option value='$dir_name' selected='selected'>$dir_label</option>\n";
-					}
-					else {
-						echo "		<option value='$dir_name'>$dir_label</option>\n";
-					}
-				}
-			}
-			closedir($handle);
-		}
-	echo "		</select>\n";
-	echo "		<br />\n";
-	echo "		Select a theme to set as the default.<br />\n";
-	echo "	</td>\n";
-	echo "	</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "		Domain name\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "		<input class='formfld' type='text' name='domain_name' maxlength='255' value=\"$domain_name\"><br />\n";
-	echo "		Enter the default domain name. \n";
-	echo "\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "	Database Type\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	<select name='db_type' id='db_type' class='formfld' id='form_tag' onchange='db_type_onchange();'>\n";
-	if (extension_loaded('pdo_pgsql')) {	echo "	<option value='pgsql'>postgresql</option>\n"; }
-	if (extension_loaded('pdo_mysql')) {	echo "	<option value='mysql'>mysql</option>\n"; }
-	if (extension_loaded('pdo_sqlite')) {	echo "	<option value='sqlite' selected='selected'>sqlite</option>\n"; } //set sqlite as the default
-	echo "	</select><br />\n";
-	echo "		Select the database type.\n";
-	echo "\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "</table>";
-	//echo "	<div style='text-align:right'>\n";
-	//echo "		<input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
-	//echo "		<input type='submit' class='btn' name='execute' name='".$text['button-next']."'>\n";
-	//echo "	</div>\n";
-	echo "</form>\n";
+<?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-2012
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+	Matthew Vale <[email protected]>
+*/
+
+	echo "<form method='post' name='frm' action=''>\n";
+	echo "<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
+	echo "<input type='hidden' name='return_install_step' value='config_detail'/>\n";
+	echo "<input type='hidden' name='install_step' value='config_database'/>\n";
+
+	echo "<input type='hidden' name='event_host' value='$event_host'/>\n";
+	echo "<input type='hidden' name='event_port' value='$event_port'/>\n";
+	echo "<input type='hidden' name='event_password' value='$event_password'/>\n";
+
+	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+
+	echo "<tr>\n";
+	echo "<td align='left' width='30%' nowrap><b>".$text['header-config_detail']."</b></td>\n";
+	echo "<td width='70%' align='right'>\n";
+	echo "	<input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
+	echo "	<input type='submit' name='next' class='btn' value='".$text['button-next']."'/>\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "<tr>\n";
+	echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
+	echo "	Username\n";
+	echo "</td>\n";
+	echo "<td class='vtable' align='left'>\n";
+	echo "	<input class='formfld' type='text' name='admin_username' maxlength='255' value=\"$admin_username\"><br />\n";
+	echo "	Enter the username to use when logging in with the browser.<br />\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "<tr>\n";
+	echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
+	echo "	Password\n";
+	echo "</td>\n";
+	echo "<td class='vtable' align='left'>\n";
+	echo "	<input class='formfld' type='text' name='admin_password' maxlength='255' value=\"$admin_password\"><br />\n";
+	echo "	Enter the password to use when logging in with the browser.<br />\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "<tr>\n";
+	echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
+	echo "	Country\n";
+	echo "</td>\n";
+	echo "<td class='vtable' align='left'>\n";
+	echo "		<select id='install_default_country' name='install_default_country' class='formfld' style=''>\n";
+	require "resources/countries.php";
+
+	foreach ($countries as $iso_code => $country ){
+		if($iso_code == $install_default_country){
+			echo "			<option value='$iso_code' selected='selected'>".$country['country']."</option>\n";
+		}else{
+			echo "			<option value='$iso_code'>".$country['country']."</option>\n";
+		}
+	}
+	echo "		</select>\n";
+	echo "		<br />\n";
+	echo "	Select ISO country code used to initialize calling contry code variables.<br />\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "	<tr>\n";
+	echo "	<td width='20%' class=\"vncellreq\" align='left' nowrap='nowrap'>\n";
+	echo "		Theme: \n";
+	echo "	</td>\n";
+	echo "	<td class=\"vtable\" align='left'>\n";
+	echo "		<select id='install_template_name' name='install_template_name' class='formfld' style=''>\n";
+	echo "		<option value=''></option>\n";
+	//add all the themes to the list
+		$theme_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/themes';
+		if ($handle = opendir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/themes')) {
+			while (false !== ($dir_name = readdir($handle))) {
+				if ($dir_name != "." && $dir_name != ".." && $dir_name != ".svn" && $dir_name != ".git" && $dir_name != "flags" && is_readable($theme_dir.'/'.$dir_name)) {
+					$dir_label = str_replace('_', ' ', $dir_name);
+					$dir_label = str_replace('-', ' ', $dir_label);
+					if ($dir_name == 'enhanced') {
+						echo "		<option value='$dir_name' selected='selected'>$dir_label</option>\n";
+					}
+					else {
+						echo "		<option value='$dir_name'>$dir_label</option>\n";
+					}
+				}
+			}
+			closedir($handle);
+		}
+	echo "		</select>\n";
+	echo "		<br />\n";
+	echo "		Select a theme to set as the default.<br />\n";
+	echo "	</td>\n";
+	echo "	</tr>\n";
+
+	echo "<tr>\n";
+	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
+	echo "		Domain name\n";
+	echo "</td>\n";
+	echo "<td class='vtable' align='left'>\n";
+	echo "		<input class='formfld' type='text' name='domain_name' maxlength='255' value=\"$domain_name\"><br />\n";
+	echo "		Enter the default domain name. \n";
+	echo "\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "<tr>\n";
+	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
+	echo "	Database Type\n";
+	echo "</td>\n";
+	echo "<td class='vtable' align='left'>\n";
+	echo "	<select name='db_type' id='db_type' class='formfld' id='form_tag' onchange='db_type_onchange();'>\n";
+	if (extension_loaded('pdo_pgsql')) {	echo "	<option value='pgsql'>postgresql</option>\n"; }
+	if (extension_loaded('pdo_mysql')) {	echo "	<option value='mysql'>mysql</option>\n"; }
+	if (extension_loaded('pdo_sqlite')) {	echo "	<option value='sqlite' selected='selected'>sqlite</option>\n"; } //set sqlite as the default
+	echo "	</select><br />\n";
+	echo "		Select the database type.\n";
+	echo "\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "</table>";
+	//echo "	<div style='text-align:right'>\n";
+	//echo "		<input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
+	//echo "		<input type='submit' class='btn' name='execute' name='".$text['button-next']."'>\n";
+	//echo "	</div>\n";
+	echo "</form>\n";
 ?>

+ 136 - 136
core/install/resources/page_parts/install_event_socket.php

@@ -1,137 +1,137 @@
-<?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-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Matthew Vale <[email protected]>
-*/
-	//fetch the values
-	require_once "core/install/resources/classes/detect_switch.php";
-	$switch_detect = new detect_switch($event_host, $event_port, $event_password);
-	//$switch_detect->event_port = 2021;
-	$detect_ok = true;
-	try {
-		$switch_detect->detect();
-	} catch(Exception $e){
-		//echo "<p><b>Failed to detect configuration</b> detect_switch reported: " . $e->getMessage() ."</p>\n";
-		//$detect_ok = false;
-	}
-	echo "<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
-	echo "<input type='hidden' name='install_step' value='detect_config'/>\n";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-
-	echo "<tr>\n";
-	echo "<td width='30%' align='left' nowrap><b>".$text['header-event_socket']."</b><br><br></td>\n";
-	echo "<td width='70%' align='right'>";
-	//echo "	<input type='button' name='detect' class='btn' onclick=\"location.reload();\" value='".$text['button-detect']."'/>\n";
-	echo "	<input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
-	echo "	<input type='submit' name='next' class='btn' value='".$text['button-next']."'/>\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "	".$text['label-event_host']."\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	<input class='formfld' type='text' name='event_host' maxlength='255' value=\"".$switch_detect->event_host."\" />\n";
-	echo "<br />\n";
-	echo $text['description-event_host']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "	".$text['label-event_port']."\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	<input class='formfld' type='text' name='event_port' maxlength='255' value=\"".$switch_detect->event_port."\"/>\n";
-	echo "<br />\n";
-	echo $text['description-event_port']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "	".$text['label-event_password']."\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	<input class='formfld' type='password' name='event_password' maxlength='255' value=\"".$switch_detect->event_password."\"/>\n";
-	echo "<br />\n";
-	echo $text['description-event_password']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "	<tr>\n";
-	echo "		<td colspan='2' align='right'>\n";
-	echo "			<br>";
-	echo "		</td>\n";
-	echo "	</tr>";
-
-	echo "</table>";
-	if($detect_ok){
-		echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-
-		echo "<tr>\n";
-		echo "<td colspan='4' align='left' nowrap><b>".$text['title-detected_configuration']."</b></td>\n";
-		echo "</tr>\n";
-
-		$id = 1;
-		echo "<tr>\n";
-		echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap' width='15%'>\n";
-		echo "Switch version\n";
-		echo "</td>\n";
-		echo "<td class='vtable' width='35%' align='left'>\n";
-		echo "    ".$switch_detect->version()."\n";
-		echo "</td>\n";
-
-		foreach ($switch_detect->get_dirs() as $folder)
-		{
-			if($id % 2 == 0){ echo "<tr>\n"; }
-			echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap' width='15%'>\n";
-			echo $folder."\n";
-			echo "</td>\n";
-			echo "<td class='vtable' width='35%' align='left'>\n";
-			echo "    ".$switch_detect->$folder()."\n";
-			echo "</td>\n";
-			if($id % 2 == 1){ echo "</tr>\n"; }
-			$id++;
-		}
-		if($id % 2 == 1){ echo "</tr>\n"; }
-		echo "<tr>\n";
-		echo "<td colspan='4' align='left' nowrap><br/><b>".$text['title-assumed_configuration']."</b></td>\n";
-		echo "</tr>\n";
-		$id=0;
-		foreach ($switch_detect->get_vdirs() as $folder) {
-			if($id % 2 == 0){ echo "<tr>\n"; }
-			echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap' width='15%'>\n";
-			echo $folder."\n";
-			echo "</td>\n";
-			echo "<td class='vtable' width='35%' align='left'>\n";
-			echo "    ".$switch_detect->$folder()."\n";
-			echo "</td>\n";
-			if($id % 2 == 1){ echo "</tr>\n"; }
-			$id++;
-		}
-		echo "</table>";
-	}
-
+<?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-2012
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Matthew Vale <[email protected]>
+*/
+	//fetch the values
+	require_once "core/install/resources/classes/detect_switch.php";
+	$switch_detect = new detect_switch($event_host, $event_port, $event_password);
+	//$switch_detect->event_port = 2021;
+	$detect_ok = true;
+	try {
+		$switch_detect->detect();
+	} catch(Exception $e){
+		//echo "<p><b>Failed to detect configuration</b> detect_switch reported: " . $e->getMessage() ."</p>\n";
+		//$detect_ok = false;
+	}
+	echo "<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
+	echo "<input type='hidden' name='install_step' value='detect_config'/>\n";
+	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+
+	echo "<tr>\n";
+	echo "<td width='30%' align='left' nowrap><b>".$text['header-event_socket']."</b><br><br></td>\n";
+	echo "<td width='70%' align='right'>";
+	//echo "	<input type='button' name='detect' class='btn' onclick=\"location.reload();\" value='".$text['button-detect']."'/>\n";
+	echo "	<input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
+	echo "	<input type='submit' name='next' class='btn' value='".$text['button-next']."'/>\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "<tr>\n";
+	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
+	echo "	".$text['label-event_host']."\n";
+	echo "</td>\n";
+	echo "<td class='vtable' align='left'>\n";
+	echo "	<input class='formfld' type='text' name='event_host' maxlength='255' value=\"".$switch_detect->event_host."\" />\n";
+	echo "<br />\n";
+	echo $text['description-event_host']."\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "<tr>\n";
+	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
+	echo "	".$text['label-event_port']."\n";
+	echo "</td>\n";
+	echo "<td class='vtable' align='left'>\n";
+	echo "	<input class='formfld' type='text' name='event_port' maxlength='255' value=\"".$switch_detect->event_port."\"/>\n";
+	echo "<br />\n";
+	echo $text['description-event_port']."\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "<tr>\n";
+	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
+	echo "	".$text['label-event_password']."\n";
+	echo "</td>\n";
+	echo "<td class='vtable' align='left'>\n";
+	echo "	<input class='formfld' type='password' name='event_password' maxlength='255' value=\"".$switch_detect->event_password."\"/>\n";
+	echo "<br />\n";
+	echo $text['description-event_password']."\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "	<tr>\n";
+	echo "		<td colspan='2' align='right'>\n";
+	echo "			<br>";
+	echo "		</td>\n";
+	echo "	</tr>";
+
+	echo "</table>";
+	if($detect_ok){
+		echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+
+		echo "<tr>\n";
+		echo "<td colspan='4' align='left' nowrap><b>".$text['title-detected_configuration']."</b></td>\n";
+		echo "</tr>\n";
+
+		$id = 1;
+		echo "<tr>\n";
+		echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap' width='15%'>\n";
+		echo "Switch version\n";
+		echo "</td>\n";
+		echo "<td class='vtable' width='35%' align='left'>\n";
+		echo "    ".$switch_detect->version()."\n";
+		echo "</td>\n";
+
+		foreach ($switch_detect->get_dirs() as $folder)
+		{
+			if($id % 2 == 0){ echo "<tr>\n"; }
+			echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap' width='15%'>\n";
+			echo $folder."\n";
+			echo "</td>\n";
+			echo "<td class='vtable' width='35%' align='left'>\n";
+			echo "    ".$switch_detect->$folder()."\n";
+			echo "</td>\n";
+			if($id % 2 == 1){ echo "</tr>\n"; }
+			$id++;
+		}
+		if($id % 2 == 1){ echo "</tr>\n"; }
+		echo "<tr>\n";
+		echo "<td colspan='4' align='left' nowrap><br/><b>".$text['title-assumed_configuration']."</b></td>\n";
+		echo "</tr>\n";
+		$id=0;
+		foreach ($switch_detect->get_vdirs() as $folder) {
+			if($id % 2 == 0){ echo "<tr>\n"; }
+			echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap' width='15%'>\n";
+			echo $folder."\n";
+			echo "</td>\n";
+			echo "<td class='vtable' width='35%' align='left'>\n";
+			echo "    ".$switch_detect->$folder()."\n";
+			echo "</td>\n";
+			if($id % 2 == 1){ echo "</tr>\n"; }
+			$id++;
+		}
+		echo "</table>";
+	}
+
 ?>

+ 64 - 64
core/install/resources/page_parts/install_select_language.php

@@ -1,65 +1,65 @@
-<?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) 2015-2016
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Matthew Vale <[email protected]>
-*/
-
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "	<tr>\n";
-	echo "		<td width='30%' align='left' nowrap='nowrap'><b>".$text['header-select_language']."</b><br><br></td>\n";
-	echo "		<td width='70%' align='right'>";
-	echo "			<input type='submit' name='submit' class='btn' value='".$text['button-next']."'/>\n";
-	echo "		</td>\n";
-	echo "	</tr>\n";
-	echo "	<tr>\n";
-	echo "		<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "			".$text['label-select_language']."\n";
-	echo "		</td>\n";
-	echo "		<td class='vtable' align='left'>\n";
-	echo "			<table cellpadding='0' cellspacing='0'>";
-	foreach($_SESSION['app']['languages'] as $lang_code){
-		echo "			<tr>";
-		echo "				<td width='15' class='vtable' valign='top' nowrap='nowrap'>\n";
-		echo "					<input type='radio' name='install_language' value='$lang_code' id='lang_$lang_code' ";
-		if($lang_code == $_SESSION['domain']['language']['code']) {
-			echo " checked='checked'";
-		}
-		echo "/>";
-		echo "				</td>";
-		echo "				<td class='vtable' align='left' valign='top' nowrap='nowrap'>\n";
-		echo "					<img src='<!--{project_path}-->/core/install/resources/images/flags/$lang_code.png' alt='$lang_code'/>&nbsp;".$text["language-$lang_code"];
-		echo "				</td>";
-		echo "				<td width='100%' class='vtable' valign='top'>\n";
-		echo "					&nbsp;\n";
-		echo "				</td>";
-		echo "			</tr>";
-	}
-	echo "			</table>";
-	echo "			<br />\n";
-	echo "			".$text['description-select_language']."\n";
-	echo "		</td>\n";
-	echo "	</tr>\n";
-	echo "</table>";
-	echo "<br><br>";
-
+<?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) 2015-2016
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Matthew Vale <[email protected]>
+*/
+
+	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "	<tr>\n";
+	echo "		<td width='30%' align='left' nowrap='nowrap'><b>".$text['header-select_language']."</b><br><br></td>\n";
+	echo "		<td width='70%' align='right'>";
+	echo "			<input type='submit' name='submit' class='btn' value='".$text['button-next']."'/>\n";
+	echo "		</td>\n";
+	echo "	</tr>\n";
+	echo "	<tr>\n";
+	echo "		<td class='vncellreq' valign='top' align='left' nowrap>\n";
+	echo "			".$text['label-select_language']."\n";
+	echo "		</td>\n";
+	echo "		<td class='vtable' align='left'>\n";
+	echo "			<table cellpadding='0' cellspacing='0'>";
+	foreach($_SESSION['app']['languages'] as $lang_code){
+		echo "			<tr>";
+		echo "				<td width='15' class='vtable' valign='top' nowrap='nowrap'>\n";
+		echo "					<input type='radio' name='install_language' value='$lang_code' id='lang_$lang_code' ";
+		if($lang_code == $_SESSION['domain']['language']['code']) {
+			echo " checked='checked'";
+		}
+		echo "/>";
+		echo "				</td>";
+		echo "				<td class='vtable' align='left' valign='top' nowrap='nowrap'>\n";
+		echo "					<img src='<!--{project_path}-->/core/install/resources/images/flags/$lang_code.png' alt='$lang_code'/>&nbsp;".$text["language-$lang_code"];
+		echo "				</td>";
+		echo "				<td width='100%' class='vtable' valign='top'>\n";
+		echo "					&nbsp;\n";
+		echo "				</td>";
+		echo "			</tr>";
+	}
+	echo "			</table>";
+	echo "			<br />\n";
+	echo "			".$text['description-select_language']."\n";
+	echo "		</td>\n";
+	echo "	</tr>\n";
+	echo "</table>";
+	echo "<br><br>";
+
 ?>

+ 460 - 460
core/notifications/notification_edit.php

@@ -1,461 +1,461 @@
-<?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-2012
-the Initial Developer. All Rights Reserved.
-
-Contributor(s):
-Mark J Crane <[email protected]>
-*/
-
-require_once "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-if (if_group('superadmin')) {
-	//access granted
-}
-else {
-	echo "access denied";
-	exit;
-}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-// retrieve software uuid
-	$sql = "select software_uuid, software_url, software_version from v_software";
-	$prep_statement = $db->prepare($sql);
-	if ($prep_statement) {
-		$prep_statement->execute();
-		$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-		foreach ($result as &$row) {
-			$software_uuid = $row["software_uuid"];
-			$software_url = $row["software_url"];
-			$software_version = $row["software_version"];
-			break; // limit to 1 row
-		}
-	}
-	unset($sql, $prep_statement);
-
-	if (count($_REQUEST) > 0) {
-
-		// prepare demographic information **********************************************
-
-			// fusionpbx version
-			$software_ver = $software_version;
-
-			// php version
-			$php_ver = phpversion();
-
-			// webserver name & version
-			$web_server = $_SERVER['SERVER_SOFTWARE'];
-
-			// switch version
-			$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
-			if ($fp) {
-				$switch_result = event_socket_request($fp, 'api version');
-			}
-			$switch_ver = trim($switch_result);
-
-			// database name & version
-			switch ($db_type) {
-				case "pgsql" :	$db_ver_query = "select version() as db_ver;";			break;
-				case "mysql" :	$db_ver_query = "select version() as db_ver;";			break;
-				case "sqlite" :	$db_ver_query = "select sqlite_version() as db_ver;";	break;
-			}
-			$prep_statement = $db->prepare($db_ver_query);
-			if ($prep_statement) {
-				$prep_statement->execute();
-				$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-				foreach ($result as &$row) {
-					$database_version = $row["db_ver"];
-					break; // limit to 1 row
-				}
-			}
-			unset($db_ver_query, $prep_statement);
-			$db_ver = $database_version;
-
-			// operating system name & version
-			$os_platform = PHP_OS;
-			$os_info_1 = php_uname("a");
-			if ($os_platform == "Linux") {
-				$os_info_2 = shell_exec("cat /etc/*{release,version}");
-				$os_info_2 .= shell_exec("lsb_release -d -s");
-			}
-			else if (substr(strtoupper($os_platform), 0, 3) == "WIN") {
-				$os_info_2 = trim(shell_exec("ver"));
-			}
-
-		// **************************************************************************
-
-		// check for demographic only submit
-		if (isset($_GET["demo"])) {
-
-			// update remote server record with new values
-			$url = "https://".$software_url."/app/notifications/notifications_manage.php";
-			$url .= "?demo";
-			$url .= "&id=".$software_uuid;
-			$url .= "&software_ver=".urlencode($software_ver);
-			$url .= "&php_ver=".urlencode($php_ver);
-			$url .= "&web_server=".urlencode($web_server);
-			$url .= "&switch_ver=".urlencode($switch_ver);
-			$url .= "&db_type=".urlencode($db_type);
-			$url .= "&db_ver=".urlencode($db_ver);
-			$url .= "&os_platform=".urlencode($os_platform);
-			$url .= "&os_info_1=".urlencode($os_info_1);
-			$url .= "&os_info_2=".urlencode($os_info_2);
-
-			if (file_get_contents(__FILE__) && ini_get('allow_url_fopen')) {
-				$response = file_get_contents($url);
-			}
-			else if (function_exists('curl_version')) {
-				$curl = curl_init();
-				curl_setopt($curl, CURLOPT_URL, $url);
-				curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
-				$response = curl_exec($curl);
-				curl_close($curl);
-			}
-
-			// parse response
-			$response = json_decode($response, true);
-
-			if ($response['result'] == 'submitted') {
-				// set message
-				$_SESSION["message"] = $text['message-demographics_submitted'];
-			}
-
-			header("Location: notification_edit.php");
-			exit;
-
-		}
-
-		// retrieve submitted values
-		$project_notifications = check_str($_POST["project_notifications"]);
-		$project_security = check_str($_POST["project_security"]);
-		$project_releases = check_str($_POST["project_releases"]);
-		$project_events = check_str($_POST["project_events"]);
-		$project_news = check_str($_POST["project_news"]);
-		$project_notification_method = check_str($_POST["project_notification_method"]);
-		$project_notification_recipient = check_str($_POST["project_notification_recipient"]);
-
-		// get local project notification participation flag
-		$sql = "select project_notifications from v_notifications";
-		$prep_statement = $db->prepare($sql);
-		if ($prep_statement) {
-			$prep_statement->execute();
-			$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-			foreach ($result as &$row) {
-				$current_project_notifications = $row["project_notifications"];
-				break; // limit to 1 row
-			}
-		}
-		unset($sql, $prep_statement);
-
-		// check if remote record should be removed
-		if ($project_notifications == 'false') {
-
-			if ($current_project_notifications == 'true') {
-				// remove remote server record
-				$url = "https://".$software_url."/app/notifications/notifications_manage.php?id=".$software_uuid."&action=delete";
-				if (file_get_contents(__FILE__) && ini_get('allow_url_fopen')) {
-					$response = file_get_contents($url);
-				}
-				else if (function_exists('curl_version')) {
-					$curl = curl_init();
-					curl_setopt($curl, CURLOPT_URL, $url);
-					curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
-					$response = curl_exec($curl);
-					curl_close($curl);
-				}
-
-				// parse response
-				$response = json_decode($response, true);
-
-				if ($response['result'] == 'deleted') {
-					// set local project notification participation flag to false
-					$sql = "update v_notifications set project_notifications = 'false'";
-					$db->exec(check_sql($sql));
-					unset($sql);
-				}
-			}
-			// redirect
-			$_SESSION["message"] = $text['message-update'];
-			header("Location: notification_edit.php");
-			exit;
-		}
-
-		// check for invalid values
-		if ($project_notifications == 'true') {
-			if (
-				($project_notification_method == 'email' && !valid_email($project_notification_recipient)) ||
-				($project_notification_method == 'email' && $project_notification_recipient == '')
-				) {
-					$_SESSION["postback"] = $_POST;
-					$_SESSION["message_mood"] = 'negative';
-					$_SESSION["message"] = $text['message-invalid_recipient'];
-					header("Location: notification_edit.php");
-					exit;
-			}
-		}
-
-		// update remote server record with new values
-		$url = "https://".$software_url."/app/notifications/notifications_manage.php";
-		$url .= "?id=".$software_uuid;
-		$url .= "&security=".$project_security;
-		$url .= "&releases=".$project_releases;
-		$url .= "&events=".$project_events;
-		$url .= "&news=".$project_news;
-		$url .= "&method=".$project_notification_method;
-		$url .= "&recipient=".urlencode($project_notification_recipient);
-		$url .= "&software_ver=".urlencode($software_ver);
-		$url .= "&php_ver=".urlencode($php_ver);
-		$url .= "&web_server=".urlencode($web_server);
-		$url .= "&switch_ver=".urlencode($switch_ver);
-		$url .= "&db_type=".urlencode($db_type);
-		$url .= "&db_ver=".urlencode($db_ver);
-		$url .= "&os_platform=".urlencode($os_platform);
-		$url .= "&os_info_1=".urlencode($os_info_1);
-		$url .= "&os_info_2=".urlencode($os_info_2);
-
-		if (file_get_contents(__FILE__) && ini_get('allow_url_fopen')) {
-			$response = file_get_contents($url);
-		}
-		else if (function_exists('curl_version')) {
-			$curl = curl_init();
-			curl_setopt($curl, CURLOPT_URL, $url);
-			curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
-			$response = curl_exec($curl);
-			curl_close($curl);
-		}
-
-		// parse response
-		$response = json_decode($response, true);
-
-		if ($response['result'] == 'updated' || $response['result'] == 'inserted') {
-			// set local project notification participation flag to true
-			$sql = "update v_notifications set project_notifications = 'true'";
-			$db->exec(check_sql($sql));
-			unset($sql);
-			// set message
-			$_SESSION["message"] = $text['message-update'];
-			if (
-				$project_security == 'false' &&
-				$project_releases == 'false' &&
-				$project_events == 'false' &&
-				$project_news == 'false'
-				) {
-				$_SESSION["message_mood"] = 'alert';
-				$_SESSION["message"] = $_SESSION["message"]." - ".$text['message-no_channels'];
-			}
-			// redirect
-			header("Location: notification_edit.php");
-			exit;
-		}
-
-	}
-
-// check postback session
-	if (!isset($_SESSION["postback"])) {
-
-		// check local project notification participation flag
-		$sql = "select project_notifications from v_notifications";
-		$prep_statement = $db->prepare($sql);
-		if ($prep_statement) {
-			$prep_statement->execute();
-			$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-			foreach ($result as &$row) {
-				$setting["project_notifications"] = $row["project_notifications"];
-				break; // limit to 1 row
-			}
-		}
-		unset($sql, $prep_statement);
-
-		// if participation enabled
-		if ($setting["project_notifications"] == 'true') {
-
-			// get current project notification preferences
-			$url = "https://".$software_url."/app/notifications/notifications_manage.php?id=".$software_uuid;
-			if (file_get_contents(__FILE__) && ini_get('allow_url_fopen')) {
-				$response = file_get_contents($url);
-			}
-			else if (function_exists('curl_version')) {
-				$curl = curl_init();
-				curl_setopt($curl, CURLOPT_URL, $url);
-				curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
-				$response = curl_exec($curl);
-				curl_close($curl);
-			}
-
-			// parse response
-			$setting = json_decode($response, true);
-			$setting["project_notifications"] = 'true';
-		}
-
-	}
-	else {
-
-		// load postback variables
-		$setting = fix_postback($_SESSION["postback"]);
-		unset($_SESSION["postback"]);
-
-	}
-
-require_once "resources/header.php";
-$document['title'] = $text['title-notifications'];
-
-// show the content
-	echo "<form method='post' name='frm' action=''>\n";
-	echo "<table cellpadding='0' cellspacing='0' width='100%' border='0'>\n";
-	echo "	<tr>\n";
-	echo "		<td align='left' nowrap='nowrap'><b>".$text['header-notifications']."</b><br><br></td>\n";
-	echo "		<td align='right'>";
-	echo "			<input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
-	echo "			<br><br>";
-	echo "		</td>\n";
-	echo "	</tr>\n";
-	echo "	<tr>\n";
-	echo "		<td align='left' colspan='2'>\n";
-	echo "			".$text['description-notifications']."<br /><br />\n";
-	echo "		</td>\n";
-	echo "	</tr>\n";
-
-	echo "	<tr>\n";
-	echo "		<td width='30%' class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo 			$text['label-project_notifications']."\n";
-	echo "		</td>\n";
-	echo "		<td width='70%' class='vtable' align='left'>\n";
-	echo "			<select name='project_notifications' class='formfld' style='width: auto;' onchange=\"$('#notification_channels').slideToggle();\">\n";
-	echo "				<option value='false' ".(($setting["project_notifications"] == 'false') ? "selected='selected'" : null).">".$text['option-disabled']."</option>\n";
-	echo "				<option value='true' ".(($setting["project_notifications"] == 'true') ? "selected='selected'" : null).">".$text['option-enabled']."</option>\n";
-	echo "			</select><br />\n";
-	echo 			$text['description-project_notifications']."\n";
-	echo "		</td>\n";
-	echo "	</tr>\n";
-
-	echo "</table>\n";
-
-	echo "<div id='notification_channels' ".(($setting["project_notifications"] != 'true') ? "style='display: none;'" : null).">\n";
-		echo "<table cellpadding='0' cellspacing='0' width='100%' border='0'>\n";
-
-		echo "	<tr>\n";
-		echo "		<td width='30%' class='vncell' valign='top' align='left' nowrap>\n";
-		echo 			$text['label-project_security']."\n";
-		echo "		</td>\n";
-		echo "		<td width='70%' class='vtable' align='left'>\n";
-		echo "			<select name='project_security' class='formfld' style='width: auto;'>\n";
-		echo "				<option value='false' ".(($setting["project_security"] == 'false') ? "selected='selected'" : null).">".$text['option-disabled']."</option>\n";
-		echo "				<option value='true' ".(($setting["project_security"] == 'true') ? "selected='selected'" : null).">".$text['option-enabled']."</option>\n";
-		echo "			</select><br />\n";
-		echo 			$text['description-project_security']."\n";
-		echo "		</td>\n";
-		echo "	</tr>\n";
-
-		echo "	<tr>\n";
-		echo "		<td class='vncell' valign='top' align='left' nowrap>\n";
-		echo 			$text['label-project_releases']."\n";
-		echo "		</td>\n";
-		echo "		<td class='vtable' align='left'>\n";
-		echo "			<select name='project_releases' class='formfld' style='width: auto;'>\n";
-		echo "				<option value='false' ".(($setting["project_releases"] == 'false') ? "selected='selected'" : null).">".$text['option-disabled']."</option>\n";
-		echo "				<option value='true' ".(($setting["project_releases"] == 'true') ? "selected='selected'" : null).">".$text['option-enabled']."</option>\n";
-		echo "			</select><br />\n";
-		echo 			$text['description-project_releases']."\n";
-		echo "		</td>\n";
-		echo "	</tr>\n";
-
-		echo "	<tr>\n";
-		echo "		<td width='30%' class='vncell' valign='top' align='left' nowrap>\n";
-		echo 			$text['label-project_events']."\n";
-		echo "		</td>\n";
-		echo "		<td width='70%' class='vtable' align='left'>\n";
-		echo "			<select name='project_events' class='formfld' style='width: auto;'>\n";
-		echo "				<option value='false' ".(($setting["project_events"] == 'false') ? "selected='selected'" : null).">".$text['option-disabled']."</option>\n";
-		echo "				<option value='true' ".(($setting["project_events"] == 'true') ? "selected='selected'" : null).">".$text['option-enabled']."</option>\n";
-		echo "			</select><br />\n";
-		echo 			$text['description-project_events']."\n";
-		echo "		</td>\n";
-		echo "	</tr>\n";
-
-		echo "	<tr>\n";
-		echo "		<td class='vncell' valign='top' align='left' nowrap>\n";
-		echo 			$text['label-project_news']."\n";
-		echo "		</td>\n";
-		echo "		<td class='vtable' align='left'>\n";
-		echo "			<select name='project_news' class='formfld' style='width: auto;'>\n";
-		echo "				<option value='false' ".(($setting["project_news"] == 'false') ? "selected='selected'" : null).">".$text['option-disabled']."</option>\n";
-		echo "				<option value='true' ".(($setting["project_news"] == 'true') ? "selected='selected'" : null).">".$text['option-enabled']."</option>\n";
-		echo "			</select><br />\n";
-		echo 			$text['description-project_news']."\n";
-		echo "		</td>\n";
-		echo "	</tr>\n";
-
-		echo "	<input type='hidden' name='project_notification_method' value='email'>\n";
-		/*
-		echo "	<tr>\n";
-		echo "		<td width='30%' class='vncell' valign='top' align='left' nowrap>\n";
-		echo 			$text['label-project_notification_method']."\n";
-		echo "		</td>\n";
-		echo "		<td width='70%' class='vtable' align='left'>\n";
-		echo "			<select name='project_notification_method' class='formfld' style='width: auto;'>\n";
-		echo "				<option value='email' ".(($setting["project_notification_method"] == 'email') ? "selected='selected'" : null).">".$text['option-email']."</option>\n";
-		echo "			</select><br />\n";
-		echo 			$text['description-project_notification_method']."\n";
-		echo "		</td>\n";
-		echo "	</tr>\n";
-		*/
-
-		echo "	<tr>\n";
-		echo "		<td class='vncellreq' valign='top' align='left' nowrap>\n";
-		echo 			$text['label-project_notification_recipient']."\n";
-		echo "		</td>\n";
-		echo "		<td class='vtable' align='left'>\n";
-		echo "			<input class='formfld' type='text' name='project_notification_recipient' maxlength='50' value='".$setting["project_notification_recipient"]."'><br />\n";
-		echo 			$text['description-project_notification_recipient']."\n";
-		echo "		</td>\n";
-		echo "	</tr>\n";
-
-		echo "</table>\n";
-	echo "</div>\n";
-
-	echo "<table cellpadding='0' cellspacing='0' width='100%' border='0'>\n";
-	echo "	<tr>\n";
-	echo "		<td colspan='2' class='vtable' style='padding: 15px;' align='right'>\n";
-	echo "			".$text['message-disclaimer']."\n";
-	echo "			<br /><br />\n";
-	echo "			".$text['message-demographics']." <a href='?demo'>".$text['message-demographics_click_here']."</a>.\n";
-	echo "		</td>\n";
-	echo "	</tr>\n";
-	echo "</table>\n";
-
-	echo "<table cellpadding='0' cellspacing='0' width='100%' border='0'>\n";
-	echo "	<tr>\n";
-	echo "		<td align='right'>\n";
-	echo "			<br>";
-	echo "			<input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
-	echo "		</td>\n";
-	echo "	</tr>";
-
-	echo "</table>\n";
-
-	echo "</form>\n";
-
-// include the footer
-	require_once "resources/footer.php";
+<?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-2012
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+Mark J Crane <[email protected]>
+*/
+
+require_once "root.php";
+require_once "resources/require.php";
+require_once "resources/check_auth.php";
+if (if_group('superadmin')) {
+	//access granted
+}
+else {
+	echo "access denied";
+	exit;
+}
+
+//add multi-lingual support
+	$language = new text;
+	$text = $language->get();
+
+// retrieve software uuid
+	$sql = "select software_uuid, software_url, software_version from v_software";
+	$prep_statement = $db->prepare($sql);
+	if ($prep_statement) {
+		$prep_statement->execute();
+		$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+		foreach ($result as &$row) {
+			$software_uuid = $row["software_uuid"];
+			$software_url = $row["software_url"];
+			$software_version = $row["software_version"];
+			break; // limit to 1 row
+		}
+	}
+	unset($sql, $prep_statement);
+
+	if (count($_REQUEST) > 0) {
+
+		// prepare demographic information **********************************************
+
+			// fusionpbx version
+			$software_ver = $software_version;
+
+			// php version
+			$php_ver = phpversion();
+
+			// webserver name & version
+			$web_server = $_SERVER['SERVER_SOFTWARE'];
+
+			// switch version
+			$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
+			if ($fp) {
+				$switch_result = event_socket_request($fp, 'api version');
+			}
+			$switch_ver = trim($switch_result);
+
+			// database name & version
+			switch ($db_type) {
+				case "pgsql" :	$db_ver_query = "select version() as db_ver;";			break;
+				case "mysql" :	$db_ver_query = "select version() as db_ver;";			break;
+				case "sqlite" :	$db_ver_query = "select sqlite_version() as db_ver;";	break;
+			}
+			$prep_statement = $db->prepare($db_ver_query);
+			if ($prep_statement) {
+				$prep_statement->execute();
+				$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+				foreach ($result as &$row) {
+					$database_version = $row["db_ver"];
+					break; // limit to 1 row
+				}
+			}
+			unset($db_ver_query, $prep_statement);
+			$db_ver = $database_version;
+
+			// operating system name & version
+			$os_platform = PHP_OS;
+			$os_info_1 = php_uname("a");
+			if ($os_platform == "Linux") {
+				$os_info_2 = shell_exec("cat /etc/*{release,version}");
+				$os_info_2 .= shell_exec("lsb_release -d -s");
+			}
+			else if (substr(strtoupper($os_platform), 0, 3) == "WIN") {
+				$os_info_2 = trim(shell_exec("ver"));
+			}
+
+		// **************************************************************************
+
+		// check for demographic only submit
+		if (isset($_GET["demo"])) {
+
+			// update remote server record with new values
+			$url = "https://".$software_url."/app/notifications/notifications_manage.php";
+			$url .= "?demo";
+			$url .= "&id=".$software_uuid;
+			$url .= "&software_ver=".urlencode($software_ver);
+			$url .= "&php_ver=".urlencode($php_ver);
+			$url .= "&web_server=".urlencode($web_server);
+			$url .= "&switch_ver=".urlencode($switch_ver);
+			$url .= "&db_type=".urlencode($db_type);
+			$url .= "&db_ver=".urlencode($db_ver);
+			$url .= "&os_platform=".urlencode($os_platform);
+			$url .= "&os_info_1=".urlencode($os_info_1);
+			$url .= "&os_info_2=".urlencode($os_info_2);
+
+			if (file_get_contents(__FILE__) && ini_get('allow_url_fopen')) {
+				$response = file_get_contents($url);
+			}
+			else if (function_exists('curl_version')) {
+				$curl = curl_init();
+				curl_setopt($curl, CURLOPT_URL, $url);
+				curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
+				$response = curl_exec($curl);
+				curl_close($curl);
+			}
+
+			// parse response
+			$response = json_decode($response, true);
+
+			if ($response['result'] == 'submitted') {
+				// set message
+				$_SESSION["message"] = $text['message-demographics_submitted'];
+			}
+
+			header("Location: notification_edit.php");
+			exit;
+
+		}
+
+		// retrieve submitted values
+		$project_notifications = check_str($_POST["project_notifications"]);
+		$project_security = check_str($_POST["project_security"]);
+		$project_releases = check_str($_POST["project_releases"]);
+		$project_events = check_str($_POST["project_events"]);
+		$project_news = check_str($_POST["project_news"]);
+		$project_notification_method = check_str($_POST["project_notification_method"]);
+		$project_notification_recipient = check_str($_POST["project_notification_recipient"]);
+
+		// get local project notification participation flag
+		$sql = "select project_notifications from v_notifications";
+		$prep_statement = $db->prepare($sql);
+		if ($prep_statement) {
+			$prep_statement->execute();
+			$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+			foreach ($result as &$row) {
+				$current_project_notifications = $row["project_notifications"];
+				break; // limit to 1 row
+			}
+		}
+		unset($sql, $prep_statement);
+
+		// check if remote record should be removed
+		if ($project_notifications == 'false') {
+
+			if ($current_project_notifications == 'true') {
+				// remove remote server record
+				$url = "https://".$software_url."/app/notifications/notifications_manage.php?id=".$software_uuid."&action=delete";
+				if (file_get_contents(__FILE__) && ini_get('allow_url_fopen')) {
+					$response = file_get_contents($url);
+				}
+				else if (function_exists('curl_version')) {
+					$curl = curl_init();
+					curl_setopt($curl, CURLOPT_URL, $url);
+					curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
+					$response = curl_exec($curl);
+					curl_close($curl);
+				}
+
+				// parse response
+				$response = json_decode($response, true);
+
+				if ($response['result'] == 'deleted') {
+					// set local project notification participation flag to false
+					$sql = "update v_notifications set project_notifications = 'false'";
+					$db->exec(check_sql($sql));
+					unset($sql);
+				}
+			}
+			// redirect
+			$_SESSION["message"] = $text['message-update'];
+			header("Location: notification_edit.php");
+			exit;
+		}
+
+		// check for invalid values
+		if ($project_notifications == 'true') {
+			if (
+				($project_notification_method == 'email' && !valid_email($project_notification_recipient)) ||
+				($project_notification_method == 'email' && $project_notification_recipient == '')
+				) {
+					$_SESSION["postback"] = $_POST;
+					$_SESSION["message_mood"] = 'negative';
+					$_SESSION["message"] = $text['message-invalid_recipient'];
+					header("Location: notification_edit.php");
+					exit;
+			}
+		}
+
+		// update remote server record with new values
+		$url = "https://".$software_url."/app/notifications/notifications_manage.php";
+		$url .= "?id=".$software_uuid;
+		$url .= "&security=".$project_security;
+		$url .= "&releases=".$project_releases;
+		$url .= "&events=".$project_events;
+		$url .= "&news=".$project_news;
+		$url .= "&method=".$project_notification_method;
+		$url .= "&recipient=".urlencode($project_notification_recipient);
+		$url .= "&software_ver=".urlencode($software_ver);
+		$url .= "&php_ver=".urlencode($php_ver);
+		$url .= "&web_server=".urlencode($web_server);
+		$url .= "&switch_ver=".urlencode($switch_ver);
+		$url .= "&db_type=".urlencode($db_type);
+		$url .= "&db_ver=".urlencode($db_ver);
+		$url .= "&os_platform=".urlencode($os_platform);
+		$url .= "&os_info_1=".urlencode($os_info_1);
+		$url .= "&os_info_2=".urlencode($os_info_2);
+
+		if (file_get_contents(__FILE__) && ini_get('allow_url_fopen')) {
+			$response = file_get_contents($url);
+		}
+		else if (function_exists('curl_version')) {
+			$curl = curl_init();
+			curl_setopt($curl, CURLOPT_URL, $url);
+			curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
+			$response = curl_exec($curl);
+			curl_close($curl);
+		}
+
+		// parse response
+		$response = json_decode($response, true);
+
+		if ($response['result'] == 'updated' || $response['result'] == 'inserted') {
+			// set local project notification participation flag to true
+			$sql = "update v_notifications set project_notifications = 'true'";
+			$db->exec(check_sql($sql));
+			unset($sql);
+			// set message
+			$_SESSION["message"] = $text['message-update'];
+			if (
+				$project_security == 'false' &&
+				$project_releases == 'false' &&
+				$project_events == 'false' &&
+				$project_news == 'false'
+				) {
+				$_SESSION["message_mood"] = 'alert';
+				$_SESSION["message"] = $_SESSION["message"]." - ".$text['message-no_channels'];
+			}
+			// redirect
+			header("Location: notification_edit.php");
+			exit;
+		}
+
+	}
+
+// check postback session
+	if (!isset($_SESSION["postback"])) {
+
+		// check local project notification participation flag
+		$sql = "select project_notifications from v_notifications";
+		$prep_statement = $db->prepare($sql);
+		if ($prep_statement) {
+			$prep_statement->execute();
+			$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+			foreach ($result as &$row) {
+				$setting["project_notifications"] = $row["project_notifications"];
+				break; // limit to 1 row
+			}
+		}
+		unset($sql, $prep_statement);
+
+		// if participation enabled
+		if ($setting["project_notifications"] == 'true') {
+
+			// get current project notification preferences
+			$url = "https://".$software_url."/app/notifications/notifications_manage.php?id=".$software_uuid;
+			if (file_get_contents(__FILE__) && ini_get('allow_url_fopen')) {
+				$response = file_get_contents($url);
+			}
+			else if (function_exists('curl_version')) {
+				$curl = curl_init();
+				curl_setopt($curl, CURLOPT_URL, $url);
+				curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
+				$response = curl_exec($curl);
+				curl_close($curl);
+			}
+
+			// parse response
+			$setting = json_decode($response, true);
+			$setting["project_notifications"] = 'true';
+		}
+
+	}
+	else {
+
+		// load postback variables
+		$setting = fix_postback($_SESSION["postback"]);
+		unset($_SESSION["postback"]);
+
+	}
+
+require_once "resources/header.php";
+$document['title'] = $text['title-notifications'];
+
+// show the content
+	echo "<form method='post' name='frm' action=''>\n";
+	echo "<table cellpadding='0' cellspacing='0' width='100%' border='0'>\n";
+	echo "	<tr>\n";
+	echo "		<td align='left' nowrap='nowrap'><b>".$text['header-notifications']."</b><br><br></td>\n";
+	echo "		<td align='right'>";
+	echo "			<input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
+	echo "			<br><br>";
+	echo "		</td>\n";
+	echo "	</tr>\n";
+	echo "	<tr>\n";
+	echo "		<td align='left' colspan='2'>\n";
+	echo "			".$text['description-notifications']."<br /><br />\n";
+	echo "		</td>\n";
+	echo "	</tr>\n";
+
+	echo "	<tr>\n";
+	echo "		<td width='30%' class='vncellreq' valign='top' align='left' nowrap>\n";
+	echo 			$text['label-project_notifications']."\n";
+	echo "		</td>\n";
+	echo "		<td width='70%' class='vtable' align='left'>\n";
+	echo "			<select name='project_notifications' class='formfld' style='width: auto;' onchange=\"$('#notification_channels').slideToggle();\">\n";
+	echo "				<option value='false' ".(($setting["project_notifications"] == 'false') ? "selected='selected'" : null).">".$text['option-disabled']."</option>\n";
+	echo "				<option value='true' ".(($setting["project_notifications"] == 'true') ? "selected='selected'" : null).">".$text['option-enabled']."</option>\n";
+	echo "			</select><br />\n";
+	echo 			$text['description-project_notifications']."\n";
+	echo "		</td>\n";
+	echo "	</tr>\n";
+
+	echo "</table>\n";
+
+	echo "<div id='notification_channels' ".(($setting["project_notifications"] != 'true') ? "style='display: none;'" : null).">\n";
+		echo "<table cellpadding='0' cellspacing='0' width='100%' border='0'>\n";
+
+		echo "	<tr>\n";
+		echo "		<td width='30%' class='vncell' valign='top' align='left' nowrap>\n";
+		echo 			$text['label-project_security']."\n";
+		echo "		</td>\n";
+		echo "		<td width='70%' class='vtable' align='left'>\n";
+		echo "			<select name='project_security' class='formfld' style='width: auto;'>\n";
+		echo "				<option value='false' ".(($setting["project_security"] == 'false') ? "selected='selected'" : null).">".$text['option-disabled']."</option>\n";
+		echo "				<option value='true' ".(($setting["project_security"] == 'true') ? "selected='selected'" : null).">".$text['option-enabled']."</option>\n";
+		echo "			</select><br />\n";
+		echo 			$text['description-project_security']."\n";
+		echo "		</td>\n";
+		echo "	</tr>\n";
+
+		echo "	<tr>\n";
+		echo "		<td class='vncell' valign='top' align='left' nowrap>\n";
+		echo 			$text['label-project_releases']."\n";
+		echo "		</td>\n";
+		echo "		<td class='vtable' align='left'>\n";
+		echo "			<select name='project_releases' class='formfld' style='width: auto;'>\n";
+		echo "				<option value='false' ".(($setting["project_releases"] == 'false') ? "selected='selected'" : null).">".$text['option-disabled']."</option>\n";
+		echo "				<option value='true' ".(($setting["project_releases"] == 'true') ? "selected='selected'" : null).">".$text['option-enabled']."</option>\n";
+		echo "			</select><br />\n";
+		echo 			$text['description-project_releases']."\n";
+		echo "		</td>\n";
+		echo "	</tr>\n";
+
+		echo "	<tr>\n";
+		echo "		<td width='30%' class='vncell' valign='top' align='left' nowrap>\n";
+		echo 			$text['label-project_events']."\n";
+		echo "		</td>\n";
+		echo "		<td width='70%' class='vtable' align='left'>\n";
+		echo "			<select name='project_events' class='formfld' style='width: auto;'>\n";
+		echo "				<option value='false' ".(($setting["project_events"] == 'false') ? "selected='selected'" : null).">".$text['option-disabled']."</option>\n";
+		echo "				<option value='true' ".(($setting["project_events"] == 'true') ? "selected='selected'" : null).">".$text['option-enabled']."</option>\n";
+		echo "			</select><br />\n";
+		echo 			$text['description-project_events']."\n";
+		echo "		</td>\n";
+		echo "	</tr>\n";
+
+		echo "	<tr>\n";
+		echo "		<td class='vncell' valign='top' align='left' nowrap>\n";
+		echo 			$text['label-project_news']."\n";
+		echo "		</td>\n";
+		echo "		<td class='vtable' align='left'>\n";
+		echo "			<select name='project_news' class='formfld' style='width: auto;'>\n";
+		echo "				<option value='false' ".(($setting["project_news"] == 'false') ? "selected='selected'" : null).">".$text['option-disabled']."</option>\n";
+		echo "				<option value='true' ".(($setting["project_news"] == 'true') ? "selected='selected'" : null).">".$text['option-enabled']."</option>\n";
+		echo "			</select><br />\n";
+		echo 			$text['description-project_news']."\n";
+		echo "		</td>\n";
+		echo "	</tr>\n";
+
+		echo "	<input type='hidden' name='project_notification_method' value='email'>\n";
+		/*
+		echo "	<tr>\n";
+		echo "		<td width='30%' class='vncell' valign='top' align='left' nowrap>\n";
+		echo 			$text['label-project_notification_method']."\n";
+		echo "		</td>\n";
+		echo "		<td width='70%' class='vtable' align='left'>\n";
+		echo "			<select name='project_notification_method' class='formfld' style='width: auto;'>\n";
+		echo "				<option value='email' ".(($setting["project_notification_method"] == 'email') ? "selected='selected'" : null).">".$text['option-email']."</option>\n";
+		echo "			</select><br />\n";
+		echo 			$text['description-project_notification_method']."\n";
+		echo "		</td>\n";
+		echo "	</tr>\n";
+		*/
+
+		echo "	<tr>\n";
+		echo "		<td class='vncellreq' valign='top' align='left' nowrap>\n";
+		echo 			$text['label-project_notification_recipient']."\n";
+		echo "		</td>\n";
+		echo "		<td class='vtable' align='left'>\n";
+		echo "			<input class='formfld' type='text' name='project_notification_recipient' maxlength='50' value='".$setting["project_notification_recipient"]."'><br />\n";
+		echo 			$text['description-project_notification_recipient']."\n";
+		echo "		</td>\n";
+		echo "	</tr>\n";
+
+		echo "</table>\n";
+	echo "</div>\n";
+
+	echo "<table cellpadding='0' cellspacing='0' width='100%' border='0'>\n";
+	echo "	<tr>\n";
+	echo "		<td colspan='2' class='vtable' style='padding: 15px;' align='right'>\n";
+	echo "			".$text['message-disclaimer']."\n";
+	echo "			<br /><br />\n";
+	echo "			".$text['message-demographics']." <a href='?demo'>".$text['message-demographics_click_here']."</a>.\n";
+	echo "		</td>\n";
+	echo "	</tr>\n";
+	echo "</table>\n";
+
+	echo "<table cellpadding='0' cellspacing='0' width='100%' border='0'>\n";
+	echo "	<tr>\n";
+	echo "		<td align='right'>\n";
+	echo "			<br>";
+	echo "			<input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
+	echo "		</td>\n";
+	echo "	</tr>";
+
+	echo "</table>\n";
+
+	echo "</form>\n";
+
+// include the footer
+	require_once "resources/footer.php";
 ?>

+ 248 - 248
core/upgrade/index.php

@@ -1,249 +1,249 @@
-<?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-2015
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-
-set_time_limit(600); //sec (10 min)
-
-include "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-
-//check the permission
-if (
-	!permission_exists('upgrade_source') &&
-	!permission_exists('upgrade_schema') &&
-	!permission_exists('upgrade_apps') &&
-	!permission_exists('menu_restore') &&
-	!permission_exists('group_edit')
-	) {
-	echo "access denied";
-	exit;
-}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-if (sizeof($_POST) > 0) {
-
-	$do = $_POST['do'];
-
-	// run source update
-	if ($do["source"] && permission_exists("upgrade_source") && !is_dir("/usr/share/examples/fusionpbx")) {
-		chdir($_SERVER["PROJECT_ROOT"]);
-		exec("git pull", $response_source_update);
-		$update_failed = true;
-		if (sizeof($response_source_update) > 0) {
-			$_SESSION["response_source_update"] = $response_source_update;
-			foreach ($response_source_update as $response_line) {
-				if (substr_count($response_line, "Updating ") > 0 || substr_count($response_line, "Already up-to-date.") > 0) {
-					$update_failed = false;
-				}
-			}
-		}
-		if ($update_failed) {
-			$_SESSION["message_delay"] = 3500;
-			$_SESSION["message_mood"] = 'negative';
-			$response_message = $text['message-upgrade_source_failed'];
-		}
-	}
-
-	// load an array of the database schema and compare it with the active database
-	if ($do["schema"] && permission_exists("upgrade_schema")) {
-		$response_message = $text['message-upgrade_schema'];
-
-		$upgrade_data_types = check_str($do["data_types"]);
-		require_once "resources/classes/schema.php";
-		$obj = new schema();
-		$_SESSION["schema"]["response"] = $obj->schema("html");
-	}
-
-	// process the apps defaults
-	if ($do["apps"] && permission_exists("upgrade_apps")) {
-		$response_message = $text['message-upgrade_apps'];
-
-		require_once "resources/classes/domains.php";
-		$domain = new domains;
-		$domain->upgrade();
-	}
-
-	// restore defaults of the selected menu
-	if ($do["menu"] && permission_exists("menu_restore")) {
-		$sel_menu = explode('|', check_str($_POST["sel_menu"]));
-		$menu_uuid = $sel_menu[0];
-		$menu_language = $sel_menu[1];
-		$included = true;
-		require_once("core/menu/menu_restore_default.php");
-		unset($sel_menu);
-		$response_message = $text['message-upgrade_menu'];
-	}
-
-	// restore default permissions
-	if ($do["permissions"] && permission_exists("group_edit")) {
-		$included = true;
-		require_once("core/users/permissions_default.php");
-		$response_message = "Permission Defaults Restored";
-	}
-
-	if (sizeof($_POST['do']) > 1) {
-		$response_message = $text['message-upgrade'];
-	}
-
-	$_SESSION["message"] = $response_message;
-	header("Location: ".PROJECT_PATH."/core/upgrade/index.php");
-	exit;
-
-} // end if
-
-
-require_once "resources/header.php";
-$document['title'] = $text['title-upgrade'];
-
-echo "<b>".$text['header-upgrade']."</b>";
-echo "<br><br>";
-echo $text['description-upgrade'];
-echo "<br><br>";
-
-echo "<form name='frm' method='post' action=''>\n";
-
-if (permission_exists("upgrade_source") && !is_dir("/usr/share/examples/fusionpbx") && is_writeable($_SERVER["PROJECT_ROOT"]."/.git")) {
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	echo "	<td width='30%' class='vncell'>\n";
-	echo "		".$text['label-upgrade_source'];
-	echo "	</td>\n";
-	echo "	<td width='70%' class='vtable' style='height: 50px;'>\n";
-	echo "		<label for='do_source'><input type='checkbox' name='do[source]' id='do_source' value='1'> ".$text['description-upgrade_source']."</label>\n";
-	echo "	</td>\n";
-	echo "</tr>\n";
-	echo "</table>\n";
-}
-
-if (permission_exists("upgrade_schema")) {
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	echo "	<td width='30%' class='vncell'>\n";
-	echo "		".$text['label-upgrade_schema'];
-	echo "	</td>\n";
-	echo "	<td width='70%' class='vtable' style='height: 50px;'>\n";
-	echo "		<label for='do_schema'><input type='checkbox' name='do[schema]' id='do_schema' value='1' onchange=\"$('#do_data_types').prop('checked', false); $('#tr_data_types').slideToggle('fast');\"> ".$text['description-upgrade_schema']."</label>\n";
-	echo "	</td>\n";
-	echo "</tr>\n";
-	echo "</table>\n";
-
-	echo "<div id='tr_data_types' style='display: none;'>\n";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	echo "	<td width='30%' class='vncell'>\n";
-	echo "		".$text['label-upgrade_data_types'];
-	echo "	</td>\n";
-	echo "	<td width='70%' class='vtable' style='height: 50px;'>\n";
-	echo "		<label for='do_data_types'><input type='checkbox' name='do[data_types]' id='do_data_types' value='true'> ".$text['description-upgrade_data_types']."</label>\n";
-	echo "	</td>\n";
-	echo "</tr>\n";
-	echo "</table>\n";
-	echo "</div>\n";
-}
-
-if (permission_exists("upgrade_apps")) {
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	echo "	<td width='30%' class='vncell'>\n";
-	echo "		".$text['label-upgrade_apps'];
-	echo "	</td>\n";
-	echo "	<td width='70%' class='vtable' style='height: 50px;'>\n";
-	echo "		<label for='do_apps'><input type='checkbox' name='do[apps]' id='do_apps' value='1'> ".$text['description-upgrade_apps']."</label>\n";
-	echo "	</td>\n";
-	echo "</tr>\n";
-	echo "</table>\n";
-}
-
-if (permission_exists("menu_restore")) {
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	echo "	<td width='30%' class='vncell'>\n";
-	echo "		".$text['label-upgrade_menu'];
-	echo "	</td>\n";
-	echo "	<td width='70%' class='vtable' style='height: 50px;'>\n";
-	echo "		<label for='do_menu'>";
-	echo 			"<input type='checkbox' name='do[menu]' id='do_menu' value='1' onchange=\"$('#sel_menu').fadeToggle('fast');\">";
-	echo 			"<select name='sel_menu' id='sel_menu' class='formfld' style='display: none; vertical-align: middle; margin-left: 5px;'>";
-	$sql = "select * from v_menus ";
-	$prep_statement = $db->prepare(check_sql($sql));
-	$prep_statement->execute();
-	$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-	foreach ($result as &$row) {
-		echo "<option value='".$row["menu_uuid"]."|".$row["menu_language"]."'>".$row["menu_name"]."</option>";
-	}
-	unset ($sql, $result, $prep_statement);
-	echo 			"</select>";
-	echo 			" ".$text['description-upgrade_menu'];
-	echo 		"</label>\n";
-	echo "	</td>\n";
-	echo "</tr>\n";
-	echo "</table>\n";
-}
-
-if (permission_exists("group_edit")) {
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	echo "	<td width='30%' class='vncell'>\n";
-	echo "		".$text['label-upgrade_permissions'];
-	echo "	</td>\n";
-	echo "	<td width='70%' class='vtable' style='height: 50px;'>\n";
-	echo "		<label for='do_permissions'><input type='checkbox' name='do[permissions]' id='do_permissions' value='1'> ".$text['description-upgrade_permissions']."</label>\n";
-	echo "	</td>\n";
-	echo "</tr>\n";
-	echo "</table>\n";
-}
-
-echo "<br>";
-echo "<div style='text-align: right;'><input type='submit' class='btn' value='".$text['button-upgrade_execute']."'></div>";
-echo "<br><br>";
-echo "</form>\n";
-
-// output result of source update
-if (sizeof($_SESSION["response_source_update"]) > 0) {
-	echo "<br />";
-	echo "<b>".$text['header-source_update_results']."</b>";
-	echo "<br /><br />";
-	echo "<pre>";
-	echo implode("\n", $_SESSION["response_source_update"]);
-	echo "</pre>";
-	echo "<br /><br />";
-	unset($_SESSION["response_source_update"]);
-}
-
-// output result of upgrade schema
-if ($_SESSION["schema"]["response"] != '') {
-	echo "<br />";
-	echo "<b>".$text['header-upgrade_schema_results']."</b>";
-	echo "<br /><br />";
-	echo $_SESSION["schema"]["response"];
-	unset($_SESSION["schema"]["response"]);
-}
-
-require_once "resources/footer.php";
+<?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-2015
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
+
+set_time_limit(600); //sec (10 min)
+
+include "root.php";
+require_once "resources/require.php";
+require_once "resources/check_auth.php";
+
+//check the permission
+if (
+	!permission_exists('upgrade_source') &&
+	!permission_exists('upgrade_schema') &&
+	!permission_exists('upgrade_apps') &&
+	!permission_exists('menu_restore') &&
+	!permission_exists('group_edit')
+	) {
+	echo "access denied";
+	exit;
+}
+
+//add multi-lingual support
+	$language = new text;
+	$text = $language->get();
+
+if (sizeof($_POST) > 0) {
+
+	$do = $_POST['do'];
+
+	// run source update
+	if ($do["source"] && permission_exists("upgrade_source") && !is_dir("/usr/share/examples/fusionpbx")) {
+		chdir($_SERVER["PROJECT_ROOT"]);
+		exec("git pull", $response_source_update);
+		$update_failed = true;
+		if (sizeof($response_source_update) > 0) {
+			$_SESSION["response_source_update"] = $response_source_update;
+			foreach ($response_source_update as $response_line) {
+				if (substr_count($response_line, "Updating ") > 0 || substr_count($response_line, "Already up-to-date.") > 0) {
+					$update_failed = false;
+				}
+			}
+		}
+		if ($update_failed) {
+			$_SESSION["message_delay"] = 3500;
+			$_SESSION["message_mood"] = 'negative';
+			$response_message = $text['message-upgrade_source_failed'];
+		}
+	}
+
+	// load an array of the database schema and compare it with the active database
+	if ($do["schema"] && permission_exists("upgrade_schema")) {
+		$response_message = $text['message-upgrade_schema'];
+
+		$upgrade_data_types = check_str($do["data_types"]);
+		require_once "resources/classes/schema.php";
+		$obj = new schema();
+		$_SESSION["schema"]["response"] = $obj->schema("html");
+	}
+
+	// process the apps defaults
+	if ($do["apps"] && permission_exists("upgrade_apps")) {
+		$response_message = $text['message-upgrade_apps'];
+
+		require_once "resources/classes/domains.php";
+		$domain = new domains;
+		$domain->upgrade();
+	}
+
+	// restore defaults of the selected menu
+	if ($do["menu"] && permission_exists("menu_restore")) {
+		$sel_menu = explode('|', check_str($_POST["sel_menu"]));
+		$menu_uuid = $sel_menu[0];
+		$menu_language = $sel_menu[1];
+		$included = true;
+		require_once("core/menu/menu_restore_default.php");
+		unset($sel_menu);
+		$response_message = $text['message-upgrade_menu'];
+	}
+
+	// restore default permissions
+	if ($do["permissions"] && permission_exists("group_edit")) {
+		$included = true;
+		require_once("core/users/permissions_default.php");
+		$response_message = "Permission Defaults Restored";
+	}
+
+	if (sizeof($_POST['do']) > 1) {
+		$response_message = $text['message-upgrade'];
+	}
+
+	$_SESSION["message"] = $response_message;
+	header("Location: ".PROJECT_PATH."/core/upgrade/index.php");
+	exit;
+
+} // end if
+
+
+require_once "resources/header.php";
+$document['title'] = $text['title-upgrade'];
+
+echo "<b>".$text['header-upgrade']."</b>";
+echo "<br><br>";
+echo $text['description-upgrade'];
+echo "<br><br>";
+
+echo "<form name='frm' method='post' action=''>\n";
+
+if (permission_exists("upgrade_source") && !is_dir("/usr/share/examples/fusionpbx") && is_writeable($_SERVER["PROJECT_ROOT"]."/.git")) {
+	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "<tr>\n";
+	echo "	<td width='30%' class='vncell'>\n";
+	echo "		".$text['label-upgrade_source'];
+	echo "	</td>\n";
+	echo "	<td width='70%' class='vtable' style='height: 50px;'>\n";
+	echo "		<label for='do_source'><input type='checkbox' name='do[source]' id='do_source' value='1'> ".$text['description-upgrade_source']."</label>\n";
+	echo "	</td>\n";
+	echo "</tr>\n";
+	echo "</table>\n";
+}
+
+if (permission_exists("upgrade_schema")) {
+	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "<tr>\n";
+	echo "	<td width='30%' class='vncell'>\n";
+	echo "		".$text['label-upgrade_schema'];
+	echo "	</td>\n";
+	echo "	<td width='70%' class='vtable' style='height: 50px;'>\n";
+	echo "		<label for='do_schema'><input type='checkbox' name='do[schema]' id='do_schema' value='1' onchange=\"$('#do_data_types').prop('checked', false); $('#tr_data_types').slideToggle('fast');\"> ".$text['description-upgrade_schema']."</label>\n";
+	echo "	</td>\n";
+	echo "</tr>\n";
+	echo "</table>\n";
+
+	echo "<div id='tr_data_types' style='display: none;'>\n";
+	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "<tr>\n";
+	echo "	<td width='30%' class='vncell'>\n";
+	echo "		".$text['label-upgrade_data_types'];
+	echo "	</td>\n";
+	echo "	<td width='70%' class='vtable' style='height: 50px;'>\n";
+	echo "		<label for='do_data_types'><input type='checkbox' name='do[data_types]' id='do_data_types' value='true'> ".$text['description-upgrade_data_types']."</label>\n";
+	echo "	</td>\n";
+	echo "</tr>\n";
+	echo "</table>\n";
+	echo "</div>\n";
+}
+
+if (permission_exists("upgrade_apps")) {
+	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "<tr>\n";
+	echo "	<td width='30%' class='vncell'>\n";
+	echo "		".$text['label-upgrade_apps'];
+	echo "	</td>\n";
+	echo "	<td width='70%' class='vtable' style='height: 50px;'>\n";
+	echo "		<label for='do_apps'><input type='checkbox' name='do[apps]' id='do_apps' value='1'> ".$text['description-upgrade_apps']."</label>\n";
+	echo "	</td>\n";
+	echo "</tr>\n";
+	echo "</table>\n";
+}
+
+if (permission_exists("menu_restore")) {
+	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "<tr>\n";
+	echo "	<td width='30%' class='vncell'>\n";
+	echo "		".$text['label-upgrade_menu'];
+	echo "	</td>\n";
+	echo "	<td width='70%' class='vtable' style='height: 50px;'>\n";
+	echo "		<label for='do_menu'>";
+	echo 			"<input type='checkbox' name='do[menu]' id='do_menu' value='1' onchange=\"$('#sel_menu').fadeToggle('fast');\">";
+	echo 			"<select name='sel_menu' id='sel_menu' class='formfld' style='display: none; vertical-align: middle; margin-left: 5px;'>";
+	$sql = "select * from v_menus ";
+	$prep_statement = $db->prepare(check_sql($sql));
+	$prep_statement->execute();
+	$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+	foreach ($result as &$row) {
+		echo "<option value='".$row["menu_uuid"]."|".$row["menu_language"]."'>".$row["menu_name"]."</option>";
+	}
+	unset ($sql, $result, $prep_statement);
+	echo 			"</select>";
+	echo 			" ".$text['description-upgrade_menu'];
+	echo 		"</label>\n";
+	echo "	</td>\n";
+	echo "</tr>\n";
+	echo "</table>\n";
+}
+
+if (permission_exists("group_edit")) {
+	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "<tr>\n";
+	echo "	<td width='30%' class='vncell'>\n";
+	echo "		".$text['label-upgrade_permissions'];
+	echo "	</td>\n";
+	echo "	<td width='70%' class='vtable' style='height: 50px;'>\n";
+	echo "		<label for='do_permissions'><input type='checkbox' name='do[permissions]' id='do_permissions' value='1'> ".$text['description-upgrade_permissions']."</label>\n";
+	echo "	</td>\n";
+	echo "</tr>\n";
+	echo "</table>\n";
+}
+
+echo "<br>";
+echo "<div style='text-align: right;'><input type='submit' class='btn' value='".$text['button-upgrade_execute']."'></div>";
+echo "<br><br>";
+echo "</form>\n";
+
+// output result of source update
+if (sizeof($_SESSION["response_source_update"]) > 0) {
+	echo "<br />";
+	echo "<b>".$text['header-source_update_results']."</b>";
+	echo "<br /><br />";
+	echo "<pre>";
+	echo implode("\n", $_SESSION["response_source_update"]);
+	echo "</pre>";
+	echo "<br /><br />";
+	unset($_SESSION["response_source_update"]);
+}
+
+// output result of upgrade schema
+if ($_SESSION["schema"]["response"] != '') {
+	echo "<br />";
+	echo "<b>".$text['header-upgrade_schema_results']."</b>";
+	echo "<br /><br />";
+	echo $_SESSION["schema"]["response"];
+	unset($_SESSION["schema"]["response"]);
+}
+
+require_once "resources/footer.php";
 ?>

+ 1259 - 1259
core/user_settings/app_languages.php

@@ -1,1260 +1,1260 @@
-<?php
-
-$text['title-user_dashboard']['en-us'] = "Dashboard";
-$text['title-user_dashboard']['es-cl'] = "Dashboard Usuario";
-$text['title-user_dashboard']['pt-pt'] = "Painel de Controle do Usuário";
-$text['title-user_dashboard']['fr-fr'] = "Tableau de bord de l'utilisateur";
-$text['title-user_dashboard']['pt-br'] = "Painel de Controle de Usuário";
-$text['title-user_dashboard']['pl'] = "Panel użytkowników";
-$text['title-user_dashboard']['he'] = "ממשק משתמש";
-$text['title-user_dashboard']['uk'] = "Панель користувача";
-$text['title-user_dashboard']['sv-se'] = "Användarpanel";
-$text['title-user_dashboard']['de-at'] = "Benutzerübersicht";
-$text['title-user_dashboard']['ro'] = "Panou control utilizator";
-$text['title-user_dashboard']['fa'] = "";
-$text['title-user_dashboard']['ar-eg'] = "الصفحه الرئيسيه للمستخدم";
-
-$text['title']['en-us'] = "Account Settings";
-$text['title']['es-cl'] = "Configuración de Cuenta";
-$text['title']['pt-pt'] = "Configurações de Conta";
-$text['title']['fr-fr'] = "Personalisation du compte";
-$text['title']['pt-br'] = "Configurações da Conta";
-$text['title']['pl'] = "Ustawienia konta";
-$text['title']['he'] = "הגדרת חשבון";
-$text['title']['uk'] = "Параметри облікового запису";
-$text['title']['sv-se'] = "Kontoinställningar";
-$text['title']['de-at'] = "Kontoeinstellungen";
-$text['title']['ro'] = "Setări cont";
-$text['title']['fa'] = "";
-$text['title']['ar-eg'] = "إعدادات الحساب";
-
-$text['table2-title']['en-us'] = "Additional Info";
-$text['table2-title']['es-cl'] = "Información Adicional";
-$text['table2-title']['pt-pt'] = "Informações Adicionais";
-$text['table2-title']['fr-fr'] = "Informations aditionnelles";
-$text['table2-title']['pt-br'] = "Informações Adicionais";
-$text['table2-title']['pl'] = "Informacje dodatkowe ";
-$text['table2-title']['he'] = "פרטים נוספים";
-$text['table2-title']['uk'] = "Додаткова інформація";
-$text['table2-title']['sv-se'] = "Ytterligare Information";
-$text['table2-title']['de-at'] = "Zusätzliche Informationen";
-$text['table2-title']['ro'] = "Informații adiționale";
-$text['table2-title']['fa'] = "";
-$text['table2-title']['ar-eg'] = "معلومات اضافيه";
-
-$text['table-tools']['en-us'] = "Tools";
-$text['table-tools']['es-cl'] = "Herramientas";
-$text['table-tools']['pt-pt'] = "Ferramentas";
-$text['table-tools']['fr-fr'] = "Outils";
-$text['table-tools']['pt-br'] = "Ferramentas";
-$text['table-tools']['pl'] = "Narzędzia";
-$text['table-tools']['he'] = "כלים";
-$text['table-tools']['uk'] = "Налаштування";
-$text['table-tools']['sv-se'] = "Verktyg";
-$text['table-tools']['de-at'] = "Funktionen";
-$text['table-tools']['ro'] = "Utilitare";
-$text['table-tools']['fa'] = "ابزارها";
-$text['table-tools']['ar-eg'] = "الادوات";
-
-$text['table-title']['en-us'] = "User Info";
-$text['table-title']['es-cl'] = "Información de Usuario";
-$text['table-title']['pt-pt'] = "Informações de Utilizador";
-$text['table-title']['fr-fr'] = "Informations de l'usager";
-$text['table-title']['pt-br'] = "Informações do Usuário";
-$text['table-title']['pl'] = "Informacje o użytkowniku";
-$text['table-title']['he'] = "פרטי משתמש";
-$text['table-title']['uk'] = "Інформація про користувача";
-$text['table-title']['sv-se'] = "Användarinformation";
-$text['table-title']['de-at'] = "Benutzerinformationen";
-$text['table-title']['ro'] = "Informații Utilizator";
-$text['table-title']['fa'] = "اطلاعات کاربر";
-$text['table-title']['ar-eg'] = "بيانات المستخدم";
-
-$text['table-extension']['en-us'] = "Extension";
-$text['table-extension']['es-cl'] = "Extensión";
-$text['table-extension']['pt-pt'] = "Extensão";
-$text['table-extension']['fr-fr'] = "Extension";
-$text['table-extension']['pt-br'] = "Ramal";
-$text['table-extension']['pl'] = "Numer wewnętrzny";
-$text['table-extension']['he'] = "שלוחה";
-$text['table-extension']['uk'] = "Розширення (Extention)";
-$text['table-extension']['sv-se'] = "Anknytning";
-$text['table-extension']['de-at'] = "Durchwahl";
-$text['table-extension']['ro'] = "Extensie";
-$text['table-extension']['fa'] = "";
-$text['table-extension']['ar-eg'] = "رقم داخلي";
-
-$text['table-description']['en-us'] = "Description";
-$text['table-description']['es-cl'] = "Descripción";
-$text['table-description']['pt-pt'] = "Descrição";
-$text['table-description']['fr-fr'] = "Description";
-$text['table-description']['pt-br'] = "Descrição";
-$text['table-description']['pl'] = "Opis";
-$text['table-description']['he'] = "תיאור";
-$text['table-description']['uk'] = "Опис";
-$text['table-description']['sv-se'] = "Beskrivning";
-$text['table-description']['de-at'] = "Beschreibung";
-$text['table-description']['ro'] = "Descriere";
-$text['table-description']['fa'] = "";
-$text['table-description']['ar-eg'] = "الوصف";
-
-$text['message-reset_link_sent']['en-us'] = "Password Reset Link Sent";
-$text['message-reset_link_sent']['es-cl'] = "Restablecer Contraseña de Conexión Enviados";
-$text['message-reset_link_sent']['pt-pt'] = "Password Reset Link Enviado";
-$text['message-reset_link_sent']['fr-fr'] = "Lien de réinitialisation de mot de passe envoyé";
-$text['message-reset_link_sent']['pt-br'] = "Link para redefinir senha enviado";
-$text['message-reset_link_sent']['pl'] = "Link do resetowania hasla zostal wyslany";
-$text['message-reset_link_sent']['he'] = "קישור לאיפוס סיסמה נשלח";
-$text['message-reset_link_sent']['uk'] = "Посилання на скидання пароля відправлено";
-$text['message-reset_link_sent']['sv-se'] = "Återställnings Länk för Lösenord Skickat";
-$text['message-reset_link_sent']['de-at'] = "Link zum Zurücksetzen des Passworts gesendet";
-$text['message-reset_link_sent']['ro'] = "Link pentru resetare parolă trimis";
-$text['message-reset_link_sent']['fa'] = "";
-$text['message-reset_link_sent']['ar-eg'] = "تم ارسال رابط اعادة تعيين كلمة السر";
-
-$text['message-password_reset']['en-us'] = "Password Reset";
-$text['message-password_reset']['es-cl'] = "Restablecer Contraseña";
-$text['message-password_reset']['pt-pt'] = "Password Reset";
-$text['message-password_reset']['fr-fr'] = "Réinitialiser votre mot de passe";
-$text['message-password_reset']['pt-br'] = "Redefinir Senha";
-$text['message-password_reset']['pl'] = "Resetowanie hasła";
-$text['message-password_reset']['he'] = "איפוס סיסמה";
-$text['message-password_reset']['uk'] = "Скинути пароль";
-$text['message-password_reset']['sv-se'] = "Återställning Av Lösenord";
-$text['message-password_reset']['de-at'] = "Passwort zurücksetzen";
-$text['message-password_reset']['ro'] = "Resetare parolă";
-$text['message-password_reset']['fa'] = "";
-$text['message-password_reset']['ar-eg'] = "اعادة تعيين كلمة السر";
-
-$text['message-invalid_username_mismatch_passwords']['en-us'] = "Invalid Username and/or Mismatched Passwords";
-$text['message-invalid_username_mismatch_passwords']['es-cl'] = "Nombre de usuario válido y/o contraseñas no coincidentes";
-$text['message-invalid_username_mismatch_passwords']['pt-pt'] = "Nome de usuário inválido e/ou palavras-passe não correspondentes";
-$text['message-invalid_username_mismatch_passwords']['fr-fr'] = "Nom d'utilisateur invalide et/ou les mots de passe ne correspondent pas";
-$text['message-invalid_username_mismatch_passwords']['pt-br'] = "Nome de usuário inválido e/ou senha incorreta";
-$text['message-invalid_username_mismatch_passwords']['pl'] = "Nieprawidłowa nazwa użytkownika lub/i niepoprawne hasła";
-$text['message-invalid_username_mismatch_passwords']['he'] = "שם משתמש או סיסמה  לא נכונים";
-$text['message-invalid_username_mismatch_passwords']['uk'] = "Неправильні ім’я користувача та/або пароль";
-$text['message-invalid_username_mismatch_passwords']['sv-se'] = "Ogiltig Användarnamn och / eller Felaktigt Lösenord";
-$text['message-invalid_username_mismatch_passwords']['de-at'] = "Falscher Benutzername und/oder Nichtübereinstimmung der Passwörter";
-$text['message-invalid_username_mismatch_passwords']['ro'] = "Nume utilizator invalid si/sau nepotrivire parole";
-$text['message-invalid_username_mismatch_passwords']['fa'] = "";
-$text['message-invalid_username_mismatch_passwords']['ar-eg'] = "خطا في اسم المسخدم او كلمة السر";
-
-$text['message-invalid_email']['en-us'] = "Invalid Email Address";
-$text['message-invalid_email']['es-cl'] = "Dirección no válida de correo electrónico";
-$text['message-invalid_email']['pt-pt'] = "Endereço inválido Email";
-$text['message-invalid_email']['fr-fr'] = "Adresse email invalide";
-$text['message-invalid_email']['pt-br'] = "Endereço de E-mail Inválido";
-$text['message-invalid_email']['pl'] = "Nieprawidłowy adres email";
-$text['message-invalid_email']['he'] = "כתובת דואר מייל לא תקינה";
-$text['message-invalid_email']['uk'] = "Некоректна адреса E-Mail";
-$text['message-invalid_email']['sv-se'] = "Ogiltig E-postadress";
-$text['message-invalid_email']['de-at'] = "Ungültige E-Mail-Adresse";
-$text['message-invalid_email']['ro'] = "Adresă Email invalidă";
-$text['message-invalid_email']['fa'] = "";
-$text['message-invalid_email']['ar-eg'] = "البريد الإلكتروني غير صحيح";
-
-$text['login-message_dismiss']['en-us'] = "Dismiss";
-$text['login-message_dismiss']['es-cl'] = "Despedir";
-$text['login-message_dismiss']['pt-pt'] = "Demitir";
-$text['login-message_dismiss']['fr-fr'] = "Rejeter";
-$text['login-message_dismiss']['pt-br'] = "Descartar";
-$text['login-message_dismiss']['pl'] = "Odrzuć";
-$text['login-message_dismiss']['he'] = "משוחרר";
-$text['login-message_dismiss']['uk'] = "Звільнити";
-$text['login-message_dismiss']['sv-se'] = "Avvisa";
-$text['login-message_dismiss']['de-at'] = "Verwerfen";
-$text['login-message_dismiss']['ro'] = "Renunță";
-$text['login-message_dismiss']['fa'] = "";
-$text['login-message_dismiss']['ar-eg'] = "تجاهل";
-
-$text['login-message_attention']['en-us'] = "Attention!";
-$text['login-message_attention']['es-cl'] = "¡Atención!";
-$text['login-message_attention']['pt-pt'] = "Atenção!";
-$text['login-message_attention']['fr-fr'] = "Attention!";
-$text['login-message_attention']['pt-br'] = "Atenção!";
-$text['login-message_attention']['pl'] = "Uwaga";
-$text['login-message_attention']['he'] = "!שים לב";
-$text['login-message_attention']['uk'] = "Увага!";
-$text['login-message_attention']['sv-se'] = "Observera!";
-$text['login-message_attention']['de-at'] = "Achtung!";
-$text['login-message_attention']['ro'] = "Atenție!";
-$text['login-message_attention']['fa'] = "";
-$text['login-message_attention']['ar-eg'] = "برجاء الملاحظة";
-
-$text['label-welcome']['en-us'] = "Welcome:";
-$text['label-welcome']['es-cl'] = "Bienvenido:";
-$text['label-welcome']['pt-pt'] = "Witamy:";
-$text['label-welcome']['fr-fr'] = "Bienvenue:";
-$text['label-welcome']['pt-br'] = "Bem vinda:";
-$text['label-welcome']['pl'] = "Witamy:";
-$text['label-welcome']['he'] = "ברוך הבא:";
-$text['label-welcome']['uk'] = "Ласкаво просимо:";
-$text['label-welcome']['sv-se'] = "Välkomna:";
-$text['label-welcome']['de-at'] = "Herzlich willkommen:";
-$text['label-welcome']['ro'] = "Bine ati venit:";
-$text['label-welcome']['fa'] = "";
-$text['label-welcome']['ar-eg'] = "أهلا بك:";
-
-$text['label-voicemail']['en-us'] = "Voicemail";
-$text['label-voicemail']['es-cl'] = "Correo de Voz";
-$text['label-voicemail']['pt-pt'] = "Correio de Voz";
-$text['label-voicemail']['fr-fr'] = "Messagerie Vocale";
-$text['label-voicemail']['pt-br'] = "Correio de voz";
-$text['label-voicemail']['pl'] = "Poczta głosowa";
-$text['label-voicemail']['sv-se'] = "Röstbrevlåda";
-$text['label-voicemail']['uk'] = "Голосова пошта";
-$text['label-voicemail']['de-at'] = "Mailbox";
-$text['label-voicemail']['he'] = "תא קולי";
-
-$text['label-view_all']['en-us'] = "View All";
-$text['label-view_all']['es-cl'] = "Mostrar Todos";
-$text['label-view_all']['pt-pt'] = "Mostrar Todos";
-$text['label-view_all']['fr-fr'] = "Tout Montrer";
-$text['label-view_all']['pl'] = "Pokaż wszystkie";
-$text['label-view_all']['uk'] = "Показати всі";
-$text['label-view_all']['sv-se'] = "Visa Allt";
-$text['label-view_all']['ro'] = "";
-$text['label-view_all']['de-at'] = "Alle anzeigen";
-$text['label-view_all']['he'] = "הצג הכל";
-
-$text['label-value']['en-us'] = "Value";
-$text['label-value']['es-cl'] = "Valor";
-$text['label-value']['pt-pt'] = "Valor";
-$text['label-value']['fr-fr'] = "Valeur";
-$text['label-value']['nl-nl'] = "";
-$text['label-value']['pt-br'] = "Valor";
-$text['label-value']['pl'] = "Wartość";
-$text['label-value']['sv-se'] = "Värde";
-$text['label-value']['uk'] = "Значення";
-$text['label-value']['de-at'] = "Wert";
-
-$text['label-username']['en-us'] = "Username";
-$text['label-username']['es-cl'] = "Nombre de Usuario";
-$text['label-username']['pt-pt'] = "Nome de Utilizador";
-$text['label-username']['fr-fr'] = "Nom d'utilisateur";
-$text['label-username']['pt-br'] = "Nome do Usuário";
-$text['label-username']['pl'] = "Użytkownik";
-$text['label-username']['he'] = "שם משתמש";
-$text['label-username']['uk'] = "Ім’я користувача";
-$text['label-username']['sv-se'] = "Användarnamn";
-$text['label-username']['de-at'] = "Benutzername";
-$text['label-username']['ro'] = "Utilizator";
-$text['label-username']['fa'] = "";
-$text['label-username']['ar-eg'] = "اسم المستخدم";
-
-$text['label-users']['en-us'] = "Users";
-$text['label-users']['es-cl'] = "Usuarios";
-$text['label-users']['pt-pt'] = "Utilizadores";
-$text['label-users']['fr-fr'] = "Utilisateurs";
-$text['label-users']['pt-br'] = "Usuários";
-$text['label-users']['pl'] = "Użytkownicy";
-$text['label-users']['sv-se'] = "Användare";
-$text['label-users']['uk'] = "Користувачі";
-$text['label-users']['de-at'] = "Benutzer";
-
-$text['label-user_language']['en-us'] = "Language";
-$text['label-user_language']['es-cl'] = "Lengua";
-$text['label-user_language']['pt-pt'] = "Língua";
-$text['label-user_language']['fr-fr'] = "Langue";
-$text['label-user_language']['pt-br'] = "Idioma";
-$text['label-user_language']['pl'] = "Język";
-$text['label-user_language']['he'] = "שפה";
-$text['label-user_language']['uk'] = "Мова";
-$text['label-user_language']['sv-se'] = "Språk";
-$text['label-user_language']['de-at'] = "Sprache";
-$text['label-user_language']['ro'] = "Limbă";
-$text['label-user_language']['fa'] = "";
-$text['label-user_language']['ar-eg'] = "اللغه";
-
-$text['label-used']['en-us'] = "Used";
-$text['label-used']['es-cl'] = "Usado";
-$text['label-used']['pt-pt'] = "Usava";
-$text['label-used']['fr-fr'] = "Utilisé";
-$text['label-used']['pt-br'] = "Usava";
-$text['label-used']['pl'] = "Używany";
-$text['label-used']['he'] = "מְשׁוּמָשׁ";
-$text['label-used']['uk'] = "використовується";
-$text['label-used']['sv-se'] = "Begagnade";
-$text['label-used']['de-at'] = "Benutzt";
-$text['label-used']['ro'] = "Folosit";
-$text['label-used']['fa'] = "";
-$text['label-used']['ar-eg'] = "مستعمل";
-
-$text['label-total_extensions']['en-us'] = "Total Extensions";
-$text['label-total_extensions']['es-cl'] = "Las extensiones totales";
-$text['label-total_extensions']['pt-pt'] = "total de extensões";
-$text['label-total_extensions']['fr-fr'] = "total des extensions";
-$text['label-total_extensions']['pt-br'] = "total de extensões";
-$text['label-total_extensions']['pl'] = "Wszystkich Rozszerzenia";
-$text['label-total_extensions']['he'] = "רוזן רחב";
-$text['label-total_extensions']['uk'] = "всього розширень";
-$text['label-total_extensions']['sv-se'] = "Totalt Extensions";
-$text['label-total_extensions']['de-at'] = "insgesamt Extensions";
-$text['label-total_extensions']['ro'] = "Extensii totale";
-$text['label-total_extensions']['fa'] = "";
-$text['label-total_extensions']['ar-eg'] = "مجموع الإضافات";
-
-$text['label-total_destinations']['en-us'] = "Total Destinations";
-$text['label-total_destinations']['es-cl'] = "destinos totales";
-$text['label-total_destinations']['pt-pt'] = "total de Destino";
-$text['label-total_destinations']['fr-fr'] = "total des destinations";
-$text['label-total_destinations']['pt-br'] = "total de Destino";
-$text['label-total_destinations']['pl'] = "Wszystkich Kierunki";
-$text['label-total_destinations']['he'] = "רוזן יעד";
-$text['label-total_destinations']['uk'] = "всього Напрями";
-$text['label-total_destinations']['sv-se'] = "Totalt resmål";
-$text['label-total_destinations']['de-at'] = "insgesamt Reiseziele";
-$text['label-total_destinations']['ro'] = "Destinații totale";
-$text['label-total_destinations']['fa'] = "";
-$text['label-total_destinations']['ar-eg'] = "مجموع ظبي";
-
-$text['label-total']['en-us'] = "Total";
-$text['label-total']['es-cl'] = "Total";
-$text['label-total']['pt-pt'] = "Total";
-$text['label-total']['fr-fr'] = "Total";
-$text['label-total']['pt-br'] = "Total";
-$text['label-total']['pl'] = "Podsumowanie";
-$text['label-total']['sv-se'] = "Totalt";
-$text['label-total']['uk'] = "Всього";
-$text['label-total']['de-at'] = "Total";
-$text['label-total']['he'] = "סה״כ";
-
-$text['label-time']['en-us'] = "Time Zone";
-$text['label-time']['es-cl'] = "Zona Horaria";
-$text['label-time']['pt-pt'] = "Fuso Horário";
-$text['label-time']['fr-fr'] = "Fuseau Horaire";
-$text['label-time']['pt-br'] = "Fuso Horário";
-$text['label-time']['pl'] = "Strefa czasowa";
-$text['label-time']['he'] = "אזור זמן";
-$text['label-time']['uk'] = "Часовий пояс";
-$text['label-time']['sv-se'] = "Tidszon";
-$text['label-time']['de-at'] = "Zeitzone";
-$text['label-time']['ro'] = "Zonă fus orar";
-$text['label-time']['fa'] = "";
-$text['label-time']['ar-eg'] = "منطقة التوقيت";
-
-$text['label-system_uptime']['en-us'] = "OS Uptime";
-$text['label-system_uptime']['es-cl'] = "Tiempo de actividad del sistema";
-$text['label-system_uptime']['pt-pt'] = "Uptime sistema";
-$text['label-system_uptime']['fr-fr'] = "système Uptime";
-$text['label-system_uptime']['pt-br'] = "Uptime sistema";
-$text['label-system_uptime']['pl'] = "System Uptime";
-$text['label-system_uptime']['he'] = "מערכת Uptime";
-$text['label-system_uptime']['uk'] = "час роботи системи";
-$text['label-system_uptime']['sv-se'] = "System Uptime";
-$text['label-system_uptime']['de-at'] = "System-Uptime";
-$text['label-system_uptime']['ro'] = "sistemul Uptime";
-$text['label-system_uptime']['fa'] = "";
-$text['label-system_uptime']['ar-eg'] = "نظام الجهوزية";
-
-$text['label-system_status']['en-us'] = "System Status";
-$text['label-system_status']['es-cl'] = "Estado del sistema";
-$text['label-system_status']['pt-pt'] = "Status do sistema";
-$text['label-system_status']['fr-fr'] = "État du système";
-$text['label-system_status']['pt-br'] = "Status do sistema";
-$text['label-system_status']['pl'] = "Status systemu";
-$text['label-system_status']['he'] = "סטטוס מערכת";
-$text['label-system_status']['uk'] = "стан системи";
-$text['label-system_status']['sv-se'] = "Systemstatus ";
-$text['label-system_status']['de-at'] = "Systemstatus";
-$text['label-system_status']['ro'] = "Stare sistem";
-$text['label-system_status']['fa'] = "";
-$text['label-system_status']['ar-eg'] = "حالة النظام";
-
-$text['label-system_counts']['en-us'] = "System Counts";
-$text['label-system_counts']['es-cl'] = "Cuenta del sistema";
-$text['label-system_counts']['pt-pt'] = "contagens do sistema";
-$text['label-system_counts']['fr-fr'] = "Chiffres de système";
-$text['label-system_counts']['pt-br'] = "contagens do sistema";
-$text['label-system_counts']['pl'] = "Liczy systemowe";
-$text['label-system_counts']['he'] = "ספירת מערכת";
-$text['label-system_counts']['uk'] = "система зараховує";
-$text['label-system_counts']['sv-se'] = "System Counts";
-$text['label-system_counts']['de-at'] = "System zählt";
-$text['label-system_counts']['ro'] = "Numără sistem";
-$text['label-system_counts']['fa'] = "";
-$text['label-system_counts']['ar-eg'] = "التهم النظام";
-
-$text['label-switch_uptime']['en-us'] = "Switch Uptime";
-$text['label-switch_uptime']['es-cl'] = "Tiempo de actividad Switch";
-$text['label-switch_uptime']['pt-pt'] = "Uptime Switch";
-$text['label-switch_uptime']['fr-fr'] = "Switch Uptime";
-$text['label-switch_uptime']['pt-br'] = "Uptime Switch";
-$text['label-switch_uptime']['pl'] = "Switch Uptime";
-$text['label-switch_uptime']['sv-se'] = "Switch Uptime";
-$text['label-switch_uptime']['uk'] = "Switch Uptime";
-$text['label-switch_uptime']['de-at'] = "Switch Uptime";
-
-$text['label-switch']['en-us'] = "Switch";
-$text['label-switch']['es-cl'] = "Switch";
-$text['label-switch']['pt-pt'] = "Switch";
-$text['label-switch']['fr-fr'] = "Switch";
-$text['label-switch']['pt-br'] = "Switch";
-$text['label-switch']['pl'] = "Switch";
-$text['label-switch']['sv-se'] = "Switch";
-$text['label-switch']['uk'] = "Switch";
-$text['label-switch']['de-at'] = "Switch";
-
-$text['label-status']['en-us'] = "Status";
-$text['label-status']['es-cl'] = "Estado";
-$text['label-status']['pt-pt'] = "Estado";
-$text['label-status']['fr-fr'] = "Etat";
-$text['label-status']['pt-br'] = "Estado";
-$text['label-status']['pl'] = "Status";
-$text['label-status']['he'] = "סטטוס";
-$text['label-status']['uk'] = "Статус";
-$text['label-status']['sv-se'] = "Status";
-$text['label-status']['de-at'] = "Status";
-$text['label-status']['ro'] = "Stare";
-$text['label-status']['fa'] = "";
-$text['label-status']['ar-eg'] = "الحالة";
-
-$text['label-ring_groups']['en-us'] = "Ring Groups";
-$text['label-ring_groups']['es-cl'] = "Grupo de llamado";
-$text['label-ring_groups']['fr-fr'] = "Groupes de Sonnerie";
-$text['label-ring_groups']['pt-pt'] = "Grupos";
-$text['label-ring_groups']['pt-br'] = "Configurações da Conta";
-$text['label-ring_groups']['pl'] = "Grupy odbiorców rozmów";
-$text['label-ring_groups']['sv-se'] = "Ringgrupper";
-$text['label-ring_groups']['uk'] = "Групи";
-$text['label-ring_groups']['de-at'] = "Rufgruppen";
-$text['label-ring_groups']['he'] = "קבוצות חיוג";
-
-$text['label-reset_password']['en-us'] = "Reset Password";
-$text['label-reset_password']['es-cl'] = "Restablecer contraseña";
-$text['label-reset_password']['pt-pt'] = "Reset Password";
-$text['label-reset_password']['fr-fr'] = "Réinitialiser le mot de passe";
-$text['label-reset_password']['pt-br'] = "Redefinir Senha";
-$text['label-reset_password']['pl'] = "Resetowanie hasla";
-$text['label-reset_password']['he'] = "אפס סיסמה";
-$text['label-reset_password']['uk'] = "Скинути пароль";
-$text['label-reset_password']['sv-se'] = "Återställ Lösenord";
-$text['label-reset_password']['de-at'] = "Passwort zurücksetzen";
-$text['label-reset_password']['ro'] = "Resetare parolă";
-$text['label-reset_password']['fa'] = "";
-$text['label-reset_password']['ar-eg'] = "اعادة تعيين كلمة السر";
-
-$text['label-reset_link']['en-us'] = "Password Reset Link";
-$text['label-reset_link']['es-cl'] = "Password Reset Enlace";
-$text['label-reset_link']['pt-pt'] = "Password Reset Link";
-$text['label-reset_link']['fr-fr'] = "Lien de réinitialisation du mot de passe";
-$text['label-reset_link']['pt-br'] = "Link para Redefinir Senha";
-$text['label-reset_link']['pl'] = "Link do resetowania hasla";
-$text['label-reset_link']['he'] = "קישור לאיפוס סיסמה";
-$text['label-reset_link']['uk'] = "Посилання на скидання пароля";
-$text['label-reset_link']['sv-se'] = "Länk för Återställning av Lösenord";
-$text['label-reset_link']['de-at'] = "Link zum Zurücksetzen des Passworts";
-$text['label-reset_link']['ro'] = "Link resetare parolă";
-$text['label-reset_link']['fa'] = "";
-$text['label-reset_link']['ar-eg'] = " رابط اعادة تعيين كلمة السر";
-
-$text['label-repeat_password']['en-us'] = "Repeat Password";
-$text['label-repeat_password']['es-cl'] = "Repita la Contraseña";
-$text['label-repeat_password']['pt-pt'] = "Repita a Senha";
-$text['label-repeat_password']['fr-fr'] = "Répéter le mot de passe";
-$text['label-repeat_password']['pt-br'] = "Repita a Senha";
-$text['label-repeat_password']['pl'] = "Wpisz ponownie hasło ";
-$text['label-repeat_password']['he'] = "חזור על הסיסמה";
-$text['label-repeat_password']['uk'] = "Повторіть пароль";
-$text['label-repeat_password']['sv-se'] = "Repetera Lösenord";
-$text['label-repeat_password']['de-at'] = "Passwort wiederholen";
-$text['label-repeat_password']['ro'] = "Repetare parolă";
-$text['label-repeat_password']['fa'] = "";
-$text['label-repeat_password']['ar-eg'] = "تاكيد كلمة السر";
-
-$text['label-registrations']['en-us'] = "Registrations";
-$text['label-registrations']['es-cl'] = "Inscripciones";
-$text['label-registrations']['pt-pt'] = "Inscrições";
-$text['label-registrations']['fr-fr'] = "Enregistrements SIP";
-$text['label-registrations']['pt-br'] = "Inscrições";
-$text['label-registrations']['pl'] = "Rejestracje";
-$text['label-registrations']['sv-se'] = "Registreringar";
-$text['label-registrations']['uk'] = "Реєстрації";
-$text['label-registrations']['de-at'] = "Registrierungen";
-
-$text['label-recent_calls']['en-us'] = "Recent Calls";
-$text['label-recent_calls']['es-cl'] = "Llamadas recientes";
-$text['label-recent_calls']['fr-fr'] = "Appels récents";
-$text['label-recent_calls']['pt-pt'] = "chamadas recentes";
-$text['label-recent_calls']['pt-br'] = "chamadas recentes";
-$text['label-recent_calls']['pl'] = "Ostatnie połączenia";
-$text['label-recent_calls']['sv-se'] = "Samtals";
-$text['label-recent_calls']['de-at'] = "Kürzliche Anrufe";
-$text['label-recent_calls']['ar-eg'] = "المكالمات الأخيرة";
-$text['label-recent_calls']['he'] = "שיחות אחרונות";
-
-$text['label-processor_usage']['en-us'] = "CPU Usage";
-$text['label-processor_usage']['es-cl'] = "uso del procesador";
-$text['label-processor_usage']['pt-pt'] = "O uso do processador";
-$text['label-processor_usage']['fr-fr'] = "processeur Utilisation";
-$text['label-processor_usage']['pt-br'] = "O uso do processador";
-$text['label-processor_usage']['pl'] = "Wykorzystanie procesora";
-$text['label-processor_usage']['he'] = "שימוש מעבד";
-$text['label-processor_usage']['uk'] = "Використання процесора";
-$text['label-processor_usage']['sv-se'] = "processor Usage";
-$text['label-processor_usage']['de-at'] = "Prozessorauslastung ";
-$text['label-processor_usage']['ro'] = "procesor de utilizare";
-$text['label-processor_usage']['fa'] = "";
-$text['label-processor_usage']['ar-eg'] = "معالج الاستخدام";
-
-$text['label-password']['en-us'] = "Password";
-$text['label-password']['es-cl'] = "Contraseña";
-$text['label-password']['pt-pt'] = "Password";
-$text['label-password']['fr-fr'] = "Mot de passe";
-$text['label-password']['pt-br'] = "Senha";
-$text['label-password']['pl'] = "Hasło";
-$text['label-password']['he'] = "סיסמה";
-$text['label-password']['uk'] = "Пароль";
-$text['label-password']['sv-se'] = "Lösenord";
-$text['label-password']['de-at'] = "Passwort";
-$text['label-password']['ro'] = "Parolă";
-$text['label-password']['fa'] = "";
-$text['label-password']['ar-eg'] = "كلمة السر";
-
-$text['label-outbound']['en-us'] = "Outbound";
-$text['label-outbound']['es-cl'] = "Salida";
-$text['label-outbound']['pt-pt'] = "Saída";
-$text['label-outbound']['fr-fr'] = "Sortant";
-$text['label-outbound']['pt-br'] = "Saída";
-$text['label-outbound']['pl'] = "Wychodzące";
-$text['label-outbound']['sv-se'] = "Utgående";
-$text['label-outbound']['uk'] = "";
-$text['label-outbound']['de-at'] = "Ausgehend";
-$text['label-outbound']['he'] = "";
-
-$text['label-no_voicemail_assigned']['en-us'] = "No Voicemail Assigned";
-$text['label-no_voicemail_assigned']['es-cl'] = "No Asignado correo de voz";
-$text['label-no_voicemail_assigned']['pt-pt'] = "Sem Voicemail Assigned";
-$text['label-no_voicemail_assigned']['fr-fr'] = "Non Voicemail Assigné";
-$text['label-no_voicemail_assigned']['pt-br'] = "Sem Voicemail Assigned";
-$text['label-no_voicemail_assigned']['pl'] = "Nie głosowa Przypisany";
-$text['label-no_voicemail_assigned']['he'] = "אין שירות תא קולי Assigned";
-$text['label-no_voicemail_assigned']['uk'] = "Ні Voicemail Assigned";
-$text['label-no_voicemail_assigned']['sv-se'] = "Ingen röstmeddelande Delad";
-$text['label-no_voicemail_assigned']['de-at'] = "Nein Voicemail Assigned";
-$text['label-no_voicemail_assigned']['ro'] = "Nr Mesagerie vocală alocate";
-$text['label-no_voicemail_assigned']['fa'] = "";
-$text['label-no_voicemail_assigned']['ar-eg'] = "لا المخصصة البريد الصوتي";
-
-$text['label-new_password']['en-us'] = "New Password";
-$text['label-new_password']['es-cl'] = "Nueva Contraseña";
-$text['label-new_password']['pt-pt'] = "Nova Senha";
-$text['label-new_password']['fr-fr'] = "Nouveau mot de passe";
-$text['label-new_password']['pt-br'] = "Nova Senha";
-$text['label-new_password']['pl'] = "Nowe haslo";
-$text['label-new_password']['he'] = "סיסמה חדשה";
-$text['label-new_password']['uk'] = "Новий пароль";
-$text['label-new_password']['sv-se'] = "Nytt Lösenord";
-$text['label-new_password']['de-at'] = "Neues Passwort";
-$text['label-new_password']['ro'] = "Parolă nouă";
-$text['label-new_password']['fa'] = "";
-$text['label-new_password']['ar-eg'] = "كلمة سر جديدة";
-
-$text['label-new_messages']['en-us'] = "New Messages";
-$text['label-new_messages']['es-cl'] = "Nuevos mensajes";
-$text['label-new_messages']['pt-pt'] = "Novas mensagens";
-$text['label-new_messages']['fr-fr'] = "Nouveaux messages";
-$text['label-new_messages']['pt-br'] = "Novas mensagens";
-$text['label-new_messages']['pl'] = "Nowe wiadomości";
-$text['label-new_messages']['he'] = "הודעות חדשות";
-$text['label-new_messages']['uk'] = "нові повідомлення";
-$text['label-new_messages']['sv-se'] = "нові повідомлення";
-$text['label-new_messages']['de-at'] = "Neue Nachrichten";
-$text['label-new_messages']['ro'] = "Mesaje noi";
-$text['label-new_messages']['fa'] = "";
-$text['label-new_messages']['ar-eg'] = "رسائل جديدة";
-
-$text['label-new']['en-us'] = "New";
-$text['label-new']['es-cl'] = "Nueva";
-$text['label-new']['pt-pt'] = "Nova";
-$text['label-new']['fr-fr'] = "Nouveau";
-$text['label-new']['pt-br'] = "Nova";
-$text['label-new']['pl'] = "Nowy";
-$text['label-new']['sv-se'] = "Nytt";
-$text['label-new']['de-at'] = "Neu";
-$text['label-new']['ro'] = "Nou";
-$text['label-new']['he'] = "חדש";
-
-$text['label-missed_calls']['en-us'] = "Missed Calls";
-$text['label-missed_calls']['es-cl'] = "Llamadas perdidas";
-$text['label-missed_calls']['fr-fr'] = "Appels manqués";
-$text['label-missed_calls']['pt-pt'] = "Chamadas perdidas";
-$text['label-missed_calls']['pt-br'] = "Chamadas perdidas";
-$text['label-missed_calls']['pl'] = "Nieodebrane połączenie";
-$text['label-missed_calls']['sv-se'] = "Missade samtal";
-$text['label-missed_calls']['de-at'] = "Anrufe in Abwesenheit";
-$text['label-missed_calls']['ar-eg'] = "مكالمات فائتة";
-$text['label-missed_calls']['he'] = "שיחות שלא נענו";
-
-$text['label-missed']['en-us'] = "Missed";
-$text['label-missed']['es-cl'] = "Perdido";
-$text['label-missed']['fr-fr'] = "Raté";
-$text['label-missed']['pt-pt'] = "Perdidas";
-$text['label-missed']['pt-br'] = "Perdidas";
-$text['label-missed']['pl'] = "Nie odebrany";
-$text['label-missed']['sv-se'] = "Missade";
-$text['label-missed']['de-at'] = "Verpasst";
-$text['label-missed']['ar-eg'] = "";
-$text['label-missed']['he'] = "שיחה שלא נענתה";
-
-$text['label-messages']['en-us'] = "Messages";
-$text['label-messages']['es-cl'] = "Mensajes";
-$text['label-messages']['pt-pt'] = "mensagens";
-$text['label-messages']['fr-fr'] = "Messages";
-$text['label-messages']['pt-br'] = "mensagens";
-$text['label-messages']['pl'] = "Wiadomości";
-$text['label-messages']['uk'] = "повідомлення";
-$text['label-messages']['sv-se'] = "meddelanden";
-$text['label-messages']['ro'] = "mesaje";
-$text['label-messages']['de-at'] = "Nachrichten";
-$text['label-messages']['ar-eg'] = "رسائل";
-$text['label-messages']['he'] = "הודעות";
-
-$text['label-memory_usage']['en-us'] = "Memory Usage";
-$text['label-memory_usage']['es-cl'] = "Uso de memoria";
-$text['label-memory_usage']['pt-pt'] = "Uso de memória";
-$text['label-memory_usage']['fr-fr'] = "Utilisation de la mémoire";
-$text['label-memory_usage']['pt-br'] = "Uso de memória";
-$text['label-memory_usage']['pl'] = "Zużycie pamięci";
-$text['label-memory_usage']['he'] = "שימוש בזיכרון";
-$text['label-memory_usage']['uk'] = "Використання пам'яті";
-$text['label-memory_usage']['sv-se'] = "Minnesanvändning";
-$text['label-memory_usage']['de-at'] = "Speichernutzung";
-$text['label-memory_usage']['ro'] = "Folosirea memoriei";
-$text['label-memory_usage']['fa'] = "";
-$text['label-memory_usage']['ar-eg'] = "استخدام الذاكرة";
-
-$text['label-local']['en-us'] = "Local";
-$text['label-local']['es-cl'] = "Local";
-$text['label-local']['pt-pt'] = "Local";
-$text['label-local']['fr-fr'] = "Local";
-$text['label-local']['pt-br'] = "Local";
-$text['label-local']['pl'] = "Lokalne";
-$text['label-local']['sv-se'] = "Lokal";
-$text['label-local']['uk'] = "Локальний";
-$text['label-local']['de-at'] = "Lokal";
-$text['label-local']['he'] = "מקומי";
-
-$text['label-last_24_hours']['en-us'] = "Last 24 Hours";
-$text['label-last_24_hours']['es-cl'] = "Últimas 24 horas";
-$text['label-last_24_hours']['pt-pt'] = "Nas últimas 24 horas";
-$text['label-last_24_hours']['fr-fr'] = "Dernières 24 heures";
-$text['label-last_24_hours']['pt-br'] = "Nas últimas 24 horas";
-$text['label-last_24_hours']['pl'] = "Ostatnie 24 godziny";
-$text['label-last_24_hours']['he'] = "לאחרונה עשרים וארבע שעות";
-$text['label-last_24_hours']['uk'] = "Останні 24 годин";
-$text['label-last_24_hours']['sv-se'] = "Senaste 24 timmarna";
-$text['label-last_24_hours']['de-at'] = "Die letzten 24 Stunden";
-$text['label-last_24_hours']['ro'] = "Ultimele 24 de ore";
-$text['label-last_24_hours']['fa'] = "";
-$text['label-last_24_hours']['ar-eg'] = "الماضي أربع وعشرين ساعة";
-
-$text['label-ivr_menus']['en-us'] = "IVR Menus";
-$text['label-ivr_menus']['es-cl'] = "Menus IVR";
-$text['label-ivr_menus']['pt-pt'] = "Menus de IVR";
-$text['label-ivr_menus']['fr-fr'] = "Menus SVI";
-$text['label-ivr_menus']['pt-br'] = "Menus de IVR";
-$text['label-ivr_menus']['pl'] = "Menu zapowiedzi głosowych (IVR)";
-$text['label-ivr_menus']['sv-se'] = "IVR Menyer";
-$text['label-ivr_menus']['de-at'] = "Automatische Vermittlungen";
-
-$text['label-inbound']['en-us'] = "Inbound";
-$text['label-inbound']['es-cl'] = "Entrada";
-$text['label-inbound']['pt-pt'] = "Entrada";
-$text['label-inbound']['fr-fr'] = "Entrant";
-$text['label-inbound']['pt-br'] = "Entrada";
-$text['label-inbound']['pl'] = "Przychodzące";
-$text['label-inbound']['sv-se'] = "Inkommande";
-$text['label-inbound']['uk'] = "Вихідний";
-$text['label-inbound']['de-at'] = "Eingehend";
-$text['label-inbound']['he'] = "";
-
-$text['label-item']['en-us'] = "Item";
-$text['label-item']['es-cl'] = "Ítem";
-$text['label-item']['pt-pt'] = "Item";
-$text['label-item']['fr-fr'] = "Article";
-$text['label-item']['pt-br'] = "Item";
-$text['label-item']['pl'] = "Pozycja";
-$text['label-item']['he'] = "פריט";
-$text['label-item']['uk'] = "пункт";
-$text['label-item']['sv-se'] = "Punkt";
-$text['label-item']['de-at'] = "Artikel";
-$text['label-item']['ro'] = "Articol";
-$text['label-item']['fa'] = "";
-$text['label-item']['ar-eg'] = "بند";
-
-$text['label-gateways']['en-us'] = "Gateways";
-$text['label-gateways']['es-cl'] = "Pasarelas";
-$text['label-gateways']['pt-pt'] = "Gateways";
-$text['label-gateways']['fr-fr'] = "Passerelles";
-$text['label-gateways']['pt-br'] = "Gateways";
-$text['label-gateways']['pl'] = "Bramy wyjściowe (gateways)";
-$text['label-gateways']['uk'] = "Шлюзи";
-$text['label-gateways']['sv-se'] = "Gateways";
-$text['label-gateways']['ro'] = "";
-$text['label-gateways']['de-at'] = "Gateways";
-$text['label-gateways']['ar-eg'] = "البوابات";
-$text['label-gateways']['he'] = "שערים";
-
-$text['label-followme']['en-us'] = "Follow Me";
-$text['label-followme']['es-cl'] = "Sígueme";
-$text['label-followme']['pt-pt'] = "Segue-me";
-$text['label-followme']['fr-fr'] = "Follow Me";
-$text['label-followme']['pt-br'] = "Siga-me";
-$text['label-followme']['pl'] = "Podążaj za mną";
-$text['label-followme']['he'] = "עקוב אחרי";
-$text['label-followme']['uk'] = "Follow Me";
-$text['label-followme']['sv-se'] = "Följ Mig";
-$text['label-followme']['de-at'] = "Anrufweiterschaltung";
-$text['label-followme']['ro'] = "Urmează-mă";
-$text['label-followme']['fa'] = "";
-$text['label-followme']['ar-eg'] = "خدمة اتبعني";
-
-$text['label-feature']['en-us'] = "Feature";
-$text['label-feature']['es-cl'] = "Característica";
-$text['label-feature']['pt-pt'] = "Característica";
-$text['label-feature']['fr-fr'] = "Fonctionnalité";
-$text['label-feature']['pt-br'] = "Característica";
-$text['label-feature']['pl'] = "Cecha";
-$text['label-feature']['uk'] = "особливість";
-$text['label-feature']['sv-se'] = "Särdrag";
-$text['label-feature']['ro'] = "trăsătură";
-$text['label-feature']['de-at'] = "Feature";
-$text['label-feature']['ar-eg'] = "ميزة";
-$text['label-feature']['he'] = "מאפיין";
-
-$text['label-failed']['en-us'] = "Failed";
-$text['label-failed']['es-cl'] = "Fracasado";
-$text['label-failed']['pt-pt'] = "Fracassado";
-$text['label-failed']['fr-fr'] = "Manqué";
-$text['label-failed']['pt-br'] = "Fracassado";
-$text['label-failed']['pl'] = "Nie powiodło się";
-$text['label-failed']['sv-se'] = "Misslyckad";
-$text['label-failed']['uk'] = "";
-$text['label-failed']['de-at'] = "Fehlgeschlagen";
-$text['label-failed']['he'] = "נכשל";
-
-$text['label-extensions']['en-us'] = "Extensions";
-$text['label-extensions']['es-cl'] = "Extensiones";
-$text['label-extensions']['pt-pt'] = "Extensões";
-$text['label-extensions']['fr-fr'] = "Extensions";
-$text['label-extensions']['pt-br'] = "Extensões";
-$text['label-extensions']['pl'] = "Numery wewnętrzne";
-$text['label-extensions']['uk'] = "Розширення";
-$text['label-extensions']['sv-se'] = "Anknytningar";
-$text['label-extensions']['ro'] = "Extensii";
-$text['label-extensions']['de-at'] = "Nebenstellen";
-$text['label-extensions']['ar-eg'] = "الأرقام الداخلية";
-$text['label-extensions']['he'] = "שלוחות";
-
-$text['label-extension']['en-us'] = "Extension";
-$text['label-extension']['es-cl'] = "Extensión";
-$text['label-extension']['pt-pt'] = "Extensão";
-$text['label-extension']['fr-fr'] = "Extension";
-$text['label-extension']['pt-br'] = "Ramal";
-$text['label-extension']['pl'] = "Numer wewnętrzny";
-$text['label-extension']['he'] = "שלוחה";
-$text['label-extension']['uk'] = "Розширення (Extention)";
-$text['label-extension']['sv-se'] = "Anknytning";
-$text['label-extension']['de-at'] = "Durchwahl";
-$text['label-extension']['ro'] = "Extensie";
-$text['label-extension']['fa'] = "";
-$text['label-extension']['ar-eg'] = "رقم داخلي";
-
-$text['label-email_address']['en-us'] = "Email Address";
-$text['label-email_address']['es-cl'] = "Dirección de Correo Electrónico";
-$text['label-email_address']['pt-pt'] = "Endereço de Email";
-$text['label-email_address']['fr-fr'] = "Adresse E-mail";
-$text['label-email_address']['pt-br'] = "Endereço de E-mail";
-$text['label-email_address']['pl'] = "Adres email";
-$text['label-email_address']['he'] = "כתובת מייל";
-$text['label-email_address']['uk'] = "Адреси E-Mail";
-$text['label-email_address']['sv-se'] = "E-postadress";
-$text['label-email_address']['de-at'] = "E-Mail-Adresse";
-$text['label-email_address']['ro'] = "Adresă email";
-$text['label-email_address']['fa'] = "";
-$text['label-email_address']['ar-eg'] = "البريد الإلكتروني";
-
-$text['label-domains']['en-us'] = "Domains";
-$text['label-domains']['es-cl'] = "Dominios";
-$text['label-domains']['pt-pt'] = "Domínios";
-$text['label-domains']['fr-fr'] = "Domaines";
-$text['label-domains']['pt-br'] = "Dominios";
-$text['label-domains']['pl'] = "Domeny";
-$text['label-domains']['sv-se'] = "Domäner";
-$text['label-domains']['uk'] = "Домени";
-$text['label-domains']['de-at'] = "Domains";
-
-$text['label-domain_limits']['en-us'] = "Domain Limits";
-$text['label-domain_limits']['es-cl'] = "Límites de dominio";
-$text['label-domain_limits']['pt-pt'] = "Limites de domínio";
-$text['label-domain_limits']['fr-fr'] = "Limites de domaine";
-$text['label-domain_limits']['pt-br'] = "Limites de domínio";
-$text['label-domain_limits']['pl'] = "Granice domen";
-$text['label-domain_limits']['he'] = "מגבלת הדומיין";
-$text['label-domain_limits']['uk'] = "обмеження домену";
-$text['label-domain_limits']['sv-se'] = "domän Gränser";
-$text['label-domain_limits']['de-at'] = "Domain Limits";
-$text['label-domain_limits']['ro'] = "Limite de domeniu";
-$text['label-domain_limits']['fa'] = "";
-$text['label-domain_limits']['ar-eg'] = "حدود نطاق";
-
-$text['label-domain']['en-us'] = "Domain";
-$text['label-domain']['es-cl'] = "Dominio";
-$text['label-domain']['pt-pt'] = "Domínio";
-$text['label-domain']['fr-fr'] = "Domaine";
-$text['label-domain']['pt-br'] = "Domínio";
-$text['label-domain']['pl'] = "Domena";
-$text['label-domain']['he'] = "תחום";
-$text['label-domain']['uk'] = "Домен";
-$text['label-domain']['sv-se'] = "Domän";
-$text['label-domain']['de-at'] = "Domain";
-$text['label-domain']['ro'] = "Domeniu";
-$text['label-domain']['fa'] = "";
-$text['label-domain']['ar-eg'] = "النطاق";
-
-$text['label-dnd']['en-us'] = "Do Not Disturb";
-$text['label-dnd']['es-cl'] = "No Molestar";
-$text['label-dnd']['pt-pt'] = "Não Perturbar";
-$text['label-dnd']['fr-fr'] = "Ne Pas Déranger";
-$text['label-dnd']['pt-br'] = "Não Pertube";
-$text['label-dnd']['pl'] = "Nie przeszkadzaj (DND)";
-$text['label-dnd']['he'] = "לא להפריע";
-$text['label-dnd']['uk'] = "Не турбувати";
-$text['label-dnd']['sv-se'] = "Stör Ej";
-$text['label-dnd']['de-at'] = "Nicht stören";
-$text['label-dnd']['ro'] = "Nu deranjați";
-$text['label-dnd']['fa'] = "";
-$text['label-dnd']['ar-eg'] = "عدم الازعاج";
-
-$text['label-disk_usage']['en-us'] = "Disk Usage";
-$text['label-disk_usage']['es-cl'] = "Uso del disco";
-$text['label-disk_usage']['pt-pt'] = "Uso de disco";
-$text['label-disk_usage']['fr-fr'] = "Utilisation du disque";
-$text['label-disk_usage']['pt-br'] = "Uso de disco";
-$text['label-disk_usage']['pl'] = "Użycie dysku";
-$text['label-disk_usage']['he'] = "שימוש בדיסק";
-$text['label-disk_usage']['uk'] = "Використання диска";
-$text['label-disk_usage']['sv-se'] = "Drive användning";
-$text['label-disk_usage']['de-at'] = "Festplattennutzung";
-$text['label-disk_usage']['ro'] = "utilizare disc";
-$text['label-disk_usage']['fa'] = "";
-$text['label-disk_usage']['ar-eg'] = "إستخدام القرص";
-
-$text['label-disabled']['en-us'] = "Disabled";
-$text['label-disabled']['es-cl'] = "Discapacitado";
-$text['label-disabled']['pt-pt'] = "Inválido";
-$text['label-disabled']['fr-fr'] = "Non Permis";
-$text['label-disabled']['pt-br'] = "Inválido";
-$text['label-disabled']['pl'] = "Wyłączony";
-$text['label-disabled']['sv-se'] = "Inaktiverad";
-$text['label-disabled']['uk'] = "Відключено";
-$text['label-disabled']['de-at'] = "Ausgeschaltet";
-
-$text['label-devices']['en-us'] = "Devices";
-$text['label-devices']['es-cl'] = "Dispositivos";
-$text['label-devices']['pt-pt'] = "Dispositivos";
-$text['label-devices']['fr-fr'] = "Equipements";
-$text['label-devices']['pt-br'] = "Dispositivos";
-$text['label-devices']['pl'] = "Urządzenia";
-$text['label-devices']['uk'] = "Пристрої";
-$text['label-devices']['sv-se'] = "Enheter";
-$text['label-devices']['ro'] = "Dispozitive";
-$text['label-devices']['de-at'] = "Geräte";
-$text['label-devices']['ar-eg'] = "الأجهزة";
-$text['label-devices']['he'] = "התקנים";
-
-$text['label-destinations']['en-us'] = "Destinations";
-$text['label-destinations']['es-cl'] = "Destinos";
-$text['label-destinations']['pt-pt'] = "Destinos";
-$text['label-destinations']['fr-fr'] = "Destinations";
-$text['label-destinations']['pt-br'] = "Destinos";
-$text['label-destinations']['pl'] = "Destynacje";
-$text['label-destinations']['sv-se'] = "Destinationer";
-$text['label-destinations']['uk'] = "Номери";
-$text['label-destinations']['ro'] = "Destinații";
-$text['label-destinations']['de-at'] = "Kopfnummern";
-$text['label-destinations']['fa'] = "";
-$text['label-destinations']['ar-eg'] = "جهات الأتصال";
-$text['label-destinations']['he'] = "יעדים";
-
-$text['label-date_time']['en-us'] = "Date/Time";
-$text['label-date_time']['es-cl'] = "Fecha y hora";
-$text['label-date_time']['pt-pt'] = "Data hora";
-$text['label-date_time']['fr-fr'] = "Date / Heure";
-$text['label-date_time']['pt-br'] = "Data hora";
-$text['label-date_time']['pl'] = "Data Godzina";
-$text['label-date_time']['sv-se'] = "Datum Tid";
-$text['label-date_time']['uk'] = "Дата, час";
-$text['label-date_time']['ro'] = "Data / Ora";
-$text['label-date_time']['de-at'] = "Terminzeit";
-$text['label-date_time']['fa'] = "";
-$text['label-date_time']['ar-eg'] = "تاريخ / وقت";
-$text['label-date_time']['he'] = "תאריך שעה";
-
-$text['label-database_connections']['en-us'] = "DB Connections";
-$text['label-database_connections']['es-cl'] = "Conexiones de base de datos";
-$text['label-database_connections']['pt-pt'] = "Conexões de banco de dados";
-$text['label-database_connections']['fr-fr'] = "Connexions de base de données";
-$text['label-database_connections']['pt-br'] = "Conexões de banco de dados";
-$text['label-database_connections']['pl'] = "Połączenia z bazami danych";
-$text['label-database_connections']['sv-se'] = "databasanslutningar ";
-$text['label-database_connections']['uk'] = "з'єднання бази даних";
-$text['label-database_connections']['ro'] = "Baza de date Conexiuni";
-$text['label-database_connections']['de-at'] = "Datenbankverbindungen ";
-$text['label-database_connections']['fa'] = "";
-$text['label-database_connections']['ar-eg'] = "اتصالات قاعدة البيانات";
-$text['label-database_connections']['he'] = "התחברויות למסד נתונים";
-
-$text['label-confirm-password']['en-us'] = "Confirm Password";
-$text['label-confirm-password']['es-cl'] = "Confirmar Contraseña";
-$text['label-confirm-password']['pt-pt'] = "Confirmar Palavra-Passe";
-$text['label-confirm-password']['fr-fr'] = "Confirmation du mot de passe";
-$text['label-confirm-password']['pt-br'] = "Confirmar Senha";
-$text['label-confirm-password']['pl'] = "Potwierdź hasło";
-$text['label-confirm-password']['he'] = "אשר סיסמה";
-$text['label-confirm-password']['uk'] = "Підтвердіть пароль";
-$text['label-confirm-password']['sv-se'] = "Verifiera Lösenord";
-$text['label-confirm-password']['de-at'] = "Passwort bestätigen";
-$text['label-confirm-password']['ro'] = "Confirmare parolă";
-$text['label-confirm-password']['fa'] = "";
-$text['label-confirm-password']['ar-eg'] = "تاكيد كلمة السر";
-
-$text['label-cid_number']['en-us'] = "Number";
-$text['label-cid_number']['es-cl'] = "Número";
-$text['label-cid_number']['pt-pt'] = "Número";
-$text['label-cid_number']['fr-fr'] = "Numéro";
-$text['label-cid_number']['pt-br'] = "Número";
-$text['label-cid_number']['pl'] = "Numer";
-$text['label-cid_number']['sv-se'] = "Nummer";
-$text['label-cid_number']['uk'] = "Номер";
-$text['label-cid_number']['de-at'] = "Nummer";
-$text['label-cid_number']['he'] = "מספר";
-
-$text['label-cid_name']['en-us'] = "Name";
-$text['label-cid_name']['es-cl'] = "Nombre";
-$text['label-cid_name']['pt-pt'] = "Nome";
-$text['label-cid_name']['fr-fr'] = "Nom";
-$text['label-cid_name']['pt-br'] = "Nome";
-$text['label-cid_name']['pl'] = "Nazwa";
-$text['label-cid_name']['sv-se'] = "Namn";
-$text['label-cid_name']['uk'] = "Назва";
-$text['label-cid_name']['de-at'] = "Name";
-$text['label-cid_name']['he'] = "שם";
-
-$text['label-channels']['en-us'] = "Channels";
-$text['label-channels']['es-cl'] = "Canales";
-$text['label-channels']['pt-pt'] = "Canais";
-$text['label-channels']['fr-fr'] = "Canaux";
-$text['label-channels']['pt-br'] = "Canais";
-$text['label-channels']['pl'] = "Kanały";
-$text['label-channels']['uk'] = "Канали";
-$text['label-channels']['sv-se'] = "Kanaler";
-$text['label-channels']['ro'] = "Canale";
-$text['label-channels']['de-at'] = "Kanäle";
-$text['label-channels']['ar-eg'] = "";
-$text['label-channels']['he'] = "ערוצים";
-
-$text['label-cancelled']['en-us'] = "Cancelled";
-$text['label-cancelled']['es-cl'] = "Cancelado";
-$text['label-cancelled']['pt-pt'] = "Cancelado";
-$text['label-cancelled']['fr-fr'] = "Annulé";
-$text['label-cancelled']['pt-br'] = "Cancelado";
-$text['label-cancelled']['pl'] = "Odwołany";
-$text['label-cancelled']['he'] = "מבוטל";
-$text['label-cancelled']['uk'] = "скасовано";
-$text['label-cancelled']['sv-se'] = "Avbryts";
-$text['label-cancelled']['de-at'] = "Abgebrochen";
-$text['label-cancelled']['ro'] = "Anulat";
-$text['label-cancelled']['fa'] = "";
-$text['label-cancelled']['ar-eg'] = "ألغيت";
-
-$text['label-cancel']['en-us'] = "Cancel";
-$text['label-cancel']['es-cl'] = "Cancelar";
-$text['label-cancel']['pt-pt'] = "Cancelar";
-$text['label-cancel']['fr-fr'] = "Annuler";
-$text['label-cancel']['pt-br'] = "Cancelar";
-$text['label-cancel']['pl'] = "Anuluj";
-$text['label-cancel']['he'] = "בטל";
-$text['label-cancel']['uk'] = "Відмінити";
-$text['label-cancel']['sv-se'] = "Avbryt";
-$text['label-cancel']['de-at'] = "Abbrechen";
-$text['label-cancel']['ro'] = "Anulează";
-$text['label-cancel']['fa'] = "";
-$text['label-cancel']['ar-eg'] = "الغاء";
-
-$text['label-callforward']['en-us'] = "Call Forward";
-$text['label-callforward']['es-cl'] = "Desvío de Llamadas";
-$text['label-callforward']['pt-pt'] = "Encaminhamento de Chamadas";
-$text['label-callforward']['fr-fr'] = "Renvoi d'appel";
-$text['label-callforward']['pt-br'] = "Encaminhamento de Chamadas";
-$text['label-callforward']['pl'] = "Przekierowanie rozmowy";
-$text['label-callforward']['he'] = "עקוב אחרי";
-$text['label-callforward']['uk'] = "Переадресація дзвінків";
-$text['label-callforward']['sv-se'] = "Vidarekoppling";
-$text['label-callforward']['de-at'] = "Rufumleitung";
-$text['label-callforward']['ro'] = "Redirecționare apel";
-$text['label-callforward']['fa'] = "";
-$text['label-callforward']['ar-eg'] = "تحويل المكالمات";
-
-$text['label-call_center_queues']['en-us'] = "CC Queues";
-$text['label-call_center_queues']['es-cl'] = "Colas de Centro de Llamados";
-$text['label-call_center_queues']['pt-pt'] = "Filas de Call Center";
-$text['label-call_center_queues']['fr-fr'] = "Queues du Centre d'appels";
-$text['label-call_center_queues']['pt-br'] = "Filas de call center";
-$text['label-call_center_queues']['pl'] = "Kolejki w Call Center ";
-$text['label-call_center_queues']['sv-se'] = "Call Center Kö:er";
-$text['label-call_center_queues']['uk'] = "Черги кол-центра";
-$text['label-call_center_queues']['de-at'] = "Callcenter Warteschlangen";
-
-$text['label-answered']['en-us'] = "Answered";
-$text['label-answered']['es-cl'] = "Respondido";
-$text['label-answered']['pt-pt'] = "Atendidas";
-$text['label-answered']['fr-fr'] = "Répondu";
-$text['label-answered']['pt-br'] = "Atendidas";
-$text['label-answered']['pl'] = "Odebrano";
-$text['label-answered']['he'] = "ענה";
-$text['label-answered']['uk'] = "відповів";
-$text['label-answered']['sv-se'] = "Besvarad";
-$text['label-answered']['de-at'] = "Angenommen";
-$text['label-answered']['ro'] = "Răspuns";
-$text['label-answered']['fa'] = "";
-$text['label-answered']['ar-eg'] = "تم الرد";
-
-$text['label-active_users']['en-us'] = "Active Users";
-$text['label-active_users']['es-cl'] = "Los usuarios activos";
-$text['label-active_users']['pt-pt'] = "Usuários ativos";
-$text['label-active_users']['fr-fr'] = "Usuários ativos...";
-$text['label-active_users']['pt-br'] = "Usuários ativos";
-$text['label-active_users']['pl'] = "Aktywni użytkownicy";
-$text['label-active_users']['he'] = "משתמשים פעילים";
-$text['label-active_users']['uk'] = "активні користувачі";
-$text['label-active_users']['sv-se'] = "aktiva användare";
-$text['label-active_users']['de-at'] = "Aktive Benutzer";
-$text['label-active_users']['ro'] = "Utilizatori activi";
-$text['label-active_users']['fa'] = "";
-$text['label-active_users']['ar-eg'] = "الأعضاء النشيطين";
-
-$text['label-active_extensions']['en-us'] = "Active Extensions";
-$text['label-active_extensions']['es-cl'] = "Extensiones de activos";
-$text['label-active_extensions']['pt-pt'] = "Extensões de ativos";
-$text['label-active_extensions']['fr-fr'] = "Extensions actives";
-$text['label-active_extensions']['pt-br'] = "Extensões de ativos";
-$text['label-active_extensions']['pl'] = "Całość Rozszerzenia";
-$text['label-active_extensions']['he'] = "הרחבות בשידור חי";
-$text['label-active_extensions']['uk'] = "активні Розширення";
-$text['label-active_extensions']['sv-se'] = "aktiva Extensions";
-$text['label-active_extensions']['de-at'] = "Aktive Erweiterungen";
-$text['label-active_extensions']['ro'] = "Extensii active";
-$text['label-active_extensions']['fa'] = "";
-$text['label-active_extensions']['ar-eg'] = "الامتدادات النشطة";
-
-$text['label-active_domains']['en-us'] = "Active Domains";
-$text['label-active_domains']['es-cl'] = "Los dominios activos";
-$text['label-active_domains']['pt-pt'] = "Domínios ativos";
-$text['label-active_domains']['fr-fr'] = "domaines active";
-$text['label-active_domains']['pt-br'] = "Domínios ativos";
-$text['label-active_domains']['pl'] = "aktywne Domeny";
-$text['label-active_domains']['he'] = "תחומים פעילים";
-$text['label-active_domains']['uk'] = "активні домени";
-$text['label-active_domains']['sv-se'] = "aktiva domäner";
-$text['label-active_domains']['de-at'] = "Aktive Domains";
-$text['label-active_domains']['ro'] = "Domenii active";
-$text['label-active_domains']['fa'] = "";
-$text['label-active_domains']['ar-eg'] = "مجالات حية";
-
-$text['header-user_dashboard']['en-us'] = "Dashboard";
-$text['header-user_dashboard']['es-cl'] = "Dashboard Usuario";
-$text['header-user_dashboard']['pt-pt'] = "Painel de Controle do Usuário";
-$text['header-user_dashboard']['fr-fr'] = "Tableau de bord de l'utilisateur";
-$text['header-user_dashboard']['pt-br'] = "Painel de Controle do Usuário";
-$text['header-user_dashboard']['pl'] = "Panel użytkowników";
-$text['header-user_dashboard']['he'] = "ממשק משתמש";
-$text['header-user_dashboard']['uk'] = "Панель користувача";
-$text['header-user_dashboard']['sv-se'] = "Användarpanel";
-$text['header-user_dashboard']['de-at'] = "Benutzerübersicht";
-$text['header-user_dashboard']['ro'] = "Panou control utilizator";
-$text['header-user_dashboard']['fa'] = "";
-$text['header-user_dashboard']['ar-eg'] = "الصفحه الرئيسيه للمستخدم";
-
-$text['description-user_language']['en-us'] = "Select the language.";
-$text['description-user_language']['es-cl'] = "Seleccione el idioma.";
-$text['description-user_language']['pt-pt'] = "Selecione o idioma.";
-$text['description-user_language']['fr-fr'] = "Sélectionnez la langue.";
-$text['description-user_language']['pt-br'] = "Selecione o idioma";
-$text['description-user_language']['pl'] = "Wybierz język";
-$text['description-user_language']['he'] = "בחר שפה";
-$text['description-user_language']['uk'] = "Виберіть мову";
-$text['description-user_language']['sv-se'] = "Välj Språk";
-$text['description-user_language']['de-at'] = "Sprache auswählen";
-$text['description-user_language']['ro'] = "Selecție limbă";
-$text['description-user_language']['fa'] = "";
-$text['description-user_language']['ar-eg'] = "اختيار الغة";
-
-$text['description-user_dashboard']['en-us'] = "Quickly access information and tools related to your account.";
-$text['description-user_dashboard']['es-cl'] = "Acceso rápido a la información y herramientas relacionadas con su cuenta.";
-$text['description-user_dashboard']['pt-pt'] = "Acessar rapidamente as informações e ferramentas relacionadas à sua conta.";
-$text['description-user_dashboard']['fr-fr'] = "Accéder rapidement aux informations et outils liés à votre compte.";
-$text['description-user_dashboard']['pt-br'] = "Acessar as informações e ferramentas relacionadas à sua conta.";
-$text['description-user_dashboard']['pl'] = "Szybki dostęp do informacji i narzędzi związanych z twoim kontem";
-$text['description-user_dashboard']['he'] = "מידע מהיר וגישה לכלים הקשורים לחשבון שלך ";
-$text['description-user_dashboard']['uk'] = "Швидкий доступ до інформації та інструментів  вашого облікового запису.";
-$text['description-user_dashboard']['sv-se'] = "Snabb tillgång till information och verktyg för ditt konto.";
-$text['description-user_dashboard']['de-at'] = "Schneller Zugriff auf Kontoinformationen und -funktionen";
-$text['description-user_dashboard']['ro'] = "Acces rapid la informații și utilitare pentru contul Dvs.";
-$text['description-user_dashboard']['fa'] = "";
-$text['description-user_dashboard']['ar-eg'] = "دخول سريع للمعلومات و الادوات الخاصة بحسابك";
-
-$text['description-timezone']['en-us'] = "Select the default time zone.";
-$text['description-timezone']['es-cl'] = "Seleccione la zona horaria predeterminada.";
-$text['description-timezone']['pt-pt'] = "Selecione o fuso horário por omissão.";
-$text['description-timezone']['fr-fr'] = "Sélection du Fuseau Horaire par défaut.";
-$text['description-timezone']['pt-br'] = "Selecione o fuso horário padrão.";
-$text['description-timezone']['pl'] = "Wybierz domyślną strefę czasową";
-$text['description-timezone']['he'] = "בחר את ברירת המחדל עבור אזור הזמן ";
-$text['description-timezone']['uk'] = "Виберіть часовий пояс за замовчуванням";
-$text['description-timezone']['sv-se'] = "Välj standardtidszon";
-$text['description-timezone']['de-at'] = "Standardzeitzone auswählen";
-$text['description-timezone']['ro'] = "Selectați un fus orar implicit";
-$text['description-timezone']['fa'] = "";
-$text['description-timezone']['ar-eg'] = "اختيار منطقة التوقيت";
-
-$text['description-status']['en-us'] = "Select a user status.";
-$text['description-status']['es-cl'] = "Seleccione el estado del usuario.";
-$text['description-status']['pt-pt'] = "Escolha um estado para o utilizador.";
-$text['description-status']['fr-fr'] = "Sélection de l'état de l'usager.";
-$text['description-status']['pt-br'] = "Escolha o estado do usuário.";
-$text['description-status']['pl'] = "Wybierz status użytkownika";
-$text['description-status']['he'] = "בחר את סטטוס המשתמש";
-$text['description-status']['uk'] = "Виберіть статус користувача";
-$text['description-status']['sv-se'] = "Välj en användarstatus.";
-$text['description-status']['de-at'] = "Benutzerstatus auswählen";
-$text['description-status']['ro'] = "Selectați starea utilizatorului";
-$text['description-status']['fa'] = "";
-$text['description-status']['ar-eg'] = "اختيار حالة للمستخدم";
-
-$text['description']['en-us'] = "Edit account information.";
-$text['description']['es-cl'] = "Editar configuración de la cuenta.";
-$text['description']['pt-pt'] = "Editar informações de conta.";
-$text['description']['fr-fr'] = "Modifier les informations du compte.";
-$text['description']['pt-br'] = "Editar informações da conta.";
-$text['description']['pl'] = "Edytuj informacje o koncie";
-$text['description']['he'] = "ערוך את פרטי החשבון";
-$text['description']['uk'] = "Редагування інформації облікового запису";
-$text['description']['sv-se'] = "Redigera kontoinformation.";
-$text['description']['de-at'] = "Kontoinformationen bearbeiten";
-$text['description']['ro'] = "Editare cont";
-$text['description']['fa'] = "";
-$text['description']['ar-eg'] = "تعديل بيانات الحساب";
-
-$text['confirm-update']['en-us'] = "Update Complete";
-$text['confirm-update']['es-cl'] = "Actualización Completa";
-$text['confirm-update']['pt-pt'] = "Actualização Efectuada";
-$text['confirm-update']['fr-fr'] = "Mise à jour terminée";
-$text['confirm-update']['pt-br'] = "Atualização Efetuada";
-$text['confirm-update']['pl'] = "Aktualizacja zakonczona";
-$text['confirm-update']['he'] = "עידכון הושלם";
-$text['confirm-update']['uk'] = "Оновлення завершено";
-$text['confirm-update']['sv-se'] = "Uppdatering Klar";
-$text['confirm-update']['de-at'] = "Aktualisierung durchgeführt";
-$text['confirm-update']['ro'] = "Actualizare completă";
-$text['confirm-update']['fa'] = "";
-$text['confirm-update']['ar-eg'] = "تم التحديث";
-
-$text['confirm-password']['en-us'] = "Passwords did not match.";
-$text['confirm-password']['es-cl'] = "Las contraseñas no coinciden.";
-$text['confirm-password']['pt-pt'] = "As palavras-chave não coincidem.";
-$text['confirm-password']['fr-fr'] = "Les mots de passe ne sont pas les mêmes.";
-$text['confirm-password']['pt-br'] = "As senhas não coincidem.";
-$text['confirm-password']['pl'] = "Hasła nie sa takie same";
-$text['confirm-password']['he'] = "סיסמאות לא תואמות";
-$text['confirm-password']['uk'] = "Паролі не співпадають";
-$text['confirm-password']['sv-se'] = "Lösenorden matchar inte.";
-$text['confirm-password']['de-at'] = "Die Passwörter stimmen nicht überein";
-$text['confirm-password']['ro'] = "Parolele nu se potrivesc";
-$text['confirm-password']['fa'] = "";
-$text['confirm-password']['ar-eg'] = "كلمات السر غير متطابقة";
-
-$text['check-onbreak-status']['en-us'] = "On Break";
-$text['check-onbreak-status']['es-cl'] = "En Pausa";
-$text['check-onbreak-status']['pt-pt'] = "Em Pausa";
-$text['check-onbreak-status']['fr-fr'] = "En Pause";
-$text['check-onbreak-status']['pt-br'] = "Em Pausa";
-$text['check-onbreak-status']['pl'] = "Na przerwie";
-$text['check-onbreak-status']['he'] = "בהפסקה";
-$text['check-onbreak-status']['uk'] = "На перерві";
-$text['check-onbreak-status']['sv-se'] = "På Rast";
-$text['check-onbreak-status']['de-at'] = "Pause";
-$text['check-onbreak-status']['ro'] = "În pauză";
-$text['check-onbreak-status']['fa'] = "";
-$text['check-onbreak-status']['ar-eg'] = " (في استراحة (لا يعمل";
-
-$text['check-loggedout-status']['en-us'] = "Logged Out";
-$text['check-loggedout-status']['es-cl'] = "Desconectado";
-$text['check-loggedout-status']['pt-pt'] = "Desligado";
-$text['check-loggedout-status']['fr-fr'] = "Déconnecté";
-$text['check-loggedout-status']['pt-br'] = "Desligado";
-$text['check-loggedout-status']['pl'] = "Wylogowany";
-$text['check-loggedout-status']['he'] = "התנתק";
-$text['check-loggedout-status']['uk'] = "Вийшов";
-$text['check-loggedout-status']['sv-se'] = "Utloggad";
-$text['check-loggedout-status']['de-at'] = "Abgemeldet";
-$text['check-loggedout-status']['ro'] = "";
-$text['check-loggedout-status']['fa'] = "";
-$text['check-loggedout-status']['ar-eg'] = "تم الخروخ";
-
-$text['check-do-not-disturb-status']['en-us'] = "Do Not Disturb";
-$text['check-do-not-disturb-status']['es-cl'] = "No molestar";
-$text['check-do-not-disturb-status']['pt-pt'] = "Não Perturbar";
-$text['check-do-not-disturb-status']['fr-fr'] = "Ne pas déranger";
-$text['check-do-not-disturb-status']['pt-br'] = "Não Pertube";
-$text['check-do-not-disturb-status']['pl'] = "Nie przeszkadzaj (DND)";
-$text['check-do-not-disturb-status']['he'] = "לא להפריע";
-$text['check-do-not-disturb-status']['uk'] = "Не турбувати";
-$text['check-do-not-disturb-status']['sv-se'] = "Stör Ej";
-$text['check-do-not-disturb-status']['de-at'] = "Nicht stören";
-$text['check-do-not-disturb-status']['ro'] = "Nu deranjați";
-$text['check-do-not-disturb-status']['fa'] = "";
-$text['check-do-not-disturb-status']['ar-eg'] = "عدم الازعاج";
-
-$text['check-available-status']['en-us'] = "Available";
-$text['check-available-status']['es-cl'] = "Disponible";
-$text['check-available-status']['pt-pt'] = "Disponível";
-$text['check-available-status']['fr-fr'] = "Disponible";
-$text['check-available-status']['pt-br'] = "Disponível";
-$text['check-available-status']['pl'] = "Dostępny";
-$text['check-available-status']['he'] = "זמין";
-$text['check-available-status']['uk'] = "Доступний";
-$text['check-available-status']['sv-se'] = "Tillgänglig";
-$text['check-available-status']['de-at'] = "Erreichbar";
-$text['check-available-status']['ro'] = "Disponibil";
-$text['check-available-status']['fa'] = "";
-$text['check-available-status']['ar-eg'] = "متاح";
-
-$text['check-available-ondemand-status']['en-us'] = "Available (On Demand)";
-$text['check-available-ondemand-status']['es-cl'] = "Disponible (A Pedido)";
-$text['check-available-ondemand-status']['pt-pt'] = "Disponível (A Pedido)";
-$text['check-available-ondemand-status']['fr-fr'] = "Disponble (sur demande)";
-$text['check-available-ondemand-status']['pt-br'] = "Disponível (a pedido)";
-$text['check-available-ondemand-status']['pl'] = "Dostepny (na żądanie)";
-$text['check-available-ondemand-status']['he'] = "(זמין (ע״פ דרישה";
-$text['check-available-ondemand-status']['uk'] = "Доступний (на вимогу)";
-$text['check-available-ondemand-status']['sv-se'] = "Tillgänglig (På Begäran)";
-$text['check-available-ondemand-status']['de-at'] = "Erreichbar (bei Bedarf)";
-$text['check-available-ondemand-status']['ro'] = "Disponibil (la cerere)";
-$text['check-available-ondemand-status']['fa'] = "";
-$text['check-available-ondemand-status']['ar-eg'] = "(متاح ( تحت الطلب";
-
-$text['button-voicemail']['en-us'] = "Voicemail";
-$text['button-voicemail']['es-cl'] = "Correo de Voz";
-$text['button-voicemail']['pt-pt'] = "Correio de Voz";
-$text['button-voicemail']['fr-fr'] = "Messagerie Vocale";
-$text['button-voicemail']['pt-br'] = "Correio de voz";
-$text['button-voicemail']['pl'] = "Poczta głosowa";
-$text['button-voicemail']['sv-se'] = "Röstbrevlåda";
-$text['button-voicemail']['uk'] = "Голосова пошта";
-$text['button-voicemail']['de-at'] = "Mailbox";
-$text['button-voicemail']['he'] = "תא קולי";
-
+<?php
+
+$text['title-user_dashboard']['en-us'] = "Dashboard";
+$text['title-user_dashboard']['es-cl'] = "Dashboard Usuario";
+$text['title-user_dashboard']['pt-pt'] = "Painel de Controle do Usuário";
+$text['title-user_dashboard']['fr-fr'] = "Tableau de bord de l'utilisateur";
+$text['title-user_dashboard']['pt-br'] = "Painel de Controle de Usuário";
+$text['title-user_dashboard']['pl'] = "Panel użytkowników";
+$text['title-user_dashboard']['he'] = "ממשק משתמש";
+$text['title-user_dashboard']['uk'] = "Панель користувача";
+$text['title-user_dashboard']['sv-se'] = "Användarpanel";
+$text['title-user_dashboard']['de-at'] = "Benutzerübersicht";
+$text['title-user_dashboard']['ro'] = "Panou control utilizator";
+$text['title-user_dashboard']['fa'] = "";
+$text['title-user_dashboard']['ar-eg'] = "الصفحه الرئيسيه للمستخدم";
+
+$text['title']['en-us'] = "Account Settings";
+$text['title']['es-cl'] = "Configuración de Cuenta";
+$text['title']['pt-pt'] = "Configurações de Conta";
+$text['title']['fr-fr'] = "Personalisation du compte";
+$text['title']['pt-br'] = "Configurações da Conta";
+$text['title']['pl'] = "Ustawienia konta";
+$text['title']['he'] = "הגדרת חשבון";
+$text['title']['uk'] = "Параметри облікового запису";
+$text['title']['sv-se'] = "Kontoinställningar";
+$text['title']['de-at'] = "Kontoeinstellungen";
+$text['title']['ro'] = "Setări cont";
+$text['title']['fa'] = "";
+$text['title']['ar-eg'] = "إعدادات الحساب";
+
+$text['table2-title']['en-us'] = "Additional Info";
+$text['table2-title']['es-cl'] = "Información Adicional";
+$text['table2-title']['pt-pt'] = "Informações Adicionais";
+$text['table2-title']['fr-fr'] = "Informations aditionnelles";
+$text['table2-title']['pt-br'] = "Informações Adicionais";
+$text['table2-title']['pl'] = "Informacje dodatkowe ";
+$text['table2-title']['he'] = "פרטים נוספים";
+$text['table2-title']['uk'] = "Додаткова інформація";
+$text['table2-title']['sv-se'] = "Ytterligare Information";
+$text['table2-title']['de-at'] = "Zusätzliche Informationen";
+$text['table2-title']['ro'] = "Informații adiționale";
+$text['table2-title']['fa'] = "";
+$text['table2-title']['ar-eg'] = "معلومات اضافيه";
+
+$text['table-tools']['en-us'] = "Tools";
+$text['table-tools']['es-cl'] = "Herramientas";
+$text['table-tools']['pt-pt'] = "Ferramentas";
+$text['table-tools']['fr-fr'] = "Outils";
+$text['table-tools']['pt-br'] = "Ferramentas";
+$text['table-tools']['pl'] = "Narzędzia";
+$text['table-tools']['he'] = "כלים";
+$text['table-tools']['uk'] = "Налаштування";
+$text['table-tools']['sv-se'] = "Verktyg";
+$text['table-tools']['de-at'] = "Funktionen";
+$text['table-tools']['ro'] = "Utilitare";
+$text['table-tools']['fa'] = "ابزارها";
+$text['table-tools']['ar-eg'] = "الادوات";
+
+$text['table-title']['en-us'] = "User Info";
+$text['table-title']['es-cl'] = "Información de Usuario";
+$text['table-title']['pt-pt'] = "Informações de Utilizador";
+$text['table-title']['fr-fr'] = "Informations de l'usager";
+$text['table-title']['pt-br'] = "Informações do Usuário";
+$text['table-title']['pl'] = "Informacje o użytkowniku";
+$text['table-title']['he'] = "פרטי משתמש";
+$text['table-title']['uk'] = "Інформація про користувача";
+$text['table-title']['sv-se'] = "Användarinformation";
+$text['table-title']['de-at'] = "Benutzerinformationen";
+$text['table-title']['ro'] = "Informații Utilizator";
+$text['table-title']['fa'] = "اطلاعات کاربر";
+$text['table-title']['ar-eg'] = "بيانات المستخدم";
+
+$text['table-extension']['en-us'] = "Extension";
+$text['table-extension']['es-cl'] = "Extensión";
+$text['table-extension']['pt-pt'] = "Extensão";
+$text['table-extension']['fr-fr'] = "Extension";
+$text['table-extension']['pt-br'] = "Ramal";
+$text['table-extension']['pl'] = "Numer wewnętrzny";
+$text['table-extension']['he'] = "שלוחה";
+$text['table-extension']['uk'] = "Розширення (Extention)";
+$text['table-extension']['sv-se'] = "Anknytning";
+$text['table-extension']['de-at'] = "Durchwahl";
+$text['table-extension']['ro'] = "Extensie";
+$text['table-extension']['fa'] = "";
+$text['table-extension']['ar-eg'] = "رقم داخلي";
+
+$text['table-description']['en-us'] = "Description";
+$text['table-description']['es-cl'] = "Descripción";
+$text['table-description']['pt-pt'] = "Descrição";
+$text['table-description']['fr-fr'] = "Description";
+$text['table-description']['pt-br'] = "Descrição";
+$text['table-description']['pl'] = "Opis";
+$text['table-description']['he'] = "תיאור";
+$text['table-description']['uk'] = "Опис";
+$text['table-description']['sv-se'] = "Beskrivning";
+$text['table-description']['de-at'] = "Beschreibung";
+$text['table-description']['ro'] = "Descriere";
+$text['table-description']['fa'] = "";
+$text['table-description']['ar-eg'] = "الوصف";
+
+$text['message-reset_link_sent']['en-us'] = "Password Reset Link Sent";
+$text['message-reset_link_sent']['es-cl'] = "Restablecer Contraseña de Conexión Enviados";
+$text['message-reset_link_sent']['pt-pt'] = "Password Reset Link Enviado";
+$text['message-reset_link_sent']['fr-fr'] = "Lien de réinitialisation de mot de passe envoyé";
+$text['message-reset_link_sent']['pt-br'] = "Link para redefinir senha enviado";
+$text['message-reset_link_sent']['pl'] = "Link do resetowania hasla zostal wyslany";
+$text['message-reset_link_sent']['he'] = "קישור לאיפוס סיסמה נשלח";
+$text['message-reset_link_sent']['uk'] = "Посилання на скидання пароля відправлено";
+$text['message-reset_link_sent']['sv-se'] = "Återställnings Länk för Lösenord Skickat";
+$text['message-reset_link_sent']['de-at'] = "Link zum Zurücksetzen des Passworts gesendet";
+$text['message-reset_link_sent']['ro'] = "Link pentru resetare parolă trimis";
+$text['message-reset_link_sent']['fa'] = "";
+$text['message-reset_link_sent']['ar-eg'] = "تم ارسال رابط اعادة تعيين كلمة السر";
+
+$text['message-password_reset']['en-us'] = "Password Reset";
+$text['message-password_reset']['es-cl'] = "Restablecer Contraseña";
+$text['message-password_reset']['pt-pt'] = "Password Reset";
+$text['message-password_reset']['fr-fr'] = "Réinitialiser votre mot de passe";
+$text['message-password_reset']['pt-br'] = "Redefinir Senha";
+$text['message-password_reset']['pl'] = "Resetowanie hasła";
+$text['message-password_reset']['he'] = "איפוס סיסמה";
+$text['message-password_reset']['uk'] = "Скинути пароль";
+$text['message-password_reset']['sv-se'] = "Återställning Av Lösenord";
+$text['message-password_reset']['de-at'] = "Passwort zurücksetzen";
+$text['message-password_reset']['ro'] = "Resetare parolă";
+$text['message-password_reset']['fa'] = "";
+$text['message-password_reset']['ar-eg'] = "اعادة تعيين كلمة السر";
+
+$text['message-invalid_username_mismatch_passwords']['en-us'] = "Invalid Username and/or Mismatched Passwords";
+$text['message-invalid_username_mismatch_passwords']['es-cl'] = "Nombre de usuario válido y/o contraseñas no coincidentes";
+$text['message-invalid_username_mismatch_passwords']['pt-pt'] = "Nome de usuário inválido e/ou palavras-passe não correspondentes";
+$text['message-invalid_username_mismatch_passwords']['fr-fr'] = "Nom d'utilisateur invalide et/ou les mots de passe ne correspondent pas";
+$text['message-invalid_username_mismatch_passwords']['pt-br'] = "Nome de usuário inválido e/ou senha incorreta";
+$text['message-invalid_username_mismatch_passwords']['pl'] = "Nieprawidłowa nazwa użytkownika lub/i niepoprawne hasła";
+$text['message-invalid_username_mismatch_passwords']['he'] = "שם משתמש או סיסמה  לא נכונים";
+$text['message-invalid_username_mismatch_passwords']['uk'] = "Неправильні ім’я користувача та/або пароль";
+$text['message-invalid_username_mismatch_passwords']['sv-se'] = "Ogiltig Användarnamn och / eller Felaktigt Lösenord";
+$text['message-invalid_username_mismatch_passwords']['de-at'] = "Falscher Benutzername und/oder Nichtübereinstimmung der Passwörter";
+$text['message-invalid_username_mismatch_passwords']['ro'] = "Nume utilizator invalid si/sau nepotrivire parole";
+$text['message-invalid_username_mismatch_passwords']['fa'] = "";
+$text['message-invalid_username_mismatch_passwords']['ar-eg'] = "خطا في اسم المسخدم او كلمة السر";
+
+$text['message-invalid_email']['en-us'] = "Invalid Email Address";
+$text['message-invalid_email']['es-cl'] = "Dirección no válida de correo electrónico";
+$text['message-invalid_email']['pt-pt'] = "Endereço inválido Email";
+$text['message-invalid_email']['fr-fr'] = "Adresse email invalide";
+$text['message-invalid_email']['pt-br'] = "Endereço de E-mail Inválido";
+$text['message-invalid_email']['pl'] = "Nieprawidłowy adres email";
+$text['message-invalid_email']['he'] = "כתובת דואר מייל לא תקינה";
+$text['message-invalid_email']['uk'] = "Некоректна адреса E-Mail";
+$text['message-invalid_email']['sv-se'] = "Ogiltig E-postadress";
+$text['message-invalid_email']['de-at'] = "Ungültige E-Mail-Adresse";
+$text['message-invalid_email']['ro'] = "Adresă Email invalidă";
+$text['message-invalid_email']['fa'] = "";
+$text['message-invalid_email']['ar-eg'] = "البريد الإلكتروني غير صحيح";
+
+$text['login-message_dismiss']['en-us'] = "Dismiss";
+$text['login-message_dismiss']['es-cl'] = "Despedir";
+$text['login-message_dismiss']['pt-pt'] = "Demitir";
+$text['login-message_dismiss']['fr-fr'] = "Rejeter";
+$text['login-message_dismiss']['pt-br'] = "Descartar";
+$text['login-message_dismiss']['pl'] = "Odrzuć";
+$text['login-message_dismiss']['he'] = "משוחרר";
+$text['login-message_dismiss']['uk'] = "Звільнити";
+$text['login-message_dismiss']['sv-se'] = "Avvisa";
+$text['login-message_dismiss']['de-at'] = "Verwerfen";
+$text['login-message_dismiss']['ro'] = "Renunță";
+$text['login-message_dismiss']['fa'] = "";
+$text['login-message_dismiss']['ar-eg'] = "تجاهل";
+
+$text['login-message_attention']['en-us'] = "Attention!";
+$text['login-message_attention']['es-cl'] = "¡Atención!";
+$text['login-message_attention']['pt-pt'] = "Atenção!";
+$text['login-message_attention']['fr-fr'] = "Attention!";
+$text['login-message_attention']['pt-br'] = "Atenção!";
+$text['login-message_attention']['pl'] = "Uwaga";
+$text['login-message_attention']['he'] = "!שים לב";
+$text['login-message_attention']['uk'] = "Увага!";
+$text['login-message_attention']['sv-se'] = "Observera!";
+$text['login-message_attention']['de-at'] = "Achtung!";
+$text['login-message_attention']['ro'] = "Atenție!";
+$text['login-message_attention']['fa'] = "";
+$text['login-message_attention']['ar-eg'] = "برجاء الملاحظة";
+
+$text['label-welcome']['en-us'] = "Welcome:";
+$text['label-welcome']['es-cl'] = "Bienvenido:";
+$text['label-welcome']['pt-pt'] = "Witamy:";
+$text['label-welcome']['fr-fr'] = "Bienvenue:";
+$text['label-welcome']['pt-br'] = "Bem vinda:";
+$text['label-welcome']['pl'] = "Witamy:";
+$text['label-welcome']['he'] = "ברוך הבא:";
+$text['label-welcome']['uk'] = "Ласкаво просимо:";
+$text['label-welcome']['sv-se'] = "Välkomna:";
+$text['label-welcome']['de-at'] = "Herzlich willkommen:";
+$text['label-welcome']['ro'] = "Bine ati venit:";
+$text['label-welcome']['fa'] = "";
+$text['label-welcome']['ar-eg'] = "أهلا بك:";
+
+$text['label-voicemail']['en-us'] = "Voicemail";
+$text['label-voicemail']['es-cl'] = "Correo de Voz";
+$text['label-voicemail']['pt-pt'] = "Correio de Voz";
+$text['label-voicemail']['fr-fr'] = "Messagerie Vocale";
+$text['label-voicemail']['pt-br'] = "Correio de voz";
+$text['label-voicemail']['pl'] = "Poczta głosowa";
+$text['label-voicemail']['sv-se'] = "Röstbrevlåda";
+$text['label-voicemail']['uk'] = "Голосова пошта";
+$text['label-voicemail']['de-at'] = "Mailbox";
+$text['label-voicemail']['he'] = "תא קולי";
+
+$text['label-view_all']['en-us'] = "View All";
+$text['label-view_all']['es-cl'] = "Mostrar Todos";
+$text['label-view_all']['pt-pt'] = "Mostrar Todos";
+$text['label-view_all']['fr-fr'] = "Tout Montrer";
+$text['label-view_all']['pl'] = "Pokaż wszystkie";
+$text['label-view_all']['uk'] = "Показати всі";
+$text['label-view_all']['sv-se'] = "Visa Allt";
+$text['label-view_all']['ro'] = "";
+$text['label-view_all']['de-at'] = "Alle anzeigen";
+$text['label-view_all']['he'] = "הצג הכל";
+
+$text['label-value']['en-us'] = "Value";
+$text['label-value']['es-cl'] = "Valor";
+$text['label-value']['pt-pt'] = "Valor";
+$text['label-value']['fr-fr'] = "Valeur";
+$text['label-value']['nl-nl'] = "";
+$text['label-value']['pt-br'] = "Valor";
+$text['label-value']['pl'] = "Wartość";
+$text['label-value']['sv-se'] = "Värde";
+$text['label-value']['uk'] = "Значення";
+$text['label-value']['de-at'] = "Wert";
+
+$text['label-username']['en-us'] = "Username";
+$text['label-username']['es-cl'] = "Nombre de Usuario";
+$text['label-username']['pt-pt'] = "Nome de Utilizador";
+$text['label-username']['fr-fr'] = "Nom d'utilisateur";
+$text['label-username']['pt-br'] = "Nome do Usuário";
+$text['label-username']['pl'] = "Użytkownik";
+$text['label-username']['he'] = "שם משתמש";
+$text['label-username']['uk'] = "Ім’я користувача";
+$text['label-username']['sv-se'] = "Användarnamn";
+$text['label-username']['de-at'] = "Benutzername";
+$text['label-username']['ro'] = "Utilizator";
+$text['label-username']['fa'] = "";
+$text['label-username']['ar-eg'] = "اسم المستخدم";
+
+$text['label-users']['en-us'] = "Users";
+$text['label-users']['es-cl'] = "Usuarios";
+$text['label-users']['pt-pt'] = "Utilizadores";
+$text['label-users']['fr-fr'] = "Utilisateurs";
+$text['label-users']['pt-br'] = "Usuários";
+$text['label-users']['pl'] = "Użytkownicy";
+$text['label-users']['sv-se'] = "Användare";
+$text['label-users']['uk'] = "Користувачі";
+$text['label-users']['de-at'] = "Benutzer";
+
+$text['label-user_language']['en-us'] = "Language";
+$text['label-user_language']['es-cl'] = "Lengua";
+$text['label-user_language']['pt-pt'] = "Língua";
+$text['label-user_language']['fr-fr'] = "Langue";
+$text['label-user_language']['pt-br'] = "Idioma";
+$text['label-user_language']['pl'] = "Język";
+$text['label-user_language']['he'] = "שפה";
+$text['label-user_language']['uk'] = "Мова";
+$text['label-user_language']['sv-se'] = "Språk";
+$text['label-user_language']['de-at'] = "Sprache";
+$text['label-user_language']['ro'] = "Limbă";
+$text['label-user_language']['fa'] = "";
+$text['label-user_language']['ar-eg'] = "اللغه";
+
+$text['label-used']['en-us'] = "Used";
+$text['label-used']['es-cl'] = "Usado";
+$text['label-used']['pt-pt'] = "Usava";
+$text['label-used']['fr-fr'] = "Utilisé";
+$text['label-used']['pt-br'] = "Usava";
+$text['label-used']['pl'] = "Używany";
+$text['label-used']['he'] = "מְשׁוּמָשׁ";
+$text['label-used']['uk'] = "використовується";
+$text['label-used']['sv-se'] = "Begagnade";
+$text['label-used']['de-at'] = "Benutzt";
+$text['label-used']['ro'] = "Folosit";
+$text['label-used']['fa'] = "";
+$text['label-used']['ar-eg'] = "مستعمل";
+
+$text['label-total_extensions']['en-us'] = "Total Extensions";
+$text['label-total_extensions']['es-cl'] = "Las extensiones totales";
+$text['label-total_extensions']['pt-pt'] = "total de extensões";
+$text['label-total_extensions']['fr-fr'] = "total des extensions";
+$text['label-total_extensions']['pt-br'] = "total de extensões";
+$text['label-total_extensions']['pl'] = "Wszystkich Rozszerzenia";
+$text['label-total_extensions']['he'] = "רוזן רחב";
+$text['label-total_extensions']['uk'] = "всього розширень";
+$text['label-total_extensions']['sv-se'] = "Totalt Extensions";
+$text['label-total_extensions']['de-at'] = "insgesamt Extensions";
+$text['label-total_extensions']['ro'] = "Extensii totale";
+$text['label-total_extensions']['fa'] = "";
+$text['label-total_extensions']['ar-eg'] = "مجموع الإضافات";
+
+$text['label-total_destinations']['en-us'] = "Total Destinations";
+$text['label-total_destinations']['es-cl'] = "destinos totales";
+$text['label-total_destinations']['pt-pt'] = "total de Destino";
+$text['label-total_destinations']['fr-fr'] = "total des destinations";
+$text['label-total_destinations']['pt-br'] = "total de Destino";
+$text['label-total_destinations']['pl'] = "Wszystkich Kierunki";
+$text['label-total_destinations']['he'] = "רוזן יעד";
+$text['label-total_destinations']['uk'] = "всього Напрями";
+$text['label-total_destinations']['sv-se'] = "Totalt resmål";
+$text['label-total_destinations']['de-at'] = "insgesamt Reiseziele";
+$text['label-total_destinations']['ro'] = "Destinații totale";
+$text['label-total_destinations']['fa'] = "";
+$text['label-total_destinations']['ar-eg'] = "مجموع ظبي";
+
+$text['label-total']['en-us'] = "Total";
+$text['label-total']['es-cl'] = "Total";
+$text['label-total']['pt-pt'] = "Total";
+$text['label-total']['fr-fr'] = "Total";
+$text['label-total']['pt-br'] = "Total";
+$text['label-total']['pl'] = "Podsumowanie";
+$text['label-total']['sv-se'] = "Totalt";
+$text['label-total']['uk'] = "Всього";
+$text['label-total']['de-at'] = "Total";
+$text['label-total']['he'] = "סה״כ";
+
+$text['label-time']['en-us'] = "Time Zone";
+$text['label-time']['es-cl'] = "Zona Horaria";
+$text['label-time']['pt-pt'] = "Fuso Horário";
+$text['label-time']['fr-fr'] = "Fuseau Horaire";
+$text['label-time']['pt-br'] = "Fuso Horário";
+$text['label-time']['pl'] = "Strefa czasowa";
+$text['label-time']['he'] = "אזור זמן";
+$text['label-time']['uk'] = "Часовий пояс";
+$text['label-time']['sv-se'] = "Tidszon";
+$text['label-time']['de-at'] = "Zeitzone";
+$text['label-time']['ro'] = "Zonă fus orar";
+$text['label-time']['fa'] = "";
+$text['label-time']['ar-eg'] = "منطقة التوقيت";
+
+$text['label-system_uptime']['en-us'] = "OS Uptime";
+$text['label-system_uptime']['es-cl'] = "Tiempo de actividad del sistema";
+$text['label-system_uptime']['pt-pt'] = "Uptime sistema";
+$text['label-system_uptime']['fr-fr'] = "système Uptime";
+$text['label-system_uptime']['pt-br'] = "Uptime sistema";
+$text['label-system_uptime']['pl'] = "System Uptime";
+$text['label-system_uptime']['he'] = "מערכת Uptime";
+$text['label-system_uptime']['uk'] = "час роботи системи";
+$text['label-system_uptime']['sv-se'] = "System Uptime";
+$text['label-system_uptime']['de-at'] = "System-Uptime";
+$text['label-system_uptime']['ro'] = "sistemul Uptime";
+$text['label-system_uptime']['fa'] = "";
+$text['label-system_uptime']['ar-eg'] = "نظام الجهوزية";
+
+$text['label-system_status']['en-us'] = "System Status";
+$text['label-system_status']['es-cl'] = "Estado del sistema";
+$text['label-system_status']['pt-pt'] = "Status do sistema";
+$text['label-system_status']['fr-fr'] = "État du système";
+$text['label-system_status']['pt-br'] = "Status do sistema";
+$text['label-system_status']['pl'] = "Status systemu";
+$text['label-system_status']['he'] = "סטטוס מערכת";
+$text['label-system_status']['uk'] = "стан системи";
+$text['label-system_status']['sv-se'] = "Systemstatus ";
+$text['label-system_status']['de-at'] = "Systemstatus";
+$text['label-system_status']['ro'] = "Stare sistem";
+$text['label-system_status']['fa'] = "";
+$text['label-system_status']['ar-eg'] = "حالة النظام";
+
+$text['label-system_counts']['en-us'] = "System Counts";
+$text['label-system_counts']['es-cl'] = "Cuenta del sistema";
+$text['label-system_counts']['pt-pt'] = "contagens do sistema";
+$text['label-system_counts']['fr-fr'] = "Chiffres de système";
+$text['label-system_counts']['pt-br'] = "contagens do sistema";
+$text['label-system_counts']['pl'] = "Liczy systemowe";
+$text['label-system_counts']['he'] = "ספירת מערכת";
+$text['label-system_counts']['uk'] = "система зараховує";
+$text['label-system_counts']['sv-se'] = "System Counts";
+$text['label-system_counts']['de-at'] = "System zählt";
+$text['label-system_counts']['ro'] = "Numără sistem";
+$text['label-system_counts']['fa'] = "";
+$text['label-system_counts']['ar-eg'] = "التهم النظام";
+
+$text['label-switch_uptime']['en-us'] = "Switch Uptime";
+$text['label-switch_uptime']['es-cl'] = "Tiempo de actividad Switch";
+$text['label-switch_uptime']['pt-pt'] = "Uptime Switch";
+$text['label-switch_uptime']['fr-fr'] = "Switch Uptime";
+$text['label-switch_uptime']['pt-br'] = "Uptime Switch";
+$text['label-switch_uptime']['pl'] = "Switch Uptime";
+$text['label-switch_uptime']['sv-se'] = "Switch Uptime";
+$text['label-switch_uptime']['uk'] = "Switch Uptime";
+$text['label-switch_uptime']['de-at'] = "Switch Uptime";
+
+$text['label-switch']['en-us'] = "Switch";
+$text['label-switch']['es-cl'] = "Switch";
+$text['label-switch']['pt-pt'] = "Switch";
+$text['label-switch']['fr-fr'] = "Switch";
+$text['label-switch']['pt-br'] = "Switch";
+$text['label-switch']['pl'] = "Switch";
+$text['label-switch']['sv-se'] = "Switch";
+$text['label-switch']['uk'] = "Switch";
+$text['label-switch']['de-at'] = "Switch";
+
+$text['label-status']['en-us'] = "Status";
+$text['label-status']['es-cl'] = "Estado";
+$text['label-status']['pt-pt'] = "Estado";
+$text['label-status']['fr-fr'] = "Etat";
+$text['label-status']['pt-br'] = "Estado";
+$text['label-status']['pl'] = "Status";
+$text['label-status']['he'] = "סטטוס";
+$text['label-status']['uk'] = "Статус";
+$text['label-status']['sv-se'] = "Status";
+$text['label-status']['de-at'] = "Status";
+$text['label-status']['ro'] = "Stare";
+$text['label-status']['fa'] = "";
+$text['label-status']['ar-eg'] = "الحالة";
+
+$text['label-ring_groups']['en-us'] = "Ring Groups";
+$text['label-ring_groups']['es-cl'] = "Grupo de llamado";
+$text['label-ring_groups']['fr-fr'] = "Groupes de Sonnerie";
+$text['label-ring_groups']['pt-pt'] = "Grupos";
+$text['label-ring_groups']['pt-br'] = "Configurações da Conta";
+$text['label-ring_groups']['pl'] = "Grupy odbiorców rozmów";
+$text['label-ring_groups']['sv-se'] = "Ringgrupper";
+$text['label-ring_groups']['uk'] = "Групи";
+$text['label-ring_groups']['de-at'] = "Rufgruppen";
+$text['label-ring_groups']['he'] = "קבוצות חיוג";
+
+$text['label-reset_password']['en-us'] = "Reset Password";
+$text['label-reset_password']['es-cl'] = "Restablecer contraseña";
+$text['label-reset_password']['pt-pt'] = "Reset Password";
+$text['label-reset_password']['fr-fr'] = "Réinitialiser le mot de passe";
+$text['label-reset_password']['pt-br'] = "Redefinir Senha";
+$text['label-reset_password']['pl'] = "Resetowanie hasla";
+$text['label-reset_password']['he'] = "אפס סיסמה";
+$text['label-reset_password']['uk'] = "Скинути пароль";
+$text['label-reset_password']['sv-se'] = "Återställ Lösenord";
+$text['label-reset_password']['de-at'] = "Passwort zurücksetzen";
+$text['label-reset_password']['ro'] = "Resetare parolă";
+$text['label-reset_password']['fa'] = "";
+$text['label-reset_password']['ar-eg'] = "اعادة تعيين كلمة السر";
+
+$text['label-reset_link']['en-us'] = "Password Reset Link";
+$text['label-reset_link']['es-cl'] = "Password Reset Enlace";
+$text['label-reset_link']['pt-pt'] = "Password Reset Link";
+$text['label-reset_link']['fr-fr'] = "Lien de réinitialisation du mot de passe";
+$text['label-reset_link']['pt-br'] = "Link para Redefinir Senha";
+$text['label-reset_link']['pl'] = "Link do resetowania hasla";
+$text['label-reset_link']['he'] = "קישור לאיפוס סיסמה";
+$text['label-reset_link']['uk'] = "Посилання на скидання пароля";
+$text['label-reset_link']['sv-se'] = "Länk för Återställning av Lösenord";
+$text['label-reset_link']['de-at'] = "Link zum Zurücksetzen des Passworts";
+$text['label-reset_link']['ro'] = "Link resetare parolă";
+$text['label-reset_link']['fa'] = "";
+$text['label-reset_link']['ar-eg'] = " رابط اعادة تعيين كلمة السر";
+
+$text['label-repeat_password']['en-us'] = "Repeat Password";
+$text['label-repeat_password']['es-cl'] = "Repita la Contraseña";
+$text['label-repeat_password']['pt-pt'] = "Repita a Senha";
+$text['label-repeat_password']['fr-fr'] = "Répéter le mot de passe";
+$text['label-repeat_password']['pt-br'] = "Repita a Senha";
+$text['label-repeat_password']['pl'] = "Wpisz ponownie hasło ";
+$text['label-repeat_password']['he'] = "חזור על הסיסמה";
+$text['label-repeat_password']['uk'] = "Повторіть пароль";
+$text['label-repeat_password']['sv-se'] = "Repetera Lösenord";
+$text['label-repeat_password']['de-at'] = "Passwort wiederholen";
+$text['label-repeat_password']['ro'] = "Repetare parolă";
+$text['label-repeat_password']['fa'] = "";
+$text['label-repeat_password']['ar-eg'] = "تاكيد كلمة السر";
+
+$text['label-registrations']['en-us'] = "Registrations";
+$text['label-registrations']['es-cl'] = "Inscripciones";
+$text['label-registrations']['pt-pt'] = "Inscrições";
+$text['label-registrations']['fr-fr'] = "Enregistrements SIP";
+$text['label-registrations']['pt-br'] = "Inscrições";
+$text['label-registrations']['pl'] = "Rejestracje";
+$text['label-registrations']['sv-se'] = "Registreringar";
+$text['label-registrations']['uk'] = "Реєстрації";
+$text['label-registrations']['de-at'] = "Registrierungen";
+
+$text['label-recent_calls']['en-us'] = "Recent Calls";
+$text['label-recent_calls']['es-cl'] = "Llamadas recientes";
+$text['label-recent_calls']['fr-fr'] = "Appels récents";
+$text['label-recent_calls']['pt-pt'] = "chamadas recentes";
+$text['label-recent_calls']['pt-br'] = "chamadas recentes";
+$text['label-recent_calls']['pl'] = "Ostatnie połączenia";
+$text['label-recent_calls']['sv-se'] = "Samtals";
+$text['label-recent_calls']['de-at'] = "Kürzliche Anrufe";
+$text['label-recent_calls']['ar-eg'] = "المكالمات الأخيرة";
+$text['label-recent_calls']['he'] = "שיחות אחרונות";
+
+$text['label-processor_usage']['en-us'] = "CPU Usage";
+$text['label-processor_usage']['es-cl'] = "uso del procesador";
+$text['label-processor_usage']['pt-pt'] = "O uso do processador";
+$text['label-processor_usage']['fr-fr'] = "processeur Utilisation";
+$text['label-processor_usage']['pt-br'] = "O uso do processador";
+$text['label-processor_usage']['pl'] = "Wykorzystanie procesora";
+$text['label-processor_usage']['he'] = "שימוש מעבד";
+$text['label-processor_usage']['uk'] = "Використання процесора";
+$text['label-processor_usage']['sv-se'] = "processor Usage";
+$text['label-processor_usage']['de-at'] = "Prozessorauslastung ";
+$text['label-processor_usage']['ro'] = "procesor de utilizare";
+$text['label-processor_usage']['fa'] = "";
+$text['label-processor_usage']['ar-eg'] = "معالج الاستخدام";
+
+$text['label-password']['en-us'] = "Password";
+$text['label-password']['es-cl'] = "Contraseña";
+$text['label-password']['pt-pt'] = "Password";
+$text['label-password']['fr-fr'] = "Mot de passe";
+$text['label-password']['pt-br'] = "Senha";
+$text['label-password']['pl'] = "Hasło";
+$text['label-password']['he'] = "סיסמה";
+$text['label-password']['uk'] = "Пароль";
+$text['label-password']['sv-se'] = "Lösenord";
+$text['label-password']['de-at'] = "Passwort";
+$text['label-password']['ro'] = "Parolă";
+$text['label-password']['fa'] = "";
+$text['label-password']['ar-eg'] = "كلمة السر";
+
+$text['label-outbound']['en-us'] = "Outbound";
+$text['label-outbound']['es-cl'] = "Salida";
+$text['label-outbound']['pt-pt'] = "Saída";
+$text['label-outbound']['fr-fr'] = "Sortant";
+$text['label-outbound']['pt-br'] = "Saída";
+$text['label-outbound']['pl'] = "Wychodzące";
+$text['label-outbound']['sv-se'] = "Utgående";
+$text['label-outbound']['uk'] = "";
+$text['label-outbound']['de-at'] = "Ausgehend";
+$text['label-outbound']['he'] = "";
+
+$text['label-no_voicemail_assigned']['en-us'] = "No Voicemail Assigned";
+$text['label-no_voicemail_assigned']['es-cl'] = "No Asignado correo de voz";
+$text['label-no_voicemail_assigned']['pt-pt'] = "Sem Voicemail Assigned";
+$text['label-no_voicemail_assigned']['fr-fr'] = "Non Voicemail Assigné";
+$text['label-no_voicemail_assigned']['pt-br'] = "Sem Voicemail Assigned";
+$text['label-no_voicemail_assigned']['pl'] = "Nie głosowa Przypisany";
+$text['label-no_voicemail_assigned']['he'] = "אין שירות תא קולי Assigned";
+$text['label-no_voicemail_assigned']['uk'] = "Ні Voicemail Assigned";
+$text['label-no_voicemail_assigned']['sv-se'] = "Ingen röstmeddelande Delad";
+$text['label-no_voicemail_assigned']['de-at'] = "Nein Voicemail Assigned";
+$text['label-no_voicemail_assigned']['ro'] = "Nr Mesagerie vocală alocate";
+$text['label-no_voicemail_assigned']['fa'] = "";
+$text['label-no_voicemail_assigned']['ar-eg'] = "لا المخصصة البريد الصوتي";
+
+$text['label-new_password']['en-us'] = "New Password";
+$text['label-new_password']['es-cl'] = "Nueva Contraseña";
+$text['label-new_password']['pt-pt'] = "Nova Senha";
+$text['label-new_password']['fr-fr'] = "Nouveau mot de passe";
+$text['label-new_password']['pt-br'] = "Nova Senha";
+$text['label-new_password']['pl'] = "Nowe haslo";
+$text['label-new_password']['he'] = "סיסמה חדשה";
+$text['label-new_password']['uk'] = "Новий пароль";
+$text['label-new_password']['sv-se'] = "Nytt Lösenord";
+$text['label-new_password']['de-at'] = "Neues Passwort";
+$text['label-new_password']['ro'] = "Parolă nouă";
+$text['label-new_password']['fa'] = "";
+$text['label-new_password']['ar-eg'] = "كلمة سر جديدة";
+
+$text['label-new_messages']['en-us'] = "New Messages";
+$text['label-new_messages']['es-cl'] = "Nuevos mensajes";
+$text['label-new_messages']['pt-pt'] = "Novas mensagens";
+$text['label-new_messages']['fr-fr'] = "Nouveaux messages";
+$text['label-new_messages']['pt-br'] = "Novas mensagens";
+$text['label-new_messages']['pl'] = "Nowe wiadomości";
+$text['label-new_messages']['he'] = "הודעות חדשות";
+$text['label-new_messages']['uk'] = "нові повідомлення";
+$text['label-new_messages']['sv-se'] = "нові повідомлення";
+$text['label-new_messages']['de-at'] = "Neue Nachrichten";
+$text['label-new_messages']['ro'] = "Mesaje noi";
+$text['label-new_messages']['fa'] = "";
+$text['label-new_messages']['ar-eg'] = "رسائل جديدة";
+
+$text['label-new']['en-us'] = "New";
+$text['label-new']['es-cl'] = "Nueva";
+$text['label-new']['pt-pt'] = "Nova";
+$text['label-new']['fr-fr'] = "Nouveau";
+$text['label-new']['pt-br'] = "Nova";
+$text['label-new']['pl'] = "Nowy";
+$text['label-new']['sv-se'] = "Nytt";
+$text['label-new']['de-at'] = "Neu";
+$text['label-new']['ro'] = "Nou";
+$text['label-new']['he'] = "חדש";
+
+$text['label-missed_calls']['en-us'] = "Missed Calls";
+$text['label-missed_calls']['es-cl'] = "Llamadas perdidas";
+$text['label-missed_calls']['fr-fr'] = "Appels manqués";
+$text['label-missed_calls']['pt-pt'] = "Chamadas perdidas";
+$text['label-missed_calls']['pt-br'] = "Chamadas perdidas";
+$text['label-missed_calls']['pl'] = "Nieodebrane połączenie";
+$text['label-missed_calls']['sv-se'] = "Missade samtal";
+$text['label-missed_calls']['de-at'] = "Anrufe in Abwesenheit";
+$text['label-missed_calls']['ar-eg'] = "مكالمات فائتة";
+$text['label-missed_calls']['he'] = "שיחות שלא נענו";
+
+$text['label-missed']['en-us'] = "Missed";
+$text['label-missed']['es-cl'] = "Perdido";
+$text['label-missed']['fr-fr'] = "Raté";
+$text['label-missed']['pt-pt'] = "Perdidas";
+$text['label-missed']['pt-br'] = "Perdidas";
+$text['label-missed']['pl'] = "Nie odebrany";
+$text['label-missed']['sv-se'] = "Missade";
+$text['label-missed']['de-at'] = "Verpasst";
+$text['label-missed']['ar-eg'] = "";
+$text['label-missed']['he'] = "שיחה שלא נענתה";
+
+$text['label-messages']['en-us'] = "Messages";
+$text['label-messages']['es-cl'] = "Mensajes";
+$text['label-messages']['pt-pt'] = "mensagens";
+$text['label-messages']['fr-fr'] = "Messages";
+$text['label-messages']['pt-br'] = "mensagens";
+$text['label-messages']['pl'] = "Wiadomości";
+$text['label-messages']['uk'] = "повідомлення";
+$text['label-messages']['sv-se'] = "meddelanden";
+$text['label-messages']['ro'] = "mesaje";
+$text['label-messages']['de-at'] = "Nachrichten";
+$text['label-messages']['ar-eg'] = "رسائل";
+$text['label-messages']['he'] = "הודעות";
+
+$text['label-memory_usage']['en-us'] = "Memory Usage";
+$text['label-memory_usage']['es-cl'] = "Uso de memoria";
+$text['label-memory_usage']['pt-pt'] = "Uso de memória";
+$text['label-memory_usage']['fr-fr'] = "Utilisation de la mémoire";
+$text['label-memory_usage']['pt-br'] = "Uso de memória";
+$text['label-memory_usage']['pl'] = "Zużycie pamięci";
+$text['label-memory_usage']['he'] = "שימוש בזיכרון";
+$text['label-memory_usage']['uk'] = "Використання пам'яті";
+$text['label-memory_usage']['sv-se'] = "Minnesanvändning";
+$text['label-memory_usage']['de-at'] = "Speichernutzung";
+$text['label-memory_usage']['ro'] = "Folosirea memoriei";
+$text['label-memory_usage']['fa'] = "";
+$text['label-memory_usage']['ar-eg'] = "استخدام الذاكرة";
+
+$text['label-local']['en-us'] = "Local";
+$text['label-local']['es-cl'] = "Local";
+$text['label-local']['pt-pt'] = "Local";
+$text['label-local']['fr-fr'] = "Local";
+$text['label-local']['pt-br'] = "Local";
+$text['label-local']['pl'] = "Lokalne";
+$text['label-local']['sv-se'] = "Lokal";
+$text['label-local']['uk'] = "Локальний";
+$text['label-local']['de-at'] = "Lokal";
+$text['label-local']['he'] = "מקומי";
+
+$text['label-last_24_hours']['en-us'] = "Last 24 Hours";
+$text['label-last_24_hours']['es-cl'] = "Últimas 24 horas";
+$text['label-last_24_hours']['pt-pt'] = "Nas últimas 24 horas";
+$text['label-last_24_hours']['fr-fr'] = "Dernières 24 heures";
+$text['label-last_24_hours']['pt-br'] = "Nas últimas 24 horas";
+$text['label-last_24_hours']['pl'] = "Ostatnie 24 godziny";
+$text['label-last_24_hours']['he'] = "לאחרונה עשרים וארבע שעות";
+$text['label-last_24_hours']['uk'] = "Останні 24 годин";
+$text['label-last_24_hours']['sv-se'] = "Senaste 24 timmarna";
+$text['label-last_24_hours']['de-at'] = "Die letzten 24 Stunden";
+$text['label-last_24_hours']['ro'] = "Ultimele 24 de ore";
+$text['label-last_24_hours']['fa'] = "";
+$text['label-last_24_hours']['ar-eg'] = "الماضي أربع وعشرين ساعة";
+
+$text['label-ivr_menus']['en-us'] = "IVR Menus";
+$text['label-ivr_menus']['es-cl'] = "Menus IVR";
+$text['label-ivr_menus']['pt-pt'] = "Menus de IVR";
+$text['label-ivr_menus']['fr-fr'] = "Menus SVI";
+$text['label-ivr_menus']['pt-br'] = "Menus de IVR";
+$text['label-ivr_menus']['pl'] = "Menu zapowiedzi głosowych (IVR)";
+$text['label-ivr_menus']['sv-se'] = "IVR Menyer";
+$text['label-ivr_menus']['de-at'] = "Automatische Vermittlungen";
+
+$text['label-inbound']['en-us'] = "Inbound";
+$text['label-inbound']['es-cl'] = "Entrada";
+$text['label-inbound']['pt-pt'] = "Entrada";
+$text['label-inbound']['fr-fr'] = "Entrant";
+$text['label-inbound']['pt-br'] = "Entrada";
+$text['label-inbound']['pl'] = "Przychodzące";
+$text['label-inbound']['sv-se'] = "Inkommande";
+$text['label-inbound']['uk'] = "Вихідний";
+$text['label-inbound']['de-at'] = "Eingehend";
+$text['label-inbound']['he'] = "";
+
+$text['label-item']['en-us'] = "Item";
+$text['label-item']['es-cl'] = "Ítem";
+$text['label-item']['pt-pt'] = "Item";
+$text['label-item']['fr-fr'] = "Article";
+$text['label-item']['pt-br'] = "Item";
+$text['label-item']['pl'] = "Pozycja";
+$text['label-item']['he'] = "פריט";
+$text['label-item']['uk'] = "пункт";
+$text['label-item']['sv-se'] = "Punkt";
+$text['label-item']['de-at'] = "Artikel";
+$text['label-item']['ro'] = "Articol";
+$text['label-item']['fa'] = "";
+$text['label-item']['ar-eg'] = "بند";
+
+$text['label-gateways']['en-us'] = "Gateways";
+$text['label-gateways']['es-cl'] = "Pasarelas";
+$text['label-gateways']['pt-pt'] = "Gateways";
+$text['label-gateways']['fr-fr'] = "Passerelles";
+$text['label-gateways']['pt-br'] = "Gateways";
+$text['label-gateways']['pl'] = "Bramy wyjściowe (gateways)";
+$text['label-gateways']['uk'] = "Шлюзи";
+$text['label-gateways']['sv-se'] = "Gateways";
+$text['label-gateways']['ro'] = "";
+$text['label-gateways']['de-at'] = "Gateways";
+$text['label-gateways']['ar-eg'] = "البوابات";
+$text['label-gateways']['he'] = "שערים";
+
+$text['label-followme']['en-us'] = "Follow Me";
+$text['label-followme']['es-cl'] = "Sígueme";
+$text['label-followme']['pt-pt'] = "Segue-me";
+$text['label-followme']['fr-fr'] = "Follow Me";
+$text['label-followme']['pt-br'] = "Siga-me";
+$text['label-followme']['pl'] = "Podążaj za mną";
+$text['label-followme']['he'] = "עקוב אחרי";
+$text['label-followme']['uk'] = "Follow Me";
+$text['label-followme']['sv-se'] = "Följ Mig";
+$text['label-followme']['de-at'] = "Anrufweiterschaltung";
+$text['label-followme']['ro'] = "Urmează-mă";
+$text['label-followme']['fa'] = "";
+$text['label-followme']['ar-eg'] = "خدمة اتبعني";
+
+$text['label-feature']['en-us'] = "Feature";
+$text['label-feature']['es-cl'] = "Característica";
+$text['label-feature']['pt-pt'] = "Característica";
+$text['label-feature']['fr-fr'] = "Fonctionnalité";
+$text['label-feature']['pt-br'] = "Característica";
+$text['label-feature']['pl'] = "Cecha";
+$text['label-feature']['uk'] = "особливість";
+$text['label-feature']['sv-se'] = "Särdrag";
+$text['label-feature']['ro'] = "trăsătură";
+$text['label-feature']['de-at'] = "Feature";
+$text['label-feature']['ar-eg'] = "ميزة";
+$text['label-feature']['he'] = "מאפיין";
+
+$text['label-failed']['en-us'] = "Failed";
+$text['label-failed']['es-cl'] = "Fracasado";
+$text['label-failed']['pt-pt'] = "Fracassado";
+$text['label-failed']['fr-fr'] = "Manqué";
+$text['label-failed']['pt-br'] = "Fracassado";
+$text['label-failed']['pl'] = "Nie powiodło się";
+$text['label-failed']['sv-se'] = "Misslyckad";
+$text['label-failed']['uk'] = "";
+$text['label-failed']['de-at'] = "Fehlgeschlagen";
+$text['label-failed']['he'] = "נכשל";
+
+$text['label-extensions']['en-us'] = "Extensions";
+$text['label-extensions']['es-cl'] = "Extensiones";
+$text['label-extensions']['pt-pt'] = "Extensões";
+$text['label-extensions']['fr-fr'] = "Extensions";
+$text['label-extensions']['pt-br'] = "Extensões";
+$text['label-extensions']['pl'] = "Numery wewnętrzne";
+$text['label-extensions']['uk'] = "Розширення";
+$text['label-extensions']['sv-se'] = "Anknytningar";
+$text['label-extensions']['ro'] = "Extensii";
+$text['label-extensions']['de-at'] = "Nebenstellen";
+$text['label-extensions']['ar-eg'] = "الأرقام الداخلية";
+$text['label-extensions']['he'] = "שלוחות";
+
+$text['label-extension']['en-us'] = "Extension";
+$text['label-extension']['es-cl'] = "Extensión";
+$text['label-extension']['pt-pt'] = "Extensão";
+$text['label-extension']['fr-fr'] = "Extension";
+$text['label-extension']['pt-br'] = "Ramal";
+$text['label-extension']['pl'] = "Numer wewnętrzny";
+$text['label-extension']['he'] = "שלוחה";
+$text['label-extension']['uk'] = "Розширення (Extention)";
+$text['label-extension']['sv-se'] = "Anknytning";
+$text['label-extension']['de-at'] = "Durchwahl";
+$text['label-extension']['ro'] = "Extensie";
+$text['label-extension']['fa'] = "";
+$text['label-extension']['ar-eg'] = "رقم داخلي";
+
+$text['label-email_address']['en-us'] = "Email Address";
+$text['label-email_address']['es-cl'] = "Dirección de Correo Electrónico";
+$text['label-email_address']['pt-pt'] = "Endereço de Email";
+$text['label-email_address']['fr-fr'] = "Adresse E-mail";
+$text['label-email_address']['pt-br'] = "Endereço de E-mail";
+$text['label-email_address']['pl'] = "Adres email";
+$text['label-email_address']['he'] = "כתובת מייל";
+$text['label-email_address']['uk'] = "Адреси E-Mail";
+$text['label-email_address']['sv-se'] = "E-postadress";
+$text['label-email_address']['de-at'] = "E-Mail-Adresse";
+$text['label-email_address']['ro'] = "Adresă email";
+$text['label-email_address']['fa'] = "";
+$text['label-email_address']['ar-eg'] = "البريد الإلكتروني";
+
+$text['label-domains']['en-us'] = "Domains";
+$text['label-domains']['es-cl'] = "Dominios";
+$text['label-domains']['pt-pt'] = "Domínios";
+$text['label-domains']['fr-fr'] = "Domaines";
+$text['label-domains']['pt-br'] = "Dominios";
+$text['label-domains']['pl'] = "Domeny";
+$text['label-domains']['sv-se'] = "Domäner";
+$text['label-domains']['uk'] = "Домени";
+$text['label-domains']['de-at'] = "Domains";
+
+$text['label-domain_limits']['en-us'] = "Domain Limits";
+$text['label-domain_limits']['es-cl'] = "Límites de dominio";
+$text['label-domain_limits']['pt-pt'] = "Limites de domínio";
+$text['label-domain_limits']['fr-fr'] = "Limites de domaine";
+$text['label-domain_limits']['pt-br'] = "Limites de domínio";
+$text['label-domain_limits']['pl'] = "Granice domen";
+$text['label-domain_limits']['he'] = "מגבלת הדומיין";
+$text['label-domain_limits']['uk'] = "обмеження домену";
+$text['label-domain_limits']['sv-se'] = "domän Gränser";
+$text['label-domain_limits']['de-at'] = "Domain Limits";
+$text['label-domain_limits']['ro'] = "Limite de domeniu";
+$text['label-domain_limits']['fa'] = "";
+$text['label-domain_limits']['ar-eg'] = "حدود نطاق";
+
+$text['label-domain']['en-us'] = "Domain";
+$text['label-domain']['es-cl'] = "Dominio";
+$text['label-domain']['pt-pt'] = "Domínio";
+$text['label-domain']['fr-fr'] = "Domaine";
+$text['label-domain']['pt-br'] = "Domínio";
+$text['label-domain']['pl'] = "Domena";
+$text['label-domain']['he'] = "תחום";
+$text['label-domain']['uk'] = "Домен";
+$text['label-domain']['sv-se'] = "Domän";
+$text['label-domain']['de-at'] = "Domain";
+$text['label-domain']['ro'] = "Domeniu";
+$text['label-domain']['fa'] = "";
+$text['label-domain']['ar-eg'] = "النطاق";
+
+$text['label-dnd']['en-us'] = "Do Not Disturb";
+$text['label-dnd']['es-cl'] = "No Molestar";
+$text['label-dnd']['pt-pt'] = "Não Perturbar";
+$text['label-dnd']['fr-fr'] = "Ne Pas Déranger";
+$text['label-dnd']['pt-br'] = "Não Pertube";
+$text['label-dnd']['pl'] = "Nie przeszkadzaj (DND)";
+$text['label-dnd']['he'] = "לא להפריע";
+$text['label-dnd']['uk'] = "Не турбувати";
+$text['label-dnd']['sv-se'] = "Stör Ej";
+$text['label-dnd']['de-at'] = "Nicht stören";
+$text['label-dnd']['ro'] = "Nu deranjați";
+$text['label-dnd']['fa'] = "";
+$text['label-dnd']['ar-eg'] = "عدم الازعاج";
+
+$text['label-disk_usage']['en-us'] = "Disk Usage";
+$text['label-disk_usage']['es-cl'] = "Uso del disco";
+$text['label-disk_usage']['pt-pt'] = "Uso de disco";
+$text['label-disk_usage']['fr-fr'] = "Utilisation du disque";
+$text['label-disk_usage']['pt-br'] = "Uso de disco";
+$text['label-disk_usage']['pl'] = "Użycie dysku";
+$text['label-disk_usage']['he'] = "שימוש בדיסק";
+$text['label-disk_usage']['uk'] = "Використання диска";
+$text['label-disk_usage']['sv-se'] = "Drive användning";
+$text['label-disk_usage']['de-at'] = "Festplattennutzung";
+$text['label-disk_usage']['ro'] = "utilizare disc";
+$text['label-disk_usage']['fa'] = "";
+$text['label-disk_usage']['ar-eg'] = "إستخدام القرص";
+
+$text['label-disabled']['en-us'] = "Disabled";
+$text['label-disabled']['es-cl'] = "Discapacitado";
+$text['label-disabled']['pt-pt'] = "Inválido";
+$text['label-disabled']['fr-fr'] = "Non Permis";
+$text['label-disabled']['pt-br'] = "Inválido";
+$text['label-disabled']['pl'] = "Wyłączony";
+$text['label-disabled']['sv-se'] = "Inaktiverad";
+$text['label-disabled']['uk'] = "Відключено";
+$text['label-disabled']['de-at'] = "Ausgeschaltet";
+
+$text['label-devices']['en-us'] = "Devices";
+$text['label-devices']['es-cl'] = "Dispositivos";
+$text['label-devices']['pt-pt'] = "Dispositivos";
+$text['label-devices']['fr-fr'] = "Equipements";
+$text['label-devices']['pt-br'] = "Dispositivos";
+$text['label-devices']['pl'] = "Urządzenia";
+$text['label-devices']['uk'] = "Пристрої";
+$text['label-devices']['sv-se'] = "Enheter";
+$text['label-devices']['ro'] = "Dispozitive";
+$text['label-devices']['de-at'] = "Geräte";
+$text['label-devices']['ar-eg'] = "الأجهزة";
+$text['label-devices']['he'] = "התקנים";
+
+$text['label-destinations']['en-us'] = "Destinations";
+$text['label-destinations']['es-cl'] = "Destinos";
+$text['label-destinations']['pt-pt'] = "Destinos";
+$text['label-destinations']['fr-fr'] = "Destinations";
+$text['label-destinations']['pt-br'] = "Destinos";
+$text['label-destinations']['pl'] = "Destynacje";
+$text['label-destinations']['sv-se'] = "Destinationer";
+$text['label-destinations']['uk'] = "Номери";
+$text['label-destinations']['ro'] = "Destinații";
+$text['label-destinations']['de-at'] = "Kopfnummern";
+$text['label-destinations']['fa'] = "";
+$text['label-destinations']['ar-eg'] = "جهات الأتصال";
+$text['label-destinations']['he'] = "יעדים";
+
+$text['label-date_time']['en-us'] = "Date/Time";
+$text['label-date_time']['es-cl'] = "Fecha y hora";
+$text['label-date_time']['pt-pt'] = "Data hora";
+$text['label-date_time']['fr-fr'] = "Date / Heure";
+$text['label-date_time']['pt-br'] = "Data hora";
+$text['label-date_time']['pl'] = "Data Godzina";
+$text['label-date_time']['sv-se'] = "Datum Tid";
+$text['label-date_time']['uk'] = "Дата, час";
+$text['label-date_time']['ro'] = "Data / Ora";
+$text['label-date_time']['de-at'] = "Terminzeit";
+$text['label-date_time']['fa'] = "";
+$text['label-date_time']['ar-eg'] = "تاريخ / وقت";
+$text['label-date_time']['he'] = "תאריך שעה";
+
+$text['label-database_connections']['en-us'] = "DB Connections";
+$text['label-database_connections']['es-cl'] = "Conexiones de base de datos";
+$text['label-database_connections']['pt-pt'] = "Conexões de banco de dados";
+$text['label-database_connections']['fr-fr'] = "Connexions de base de données";
+$text['label-database_connections']['pt-br'] = "Conexões de banco de dados";
+$text['label-database_connections']['pl'] = "Połączenia z bazami danych";
+$text['label-database_connections']['sv-se'] = "databasanslutningar ";
+$text['label-database_connections']['uk'] = "з'єднання бази даних";
+$text['label-database_connections']['ro'] = "Baza de date Conexiuni";
+$text['label-database_connections']['de-at'] = "Datenbankverbindungen ";
+$text['label-database_connections']['fa'] = "";
+$text['label-database_connections']['ar-eg'] = "اتصالات قاعدة البيانات";
+$text['label-database_connections']['he'] = "התחברויות למסד נתונים";
+
+$text['label-confirm-password']['en-us'] = "Confirm Password";
+$text['label-confirm-password']['es-cl'] = "Confirmar Contraseña";
+$text['label-confirm-password']['pt-pt'] = "Confirmar Palavra-Passe";
+$text['label-confirm-password']['fr-fr'] = "Confirmation du mot de passe";
+$text['label-confirm-password']['pt-br'] = "Confirmar Senha";
+$text['label-confirm-password']['pl'] = "Potwierdź hasło";
+$text['label-confirm-password']['he'] = "אשר סיסמה";
+$text['label-confirm-password']['uk'] = "Підтвердіть пароль";
+$text['label-confirm-password']['sv-se'] = "Verifiera Lösenord";
+$text['label-confirm-password']['de-at'] = "Passwort bestätigen";
+$text['label-confirm-password']['ro'] = "Confirmare parolă";
+$text['label-confirm-password']['fa'] = "";
+$text['label-confirm-password']['ar-eg'] = "تاكيد كلمة السر";
+
+$text['label-cid_number']['en-us'] = "Number";
+$text['label-cid_number']['es-cl'] = "Número";
+$text['label-cid_number']['pt-pt'] = "Número";
+$text['label-cid_number']['fr-fr'] = "Numéro";
+$text['label-cid_number']['pt-br'] = "Número";
+$text['label-cid_number']['pl'] = "Numer";
+$text['label-cid_number']['sv-se'] = "Nummer";
+$text['label-cid_number']['uk'] = "Номер";
+$text['label-cid_number']['de-at'] = "Nummer";
+$text['label-cid_number']['he'] = "מספר";
+
+$text['label-cid_name']['en-us'] = "Name";
+$text['label-cid_name']['es-cl'] = "Nombre";
+$text['label-cid_name']['pt-pt'] = "Nome";
+$text['label-cid_name']['fr-fr'] = "Nom";
+$text['label-cid_name']['pt-br'] = "Nome";
+$text['label-cid_name']['pl'] = "Nazwa";
+$text['label-cid_name']['sv-se'] = "Namn";
+$text['label-cid_name']['uk'] = "Назва";
+$text['label-cid_name']['de-at'] = "Name";
+$text['label-cid_name']['he'] = "שם";
+
+$text['label-channels']['en-us'] = "Channels";
+$text['label-channels']['es-cl'] = "Canales";
+$text['label-channels']['pt-pt'] = "Canais";
+$text['label-channels']['fr-fr'] = "Canaux";
+$text['label-channels']['pt-br'] = "Canais";
+$text['label-channels']['pl'] = "Kanały";
+$text['label-channels']['uk'] = "Канали";
+$text['label-channels']['sv-se'] = "Kanaler";
+$text['label-channels']['ro'] = "Canale";
+$text['label-channels']['de-at'] = "Kanäle";
+$text['label-channels']['ar-eg'] = "";
+$text['label-channels']['he'] = "ערוצים";
+
+$text['label-cancelled']['en-us'] = "Cancelled";
+$text['label-cancelled']['es-cl'] = "Cancelado";
+$text['label-cancelled']['pt-pt'] = "Cancelado";
+$text['label-cancelled']['fr-fr'] = "Annulé";
+$text['label-cancelled']['pt-br'] = "Cancelado";
+$text['label-cancelled']['pl'] = "Odwołany";
+$text['label-cancelled']['he'] = "מבוטל";
+$text['label-cancelled']['uk'] = "скасовано";
+$text['label-cancelled']['sv-se'] = "Avbryts";
+$text['label-cancelled']['de-at'] = "Abgebrochen";
+$text['label-cancelled']['ro'] = "Anulat";
+$text['label-cancelled']['fa'] = "";
+$text['label-cancelled']['ar-eg'] = "ألغيت";
+
+$text['label-cancel']['en-us'] = "Cancel";
+$text['label-cancel']['es-cl'] = "Cancelar";
+$text['label-cancel']['pt-pt'] = "Cancelar";
+$text['label-cancel']['fr-fr'] = "Annuler";
+$text['label-cancel']['pt-br'] = "Cancelar";
+$text['label-cancel']['pl'] = "Anuluj";
+$text['label-cancel']['he'] = "בטל";
+$text['label-cancel']['uk'] = "Відмінити";
+$text['label-cancel']['sv-se'] = "Avbryt";
+$text['label-cancel']['de-at'] = "Abbrechen";
+$text['label-cancel']['ro'] = "Anulează";
+$text['label-cancel']['fa'] = "";
+$text['label-cancel']['ar-eg'] = "الغاء";
+
+$text['label-callforward']['en-us'] = "Call Forward";
+$text['label-callforward']['es-cl'] = "Desvío de Llamadas";
+$text['label-callforward']['pt-pt'] = "Encaminhamento de Chamadas";
+$text['label-callforward']['fr-fr'] = "Renvoi d'appel";
+$text['label-callforward']['pt-br'] = "Encaminhamento de Chamadas";
+$text['label-callforward']['pl'] = "Przekierowanie rozmowy";
+$text['label-callforward']['he'] = "עקוב אחרי";
+$text['label-callforward']['uk'] = "Переадресація дзвінків";
+$text['label-callforward']['sv-se'] = "Vidarekoppling";
+$text['label-callforward']['de-at'] = "Rufumleitung";
+$text['label-callforward']['ro'] = "Redirecționare apel";
+$text['label-callforward']['fa'] = "";
+$text['label-callforward']['ar-eg'] = "تحويل المكالمات";
+
+$text['label-call_center_queues']['en-us'] = "CC Queues";
+$text['label-call_center_queues']['es-cl'] = "Colas de Centro de Llamados";
+$text['label-call_center_queues']['pt-pt'] = "Filas de Call Center";
+$text['label-call_center_queues']['fr-fr'] = "Queues du Centre d'appels";
+$text['label-call_center_queues']['pt-br'] = "Filas de call center";
+$text['label-call_center_queues']['pl'] = "Kolejki w Call Center ";
+$text['label-call_center_queues']['sv-se'] = "Call Center Kö:er";
+$text['label-call_center_queues']['uk'] = "Черги кол-центра";
+$text['label-call_center_queues']['de-at'] = "Callcenter Warteschlangen";
+
+$text['label-answered']['en-us'] = "Answered";
+$text['label-answered']['es-cl'] = "Respondido";
+$text['label-answered']['pt-pt'] = "Atendidas";
+$text['label-answered']['fr-fr'] = "Répondu";
+$text['label-answered']['pt-br'] = "Atendidas";
+$text['label-answered']['pl'] = "Odebrano";
+$text['label-answered']['he'] = "ענה";
+$text['label-answered']['uk'] = "відповів";
+$text['label-answered']['sv-se'] = "Besvarad";
+$text['label-answered']['de-at'] = "Angenommen";
+$text['label-answered']['ro'] = "Răspuns";
+$text['label-answered']['fa'] = "";
+$text['label-answered']['ar-eg'] = "تم الرد";
+
+$text['label-active_users']['en-us'] = "Active Users";
+$text['label-active_users']['es-cl'] = "Los usuarios activos";
+$text['label-active_users']['pt-pt'] = "Usuários ativos";
+$text['label-active_users']['fr-fr'] = "Usuários ativos...";
+$text['label-active_users']['pt-br'] = "Usuários ativos";
+$text['label-active_users']['pl'] = "Aktywni użytkownicy";
+$text['label-active_users']['he'] = "משתמשים פעילים";
+$text['label-active_users']['uk'] = "активні користувачі";
+$text['label-active_users']['sv-se'] = "aktiva användare";
+$text['label-active_users']['de-at'] = "Aktive Benutzer";
+$text['label-active_users']['ro'] = "Utilizatori activi";
+$text['label-active_users']['fa'] = "";
+$text['label-active_users']['ar-eg'] = "الأعضاء النشيطين";
+
+$text['label-active_extensions']['en-us'] = "Active Extensions";
+$text['label-active_extensions']['es-cl'] = "Extensiones de activos";
+$text['label-active_extensions']['pt-pt'] = "Extensões de ativos";
+$text['label-active_extensions']['fr-fr'] = "Extensions actives";
+$text['label-active_extensions']['pt-br'] = "Extensões de ativos";
+$text['label-active_extensions']['pl'] = "Całość Rozszerzenia";
+$text['label-active_extensions']['he'] = "הרחבות בשידור חי";
+$text['label-active_extensions']['uk'] = "активні Розширення";
+$text['label-active_extensions']['sv-se'] = "aktiva Extensions";
+$text['label-active_extensions']['de-at'] = "Aktive Erweiterungen";
+$text['label-active_extensions']['ro'] = "Extensii active";
+$text['label-active_extensions']['fa'] = "";
+$text['label-active_extensions']['ar-eg'] = "الامتدادات النشطة";
+
+$text['label-active_domains']['en-us'] = "Active Domains";
+$text['label-active_domains']['es-cl'] = "Los dominios activos";
+$text['label-active_domains']['pt-pt'] = "Domínios ativos";
+$text['label-active_domains']['fr-fr'] = "domaines active";
+$text['label-active_domains']['pt-br'] = "Domínios ativos";
+$text['label-active_domains']['pl'] = "aktywne Domeny";
+$text['label-active_domains']['he'] = "תחומים פעילים";
+$text['label-active_domains']['uk'] = "активні домени";
+$text['label-active_domains']['sv-se'] = "aktiva domäner";
+$text['label-active_domains']['de-at'] = "Aktive Domains";
+$text['label-active_domains']['ro'] = "Domenii active";
+$text['label-active_domains']['fa'] = "";
+$text['label-active_domains']['ar-eg'] = "مجالات حية";
+
+$text['header-user_dashboard']['en-us'] = "Dashboard";
+$text['header-user_dashboard']['es-cl'] = "Dashboard Usuario";
+$text['header-user_dashboard']['pt-pt'] = "Painel de Controle do Usuário";
+$text['header-user_dashboard']['fr-fr'] = "Tableau de bord de l'utilisateur";
+$text['header-user_dashboard']['pt-br'] = "Painel de Controle do Usuário";
+$text['header-user_dashboard']['pl'] = "Panel użytkowników";
+$text['header-user_dashboard']['he'] = "ממשק משתמש";
+$text['header-user_dashboard']['uk'] = "Панель користувача";
+$text['header-user_dashboard']['sv-se'] = "Användarpanel";
+$text['header-user_dashboard']['de-at'] = "Benutzerübersicht";
+$text['header-user_dashboard']['ro'] = "Panou control utilizator";
+$text['header-user_dashboard']['fa'] = "";
+$text['header-user_dashboard']['ar-eg'] = "الصفحه الرئيسيه للمستخدم";
+
+$text['description-user_language']['en-us'] = "Select the language.";
+$text['description-user_language']['es-cl'] = "Seleccione el idioma.";
+$text['description-user_language']['pt-pt'] = "Selecione o idioma.";
+$text['description-user_language']['fr-fr'] = "Sélectionnez la langue.";
+$text['description-user_language']['pt-br'] = "Selecione o idioma";
+$text['description-user_language']['pl'] = "Wybierz język";
+$text['description-user_language']['he'] = "בחר שפה";
+$text['description-user_language']['uk'] = "Виберіть мову";
+$text['description-user_language']['sv-se'] = "Välj Språk";
+$text['description-user_language']['de-at'] = "Sprache auswählen";
+$text['description-user_language']['ro'] = "Selecție limbă";
+$text['description-user_language']['fa'] = "";
+$text['description-user_language']['ar-eg'] = "اختيار الغة";
+
+$text['description-user_dashboard']['en-us'] = "Quickly access information and tools related to your account.";
+$text['description-user_dashboard']['es-cl'] = "Acceso rápido a la información y herramientas relacionadas con su cuenta.";
+$text['description-user_dashboard']['pt-pt'] = "Acessar rapidamente as informações e ferramentas relacionadas à sua conta.";
+$text['description-user_dashboard']['fr-fr'] = "Accéder rapidement aux informations et outils liés à votre compte.";
+$text['description-user_dashboard']['pt-br'] = "Acessar as informações e ferramentas relacionadas à sua conta.";
+$text['description-user_dashboard']['pl'] = "Szybki dostęp do informacji i narzędzi związanych z twoim kontem";
+$text['description-user_dashboard']['he'] = "מידע מהיר וגישה לכלים הקשורים לחשבון שלך ";
+$text['description-user_dashboard']['uk'] = "Швидкий доступ до інформації та інструментів  вашого облікового запису.";
+$text['description-user_dashboard']['sv-se'] = "Snabb tillgång till information och verktyg för ditt konto.";
+$text['description-user_dashboard']['de-at'] = "Schneller Zugriff auf Kontoinformationen und -funktionen";
+$text['description-user_dashboard']['ro'] = "Acces rapid la informații și utilitare pentru contul Dvs.";
+$text['description-user_dashboard']['fa'] = "";
+$text['description-user_dashboard']['ar-eg'] = "دخول سريع للمعلومات و الادوات الخاصة بحسابك";
+
+$text['description-timezone']['en-us'] = "Select the default time zone.";
+$text['description-timezone']['es-cl'] = "Seleccione la zona horaria predeterminada.";
+$text['description-timezone']['pt-pt'] = "Selecione o fuso horário por omissão.";
+$text['description-timezone']['fr-fr'] = "Sélection du Fuseau Horaire par défaut.";
+$text['description-timezone']['pt-br'] = "Selecione o fuso horário padrão.";
+$text['description-timezone']['pl'] = "Wybierz domyślną strefę czasową";
+$text['description-timezone']['he'] = "בחר את ברירת המחדל עבור אזור הזמן ";
+$text['description-timezone']['uk'] = "Виберіть часовий пояс за замовчуванням";
+$text['description-timezone']['sv-se'] = "Välj standardtidszon";
+$text['description-timezone']['de-at'] = "Standardzeitzone auswählen";
+$text['description-timezone']['ro'] = "Selectați un fus orar implicit";
+$text['description-timezone']['fa'] = "";
+$text['description-timezone']['ar-eg'] = "اختيار منطقة التوقيت";
+
+$text['description-status']['en-us'] = "Select a user status.";
+$text['description-status']['es-cl'] = "Seleccione el estado del usuario.";
+$text['description-status']['pt-pt'] = "Escolha um estado para o utilizador.";
+$text['description-status']['fr-fr'] = "Sélection de l'état de l'usager.";
+$text['description-status']['pt-br'] = "Escolha o estado do usuário.";
+$text['description-status']['pl'] = "Wybierz status użytkownika";
+$text['description-status']['he'] = "בחר את סטטוס המשתמש";
+$text['description-status']['uk'] = "Виберіть статус користувача";
+$text['description-status']['sv-se'] = "Välj en användarstatus.";
+$text['description-status']['de-at'] = "Benutzerstatus auswählen";
+$text['description-status']['ro'] = "Selectați starea utilizatorului";
+$text['description-status']['fa'] = "";
+$text['description-status']['ar-eg'] = "اختيار حالة للمستخدم";
+
+$text['description']['en-us'] = "Edit account information.";
+$text['description']['es-cl'] = "Editar configuración de la cuenta.";
+$text['description']['pt-pt'] = "Editar informações de conta.";
+$text['description']['fr-fr'] = "Modifier les informations du compte.";
+$text['description']['pt-br'] = "Editar informações da conta.";
+$text['description']['pl'] = "Edytuj informacje o koncie";
+$text['description']['he'] = "ערוך את פרטי החשבון";
+$text['description']['uk'] = "Редагування інформації облікового запису";
+$text['description']['sv-se'] = "Redigera kontoinformation.";
+$text['description']['de-at'] = "Kontoinformationen bearbeiten";
+$text['description']['ro'] = "Editare cont";
+$text['description']['fa'] = "";
+$text['description']['ar-eg'] = "تعديل بيانات الحساب";
+
+$text['confirm-update']['en-us'] = "Update Complete";
+$text['confirm-update']['es-cl'] = "Actualización Completa";
+$text['confirm-update']['pt-pt'] = "Actualização Efectuada";
+$text['confirm-update']['fr-fr'] = "Mise à jour terminée";
+$text['confirm-update']['pt-br'] = "Atualização Efetuada";
+$text['confirm-update']['pl'] = "Aktualizacja zakonczona";
+$text['confirm-update']['he'] = "עידכון הושלם";
+$text['confirm-update']['uk'] = "Оновлення завершено";
+$text['confirm-update']['sv-se'] = "Uppdatering Klar";
+$text['confirm-update']['de-at'] = "Aktualisierung durchgeführt";
+$text['confirm-update']['ro'] = "Actualizare completă";
+$text['confirm-update']['fa'] = "";
+$text['confirm-update']['ar-eg'] = "تم التحديث";
+
+$text['confirm-password']['en-us'] = "Passwords did not match.";
+$text['confirm-password']['es-cl'] = "Las contraseñas no coinciden.";
+$text['confirm-password']['pt-pt'] = "As palavras-chave não coincidem.";
+$text['confirm-password']['fr-fr'] = "Les mots de passe ne sont pas les mêmes.";
+$text['confirm-password']['pt-br'] = "As senhas não coincidem.";
+$text['confirm-password']['pl'] = "Hasła nie sa takie same";
+$text['confirm-password']['he'] = "סיסמאות לא תואמות";
+$text['confirm-password']['uk'] = "Паролі не співпадають";
+$text['confirm-password']['sv-se'] = "Lösenorden matchar inte.";
+$text['confirm-password']['de-at'] = "Die Passwörter stimmen nicht überein";
+$text['confirm-password']['ro'] = "Parolele nu se potrivesc";
+$text['confirm-password']['fa'] = "";
+$text['confirm-password']['ar-eg'] = "كلمات السر غير متطابقة";
+
+$text['check-onbreak-status']['en-us'] = "On Break";
+$text['check-onbreak-status']['es-cl'] = "En Pausa";
+$text['check-onbreak-status']['pt-pt'] = "Em Pausa";
+$text['check-onbreak-status']['fr-fr'] = "En Pause";
+$text['check-onbreak-status']['pt-br'] = "Em Pausa";
+$text['check-onbreak-status']['pl'] = "Na przerwie";
+$text['check-onbreak-status']['he'] = "בהפסקה";
+$text['check-onbreak-status']['uk'] = "На перерві";
+$text['check-onbreak-status']['sv-se'] = "På Rast";
+$text['check-onbreak-status']['de-at'] = "Pause";
+$text['check-onbreak-status']['ro'] = "În pauză";
+$text['check-onbreak-status']['fa'] = "";
+$text['check-onbreak-status']['ar-eg'] = " (في استراحة (لا يعمل";
+
+$text['check-loggedout-status']['en-us'] = "Logged Out";
+$text['check-loggedout-status']['es-cl'] = "Desconectado";
+$text['check-loggedout-status']['pt-pt'] = "Desligado";
+$text['check-loggedout-status']['fr-fr'] = "Déconnecté";
+$text['check-loggedout-status']['pt-br'] = "Desligado";
+$text['check-loggedout-status']['pl'] = "Wylogowany";
+$text['check-loggedout-status']['he'] = "התנתק";
+$text['check-loggedout-status']['uk'] = "Вийшов";
+$text['check-loggedout-status']['sv-se'] = "Utloggad";
+$text['check-loggedout-status']['de-at'] = "Abgemeldet";
+$text['check-loggedout-status']['ro'] = "";
+$text['check-loggedout-status']['fa'] = "";
+$text['check-loggedout-status']['ar-eg'] = "تم الخروخ";
+
+$text['check-do-not-disturb-status']['en-us'] = "Do Not Disturb";
+$text['check-do-not-disturb-status']['es-cl'] = "No molestar";
+$text['check-do-not-disturb-status']['pt-pt'] = "Não Perturbar";
+$text['check-do-not-disturb-status']['fr-fr'] = "Ne pas déranger";
+$text['check-do-not-disturb-status']['pt-br'] = "Não Pertube";
+$text['check-do-not-disturb-status']['pl'] = "Nie przeszkadzaj (DND)";
+$text['check-do-not-disturb-status']['he'] = "לא להפריע";
+$text['check-do-not-disturb-status']['uk'] = "Не турбувати";
+$text['check-do-not-disturb-status']['sv-se'] = "Stör Ej";
+$text['check-do-not-disturb-status']['de-at'] = "Nicht stören";
+$text['check-do-not-disturb-status']['ro'] = "Nu deranjați";
+$text['check-do-not-disturb-status']['fa'] = "";
+$text['check-do-not-disturb-status']['ar-eg'] = "عدم الازعاج";
+
+$text['check-available-status']['en-us'] = "Available";
+$text['check-available-status']['es-cl'] = "Disponible";
+$text['check-available-status']['pt-pt'] = "Disponível";
+$text['check-available-status']['fr-fr'] = "Disponible";
+$text['check-available-status']['pt-br'] = "Disponível";
+$text['check-available-status']['pl'] = "Dostępny";
+$text['check-available-status']['he'] = "זמין";
+$text['check-available-status']['uk'] = "Доступний";
+$text['check-available-status']['sv-se'] = "Tillgänglig";
+$text['check-available-status']['de-at'] = "Erreichbar";
+$text['check-available-status']['ro'] = "Disponibil";
+$text['check-available-status']['fa'] = "";
+$text['check-available-status']['ar-eg'] = "متاح";
+
+$text['check-available-ondemand-status']['en-us'] = "Available (On Demand)";
+$text['check-available-ondemand-status']['es-cl'] = "Disponible (A Pedido)";
+$text['check-available-ondemand-status']['pt-pt'] = "Disponível (A Pedido)";
+$text['check-available-ondemand-status']['fr-fr'] = "Disponble (sur demande)";
+$text['check-available-ondemand-status']['pt-br'] = "Disponível (a pedido)";
+$text['check-available-ondemand-status']['pl'] = "Dostepny (na żądanie)";
+$text['check-available-ondemand-status']['he'] = "(זמין (ע״פ דרישה";
+$text['check-available-ondemand-status']['uk'] = "Доступний (на вимогу)";
+$text['check-available-ondemand-status']['sv-se'] = "Tillgänglig (På Begäran)";
+$text['check-available-ondemand-status']['de-at'] = "Erreichbar (bei Bedarf)";
+$text['check-available-ondemand-status']['ro'] = "Disponibil (la cerere)";
+$text['check-available-ondemand-status']['fa'] = "";
+$text['check-available-ondemand-status']['ar-eg'] = "(متاح ( تحت الطلب";
+
+$text['button-voicemail']['en-us'] = "Voicemail";
+$text['button-voicemail']['es-cl'] = "Correo de Voz";
+$text['button-voicemail']['pt-pt'] = "Correio de Voz";
+$text['button-voicemail']['fr-fr'] = "Messagerie Vocale";
+$text['button-voicemail']['pt-br'] = "Correio de voz";
+$text['button-voicemail']['pl'] = "Poczta głosowa";
+$text['button-voicemail']['sv-se'] = "Röstbrevlåda";
+$text['button-voicemail']['uk'] = "Голосова пошта";
+$text['button-voicemail']['de-at'] = "Mailbox";
+$text['button-voicemail']['he'] = "תא קולי";
+
 ?>

+ 42 - 42
core/user_settings/app_menu.php

@@ -1,43 +1,43 @@
-<?php
-
-$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']['he'] = "הגדרת חשבון";
-$apps[$x]['menu'][0]['title']['uk'] = "Обліковий запис";
-$apps[$x]['menu'][0]['title']['sv-se'] = "Kontoinställningar";
-$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/user_settings/user_edit.php";
-$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'] = "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";
-$apps[$x]['menu'][1]['title']['pl'] = "Panel użytkowników";
-$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-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
+
+$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']['he'] = "הגדרת חשבון";
+$apps[$x]['menu'][0]['title']['uk'] = "Обліковий запис";
+$apps[$x]['menu'][0]['title']['sv-se'] = "Kontoinställningar";
+$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/user_settings/user_edit.php";
+$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'] = "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";
+$apps[$x]['menu'][1]['title']['pl'] = "Panel użytkowników";
+$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-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";
+
 ?>

+ 421 - 421
core/users/app_config.php

@@ -1,421 +1,421 @@
-<?php
-	//application details
-		$apps[$x]['name'] = "User Manager";
-		$apps[$x]['uuid'] = "112124b3-95c2-5352-7e9d-d14c0b88f207";
-		$apps[$x]['category'] = "Core";
-		$apps[$x]['subcategory'] = "";
-		$apps[$x]['version'] = "";
-		$apps[$x]['license'] = "Mozilla Public License 1.1";
-		$apps[$x]['url'] = "http://www.fusionpbx.com";
-		$apps[$x]['description']['en-us'] = "Add, edit, delete, and search for users.";
-		$apps[$x]['description']['es-cl'] = "Agregar, Editar, Eliminar y Buscar Usuarios.";
-		$apps[$x]['description']['de-de'] = "";
-		$apps[$x]['description']['de-ch'] = "";
-		$apps[$x]['description']['de-at'] = "";
-		$apps[$x]['description']['fr-fr'] = "Ajouter, Editer, Supprimer et Chercher des Usagers";
-		$apps[$x]['description']['fr-ca'] = "";
-		$apps[$x]['description']['fr-ch'] = "";
-		$apps[$x]['description']['pt-pt'] = "Adicionar, editar, apagar e pesquisa pelos utilizadores.";
-		$apps[$x]['description']['pt-br'] = "";
-
-	//permission details
-		$y = 0;
-		$apps[$x]['permissions'][$y]['name'] = "user_view";
-		$apps[$x]['permissions'][$y]['menu']['uuid'] = "0d57cc1e-1874-47b9-7ddd-fe1f57cec99b";
-		$apps[$x]['permissions'][$y]['groups'][] = "admin";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "user_add";
-		$apps[$x]['permissions'][$y]['groups'][] = "admin";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "user_edit";
-		$apps[$x]['permissions'][$y]['groups'][] = "admin";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "user_delete";
-		$apps[$x]['permissions'][$y]['groups'][] = "admin";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = 'user_domain';
-		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = 'user_all';
-		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "group_view";
-		$apps[$x]['permissions'][$y]['menu']['uuid'] = "3b4acc6d-827b-f537-bf21-0093d94ffec7";
-		$apps[$x]['permissions'][$y]['groups'][] = "admin";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "group_add";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "group_edit";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "group_delete";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = 'group_domain';
-		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = 'group_all';
-		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "group_member_view";
-		$apps[$x]['permissions'][$y]['menu']['uuid'] = "3b4acc6d-827b-f537-bf21-0093d94ffec7";
-		$apps[$x]['permissions'][$y]['groups'][] = "admin";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "group_member_add";
-		$apps[$x]['permissions'][$y]['groups'][] = "admin";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "group_member_delete";
-		$apps[$x]['permissions'][$y]['groups'][] = "admin";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "group_permissions";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "group_user_view";
-		$apps[$x]['permissions'][$y]['menu']['uuid'] = "3b4acc6d-827b-f537-bf21-0093d94ffec7";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$apps[$x]['permissions'][$y]['groups'][] = "admin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "group_user_add";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$apps[$x]['permissions'][$y]['groups'][] = "admin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "group_user_edit";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$apps[$x]['permissions'][$y]['groups'][] = "admin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "group_user_delete";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$apps[$x]['permissions'][$y]['groups'][] = "admin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "group_permission_view";
-		$apps[$x]['permissions'][$y]['menu']['uuid'] = "3b4acc6d-827b-f537-bf21-0093d94ffec7";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "group_permission_add";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "group_permission_edit";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "group_permission_delete";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "user_setting_view";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$apps[$x]['permissions'][$y]['groups'][] = "admin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "user_setting_add";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$apps[$x]['permissions'][$y]['groups'][] = "admin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "user_setting_edit";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$apps[$x]['permissions'][$y]['groups'][] = "admin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "user_setting_delete";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$apps[$x]['permissions'][$y]['groups'][] = "admin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "user_setting_category_edit";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-
-	//schema details
-		$y = 0; //table array index
-		$z = 0; //field array index
-		$apps[$x]['db'][$y]['table'] = "v_users";
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "id";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "serial";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "integer";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "INT NOT NULL AUTO_INCREMENT";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "v_id";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "username";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "password";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "salt";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		//$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
-		//$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_contacts";
-		//$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "contact_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "user_email";
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "useremail";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "user_status";
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "userstatus";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "user_time_zone";
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "usertimezone";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "api_key";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_enabled";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "add_user";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "add_date";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-
-		$y = 1; //table array index
-		$z = 0; //field array index
-		$apps[$x]['db'][$y]['table'] = "v_groups";
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "group_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "id";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "serial";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "integer";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "INT NOT NULL AUTO_INCREMENT";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "v_id";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "group_name";
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "groupid";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "group_protected";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "group_description";
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "groupdesc";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-
-		$y = 2; //table array index
-		$z = 0; //field array index
-		$apps[$x]['db'][$y]['table'] = "v_group_users";
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "id";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "serial";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "integer";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "INT NOT NULL AUTO_INCREMENT";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "group_user_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "v_id";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "group_name";
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "groupid";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "group_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_groups";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "group_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "username";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-
-		$y = 3; //table array index
-		$z = 0; //field array index
-		$apps[$x]['db'][$y]['table'] = "v_group_permissions";
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "group_permission_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "id";
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "group_permission_name";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "serial";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "integer";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "INT NOT NULL AUTO_INCREMENT";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "v_id";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "permission_name";
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "permission_id";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "group_name";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "group_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-
-		$y = 4; //table array index
-		$z = 0; //field array index
-		$apps[$x]['db'][$y]['table'] = "v_user_settings";
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_setting_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_setting_category";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the category.";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_setting_subcategory";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the subcategory.";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_setting_name";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the name.";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_setting_value";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the value.";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_setting_order";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_setting_enabled";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_setting_description";
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-?>
+<?php
+	//application details
+		$apps[$x]['name'] = "User Manager";
+		$apps[$x]['uuid'] = "112124b3-95c2-5352-7e9d-d14c0b88f207";
+		$apps[$x]['category'] = "Core";
+		$apps[$x]['subcategory'] = "";
+		$apps[$x]['version'] = "";
+		$apps[$x]['license'] = "Mozilla Public License 1.1";
+		$apps[$x]['url'] = "http://www.fusionpbx.com";
+		$apps[$x]['description']['en-us'] = "Add, edit, delete, and search for users.";
+		$apps[$x]['description']['es-cl'] = "Agregar, Editar, Eliminar y Buscar Usuarios.";
+		$apps[$x]['description']['de-de'] = "";
+		$apps[$x]['description']['de-ch'] = "";
+		$apps[$x]['description']['de-at'] = "";
+		$apps[$x]['description']['fr-fr'] = "Ajouter, Editer, Supprimer et Chercher des Usagers";
+		$apps[$x]['description']['fr-ca'] = "";
+		$apps[$x]['description']['fr-ch'] = "";
+		$apps[$x]['description']['pt-pt'] = "Adicionar, editar, apagar e pesquisa pelos utilizadores.";
+		$apps[$x]['description']['pt-br'] = "";
+
+	//permission details
+		$y = 0;
+		$apps[$x]['permissions'][$y]['name'] = "user_view";
+		$apps[$x]['permissions'][$y]['menu']['uuid'] = "0d57cc1e-1874-47b9-7ddd-fe1f57cec99b";
+		$apps[$x]['permissions'][$y]['groups'][] = "admin";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "user_add";
+		$apps[$x]['permissions'][$y]['groups'][] = "admin";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "user_edit";
+		$apps[$x]['permissions'][$y]['groups'][] = "admin";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "user_delete";
+		$apps[$x]['permissions'][$y]['groups'][] = "admin";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = 'user_domain';
+		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = 'user_all';
+		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "group_view";
+		$apps[$x]['permissions'][$y]['menu']['uuid'] = "3b4acc6d-827b-f537-bf21-0093d94ffec7";
+		$apps[$x]['permissions'][$y]['groups'][] = "admin";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "group_add";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "group_edit";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "group_delete";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = 'group_domain';
+		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = 'group_all';
+		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "group_member_view";
+		$apps[$x]['permissions'][$y]['menu']['uuid'] = "3b4acc6d-827b-f537-bf21-0093d94ffec7";
+		$apps[$x]['permissions'][$y]['groups'][] = "admin";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "group_member_add";
+		$apps[$x]['permissions'][$y]['groups'][] = "admin";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "group_member_delete";
+		$apps[$x]['permissions'][$y]['groups'][] = "admin";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "group_permissions";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "group_user_view";
+		$apps[$x]['permissions'][$y]['menu']['uuid'] = "3b4acc6d-827b-f537-bf21-0093d94ffec7";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$apps[$x]['permissions'][$y]['groups'][] = "admin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "group_user_add";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$apps[$x]['permissions'][$y]['groups'][] = "admin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "group_user_edit";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$apps[$x]['permissions'][$y]['groups'][] = "admin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "group_user_delete";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$apps[$x]['permissions'][$y]['groups'][] = "admin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "group_permission_view";
+		$apps[$x]['permissions'][$y]['menu']['uuid'] = "3b4acc6d-827b-f537-bf21-0093d94ffec7";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "group_permission_add";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "group_permission_edit";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "group_permission_delete";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "user_setting_view";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$apps[$x]['permissions'][$y]['groups'][] = "admin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "user_setting_add";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$apps[$x]['permissions'][$y]['groups'][] = "admin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "user_setting_edit";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$apps[$x]['permissions'][$y]['groups'][] = "admin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "user_setting_delete";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+		$apps[$x]['permissions'][$y]['groups'][] = "admin";
+		$y++;
+		$apps[$x]['permissions'][$y]['name'] = "user_setting_category_edit";
+		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
+
+	//schema details
+		$y = 0; //table array index
+		$z = 0; //field array index
+		$apps[$x]['db'][$y]['table'] = "v_users";
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "id";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "serial";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "integer";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "INT NOT NULL AUTO_INCREMENT";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "v_id";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "username";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "password";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "salt";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		//$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
+		//$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_contacts";
+		//$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "contact_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "user_email";
+		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "useremail";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "user_status";
+		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "userstatus";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "user_time_zone";
+		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "usertimezone";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "api_key";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_enabled";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "add_user";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "add_date";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+
+		$y = 1; //table array index
+		$z = 0; //field array index
+		$apps[$x]['db'][$y]['table'] = "v_groups";
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "group_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "id";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "serial";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "integer";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "INT NOT NULL AUTO_INCREMENT";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "v_id";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "group_name";
+		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "groupid";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "group_protected";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "group_description";
+		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "groupdesc";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+
+		$y = 2; //table array index
+		$z = 0; //field array index
+		$apps[$x]['db'][$y]['table'] = "v_group_users";
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "id";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "serial";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "integer";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "INT NOT NULL AUTO_INCREMENT";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "group_user_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "v_id";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "group_name";
+		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "groupid";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "group_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_groups";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "group_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "username";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+
+		$y = 3; //table array index
+		$z = 0; //field array index
+		$apps[$x]['db'][$y]['table'] = "v_group_permissions";
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "group_permission_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "id";
+		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "group_permission_name";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "serial";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "integer";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "INT NOT NULL AUTO_INCREMENT";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "v_id";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "permission_name";
+		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "permission_id";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "group_name";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "group_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+
+		$y = 4; //table array index
+		$z = 0; //field array index
+		$apps[$x]['db'][$y]['table'] = "v_user_settings";
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_setting_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
+		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_setting_category";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the category.";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_setting_subcategory";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the subcategory.";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_setting_name";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the name.";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_setting_value";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the value.";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_setting_order";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_setting_enabled";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+		$z++;
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_setting_description";
+		$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
+		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
+?>

+ 1072 - 1072
core/users/app_languages.php

@@ -1,1073 +1,1073 @@
-<?php
-
-$text['title-user_setting-edit']['en-us'] = "User Setting";
-$text['title-user_setting-edit']['es-cl'] = "Configuración de Usuario";
-$text['title-user_setting-edit']['pt-pt'] = "Definição do Utilizador";
-$text['title-user_setting-edit']['fr-fr'] = "Cadre de l'utilisateur";
-
-$text['title-user_setting-add']['en-us'] = "User Setting Add";
-$text['title-user_setting-add']['es-cl'] = "Ajuste del usuario Agregar";
-$text['title-user_setting-add']['pt-pt'] = "Usuário setting Adicionar";
-$text['title-user_setting-add']['fr-fr'] = "Cadre utilisateur Ajouter";
-
-$text['title-user_manager']['en-us'] = "User Manager";
-$text['title-user_manager']['es-cl'] = "Administración de Usuarios";
-$text['title-user_manager']['pt-pt'] = "Gestão de Utilizadores";
-$text['title-user_manager']['fr-fr'] = "Gestion des utilisateurs";
-$text['title-user_manager']['pl'] = "Menedżer użytkowników";
-$text['title-user_manager']['uk'] = "Користувачі";
-$text['title-user_manager']['sv-se'] = "Användar Inställningar";
-$text['title-user_manager']['ro'] = "";
-$text['title-user_manager']['de-at'] = "Benutzerverwaltung";
-$text['title-user_manager']['he'] = "מנהל משתמש";
-
-$text['title-user_edit']['en-us'] = "User";
-$text['title-user_edit']['es-cl'] = "Editar Usuario";
-$text['title-user_edit']['pt-pt'] = "Utilizador";
-$text['title-user_edit']['fr-fr'] = "Modifier l'utilisateur";
-$text['title-user_edit']['pl'] = "Użytkownik";
-$text['title-user_edit']['uk'] = "Користувач";
-$text['title-user_edit']['sv-se'] = "Användare";
-$text['title-user_edit']['ro'] = "Utilizator";
-$text['title-user_edit']['de-at'] = "Benutzer";
-$text['title-user_edit']['he'] = "משתמש";
-
-$text['title-user_add']['en-us'] = "User";
-$text['title-user_add']['es-cl'] = "Agregar Usuario";
-$text['title-user_add']['pt-pt'] = "Adicionar Utilizador";
-$text['title-user_add']['fr-fr'] = "Ajouter un utilisateur";
-$text['title-user_add']['pl'] = "Użytkownik";
-$text['title-user_add']['uk'] = "Користувач";
-$text['title-user_add']['sv-se'] = "Användare";
-$text['title-user_add']['ro'] = "Utilizator";
-$text['title-user_add']['de-at'] = "Benutzer";
-$text['title-user_add']['he'] = "משתמש";
-
-$text['title-group_permissions']['en-us'] = "Group Permissions";
-$text['title-group_permissions']['es-cl'] = "Permisos de Grupo";
-$text['title-group_permissions']['pt-pt'] = "Permissões do Grupo";
-$text['title-group_permissions']['fr-fr'] = "Permissions du Groupe";
-$text['title-group_permissions']['pl'] = "Uprawnienia grupy:";
-$text['title-group_permissions']['uk'] = "Привілеї групи";
-$text['title-group_permissions']['sv-se'] = "Grupp Rättigheter";
-$text['title-group_permissions']['ro'] = "Permisiuni grup";
-$text['title-group_permissions']['de-at'] = "Gruppenberechtigung";
-$text['title-group_permissions']['he'] = "הרשאות קבוצה";
-
-$text['title-group_members']['en-us'] = "Group Members";
-$text['title-group_members']['es-cl'] = "Miembros del Grupo";
-$text['title-group_members']['pt-pt'] = "Membros do Grupo";
-$text['title-group_members']['fr-fr'] = "Membres du Groupe";
-$text['title-group_members']['pl'] = "Członkowie grupy:";
-$text['title-group_members']['uk'] = "Учасники групи";
-$text['title-group_members']['sv-se'] = "Grupp Medlemmar";
-$text['title-group_members']['ro'] = "Membri grup";
-$text['title-group_members']['de-at'] = "Gruppenmitglieder";
-$text['title-group_members']['he'] = "חברי קבוצה";
-
-$text['title-group_manager']['en-us'] = "Group Manager";
-$text['title-group_manager']['es-cl'] = "Administración de Grupo";
-$text['title-group_manager']['pt-pt'] = "Gestão de Grupos";
-$text['title-group_manager']['fr-fr'] = "Gestion de Groupe";
-$text['title-group_manager']['pl'] = "Menedżer grup";
-$text['title-group_manager']['uk'] = "Групи";
-$text['title-group_manager']['sv-se'] = "Grupp Inställningar";
-$text['title-group_manager']['ro'] = "";
-$text['title-group_manager']['de-at'] = "Gruppenverwaltung";
-$text['title-group_manager']['he'] = "מנהל קבוצה";
-
-$text['title-group_edit']['en-us'] = "Edit Group";
-$text['title-group_edit']['es-cl'] = "Editar Grupo";
-$text['title-group_edit']['pt-pt'] = "Editar Grupo";
-$text['title-group_edit']['fr-fr'] = "Modifier le Groupe";
-$text['title-group_edit']['pl'] = "Edycja grupy";
-$text['title-group_edit']['uk'] = "Редагувати групу";
-$text['title-group_edit']['sv-se'] = "Editera Grupp";
-$text['title-group_edit']['ro'] = "Editare grup";
-$text['title-group_edit']['de-at'] = "Gruppe ändern";
-$text['title-group_edit']['he'] = "ערוך קבוצה";
-
-$text['title-group_add']['en-us'] = "Add Group";
-$text['title-group_add']['es-cl'] = "Agregar Grupo";
-$text['title-group_add']['pt-pt'] = "Adicionar Grupo";
-$text['title-group_add']['fr-fr'] = "Ajouter un Groupe";
-$text['title-group_add']['pl'] = "Dodaj grupę";
-$text['title-group_add']['uk'] = "Додати групу";
-$text['title-group_add']['sv-se'] = "Lägg Till Grupp";
-$text['title-group_add']['ro'] = "Adăugare grup";
-$text['title-group_add']['de-at'] = "Gruppe hinzufügen";
-$text['title-group_add']['he'] = "הוסף קבוצה";
-
-$text['option-true']['en-us'] = "True";
-$text['option-true']['es-cl'] = "Verdadero";
-$text['option-true']['pt-pt'] = "Sim";
-$text['option-true']['fr-fr'] = "Oui";
-$text['option-true']['pl'] = "Tak";
-$text['option-true']['uk'] = "Так";
-$text['option-true']['sv-se'] = "Sann";
-$text['option-true']['ro'] = "";
-$text['option-true']['de-at'] = "Ein";
-$text['option-true']['he'] = "חוקי";
-
-$text['option-on_break']['en-us'] = "On Break";
-$text['option-on_break']['es-cl'] = "En Pausa";
-$text['option-on_break']['pt-pt'] = "Em Pausa";
-$text['option-on_break']['fr-fr'] = "En Pause";
-$text['option-on_break']['pl'] = "Na przerwie";
-$text['option-on_break']['uk'] = "На перерві";
-$text['option-on_break']['sv-se'] = "På Rast";
-$text['option-on_break']['ro'] = "În pauză";
-$text['option-on_break']['de-at'] = "In Pause";
-$text['option-on_break']['he'] = "בהפסקה";
-
-$text['option-logged_out']['en-us'] = "Logged Out";
-$text['option-logged_out']['es-cl'] = "Desconectado";
-$text['option-logged_out']['pt-pt'] = "Desligado";
-$text['option-logged_out']['fr-fr'] = "Déconnecté";
-$text['option-logged_out']['pl'] = "Wylogowany";
-$text['option-logged_out']['uk'] = "Вийшов";
-$text['option-logged_out']['sv-se'] = "Utloggad";
-$text['option-logged_out']['ro'] = "";
-$text['option-logged_out']['de-at'] = "Abgemeldet";
-$text['option-logged_out']['he'] = "התנתק";
-
-$text['option-global']['en-us'] = "Global";
-$text['option-global']['es-cl'] = "Global";
-$text['option-global']['pt-pt'] = "Global";
-$text['option-global']['fr-fr'] = "Global";
-$text['option-global']['pl'] = "Ogólny";
-$text['option-global']['uk'] = "Глобально";
-$text['option-global']['sv-se'] = "Global";
-$text['option-global']['ro'] = "Global";
-$text['option-global']['de-at'] = "Global";
-$text['option-global']['he'] = "כללי";
-
-$text['option-false']['en-us'] = "False";
-$text['option-false']['es-cl'] = "Falso";
-$text['option-false']['pt-pt'] = "Não";
-$text['option-false']['fr-fr'] = "Non";
-$text['option-false']['pl'] = "Nie";
-$text['option-false']['uk'] = "Ні";
-$text['option-false']['sv-se'] = "Falsk";
-$text['option-false']['ro'] = "";
-$text['option-false']['de-at'] = "Aus";
-$text['option-false']['he'] = "לא חוקי";
-
-$text['option-do_not_disturb']['en-us'] = "Do Not Disturb";
-$text['option-do_not_disturb']['es-cl'] = "No Molestar";
-$text['option-do_not_disturb']['pt-pt'] = "Não Perturbar";
-$text['option-do_not_disturb']['fr-fr'] = "Ne pas Déranger";
-$text['option-do_not_disturb']['pl'] = "Nie przeszkadzaj (DND)";
-$text['option-do_not_disturb']['uk'] = "Не турбувати";
-$text['option-do_not_disturb']['sv-se'] = "Stör Ej";
-$text['option-do_not_disturb']['ro'] = "";
-$text['option-do_not_disturb']['de-at'] = "Bitte nicht stören";
-$text['option-do_not_disturb']['he'] = "נא לא להפריע";
-
-$text['option-available_on_demand']['en-us'] = "Available (On Demand)";
-$text['option-available_on_demand']['es-cl'] = "Disponible (A Pedido)";
-$text['option-available_on_demand']['pt-pt'] = "Disponível (A Pedido)";
-$text['option-available_on_demand']['fr-fr'] = "Disponible (sur demande)";
-$text['option-available_on_demand']['pl'] = "Dostępny (na żądanie)";
-$text['option-available_on_demand']['uk'] = "Доступний (на вимогу)";
-$text['option-available_on_demand']['sv-se'] = "Tillgänglig (På Begäran)";
-$text['option-available_on_demand']['ro'] = "";
-$text['option-available_on_demand']['de-at'] = "Verfügbar (auf Anfrage)";
-$text['option-available_on_demand']['he'] = "זמין (לפי דרישה(";
-
-$text['option-available']['en-us'] = "Available";
-$text['option-available']['es-cl'] = "Disponible";
-$text['option-available']['pt-pt'] = "Disponível";
-$text['option-available']['fr-fr'] = "Disponible";
-$text['option-available']['pl'] = "Dostępny";
-$text['option-available']['uk'] = "Доступний";
-$text['option-available']['sv-se'] = "Tillgänglig";
-$text['option-available']['ro'] = "";
-$text['option-available']['de-at'] = "Verfügbar";
-$text['option-available']['he'] = "זמין";
-
-$text['message-username_exists']['en-us'] = "Username Already Exists";
-$text['message-username_exists']['es-cl'] = "Ya existe Nombre de usuario";
-$text['message-username_exists']['pt-pt'] = "Nome de usuário já existe";
-$text['message-username_exists']['fr-fr'] = "Le nom d'utilisateur existe déjà";
-$text['message-username_exists']['pl'] = "Nazwa użytkownika już istnieje";
-$text['message-username_exists']['uk'] = "Користувач вже існує";
-$text['message-username_exists']['sv-se'] = "Användarnamnet Existerar Redan";
-$text['message-username_exists']['ro'] = "";
-$text['message-username_exists']['de-at'] = "Benutzername existiert bereits";
-$text['message-username_exists']['he'] = "שם משתמש כבר קיים";
-
-$text['message-password_mismatch']['en-us'] = "Password Mismatch";
-$text['message-password_mismatch']['es-cl'] = "Contraseñas no coinciden";
-$text['message-password_mismatch']['pt-pt'] = "As passwords não correspondem.";
-$text['message-password_mismatch']['fr-fr'] = "Les mots de passe ne correspondent pas";
-$text['message-password_mismatch']['pl'] = "Wprowadzone hasła nie są takie same";
-$text['message-password_mismatch']['uk'] = "Паролі не співпадають";
-$text['message-password_mismatch']['sv-se'] = "Lösenordet Stämmer Inte";
-$text['message-password_mismatch']['ro'] = "";
-$text['message-password_mismatch']['de-at'] = "Passwörter stimmen nicht überein.";
-$text['message-password_mismatch']['he'] = "הסיסמא לא נכונה";
-
-$text['message-password_blank']['en-us'] = "Invalid Password";
-$text['message-password_blank']['es-cl'] = "Contraseña No Válida";
-$text['message-password_blank']['pt-pt'] = "Senha Inválida";
-$text['message-password_blank']['fr-fr'] = "Mot de Passe Incorrect";
-$text['message-password_blank']['pl'] = "Nieprawidłowe hasło";
-$text['message-password_blank']['uk'] = "Неправильний пароль";
-$text['message-password_blank']['sv-se'] = "Ogiltigt Lösenord";
-$text['message-password_blank']['ro'] = "";
-$text['message-password_blank']['de-at'] = "Falsches Passwort";
-$text['message-password_blank']['he'] = "סיסמא לא קיימת";
-
-$text['message-new_group_name']['en-us'] = "Enter a Name for the new Group...";
-$text['message-new_group_name']['es-cl'] = "Introduzca un Nombre para el nuevo Grupo...";
-$text['message-new_group_name']['pt-pt'] = "Digite um Nome para o novo Grupo...";
-$text['message-new_group_name']['fr-fr'] = "Entrez un Nom pour le nouveau Groupe...";
-$text['message-new_group_name']['pl'] = "Wprowadź nazwę nowej grupy";
-$text['message-new_group_name']['uk'] = "Введіть назву нової групи";
-$text['message-new_group_name']['sv-se'] = "Ange ett Namn för den nya Gruppen...";
-$text['message-new_group_name']['ro'] = "";
-$text['message-new_group_name']['de-at'] = "Geben Sie den Namen der neuen Gruppe an...";
-$text['message-new_group_name']['he'] = "הכנס שם לקבוצה";
-
-$text['message-new_group_description']['en-us'] = "Enter a Description for the new Group...";
-$text['message-new_group_description']['es-cl'] = "Introduzca una Descripción para el nuevo Grupo...";
-$text['message-new_group_description']['pt-pt'] = "Digite uma Descrição para o novo grupo...";
-$text['message-new_group_description']['fr-fr'] = "Entrez une Description pour le nouveau groupe...";
-$text['message-new_group_description']['pl'] = "Wprowadź opis nowej grupy";
-$text['message-new_group_description']['uk'] = "Введіть опис нової групи";
-$text['message-new_group_description']['sv-se'] = "Ange en Beskrivning för den nya Gruppen...";
-$text['message-new_group_description']['ro'] = "";
-$text['message-new_group_description']['de-at'] = "Geben Sie eine Beschreiben für die neue Gruppe an...";
-$text['message-new_group_description']['he'] = "הכנס תאור לקבוצה";
-
-$text['message-maximum_users']['en-us'] = "Maximum Users:";
-$text['message-maximum_users']['es-cl'] = "Usuarios Máximo Permitido:";
-$text['message-maximum_users']['pt-pt'] = "Usuários Máximo Permitido:";
-$text['message-maximum_users']['fr-fr'] = "Utilisateurs Maximale Autorisée:";
-$text['message-maximum_users']['pl'] = "Maks ilość użytkowników";
-$text['message-maximum_users']['uk'] = "Максимальна кількість користувачів";
-$text['message-maximum_users']['sv-se'] = "Max Antal Användare:";
-$text['message-maximum_users']['ro'] = "";
-$text['message-maximum_users']['de-at'] = "Maximale Anzahl an Benutzern:";
-$text['message-maximum_users']['he'] = "מקסימום משתמשים";
-
-$text['message-group_exists']['en-us'] = "Group Already Exists";
-$text['message-group_exists']['es-cl'] = "El Grupo ya Existe";
-$text['message-group_exists']['pt-pt'] = "O Grupo já Existe";
-$text['message-group_exists']['fr-fr'] = "Le groupe existe déjà";
-$text['message-group_exists']['pl'] = "Grupa już istnieje";
-$text['message-group_exists']['uk'] = "Група вже існує";
-$text['message-group_exists']['sv-se'] = "Gruppen Existerar Redan";
-$text['message-group_exists']['ro'] = "";
-$text['message-group_exists']['de-at'] = "Gruppe existiert bereits";
-$text['message-group_exists']['he'] = "הקבוצה כבר קיימת";
-
-$text['message-default_system_group']['en-us'] = "Default system groups cannot be edited or deleted.";
-$text['message-default_system_group']['es-cl'] = "Grupos predeterminados del sistema no pueden ser editados o eliminados.";
-$text['message-default_system_group']['pt-pt'] = "Grupos de sistema padrão não podem ser editados ou apagados.";
-$text['message-default_system_group']['fr-fr'] = "Les groupes par défaut du système ne peuvent pas être modifiés ou supprimés.";
-$text['message-default_system_group']['pl'] = "Domyślne grupy systemowe nie mogą być edytowane lub usuwane";
-$text['message-default_system_group']['uk'] = "Системні групи за замовчуванням не можна редагувати або видаляти";
-$text['message-default_system_group']['sv-se'] = "Standard system grupper kan inte redigeras eller tas bort.";
-$text['message-default_system_group']['ro'] = "";
-$text['message-default_system_group']['de-at'] = "Systemgruppen können nicht bearbeitet oder gelöscht werden.";
-$text['message-default_system_group']['he'] = "";
-
-$text['message-copy']['en-us'] = "Copy Completed";
-$text['message-copy']['es-cl'] = "Copia Completada";
-$text['message-copy']['pt-pt'] = "Cópia Efectuada";
-$text['message-copy']['fr-fr'] = "Copie effectuée";
-$text['message-copy']['pl'] = "Skopiowano poprawnie";
-$text['message-copy']['uk'] = "Скопійовано";
-$text['message-copy']['sv-se'] = "Kopiering Slutförd";
-$text['message-copy']['ro'] = "Copiere completă";
-$text['message-copy']['de-at'] = "Kopieren erfolgreich";
-$text['message-copy']['he'] = "העתקה הושלמה";
-
-$text['message-cannot_delete_own_account']['en-us'] = "You cannot delete your own user account. Please login as a different user, then try again.";
-$text['message-cannot_delete_own_account']['es-cl'] = "No se puede eliminar su propia cuenta de usuario. Por favor, iniciar sesión como un usuario diferente, vuelva a intentarlo.";
-$text['message-cannot_delete_own_account']['pt-pt'] = "Você não pode excluir a sua própria conta de usuário. Identifique-se como um usuário diferente, em seguida, tente novamente.";
-$text['message-cannot_delete_own_account']['fr-fr'] = "Vous ne pouvez pas supprimer votre propre compte utilisateur. Veuillez vous identifier en tant qu'un utilisateur différent, puis réessayez.";
-$text['message-cannot_delete_own_account']['pl'] = "Nie można usunąć własnego konta użytkownika. Zaloguj się jako inny użytkownik i spróbuj ponownie.";
-$text['message-cannot_delete_own_account']['uk'] = "Ви не можете видалити власний обліковий запис. Будь ласка, увійдіть під іншим користувачем, потім повторіть спробу.";
-$text['message-cannot_delete_own_account']['sv-se'] = "Du kan inte ta bort ditt egna användarkonto. Logg ain som en annan användare och försök igen.";
-$text['message-cannot_delete_own_account']['ro'] = "";
-$text['message-cannot_delete_own_account']['de-at'] = "Sie können nicht ihren eigenen Benutzer löschen. Bitte melden Sie sich mit einem anderen Benutzer an und versuchen Sie es erneut.";
-$text['message-cannot_delete_own_account']['he'] = "";
-
-$text['label-username']['en-us'] = "Username";
-$text['label-username']['es-cl'] = "Nombre de usuario";
-$text['label-username']['pt-pt'] = "Nome de Utilizador";
-$text['label-username']['fr-fr'] = "Nom d'utilisateur";
-$text['label-username']['pl'] = "Użytkownik";
-$text['label-username']['uk'] = "Ім’я користувача";
-$text['label-username']['sv-se'] = "Användarnamn";
-$text['label-username']['ro'] = "Utilizator";
-$text['label-username']['de-at'] = "Benutzername";
-$text['label-username']['he'] = "שם משתמש";
-
-$text['label-user_language']['en-us'] = "Language";
-$text['label-user_language']['es-cl'] = "Lengua";
-$text['label-user_language']['pt-pt'] = "Língua";
-$text['label-user_language']['fr-fr'] = "Langue";
-$text['label-user_language']['pl'] = "Język";
-$text['label-user_language']['uk'] = "Мова";
-$text['label-user_language']['sv-se'] = "Språk";
-$text['label-user_language']['ro'] = "Limbă";
-$text['label-user_language']['de-at'] = "Sprache";
-$text['label-user_language']['he'] = "שפה";
-
-$text['label-user_info']['en-us'] = "User Info";
-$text['label-user_info']['es-cl'] = "Información de Usuario";
-$text['label-user_info']['pt-pt'] = "Informação do Utilizador";
-$text['label-user_info']['fr-fr'] = "Informations sur l'utilisateur";
-$text['label-user_info']['pl'] = "Informacje o użytkowniku";
-$text['label-user_info']['uk'] = "Інформація про користувача";
-$text['label-user_info']['sv-se'] = "Användar Info";
-$text['label-user_info']['ro'] = "";
-$text['label-user_info']['de-at'] = "Benutzer Information";
-$text['label-user_info']['he'] = "פרטי משתמש";
-
-$text['label-top']['en-us'] = "Top";
-$text['label-top']['es-cl'] = "encima";
-$text['label-top']['pt-pt'] = "Topo";
-$text['label-top']['fr-fr'] = "Meilleur";
-$text['label-top']['pt-br'] = "Topo";
-$text['label-top']['pl'] = "Top";
-$text['label-top']['he'] = "עליון";
-$text['label-top']['uk'] = "топ";
-$text['label-top']['sv-se'] = "Topp";
-$text['label-top']['de-at'] = "Oben";
-$text['label-top']['ro'] = "Top";
-$text['label-top']['fa'] = "";
-$text['label-top']['ar-eg'] = "أعلى";
-
-$text['label-time_zone']['en-us'] = "Time Zone";
-$text['label-time_zone']['es-cl'] = "Zona Horaria";
-$text['label-time_zone']['pt-pt'] = "Fuso Horário";
-$text['label-time_zone']['fr-fr'] = "Fuseau Horaire";
-$text['label-time_zone']['pl'] = "Strefa czasowa";
-$text['label-time_zone']['uk'] = "Часовий пояс";
-$text['label-time_zone']['sv-se'] = "Tidszon";
-$text['label-time_zone']['ro'] = "";
-$text['label-time_zone']['de-at'] = "Zeitzone";
-$text['label-time_zone']['he'] = "אזור זמן";
-
-$text['label-text']['en-us'] = "Text";
-$text['label-text']['es-cl'] = "Texto";
-$text['label-text']['pt-pt'] = "Texto";
-$text['label-text']['fr-fr'] = "Texte";
-$text['label-text']['pt-br'] = "Texto";
-$text['label-text']['pl'] = "Tekst";
-$text['label-text']['he'] = "טֶקסט";
-$text['label-text']['uk'] = "текст";
-$text['label-text']['sv-se'] = "Text";
-$text['label-text']['de-at'] = "Text";
-$text['label-text']['ro'] = "Text";
-$text['label-text']['fa'] = "";
-$text['label-text']['ar-eg'] = "نص";
-
-$text['label-status']['en-us'] = "Status";
-$text['label-status']['es-cl'] = "Estado";
-$text['label-status']['pt-pt'] = "Estado";
-$text['label-status']['fr-fr'] = "Etat";
-$text['label-status']['pl'] = "Status";
-$text['label-status']['uk'] = "Статус";
-$text['label-status']['sv-se'] = "Status";
-$text['label-status']['ro'] = "Stare";
-$text['label-status']['de-at'] = "Status";
-$text['label-status']['he'] = "סטטוס";
-
-$text['label-static']['en-us'] = "Static";
-$text['label-static']['es-cl'] = "Estático";
-$text['label-static']['pt-pt'] = "Estático";
-$text['label-static']['fr-fr'] = "Statique";
-$text['label-static']['pt-br'] = "Estático";
-$text['label-static']['pl'] = "Statyczny";
-$text['label-static']['he'] = "סטָטִי";
-$text['label-static']['uk'] = "статичний";
-$text['label-static']['sv-se'] = "Statisk";
-$text['label-static']['de-at'] = "Statisch";
-$text['label-static']['ro'] = "Static";
-$text['label-static']['fa'] = "";
-$text['label-static']['ar-eg'] = "ساكن";
-
-$text['label-right']['en-us'] = "Right";
-$text['label-right']['es-cl'] = "Derecha";
-$text['label-right']['pt-pt'] = "Certo";
-$text['label-right']['fr-fr'] = "Droite";
-$text['label-right']['pt-br'] = "Certo";
-$text['label-right']['pl'] = "Dobrze";
-$text['label-right']['he'] = "יָמִינָה";
-$text['label-right']['uk'] = "правий";
-$text['label-right']['sv-se'] = "Höger";
-$text['label-right']['de-at'] = "Recht";
-$text['label-right']['ro'] = "Dreapta";
-$text['label-right']['fa'] = "";
-$text['label-right']['ar-eg'] = "حق";
-
-$text['label-permission_permissions']['en-us'] = "Permissions";
-$text['label-permission_permissions']['es-cl'] = "Permisos";
-$text['label-permission_permissions']['pt-pt'] = "Permissões";
-$text['label-permission_permissions']['fr-fr'] = "Permissions";
-$text['label-permission_permissions']['pl'] = "Uprawnienia";
-$text['label-permission_permissions']['uk'] = "Привілеї";
-$text['label-permission_permissions']['sv-se'] = "Rättigheter";
-$text['label-permission_permissions']['ro'] = "";
-$text['label-permission_permissions']['de-at'] = "Berechtigungen";
-$text['label-permission_permissions']['he'] = "הרשאות";
-
-$text['label-permission_description']['en-us'] = "Description";
-$text['label-permission_description']['es-cl'] = "Descripción";
-$text['label-permission_description']['pt-pt'] = "Descrição";
-$text['label-permission_description']['fr-fr'] = "Description";
-$text['label-permission_description']['pl'] = "Opis";
-$text['label-permission_description']['uk'] = "Опис";
-$text['label-permission_description']['sv-se'] = "Beskrivning";
-$text['label-permission_description']['ro'] = "";
-$text['label-permission_description']['de-at'] = "Beschreibung";
-$text['label-permission_description']['he'] = "תאור";
-
-$text['label-password']['en-us'] = "Password";
-$text['label-password']['es-cl'] = "Contraseña";
-$text['label-password']['pt-pt'] = "Palavra-Passe";
-$text['label-password']['fr-fr'] = "Mot de passe";
-$text['label-password']['pl'] = "Hasło";
-$text['label-password']['uk'] = "Пароль";
-$text['label-password']['sv-se'] = "Lösenord";
-$text['label-password']['ro'] = "Parolă";
-$text['label-password']['de-at'] = "Passwort";
-$text['label-password']['he'] = "סיסמה";
-
-$text['label-none']['en-us'] = "None";
-$text['label-none']['es-cl'] = "Ninguna";
-$text['label-none']['pt-pt'] = "Nenhum";
-$text['label-none']['fr-fr'] = "Aucun";
-$text['label-none']['pt-br'] = "Nenhum";
-$text['label-none']['pl'] = "Żaden";
-$text['label-none']['he'] = "אף לא אחד";
-$text['label-none']['uk'] = "жоден";
-$text['label-none']['sv-se'] = "Ingen";
-$text['label-none']['de-at'] = "Keiner";
-$text['label-none']['ro'] = "Nici unul";
-$text['label-none']['fa'] = "";
-$text['label-none']['ar-eg'] = "لا شيء";
-
-$text['label-left']['en-us'] = "Left";
-$text['label-left']['es-cl'] = "Izquierda";
-$text['label-left']['pt-pt'] = "Esquerda";
-$text['label-left']['fr-fr'] = "À gauche";
-$text['label-left']['pt-br'] = "Esquerda";
-$text['label-left']['pl'] = "Lewo";
-$text['label-left']['he'] = "שְׁמֹאל";
-$text['label-left']['uk'] = "лівий";
-$text['label-left']['sv-se'] = "Vänster";
-$text['label-left']['de-at'] = "Links";
-$text['label-left']['ro'] = "Stânga";
-$text['label-left']['fa'] = "";
-$text['label-left']['ar-eg'] = "اليسار";
-
-$text['label-last_name']['en-us'] = "Last Name";
-$text['label-last_name']['es-cl'] = "Apellido";
-$text['label-last_name']['pt-pt'] = "Último Nome";
-$text['label-last_name']['fr-fr'] = "Nom";
-$text['label-last_name']['pl'] = "Nazwisko";
-$text['label-last_name']['uk'] = "Прізвище";
-$text['label-last_name']['sv-se'] = "Efternamn";
-$text['label-last_name']['ro'] = "";
-$text['label-last_name']['de-at'] = "Nachname";
-$text['label-last_name']['he'] = "שם משפחה";
-
-$text['label-inline']['en-us'] = "Inline";
-$text['label-inline']['es-cl'] = "En línea";
-$text['label-inline']['pt-pt'] = "Na linha";
-$text['label-inline']['fr-fr'] = "En ligne";
-$text['label-inline']['pt-br'] = "Na linha";
-$text['label-inline']['pl'] = "inline";
-$text['label-inline']['he'] = "בשורה";
-$text['label-inline']['uk'] = "В лінію";
-$text['label-inline']['sv-se'] = "I kö";
-$text['label-inline']['de-at'] = "In der Reihe";
-$text['label-inline']['ro'] = "In linie";
-$text['label-inline']['fa'] = "";
-$text['label-inline']['ar-eg'] = "في النسق";
-
-$text['label-image']['en-us'] = "Image";
-$text['label-image']['es-cl'] = "Imagen";
-$text['label-image']['pt-pt'] = "Imagem";
-$text['label-image']['fr-fr'] = "image";
-$text['label-image']['pt-br'] = "Imagem";
-$text['label-image']['pl'] = "Obraz";
-$text['label-image']['he'] = "תמונה";
-$text['label-image']['uk'] = "зображення";
-$text['label-image']['sv-se'] = "Bild";
-$text['label-image']['de-at'] = "Image";
-$text['label-image']['ro'] = "Imagine";
-$text['label-image']['fa'] = "";
-$text['label-image']['ar-eg'] = "صورة";
-
-$text['label-groups']['en-us'] = "Groups";
-$text['label-groups']['es-cl'] = "Grupos";
-$text['label-groups']['pt-pt'] = "Grupos";
-$text['label-groups']['fr-fr'] = "Groupes";
-$text['label-groups']['pl'] = "Grupy";
-$text['label-groups']['uk'] = "Групи";
-$text['label-groups']['sv-se'] = "Grupper";
-$text['label-groups']['ro'] = "";
-$text['label-groups']['de-at'] = "Gruppen";
-$text['label-groups']['he'] = "קבוצות";
-
-$text['label-group_tools']['en-us'] = "Tools";
-$text['label-group_tools']['es-cl'] = "Instrumentos";
-$text['label-group_tools']['pt-pt'] = "Ferramentas";
-$text['label-group_tools']['fr-fr'] = "Outils";
-$text['label-group_tools']['pl'] = "Narzędzia";
-$text['label-group_tools']['uk'] = "Інструменти";
-$text['label-group_tools']['sv-se'] = "Verktyg";
-$text['label-group_tools']['ro'] = "";
-$text['label-group_tools']['de-at'] = "Funktionen";
-$text['label-group_tools']['he'] = "כלים";
-
-$text['label-group_protected']['en-us'] = "Protected";
-$text['label-group_protected']['es-cl'] = "Protegido";
-$text['label-group_protected']['pt-pt'] = "Protegido";
-$text['label-group_protected']['fr-fr'] = "Protégé";
-$text['label-group_protected']['pl'] = "Zabezpieczony";
-$text['label-group_protected']['uk'] = "Захищено";
-$text['label-group_protected']['sv-se'] = "Skyddad";
-$text['label-group_protected']['ro'] = "";
-$text['label-group_protected']['de-at'] = "Geschützt";
-$text['label-group_protected']['he'] = "שמור";
-
-$text['label-group_permissions']['en-us'] = "Permissions";
-$text['label-group_permissions']['es-cl'] = "Permisos";
-$text['label-group_permissions']['pt-pt'] = "Permissões";
-$text['label-group_permissions']['fr-fr'] = "Permissions";
-$text['label-group_permissions']['pl'] = "Uprawnienia";
-$text['label-group_permissions']['uk'] = "Дозволи";
-$text['label-group_permissions']['sv-se'] = "Rättigheter";
-$text['label-group_permissions']['ro'] = "";
-$text['label-group_permissions']['de-at'] = "Berechtigungen";
-$text['label-group_permissions']['he'] = "הראשות";
-
-$text['label-group_name']['en-us'] = "Name";
-$text['label-group_name']['es-cl'] = "Nombre";
-$text['label-group_name']['pt-pt'] = "Nome";
-$text['label-group_name']['fr-fr'] = "Nom";
-$text['label-group_name']['pl'] = "Nazwa";
-$text['label-group_name']['uk'] = "Назва";
-$text['label-group_name']['sv-se'] = "Namn";
-$text['label-group_name']['ro'] = "";
-$text['label-group_name']['de-at'] = "Name";
-$text['label-group_name']['he'] = "שם";
-
-$text['label-group_members']['en-us'] = "Members";
-$text['label-group_members']['es-cl'] = "Miembros";
-$text['label-group_members']['pt-pt'] = "Membros";
-$text['label-group_members']['fr-fr'] = "Membres";
-$text['label-group_members']['pl'] = "Członkowie";
-$text['label-group_members']['uk'] = "Учасники";
-$text['label-group_members']['sv-se'] = "Medlemmar";
-$text['label-group_members']['ro'] = "";
-$text['label-group_members']['de-at'] = "Mitglieder";
-$text['label-group_members']['he'] = "משתמשים";
-
-$text['label-group_description']['en-us'] = "Description";
-$text['label-group_description']['es-cl'] = "Descripción";
-$text['label-group_description']['pt-pt'] = "Descrição";
-$text['label-group_description']['fr-fr'] = "Description";
-$text['label-group_description']['pl'] = "Opis";
-$text['label-group_description']['uk'] = "Опис";
-$text['label-group_description']['sv-se'] = "Beskrivning";
-$text['label-group_description']['ro'] = "";
-$text['label-group_description']['de-at'] = "Beschreibung";
-$text['label-group_description']['he'] = "תאור";
-
-$text['label-group']['en-us'] = "Group";
-$text['label-group']['es-cl'] = "Grupo";
-$text['label-group']['pt-pt'] = "Grupo";
-$text['label-group']['fr-fr'] = "Group";
-$text['label-group']['pl'] = "Grupa";
-$text['label-group']['uk'] = "Група";
-$text['label-group']['sv-se'] = "Grupp";
-$text['label-group']['ro'] = "";
-$text['label-group']['de-at'] = "Gruppe";
-$text['label-group']['he'] = "קבוצה";
-
-$text['label-global']['en-us'] = "Global";
-$text['label-global']['es-cl'] = "Global";
-$text['label-global']['pt-pt'] = "Global";
-$text['label-global']['fr-fr'] = "Global";
-$text['label-global']['pl'] = "Ogólny";
-$text['label-global']['uk'] = "Глобально";
-$text['label-global']['sv-se'] = "Global";
-$text['label-global']['ro'] = "";
-$text['label-global']['de-at'] = "Global";
-$text['label-global']['he'] = "כללי";
-
-$text['label-fixed']['en-us'] = "Fixed";
-$text['label-fixed']['es-cl'] = "Fijo";
-$text['label-fixed']['pt-pt'] = "Fixo";
-$text['label-fixed']['fr-fr'] = "Fixé";
-$text['label-fixed']['pt-br'] = "Fixo";
-$text['label-fixed']['pl'] = "Naprawiony";
-$text['label-fixed']['he'] = "קָבוּעַ";
-$text['label-fixed']['uk'] = "фіксований";
-$text['label-fixed']['sv-se'] = "Fast";
-$text['label-fixed']['de-at'] = "fest";
-$text['label-fixed']['ro'] = "Fix";
-$text['label-fixed']['fa'] = "";
-$text['label-fixed']['ar-eg'] = "ثابت";
-
-$text['label-first_name']['en-us'] = "First Name";
-$text['label-first_name']['es-cl'] = "Nombre";
-$text['label-first_name']['pt-pt'] = "Primeiro Nome";
-$text['label-first_name']['fr-fr'] = "Prénom";
-$text['label-first_name']['pl'] = "Imię";
-$text['label-first_name']['uk'] = "Ім’я";
-$text['label-first_name']['sv-se'] = "Förnamn";
-$text['label-first_name']['ro'] = "";
-$text['label-first_name']['de-at'] = "Vorname";
-$text['label-first_name']['he'] = "שם";
-
-$text['label-email']['en-us'] = "Email";
-$text['label-email']['es-cl'] = "Email";
-$text['label-email']['pt-pt'] = "Email";
-$text['label-email']['fr-fr'] = "Courriel";
-$text['label-email']['pl'] = "Email";
-$text['label-email']['uk'] = "Електронна пошта";
-$text['label-email']['sv-se'] = "E-post";
-$text['label-email']['ro'] = "";
-$text['label-email']['de-at'] = "Email";
-$text['label-email']['he'] = "אימייל";
-
-$text['label-domain']['en-us'] = "Domain";
-$text['label-domain']['es-cl'] = "Dominio";
-$text['label-domain']['pt-pt'] = "Domínio";
-$text['label-domain']['fr-fr'] = "Domaine";
-$text['label-domain']['pl'] = "Domena";
-$text['label-domain']['uk'] = "Домен";
-$text['label-domain']['sv-se'] = "Domän";
-$text['label-domain']['ro'] = "Domeniu";
-$text['label-domain']['de-at'] = "Domain";
-$text['label-domain']['he'] = "תחום";
-
-$text['label-contact']['en-us'] = "Contact";
-$text['label-contact']['es-cl'] = "Contacto";
-$text['label-contact']['pt-pt'] = "Contacto";
-$text['label-contact']['fr-fr'] = "Contact";
-$text['label-contact']['pl'] = "Kontakt";
-$text['label-contact']['uk'] = "Контакт";
-$text['label-contact']['sv-se'] = "Kontakt";
-$text['label-contact']['ro'] = "";
-$text['label-contact']['de-at'] = "Kontakt";
-$text['label-contact']['he'] = "איש קשר";
-
-$text['label-confirm_password']['en-us'] = "Confirm Password";
-$text['label-confirm_password']['es-cl'] = "Confirme Contraseña";
-$text['label-confirm_password']['pt-pt'] = "Confirmar Palavra-Passe";
-$text['label-confirm_password']['fr-fr'] = "Confirmer le mot de passe";
-$text['label-confirm_password']['pl'] = "Potwierdź hasło";
-$text['label-confirm_password']['uk'] = "Повторити пароль";
-$text['label-confirm_password']['sv-se'] = "Bekräfta Lösenord";
-$text['label-confirm_password']['ro'] = "";
-$text['label-confirm_password']['de-at'] = "Passwort bestätigen";
-$text['label-confirm_password']['he'] = "אשר סיסמא";
-
-$text['label-company_name']['en-us'] = "Company Name";
-$text['label-company_name']['es-cl'] = "Nombre de la Compañia";
-$text['label-company_name']['pt-pt'] = "Nome da Empresa";
-$text['label-company_name']['fr-fr'] = "Compagnie";
-$text['label-company_name']['pl'] = "Nazwa firmy";
-$text['label-company_name']['uk'] = "Назва компанії";
-$text['label-company_name']['sv-se'] = "Företags Namn";
-$text['label-company_name']['ro'] = "";
-$text['label-company_name']['de-at'] = "Firmenname";
-$text['label-company_name']['he'] = "שם חברה";
-
-$text['label-center']['en-us'] = "Center";
-$text['label-center']['es-cl'] = "Centrar";
-$text['label-center']['pt-pt'] = "Centro";
-$text['label-center']['fr-fr'] = "centre";
-$text['label-center']['pt-br'] = "Centro";
-$text['label-center']['pl'] = "Centrum";
-$text['label-center']['he'] = "מֶרְכָּז";
-$text['label-center']['uk'] = "центр";
-$text['label-center']['sv-se'] = "Centrum";
-$text['label-center']['de-at'] = "Center";
-$text['label-center']['ro'] = "Centru";
-$text['label-center']['fa'] = "";
-$text['label-center']['ar-eg'] = "مركز";
-
-$text['label-bottom']['en-us'] = "Bottom";
-$text['label-bottom']['es-cl'] = "Fondo";
-$text['label-bottom']['pt-pt'] = "Inferior";
-$text['label-bottom']['fr-fr'] = "Bas";
-$text['label-bottom']['pt-br'] = "Inferior";
-$text['label-bottom']['pl'] = "Dolny";
-$text['label-bottom']['he'] = "תַחתִית";
-$text['label-bottom']['uk'] = "дно";
-$text['label-bottom']['sv-se'] = "Botten";
-$text['label-bottom']['de-at'] = "Boden";
-$text['label-bottom']['ro'] = "Fund";
-$text['label-bottom']['fa'] = "";
-$text['label-bottom']['ar-eg'] = "أسفل";
-
-$text['label-api_key']['en-us'] = "API Key";
-$text['label-api_key']['es-cl'] = "API Key";
-$text['label-api_key']['pt-pt'] = "API Key";
-$text['label-api_key']['fr-fr'] = "Clé d'API";
-$text['label-api_key']['pl'] = "Klucz API";
-$text['label-api_key']['uk'] = "Ключ API";
-$text['label-api_key']['sv-se'] = "API Nyckel";
-$text['label-api_key']['ro'] = "";
-$text['label-api_key']['de-at'] = "API Key";
-$text['label-api_key']['he'] = "";
-
-$text['label-additional_info']['en-us'] = "Additional Info";
-$text['label-additional_info']['es-cl'] = "Información Adicional";
-$text['label-additional_info']['pt-pt'] = "Informação Adicional";
-$text['label-additional_info']['fr-fr'] = "Informations additionnelles";
-$text['label-additional_info']['pl'] = "Dodatkowe informacje";
-$text['label-additional_info']['uk'] = "Додаткова інформація";
-$text['label-additional_info']['sv-se'] = "Ytterligare Info";
-$text['label-additional_info']['ro'] = "";
-$text['label-additional_info']['de-at'] = "Zusätzliche Information";
-$text['label-additional_info']['he'] = "מידע נוסף";
-
-$text['label-24-hour']['en-us'] = "24-Hour";
-$text['label-24-hour']['es-cl'] = "24 horas";
-$text['label-24-hour']['pt-pt'] = "24 horas";
-$text['label-24-hour']['fr-fr'] = "24 heures";
-$text['label-24-hour']['pt-br'] = "24 horas";
-$text['label-24-hour']['pl'] = "24-godzinny";
-$text['label-24-hour']['he'] = "24 שעות";
-$text['label-24-hour']['uk'] = "24-годинний";
-$text['label-24-hour']['sv-se'] = "24-timmars";
-$text['label-24-hour']['de-at'] = "24 Stunden";
-$text['label-24-hour']['ro'] = "24 de ore";
-$text['label-24-hour']['fa'] = "";
-$text['label-24-hour']['ar-eg'] = "24 ساعة";
-
-$text['label-12-hour']['en-us'] = "12-Hour";
-$text['label-12-hour']['es-cl'] = "12 horas";
-$text['label-12-hour']['pt-pt'] = "12 horas";
-$text['label-12-hour']['fr-fr'] = "12 heures";
-$text['label-12-hour']['pt-br'] = "12 horas";
-$text['label-12-hour']['pl'] = "12-godzinny";
-$text['label-12-hour']['he'] = "12 שעות";
-$text['label-12-hour']['uk'] = "12-годинний";
-$text['label-12-hour']['sv-se'] = "12-timmars";
-$text['label-12-hour']['de-at'] = "12 Stunden";
-$text['label-12-hour']['ro'] = "12 de ore";
-$text['label-12-hour']['fa'] = "";
-$text['label-12-hour']['ar-eg'] = "12 ساعة";
-
-$text['header-user_setting-edit']['en-us'] = "User Setting";
-$text['header-user_setting-edit']['es-cl'] = "Configuración de Usuario";
-$text['header-user_setting-edit']['pt-pt'] = "Definição do Utilizador";
-$text['header-user_setting-edit']['fr-fr'] = "Cadre de l'utilisateur";
-
-$text['header-user_setting-add']['en-us'] = "User Setting Add";
-$text['header-user_setting-add']['es-cl'] = "Ajuste del usuario Agregar";
-$text['header-user_setting-add']['pt-pt'] = "Usuário setting Adicionar";
-$text['header-user_setting-add']['fr-fr'] = "Cadre utilisateur Ajouter";
-
-$text['header-user_manager']['en-us'] = "Users";
-$text['header-user_manager']['es-cl'] = "Administración de Usuario";
-$text['header-user_manager']['pt-pt'] = "Gestão de Utilizadores";
-$text['header-user_manager']['fr-fr'] = "Gestion des utilisateurs";
-$text['header-user_manager']['pl'] = "Menadżer użytkowników";
-$text['header-user_manager']['uk'] = "Користувачі";
-$text['header-user_manager']['sv-se'] = "Användar Inställningar";
-$text['header-user_manager']['ro'] = "";
-$text['header-user_manager']['de-at'] = "Benutzerverwaltung";
-$text['header-user_manager']['he'] = "מנהל משתמש";
-
-$text['header-user_edit']['en-us'] = "User";
-$text['header-user_edit']['es-cl'] = "Editar Usuario";
-$text['header-user_edit']['pt-pt'] = "Editar Utilizador";
-$text['header-user_edit']['fr-fr'] = "Modifier l'utilisateur";
-$text['header-user_edit']['pl'] = "Użytkownik";
-$text['header-user_edit']['uk'] = "Користувач";
-$text['header-user_edit']['sv-se'] = "Användare";
-$text['header-user_edit']['ro'] = "";
-$text['header-user_edit']['de-at'] = "Benutzer";
-$text['header-user_edit']['he'] = "משתמש";
-
-$text['header-user_add']['en-us'] = "User";
-$text['header-user_add']['es-cl'] = "Agregar Usuario";
-$text['header-user_add']['pt-pt'] = "Adicionar Utilizador";
-$text['header-user_add']['fr-fr'] = "Ajout d'un utilisateur";
-$text['header-user_add']['pl'] = "Użytkownik";
-$text['header-user_add']['uk'] = "Користувач";
-$text['header-user_add']['sv-se'] = "Användare";
-$text['header-user_add']['ro'] = "";
-$text['header-user_add']['de-at'] = "Benutzer";
-$text['header-user_add']['he'] = "משתמש";
-
-$text['header-group_permissions']['en-us'] = "Group Permissions: ";
-$text['header-group_permissions']['es-cl'] = "Permisos de Grupo: ";
-$text['header-group_permissions']['pt-pt'] = "Permissões do Grupo: ";
-$text['header-group_permissions']['fr-fr'] = "Permissions du Groupe: ";
-$text['header-group_permissions']['pl'] = "Uprawnienia grupy";
-$text['header-group_permissions']['uk'] = "Привілеї групи:";
-$text['header-group_permissions']['sv-se'] = "Grupp Rättigheter";
-$text['header-group_permissions']['ro'] = "";
-$text['header-group_permissions']['de-at'] = "Gruppenberechtigungen:";
-$text['header-group_permissions']['he'] = "הרשאות קבוצה";
-
-$text['header-group_members']['en-us'] = "Group Members: ";
-$text['header-group_members']['es-cl'] = "Miembros de Grupo: ";
-$text['header-group_members']['pt-pt'] = "Membros do Grupo: ";
-$text['header-group_members']['fr-fr'] = "Membres du Groupe: ";
-$text['header-group_members']['pl'] = "Członkowie grupy:";
-$text['header-group_members']['uk'] = "Учасники групи: ";
-$text['header-group_members']['sv-se'] = "Grupp Medlemmar:";
-$text['header-group_members']['ro'] = "";
-$text['header-group_members']['de-at'] = "Gruppenmitglieder:";
-$text['header-group_members']['he'] = "משתמשי קבוצה";
-
-$text['header-group_manager']['en-us'] = "Group Manager";
-$text['header-group_manager']['es-cl'] = "Administración de Grupo";
-$text['header-group_manager']['pt-pt'] = "Gestão de Grupos";
-$text['header-group_manager']['fr-fr'] = "Gestion de Groupe";
-$text['header-group_manager']['pl'] = "Menadżer  grup";
-$text['header-group_manager']['uk'] = "Групи";
-$text['header-group_manager']['sv-se'] = "Grupp Inställningar";
-$text['header-group_manager']['ro'] = "";
-$text['header-group_manager']['de-at'] = "Gruppenverwaltung";
-$text['header-group_manager']['he'] = "מנהל קבוצה";
-
-$text['header-group_edit']['en-us'] = "Edit Group";
-$text['header-group_edit']['es-cl'] = "Editar Grupo";
-$text['header-group_edit']['pt-pt'] = "Editar Grupo";
-$text['header-group_edit']['fr-fr'] = "Modifier le Groupe";
-$text['header-group_edit']['pl'] = "Edycja grupy";
-$text['header-group_edit']['uk'] = "Редагувати групу";
-$text['header-group_edit']['sv-se'] = "Editera Grupp";
-$text['header-group_edit']['ro'] = "";
-$text['header-group_edit']['de-at'] = "Gruppe bearbeiten";
-$text['header-group_edit']['he'] = "ערוך קבוצה";
-
-$text['header-group_add']['en-us'] = "Add Group";
-$text['header-group_add']['es-cl'] = "Agregar Grupo";
-$text['header-group_add']['pt-pt'] = "Adicionar Grupo";
-$text['header-group_add']['fr-fr'] = "Ajouter un Groupe";
-$text['header-group_add']['pl'] = "Dodaj grupę";
-$text['header-group_add']['uk'] = "Додати групу";
-$text['header-group_add']['sv-se'] = "Lägg Till Grupp";
-$text['header-group_add']['ro'] = "";
-$text['header-group_add']['de-at'] = "Gruppe hinzufügen";
-$text['header-group_add']['he'] = "הוסף קבוצה";
-
-$text['description-user_setting-edit']['en-us'] = "Edit a setting for this user.";
-$text['description-user_setting-edit']['es-cl'] = "Editar un escenario de este usuario.";
-$text['description-user_setting-edit']['pt-pt'] = "Editar uma configuração para este usuário.";
-$text['description-user_setting-edit']['fr-fr'] = "Modifier un réglage pour cet utilisateur.";
-
-$text['description-user_setting-add']['en-us'] = "Add a setting for this user.";
-$text['description-user_setting-add']['es-cl'] = "Añadir un entorno para este usuario.";
-$text['description-user_setting-add']['pt-pt'] = "Adicionar uma definição para esse usuário.";
-$text['description-user_setting-add']['fr-fr'] = "Ajouter un cadre pour cet utilisateur.";
-
-$text['description-user_manager']['en-us'] = "Add, edit, delete, and search users. ";
-$text['description-user_manager']['es-cl'] = "Agregar, Editar, Eliminar y Buscar Usuarios. ";
-$text['description-user_manager']['pt-pt'] = "Adicionar, editar, remover e pesquisar utilizadores. ";
-$text['description-user_manager']['fr-fr'] = "Ajouter, modifier, supprimer et chercher des utilisateurs. ";
-$text['description-user_manager']['pl'] = "Dodaj, edytuj, usuń i wyszukaj użytkowników.";
-$text['description-user_manager']['uk'] = "Додавання, редагування, видалення та пошук користувачів";
-$text['description-user_manager']['sv-se'] = "Lägg Till, editera, ta bort och sök användare.";
-$text['description-user_manager']['ro'] = "";
-$text['description-user_manager']['de-at'] = "Benutzer anlegen, editieren, löschen und suchen.";
-$text['description-user_manager']['he'] = "הוסף, ערוך, מחק וחפש משתמשים";
-
-$text['description-user_language']['en-us'] = "Select the language.";
-$text['description-user_language']['es-cl'] = "Seleccione el idioma.";
-$text['description-user_language']['pt-pt'] = "Selecione o idioma.";
-$text['description-user_language']['fr-fr'] = "Sélectionnez la langue.";
-$text['description-user_language']['pl'] = "Wybierz język";
-$text['description-user_language']['uk'] = "Виберіть мову";
-$text['description-user_language']['sv-se'] = "Välj Språk";
-$text['description-user_language']['ro'] = "Selecție limbă";
-$text['description-user_language']['de-at'] = "Sprache auswählen";
-$text['description-user_language']['he'] = "בחר שפה";
-
-$text['description-user_edit']['en-us'] = "Edit user information and group membership. ";
-$text['description-user_edit']['es-cl'] = "Editar información del usuario y pertenencia al grupo. ";
-$text['description-user_edit']['pt-pt'] = "Editar a informação do utilizador e os membros do grupo. ";
-$text['description-user_edit']['fr-fr'] = "Modifier les informations de l'utilisateur et l'appartenance au groupe.";
-$text['description-user_edit']['pl'] = "Edytuj informacje o użytkowniku i przynależności do grupy.";
-$text['description-user_edit']['uk'] = "Змініть інформацію користувача і членство в групі.";
-$text['description-user_edit']['sv-se'] = "Meditera användarinformation och grupp medlemskap.";
-$text['description-user_edit']['ro'] = "";
-$text['description-user_edit']['de-at'] = "Benutzerinformationen und Gruppen verwalten.";
-$text['description-user_edit']['he'] = "ערוך פרטי משתמש ושיוך לקבוצה";
-
-$text['description-user_add']['en-us'] = "To add a user, please fill out this form completely. All fields are required. ";
-$text['description-user_add']['es-cl'] = "Para agregar un usuario, por favor llene completamente el siguiente formulario. Todos los campos son obligatorios. ";
-$text['description-user_add']['pt-pt'] = "Para adicionar um utilizador por favor preencha este formulário. Todos os campos são de preenchimento obrigatório. ";
-$text['description-user_add']['fr-fr'] = "Afin d'ajouter des utilisateurs, remplissez complètement ce formulaire. Tous les champs sont requis. ";
-$text['description-user_add']['pl'] = "Aby dodać użytkownika, wypełnij ten formularz w całości. Wszystkie pola są wymagane.";
-$text['description-user_add']['uk'] = "Щоб додати користувача, будь ласка, заповніть цю форму повністю. Всі поля обов'язкові для заповнення.";
-$text['description-user_add']['sv-se'] = "För att lägga till en användare, fyll i hela detta formulär. Alla fält måste fyllas i.";
-$text['description-user_add']['ro'] = "";
-$text['description-user_add']['de-at'] = "Um einen Benutzer anzulegen, füllen Sie bitte dieses Formular komplett aus. Alle Felder sind erforderlich.";
-$text['description-user_add']['he'] = "בכדי להוסיף משתמש, אנא הכנס את הפרטים בכל השדות.";
-
-$text['description-time_zone']['en-us'] = "Select the default time zone.";
-$text['description-time_zone']['es-cl'] = "Seleccione la zona horaria por defecto.";
-$text['description-time_zone']['pt-pt'] = "Escolha o fuso horário por omissão.";
-$text['description-time_zone']['fr-fr'] = "Sélectionnez le fuseau horaire par défaut.";
-$text['description-time_zone']['pl'] = "Wybierz domyślną strefę czasową";
-$text['description-time_zone']['uk'] = "Виберіть часовий пояс за замовчуванням.";
-$text['description-time_zone']['sv-se'] = "Välj standard tidszon";
-$text['description-time_zone']['ro'] = "";
-$text['description-time_zone']['de-at'] = "Wählen Sie die Standard Zeitzone";
-$text['description-time_zone']['he'] = "הגדר אזור זמן";
-
-$text['description-status']['en-us'] = "Set the user's presence.";
-$text['description-status']['es-cl'] = "Configure la presencia del usuario.";
-$text['description-status']['pt-pt'] = "Escolher o estado de presença do utilizador.";
-$text['description-status']['fr-fr'] = "Sélectionnez l'état de présence de l'utilisateur.";
-$text['description-status']['pl'] = "Wybierz status użytkownika";
-$text['description-status']['uk'] = "Виберіть статус користувача";
-$text['description-status']['sv-se'] = "Välj en användarstatus.";
-$text['description-status']['ro'] = "Selectați starea utilizatorului";
-$text['description-status']['de-at'] = "Benutzerstatus auswählen";
-$text['description-status']['he'] = "בחר את סטטוס המשתמש";
-
-$text['description-group_permissions']['en-us'] = "Assign permissions for this group.";
-$text['description-group_permissions']['es-cl'] = "Asigne permisos para este grupo.";
-$text['description-group_permissions']['pt-pt'] = "Atribua permissões para este grupo.";
-$text['description-group_permissions']['fr-fr'] = "Assignez des permissions à ce groupe.";
-$text['description-group_permissions']['pl'] = "Przypisywanie uprawnień tej grupie.";
-$text['description-group_permissions']['uk'] = "Призначення привілеїв для цієї групи.";
-$text['description-group_permissions']['sv-se'] = "Tilldela rättigheter till denna grupp.";
-$text['description-group_permissions']['ro'] = "";
-$text['description-group_permissions']['de-at'] = "Ordnen Sie Berechtigungen für diese Gruppe zu.";
-$text['description-group_permissions']['he'] = "צור הרשאות לקבוצה";
-
-$text['description-group_edit']['en-us'] = "Edit the properties of the group.";
-$text['description-group_edit']['es-cl'] = "Editar las propiedades del grupo.";
-$text['description-group_edit']['pt-pt'] = "Editar as propriedades do grupo.";
-$text['description-group_edit']['fr-fr'] = "Modifier les propriétés du groupe.";
-$text['description-group_edit']['pl'] = "Edytuj właściwości grupy.";
-$text['description-group_edit']['uk'] = "Зміна властивостей групи.";
-$text['description-group_edit']['sv-se'] = "Editera inställningar för gruppen.";
-$text['description-group_edit']['ro'] = "";
-$text['description-group_edit']['de-at'] = "Bearbeiten Sie die Eigenschaften dieser Gruppe";
-$text['description-group_edit']['he'] = "";
-
-$text['description-group_add']['en-us'] = "Create a new user group.";
-$text['description-group_add']['es-cl'] = "Crear un nuevo grupo de usuarios.";
-$text['description-group_add']['pt-pt'] = "Criar um novo grupo de usuários.";
-$text['description-group_add']['fr-fr'] = "Créez un nouveau groupe d'utilisateurs.";
-$text['description-group_add']['pl'] = "Utwórz nową grupę użytkowników.";
-$text['description-group_add']['uk'] = "Створити нову групу користувачів.";
-$text['description-group_add']['sv-se'] = "Skapa en ny användargrupp.";
-$text['description-group_add']['ro'] = "";
-$text['description-group_add']['de-at'] = "Legen Sie einen neue Gruppe an.";
-$text['description-group_add']['he'] = "";
-
-$text['description-enabled']['en-us'] = "Set the status of this account.";
-$text['description-enabled']['es-cl'] = "Indique el estaso de esta cuenta.";
-$text['description-enabled']['pt-pt'] = "Escolha o estado desta conta.";
-$text['description-enabled']['fr-fr'] = "Choisir le statut de ce compte.";
-$text['description-enabled']['pl'] = "Ustaw status numeru wewnętrznego.";
-$text['description-enabled']['uk'] = "Вкажіть стан цього облікового запису.";
-$text['description-enabled']['sv-se'] = "Välj status på denna standardinställning.";
-$text['description-enabled']['ro'] = "";
-$text['description-enabled']['de-at'] = "Setzen Sie den Status dieses Kontos.";
-$text['description-enabled']['he'] = "בחר את הסטטוס לחשבון זה";
-
-$text['description-contact_view']['en-us'] = "View";
-$text['description-contact_view']['es-cl'] = "Ver";
-$text['description-contact_view']['pt-pt'] = "Ver";
-$text['description-contact_view']['fr-fr'] = "Voir";
-$text['description-contact_view']['pl'] = "Widok";
-$text['description-contact_view']['uk'] = "Перегляд";
-$text['description-contact_view']['sv-se'] = "Granska";
-$text['description-contact_view']['ro'] = "";
-$text['description-contact_view']['de-at'] = "Ansicht";
-$text['description-contact_view']['he'] = "הצג";
-
-$text['description-contact']['en-us'] = "Assign a contact to this user account.";
-$text['description-contact']['es-cl'] = "Asignar un contacto a este usuario.";
-$text['description-contact']['pt-pt'] = "Atribuir um contacto a esta conta de utilizador.";
-$text['description-contact']['fr-fr'] = "Attacher un contact à ce compte utilisateur";
-$text['description-contact']['pl'] = "Wybierz numer";
-$text['description-contact']['uk'] = "Призначити контакт в цей обліковий запис користувача.";
-$text['description-contact']['sv-se'] = "Tilldela en kontakt till detta konto.";
-$text['description-contact']['ro'] = "";
-$text['description-contact']['de-at'] = "Weisen Sie diesem Benutzer einen Kontakt zu.";
-$text['description-contact']['he'] = "שייך איש קשר לחשבון";
-
-$text['description-api_key']['en-us'] = "Enter the API key is often a UUID. The API key should be 128 bit or greater.";
-$text['description-api_key']['es-cl'] = "Indique la API key.";
-$text['description-api_key']['pt-pt'] = "";
-$text['description-api_key']['fr-fr'] = "Entrez la  clé d'API. Il s'agit souvent d'un identifiant universel unique (UUID). La clé devrait faire 128 bits ou plus de longueur.";
-$text['description-api_key']['pl'] = "Wprowadź klucz API, który jest często UUID. Klucz API powinien być 128 bitowy lub lepszy.";
-$text['description-api_key']['uk'] = "Введіть ключ API, зазвичай UUID. Ключ API повинен бути 128 біт або більше.";
-$text['description-api_key']['sv-se'] = "Ange API nyckel (ofta UUID). API nyckeln borde vara 128 bit eller mer.";
-$text['description-api_key']['ro'] = "";
-$text['description-api_key']['de-at'] = "Geben Sie den API Schlüssel an. Der API Schlüssel sollte mindestens 128 bit oder länger sein.";
-$text['description-api_key']['he'] = "";
-
-$text['confirm-delete']['en-us'] = "Do you really want to delete this?";
-$text['confirm-delete']['es-cl'] = "¿Realmente desea eliminar esto?";
-$text['confirm-delete']['pt-pt'] = "Tem a certeza que pretende remover isto?";
-$text['confirm-delete']['fr-fr'] = "Voulez-vous vraiment supprimer cela?";
-$text['confirm-delete']['pl'] = "Czy na pewno chcesz to usunąć?";
-$text['confirm-delete']['uk'] = "Ви дійсно бажаєте це видалити?";
-$text['confirm-delete']['sv-se'] = "Vill du verkligen ta bort detta?";
-$text['confirm-delete']['ro'] = "";
-$text['confirm-delete']['de-at'] = "Wollen Sie das wirklich löschen?";
-$text['confirm-delete']['he'] = "?בטוח שאתה רוצה למחוק";
-
-$text['button-show_all']['en-us'] = "Show All";
-$text['button-show_all']['es-cl'] = "Mostrar Todos";
-$text['button-show_all']['pt-pt'] = "Mostrar Todos";
-$text['button-show_all']['fr-fr'] = "Tout Montrer";
-$text['button-show_all']['pl'] = "Pokaż wszystkie";
-$text['button-show_all']['uk'] = "Показати всі";
-$text['button-show_all']['sv-se'] = "Visa Allt";
-$text['button-show_all']['ro'] = "";
-$text['button-show_all']['de-at'] = "Alle anzeigen";
-$text['button-show_all']['he'] = "הצג הכל";
-
-$text['button-generate']['en-us'] = "Generate";
-$text['button-generate']['es-cl'] = "Generar";
-$text['button-generate']['pt-pt'] = "Geração";
-$text['button-generate']['fr-fr'] = "Générer";
-$text['button-generate']['pl'] = "Generuj";
-$text['button-generate']['uk'] = "Згенерувати";
-$text['button-generate']['sv-se'] = "Generera";
-$text['button-generate']['ro'] = "";
-$text['button-generate']['de-at'] = "Generieren";
-$text['button-generate']['he'] = "יצר";
-
-$text['button-create_account']['en-us'] = "Create Account";
-$text['button-create_account']['es-cl'] = "Crear Cuenta";
-$text['button-create_account']['pt-pt'] = "Criar Conta";
-$text['button-create_account']['fr-fr'] = "Créer le Compte";
-$text['button-create_account']['pl'] = "Załóż konto";
-$text['button-create_account']['uk'] = "Створити обліковий запис";
-$text['button-create_account']['sv-se'] = "Skapa Konto";
-$text['button-create_account']['ro'] = "";
-$text['button-create_account']['de-at'] = "Konto hinzufügen";
-$text['button-create_account']['he'] = "צור חשבון";
-
-$text['button-add_member']['en-us'] = "Add Member";
-$text['button-add_member']['es-cl'] = "Agregar Miembro";
-$text['button-add_member']['pt-pt'] = "Adicionar Membro";
-$text['button-add_member']['fr-fr'] = "Ajouter un Membre";
-$text['button-add_member']['pl'] = "Dodaj członka";
-$text['button-add_member']['uk'] = "Додати учасника";
-$text['button-add_member']['sv-se'] = "Lägg Till Medlem";
-$text['button-add_member']['ro'] = "";
-$text['button-add_member']['de-at'] = "Mitglied hinzufügen";
-$text['button-add_member']['he'] = "הוסף משתמש";
-
+<?php
+
+$text['title-user_setting-edit']['en-us'] = "User Setting";
+$text['title-user_setting-edit']['es-cl'] = "Configuración de Usuario";
+$text['title-user_setting-edit']['pt-pt'] = "Definição do Utilizador";
+$text['title-user_setting-edit']['fr-fr'] = "Cadre de l'utilisateur";
+
+$text['title-user_setting-add']['en-us'] = "User Setting Add";
+$text['title-user_setting-add']['es-cl'] = "Ajuste del usuario Agregar";
+$text['title-user_setting-add']['pt-pt'] = "Usuário setting Adicionar";
+$text['title-user_setting-add']['fr-fr'] = "Cadre utilisateur Ajouter";
+
+$text['title-user_manager']['en-us'] = "User Manager";
+$text['title-user_manager']['es-cl'] = "Administración de Usuarios";
+$text['title-user_manager']['pt-pt'] = "Gestão de Utilizadores";
+$text['title-user_manager']['fr-fr'] = "Gestion des utilisateurs";
+$text['title-user_manager']['pl'] = "Menedżer użytkowników";
+$text['title-user_manager']['uk'] = "Користувачі";
+$text['title-user_manager']['sv-se'] = "Användar Inställningar";
+$text['title-user_manager']['ro'] = "";
+$text['title-user_manager']['de-at'] = "Benutzerverwaltung";
+$text['title-user_manager']['he'] = "מנהל משתמש";
+
+$text['title-user_edit']['en-us'] = "User";
+$text['title-user_edit']['es-cl'] = "Editar Usuario";
+$text['title-user_edit']['pt-pt'] = "Utilizador";
+$text['title-user_edit']['fr-fr'] = "Modifier l'utilisateur";
+$text['title-user_edit']['pl'] = "Użytkownik";
+$text['title-user_edit']['uk'] = "Користувач";
+$text['title-user_edit']['sv-se'] = "Användare";
+$text['title-user_edit']['ro'] = "Utilizator";
+$text['title-user_edit']['de-at'] = "Benutzer";
+$text['title-user_edit']['he'] = "משתמש";
+
+$text['title-user_add']['en-us'] = "User";
+$text['title-user_add']['es-cl'] = "Agregar Usuario";
+$text['title-user_add']['pt-pt'] = "Adicionar Utilizador";
+$text['title-user_add']['fr-fr'] = "Ajouter un utilisateur";
+$text['title-user_add']['pl'] = "Użytkownik";
+$text['title-user_add']['uk'] = "Користувач";
+$text['title-user_add']['sv-se'] = "Användare";
+$text['title-user_add']['ro'] = "Utilizator";
+$text['title-user_add']['de-at'] = "Benutzer";
+$text['title-user_add']['he'] = "משתמש";
+
+$text['title-group_permissions']['en-us'] = "Group Permissions";
+$text['title-group_permissions']['es-cl'] = "Permisos de Grupo";
+$text['title-group_permissions']['pt-pt'] = "Permissões do Grupo";
+$text['title-group_permissions']['fr-fr'] = "Permissions du Groupe";
+$text['title-group_permissions']['pl'] = "Uprawnienia grupy:";
+$text['title-group_permissions']['uk'] = "Привілеї групи";
+$text['title-group_permissions']['sv-se'] = "Grupp Rättigheter";
+$text['title-group_permissions']['ro'] = "Permisiuni grup";
+$text['title-group_permissions']['de-at'] = "Gruppenberechtigung";
+$text['title-group_permissions']['he'] = "הרשאות קבוצה";
+
+$text['title-group_members']['en-us'] = "Group Members";
+$text['title-group_members']['es-cl'] = "Miembros del Grupo";
+$text['title-group_members']['pt-pt'] = "Membros do Grupo";
+$text['title-group_members']['fr-fr'] = "Membres du Groupe";
+$text['title-group_members']['pl'] = "Członkowie grupy:";
+$text['title-group_members']['uk'] = "Учасники групи";
+$text['title-group_members']['sv-se'] = "Grupp Medlemmar";
+$text['title-group_members']['ro'] = "Membri grup";
+$text['title-group_members']['de-at'] = "Gruppenmitglieder";
+$text['title-group_members']['he'] = "חברי קבוצה";
+
+$text['title-group_manager']['en-us'] = "Group Manager";
+$text['title-group_manager']['es-cl'] = "Administración de Grupo";
+$text['title-group_manager']['pt-pt'] = "Gestão de Grupos";
+$text['title-group_manager']['fr-fr'] = "Gestion de Groupe";
+$text['title-group_manager']['pl'] = "Menedżer grup";
+$text['title-group_manager']['uk'] = "Групи";
+$text['title-group_manager']['sv-se'] = "Grupp Inställningar";
+$text['title-group_manager']['ro'] = "";
+$text['title-group_manager']['de-at'] = "Gruppenverwaltung";
+$text['title-group_manager']['he'] = "מנהל קבוצה";
+
+$text['title-group_edit']['en-us'] = "Edit Group";
+$text['title-group_edit']['es-cl'] = "Editar Grupo";
+$text['title-group_edit']['pt-pt'] = "Editar Grupo";
+$text['title-group_edit']['fr-fr'] = "Modifier le Groupe";
+$text['title-group_edit']['pl'] = "Edycja grupy";
+$text['title-group_edit']['uk'] = "Редагувати групу";
+$text['title-group_edit']['sv-se'] = "Editera Grupp";
+$text['title-group_edit']['ro'] = "Editare grup";
+$text['title-group_edit']['de-at'] = "Gruppe ändern";
+$text['title-group_edit']['he'] = "ערוך קבוצה";
+
+$text['title-group_add']['en-us'] = "Add Group";
+$text['title-group_add']['es-cl'] = "Agregar Grupo";
+$text['title-group_add']['pt-pt'] = "Adicionar Grupo";
+$text['title-group_add']['fr-fr'] = "Ajouter un Groupe";
+$text['title-group_add']['pl'] = "Dodaj grupę";
+$text['title-group_add']['uk'] = "Додати групу";
+$text['title-group_add']['sv-se'] = "Lägg Till Grupp";
+$text['title-group_add']['ro'] = "Adăugare grup";
+$text['title-group_add']['de-at'] = "Gruppe hinzufügen";
+$text['title-group_add']['he'] = "הוסף קבוצה";
+
+$text['option-true']['en-us'] = "True";
+$text['option-true']['es-cl'] = "Verdadero";
+$text['option-true']['pt-pt'] = "Sim";
+$text['option-true']['fr-fr'] = "Oui";
+$text['option-true']['pl'] = "Tak";
+$text['option-true']['uk'] = "Так";
+$text['option-true']['sv-se'] = "Sann";
+$text['option-true']['ro'] = "";
+$text['option-true']['de-at'] = "Ein";
+$text['option-true']['he'] = "חוקי";
+
+$text['option-on_break']['en-us'] = "On Break";
+$text['option-on_break']['es-cl'] = "En Pausa";
+$text['option-on_break']['pt-pt'] = "Em Pausa";
+$text['option-on_break']['fr-fr'] = "En Pause";
+$text['option-on_break']['pl'] = "Na przerwie";
+$text['option-on_break']['uk'] = "На перерві";
+$text['option-on_break']['sv-se'] = "På Rast";
+$text['option-on_break']['ro'] = "În pauză";
+$text['option-on_break']['de-at'] = "In Pause";
+$text['option-on_break']['he'] = "בהפסקה";
+
+$text['option-logged_out']['en-us'] = "Logged Out";
+$text['option-logged_out']['es-cl'] = "Desconectado";
+$text['option-logged_out']['pt-pt'] = "Desligado";
+$text['option-logged_out']['fr-fr'] = "Déconnecté";
+$text['option-logged_out']['pl'] = "Wylogowany";
+$text['option-logged_out']['uk'] = "Вийшов";
+$text['option-logged_out']['sv-se'] = "Utloggad";
+$text['option-logged_out']['ro'] = "";
+$text['option-logged_out']['de-at'] = "Abgemeldet";
+$text['option-logged_out']['he'] = "התנתק";
+
+$text['option-global']['en-us'] = "Global";
+$text['option-global']['es-cl'] = "Global";
+$text['option-global']['pt-pt'] = "Global";
+$text['option-global']['fr-fr'] = "Global";
+$text['option-global']['pl'] = "Ogólny";
+$text['option-global']['uk'] = "Глобально";
+$text['option-global']['sv-se'] = "Global";
+$text['option-global']['ro'] = "Global";
+$text['option-global']['de-at'] = "Global";
+$text['option-global']['he'] = "כללי";
+
+$text['option-false']['en-us'] = "False";
+$text['option-false']['es-cl'] = "Falso";
+$text['option-false']['pt-pt'] = "Não";
+$text['option-false']['fr-fr'] = "Non";
+$text['option-false']['pl'] = "Nie";
+$text['option-false']['uk'] = "Ні";
+$text['option-false']['sv-se'] = "Falsk";
+$text['option-false']['ro'] = "";
+$text['option-false']['de-at'] = "Aus";
+$text['option-false']['he'] = "לא חוקי";
+
+$text['option-do_not_disturb']['en-us'] = "Do Not Disturb";
+$text['option-do_not_disturb']['es-cl'] = "No Molestar";
+$text['option-do_not_disturb']['pt-pt'] = "Não Perturbar";
+$text['option-do_not_disturb']['fr-fr'] = "Ne pas Déranger";
+$text['option-do_not_disturb']['pl'] = "Nie przeszkadzaj (DND)";
+$text['option-do_not_disturb']['uk'] = "Не турбувати";
+$text['option-do_not_disturb']['sv-se'] = "Stör Ej";
+$text['option-do_not_disturb']['ro'] = "";
+$text['option-do_not_disturb']['de-at'] = "Bitte nicht stören";
+$text['option-do_not_disturb']['he'] = "נא לא להפריע";
+
+$text['option-available_on_demand']['en-us'] = "Available (On Demand)";
+$text['option-available_on_demand']['es-cl'] = "Disponible (A Pedido)";
+$text['option-available_on_demand']['pt-pt'] = "Disponível (A Pedido)";
+$text['option-available_on_demand']['fr-fr'] = "Disponible (sur demande)";
+$text['option-available_on_demand']['pl'] = "Dostępny (na żądanie)";
+$text['option-available_on_demand']['uk'] = "Доступний (на вимогу)";
+$text['option-available_on_demand']['sv-se'] = "Tillgänglig (På Begäran)";
+$text['option-available_on_demand']['ro'] = "";
+$text['option-available_on_demand']['de-at'] = "Verfügbar (auf Anfrage)";
+$text['option-available_on_demand']['he'] = "זמין (לפי דרישה(";
+
+$text['option-available']['en-us'] = "Available";
+$text['option-available']['es-cl'] = "Disponible";
+$text['option-available']['pt-pt'] = "Disponível";
+$text['option-available']['fr-fr'] = "Disponible";
+$text['option-available']['pl'] = "Dostępny";
+$text['option-available']['uk'] = "Доступний";
+$text['option-available']['sv-se'] = "Tillgänglig";
+$text['option-available']['ro'] = "";
+$text['option-available']['de-at'] = "Verfügbar";
+$text['option-available']['he'] = "זמין";
+
+$text['message-username_exists']['en-us'] = "Username Already Exists";
+$text['message-username_exists']['es-cl'] = "Ya existe Nombre de usuario";
+$text['message-username_exists']['pt-pt'] = "Nome de usuário já existe";
+$text['message-username_exists']['fr-fr'] = "Le nom d'utilisateur existe déjà";
+$text['message-username_exists']['pl'] = "Nazwa użytkownika już istnieje";
+$text['message-username_exists']['uk'] = "Користувач вже існує";
+$text['message-username_exists']['sv-se'] = "Användarnamnet Existerar Redan";
+$text['message-username_exists']['ro'] = "";
+$text['message-username_exists']['de-at'] = "Benutzername existiert bereits";
+$text['message-username_exists']['he'] = "שם משתמש כבר קיים";
+
+$text['message-password_mismatch']['en-us'] = "Password Mismatch";
+$text['message-password_mismatch']['es-cl'] = "Contraseñas no coinciden";
+$text['message-password_mismatch']['pt-pt'] = "As passwords não correspondem.";
+$text['message-password_mismatch']['fr-fr'] = "Les mots de passe ne correspondent pas";
+$text['message-password_mismatch']['pl'] = "Wprowadzone hasła nie są takie same";
+$text['message-password_mismatch']['uk'] = "Паролі не співпадають";
+$text['message-password_mismatch']['sv-se'] = "Lösenordet Stämmer Inte";
+$text['message-password_mismatch']['ro'] = "";
+$text['message-password_mismatch']['de-at'] = "Passwörter stimmen nicht überein.";
+$text['message-password_mismatch']['he'] = "הסיסמא לא נכונה";
+
+$text['message-password_blank']['en-us'] = "Invalid Password";
+$text['message-password_blank']['es-cl'] = "Contraseña No Válida";
+$text['message-password_blank']['pt-pt'] = "Senha Inválida";
+$text['message-password_blank']['fr-fr'] = "Mot de Passe Incorrect";
+$text['message-password_blank']['pl'] = "Nieprawidłowe hasło";
+$text['message-password_blank']['uk'] = "Неправильний пароль";
+$text['message-password_blank']['sv-se'] = "Ogiltigt Lösenord";
+$text['message-password_blank']['ro'] = "";
+$text['message-password_blank']['de-at'] = "Falsches Passwort";
+$text['message-password_blank']['he'] = "סיסמא לא קיימת";
+
+$text['message-new_group_name']['en-us'] = "Enter a Name for the new Group...";
+$text['message-new_group_name']['es-cl'] = "Introduzca un Nombre para el nuevo Grupo...";
+$text['message-new_group_name']['pt-pt'] = "Digite um Nome para o novo Grupo...";
+$text['message-new_group_name']['fr-fr'] = "Entrez un Nom pour le nouveau Groupe...";
+$text['message-new_group_name']['pl'] = "Wprowadź nazwę nowej grupy";
+$text['message-new_group_name']['uk'] = "Введіть назву нової групи";
+$text['message-new_group_name']['sv-se'] = "Ange ett Namn för den nya Gruppen...";
+$text['message-new_group_name']['ro'] = "";
+$text['message-new_group_name']['de-at'] = "Geben Sie den Namen der neuen Gruppe an...";
+$text['message-new_group_name']['he'] = "הכנס שם לקבוצה";
+
+$text['message-new_group_description']['en-us'] = "Enter a Description for the new Group...";
+$text['message-new_group_description']['es-cl'] = "Introduzca una Descripción para el nuevo Grupo...";
+$text['message-new_group_description']['pt-pt'] = "Digite uma Descrição para o novo grupo...";
+$text['message-new_group_description']['fr-fr'] = "Entrez une Description pour le nouveau groupe...";
+$text['message-new_group_description']['pl'] = "Wprowadź opis nowej grupy";
+$text['message-new_group_description']['uk'] = "Введіть опис нової групи";
+$text['message-new_group_description']['sv-se'] = "Ange en Beskrivning för den nya Gruppen...";
+$text['message-new_group_description']['ro'] = "";
+$text['message-new_group_description']['de-at'] = "Geben Sie eine Beschreiben für die neue Gruppe an...";
+$text['message-new_group_description']['he'] = "הכנס תאור לקבוצה";
+
+$text['message-maximum_users']['en-us'] = "Maximum Users:";
+$text['message-maximum_users']['es-cl'] = "Usuarios Máximo Permitido:";
+$text['message-maximum_users']['pt-pt'] = "Usuários Máximo Permitido:";
+$text['message-maximum_users']['fr-fr'] = "Utilisateurs Maximale Autorisée:";
+$text['message-maximum_users']['pl'] = "Maks ilość użytkowników";
+$text['message-maximum_users']['uk'] = "Максимальна кількість користувачів";
+$text['message-maximum_users']['sv-se'] = "Max Antal Användare:";
+$text['message-maximum_users']['ro'] = "";
+$text['message-maximum_users']['de-at'] = "Maximale Anzahl an Benutzern:";
+$text['message-maximum_users']['he'] = "מקסימום משתמשים";
+
+$text['message-group_exists']['en-us'] = "Group Already Exists";
+$text['message-group_exists']['es-cl'] = "El Grupo ya Existe";
+$text['message-group_exists']['pt-pt'] = "O Grupo já Existe";
+$text['message-group_exists']['fr-fr'] = "Le groupe existe déjà";
+$text['message-group_exists']['pl'] = "Grupa już istnieje";
+$text['message-group_exists']['uk'] = "Група вже існує";
+$text['message-group_exists']['sv-se'] = "Gruppen Existerar Redan";
+$text['message-group_exists']['ro'] = "";
+$text['message-group_exists']['de-at'] = "Gruppe existiert bereits";
+$text['message-group_exists']['he'] = "הקבוצה כבר קיימת";
+
+$text['message-default_system_group']['en-us'] = "Default system groups cannot be edited or deleted.";
+$text['message-default_system_group']['es-cl'] = "Grupos predeterminados del sistema no pueden ser editados o eliminados.";
+$text['message-default_system_group']['pt-pt'] = "Grupos de sistema padrão não podem ser editados ou apagados.";
+$text['message-default_system_group']['fr-fr'] = "Les groupes par défaut du système ne peuvent pas être modifiés ou supprimés.";
+$text['message-default_system_group']['pl'] = "Domyślne grupy systemowe nie mogą być edytowane lub usuwane";
+$text['message-default_system_group']['uk'] = "Системні групи за замовчуванням не можна редагувати або видаляти";
+$text['message-default_system_group']['sv-se'] = "Standard system grupper kan inte redigeras eller tas bort.";
+$text['message-default_system_group']['ro'] = "";
+$text['message-default_system_group']['de-at'] = "Systemgruppen können nicht bearbeitet oder gelöscht werden.";
+$text['message-default_system_group']['he'] = "";
+
+$text['message-copy']['en-us'] = "Copy Completed";
+$text['message-copy']['es-cl'] = "Copia Completada";
+$text['message-copy']['pt-pt'] = "Cópia Efectuada";
+$text['message-copy']['fr-fr'] = "Copie effectuée";
+$text['message-copy']['pl'] = "Skopiowano poprawnie";
+$text['message-copy']['uk'] = "Скопійовано";
+$text['message-copy']['sv-se'] = "Kopiering Slutförd";
+$text['message-copy']['ro'] = "Copiere completă";
+$text['message-copy']['de-at'] = "Kopieren erfolgreich";
+$text['message-copy']['he'] = "העתקה הושלמה";
+
+$text['message-cannot_delete_own_account']['en-us'] = "You cannot delete your own user account. Please login as a different user, then try again.";
+$text['message-cannot_delete_own_account']['es-cl'] = "No se puede eliminar su propia cuenta de usuario. Por favor, iniciar sesión como un usuario diferente, vuelva a intentarlo.";
+$text['message-cannot_delete_own_account']['pt-pt'] = "Você não pode excluir a sua própria conta de usuário. Identifique-se como um usuário diferente, em seguida, tente novamente.";
+$text['message-cannot_delete_own_account']['fr-fr'] = "Vous ne pouvez pas supprimer votre propre compte utilisateur. Veuillez vous identifier en tant qu'un utilisateur différent, puis réessayez.";
+$text['message-cannot_delete_own_account']['pl'] = "Nie można usunąć własnego konta użytkownika. Zaloguj się jako inny użytkownik i spróbuj ponownie.";
+$text['message-cannot_delete_own_account']['uk'] = "Ви не можете видалити власний обліковий запис. Будь ласка, увійдіть під іншим користувачем, потім повторіть спробу.";
+$text['message-cannot_delete_own_account']['sv-se'] = "Du kan inte ta bort ditt egna användarkonto. Logg ain som en annan användare och försök igen.";
+$text['message-cannot_delete_own_account']['ro'] = "";
+$text['message-cannot_delete_own_account']['de-at'] = "Sie können nicht ihren eigenen Benutzer löschen. Bitte melden Sie sich mit einem anderen Benutzer an und versuchen Sie es erneut.";
+$text['message-cannot_delete_own_account']['he'] = "";
+
+$text['label-username']['en-us'] = "Username";
+$text['label-username']['es-cl'] = "Nombre de usuario";
+$text['label-username']['pt-pt'] = "Nome de Utilizador";
+$text['label-username']['fr-fr'] = "Nom d'utilisateur";
+$text['label-username']['pl'] = "Użytkownik";
+$text['label-username']['uk'] = "Ім’я користувача";
+$text['label-username']['sv-se'] = "Användarnamn";
+$text['label-username']['ro'] = "Utilizator";
+$text['label-username']['de-at'] = "Benutzername";
+$text['label-username']['he'] = "שם משתמש";
+
+$text['label-user_language']['en-us'] = "Language";
+$text['label-user_language']['es-cl'] = "Lengua";
+$text['label-user_language']['pt-pt'] = "Língua";
+$text['label-user_language']['fr-fr'] = "Langue";
+$text['label-user_language']['pl'] = "Język";
+$text['label-user_language']['uk'] = "Мова";
+$text['label-user_language']['sv-se'] = "Språk";
+$text['label-user_language']['ro'] = "Limbă";
+$text['label-user_language']['de-at'] = "Sprache";
+$text['label-user_language']['he'] = "שפה";
+
+$text['label-user_info']['en-us'] = "User Info";
+$text['label-user_info']['es-cl'] = "Información de Usuario";
+$text['label-user_info']['pt-pt'] = "Informação do Utilizador";
+$text['label-user_info']['fr-fr'] = "Informations sur l'utilisateur";
+$text['label-user_info']['pl'] = "Informacje o użytkowniku";
+$text['label-user_info']['uk'] = "Інформація про користувача";
+$text['label-user_info']['sv-se'] = "Användar Info";
+$text['label-user_info']['ro'] = "";
+$text['label-user_info']['de-at'] = "Benutzer Information";
+$text['label-user_info']['he'] = "פרטי משתמש";
+
+$text['label-top']['en-us'] = "Top";
+$text['label-top']['es-cl'] = "encima";
+$text['label-top']['pt-pt'] = "Topo";
+$text['label-top']['fr-fr'] = "Meilleur";
+$text['label-top']['pt-br'] = "Topo";
+$text['label-top']['pl'] = "Top";
+$text['label-top']['he'] = "עליון";
+$text['label-top']['uk'] = "топ";
+$text['label-top']['sv-se'] = "Topp";
+$text['label-top']['de-at'] = "Oben";
+$text['label-top']['ro'] = "Top";
+$text['label-top']['fa'] = "";
+$text['label-top']['ar-eg'] = "أعلى";
+
+$text['label-time_zone']['en-us'] = "Time Zone";
+$text['label-time_zone']['es-cl'] = "Zona Horaria";
+$text['label-time_zone']['pt-pt'] = "Fuso Horário";
+$text['label-time_zone']['fr-fr'] = "Fuseau Horaire";
+$text['label-time_zone']['pl'] = "Strefa czasowa";
+$text['label-time_zone']['uk'] = "Часовий пояс";
+$text['label-time_zone']['sv-se'] = "Tidszon";
+$text['label-time_zone']['ro'] = "";
+$text['label-time_zone']['de-at'] = "Zeitzone";
+$text['label-time_zone']['he'] = "אזור זמן";
+
+$text['label-text']['en-us'] = "Text";
+$text['label-text']['es-cl'] = "Texto";
+$text['label-text']['pt-pt'] = "Texto";
+$text['label-text']['fr-fr'] = "Texte";
+$text['label-text']['pt-br'] = "Texto";
+$text['label-text']['pl'] = "Tekst";
+$text['label-text']['he'] = "טֶקסט";
+$text['label-text']['uk'] = "текст";
+$text['label-text']['sv-se'] = "Text";
+$text['label-text']['de-at'] = "Text";
+$text['label-text']['ro'] = "Text";
+$text['label-text']['fa'] = "";
+$text['label-text']['ar-eg'] = "نص";
+
+$text['label-status']['en-us'] = "Status";
+$text['label-status']['es-cl'] = "Estado";
+$text['label-status']['pt-pt'] = "Estado";
+$text['label-status']['fr-fr'] = "Etat";
+$text['label-status']['pl'] = "Status";
+$text['label-status']['uk'] = "Статус";
+$text['label-status']['sv-se'] = "Status";
+$text['label-status']['ro'] = "Stare";
+$text['label-status']['de-at'] = "Status";
+$text['label-status']['he'] = "סטטוס";
+
+$text['label-static']['en-us'] = "Static";
+$text['label-static']['es-cl'] = "Estático";
+$text['label-static']['pt-pt'] = "Estático";
+$text['label-static']['fr-fr'] = "Statique";
+$text['label-static']['pt-br'] = "Estático";
+$text['label-static']['pl'] = "Statyczny";
+$text['label-static']['he'] = "סטָטִי";
+$text['label-static']['uk'] = "статичний";
+$text['label-static']['sv-se'] = "Statisk";
+$text['label-static']['de-at'] = "Statisch";
+$text['label-static']['ro'] = "Static";
+$text['label-static']['fa'] = "";
+$text['label-static']['ar-eg'] = "ساكن";
+
+$text['label-right']['en-us'] = "Right";
+$text['label-right']['es-cl'] = "Derecha";
+$text['label-right']['pt-pt'] = "Certo";
+$text['label-right']['fr-fr'] = "Droite";
+$text['label-right']['pt-br'] = "Certo";
+$text['label-right']['pl'] = "Dobrze";
+$text['label-right']['he'] = "יָמִינָה";
+$text['label-right']['uk'] = "правий";
+$text['label-right']['sv-se'] = "Höger";
+$text['label-right']['de-at'] = "Recht";
+$text['label-right']['ro'] = "Dreapta";
+$text['label-right']['fa'] = "";
+$text['label-right']['ar-eg'] = "حق";
+
+$text['label-permission_permissions']['en-us'] = "Permissions";
+$text['label-permission_permissions']['es-cl'] = "Permisos";
+$text['label-permission_permissions']['pt-pt'] = "Permissões";
+$text['label-permission_permissions']['fr-fr'] = "Permissions";
+$text['label-permission_permissions']['pl'] = "Uprawnienia";
+$text['label-permission_permissions']['uk'] = "Привілеї";
+$text['label-permission_permissions']['sv-se'] = "Rättigheter";
+$text['label-permission_permissions']['ro'] = "";
+$text['label-permission_permissions']['de-at'] = "Berechtigungen";
+$text['label-permission_permissions']['he'] = "הרשאות";
+
+$text['label-permission_description']['en-us'] = "Description";
+$text['label-permission_description']['es-cl'] = "Descripción";
+$text['label-permission_description']['pt-pt'] = "Descrição";
+$text['label-permission_description']['fr-fr'] = "Description";
+$text['label-permission_description']['pl'] = "Opis";
+$text['label-permission_description']['uk'] = "Опис";
+$text['label-permission_description']['sv-se'] = "Beskrivning";
+$text['label-permission_description']['ro'] = "";
+$text['label-permission_description']['de-at'] = "Beschreibung";
+$text['label-permission_description']['he'] = "תאור";
+
+$text['label-password']['en-us'] = "Password";
+$text['label-password']['es-cl'] = "Contraseña";
+$text['label-password']['pt-pt'] = "Palavra-Passe";
+$text['label-password']['fr-fr'] = "Mot de passe";
+$text['label-password']['pl'] = "Hasło";
+$text['label-password']['uk'] = "Пароль";
+$text['label-password']['sv-se'] = "Lösenord";
+$text['label-password']['ro'] = "Parolă";
+$text['label-password']['de-at'] = "Passwort";
+$text['label-password']['he'] = "סיסמה";
+
+$text['label-none']['en-us'] = "None";
+$text['label-none']['es-cl'] = "Ninguna";
+$text['label-none']['pt-pt'] = "Nenhum";
+$text['label-none']['fr-fr'] = "Aucun";
+$text['label-none']['pt-br'] = "Nenhum";
+$text['label-none']['pl'] = "Żaden";
+$text['label-none']['he'] = "אף לא אחד";
+$text['label-none']['uk'] = "жоден";
+$text['label-none']['sv-se'] = "Ingen";
+$text['label-none']['de-at'] = "Keiner";
+$text['label-none']['ro'] = "Nici unul";
+$text['label-none']['fa'] = "";
+$text['label-none']['ar-eg'] = "لا شيء";
+
+$text['label-left']['en-us'] = "Left";
+$text['label-left']['es-cl'] = "Izquierda";
+$text['label-left']['pt-pt'] = "Esquerda";
+$text['label-left']['fr-fr'] = "À gauche";
+$text['label-left']['pt-br'] = "Esquerda";
+$text['label-left']['pl'] = "Lewo";
+$text['label-left']['he'] = "שְׁמֹאל";
+$text['label-left']['uk'] = "лівий";
+$text['label-left']['sv-se'] = "Vänster";
+$text['label-left']['de-at'] = "Links";
+$text['label-left']['ro'] = "Stânga";
+$text['label-left']['fa'] = "";
+$text['label-left']['ar-eg'] = "اليسار";
+
+$text['label-last_name']['en-us'] = "Last Name";
+$text['label-last_name']['es-cl'] = "Apellido";
+$text['label-last_name']['pt-pt'] = "Último Nome";
+$text['label-last_name']['fr-fr'] = "Nom";
+$text['label-last_name']['pl'] = "Nazwisko";
+$text['label-last_name']['uk'] = "Прізвище";
+$text['label-last_name']['sv-se'] = "Efternamn";
+$text['label-last_name']['ro'] = "";
+$text['label-last_name']['de-at'] = "Nachname";
+$text['label-last_name']['he'] = "שם משפחה";
+
+$text['label-inline']['en-us'] = "Inline";
+$text['label-inline']['es-cl'] = "En línea";
+$text['label-inline']['pt-pt'] = "Na linha";
+$text['label-inline']['fr-fr'] = "En ligne";
+$text['label-inline']['pt-br'] = "Na linha";
+$text['label-inline']['pl'] = "inline";
+$text['label-inline']['he'] = "בשורה";
+$text['label-inline']['uk'] = "В лінію";
+$text['label-inline']['sv-se'] = "I kö";
+$text['label-inline']['de-at'] = "In der Reihe";
+$text['label-inline']['ro'] = "In linie";
+$text['label-inline']['fa'] = "";
+$text['label-inline']['ar-eg'] = "في النسق";
+
+$text['label-image']['en-us'] = "Image";
+$text['label-image']['es-cl'] = "Imagen";
+$text['label-image']['pt-pt'] = "Imagem";
+$text['label-image']['fr-fr'] = "image";
+$text['label-image']['pt-br'] = "Imagem";
+$text['label-image']['pl'] = "Obraz";
+$text['label-image']['he'] = "תמונה";
+$text['label-image']['uk'] = "зображення";
+$text['label-image']['sv-se'] = "Bild";
+$text['label-image']['de-at'] = "Image";
+$text['label-image']['ro'] = "Imagine";
+$text['label-image']['fa'] = "";
+$text['label-image']['ar-eg'] = "صورة";
+
+$text['label-groups']['en-us'] = "Groups";
+$text['label-groups']['es-cl'] = "Grupos";
+$text['label-groups']['pt-pt'] = "Grupos";
+$text['label-groups']['fr-fr'] = "Groupes";
+$text['label-groups']['pl'] = "Grupy";
+$text['label-groups']['uk'] = "Групи";
+$text['label-groups']['sv-se'] = "Grupper";
+$text['label-groups']['ro'] = "";
+$text['label-groups']['de-at'] = "Gruppen";
+$text['label-groups']['he'] = "קבוצות";
+
+$text['label-group_tools']['en-us'] = "Tools";
+$text['label-group_tools']['es-cl'] = "Instrumentos";
+$text['label-group_tools']['pt-pt'] = "Ferramentas";
+$text['label-group_tools']['fr-fr'] = "Outils";
+$text['label-group_tools']['pl'] = "Narzędzia";
+$text['label-group_tools']['uk'] = "Інструменти";
+$text['label-group_tools']['sv-se'] = "Verktyg";
+$text['label-group_tools']['ro'] = "";
+$text['label-group_tools']['de-at'] = "Funktionen";
+$text['label-group_tools']['he'] = "כלים";
+
+$text['label-group_protected']['en-us'] = "Protected";
+$text['label-group_protected']['es-cl'] = "Protegido";
+$text['label-group_protected']['pt-pt'] = "Protegido";
+$text['label-group_protected']['fr-fr'] = "Protégé";
+$text['label-group_protected']['pl'] = "Zabezpieczony";
+$text['label-group_protected']['uk'] = "Захищено";
+$text['label-group_protected']['sv-se'] = "Skyddad";
+$text['label-group_protected']['ro'] = "";
+$text['label-group_protected']['de-at'] = "Geschützt";
+$text['label-group_protected']['he'] = "שמור";
+
+$text['label-group_permissions']['en-us'] = "Permissions";
+$text['label-group_permissions']['es-cl'] = "Permisos";
+$text['label-group_permissions']['pt-pt'] = "Permissões";
+$text['label-group_permissions']['fr-fr'] = "Permissions";
+$text['label-group_permissions']['pl'] = "Uprawnienia";
+$text['label-group_permissions']['uk'] = "Дозволи";
+$text['label-group_permissions']['sv-se'] = "Rättigheter";
+$text['label-group_permissions']['ro'] = "";
+$text['label-group_permissions']['de-at'] = "Berechtigungen";
+$text['label-group_permissions']['he'] = "הראשות";
+
+$text['label-group_name']['en-us'] = "Name";
+$text['label-group_name']['es-cl'] = "Nombre";
+$text['label-group_name']['pt-pt'] = "Nome";
+$text['label-group_name']['fr-fr'] = "Nom";
+$text['label-group_name']['pl'] = "Nazwa";
+$text['label-group_name']['uk'] = "Назва";
+$text['label-group_name']['sv-se'] = "Namn";
+$text['label-group_name']['ro'] = "";
+$text['label-group_name']['de-at'] = "Name";
+$text['label-group_name']['he'] = "שם";
+
+$text['label-group_members']['en-us'] = "Members";
+$text['label-group_members']['es-cl'] = "Miembros";
+$text['label-group_members']['pt-pt'] = "Membros";
+$text['label-group_members']['fr-fr'] = "Membres";
+$text['label-group_members']['pl'] = "Członkowie";
+$text['label-group_members']['uk'] = "Учасники";
+$text['label-group_members']['sv-se'] = "Medlemmar";
+$text['label-group_members']['ro'] = "";
+$text['label-group_members']['de-at'] = "Mitglieder";
+$text['label-group_members']['he'] = "משתמשים";
+
+$text['label-group_description']['en-us'] = "Description";
+$text['label-group_description']['es-cl'] = "Descripción";
+$text['label-group_description']['pt-pt'] = "Descrição";
+$text['label-group_description']['fr-fr'] = "Description";
+$text['label-group_description']['pl'] = "Opis";
+$text['label-group_description']['uk'] = "Опис";
+$text['label-group_description']['sv-se'] = "Beskrivning";
+$text['label-group_description']['ro'] = "";
+$text['label-group_description']['de-at'] = "Beschreibung";
+$text['label-group_description']['he'] = "תאור";
+
+$text['label-group']['en-us'] = "Group";
+$text['label-group']['es-cl'] = "Grupo";
+$text['label-group']['pt-pt'] = "Grupo";
+$text['label-group']['fr-fr'] = "Group";
+$text['label-group']['pl'] = "Grupa";
+$text['label-group']['uk'] = "Група";
+$text['label-group']['sv-se'] = "Grupp";
+$text['label-group']['ro'] = "";
+$text['label-group']['de-at'] = "Gruppe";
+$text['label-group']['he'] = "קבוצה";
+
+$text['label-global']['en-us'] = "Global";
+$text['label-global']['es-cl'] = "Global";
+$text['label-global']['pt-pt'] = "Global";
+$text['label-global']['fr-fr'] = "Global";
+$text['label-global']['pl'] = "Ogólny";
+$text['label-global']['uk'] = "Глобально";
+$text['label-global']['sv-se'] = "Global";
+$text['label-global']['ro'] = "";
+$text['label-global']['de-at'] = "Global";
+$text['label-global']['he'] = "כללי";
+
+$text['label-fixed']['en-us'] = "Fixed";
+$text['label-fixed']['es-cl'] = "Fijo";
+$text['label-fixed']['pt-pt'] = "Fixo";
+$text['label-fixed']['fr-fr'] = "Fixé";
+$text['label-fixed']['pt-br'] = "Fixo";
+$text['label-fixed']['pl'] = "Naprawiony";
+$text['label-fixed']['he'] = "קָבוּעַ";
+$text['label-fixed']['uk'] = "фіксований";
+$text['label-fixed']['sv-se'] = "Fast";
+$text['label-fixed']['de-at'] = "fest";
+$text['label-fixed']['ro'] = "Fix";
+$text['label-fixed']['fa'] = "";
+$text['label-fixed']['ar-eg'] = "ثابت";
+
+$text['label-first_name']['en-us'] = "First Name";
+$text['label-first_name']['es-cl'] = "Nombre";
+$text['label-first_name']['pt-pt'] = "Primeiro Nome";
+$text['label-first_name']['fr-fr'] = "Prénom";
+$text['label-first_name']['pl'] = "Imię";
+$text['label-first_name']['uk'] = "Ім’я";
+$text['label-first_name']['sv-se'] = "Förnamn";
+$text['label-first_name']['ro'] = "";
+$text['label-first_name']['de-at'] = "Vorname";
+$text['label-first_name']['he'] = "שם";
+
+$text['label-email']['en-us'] = "Email";
+$text['label-email']['es-cl'] = "Email";
+$text['label-email']['pt-pt'] = "Email";
+$text['label-email']['fr-fr'] = "Courriel";
+$text['label-email']['pl'] = "Email";
+$text['label-email']['uk'] = "Електронна пошта";
+$text['label-email']['sv-se'] = "E-post";
+$text['label-email']['ro'] = "";
+$text['label-email']['de-at'] = "Email";
+$text['label-email']['he'] = "אימייל";
+
+$text['label-domain']['en-us'] = "Domain";
+$text['label-domain']['es-cl'] = "Dominio";
+$text['label-domain']['pt-pt'] = "Domínio";
+$text['label-domain']['fr-fr'] = "Domaine";
+$text['label-domain']['pl'] = "Domena";
+$text['label-domain']['uk'] = "Домен";
+$text['label-domain']['sv-se'] = "Domän";
+$text['label-domain']['ro'] = "Domeniu";
+$text['label-domain']['de-at'] = "Domain";
+$text['label-domain']['he'] = "תחום";
+
+$text['label-contact']['en-us'] = "Contact";
+$text['label-contact']['es-cl'] = "Contacto";
+$text['label-contact']['pt-pt'] = "Contacto";
+$text['label-contact']['fr-fr'] = "Contact";
+$text['label-contact']['pl'] = "Kontakt";
+$text['label-contact']['uk'] = "Контакт";
+$text['label-contact']['sv-se'] = "Kontakt";
+$text['label-contact']['ro'] = "";
+$text['label-contact']['de-at'] = "Kontakt";
+$text['label-contact']['he'] = "איש קשר";
+
+$text['label-confirm_password']['en-us'] = "Confirm Password";
+$text['label-confirm_password']['es-cl'] = "Confirme Contraseña";
+$text['label-confirm_password']['pt-pt'] = "Confirmar Palavra-Passe";
+$text['label-confirm_password']['fr-fr'] = "Confirmer le mot de passe";
+$text['label-confirm_password']['pl'] = "Potwierdź hasło";
+$text['label-confirm_password']['uk'] = "Повторити пароль";
+$text['label-confirm_password']['sv-se'] = "Bekräfta Lösenord";
+$text['label-confirm_password']['ro'] = "";
+$text['label-confirm_password']['de-at'] = "Passwort bestätigen";
+$text['label-confirm_password']['he'] = "אשר סיסמא";
+
+$text['label-company_name']['en-us'] = "Company Name";
+$text['label-company_name']['es-cl'] = "Nombre de la Compañia";
+$text['label-company_name']['pt-pt'] = "Nome da Empresa";
+$text['label-company_name']['fr-fr'] = "Compagnie";
+$text['label-company_name']['pl'] = "Nazwa firmy";
+$text['label-company_name']['uk'] = "Назва компанії";
+$text['label-company_name']['sv-se'] = "Företags Namn";
+$text['label-company_name']['ro'] = "";
+$text['label-company_name']['de-at'] = "Firmenname";
+$text['label-company_name']['he'] = "שם חברה";
+
+$text['label-center']['en-us'] = "Center";
+$text['label-center']['es-cl'] = "Centrar";
+$text['label-center']['pt-pt'] = "Centro";
+$text['label-center']['fr-fr'] = "centre";
+$text['label-center']['pt-br'] = "Centro";
+$text['label-center']['pl'] = "Centrum";
+$text['label-center']['he'] = "מֶרְכָּז";
+$text['label-center']['uk'] = "центр";
+$text['label-center']['sv-se'] = "Centrum";
+$text['label-center']['de-at'] = "Center";
+$text['label-center']['ro'] = "Centru";
+$text['label-center']['fa'] = "";
+$text['label-center']['ar-eg'] = "مركز";
+
+$text['label-bottom']['en-us'] = "Bottom";
+$text['label-bottom']['es-cl'] = "Fondo";
+$text['label-bottom']['pt-pt'] = "Inferior";
+$text['label-bottom']['fr-fr'] = "Bas";
+$text['label-bottom']['pt-br'] = "Inferior";
+$text['label-bottom']['pl'] = "Dolny";
+$text['label-bottom']['he'] = "תַחתִית";
+$text['label-bottom']['uk'] = "дно";
+$text['label-bottom']['sv-se'] = "Botten";
+$text['label-bottom']['de-at'] = "Boden";
+$text['label-bottom']['ro'] = "Fund";
+$text['label-bottom']['fa'] = "";
+$text['label-bottom']['ar-eg'] = "أسفل";
+
+$text['label-api_key']['en-us'] = "API Key";
+$text['label-api_key']['es-cl'] = "API Key";
+$text['label-api_key']['pt-pt'] = "API Key";
+$text['label-api_key']['fr-fr'] = "Clé d'API";
+$text['label-api_key']['pl'] = "Klucz API";
+$text['label-api_key']['uk'] = "Ключ API";
+$text['label-api_key']['sv-se'] = "API Nyckel";
+$text['label-api_key']['ro'] = "";
+$text['label-api_key']['de-at'] = "API Key";
+$text['label-api_key']['he'] = "";
+
+$text['label-additional_info']['en-us'] = "Additional Info";
+$text['label-additional_info']['es-cl'] = "Información Adicional";
+$text['label-additional_info']['pt-pt'] = "Informação Adicional";
+$text['label-additional_info']['fr-fr'] = "Informations additionnelles";
+$text['label-additional_info']['pl'] = "Dodatkowe informacje";
+$text['label-additional_info']['uk'] = "Додаткова інформація";
+$text['label-additional_info']['sv-se'] = "Ytterligare Info";
+$text['label-additional_info']['ro'] = "";
+$text['label-additional_info']['de-at'] = "Zusätzliche Information";
+$text['label-additional_info']['he'] = "מידע נוסף";
+
+$text['label-24-hour']['en-us'] = "24-Hour";
+$text['label-24-hour']['es-cl'] = "24 horas";
+$text['label-24-hour']['pt-pt'] = "24 horas";
+$text['label-24-hour']['fr-fr'] = "24 heures";
+$text['label-24-hour']['pt-br'] = "24 horas";
+$text['label-24-hour']['pl'] = "24-godzinny";
+$text['label-24-hour']['he'] = "24 שעות";
+$text['label-24-hour']['uk'] = "24-годинний";
+$text['label-24-hour']['sv-se'] = "24-timmars";
+$text['label-24-hour']['de-at'] = "24 Stunden";
+$text['label-24-hour']['ro'] = "24 de ore";
+$text['label-24-hour']['fa'] = "";
+$text['label-24-hour']['ar-eg'] = "24 ساعة";
+
+$text['label-12-hour']['en-us'] = "12-Hour";
+$text['label-12-hour']['es-cl'] = "12 horas";
+$text['label-12-hour']['pt-pt'] = "12 horas";
+$text['label-12-hour']['fr-fr'] = "12 heures";
+$text['label-12-hour']['pt-br'] = "12 horas";
+$text['label-12-hour']['pl'] = "12-godzinny";
+$text['label-12-hour']['he'] = "12 שעות";
+$text['label-12-hour']['uk'] = "12-годинний";
+$text['label-12-hour']['sv-se'] = "12-timmars";
+$text['label-12-hour']['de-at'] = "12 Stunden";
+$text['label-12-hour']['ro'] = "12 de ore";
+$text['label-12-hour']['fa'] = "";
+$text['label-12-hour']['ar-eg'] = "12 ساعة";
+
+$text['header-user_setting-edit']['en-us'] = "User Setting";
+$text['header-user_setting-edit']['es-cl'] = "Configuración de Usuario";
+$text['header-user_setting-edit']['pt-pt'] = "Definição do Utilizador";
+$text['header-user_setting-edit']['fr-fr'] = "Cadre de l'utilisateur";
+
+$text['header-user_setting-add']['en-us'] = "User Setting Add";
+$text['header-user_setting-add']['es-cl'] = "Ajuste del usuario Agregar";
+$text['header-user_setting-add']['pt-pt'] = "Usuário setting Adicionar";
+$text['header-user_setting-add']['fr-fr'] = "Cadre utilisateur Ajouter";
+
+$text['header-user_manager']['en-us'] = "Users";
+$text['header-user_manager']['es-cl'] = "Administración de Usuario";
+$text['header-user_manager']['pt-pt'] = "Gestão de Utilizadores";
+$text['header-user_manager']['fr-fr'] = "Gestion des utilisateurs";
+$text['header-user_manager']['pl'] = "Menadżer użytkowników";
+$text['header-user_manager']['uk'] = "Користувачі";
+$text['header-user_manager']['sv-se'] = "Användar Inställningar";
+$text['header-user_manager']['ro'] = "";
+$text['header-user_manager']['de-at'] = "Benutzerverwaltung";
+$text['header-user_manager']['he'] = "מנהל משתמש";
+
+$text['header-user_edit']['en-us'] = "User";
+$text['header-user_edit']['es-cl'] = "Editar Usuario";
+$text['header-user_edit']['pt-pt'] = "Editar Utilizador";
+$text['header-user_edit']['fr-fr'] = "Modifier l'utilisateur";
+$text['header-user_edit']['pl'] = "Użytkownik";
+$text['header-user_edit']['uk'] = "Користувач";
+$text['header-user_edit']['sv-se'] = "Användare";
+$text['header-user_edit']['ro'] = "";
+$text['header-user_edit']['de-at'] = "Benutzer";
+$text['header-user_edit']['he'] = "משתמש";
+
+$text['header-user_add']['en-us'] = "User";
+$text['header-user_add']['es-cl'] = "Agregar Usuario";
+$text['header-user_add']['pt-pt'] = "Adicionar Utilizador";
+$text['header-user_add']['fr-fr'] = "Ajout d'un utilisateur";
+$text['header-user_add']['pl'] = "Użytkownik";
+$text['header-user_add']['uk'] = "Користувач";
+$text['header-user_add']['sv-se'] = "Användare";
+$text['header-user_add']['ro'] = "";
+$text['header-user_add']['de-at'] = "Benutzer";
+$text['header-user_add']['he'] = "משתמש";
+
+$text['header-group_permissions']['en-us'] = "Group Permissions: ";
+$text['header-group_permissions']['es-cl'] = "Permisos de Grupo: ";
+$text['header-group_permissions']['pt-pt'] = "Permissões do Grupo: ";
+$text['header-group_permissions']['fr-fr'] = "Permissions du Groupe: ";
+$text['header-group_permissions']['pl'] = "Uprawnienia grupy";
+$text['header-group_permissions']['uk'] = "Привілеї групи:";
+$text['header-group_permissions']['sv-se'] = "Grupp Rättigheter";
+$text['header-group_permissions']['ro'] = "";
+$text['header-group_permissions']['de-at'] = "Gruppenberechtigungen:";
+$text['header-group_permissions']['he'] = "הרשאות קבוצה";
+
+$text['header-group_members']['en-us'] = "Group Members: ";
+$text['header-group_members']['es-cl'] = "Miembros de Grupo: ";
+$text['header-group_members']['pt-pt'] = "Membros do Grupo: ";
+$text['header-group_members']['fr-fr'] = "Membres du Groupe: ";
+$text['header-group_members']['pl'] = "Członkowie grupy:";
+$text['header-group_members']['uk'] = "Учасники групи: ";
+$text['header-group_members']['sv-se'] = "Grupp Medlemmar:";
+$text['header-group_members']['ro'] = "";
+$text['header-group_members']['de-at'] = "Gruppenmitglieder:";
+$text['header-group_members']['he'] = "משתמשי קבוצה";
+
+$text['header-group_manager']['en-us'] = "Group Manager";
+$text['header-group_manager']['es-cl'] = "Administración de Grupo";
+$text['header-group_manager']['pt-pt'] = "Gestão de Grupos";
+$text['header-group_manager']['fr-fr'] = "Gestion de Groupe";
+$text['header-group_manager']['pl'] = "Menadżer  grup";
+$text['header-group_manager']['uk'] = "Групи";
+$text['header-group_manager']['sv-se'] = "Grupp Inställningar";
+$text['header-group_manager']['ro'] = "";
+$text['header-group_manager']['de-at'] = "Gruppenverwaltung";
+$text['header-group_manager']['he'] = "מנהל קבוצה";
+
+$text['header-group_edit']['en-us'] = "Edit Group";
+$text['header-group_edit']['es-cl'] = "Editar Grupo";
+$text['header-group_edit']['pt-pt'] = "Editar Grupo";
+$text['header-group_edit']['fr-fr'] = "Modifier le Groupe";
+$text['header-group_edit']['pl'] = "Edycja grupy";
+$text['header-group_edit']['uk'] = "Редагувати групу";
+$text['header-group_edit']['sv-se'] = "Editera Grupp";
+$text['header-group_edit']['ro'] = "";
+$text['header-group_edit']['de-at'] = "Gruppe bearbeiten";
+$text['header-group_edit']['he'] = "ערוך קבוצה";
+
+$text['header-group_add']['en-us'] = "Add Group";
+$text['header-group_add']['es-cl'] = "Agregar Grupo";
+$text['header-group_add']['pt-pt'] = "Adicionar Grupo";
+$text['header-group_add']['fr-fr'] = "Ajouter un Groupe";
+$text['header-group_add']['pl'] = "Dodaj grupę";
+$text['header-group_add']['uk'] = "Додати групу";
+$text['header-group_add']['sv-se'] = "Lägg Till Grupp";
+$text['header-group_add']['ro'] = "";
+$text['header-group_add']['de-at'] = "Gruppe hinzufügen";
+$text['header-group_add']['he'] = "הוסף קבוצה";
+
+$text['description-user_setting-edit']['en-us'] = "Edit a setting for this user.";
+$text['description-user_setting-edit']['es-cl'] = "Editar un escenario de este usuario.";
+$text['description-user_setting-edit']['pt-pt'] = "Editar uma configuração para este usuário.";
+$text['description-user_setting-edit']['fr-fr'] = "Modifier un réglage pour cet utilisateur.";
+
+$text['description-user_setting-add']['en-us'] = "Add a setting for this user.";
+$text['description-user_setting-add']['es-cl'] = "Añadir un entorno para este usuario.";
+$text['description-user_setting-add']['pt-pt'] = "Adicionar uma definição para esse usuário.";
+$text['description-user_setting-add']['fr-fr'] = "Ajouter un cadre pour cet utilisateur.";
+
+$text['description-user_manager']['en-us'] = "Add, edit, delete, and search users. ";
+$text['description-user_manager']['es-cl'] = "Agregar, Editar, Eliminar y Buscar Usuarios. ";
+$text['description-user_manager']['pt-pt'] = "Adicionar, editar, remover e pesquisar utilizadores. ";
+$text['description-user_manager']['fr-fr'] = "Ajouter, modifier, supprimer et chercher des utilisateurs. ";
+$text['description-user_manager']['pl'] = "Dodaj, edytuj, usuń i wyszukaj użytkowników.";
+$text['description-user_manager']['uk'] = "Додавання, редагування, видалення та пошук користувачів";
+$text['description-user_manager']['sv-se'] = "Lägg Till, editera, ta bort och sök användare.";
+$text['description-user_manager']['ro'] = "";
+$text['description-user_manager']['de-at'] = "Benutzer anlegen, editieren, löschen und suchen.";
+$text['description-user_manager']['he'] = "הוסף, ערוך, מחק וחפש משתמשים";
+
+$text['description-user_language']['en-us'] = "Select the language.";
+$text['description-user_language']['es-cl'] = "Seleccione el idioma.";
+$text['description-user_language']['pt-pt'] = "Selecione o idioma.";
+$text['description-user_language']['fr-fr'] = "Sélectionnez la langue.";
+$text['description-user_language']['pl'] = "Wybierz język";
+$text['description-user_language']['uk'] = "Виберіть мову";
+$text['description-user_language']['sv-se'] = "Välj Språk";
+$text['description-user_language']['ro'] = "Selecție limbă";
+$text['description-user_language']['de-at'] = "Sprache auswählen";
+$text['description-user_language']['he'] = "בחר שפה";
+
+$text['description-user_edit']['en-us'] = "Edit user information and group membership. ";
+$text['description-user_edit']['es-cl'] = "Editar información del usuario y pertenencia al grupo. ";
+$text['description-user_edit']['pt-pt'] = "Editar a informação do utilizador e os membros do grupo. ";
+$text['description-user_edit']['fr-fr'] = "Modifier les informations de l'utilisateur et l'appartenance au groupe.";
+$text['description-user_edit']['pl'] = "Edytuj informacje o użytkowniku i przynależności do grupy.";
+$text['description-user_edit']['uk'] = "Змініть інформацію користувача і членство в групі.";
+$text['description-user_edit']['sv-se'] = "Meditera användarinformation och grupp medlemskap.";
+$text['description-user_edit']['ro'] = "";
+$text['description-user_edit']['de-at'] = "Benutzerinformationen und Gruppen verwalten.";
+$text['description-user_edit']['he'] = "ערוך פרטי משתמש ושיוך לקבוצה";
+
+$text['description-user_add']['en-us'] = "To add a user, please fill out this form completely. All fields are required. ";
+$text['description-user_add']['es-cl'] = "Para agregar un usuario, por favor llene completamente el siguiente formulario. Todos los campos son obligatorios. ";
+$text['description-user_add']['pt-pt'] = "Para adicionar um utilizador por favor preencha este formulário. Todos os campos são de preenchimento obrigatório. ";
+$text['description-user_add']['fr-fr'] = "Afin d'ajouter des utilisateurs, remplissez complètement ce formulaire. Tous les champs sont requis. ";
+$text['description-user_add']['pl'] = "Aby dodać użytkownika, wypełnij ten formularz w całości. Wszystkie pola są wymagane.";
+$text['description-user_add']['uk'] = "Щоб додати користувача, будь ласка, заповніть цю форму повністю. Всі поля обов'язкові для заповнення.";
+$text['description-user_add']['sv-se'] = "För att lägga till en användare, fyll i hela detta formulär. Alla fält måste fyllas i.";
+$text['description-user_add']['ro'] = "";
+$text['description-user_add']['de-at'] = "Um einen Benutzer anzulegen, füllen Sie bitte dieses Formular komplett aus. Alle Felder sind erforderlich.";
+$text['description-user_add']['he'] = "בכדי להוסיף משתמש, אנא הכנס את הפרטים בכל השדות.";
+
+$text['description-time_zone']['en-us'] = "Select the default time zone.";
+$text['description-time_zone']['es-cl'] = "Seleccione la zona horaria por defecto.";
+$text['description-time_zone']['pt-pt'] = "Escolha o fuso horário por omissão.";
+$text['description-time_zone']['fr-fr'] = "Sélectionnez le fuseau horaire par défaut.";
+$text['description-time_zone']['pl'] = "Wybierz domyślną strefę czasową";
+$text['description-time_zone']['uk'] = "Виберіть часовий пояс за замовчуванням.";
+$text['description-time_zone']['sv-se'] = "Välj standard tidszon";
+$text['description-time_zone']['ro'] = "";
+$text['description-time_zone']['de-at'] = "Wählen Sie die Standard Zeitzone";
+$text['description-time_zone']['he'] = "הגדר אזור זמן";
+
+$text['description-status']['en-us'] = "Set the user's presence.";
+$text['description-status']['es-cl'] = "Configure la presencia del usuario.";
+$text['description-status']['pt-pt'] = "Escolher o estado de presença do utilizador.";
+$text['description-status']['fr-fr'] = "Sélectionnez l'état de présence de l'utilisateur.";
+$text['description-status']['pl'] = "Wybierz status użytkownika";
+$text['description-status']['uk'] = "Виберіть статус користувача";
+$text['description-status']['sv-se'] = "Välj en användarstatus.";
+$text['description-status']['ro'] = "Selectați starea utilizatorului";
+$text['description-status']['de-at'] = "Benutzerstatus auswählen";
+$text['description-status']['he'] = "בחר את סטטוס המשתמש";
+
+$text['description-group_permissions']['en-us'] = "Assign permissions for this group.";
+$text['description-group_permissions']['es-cl'] = "Asigne permisos para este grupo.";
+$text['description-group_permissions']['pt-pt'] = "Atribua permissões para este grupo.";
+$text['description-group_permissions']['fr-fr'] = "Assignez des permissions à ce groupe.";
+$text['description-group_permissions']['pl'] = "Przypisywanie uprawnień tej grupie.";
+$text['description-group_permissions']['uk'] = "Призначення привілеїв для цієї групи.";
+$text['description-group_permissions']['sv-se'] = "Tilldela rättigheter till denna grupp.";
+$text['description-group_permissions']['ro'] = "";
+$text['description-group_permissions']['de-at'] = "Ordnen Sie Berechtigungen für diese Gruppe zu.";
+$text['description-group_permissions']['he'] = "צור הרשאות לקבוצה";
+
+$text['description-group_edit']['en-us'] = "Edit the properties of the group.";
+$text['description-group_edit']['es-cl'] = "Editar las propiedades del grupo.";
+$text['description-group_edit']['pt-pt'] = "Editar as propriedades do grupo.";
+$text['description-group_edit']['fr-fr'] = "Modifier les propriétés du groupe.";
+$text['description-group_edit']['pl'] = "Edytuj właściwości grupy.";
+$text['description-group_edit']['uk'] = "Зміна властивостей групи.";
+$text['description-group_edit']['sv-se'] = "Editera inställningar för gruppen.";
+$text['description-group_edit']['ro'] = "";
+$text['description-group_edit']['de-at'] = "Bearbeiten Sie die Eigenschaften dieser Gruppe";
+$text['description-group_edit']['he'] = "";
+
+$text['description-group_add']['en-us'] = "Create a new user group.";
+$text['description-group_add']['es-cl'] = "Crear un nuevo grupo de usuarios.";
+$text['description-group_add']['pt-pt'] = "Criar um novo grupo de usuários.";
+$text['description-group_add']['fr-fr'] = "Créez un nouveau groupe d'utilisateurs.";
+$text['description-group_add']['pl'] = "Utwórz nową grupę użytkowników.";
+$text['description-group_add']['uk'] = "Створити нову групу користувачів.";
+$text['description-group_add']['sv-se'] = "Skapa en ny användargrupp.";
+$text['description-group_add']['ro'] = "";
+$text['description-group_add']['de-at'] = "Legen Sie einen neue Gruppe an.";
+$text['description-group_add']['he'] = "";
+
+$text['description-enabled']['en-us'] = "Set the status of this account.";
+$text['description-enabled']['es-cl'] = "Indique el estaso de esta cuenta.";
+$text['description-enabled']['pt-pt'] = "Escolha o estado desta conta.";
+$text['description-enabled']['fr-fr'] = "Choisir le statut de ce compte.";
+$text['description-enabled']['pl'] = "Ustaw status numeru wewnętrznego.";
+$text['description-enabled']['uk'] = "Вкажіть стан цього облікового запису.";
+$text['description-enabled']['sv-se'] = "Välj status på denna standardinställning.";
+$text['description-enabled']['ro'] = "";
+$text['description-enabled']['de-at'] = "Setzen Sie den Status dieses Kontos.";
+$text['description-enabled']['he'] = "בחר את הסטטוס לחשבון זה";
+
+$text['description-contact_view']['en-us'] = "View";
+$text['description-contact_view']['es-cl'] = "Ver";
+$text['description-contact_view']['pt-pt'] = "Ver";
+$text['description-contact_view']['fr-fr'] = "Voir";
+$text['description-contact_view']['pl'] = "Widok";
+$text['description-contact_view']['uk'] = "Перегляд";
+$text['description-contact_view']['sv-se'] = "Granska";
+$text['description-contact_view']['ro'] = "";
+$text['description-contact_view']['de-at'] = "Ansicht";
+$text['description-contact_view']['he'] = "הצג";
+
+$text['description-contact']['en-us'] = "Assign a contact to this user account.";
+$text['description-contact']['es-cl'] = "Asignar un contacto a este usuario.";
+$text['description-contact']['pt-pt'] = "Atribuir um contacto a esta conta de utilizador.";
+$text['description-contact']['fr-fr'] = "Attacher un contact à ce compte utilisateur";
+$text['description-contact']['pl'] = "Wybierz numer";
+$text['description-contact']['uk'] = "Призначити контакт в цей обліковий запис користувача.";
+$text['description-contact']['sv-se'] = "Tilldela en kontakt till detta konto.";
+$text['description-contact']['ro'] = "";
+$text['description-contact']['de-at'] = "Weisen Sie diesem Benutzer einen Kontakt zu.";
+$text['description-contact']['he'] = "שייך איש קשר לחשבון";
+
+$text['description-api_key']['en-us'] = "Enter the API key is often a UUID. The API key should be 128 bit or greater.";
+$text['description-api_key']['es-cl'] = "Indique la API key.";
+$text['description-api_key']['pt-pt'] = "";
+$text['description-api_key']['fr-fr'] = "Entrez la  clé d'API. Il s'agit souvent d'un identifiant universel unique (UUID). La clé devrait faire 128 bits ou plus de longueur.";
+$text['description-api_key']['pl'] = "Wprowadź klucz API, który jest często UUID. Klucz API powinien być 128 bitowy lub lepszy.";
+$text['description-api_key']['uk'] = "Введіть ключ API, зазвичай UUID. Ключ API повинен бути 128 біт або більше.";
+$text['description-api_key']['sv-se'] = "Ange API nyckel (ofta UUID). API nyckeln borde vara 128 bit eller mer.";
+$text['description-api_key']['ro'] = "";
+$text['description-api_key']['de-at'] = "Geben Sie den API Schlüssel an. Der API Schlüssel sollte mindestens 128 bit oder länger sein.";
+$text['description-api_key']['he'] = "";
+
+$text['confirm-delete']['en-us'] = "Do you really want to delete this?";
+$text['confirm-delete']['es-cl'] = "¿Realmente desea eliminar esto?";
+$text['confirm-delete']['pt-pt'] = "Tem a certeza que pretende remover isto?";
+$text['confirm-delete']['fr-fr'] = "Voulez-vous vraiment supprimer cela?";
+$text['confirm-delete']['pl'] = "Czy na pewno chcesz to usunąć?";
+$text['confirm-delete']['uk'] = "Ви дійсно бажаєте це видалити?";
+$text['confirm-delete']['sv-se'] = "Vill du verkligen ta bort detta?";
+$text['confirm-delete']['ro'] = "";
+$text['confirm-delete']['de-at'] = "Wollen Sie das wirklich löschen?";
+$text['confirm-delete']['he'] = "?בטוח שאתה רוצה למחוק";
+
+$text['button-show_all']['en-us'] = "Show All";
+$text['button-show_all']['es-cl'] = "Mostrar Todos";
+$text['button-show_all']['pt-pt'] = "Mostrar Todos";
+$text['button-show_all']['fr-fr'] = "Tout Montrer";
+$text['button-show_all']['pl'] = "Pokaż wszystkie";
+$text['button-show_all']['uk'] = "Показати всі";
+$text['button-show_all']['sv-se'] = "Visa Allt";
+$text['button-show_all']['ro'] = "";
+$text['button-show_all']['de-at'] = "Alle anzeigen";
+$text['button-show_all']['he'] = "הצג הכל";
+
+$text['button-generate']['en-us'] = "Generate";
+$text['button-generate']['es-cl'] = "Generar";
+$text['button-generate']['pt-pt'] = "Geração";
+$text['button-generate']['fr-fr'] = "Générer";
+$text['button-generate']['pl'] = "Generuj";
+$text['button-generate']['uk'] = "Згенерувати";
+$text['button-generate']['sv-se'] = "Generera";
+$text['button-generate']['ro'] = "";
+$text['button-generate']['de-at'] = "Generieren";
+$text['button-generate']['he'] = "יצר";
+
+$text['button-create_account']['en-us'] = "Create Account";
+$text['button-create_account']['es-cl'] = "Crear Cuenta";
+$text['button-create_account']['pt-pt'] = "Criar Conta";
+$text['button-create_account']['fr-fr'] = "Créer le Compte";
+$text['button-create_account']['pl'] = "Załóż konto";
+$text['button-create_account']['uk'] = "Створити обліковий запис";
+$text['button-create_account']['sv-se'] = "Skapa Konto";
+$text['button-create_account']['ro'] = "";
+$text['button-create_account']['de-at'] = "Konto hinzufügen";
+$text['button-create_account']['he'] = "צור חשבון";
+
+$text['button-add_member']['en-us'] = "Add Member";
+$text['button-add_member']['es-cl'] = "Agregar Miembro";
+$text['button-add_member']['pt-pt'] = "Adicionar Membro";
+$text['button-add_member']['fr-fr'] = "Ajouter un Membre";
+$text['button-add_member']['pl'] = "Dodaj członka";
+$text['button-add_member']['uk'] = "Додати учасника";
+$text['button-add_member']['sv-se'] = "Lägg Till Medlem";
+$text['button-add_member']['ro'] = "";
+$text['button-add_member']['de-at'] = "Mitglied hinzufügen";
+$text['button-add_member']['he'] = "הוסף משתמש";
+
 ?>

+ 35 - 35
core/users/app_menu.php

@@ -1,36 +1,36 @@
-<?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']['uk'] = "Користувачі";
-$apps[$x]['menu'][2]['title']['sv-se'] = "Användar Inställningar";
-$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/index.php";
-$apps[$x]['menu'][2]['groups'][] = "admin";
-$apps[$x]['menu'][2]['groups'][] = "superadmin";
-
-$apps[$x]['menu'][3]['title']['en-us'] = "Group Manager";
-$apps[$x]['menu'][3]['title']['es-cl'] = "Administración de Grupos";
-$apps[$x]['menu'][3]['title']['fr-fr'] = "Gestion des groupes";
-$apps[$x]['menu'][3]['title']['pt-pt'] = "'Gestão de Grupos";
-$apps[$x]['menu'][3]['title']['pt-br'] = "Gerenciar grupos";
-$apps[$x]['menu'][3]['title']['pl'] = "Menedżer grup";
-$apps[$x]['menu'][3]['title']['uk'] = "Групи";
-$apps[$x]['menu'][3]['title']['sv-se'] = "Grupp Inställningar";
-$apps[$x]['menu'][3]['title']['de-at'] = "Gruppenverwaltung";
-$apps[$x]['menu'][3]['title']['he'] = "מנהל קבוצה";
-$apps[$x]['menu'][3]['uuid'] = "3b4acc6d-827b-f537-bf21-0093d94ffec7";
-$apps[$x]['menu'][3]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
-$apps[$x]['menu'][3]['category'] = "internal";
-$apps[$x]['menu'][3]['path'] = "/core/users/groups.php";
-$apps[$x]['menu'][3]['groups'][] = "superadmin";
-
+<?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']['uk'] = "Користувачі";
+$apps[$x]['menu'][2]['title']['sv-se'] = "Användar Inställningar";
+$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/index.php";
+$apps[$x]['menu'][2]['groups'][] = "admin";
+$apps[$x]['menu'][2]['groups'][] = "superadmin";
+
+$apps[$x]['menu'][3]['title']['en-us'] = "Group Manager";
+$apps[$x]['menu'][3]['title']['es-cl'] = "Administración de Grupos";
+$apps[$x]['menu'][3]['title']['fr-fr'] = "Gestion des groupes";
+$apps[$x]['menu'][3]['title']['pt-pt'] = "'Gestão de Grupos";
+$apps[$x]['menu'][3]['title']['pt-br'] = "Gerenciar grupos";
+$apps[$x]['menu'][3]['title']['pl'] = "Menedżer grup";
+$apps[$x]['menu'][3]['title']['uk'] = "Групи";
+$apps[$x]['menu'][3]['title']['sv-se'] = "Grupp Inställningar";
+$apps[$x]['menu'][3]['title']['de-at'] = "Gruppenverwaltung";
+$apps[$x]['menu'][3]['title']['he'] = "מנהל קבוצה";
+$apps[$x]['menu'][3]['uuid'] = "3b4acc6d-827b-f537-bf21-0093d94ffec7";
+$apps[$x]['menu'][3]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
+$apps[$x]['menu'][3]['category'] = "internal";
+$apps[$x]['menu'][3]['path'] = "/core/users/groups.php";
+$apps[$x]['menu'][3]['groups'][] = "superadmin";
+
 ?>

+ 311 - 311
core/users/groupedit.php

@@ -1,312 +1,312 @@
-<?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-2014
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-require_once "resources/require.php";
-
-//check permissions
-	require_once "resources/check_auth.php";
-	if (permission_exists('group_edit')) {
-		//access allowed
-	}
-	else {
-		echo "access denied";
-		return;
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//process update
-	if (count($_POST) > 0) {
-		//set the variables
-			$group_uuid = check_str($_POST['group_uuid']);
-			$group_name = check_str($_POST['group_name']);
-			$group_name_previous = check_str($_POST['group_name_previous']);
-			$domain_uuid = check_str($_POST["domain_uuid"]);
-			$domain_uuid_previous = check_str($_POST["domain_uuid_previous"]);
-			$group_description = check_str($_POST["group_description"]);
-
-		//check for global/domain duplicates
-			$sql = "select count(*) as num_rows from v_groups where ";
-			$sql .= "group_name = '".$group_name."' ";
-			$sql .= "and group_uuid <> '".$group_uuid."' ";
-			$sql .= "and domain_uuid ".(($domain_uuid != '') ? " = '".$domain_uuid."' " : " is null ");
-			$prep_statement = $db->prepare($sql);
-			if ($prep_statement) {
-				$prep_statement->execute();
-				$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
-				$group_exists = ($row['num_rows'] > 0) ? true : false;
-			}
-			else {
-				$group_exists = false;
-			}
-			unset($sql, $prep_statement, $row);
-
-		//update group
-			if (!$group_exists) {
-				$sql = "update v_groups ";
-				$sql .= "set ";
-				$sql .= "group_name = '".$group_name."', ";
-				$sql .= "domain_uuid = ".(($domain_uuid != '') ? "'".$domain_uuid."'" : "null").", ";
-				$sql .= "group_description = '".$group_description."' ";
-				$sql .= "where group_uuid = '".$group_uuid."' ";
-				if (!$db->exec(check_sql($sql))) {
-					$error = $db->errorInfo();
-					echo "<pre>".print_r($error, true)."</pre>";
-					exit;
-				}
-
-				//group changed from global to domain-specific
-				if ($domain_uuid_previous == '' && $domain_uuid != '') {
-					//remove any users assigned to the group from the old domain
-						$sql = "delete from v_group_users where group_uuid = '".$group_uuid."' and domain_uuid <> '".$domain_uuid."' ";
-						if (!$db->exec(check_sql($sql))) {
-							$error = $db->errorInfo();
-							//echo "<pre>".print_r($error, true)."</pre>"; exit;
-						}
-					//update permissions to use new domain uuid
-						$sql = "update v_group_permissions set domain_uuid = '".$domain_uuid."' where group_name = '".$group_name_previous."' and domain_uuid is null ";
-						if (!$db->exec(check_sql($sql))) {
-							$error = $db->errorInfo();
-							//echo "<pre>".print_r($error, true)."</pre>"; exit;
-						}
-					//change group name
-						if ($group_name != $group_name_previous && $group_name != '') {
-							//change group name in group users
-								$sql = "update v_group_users set group_name = '".$group_name."' where group_uuid = '".$group_uuid."' and group_name = '".$group_name_previous."' ";
-								if (!$db->exec(check_sql($sql))) {
-									$error = $db->errorInfo();
-									//echo "<pre>".print_r($error, true)."</pre>"; exit;
-								}
-							//change group name in permissions
-								$sql = "update v_group_permissions set group_name = '".$group_name."' where domain_uuid = '".$domain_uuid."' and group_name = '".$group_name_previous."' ";
-								if (!$db->exec(check_sql($sql))) {
-									$error = $db->errorInfo();
-									//echo "<pre>".print_r($error, true)."</pre>"; exit;
-								}
-						}
-				}
-
-				//group changed from one domain to another
-				else if ($domain_uuid_previous != '' && $domain_uuid != '' && $domain_uuid_previous != $domain_uuid) {
-					//remove any users assigned to the group from the old domain
-						$sql = "delete from v_group_users where group_uuid = '".$group_uuid."' and domain_uuid = '".$domain_uuid_previous."' ";
-						if (!$db->exec(check_sql($sql))) {
-							$error = $db->errorInfo();
-							//echo "<pre>".print_r($error, true)."</pre>"; exit;
-						}
-					//update permissions to use new domain uuid
-						$sql = "update v_group_permissions set domain_uuid = '".$domain_uuid."' where group_name = '".$group_name_previous."' and domain_uuid = '".$domain_uuid_previous."' ";
-						if (!$db->exec(check_sql($sql))) {
-							$error = $db->errorInfo();
-							//echo "<pre>".print_r($error, true)."</pre>"; exit;
-						}
-					//change group name
-						if ($group_name != $group_name_previous && $group_name != '') {
-							//change group name in group users
-								$sql = "update v_group_users set group_name = '".$group_name."' where group_uuid = '".$group_uuid."' and group_name = '".$group_name_previous."' ";
-								if (!$db->exec(check_sql($sql))) {
-									$error = $db->errorInfo();
-									//echo "<pre>".print_r($error, true)."</pre>"; exit;
-								}
-							//change group name in permissions
-								$sql = "update v_group_permissions set group_name = '".$group_name."' where domain_uuid = '".$domain_uuid."' and group_name = '".$group_name_previous."' ";
-								if (!$db->exec(check_sql($sql))) {
-									$error = $db->errorInfo();
-									//echo "<pre>".print_r($error, true)."</pre>"; exit;
-								}
-						}
-				}
-
-				//group changed from domain-specific to global
-				else if ($domain_uuid_previous != '' && $domain_uuid == '') {
-					//change group name
-						if ($group_name != $group_name_previous && $group_name != '') {
-							//change group name in group users
-								$sql = "update v_group_users set group_name = '".$group_name."' where group_uuid = '".$group_uuid."' and group_name = '".$group_name_previous."' ";
-								if (!$db->exec(check_sql($sql))) {
-									$error = $db->errorInfo();
-									//echo "<pre>".print_r($error, true)."</pre>"; exit;
-								}
-							//change group name in permissions
-								$sql = "update v_group_permissions set group_name = '".$group_name."' where domain_uuid = '".$domain_uuid_previous."' and group_name = '".$group_name_previous."' ";
-								if (!$db->exec(check_sql($sql))) {
-									$error = $db->errorInfo();
-									//echo "<pre>".print_r($error, true)."</pre>"; exit;
-								}
-						}
-					//update permissions to not use a domain uuid
-						$sql = "update v_group_permissions set domain_uuid = null where group_name = '".$group_name."' and domain_uuid = '".$domain_uuid_previous."' ";
-						if (!$db->exec(check_sql($sql))) {
-							$error = $db->errorInfo();
-							//echo "<pre>".print_r($error, true)."</pre>"; exit;
-						}
-				}
-
-				//domain didn't change, but name may still
-				else {
-					//change group name
-						if ($group_name != $group_name_previous && $group_name != '') {
-							//change group name in group users
-								$sql = "update v_group_users set group_name = '".$group_name."' where group_uuid = '".$group_uuid."' and group_name = '".$group_name_previous."' ";
-								if (!$db->exec(check_sql($sql))) {
-									$error = $db->errorInfo();
-									//echo "<pre>".print_r($error, true)."</pre>"; exit;
-								}
-							//change group name in permissions
-								$sql = "update v_group_permissions set group_name = '".$group_name."' where domain_uuid ".(($domain_uuid != '') ? " = '".$domain_uuid."' " : " is null ")." and group_name = '".$group_name_previous."' ";
-								if (!$db->exec(check_sql($sql))) {
-									$error = $db->errorInfo();
-									//echo "<pre>".print_r($error, true)."</pre>"; exit;
-								}
-						}
-				}
-
-				$_SESSION["message"] = $text['message-update'];
-				header("Location: groups.php");
-			}
-			else {
-				$_SESSION['message_mood'] = 'negative';
-				$_SESSION["message"] = $text['message-group_exists'];
-				header("Location: groupedit.php?id=".$group_uuid);
-			}
-
-		//redirect the user
-			return;
-	}
-
-//pre-populate the form
-	$group_uuid = check_str($_REQUEST['id']);
-	if ($group_uuid != '') {
-		$sql = "select * from v_groups where ";
-		$sql .= "group_uuid = '".$group_uuid."' ";
-		$prep_statement = $db->prepare($sql);
-		if ($prep_statement) {
-			$prep_statement->execute();
-			$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
-			$group_name = $row['group_name'];
-			$domain_uuid = $row['domain_uuid'];
-			$group_description = $row['group_description'];
-		}
-	}
-
-//include the header
-	include "resources/header.php";
-	$document['title'] = $text['title-group_edit'];
-
-//copy group javascript
-	echo "<script language='javascript' type='text/javascript'>\n";
-	echo "	function copy_group() {\n";
-	echo "		var new_group_name;\n";
-	echo "		var new_group_desc;\n";
-	echo "		new_group_name = prompt('".$text['message-new_group_name']."');\n";
-	echo "		if (new_group_name != null) {\n";
-	echo "			new_group_desc = prompt('".$text['message-new_group_description']."');\n";
-	echo "			if (new_group_desc != null) {\n";
-	echo "				window.location = 'permissions_copy.php?group_name=".$group_name."&new_group_name=' + new_group_name + '&new_group_desc=' + new_group_desc;\n";
-	echo "			}\n";
-	echo "		}\n";
-	echo "	}\n";
-	echo "</script>\n";
-
-//show the content
-	echo "<form name='login' method='post' action=''>\n";
-	echo "<input type='hidden' name='group_uuid' value='".$group_uuid."'>\n";
-
-	echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
-	echo "	<tr>\n";
-	echo "		<td align='left' valign='top'>\n";
-	echo "			<b>".$text['header-group_edit']."</b>\n";
-	echo "			<br><br>\n";
-	echo "			".$text['description-group_edit']."\n";
-	echo "		</td>\n";
-	echo "		<td align='right' valign='top'>\n";
-	echo "			<input type='button' class='btn' name='' alt='back' onclick=\"window.location='groups.php'\" value='".$text['button-back']."'> ";
-	echo "			<input type='button' class='btn' alt='".$text['button-copy']."' onclick='copy_group();' value='".$text['button-copy']."'>";
-	echo "  		<input type='submit' class='btn' value=\"".$text['button-save']."\">\n";
-	echo "		</td>\n";
-	echo "	</tr>\n";
-	echo "</table>\n";
-	echo "<br>";
-
-	echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	echo "<td width='30%' class='vncellreq' valign='top'>\n";
-	echo 	$text['label-group_name']."\n";
-	echo "</td>\n";
-	echo "<td width='70%' align='left' class='vtable'>\n";
-	echo "	<input type='hidden' name='group_name_previous' value=\"".$group_name."\">\n";
-	echo "  <input type='text' class='formfld' name='group_name' value=\"".$group_name."\">\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	if (permission_exists('group_domain')) {
-		echo "<tr>\n";
-		echo "<td class='vncell' valign='top'>\n";
-		echo "	".$text['label-domain']."\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "	<input type='hidden' name='domain_uuid_previous' value='".$domain_uuid."'>\n";
-		echo "	<select class='formfld' name='domain_uuid'>\n";
-		echo "	<option value='' ".((strlen($domain_uuid) == 0) ? "selected='selected'" : null).">".$text['option-global']."</option>\n";
-		foreach ($_SESSION['domains'] as $row) {
-			echo "<option value='".$row['domain_uuid']."' ".(($row['domain_uuid'] == $domain_uuid) ? "selected='selected'" : null).">".$row['domain_name']."</option>\n";
-		}
-		echo "	</select>\n";
-		echo "	<br />\n";
-		echo 	$text['description-domain_name']."\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-	}
-	else {
-		echo "<input type='hidden' name='domain_uuid' value='".$domain_uuid."'>";
-	}
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top'>\n";
-	echo 	$text['label-group_description']."\n";
-	echo "</td>\n";
-	echo "<td align='left' class='vtable' valign='top'>\n";
-	echo "	<textarea name='group_description' class='formfld' style='width: 250px; height: 50px;'>".$group_description."</textarea>\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td colspan='2' align='right'>\n";
-	echo "	<br />";
-	echo "	<input type='submit' class='btn' value=\"".$text['button-save']."\">\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "</table>\n";
-	echo "<br><br>";
-	echo "</form>";
-
-//include the footer
-	include "resources/footer.php";
-
+<?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-2014
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
+include "root.php";
+require_once "resources/require.php";
+
+//check permissions
+	require_once "resources/check_auth.php";
+	if (permission_exists('group_edit')) {
+		//access allowed
+	}
+	else {
+		echo "access denied";
+		return;
+	}
+
+//add multi-lingual support
+	$language = new text;
+	$text = $language->get();
+
+//process update
+	if (count($_POST) > 0) {
+		//set the variables
+			$group_uuid = check_str($_POST['group_uuid']);
+			$group_name = check_str($_POST['group_name']);
+			$group_name_previous = check_str($_POST['group_name_previous']);
+			$domain_uuid = check_str($_POST["domain_uuid"]);
+			$domain_uuid_previous = check_str($_POST["domain_uuid_previous"]);
+			$group_description = check_str($_POST["group_description"]);
+
+		//check for global/domain duplicates
+			$sql = "select count(*) as num_rows from v_groups where ";
+			$sql .= "group_name = '".$group_name."' ";
+			$sql .= "and group_uuid <> '".$group_uuid."' ";
+			$sql .= "and domain_uuid ".(($domain_uuid != '') ? " = '".$domain_uuid."' " : " is null ");
+			$prep_statement = $db->prepare($sql);
+			if ($prep_statement) {
+				$prep_statement->execute();
+				$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
+				$group_exists = ($row['num_rows'] > 0) ? true : false;
+			}
+			else {
+				$group_exists = false;
+			}
+			unset($sql, $prep_statement, $row);
+
+		//update group
+			if (!$group_exists) {
+				$sql = "update v_groups ";
+				$sql .= "set ";
+				$sql .= "group_name = '".$group_name."', ";
+				$sql .= "domain_uuid = ".(($domain_uuid != '') ? "'".$domain_uuid."'" : "null").", ";
+				$sql .= "group_description = '".$group_description."' ";
+				$sql .= "where group_uuid = '".$group_uuid."' ";
+				if (!$db->exec(check_sql($sql))) {
+					$error = $db->errorInfo();
+					echo "<pre>".print_r($error, true)."</pre>";
+					exit;
+				}
+
+				//group changed from global to domain-specific
+				if ($domain_uuid_previous == '' && $domain_uuid != '') {
+					//remove any users assigned to the group from the old domain
+						$sql = "delete from v_group_users where group_uuid = '".$group_uuid."' and domain_uuid <> '".$domain_uuid."' ";
+						if (!$db->exec(check_sql($sql))) {
+							$error = $db->errorInfo();
+							//echo "<pre>".print_r($error, true)."</pre>"; exit;
+						}
+					//update permissions to use new domain uuid
+						$sql = "update v_group_permissions set domain_uuid = '".$domain_uuid."' where group_name = '".$group_name_previous."' and domain_uuid is null ";
+						if (!$db->exec(check_sql($sql))) {
+							$error = $db->errorInfo();
+							//echo "<pre>".print_r($error, true)."</pre>"; exit;
+						}
+					//change group name
+						if ($group_name != $group_name_previous && $group_name != '') {
+							//change group name in group users
+								$sql = "update v_group_users set group_name = '".$group_name."' where group_uuid = '".$group_uuid."' and group_name = '".$group_name_previous."' ";
+								if (!$db->exec(check_sql($sql))) {
+									$error = $db->errorInfo();
+									//echo "<pre>".print_r($error, true)."</pre>"; exit;
+								}
+							//change group name in permissions
+								$sql = "update v_group_permissions set group_name = '".$group_name."' where domain_uuid = '".$domain_uuid."' and group_name = '".$group_name_previous."' ";
+								if (!$db->exec(check_sql($sql))) {
+									$error = $db->errorInfo();
+									//echo "<pre>".print_r($error, true)."</pre>"; exit;
+								}
+						}
+				}
+
+				//group changed from one domain to another
+				else if ($domain_uuid_previous != '' && $domain_uuid != '' && $domain_uuid_previous != $domain_uuid) {
+					//remove any users assigned to the group from the old domain
+						$sql = "delete from v_group_users where group_uuid = '".$group_uuid."' and domain_uuid = '".$domain_uuid_previous."' ";
+						if (!$db->exec(check_sql($sql))) {
+							$error = $db->errorInfo();
+							//echo "<pre>".print_r($error, true)."</pre>"; exit;
+						}
+					//update permissions to use new domain uuid
+						$sql = "update v_group_permissions set domain_uuid = '".$domain_uuid."' where group_name = '".$group_name_previous."' and domain_uuid = '".$domain_uuid_previous."' ";
+						if (!$db->exec(check_sql($sql))) {
+							$error = $db->errorInfo();
+							//echo "<pre>".print_r($error, true)."</pre>"; exit;
+						}
+					//change group name
+						if ($group_name != $group_name_previous && $group_name != '') {
+							//change group name in group users
+								$sql = "update v_group_users set group_name = '".$group_name."' where group_uuid = '".$group_uuid."' and group_name = '".$group_name_previous."' ";
+								if (!$db->exec(check_sql($sql))) {
+									$error = $db->errorInfo();
+									//echo "<pre>".print_r($error, true)."</pre>"; exit;
+								}
+							//change group name in permissions
+								$sql = "update v_group_permissions set group_name = '".$group_name."' where domain_uuid = '".$domain_uuid."' and group_name = '".$group_name_previous."' ";
+								if (!$db->exec(check_sql($sql))) {
+									$error = $db->errorInfo();
+									//echo "<pre>".print_r($error, true)."</pre>"; exit;
+								}
+						}
+				}
+
+				//group changed from domain-specific to global
+				else if ($domain_uuid_previous != '' && $domain_uuid == '') {
+					//change group name
+						if ($group_name != $group_name_previous && $group_name != '') {
+							//change group name in group users
+								$sql = "update v_group_users set group_name = '".$group_name."' where group_uuid = '".$group_uuid."' and group_name = '".$group_name_previous."' ";
+								if (!$db->exec(check_sql($sql))) {
+									$error = $db->errorInfo();
+									//echo "<pre>".print_r($error, true)."</pre>"; exit;
+								}
+							//change group name in permissions
+								$sql = "update v_group_permissions set group_name = '".$group_name."' where domain_uuid = '".$domain_uuid_previous."' and group_name = '".$group_name_previous."' ";
+								if (!$db->exec(check_sql($sql))) {
+									$error = $db->errorInfo();
+									//echo "<pre>".print_r($error, true)."</pre>"; exit;
+								}
+						}
+					//update permissions to not use a domain uuid
+						$sql = "update v_group_permissions set domain_uuid = null where group_name = '".$group_name."' and domain_uuid = '".$domain_uuid_previous."' ";
+						if (!$db->exec(check_sql($sql))) {
+							$error = $db->errorInfo();
+							//echo "<pre>".print_r($error, true)."</pre>"; exit;
+						}
+				}
+
+				//domain didn't change, but name may still
+				else {
+					//change group name
+						if ($group_name != $group_name_previous && $group_name != '') {
+							//change group name in group users
+								$sql = "update v_group_users set group_name = '".$group_name."' where group_uuid = '".$group_uuid."' and group_name = '".$group_name_previous."' ";
+								if (!$db->exec(check_sql($sql))) {
+									$error = $db->errorInfo();
+									//echo "<pre>".print_r($error, true)."</pre>"; exit;
+								}
+							//change group name in permissions
+								$sql = "update v_group_permissions set group_name = '".$group_name."' where domain_uuid ".(($domain_uuid != '') ? " = '".$domain_uuid."' " : " is null ")." and group_name = '".$group_name_previous."' ";
+								if (!$db->exec(check_sql($sql))) {
+									$error = $db->errorInfo();
+									//echo "<pre>".print_r($error, true)."</pre>"; exit;
+								}
+						}
+				}
+
+				$_SESSION["message"] = $text['message-update'];
+				header("Location: groups.php");
+			}
+			else {
+				$_SESSION['message_mood'] = 'negative';
+				$_SESSION["message"] = $text['message-group_exists'];
+				header("Location: groupedit.php?id=".$group_uuid);
+			}
+
+		//redirect the user
+			return;
+	}
+
+//pre-populate the form
+	$group_uuid = check_str($_REQUEST['id']);
+	if ($group_uuid != '') {
+		$sql = "select * from v_groups where ";
+		$sql .= "group_uuid = '".$group_uuid."' ";
+		$prep_statement = $db->prepare($sql);
+		if ($prep_statement) {
+			$prep_statement->execute();
+			$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
+			$group_name = $row['group_name'];
+			$domain_uuid = $row['domain_uuid'];
+			$group_description = $row['group_description'];
+		}
+	}
+
+//include the header
+	include "resources/header.php";
+	$document['title'] = $text['title-group_edit'];
+
+//copy group javascript
+	echo "<script language='javascript' type='text/javascript'>\n";
+	echo "	function copy_group() {\n";
+	echo "		var new_group_name;\n";
+	echo "		var new_group_desc;\n";
+	echo "		new_group_name = prompt('".$text['message-new_group_name']."');\n";
+	echo "		if (new_group_name != null) {\n";
+	echo "			new_group_desc = prompt('".$text['message-new_group_description']."');\n";
+	echo "			if (new_group_desc != null) {\n";
+	echo "				window.location = 'permissions_copy.php?group_name=".$group_name."&new_group_name=' + new_group_name + '&new_group_desc=' + new_group_desc;\n";
+	echo "			}\n";
+	echo "		}\n";
+	echo "	}\n";
+	echo "</script>\n";
+
+//show the content
+	echo "<form name='login' method='post' action=''>\n";
+	echo "<input type='hidden' name='group_uuid' value='".$group_uuid."'>\n";
+
+	echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
+	echo "	<tr>\n";
+	echo "		<td align='left' valign='top'>\n";
+	echo "			<b>".$text['header-group_edit']."</b>\n";
+	echo "			<br><br>\n";
+	echo "			".$text['description-group_edit']."\n";
+	echo "		</td>\n";
+	echo "		<td align='right' valign='top'>\n";
+	echo "			<input type='button' class='btn' name='' alt='back' onclick=\"window.location='groups.php'\" value='".$text['button-back']."'> ";
+	echo "			<input type='button' class='btn' alt='".$text['button-copy']."' onclick='copy_group();' value='".$text['button-copy']."'>";
+	echo "  		<input type='submit' class='btn' value=\"".$text['button-save']."\">\n";
+	echo "		</td>\n";
+	echo "	</tr>\n";
+	echo "</table>\n";
+	echo "<br>";
+
+	echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
+	echo "<tr>\n";
+	echo "<td width='30%' class='vncellreq' valign='top'>\n";
+	echo 	$text['label-group_name']."\n";
+	echo "</td>\n";
+	echo "<td width='70%' align='left' class='vtable'>\n";
+	echo "	<input type='hidden' name='group_name_previous' value=\"".$group_name."\">\n";
+	echo "  <input type='text' class='formfld' name='group_name' value=\"".$group_name."\">\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	if (permission_exists('group_domain')) {
+		echo "<tr>\n";
+		echo "<td class='vncell' valign='top'>\n";
+		echo "	".$text['label-domain']."\n";
+		echo "</td>\n";
+		echo "<td class='vtable' align='left'>\n";
+		echo "	<input type='hidden' name='domain_uuid_previous' value='".$domain_uuid."'>\n";
+		echo "	<select class='formfld' name='domain_uuid'>\n";
+		echo "	<option value='' ".((strlen($domain_uuid) == 0) ? "selected='selected'" : null).">".$text['option-global']."</option>\n";
+		foreach ($_SESSION['domains'] as $row) {
+			echo "<option value='".$row['domain_uuid']."' ".(($row['domain_uuid'] == $domain_uuid) ? "selected='selected'" : null).">".$row['domain_name']."</option>\n";
+		}
+		echo "	</select>\n";
+		echo "	<br />\n";
+		echo 	$text['description-domain_name']."\n";
+		echo "</td>\n";
+		echo "</tr>\n";
+	}
+	else {
+		echo "<input type='hidden' name='domain_uuid' value='".$domain_uuid."'>";
+	}
+
+	echo "<tr>\n";
+	echo "<td class='vncell' valign='top'>\n";
+	echo 	$text['label-group_description']."\n";
+	echo "</td>\n";
+	echo "<td align='left' class='vtable' valign='top'>\n";
+	echo "	<textarea name='group_description' class='formfld' style='width: 250px; height: 50px;'>".$group_description."</textarea>\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "<tr>\n";
+	echo "<td colspan='2' align='right'>\n";
+	echo "	<br />";
+	echo "	<input type='submit' class='btn' value=\"".$text['button-save']."\">\n";
+	echo "</td>\n";
+	echo "</tr>\n";
+
+	echo "</table>\n";
+	echo "<br><br>";
+	echo "</form>";
+
+//include the footer
+	include "resources/footer.php";
+
 ?>

+ 747 - 747
resources/app_languages.php

@@ -1,748 +1,748 @@
-<?php
-
-//language
-$text['language-name']['en-us'] = "English - United States";
-$text['language-name']['es-cl'] = "Español - Chile";
-$text['language-name']['pt-pt'] = "Português - Portugal";
-$text['language-name']['fr-fr'] = "Français - France";
-$text['language-name']['nl-nl'] = "Nederlands - De Nederland";
-$text['language-name']['pt-br'] = "Brasileiro - Português";
-$text['language-name']['pl'] = "Polski - Polska";
-$text['language-name']['sv-se'] = "Svenska - Sverige";
-$text['language-name']['uk'] = "Українська - Україна";
-$text['language-name']['de-at'] = "Deutsch - Österreich";
-$text['language-name']['ar-eg'] = "العربية - مصر";
-$text['language-name']['ru-ru'] = 'Русский - Россия';
-
-//language for `Select Language` install page
-$text['language-en-us']['en-us'] = "English - United States";
-$text['language-es-cl']['en-us'] = "Español - Chile";
-$text['language-pt-pt']['en-us'] = "Português - Portugal";
-$text['language-fr-fr']['en-us'] = "Français - France";
-$text['language-nl-nl']['en-us'] = "Nederlands - De Nederland";
-$text['language-pt-br']['en-us'] = "Brasileiro - Português";
-$text['language-pl'   ]['en-us'] = "Polski - Polska";
-$text['language-sv-se']['en-us'] = "Svenska - Sverige";
-$text['language-uk'   ]['en-us'] = "Українська - Україна";
-$text['language-de-at']['en-us'] = "Deutsch - Österreich";
-$text['language-ar-eg']['en-us'] = "العربية - مصر";
-$text['language-ru-ru']['en-us'] = 'Русский - Россия';
-
-//message
-$text['message-update']['en-us'] = "Update Completed";
-$text['message-update']['es-cl'] = "Actualización Completada";
-$text['message-update']['pt-pt'] = "Actualização Efectuada";
-$text['message-update']['fr-fr'] = "Mis à jour";
-$text['message-update']['pt-br'] = "Atualização Efetuada";
-$text['message-update']['he'] = "עידכון הושלם";
-$text['message-update']['de-at'] = "Aktualisierung durchgeführt";
-$text['message-update']['pl'] = "Zaktualizowano poprawnie";
-$text['message-update']['ro'] = "Actualizare completă";
-$text['message-update']['uk'] = "Оновлення завершено";
-$text['message-update']['sv-se'] = "Uppdatering Klar";
-$text['message-update']['ar-eg'] = "تحديث مكتمل";
-
-$text['message-required']['en-us'] = "Please provide: ";
-$text['message-required']['es-cl'] = "Por favor indique:";
-$text['message-required']['pt-pt'] = "Por favor indique:";
-$text['message-required']['fr-fr'] = "Merci d'indiquer:";
-$text['message-required']['pt-br'] = "Por favor Indique:";
-$text['message-required']['he'] = " אנא ספק";
-$text['message-required']['de-at'] = "Bitte geben Sie folgendes an:";
-$text['message-required']['pl'] = "Wpisz:";
-$text['message-required']['ro'] = "Vă rugăm să oferiți";
-$text['message-required']['uk'] = "Будь ласка, вкажіть:";
-$text['message-required']['sv-se'] = "Var god uppge:";
-$text['message-required']['ar-eg'] = "يرجى تقديم:";
-
-$text['message-delete']['en-us'] = "Delete Completed";
-$text['message-delete']['es-cl'] = "Eliminación Completada";
-$text['message-delete']['pt-pt'] = "Remoção Efectuada";
-$text['message-delete']['fr-fr'] = "Supprimé";
-$text['message-delete']['pt-br'] = "Remoção Efetuada";
-$text['message-delete']['he'] = "מחיקה הושלמה";
-$text['message-delete']['de-at'] = "Erfolgreich gelöscht";
-$text['message-delete']['pl'] = "Usunięto poprawnie";
-$text['message-delete']['ro'] = "Ștergere completă";
-$text['message-delete']['uk'] = "Видалено";
-$text['message-delete']['sv-se'] = "Borttagning Klar";
-$text['message-delete']['ar-eg'] = "تم المسح";
-
-$text['message-delete_failed']['en-us'] = "Delete Failed";
-$text['message-delete_failed']['es-cl'] = "Eliminar Error";
-$text['message-delete_failed']['pt-pt'] = "Falha na exclusão";
-$text['message-delete_failed']['fr-fr'] = "Echec de la suppression";
-$text['message-delete_failed']['pt-br'] = "Falha na exclusão";
-$text['message-delete_failed']['pl'] = "Próba usunięcia zakończyła się niepowodzeniem";
-$text['message-delete_failed']['sv-se'] = "Borttagning Misslyckades";
-$text['message-delete_failed']['de-at'] = "Löschen fehlgeschlagen";
-$text['message-delete_failed']['ro'] = "Ștergere eșuată";
-$text['message-delete_failed']['he'] = "";
-
-$text['message-add']['en-us'] = "Add Completed";
-$text['message-add']['es-cl'] = "Agregar Completado";
-$text['message-add']['pt-pt'] = "Adição Efectuada";
-$text['message-add']['fr-fr'] = "Ajouté";
-$text['message-add']['pt-br'] = "Criação Efetuada";
-$text['message-add']['he'] = "הוספה הושלמה";
-$text['message-add']['de-at'] = "Completed";
-$text['message-add']['pl'] = "Dodano poprawnie";
-$text['message-add']['ro'] = "Adăugare completă";
-$text['message-add']['uk'] = "Додано";
-$text['message-add']['sv-se'] = "Tillagd";
-$text['message-add']['ar-eg'] = "تمت الأضافة";
-
-$text['message-failed']['en-us'] = "Update Failed - Contact Support";
-$text['message-failed']['es-cl'] = "Update Error - Contact Support";
-$text['message-failed']['pt-pt'] = "Falha na atualiza玢o - Contato com o suporte";
-$text['message-failed']['fr-fr'] = "Mise ?jour a 閏hou?- Contacter le support technique";
-$text['message-failed']['pt-br'] = "Falha na atualiza莽茫o  - Entre em contato com o suporte";
-$text['message-failed']['pl'] = "Aktualizacja nie powiod艂a si臋 - skontaktuj si臋 z pomoc膮";
-$text['message-failed']['uk'] = "";
-$text['message-failed']['sv-se'] = "Uppdatering Misslyckades - Kontakta Support";
-$text['message-failed']['de-at'] = "Aktualisierung fehlgeschlagen - Kontaktieren Sie den Support";
-
-$text['message-copy']['en-us'] = "Copy Completed";
-$text['message-copy']['es-cl'] = "Copia Completado";
-$text['message-copy']['pt-pt'] = "Cópia Preenchida";
-$text['message-copy']['fr-fr'] = "Copier Terminé";
-$text['message-copy']['nl-nl'] = "";
-$text['message-copy']['pt-br'] = "Cópia Efetuada";
-$text['message-copy']['pl'] = "Skopiowano poprawnie";
-$text['message-copy']['sv-se'] = "Kopiering Slutförd";
-$text['message-copy']['uk'] = "Скопійовано";
-$text['message-copy']['de-at'] = "Erfolgreich kopiert";
-
-$text['message-message']['en-us'] = "Message";
-$text['message-message']['es-cl'] = "Mensaje";
-$text['message-message']['pt-pt'] = "Mensagem";
-$text['message-message']['fr-fr'] = "Message";
-$text['message-message']['pt-br'] = "Mensagem";
-$text['message-message']['pl'] = "Wiadomość";
-$text['message-message']['sv-se'] = "Meddelande";
-$text['message-message']['uk'] = "Повідомлення";
-$text['message-message']['de-at'] = "Nachricht";
-
-$text['message-restore']['en-us'] = "Restore Completed";
-$text['message-restore']['es-cl'] = "Restauración Completada";
-$text['message-restore']['pt-pt'] = "Restauração Efectuada";
-$text['message-restore']['fr-fr'] = "Restauré";
-$text['message-restore']['pl'] = "Przywrócenie zakończone";
-$text['message-restore']['uk'] = "Відновлено";
-$text['message-restore']['sv-se'] = "Återställning Klar";
-$text['message-restore']['ro'] = "";
-$text['message-restore']['de-at'] = "Widerherstellung durchgeführt";
-$text['message-restore']['he'] = "שחזור הושלם";
-
-
-//misc
-
-$text['confirm-delete']['en-us'] = "Do you really want to delete this?";
-$text['confirm-delete']['es-cl'] = "¿Realmente desea eliminar esto?";
-$text['confirm-delete']['pt-pt'] = "Deseja realmente remover isto?";
-$text['confirm-delete']['fr-fr'] = "Voulez-vous vraiment supprimer cela?";
-$text['confirm-delete']['pt-br'] = "Deseja realmente remover isto?";
-$text['confirm-delete']['he'] = " האם אתה באמת רוצה למחוק את זה?";
-$text['confirm-delete']['de-at'] = "Wollen Sie das wirklich löschen?";
-$text['confirm-delete']['pl'] = "Czy na pewno chcesz to usunąć?";
-$text['confirm-delete']['ro'] = "Chiar vrei să ștergeți asta?";
-$text['confirm-delete']['uk'] = "Ви дійсно бажаєте це видалити?";
-$text['confirm-delete']['sv-se'] = "Vill du verkligen ta bort detta?";
-$text['confirm-delete']['ar-eg'] = "هل تريد حقا أن تحذف هذا؟";
-
-$text['confirm-copy']['en-us'] = "Do you really want to copy this?";
-$text['confirm-copy']['es-cl'] = "¿Realmente desea copiar esto?";
-$text['confirm-copy']['pt-pt'] = "Deseja realmente copiar isto?";
-$text['confirm-copy']['fr-fr'] = "Voulez-vous vraiment copier cela?";
-$text['confirm-copy']['pt-br'] = "Deseja realmente copiar isto?";
-$text['confirm-copy']['pl'] = "Czy na pewno chcesz to skopiować?";
-$text['confirm-copy']['sv-se'] = "Vill du verkligen kopiera detta?";
-$text['confirm-copy']['de-at'] = "Wollen Sie das wirklich kopieren?";
-
-//buttons
-
-$text['button-clear']['en-us'] = "Clear";
-$text['button-clear']['es-cl'] = "Limpiar";
-$text['button-clear']['pt-pt'] = "Apagar";
-$text['button-clear']['fr-fr'] = "Nettoyer";
-$text['button-clear']['pt-br'] = "Claro";
-$text['button-clear']['pl'] = "Wyczyść";
-$text['button-clear']['sv-se'] = "Rensa";
-$text['button-clear']['de-at'] = "Zurücksetzen";
-$text['button-clear']['ro'] = "Curătă";
-$text['button-clear']['he'] = "נקה";
-
-$text['button-save']['en-us'] = "Save";
-$text['button-save']['es-cl'] = "Guardar";
-$text['button-save']['pt-pt'] = "Guardar";
-$text['button-save']['fr-fr'] = "Sauvegarder";
-$text['button-save']['pt-br'] = "Salvar";
-$text['button-save']['pl'] = "Zachowaj";
-$text['button-save']['he'] = "שמור";
-$text['button-save']['uk'] = "Зберегти";
-$text['button-save']['sv-se'] = "Spara";
-$text['button-save']['de-at'] = "Speichern";
-$text['button-save']['ro'] = "Salvează";
-$text['button-save']['fa'] = "";
-$text['button-save']['ar-eg'] = "حفظ";
-
-$text['button-search']['en-us'] = "Search";
-$text['button-search']['es-cl'] = "Buscar";
-$text['button-search']['pt-pt'] = "Pesquisar";
-$text['button-search']['fr-fr'] = "Chercher";
-$text['button-search']['pl'] = "Wyszukaj";
-$text['button-search']['uk'] = "Пошук";
-$text['button-search']['sv-se'] = "Sök";
-$text['button-search']['ro'] = "";
-$text['button-search']['de-at'] = "Suchen";
-$text['button-search']['he'] = "חפש";
-
-$text['button-show_all']['en-us'] = "Show All";
-$text['button-show_all']['es-cl'] = "Mostrar Todos";
-$text['button-show_all']['pt-pt'] = "Mostrar Todos";
-$text['button-show_all']['fr-fr'] = "Montrer Tout";
-$text['button-show_all']['pt-br'] = "Mostrar todos";
-$text['button-show_all']['pl'] = "Pokaż wszystkie";
-$text['button-show_all']['sv-se'] = "Visa Allt";
-$text['button-show_all']['uk'] = "Показати всі";
-$text['button-show_all']['ro'] = "";
-$text['button-show_all']['de-at'] = "Alle anzeigen";
-$text['button-show_all']['fa'] = "";
-$text['button-show_all']['ar-eg'] = "أظهر الكل";
-$text['button-show_all']['he'] = "הצג הכל";
-
-$text['button-restore']['en-us'] = "Restore Default";
-$text['button-restore']['es-cl'] = "Restaurar Predeterminados";
-$text['button-restore']['pt-pt'] = "Restaurar Predefinições";
-$text['button-restore']['fr-fr'] = "Restaurer";
-$text['button-restore']['pl'] = "Przywróć ustawienia domyślne";
-$text['button-restore']['uk'] = "Відновити типові значення";
-$text['button-restore']['sv-se'] = "Aktivera Standard Inställningar";
-$text['button-restore']['ro'] = "";
-$text['button-restore']['de-at'] = "Zurücksetzen";
-$text['button-restore']['he'] = "שחזר למקור";
-
-$text['button-reset']['en-us'] = "Reset";
-$text['button-reset']['es-cl'] = "Reajustar";
-$text['button-reset']['pt-pt'] = "Restabelecer";
-$text['button-reset']['fr-fr'] = "Remettre";
-$text['button-reset']['pt-br'] = "Restabelecer";
-$text['button-reset']['pl'] = "Resetuj";
-$text['button-reset']['he'] = "אפס";
-$text['button-reset']['uk'] = "Скинути";
-$text['button-reset']['sv-se'] = "Återställ";
-$text['button-reset']['de-at'] = "Zurücksetzen";
-$text['button-reset']['ro'] = "Inițializare";
-$text['button-reset']['fa'] = "";
-$text['button-reset']['ar-eg'] = "إعادة تعيين";
-
-$text['button-copy']['en-us'] = "Copy";
-$text['button-copy']['es-cl'] = "Copiar";
-$text['button-copy']['pt-pt'] = "Copiar";
-$text['button-copy']['fr-fr'] = "Copier";
-$text['button-copy']['pl'] = "Kopiuj";
-$text['button-copy']['uk'] = "Копіювати";
-$text['button-copy']['sv-se'] = "Kopiera";
-$text['button-copy']['ro'] = "";
-$text['button-copy']['de-at'] = "Kopieren";
-$text['button-copy']['he'] = "העתק";
-
-$text['button-login']['en-us'] = "Login";
-$text['button-login']['es-cl'] = "Ingresar";
-$text['button-login']['pt-pt'] = "Iniciar Sessão";
-$text['button-login']['fr-fr'] = "connexion";
-$text['button-login']['pt-br'] = "Iniciar Sessão";
-$text['button-login']['pl'] = "Użytkownik";
-$text['button-login']['he'] = "כניסה";
-$text['button-login']['uk'] = "Логін";
-$text['button-login']['sv-se'] = "Logga In";
-$text['button-login']['de-at'] = "Anmelden";
-$text['button-login']['ro'] = "Autentificare";
-$text['button-login']['fa'] = "";
-$text['button-login']['ar-eg'] = "دخول";
-
-$text['button-next']['en-us'] = "Next";
-$text['button-next']['es-cl'] = "";
-$text['button-next']['pt-pt'] = "";
-$text['button-next']['fr-fr'] = "";
-$text['button-next']['pt-br'] = "";
-$text['button-next']['pl'] = "";
-$text['button-next']['sv-se'] = "";
-$text['button-next']['uk'] = "";
-$text['button-next']['de-at'] = "";
-$text['button-next']['ar-eg'] = "";
-
-$text['button-back']['en-us'] = "Back";
-$text['button-back']['es-cl'] = "Volver";
-$text['button-back']['pt-pt'] = "Voltar";
-$text['button-back']['fr-fr'] = "Retour";
-$text['button-back']['pt-br'] = "Voltar";
-$text['button-back']['pl'] = "Wróć";
-$text['button-back']['he'] = "חזרה";
-$text['button-back']['uk'] = "Назад";
-$text['button-back']['sv-se'] = "Tillbaka";
-$text['button-back']['de-at'] = "Zurück ";
-$text['button-back']['ro'] = "Înapoi";
-$text['button-back']['ar-eg'] = "رجوع";
-
-$text['button-edit']['en-us'] = "Edit";
-$text['button-edit']['es-cl'] = "Editar";
-$text['button-edit']['pt-pt'] = "Editar";
-$text['button-edit']['fr-fr'] = "Editer";
-$text['button-edit']['pt-br'] = "Editar";
-$text['button-edit']['he'] = " עריכה";
-$text['button-edit']['de-at'] = "Bearbeiten";
-$text['button-edit']['pl'] = "Edytuj";
-$text['button-edit']['ro'] = "edita";
-$text['button-edit']['uk'] = "Редагувати";
-$text['button-edit']['sv-se'] = "Editera";
-$text['button-edit']['ar-eg'] = "تعديل";
-
-$text['button-delete']['en-us'] = "Delete";
-$text['button-delete']['es-cl'] = "Eliminar";
-$text['button-delete']['pt-pt'] = "Remover";
-$text['button-delete']['fr-fr'] = "Supprimer";
-$text['button-delete']['pt-br'] = "Remover";
-$text['button-delete']['he'] = " מחק";
-$text['button-delete']['de-at'] = "löschen";
-$text['button-delete']['pl'] = "Usuń";
-$text['button-delete']['ro'] = "șterge";
-$text['button-delete']['uk'] = "Видалити";
-$text['button-delete']['sv-se'] = "Ta Bort";
-$text['button-delete']['ar-eg'] = "مسح";
-
-$text['button-add']['en-us'] = "Add";
-$text['button-add']['es-cl'] = "Agregar";
-$text['button-add']['pt-pt'] = "Adicionar";
-$text['button-add']['fr-fr'] = "Ajouter";
-$text['button-add']['pt-br'] = "Adicionar";
-$text['button-add']['he'] = " להוסיף";
-$text['button-add']['de-at'] = "Hinzufügen";
-$text['button-add']['pl'] = "Dodaj";
-$text['button-add']['ro'] = "Adăuga";
-$text['button-add']['uk'] = "Додати";
-$text['button-add']['sv-se'] = "Lägg Till";
-$text['button-add']['ar-eg'] = "اضافة";
-
-$text['button-reload']['en-us'] = "Reload";
-$text['button-reload']['es-cl'] = "Recargar";
-$text['button-reload']['pt-pt'] = "Recarregar";
-$text['button-reload']['fr-fr'] = "Recharger";
-$text['button-reload']['nl-nl'] = "";
-$text['button-reload']['pt-br'] = "Recarregar";
-$text['button-reload']['pl'] = "Przeładować";
-$text['button-reload']['sv-se'] = "Ladda";
-$text['button-reload']['uk'] = "перезавантажувати";
-$text['button-reload']['de-at'] = "Neu Laden";
-
-$text['button-paste']['en-us'] = "Paste";
-$text['button-paste']['es-cl'] = "Propagar";
-$text['button-paste']['pt-pt'] = "Propagar";
-$text['button-paste']['fr-fr'] = "Propager";
-$text['button-paste']['nl-nl'] = "";
-$text['button-paste']['pt-br'] = "Colar";
-$text['button-paste']['pl'] = "Wklej";
-$text['button-paste']['sv-se'] = "Klistra In";
-$text['button-paste']['uk'] = "Вставити";
-$text['button-paste']['de-at'] = "Einfügen";
-
-$text['button-export']['en-us'] = "Export";
-$text['button-export']['es-cl'] = "Exportar";
-$text['button-export']['pt-pt'] = "Exportar";
-$text['button-export']['fr-fr'] = "Exporter";
-$text['button-export']['pt-br'] = "Exportação";
-$text['button-export']['pl'] = "Eksportuj";
-$text['button-export']['sv-se'] = "Export";
-$text['button-export']['uk'] = "Експортувати";
-$text['button-export']['de-at'] = "Exportieren";
-
-$text['button-execute']['en-us'] = "Execute";
-$text['button-execute']['es-cl'] = "Ejecutar";
-$text['button-execute']['pt-pt'] = "Executar";
-$text['button-execute']['fr-fr'] = "Exécuter";
-$text['button-execute']['pt-br'] = "Executar";
-$text['button-execute']['pl'] = "Wykonaj";
-$text['button-execute']['sv-se'] = "Kör";
-$text['button-execute']['uk'] = "Виконати";
-$text['button-execute']['de-at'] = "Ausführen";
-
-$text['button-view']['en-us'] = "View";
-$text['button-view']['es-cl'] = "Ver";
-$text['button-view']['pt-pt'] = "Vista";
-$text['button-view']['fr-fr'] = "Voir";
-$text['button-view']['pt-br'] = "Visualizar";
-$text['button-view']['he'] = " צפה ב";
-$text['button-view']['de-at'] = "Ansicht";
-$text['button-view']['pl'] = "Widok";
-$text['button-view']['ro'] = "Vedere";
-$text['button-view']['uk'] = "вид";
-$text['button-view']['sv-se'] = "Visa";
-$text['button-view']['ar-eg'] = "عرض";
-
-$text['button-upload']['en-us'] = "Upload";
-$text['button-upload']['es-cl'] = "Subir";
-$text['button-upload']['pt-pt'] = "Carregar";
-$text['button-upload']['fr-fr'] = "déposer";
-$text['button-upload']['pt-br'] = "Submeter";
-$text['button-upload']['pl'] = "Wyślij";
-$text['button-upload']['sv-se'] = "Ladda Upp";
-$text['button-upload']['uk'] = "Завантажити";
-$text['button-upload']['de-at'] = "Hochladen";
-
-$text['button-download']['en-us'] = "Download";
-$text['button-download']['es-cl'] = "Descargar";
-$text['button-download']['pt-pt'] = "Baixar";
-$text['button-download']['fr-fr'] = "Télécharger";
-$text['button-download']['pt-br'] = "Download";
-$text['button-download']['pl'] = "Pobierz";
-$text['button-download']['sv-se'] = "Ladda Ned";
-$text['button-download']['uk'] = "Скачати";
-$text['button-download']['de-at'] = "Download";
-
-$text['button-restart']['en-us'] = "Restart";
-$text['button-restart']['es-cl'] = "Reanudar";
-$text['button-restart']['pt-pt'] = "Restart";
-$text['button-restart']['fr-fr'] = "Redémarrer";
-$text['button-restart']['pt-br'] = "Reiniciar";
-$text['button-restart']['pl'] = "Restartuj";
-$text['button-restart']['sv-se'] = "Starta Om";
-$text['button-restart']['uk'] = "Перезапустити";
-$text['button-restart']['de-at'] = "Neu starten";
-
-$text['button-refresh']['en-us'] = "Refresh";
-$text['button-refresh']['es-cl'] = "Actualizar";
-$text['button-refresh']['pt-pt'] = "Actualizar";
-$text['button-refresh']['fr-fr'] = "Rafraîchir";
-$text['button-refresh']['pt-br'] = "Atualizar";
-$text['button-refresh']['pl'] = "Odśwież";
-$text['button-refresh']['sv-se'] = "Uppdatera";
-$text['button-refresh']['uk'] = "Оновити";
-$text['button-refresh']['de-at'] = "Aktualisieren";
-
-$text['button-advanced']['en-us'] = "Advanced";
-$text['button-advanced']['es-cl'] = "Avanzadas";
-$text['button-advanced']['pt-pt'] = "Avançadas";
-$text['button-advanced']['fr-fr'] = "Avancé";
-$text['button-advanced']['pt-br'] = "Avançar";
-$text['button-advanced']['pl'] = "Zaawansowany";
-$text['button-advanced']['sv-se'] = "Avancerat";
-$text['button-advanced']['uk'] = "Додатково";
-$text['button-advanced']['de-at'] = "Erweitert";
-
-$text['button-basic']['en-us'] = "Basic";
-$text['button-basic']['es-cl'] = "Básico";
-$text['button-basic']['pt-pt'] = "Básico";
-$text['button-basic']['fr-fr'] = "Basique";
-$text['button-basic']['pl'] = "Podstawowy";
-$text['button-basic']['uk'] = "Основний";
-
-$text['button-stop']['en-us'] = "Stop";
-$text['button-stop']['es-cl'] = "Detener";
-$text['button-stop']['pt-pt'] = "Parar";
-$text['button-stop']['fr-fr'] = "Stop";
-$text['button-stop']['pt-br'] = "Pausar Broadcast";
-$text['button-stop']['pl'] = "Zatrzymaj rozsylanie rozmów";
-$text['button-stop']['sv-se'] = "Stoppa";
-$text['button-stop']['uk'] = "Зупинити трансляцію";
-$text['button-stop']['de-at'] = "Stopp";
-
-$text['button-status']['en-us'] = "Status";
-$text['button-status']['es-cl'] = "Estado";
-$text['button-status']['pt-pt'] = "Estado";
-$text['button-status']['fr-fr'] = "Etat";
-$text['button-status']['pt-br'] = "Estado";
-$text['button-status']['pl'] = "Status";
-$text['button-status']['sv-se'] = "Status";
-$text['button-status']['uk'] = "Статус";
-$text['button-status']['de-at'] = "Status";
-
-$text['button-start']['en-us'] = "Start";
-$text['button-start']['es-cl'] = "Iniciar";
-$text['button-start']['pt-pt'] = "Iniciar";
-$text['button-start']['fr-fr'] = "Démarrer";
-$text['button-start']['pt-br'] = "Iniciar";
-$text['button-start']['pl'] = "Start";
-$text['button-start']['sv-se'] = "Start";
-$text['button-start']['uk'] = "Запустити";
-$text['button-start']['de-at'] = "Start";
-
-
-//label
-
-$text['label-name']['en-us'] = "Name";
-$text['label-name']['es-cl'] = "Nombre";
-$text['label-name']['pt-pt'] = "Nome";
-$text['label-name']['fr-fr'] = "Nom";
-$text['label-name']['pt-br'] = "Nome";
-$text['label-name']['pl'] = "Nazwa";
-$text['label-name']['sv-se'] = "Namn";
-$text['label-name']['uk'] = "Назва";
-$text['label-name']['de-at'] = "Name";
-
-$text['label-description']['en-us'] = "Description";
-$text['label-description']['es-cl'] = "Descripción";
-$text['label-description']['pt-pt'] = "Descripção";
-$text['label-description']['fr-fr'] = "Description";
-$text['label-description']['pt-br'] = "Descrição";
-$text['label-description']['pl'] = "Opis";
-$text['label-description']['sv-se'] = "Beskrivning";
-$text['label-description']['uk'] = "Опис";
-$text['label-description']['de-at'] = "Beschreibung";
-
-$text['label-value']['en-us'] = "Value";
-$text['label-value']['es-cl'] = "Valor";
-$text['label-value']['pt-pt'] = "Valor";
-$text['label-value']['fr-fr'] = "Valeur";
-$text['label-value']['nl-nl'] = "";
-$text['label-value']['pt-br'] = "Valor";
-$text['label-value']['pl'] = "Wartość";
-$text['label-value']['sv-se'] = "Värde";
-$text['label-value']['uk'] = "Значення";
-$text['label-value']['de-at'] = "Wert";
-
-$text['label-password']['en-us'] = "Password";
-$text['label-password']['es-cl'] = "Contreseña";
-$text['label-password']['pt-pt'] = "Palavra-Chave";
-$text['label-password']['fr-fr'] = "Mot de Passe";
-$text['label-password']['pt-br'] = "Senha";
-$text['label-password']['pl'] = "Hasło";
-$text['label-password']['sv-se'] = "Lösenord";
-$text['label-password']['uk'] = "Пароль";
-$text['label-password']['de-at'] = "Passwort";
-$text['label-password']['ar-eg'] = "كلمة السر";
-
-$text['label-type']['en-us'] = "Type";
-$text['label-type']['es-cl'] = "Tipo";
-$text['label-type']['pt-pt'] = "Tipo";
-$text['label-type']['fr-fr'] = "Type";
-$text['label-type']['nl-nl'] = "";
-$text['label-type']['pt-br'] = "Tipo";
-$text['label-type']['pl'] = "Typ";
-$text['label-type']['sv-se'] = "Typ";
-$text['label-type']['uk'] = "Тип";
-$text['label-type']['de-at'] = "Typ";
-
-$text['label-category']['en-us'] = "Category";
-$text['label-category']['es-cl'] = "Categoría";
-$text['label-category']['pt-pt'] = "Categoria";
-$text['label-category']['fr-fr'] = "Catégories";
-$text['label-category']['pt-br'] = "Categoria";
-$text['label-category']['pl'] = "Kategoria";
-$text['label-category']['sv-se'] = "Kategori";
-$text['label-category']['uk'] = "Категорія";
-$text['label-category']['de-at'] = "Kategorie";
-
-$text['label-subcategory']['en-us'] = "Subcategory";
-$text['label-subcategory']['es-cl'] = "Subcategoría";
-$text['label-subcategory']['pt-pt'] = "Subcategoria";
-$text['label-subcategory']['fr-fr'] = "Sous-catégories";
-$text['label-subcategory']['pt-br'] = "Subcategoria";
-$text['label-subcategory']['pl'] = "Podkategoria";
-$text['label-subcategory']['sv-se'] = "Under-kategori";
-$text['label-subcategory']['uk'] = "Підкатегорія";
-$text['label-subcategory']['de-at'] = "Unterkategorie";
-
-$text['label-true']['en-us'] = "True";
-$text['label-true']['es-cl'] = "Verdadero";
-$text['label-true']['pt-pt'] = "Sim";
-$text['label-true']['fr-fr'] = "Oui";
-$text['label-true']['nl-nl'] = "";
-$text['label-true']['pt-br'] = "Sim";
-$text['label-true']['pl'] = "Tak";
-$text['label-true']['sv-se'] = "Sann";
-$text['label-true']['uk'] = "Так";
-$text['label-true']['ro'] = "";
-$text['label-true']['de-at'] = "Ein";
-$text['label-true']['ar-eg'] = "صحيح";
-$text['label-true']['he'] = "חיובי";
-
-$text['label-false']['en-us'] = "False";
-$text['label-false']['es-cl'] = "Falso";
-$text['label-false']['pt-pt'] = "Falso";
-$text['label-false']['fr-fr'] = "Falso";
-$text['label-false']['pt-br'] = "Não";
-$text['label-false']['he'] = "לא חוקי";
-$text['label-false']['de-at'] = "Aus";
-$text['label-false']['pl'] = "Nie";
-$text['label-false']['ro'] = "Fals";
-$text['label-false']['uk'] = "помилковий";
-$text['label-false']['sv-se'] = "Falsk";
-$text['label-false']['ar-eg'] = "خاطئة";
-
-$text['label-enable']['en-us'] = "Enable";
-$text['label-enable']['es-cl'] = "Activar";
-$text['label-enable']['pt-pt'] = "Activar";
-$text['label-enable']['fr-fr'] = "Activer";
-$text['label-enable']['pt-br'] = "Ativar";
-$text['label-enable']['pl'] = "Włącz";
-$text['label-enable']['sv-se'] = "Aktivera ";
-$text['label-enable']['uk'] = "";
-$text['label-enable']['de-at'] = "Aktivieren";
-
-$text['label-enabled']['en-us'] = "Enabled";
-$text['label-enabled']['es-cl'] = "Activado";
-$text['label-enabled']['pt-pt'] = "Habilitado";
-$text['label-enabled']['fr-fr'] = "Actif";
-$text['label-enabled']['nl-nl'] = "";
-$text['label-enabled']['pt-br'] = "Habilitado";
-$text['label-enabled']['pl'] = "Włączony";
-$text['label-enabled']['sv-se'] = "Aktiverad";
-$text['label-enabled']['uk'] = "Включено";
-$text['label-enabled']['de-at'] = "An";
-
-$text['label-disable']['en-us'] = "Disable";
-$text['label-disable']['es-cl'] = "Desactivar";
-$text['label-disable']['pt-pt'] = "Desactivo";
-$text['label-disable']['fr-fr'] = "Désactiver";
-$text['label-disable']['pt-br'] = "Desativado";
-$text['label-disable']['pl'] = "Wyłącz";
-$text['label-disable']['sv-se'] = "Inaktivera ";
-$text['label-disable']['uk'] = "Відключити";
-$text['label-disable']['de-at'] = "Deaktivieren";
-
-$text['label-disabled']['en-us'] = "Disabled";
-$text['label-disabled']['es-cl'] = "Discapacitado";
-$text['label-disabled']['pt-pt'] = "Inválido";
-$text['label-disabled']['fr-fr'] = "Non Permis";
-$text['label-disabled']['pt-br'] = "Inválido";
-$text['label-disabled']['pl'] = "Wyłączony";
-$text['label-disabled']['sv-se'] = "Inaktiverad";
-$text['label-disabled']['uk'] = "Відключено";
-$text['label-disabled']['de-at'] = "Ausgeschaltet";
-
-$text['label-none']['en-us'] = "None";
-$text['label-none']['es-cl'] = "Ninguno";
-$text['label-none']['pt-pt'] = "Nenhum";
-$text['label-none']['fr-fr'] = "Aucun";
-$text['label-none']['pt-br'] = "Nenhum";
-$text['label-none']['pl'] = "Żaden";
-$text['label-none']['sv-se'] = "Ingen";
-$text['label-none']['uk'] = "Жоден";
-$text['label-none']['de-at'] = "keine";
-
-$text['label-select']['en-us'] = "Select";
-$text['label-select']['es-cl'] = "Seleccionar";
-$text['label-select']['pt-pt'] = "Selecionar";
-$text['label-select']['fr-fr'] = "Sélectionner";
-$text['label-select']['nl-nl'] = "";
-$text['label-select']['pt-br'] = "Selecionar";
-$text['label-select']['pl'] = "Wybierz";
-$text['label-select']['sv-se'] = "Välj";
-$text['label-select']['uk'] = "";
-$text['label-select']['de-at'] = "Auswählen";
-
-$text['label-search']['en-us'] = "Search...";
-$text['label-search']['es-cl'] = "Buscar...";
-$text['label-search']['pt-pt'] = "Pesquisa...";
-$text['label-search']['fr-fr'] = "Recherche...";
-$text['label-search']['nl-nl'] = "";
-$text['label-search']['pt-br'] = "Pesquisa...";
-$text['label-search']['pl'] = "Szukaj ...";
-$text['label-search']['sv-se'] = "Sök ...";
-$text['label-search']['ro'] = "";
-$text['label-search']['uk'] = "Результати пошуку";
-$text['label-search']['de-at'] = "Suche...";
-$text['label-search']['he'] = "תוצאות חיפוש";
-
-$text['label-order']['en-us'] = "Order";
-$text['label-order']['es-cl'] = "Orden";
-$text['label-order']['pt-pt'] = "Ordem";
-$text['label-order']['fr-fr'] = "Ordre";
-$text['label-order']['nl-nl'] = "";
-$text['label-order']['pt-br'] = "Ordenação";
-$text['label-order']['pl'] = "Kolejność";
-$text['label-order']['sv-se'] = "Ordning";
-$text['label-order']['uk'] = "Інше";
-$text['label-order']['de-at'] = "Reihenfolge";
-
-$text['label-delete']['en-us'] = "Delete";
-$text['label-delete']['es-cl'] = "Eliminar";
-$text['label-delete']['pt-pt'] = "Remover";
-$text['label-delete']['fr-fr'] = "Supprimer";
-$text['label-delete']['pt-br'] = "Remover";
-$text['label-delete']['pl'] = "Usuń";
-$text['label-delete']['sv-se'] = "Ta Bort";
-$text['label-delete']['uk'] = "Видалити";
-$text['label-delete']['de-at'] = "Löschen";
-
-
-//option (present for compatibility, should use label-true/false instead)
-
-$text['option-true']['en-us'] = "True";
-$text['option-true']['es-cl'] = "verdadero";
-$text['option-true']['pt-pt'] = "Sim";
-$text['option-true']['fr-fr'] = "Oui";
-$text['option-true']['pt-br'] = "Sim";
-$text['option-true']['pl'] = "Tak";
-$text['option-true']['sv-se'] = "Sann";
-$text['option-true']['de-at'] = "Ein";
-
-$text['option-false']['en-us'] = "False";
-$text['option-false']['es-cl'] = "Falso";
-$text['option-false']['pt-pt'] = "Não";
-$text['option-false']['fr-fr'] = "Non";
-$text['option-false']['pt-br'] = "Não";
-$text['option-false']['pl'] = "Nie";
-$text['option-false']['sv-se'] = "Falsk";
-$text['option-false']['de-at'] = "Aus";
-
-
-
-//description
-
-$text['description-value']['en-us'] = "Enter the value of this setting.";
-$text['description-value']['es-cl'] = "Ingrese el valor de esta configuración";
-$text['description-value']['pt-pt'] = "Introduza o valor desta definição.";
-$text['description-value']['fr-fr'] = "Entrer la valeur de ce paramètre.";
-$text['description-value']['nl-nl'] = "";
-$text['description-value']['pt-br'] = "Insira o valor da variável";
-$text['description-value']['pl'] = "Wprowadź wartość tego ustawienia";
-$text['description-value']['sv-se'] = "Ange värdet på inställningen.";
-$text['description-value']['uk'] = "Введіть значенння змінної";
-$text['description-value']['de-at'] = "Geben Sie den Wert für diese Einstellung an.";
-
-$text['description-type']['en-us'] = "Enter the setting type (ie. uuid, name, var, dir, etc).";
-$text['description-type']['es-cl'] = "Ingrese el tipo de configuración (ej. uuid, name, var, dir, etc).";
-$text['description-type']['pt-pt'] = "Introduza o tipo de definição (ex: uuid, name, var, dir, etc)";
-$text['description-type']['fr-fr'] = "Choisir le type de paramètre (ie. uuid, nom, var, dir, etc).";
-$text['description-type']['nl-nl'] = "";
-$text['description-type']['pt-br'] = "Introduza o tipo de definição (ex:uuid,name,var,dir,etc)";
-$text['description-type']['pl'] = "Wprowadź rodzaj ustawienia (np. uuid, name, var, dir)";
-$text['description-type']['sv-se'] = "Fyll i inställnings typ (ie. uuid, name, var, dir, etc).";
-$text['description-type']['uk'] = "";
-$text['description-type']['de-at'] = "Geben Sie den Typ für diese Einstellung an (z.B. uuid, name, var, dir, etc).";
-
-$text['description-category']['en-us'] = "Enter the category.";
-$text['description-category']['es-cl'] = "Ingrese la categoría.";
-$text['description-category']['pt-pt'] = "Introduza a categoria.";
-$text['description-category']['fr-fr'] = "Entrer la Catégorie.";
-$text['description-category']['nl-nl'] = "";
-$text['description-category']['pt-br'] = "Descrição";
-$text['description-category']['pl'] = "Wprowadź kategorię";
-$text['description-category']['sv-se'] = "Ange Kategori.";
-$text['description-category']['uk'] = "Опис";
-$text['description-category']['de-at'] = "Geben Sie die Kategorie an.";
-
-$text['description-subcategory']['en-us'] = "Enter the subcategory.";
-$text['description-subcategory']['es-cl'] = "Ingrese la subcategoría.";
-$text['description-subcategory']['pt-pt'] = "Introduza a subcategoria.";
-$text['description-subcategory']['fr-fr'] = "Entrer la Sous-Catégorie.";
-$text['description-subcategory']['nl-nl'] = "";
-$text['description-subcategory']['pt-br'] = "Introduza a subcategoria";
-$text['description-subcategory']['pl'] = "Wprowadź podkategorię";
-$text['description-subcategory']['sv-se'] = "Fyll i under-kategori";
-$text['description-subcategory']['uk'] = "";
-$text['description-subcategory']['de-at'] = "Geben Sie die Unterkategorie an.";
-
-$text['description-description']['en-us'] = "Enter a description, if desired.";
-$text['description-description']['es-cl'] = "Ingrese una descripción, opcional.";
-$text['description-description']['pt-pt'] = "Insira a descrição. (opcional) ";
-$text['description-description']['fr-fr'] = "Entrez une description, si vous le souhaitez.";
-$text['description-description']['nl-nl'] = "";
-$text['description-description']['pt-br'] = "Insira a descrição, caso desejar";
-$text['description-description']['pl'] = "Wpisz opis (opcjonalne).";
-$text['description-description']['sv-se'] = "Fyll i en beskrivning, om nödvändigt.";
-$text['description-description']['uk'] = "Введіть опис, якщо це необхідно.";
-$text['description-description']['de-at'] = "Falls gewünscht, geben Sie eine Beschreibung an.";
-
+<?php
+
+//language
+$text['language-name']['en-us'] = "English - United States";
+$text['language-name']['es-cl'] = "Español - Chile";
+$text['language-name']['pt-pt'] = "Português - Portugal";
+$text['language-name']['fr-fr'] = "Français - France";
+$text['language-name']['nl-nl'] = "Nederlands - De Nederland";
+$text['language-name']['pt-br'] = "Brasileiro - Português";
+$text['language-name']['pl'] = "Polski - Polska";
+$text['language-name']['sv-se'] = "Svenska - Sverige";
+$text['language-name']['uk'] = "Українська - Україна";
+$text['language-name']['de-at'] = "Deutsch - Österreich";
+$text['language-name']['ar-eg'] = "العربية - مصر";
+$text['language-name']['ru-ru'] = 'Русский - Россия';
+
+//language for `Select Language` install page
+$text['language-en-us']['en-us'] = "English - United States";
+$text['language-es-cl']['en-us'] = "Español - Chile";
+$text['language-pt-pt']['en-us'] = "Português - Portugal";
+$text['language-fr-fr']['en-us'] = "Français - France";
+$text['language-nl-nl']['en-us'] = "Nederlands - De Nederland";
+$text['language-pt-br']['en-us'] = "Brasileiro - Português";
+$text['language-pl'   ]['en-us'] = "Polski - Polska";
+$text['language-sv-se']['en-us'] = "Svenska - Sverige";
+$text['language-uk'   ]['en-us'] = "Українська - Україна";
+$text['language-de-at']['en-us'] = "Deutsch - Österreich";
+$text['language-ar-eg']['en-us'] = "العربية - مصر";
+$text['language-ru-ru']['en-us'] = 'Русский - Россия';
+
+//message
+$text['message-update']['en-us'] = "Update Completed";
+$text['message-update']['es-cl'] = "Actualización Completada";
+$text['message-update']['pt-pt'] = "Actualização Efectuada";
+$text['message-update']['fr-fr'] = "Mis à jour";
+$text['message-update']['pt-br'] = "Atualização Efetuada";
+$text['message-update']['he'] = "עידכון הושלם";
+$text['message-update']['de-at'] = "Aktualisierung durchgeführt";
+$text['message-update']['pl'] = "Zaktualizowano poprawnie";
+$text['message-update']['ro'] = "Actualizare completă";
+$text['message-update']['uk'] = "Оновлення завершено";
+$text['message-update']['sv-se'] = "Uppdatering Klar";
+$text['message-update']['ar-eg'] = "تحديث مكتمل";
+
+$text['message-required']['en-us'] = "Please provide: ";
+$text['message-required']['es-cl'] = "Por favor indique:";
+$text['message-required']['pt-pt'] = "Por favor indique:";
+$text['message-required']['fr-fr'] = "Merci d'indiquer:";
+$text['message-required']['pt-br'] = "Por favor Indique:";
+$text['message-required']['he'] = " אנא ספק";
+$text['message-required']['de-at'] = "Bitte geben Sie folgendes an:";
+$text['message-required']['pl'] = "Wpisz:";
+$text['message-required']['ro'] = "Vă rugăm să oferiți";
+$text['message-required']['uk'] = "Будь ласка, вкажіть:";
+$text['message-required']['sv-se'] = "Var god uppge:";
+$text['message-required']['ar-eg'] = "يرجى تقديم:";
+
+$text['message-delete']['en-us'] = "Delete Completed";
+$text['message-delete']['es-cl'] = "Eliminación Completada";
+$text['message-delete']['pt-pt'] = "Remoção Efectuada";
+$text['message-delete']['fr-fr'] = "Supprimé";
+$text['message-delete']['pt-br'] = "Remoção Efetuada";
+$text['message-delete']['he'] = "מחיקה הושלמה";
+$text['message-delete']['de-at'] = "Erfolgreich gelöscht";
+$text['message-delete']['pl'] = "Usunięto poprawnie";
+$text['message-delete']['ro'] = "Ștergere completă";
+$text['message-delete']['uk'] = "Видалено";
+$text['message-delete']['sv-se'] = "Borttagning Klar";
+$text['message-delete']['ar-eg'] = "تم المسح";
+
+$text['message-delete_failed']['en-us'] = "Delete Failed";
+$text['message-delete_failed']['es-cl'] = "Eliminar Error";
+$text['message-delete_failed']['pt-pt'] = "Falha na exclusão";
+$text['message-delete_failed']['fr-fr'] = "Echec de la suppression";
+$text['message-delete_failed']['pt-br'] = "Falha na exclusão";
+$text['message-delete_failed']['pl'] = "Próba usunięcia zakończyła się niepowodzeniem";
+$text['message-delete_failed']['sv-se'] = "Borttagning Misslyckades";
+$text['message-delete_failed']['de-at'] = "Löschen fehlgeschlagen";
+$text['message-delete_failed']['ro'] = "Ștergere eșuată";
+$text['message-delete_failed']['he'] = "";
+
+$text['message-add']['en-us'] = "Add Completed";
+$text['message-add']['es-cl'] = "Agregar Completado";
+$text['message-add']['pt-pt'] = "Adição Efectuada";
+$text['message-add']['fr-fr'] = "Ajouté";
+$text['message-add']['pt-br'] = "Criação Efetuada";
+$text['message-add']['he'] = "הוספה הושלמה";
+$text['message-add']['de-at'] = "Completed";
+$text['message-add']['pl'] = "Dodano poprawnie";
+$text['message-add']['ro'] = "Adăugare completă";
+$text['message-add']['uk'] = "Додано";
+$text['message-add']['sv-se'] = "Tillagd";
+$text['message-add']['ar-eg'] = "تمت الأضافة";
+
+$text['message-failed']['en-us'] = "Update Failed - Contact Support";
+$text['message-failed']['es-cl'] = "Update Error - Contact Support";
+$text['message-failed']['pt-pt'] = "Falha na atualiza玢o - Contato com o suporte";
+$text['message-failed']['fr-fr'] = "Mise ?jour a 閏hou?- Contacter le support technique";
+$text['message-failed']['pt-br'] = "Falha na atualiza莽茫o  - Entre em contato com o suporte";
+$text['message-failed']['pl'] = "Aktualizacja nie powiod艂a si臋 - skontaktuj si臋 z pomoc膮";
+$text['message-failed']['uk'] = "";
+$text['message-failed']['sv-se'] = "Uppdatering Misslyckades - Kontakta Support";
+$text['message-failed']['de-at'] = "Aktualisierung fehlgeschlagen - Kontaktieren Sie den Support";
+
+$text['message-copy']['en-us'] = "Copy Completed";
+$text['message-copy']['es-cl'] = "Copia Completado";
+$text['message-copy']['pt-pt'] = "Cópia Preenchida";
+$text['message-copy']['fr-fr'] = "Copier Terminé";
+$text['message-copy']['nl-nl'] = "";
+$text['message-copy']['pt-br'] = "Cópia Efetuada";
+$text['message-copy']['pl'] = "Skopiowano poprawnie";
+$text['message-copy']['sv-se'] = "Kopiering Slutförd";
+$text['message-copy']['uk'] = "Скопійовано";
+$text['message-copy']['de-at'] = "Erfolgreich kopiert";
+
+$text['message-message']['en-us'] = "Message";
+$text['message-message']['es-cl'] = "Mensaje";
+$text['message-message']['pt-pt'] = "Mensagem";
+$text['message-message']['fr-fr'] = "Message";
+$text['message-message']['pt-br'] = "Mensagem";
+$text['message-message']['pl'] = "Wiadomość";
+$text['message-message']['sv-se'] = "Meddelande";
+$text['message-message']['uk'] = "Повідомлення";
+$text['message-message']['de-at'] = "Nachricht";
+
+$text['message-restore']['en-us'] = "Restore Completed";
+$text['message-restore']['es-cl'] = "Restauración Completada";
+$text['message-restore']['pt-pt'] = "Restauração Efectuada";
+$text['message-restore']['fr-fr'] = "Restauré";
+$text['message-restore']['pl'] = "Przywrócenie zakończone";
+$text['message-restore']['uk'] = "Відновлено";
+$text['message-restore']['sv-se'] = "Återställning Klar";
+$text['message-restore']['ro'] = "";
+$text['message-restore']['de-at'] = "Widerherstellung durchgeführt";
+$text['message-restore']['he'] = "שחזור הושלם";
+
+
+//misc
+
+$text['confirm-delete']['en-us'] = "Do you really want to delete this?";
+$text['confirm-delete']['es-cl'] = "¿Realmente desea eliminar esto?";
+$text['confirm-delete']['pt-pt'] = "Deseja realmente remover isto?";
+$text['confirm-delete']['fr-fr'] = "Voulez-vous vraiment supprimer cela?";
+$text['confirm-delete']['pt-br'] = "Deseja realmente remover isto?";
+$text['confirm-delete']['he'] = " האם אתה באמת רוצה למחוק את זה?";
+$text['confirm-delete']['de-at'] = "Wollen Sie das wirklich löschen?";
+$text['confirm-delete']['pl'] = "Czy na pewno chcesz to usunąć?";
+$text['confirm-delete']['ro'] = "Chiar vrei să ștergeți asta?";
+$text['confirm-delete']['uk'] = "Ви дійсно бажаєте це видалити?";
+$text['confirm-delete']['sv-se'] = "Vill du verkligen ta bort detta?";
+$text['confirm-delete']['ar-eg'] = "هل تريد حقا أن تحذف هذا؟";
+
+$text['confirm-copy']['en-us'] = "Do you really want to copy this?";
+$text['confirm-copy']['es-cl'] = "¿Realmente desea copiar esto?";
+$text['confirm-copy']['pt-pt'] = "Deseja realmente copiar isto?";
+$text['confirm-copy']['fr-fr'] = "Voulez-vous vraiment copier cela?";
+$text['confirm-copy']['pt-br'] = "Deseja realmente copiar isto?";
+$text['confirm-copy']['pl'] = "Czy na pewno chcesz to skopiować?";
+$text['confirm-copy']['sv-se'] = "Vill du verkligen kopiera detta?";
+$text['confirm-copy']['de-at'] = "Wollen Sie das wirklich kopieren?";
+
+//buttons
+
+$text['button-clear']['en-us'] = "Clear";
+$text['button-clear']['es-cl'] = "Limpiar";
+$text['button-clear']['pt-pt'] = "Apagar";
+$text['button-clear']['fr-fr'] = "Nettoyer";
+$text['button-clear']['pt-br'] = "Claro";
+$text['button-clear']['pl'] = "Wyczyść";
+$text['button-clear']['sv-se'] = "Rensa";
+$text['button-clear']['de-at'] = "Zurücksetzen";
+$text['button-clear']['ro'] = "Curătă";
+$text['button-clear']['he'] = "נקה";
+
+$text['button-save']['en-us'] = "Save";
+$text['button-save']['es-cl'] = "Guardar";
+$text['button-save']['pt-pt'] = "Guardar";
+$text['button-save']['fr-fr'] = "Sauvegarder";
+$text['button-save']['pt-br'] = "Salvar";
+$text['button-save']['pl'] = "Zachowaj";
+$text['button-save']['he'] = "שמור";
+$text['button-save']['uk'] = "Зберегти";
+$text['button-save']['sv-se'] = "Spara";
+$text['button-save']['de-at'] = "Speichern";
+$text['button-save']['ro'] = "Salvează";
+$text['button-save']['fa'] = "";
+$text['button-save']['ar-eg'] = "حفظ";
+
+$text['button-search']['en-us'] = "Search";
+$text['button-search']['es-cl'] = "Buscar";
+$text['button-search']['pt-pt'] = "Pesquisar";
+$text['button-search']['fr-fr'] = "Chercher";
+$text['button-search']['pl'] = "Wyszukaj";
+$text['button-search']['uk'] = "Пошук";
+$text['button-search']['sv-se'] = "Sök";
+$text['button-search']['ro'] = "";
+$text['button-search']['de-at'] = "Suchen";
+$text['button-search']['he'] = "חפש";
+
+$text['button-show_all']['en-us'] = "Show All";
+$text['button-show_all']['es-cl'] = "Mostrar Todos";
+$text['button-show_all']['pt-pt'] = "Mostrar Todos";
+$text['button-show_all']['fr-fr'] = "Montrer Tout";
+$text['button-show_all']['pt-br'] = "Mostrar todos";
+$text['button-show_all']['pl'] = "Pokaż wszystkie";
+$text['button-show_all']['sv-se'] = "Visa Allt";
+$text['button-show_all']['uk'] = "Показати всі";
+$text['button-show_all']['ro'] = "";
+$text['button-show_all']['de-at'] = "Alle anzeigen";
+$text['button-show_all']['fa'] = "";
+$text['button-show_all']['ar-eg'] = "أظهر الكل";
+$text['button-show_all']['he'] = "הצג הכל";
+
+$text['button-restore']['en-us'] = "Restore Default";
+$text['button-restore']['es-cl'] = "Restaurar Predeterminados";
+$text['button-restore']['pt-pt'] = "Restaurar Predefinições";
+$text['button-restore']['fr-fr'] = "Restaurer";
+$text['button-restore']['pl'] = "Przywróć ustawienia domyślne";
+$text['button-restore']['uk'] = "Відновити типові значення";
+$text['button-restore']['sv-se'] = "Aktivera Standard Inställningar";
+$text['button-restore']['ro'] = "";
+$text['button-restore']['de-at'] = "Zurücksetzen";
+$text['button-restore']['he'] = "שחזר למקור";
+
+$text['button-reset']['en-us'] = "Reset";
+$text['button-reset']['es-cl'] = "Reajustar";
+$text['button-reset']['pt-pt'] = "Restabelecer";
+$text['button-reset']['fr-fr'] = "Remettre";
+$text['button-reset']['pt-br'] = "Restabelecer";
+$text['button-reset']['pl'] = "Resetuj";
+$text['button-reset']['he'] = "אפס";
+$text['button-reset']['uk'] = "Скинути";
+$text['button-reset']['sv-se'] = "Återställ";
+$text['button-reset']['de-at'] = "Zurücksetzen";
+$text['button-reset']['ro'] = "Inițializare";
+$text['button-reset']['fa'] = "";
+$text['button-reset']['ar-eg'] = "إعادة تعيين";
+
+$text['button-copy']['en-us'] = "Copy";
+$text['button-copy']['es-cl'] = "Copiar";
+$text['button-copy']['pt-pt'] = "Copiar";
+$text['button-copy']['fr-fr'] = "Copier";
+$text['button-copy']['pl'] = "Kopiuj";
+$text['button-copy']['uk'] = "Копіювати";
+$text['button-copy']['sv-se'] = "Kopiera";
+$text['button-copy']['ro'] = "";
+$text['button-copy']['de-at'] = "Kopieren";
+$text['button-copy']['he'] = "העתק";
+
+$text['button-login']['en-us'] = "Login";
+$text['button-login']['es-cl'] = "Ingresar";
+$text['button-login']['pt-pt'] = "Iniciar Sessão";
+$text['button-login']['fr-fr'] = "connexion";
+$text['button-login']['pt-br'] = "Iniciar Sessão";
+$text['button-login']['pl'] = "Użytkownik";
+$text['button-login']['he'] = "כניסה";
+$text['button-login']['uk'] = "Логін";
+$text['button-login']['sv-se'] = "Logga In";
+$text['button-login']['de-at'] = "Anmelden";
+$text['button-login']['ro'] = "Autentificare";
+$text['button-login']['fa'] = "";
+$text['button-login']['ar-eg'] = "دخول";
+
+$text['button-next']['en-us'] = "Next";
+$text['button-next']['es-cl'] = "";
+$text['button-next']['pt-pt'] = "";
+$text['button-next']['fr-fr'] = "";
+$text['button-next']['pt-br'] = "";
+$text['button-next']['pl'] = "";
+$text['button-next']['sv-se'] = "";
+$text['button-next']['uk'] = "";
+$text['button-next']['de-at'] = "";
+$text['button-next']['ar-eg'] = "";
+
+$text['button-back']['en-us'] = "Back";
+$text['button-back']['es-cl'] = "Volver";
+$text['button-back']['pt-pt'] = "Voltar";
+$text['button-back']['fr-fr'] = "Retour";
+$text['button-back']['pt-br'] = "Voltar";
+$text['button-back']['pl'] = "Wróć";
+$text['button-back']['he'] = "חזרה";
+$text['button-back']['uk'] = "Назад";
+$text['button-back']['sv-se'] = "Tillbaka";
+$text['button-back']['de-at'] = "Zurück ";
+$text['button-back']['ro'] = "Înapoi";
+$text['button-back']['ar-eg'] = "رجوع";
+
+$text['button-edit']['en-us'] = "Edit";
+$text['button-edit']['es-cl'] = "Editar";
+$text['button-edit']['pt-pt'] = "Editar";
+$text['button-edit']['fr-fr'] = "Editer";
+$text['button-edit']['pt-br'] = "Editar";
+$text['button-edit']['he'] = " עריכה";
+$text['button-edit']['de-at'] = "Bearbeiten";
+$text['button-edit']['pl'] = "Edytuj";
+$text['button-edit']['ro'] = "edita";
+$text['button-edit']['uk'] = "Редагувати";
+$text['button-edit']['sv-se'] = "Editera";
+$text['button-edit']['ar-eg'] = "تعديل";
+
+$text['button-delete']['en-us'] = "Delete";
+$text['button-delete']['es-cl'] = "Eliminar";
+$text['button-delete']['pt-pt'] = "Remover";
+$text['button-delete']['fr-fr'] = "Supprimer";
+$text['button-delete']['pt-br'] = "Remover";
+$text['button-delete']['he'] = " מחק";
+$text['button-delete']['de-at'] = "löschen";
+$text['button-delete']['pl'] = "Usuń";
+$text['button-delete']['ro'] = "șterge";
+$text['button-delete']['uk'] = "Видалити";
+$text['button-delete']['sv-se'] = "Ta Bort";
+$text['button-delete']['ar-eg'] = "مسح";
+
+$text['button-add']['en-us'] = "Add";
+$text['button-add']['es-cl'] = "Agregar";
+$text['button-add']['pt-pt'] = "Adicionar";
+$text['button-add']['fr-fr'] = "Ajouter";
+$text['button-add']['pt-br'] = "Adicionar";
+$text['button-add']['he'] = " להוסיף";
+$text['button-add']['de-at'] = "Hinzufügen";
+$text['button-add']['pl'] = "Dodaj";
+$text['button-add']['ro'] = "Adăuga";
+$text['button-add']['uk'] = "Додати";
+$text['button-add']['sv-se'] = "Lägg Till";
+$text['button-add']['ar-eg'] = "اضافة";
+
+$text['button-reload']['en-us'] = "Reload";
+$text['button-reload']['es-cl'] = "Recargar";
+$text['button-reload']['pt-pt'] = "Recarregar";
+$text['button-reload']['fr-fr'] = "Recharger";
+$text['button-reload']['nl-nl'] = "";
+$text['button-reload']['pt-br'] = "Recarregar";
+$text['button-reload']['pl'] = "Przeładować";
+$text['button-reload']['sv-se'] = "Ladda";
+$text['button-reload']['uk'] = "перезавантажувати";
+$text['button-reload']['de-at'] = "Neu Laden";
+
+$text['button-paste']['en-us'] = "Paste";
+$text['button-paste']['es-cl'] = "Propagar";
+$text['button-paste']['pt-pt'] = "Propagar";
+$text['button-paste']['fr-fr'] = "Propager";
+$text['button-paste']['nl-nl'] = "";
+$text['button-paste']['pt-br'] = "Colar";
+$text['button-paste']['pl'] = "Wklej";
+$text['button-paste']['sv-se'] = "Klistra In";
+$text['button-paste']['uk'] = "Вставити";
+$text['button-paste']['de-at'] = "Einfügen";
+
+$text['button-export']['en-us'] = "Export";
+$text['button-export']['es-cl'] = "Exportar";
+$text['button-export']['pt-pt'] = "Exportar";
+$text['button-export']['fr-fr'] = "Exporter";
+$text['button-export']['pt-br'] = "Exportação";
+$text['button-export']['pl'] = "Eksportuj";
+$text['button-export']['sv-se'] = "Export";
+$text['button-export']['uk'] = "Експортувати";
+$text['button-export']['de-at'] = "Exportieren";
+
+$text['button-execute']['en-us'] = "Execute";
+$text['button-execute']['es-cl'] = "Ejecutar";
+$text['button-execute']['pt-pt'] = "Executar";
+$text['button-execute']['fr-fr'] = "Exécuter";
+$text['button-execute']['pt-br'] = "Executar";
+$text['button-execute']['pl'] = "Wykonaj";
+$text['button-execute']['sv-se'] = "Kör";
+$text['button-execute']['uk'] = "Виконати";
+$text['button-execute']['de-at'] = "Ausführen";
+
+$text['button-view']['en-us'] = "View";
+$text['button-view']['es-cl'] = "Ver";
+$text['button-view']['pt-pt'] = "Vista";
+$text['button-view']['fr-fr'] = "Voir";
+$text['button-view']['pt-br'] = "Visualizar";
+$text['button-view']['he'] = " צפה ב";
+$text['button-view']['de-at'] = "Ansicht";
+$text['button-view']['pl'] = "Widok";
+$text['button-view']['ro'] = "Vedere";
+$text['button-view']['uk'] = "вид";
+$text['button-view']['sv-se'] = "Visa";
+$text['button-view']['ar-eg'] = "عرض";
+
+$text['button-upload']['en-us'] = "Upload";
+$text['button-upload']['es-cl'] = "Subir";
+$text['button-upload']['pt-pt'] = "Carregar";
+$text['button-upload']['fr-fr'] = "déposer";
+$text['button-upload']['pt-br'] = "Submeter";
+$text['button-upload']['pl'] = "Wyślij";
+$text['button-upload']['sv-se'] = "Ladda Upp";
+$text['button-upload']['uk'] = "Завантажити";
+$text['button-upload']['de-at'] = "Hochladen";
+
+$text['button-download']['en-us'] = "Download";
+$text['button-download']['es-cl'] = "Descargar";
+$text['button-download']['pt-pt'] = "Baixar";
+$text['button-download']['fr-fr'] = "Télécharger";
+$text['button-download']['pt-br'] = "Download";
+$text['button-download']['pl'] = "Pobierz";
+$text['button-download']['sv-se'] = "Ladda Ned";
+$text['button-download']['uk'] = "Скачати";
+$text['button-download']['de-at'] = "Download";
+
+$text['button-restart']['en-us'] = "Restart";
+$text['button-restart']['es-cl'] = "Reanudar";
+$text['button-restart']['pt-pt'] = "Restart";
+$text['button-restart']['fr-fr'] = "Redémarrer";
+$text['button-restart']['pt-br'] = "Reiniciar";
+$text['button-restart']['pl'] = "Restartuj";
+$text['button-restart']['sv-se'] = "Starta Om";
+$text['button-restart']['uk'] = "Перезапустити";
+$text['button-restart']['de-at'] = "Neu starten";
+
+$text['button-refresh']['en-us'] = "Refresh";
+$text['button-refresh']['es-cl'] = "Actualizar";
+$text['button-refresh']['pt-pt'] = "Actualizar";
+$text['button-refresh']['fr-fr'] = "Rafraîchir";
+$text['button-refresh']['pt-br'] = "Atualizar";
+$text['button-refresh']['pl'] = "Odśwież";
+$text['button-refresh']['sv-se'] = "Uppdatera";
+$text['button-refresh']['uk'] = "Оновити";
+$text['button-refresh']['de-at'] = "Aktualisieren";
+
+$text['button-advanced']['en-us'] = "Advanced";
+$text['button-advanced']['es-cl'] = "Avanzadas";
+$text['button-advanced']['pt-pt'] = "Avançadas";
+$text['button-advanced']['fr-fr'] = "Avancé";
+$text['button-advanced']['pt-br'] = "Avançar";
+$text['button-advanced']['pl'] = "Zaawansowany";
+$text['button-advanced']['sv-se'] = "Avancerat";
+$text['button-advanced']['uk'] = "Додатково";
+$text['button-advanced']['de-at'] = "Erweitert";
+
+$text['button-basic']['en-us'] = "Basic";
+$text['button-basic']['es-cl'] = "Básico";
+$text['button-basic']['pt-pt'] = "Básico";
+$text['button-basic']['fr-fr'] = "Basique";
+$text['button-basic']['pl'] = "Podstawowy";
+$text['button-basic']['uk'] = "Основний";
+
+$text['button-stop']['en-us'] = "Stop";
+$text['button-stop']['es-cl'] = "Detener";
+$text['button-stop']['pt-pt'] = "Parar";
+$text['button-stop']['fr-fr'] = "Stop";
+$text['button-stop']['pt-br'] = "Pausar Broadcast";
+$text['button-stop']['pl'] = "Zatrzymaj rozsylanie rozmów";
+$text['button-stop']['sv-se'] = "Stoppa";
+$text['button-stop']['uk'] = "Зупинити трансляцію";
+$text['button-stop']['de-at'] = "Stopp";
+
+$text['button-status']['en-us'] = "Status";
+$text['button-status']['es-cl'] = "Estado";
+$text['button-status']['pt-pt'] = "Estado";
+$text['button-status']['fr-fr'] = "Etat";
+$text['button-status']['pt-br'] = "Estado";
+$text['button-status']['pl'] = "Status";
+$text['button-status']['sv-se'] = "Status";
+$text['button-status']['uk'] = "Статус";
+$text['button-status']['de-at'] = "Status";
+
+$text['button-start']['en-us'] = "Start";
+$text['button-start']['es-cl'] = "Iniciar";
+$text['button-start']['pt-pt'] = "Iniciar";
+$text['button-start']['fr-fr'] = "Démarrer";
+$text['button-start']['pt-br'] = "Iniciar";
+$text['button-start']['pl'] = "Start";
+$text['button-start']['sv-se'] = "Start";
+$text['button-start']['uk'] = "Запустити";
+$text['button-start']['de-at'] = "Start";
+
+
+//label
+
+$text['label-name']['en-us'] = "Name";
+$text['label-name']['es-cl'] = "Nombre";
+$text['label-name']['pt-pt'] = "Nome";
+$text['label-name']['fr-fr'] = "Nom";
+$text['label-name']['pt-br'] = "Nome";
+$text['label-name']['pl'] = "Nazwa";
+$text['label-name']['sv-se'] = "Namn";
+$text['label-name']['uk'] = "Назва";
+$text['label-name']['de-at'] = "Name";
+
+$text['label-description']['en-us'] = "Description";
+$text['label-description']['es-cl'] = "Descripción";
+$text['label-description']['pt-pt'] = "Descripção";
+$text['label-description']['fr-fr'] = "Description";
+$text['label-description']['pt-br'] = "Descrição";
+$text['label-description']['pl'] = "Opis";
+$text['label-description']['sv-se'] = "Beskrivning";
+$text['label-description']['uk'] = "Опис";
+$text['label-description']['de-at'] = "Beschreibung";
+
+$text['label-value']['en-us'] = "Value";
+$text['label-value']['es-cl'] = "Valor";
+$text['label-value']['pt-pt'] = "Valor";
+$text['label-value']['fr-fr'] = "Valeur";
+$text['label-value']['nl-nl'] = "";
+$text['label-value']['pt-br'] = "Valor";
+$text['label-value']['pl'] = "Wartość";
+$text['label-value']['sv-se'] = "Värde";
+$text['label-value']['uk'] = "Значення";
+$text['label-value']['de-at'] = "Wert";
+
+$text['label-password']['en-us'] = "Password";
+$text['label-password']['es-cl'] = "Contreseña";
+$text['label-password']['pt-pt'] = "Palavra-Chave";
+$text['label-password']['fr-fr'] = "Mot de Passe";
+$text['label-password']['pt-br'] = "Senha";
+$text['label-password']['pl'] = "Hasło";
+$text['label-password']['sv-se'] = "Lösenord";
+$text['label-password']['uk'] = "Пароль";
+$text['label-password']['de-at'] = "Passwort";
+$text['label-password']['ar-eg'] = "كلمة السر";
+
+$text['label-type']['en-us'] = "Type";
+$text['label-type']['es-cl'] = "Tipo";
+$text['label-type']['pt-pt'] = "Tipo";
+$text['label-type']['fr-fr'] = "Type";
+$text['label-type']['nl-nl'] = "";
+$text['label-type']['pt-br'] = "Tipo";
+$text['label-type']['pl'] = "Typ";
+$text['label-type']['sv-se'] = "Typ";
+$text['label-type']['uk'] = "Тип";
+$text['label-type']['de-at'] = "Typ";
+
+$text['label-category']['en-us'] = "Category";
+$text['label-category']['es-cl'] = "Categoría";
+$text['label-category']['pt-pt'] = "Categoria";
+$text['label-category']['fr-fr'] = "Catégories";
+$text['label-category']['pt-br'] = "Categoria";
+$text['label-category']['pl'] = "Kategoria";
+$text['label-category']['sv-se'] = "Kategori";
+$text['label-category']['uk'] = "Категорія";
+$text['label-category']['de-at'] = "Kategorie";
+
+$text['label-subcategory']['en-us'] = "Subcategory";
+$text['label-subcategory']['es-cl'] = "Subcategoría";
+$text['label-subcategory']['pt-pt'] = "Subcategoria";
+$text['label-subcategory']['fr-fr'] = "Sous-catégories";
+$text['label-subcategory']['pt-br'] = "Subcategoria";
+$text['label-subcategory']['pl'] = "Podkategoria";
+$text['label-subcategory']['sv-se'] = "Under-kategori";
+$text['label-subcategory']['uk'] = "Підкатегорія";
+$text['label-subcategory']['de-at'] = "Unterkategorie";
+
+$text['label-true']['en-us'] = "True";
+$text['label-true']['es-cl'] = "Verdadero";
+$text['label-true']['pt-pt'] = "Sim";
+$text['label-true']['fr-fr'] = "Oui";
+$text['label-true']['nl-nl'] = "";
+$text['label-true']['pt-br'] = "Sim";
+$text['label-true']['pl'] = "Tak";
+$text['label-true']['sv-se'] = "Sann";
+$text['label-true']['uk'] = "Так";
+$text['label-true']['ro'] = "";
+$text['label-true']['de-at'] = "Ein";
+$text['label-true']['ar-eg'] = "صحيح";
+$text['label-true']['he'] = "חיובי";
+
+$text['label-false']['en-us'] = "False";
+$text['label-false']['es-cl'] = "Falso";
+$text['label-false']['pt-pt'] = "Falso";
+$text['label-false']['fr-fr'] = "Falso";
+$text['label-false']['pt-br'] = "Não";
+$text['label-false']['he'] = "לא חוקי";
+$text['label-false']['de-at'] = "Aus";
+$text['label-false']['pl'] = "Nie";
+$text['label-false']['ro'] = "Fals";
+$text['label-false']['uk'] = "помилковий";
+$text['label-false']['sv-se'] = "Falsk";
+$text['label-false']['ar-eg'] = "خاطئة";
+
+$text['label-enable']['en-us'] = "Enable";
+$text['label-enable']['es-cl'] = "Activar";
+$text['label-enable']['pt-pt'] = "Activar";
+$text['label-enable']['fr-fr'] = "Activer";
+$text['label-enable']['pt-br'] = "Ativar";
+$text['label-enable']['pl'] = "Włącz";
+$text['label-enable']['sv-se'] = "Aktivera ";
+$text['label-enable']['uk'] = "";
+$text['label-enable']['de-at'] = "Aktivieren";
+
+$text['label-enabled']['en-us'] = "Enabled";
+$text['label-enabled']['es-cl'] = "Activado";
+$text['label-enabled']['pt-pt'] = "Habilitado";
+$text['label-enabled']['fr-fr'] = "Actif";
+$text['label-enabled']['nl-nl'] = "";
+$text['label-enabled']['pt-br'] = "Habilitado";
+$text['label-enabled']['pl'] = "Włączony";
+$text['label-enabled']['sv-se'] = "Aktiverad";
+$text['label-enabled']['uk'] = "Включено";
+$text['label-enabled']['de-at'] = "An";
+
+$text['label-disable']['en-us'] = "Disable";
+$text['label-disable']['es-cl'] = "Desactivar";
+$text['label-disable']['pt-pt'] = "Desactivo";
+$text['label-disable']['fr-fr'] = "Désactiver";
+$text['label-disable']['pt-br'] = "Desativado";
+$text['label-disable']['pl'] = "Wyłącz";
+$text['label-disable']['sv-se'] = "Inaktivera ";
+$text['label-disable']['uk'] = "Відключити";
+$text['label-disable']['de-at'] = "Deaktivieren";
+
+$text['label-disabled']['en-us'] = "Disabled";
+$text['label-disabled']['es-cl'] = "Discapacitado";
+$text['label-disabled']['pt-pt'] = "Inválido";
+$text['label-disabled']['fr-fr'] = "Non Permis";
+$text['label-disabled']['pt-br'] = "Inválido";
+$text['label-disabled']['pl'] = "Wyłączony";
+$text['label-disabled']['sv-se'] = "Inaktiverad";
+$text['label-disabled']['uk'] = "Відключено";
+$text['label-disabled']['de-at'] = "Ausgeschaltet";
+
+$text['label-none']['en-us'] = "None";
+$text['label-none']['es-cl'] = "Ninguno";
+$text['label-none']['pt-pt'] = "Nenhum";
+$text['label-none']['fr-fr'] = "Aucun";
+$text['label-none']['pt-br'] = "Nenhum";
+$text['label-none']['pl'] = "Żaden";
+$text['label-none']['sv-se'] = "Ingen";
+$text['label-none']['uk'] = "Жоден";
+$text['label-none']['de-at'] = "keine";
+
+$text['label-select']['en-us'] = "Select";
+$text['label-select']['es-cl'] = "Seleccionar";
+$text['label-select']['pt-pt'] = "Selecionar";
+$text['label-select']['fr-fr'] = "Sélectionner";
+$text['label-select']['nl-nl'] = "";
+$text['label-select']['pt-br'] = "Selecionar";
+$text['label-select']['pl'] = "Wybierz";
+$text['label-select']['sv-se'] = "Välj";
+$text['label-select']['uk'] = "";
+$text['label-select']['de-at'] = "Auswählen";
+
+$text['label-search']['en-us'] = "Search...";
+$text['label-search']['es-cl'] = "Buscar...";
+$text['label-search']['pt-pt'] = "Pesquisa...";
+$text['label-search']['fr-fr'] = "Recherche...";
+$text['label-search']['nl-nl'] = "";
+$text['label-search']['pt-br'] = "Pesquisa...";
+$text['label-search']['pl'] = "Szukaj ...";
+$text['label-search']['sv-se'] = "Sök ...";
+$text['label-search']['ro'] = "";
+$text['label-search']['uk'] = "Результати пошуку";
+$text['label-search']['de-at'] = "Suche...";
+$text['label-search']['he'] = "תוצאות חיפוש";
+
+$text['label-order']['en-us'] = "Order";
+$text['label-order']['es-cl'] = "Orden";
+$text['label-order']['pt-pt'] = "Ordem";
+$text['label-order']['fr-fr'] = "Ordre";
+$text['label-order']['nl-nl'] = "";
+$text['label-order']['pt-br'] = "Ordenação";
+$text['label-order']['pl'] = "Kolejność";
+$text['label-order']['sv-se'] = "Ordning";
+$text['label-order']['uk'] = "Інше";
+$text['label-order']['de-at'] = "Reihenfolge";
+
+$text['label-delete']['en-us'] = "Delete";
+$text['label-delete']['es-cl'] = "Eliminar";
+$text['label-delete']['pt-pt'] = "Remover";
+$text['label-delete']['fr-fr'] = "Supprimer";
+$text['label-delete']['pt-br'] = "Remover";
+$text['label-delete']['pl'] = "Usuń";
+$text['label-delete']['sv-se'] = "Ta Bort";
+$text['label-delete']['uk'] = "Видалити";
+$text['label-delete']['de-at'] = "Löschen";
+
+
+//option (present for compatibility, should use label-true/false instead)
+
+$text['option-true']['en-us'] = "True";
+$text['option-true']['es-cl'] = "verdadero";
+$text['option-true']['pt-pt'] = "Sim";
+$text['option-true']['fr-fr'] = "Oui";
+$text['option-true']['pt-br'] = "Sim";
+$text['option-true']['pl'] = "Tak";
+$text['option-true']['sv-se'] = "Sann";
+$text['option-true']['de-at'] = "Ein";
+
+$text['option-false']['en-us'] = "False";
+$text['option-false']['es-cl'] = "Falso";
+$text['option-false']['pt-pt'] = "Não";
+$text['option-false']['fr-fr'] = "Non";
+$text['option-false']['pt-br'] = "Não";
+$text['option-false']['pl'] = "Nie";
+$text['option-false']['sv-se'] = "Falsk";
+$text['option-false']['de-at'] = "Aus";
+
+
+
+//description
+
+$text['description-value']['en-us'] = "Enter the value of this setting.";
+$text['description-value']['es-cl'] = "Ingrese el valor de esta configuración";
+$text['description-value']['pt-pt'] = "Introduza o valor desta definição.";
+$text['description-value']['fr-fr'] = "Entrer la valeur de ce paramètre.";
+$text['description-value']['nl-nl'] = "";
+$text['description-value']['pt-br'] = "Insira o valor da variável";
+$text['description-value']['pl'] = "Wprowadź wartość tego ustawienia";
+$text['description-value']['sv-se'] = "Ange värdet på inställningen.";
+$text['description-value']['uk'] = "Введіть значенння змінної";
+$text['description-value']['de-at'] = "Geben Sie den Wert für diese Einstellung an.";
+
+$text['description-type']['en-us'] = "Enter the setting type (ie. uuid, name, var, dir, etc).";
+$text['description-type']['es-cl'] = "Ingrese el tipo de configuración (ej. uuid, name, var, dir, etc).";
+$text['description-type']['pt-pt'] = "Introduza o tipo de definição (ex: uuid, name, var, dir, etc)";
+$text['description-type']['fr-fr'] = "Choisir le type de paramètre (ie. uuid, nom, var, dir, etc).";
+$text['description-type']['nl-nl'] = "";
+$text['description-type']['pt-br'] = "Introduza o tipo de definição (ex:uuid,name,var,dir,etc)";
+$text['description-type']['pl'] = "Wprowadź rodzaj ustawienia (np. uuid, name, var, dir)";
+$text['description-type']['sv-se'] = "Fyll i inställnings typ (ie. uuid, name, var, dir, etc).";
+$text['description-type']['uk'] = "";
+$text['description-type']['de-at'] = "Geben Sie den Typ für diese Einstellung an (z.B. uuid, name, var, dir, etc).";
+
+$text['description-category']['en-us'] = "Enter the category.";
+$text['description-category']['es-cl'] = "Ingrese la categoría.";
+$text['description-category']['pt-pt'] = "Introduza a categoria.";
+$text['description-category']['fr-fr'] = "Entrer la Catégorie.";
+$text['description-category']['nl-nl'] = "";
+$text['description-category']['pt-br'] = "Descrição";
+$text['description-category']['pl'] = "Wprowadź kategorię";
+$text['description-category']['sv-se'] = "Ange Kategori.";
+$text['description-category']['uk'] = "Опис";
+$text['description-category']['de-at'] = "Geben Sie die Kategorie an.";
+
+$text['description-subcategory']['en-us'] = "Enter the subcategory.";
+$text['description-subcategory']['es-cl'] = "Ingrese la subcategoría.";
+$text['description-subcategory']['pt-pt'] = "Introduza a subcategoria.";
+$text['description-subcategory']['fr-fr'] = "Entrer la Sous-Catégorie.";
+$text['description-subcategory']['nl-nl'] = "";
+$text['description-subcategory']['pt-br'] = "Introduza a subcategoria";
+$text['description-subcategory']['pl'] = "Wprowadź podkategorię";
+$text['description-subcategory']['sv-se'] = "Fyll i under-kategori";
+$text['description-subcategory']['uk'] = "";
+$text['description-subcategory']['de-at'] = "Geben Sie die Unterkategorie an.";
+
+$text['description-description']['en-us'] = "Enter a description, if desired.";
+$text['description-description']['es-cl'] = "Ingrese una descripción, opcional.";
+$text['description-description']['pt-pt'] = "Insira a descrição. (opcional) ";
+$text['description-description']['fr-fr'] = "Entrez une description, si vous le souhaitez.";
+$text['description-description']['nl-nl'] = "";
+$text['description-description']['pt-br'] = "Insira a descrição, caso desejar";
+$text['description-description']['pl'] = "Wpisz opis (opcjonalne).";
+$text['description-description']['sv-se'] = "Fyll i en beskrivning, om nödvändigt.";
+$text['description-description']['uk'] = "Введіть опис, якщо це необхідно.";
+$text['description-description']['de-at'] = "Falls gewünscht, geben Sie eine Beschreibung an.";
+
 ?>

+ 138 - 138
resources/classes/cache.php

@@ -1,139 +1,139 @@
-<?php
-
-/**
- * cache class provides an abstracted cache
- *
- * @method string set
- * @method string get
- * @method string delete
- * @method string flush
- */
-class cache {
-
-	/**
-	 * Called when the object is created
-	 */
-	public function __construct() {
-		//place holder
-	}
-
-	/**
-	 * Called when there are no references to a particular object
-	 * unset the variables used in the class
-	 */
-	public function __destruct() {
-		foreach ($this as $key => $value) {
-			unset($this->$key);
-		}
-	}
-
-	/**
-	 * Add a specific item in the cache
-	 * @var string $key		the cache id
-	 * @var string $value	string to be cached
-	 */
-	public function set($key, $value) {
-		// connect to event socket
-			$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
-			if ($fp === false) {
-				return false;
-			}
-
-		//send a custom event
-
-		//run the memcache
-			$command = "memcache set ".$key." ".$value;
-			$result = event_socket_request($fp, 'api '.$command);
-
-		//close event socket
-			fclose($fp);
-
-		// return result
-			return $result;
-	}
-
-	/**
-	 * Get a specific item from the cache
-	 * @var string $key		cache id
-	 */
-	public function get($key) {
-		// connect to event socket
-			$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
-			if ($fp === false) {
-				return false;
-			}
-
-		//send a custom event
-
-		//run the memcache
-			$command = "memcache get ".$key;
-			$result = event_socket_request($fp, 'api '.$command);
-
-		//close event socket
-			fclose($fp);
-
-		// return result
-			return $result;
-	}
-
-	/**
-	 * Delete a specific item from the cache
-	 * @var string $key		cache id
-	 */
-	public function delete($key) {
-		// connect to event socket
-			$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
-			if ($fp === false) {
-				return false;
-			}
-
-		//send a custom event
-			$event = "sendevent CUSTOM\n";
-			$event .= "Event-Name: MEMCACHE\n";
-			$event .= "Event-Subclass: delete\n";
-			$event .= "API-Command: memcache\n";
-			$event .= "API-Command-Argument: delete ".$key."\n";
-			event_socket_request($fp, $event);
-
-		//run the memcache
-			$command = "memcache delete ".$key;
-			$result = event_socket_request($fp, 'api '.$command);
-
-		//close event socket
-			fclose($fp);
-
-		// return result
-			return $result;
-	}
-
-	/**
-	 * Delete the entire cache
-	 */
-	public function flush() {
-		// connect to event socket
-			$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
-			if ($fp === false) {
-				return false;
-			}
-
-		//send a custom event
-			$event = "sendevent CUSTOM\n";
-			$event .= "Event-Name: MEMCACHE\n";
-			$event .= "Event-Subclass: flush\n";
-			$event .= "API-Command: memcache\n";
-			$event .= "API-Command-Argument: flush\n";
-			event_socket_request($fp, $event);
-
-		//run the memcache
-			$command = "memcache flush";
-			$result = event_socket_request($fp, 'api '.$command);
-
-		//close event socket
-			fclose($fp);
-
-		// return result
-			return $result;
-	}
-}
-
+<?php
+
+/**
+ * cache class provides an abstracted cache
+ *
+ * @method string set
+ * @method string get
+ * @method string delete
+ * @method string flush
+ */
+class cache {
+
+	/**
+	 * Called when the object is created
+	 */
+	public function __construct() {
+		//place holder
+	}
+
+	/**
+	 * Called when there are no references to a particular object
+	 * unset the variables used in the class
+	 */
+	public function __destruct() {
+		foreach ($this as $key => $value) {
+			unset($this->$key);
+		}
+	}
+
+	/**
+	 * Add a specific item in the cache
+	 * @var string $key		the cache id
+	 * @var string $value	string to be cached
+	 */
+	public function set($key, $value) {
+		// connect to event socket
+			$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
+			if ($fp === false) {
+				return false;
+			}
+
+		//send a custom event
+
+		//run the memcache
+			$command = "memcache set ".$key." ".$value;
+			$result = event_socket_request($fp, 'api '.$command);
+
+		//close event socket
+			fclose($fp);
+
+		// return result
+			return $result;
+	}
+
+	/**
+	 * Get a specific item from the cache
+	 * @var string $key		cache id
+	 */
+	public function get($key) {
+		// connect to event socket
+			$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
+			if ($fp === false) {
+				return false;
+			}
+
+		//send a custom event
+
+		//run the memcache
+			$command = "memcache get ".$key;
+			$result = event_socket_request($fp, 'api '.$command);
+
+		//close event socket
+			fclose($fp);
+
+		// return result
+			return $result;
+	}
+
+	/**
+	 * Delete a specific item from the cache
+	 * @var string $key		cache id
+	 */
+	public function delete($key) {
+		// connect to event socket
+			$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
+			if ($fp === false) {
+				return false;
+			}
+
+		//send a custom event
+			$event = "sendevent CUSTOM\n";
+			$event .= "Event-Name: MEMCACHE\n";
+			$event .= "Event-Subclass: delete\n";
+			$event .= "API-Command: memcache\n";
+			$event .= "API-Command-Argument: delete ".$key."\n";
+			event_socket_request($fp, $event);
+
+		//run the memcache
+			$command = "memcache delete ".$key;
+			$result = event_socket_request($fp, 'api '.$command);
+
+		//close event socket
+			fclose($fp);
+
+		// return result
+			return $result;
+	}
+
+	/**
+	 * Delete the entire cache
+	 */
+	public function flush() {
+		// connect to event socket
+			$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
+			if ($fp === false) {
+				return false;
+			}
+
+		//send a custom event
+			$event = "sendevent CUSTOM\n";
+			$event .= "Event-Name: MEMCACHE\n";
+			$event .= "Event-Subclass: flush\n";
+			$event .= "API-Command: memcache\n";
+			$event .= "API-Command-Argument: flush\n";
+			event_socket_request($fp, $event);
+
+		//run the memcache
+			$command = "memcache flush";
+			$result = event_socket_request($fp, 'api '.$command);
+
+		//close event socket
+			fclose($fp);
+
+		// return result
+			return $result;
+	}
+}
+
 ?>

+ 126 - 126
resources/classes/config.php

@@ -1,127 +1,127 @@
-<?php
-
-/**
- * config
- *
- * @method get config.php
- * @method find find the path to the config.php file
- * @method exists determin if the the config.php file exists
- */
-class config {
-
-	/**
-	 * database variables and config path
-	 */
-	public $db_type;
-	public $db_name;
-	public $db_username;
-	public $db_password;
-	public $db_host;
-	public $db_path;
-	public $db_port;
-	public $config_path;
-
-	/**
-	 * Called when the object is created
-	 */
-	public function __construct() {
-		//place holder
-	}
-
-	/**
-	 * Called when there are no references to a particular object
-	 * unset the variables used in the class
-	 */
-	public function __destruct() {
-		foreach ($this as $key => $value) {
-			unset($this->$key);
-		}
-	}
-
-	/**
-	 * Determine whether the config.php exists
-	 * @var string $db_type - type of database
-	 * @var string $db_name - name of the database
-	 * @var string $db_username - username to access the database
-	 * @var string $db_password - password to access the database
-	 * @var string $db_host - hostname of the database server
-	 * @var string $db_path - path of the database file
-	 * @var string $db_port - network port to connect to the database
-	 */
-	public function get() {
-		$this->find();
-		if ($this->exists()) {
-			require $this->config_path;
-			$this->db_type = $db_type;
-			$this->db_name = $db_name;
-			$this->db_username = $db_username;
-			$this->db_password = $db_password;
-			$this->db_host = $db_host;
-			$this->db_path = $db_path;
-			$this->db_port = $db_port;
-		}
-	}
-
-	/**
-	 * Find the path to the config.php
-	 * @var string $config_path - full path to the config.php file
-	 */
-	public function find() {
-		//get the PROJECT PATH
-			include "root.php";
-		// find the file
-			if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
-				$this->config_path = $_SERVER["PROJECT_ROOT"]."/resources/config.php";
-			} elseif (file_exists("/etc/fusionpbx/config.php")) {
-				$this->config_path = "/etc/fusionpbx/config.php";
-			} elseif (file_exists("/usr/local/etc/fusionpbx/config.php")) {
-				$this->config_path = "/usr/local/etc/fusionpbx/config.php";
-			}
-			else {
-				$this->config_path = '';
-			}
-		//return the path
-			return $this->config_path;
-	}
-
-	/**
-	 * Determine whether the config.php exists
-	 */
-	public function exists() {
-		$this->find();
-		if (strlen($this->config_path) > 0) {
-			return true;
-		}
-		else {
-			return false;
-		}
-	}
-}
-/*
-$config = new config;
-$config_exists = $config->exists();
-$config_path = $config->find();
-$config->get();
-$db_type = $config->db_type;
-$db_name = $config->db_name;
-$db_username = $config->db_username;
-$db_password = $config->db_password;
-$db_host = $config->db_host;
-$db_path = $config->db_path;
-$db_port = $config->db_port;
-echo "config_path: ".$config_path."\n";
-if ($config_exists) {
-	echo "config_exists: true\n";
-} else {
-	echo "config_exists: false\n";
-}
-echo "db_type: ".$db_type."\n";
-echo "db_name: ".$db_name."\n";
-echo "db_username: ".$db_username."\n";
-echo "db_password: ".$db_password."\n";
-echo "db_host: ".$db_host."\n";
-echo "db_path: ".$db_path."\n";
-echo "db_port: ".$db_port."\n";
-*/
-
+<?php
+
+/**
+ * config
+ *
+ * @method get config.php
+ * @method find find the path to the config.php file
+ * @method exists determin if the the config.php file exists
+ */
+class config {
+
+	/**
+	 * database variables and config path
+	 */
+	public $db_type;
+	public $db_name;
+	public $db_username;
+	public $db_password;
+	public $db_host;
+	public $db_path;
+	public $db_port;
+	public $config_path;
+
+	/**
+	 * Called when the object is created
+	 */
+	public function __construct() {
+		//place holder
+	}
+
+	/**
+	 * Called when there are no references to a particular object
+	 * unset the variables used in the class
+	 */
+	public function __destruct() {
+		foreach ($this as $key => $value) {
+			unset($this->$key);
+		}
+	}
+
+	/**
+	 * Determine whether the config.php exists
+	 * @var string $db_type - type of database
+	 * @var string $db_name - name of the database
+	 * @var string $db_username - username to access the database
+	 * @var string $db_password - password to access the database
+	 * @var string $db_host - hostname of the database server
+	 * @var string $db_path - path of the database file
+	 * @var string $db_port - network port to connect to the database
+	 */
+	public function get() {
+		$this->find();
+		if ($this->exists()) {
+			require $this->config_path;
+			$this->db_type = $db_type;
+			$this->db_name = $db_name;
+			$this->db_username = $db_username;
+			$this->db_password = $db_password;
+			$this->db_host = $db_host;
+			$this->db_path = $db_path;
+			$this->db_port = $db_port;
+		}
+	}
+
+	/**
+	 * Find the path to the config.php
+	 * @var string $config_path - full path to the config.php file
+	 */
+	public function find() {
+		//get the PROJECT PATH
+			include "root.php";
+		// find the file
+			if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
+				$this->config_path = $_SERVER["PROJECT_ROOT"]."/resources/config.php";
+			} elseif (file_exists("/etc/fusionpbx/config.php")) {
+				$this->config_path = "/etc/fusionpbx/config.php";
+			} elseif (file_exists("/usr/local/etc/fusionpbx/config.php")) {
+				$this->config_path = "/usr/local/etc/fusionpbx/config.php";
+			}
+			else {
+				$this->config_path = '';
+			}
+		//return the path
+			return $this->config_path;
+	}
+
+	/**
+	 * Determine whether the config.php exists
+	 */
+	public function exists() {
+		$this->find();
+		if (strlen($this->config_path) > 0) {
+			return true;
+		}
+		else {
+			return false;
+		}
+	}
+}
+/*
+$config = new config;
+$config_exists = $config->exists();
+$config_path = $config->find();
+$config->get();
+$db_type = $config->db_type;
+$db_name = $config->db_name;
+$db_username = $config->db_username;
+$db_password = $config->db_password;
+$db_host = $config->db_host;
+$db_path = $config->db_path;
+$db_port = $config->db_port;
+echo "config_path: ".$config_path."\n";
+if ($config_exists) {
+	echo "config_exists: true\n";
+} else {
+	echo "config_exists: false\n";
+}
+echo "db_type: ".$db_type."\n";
+echo "db_name: ".$db_name."\n";
+echo "db_username: ".$db_username."\n";
+echo "db_password: ".$db_password."\n";
+echo "db_host: ".$db_host."\n";
+echo "db_path: ".$db_path."\n";
+echo "db_port: ".$db_port."\n";
+*/
+
 ?>

+ 280 - 280
resources/classes/destinations.php

@@ -1,280 +1,280 @@
-<?php
-
-/**
- * destinations
- *
- * @method get_array get the destinations
- * @method select build the html select
- */
-class destinations {
-
-	/**
-	 * destinations array
-	 */
-	public $destinations;
-
-	/**
-	 * Called when the object is created
-	 */
-	public function __construct() {
-		//set the global variables
-			global $db, $db_type;
-
-		//get the array from the app_config.php files
-			$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php");
-			$x = 0;
-			foreach ($config_list as &$config_path) {
-				include($config_path);
-				$x++;
-			}
-			$i = 0;
-			foreach ($apps as $x => &$app) {
-				if (isset($app['destinations'])) foreach ($app['destinations'] as &$row) {
-					$this->destinations[] = $row;
-				}
-			}
-
-		//put the array in order
-			foreach ($this->destinations as $row) {
-				$option_groups[] = $row['label'];
-			}
-			array_multisort($option_groups, SORT_ASC, $this->destinations);
-
-		//add the sql and data to the array
-			$x = 0;
-			foreach ($this->destinations as $row) {
-				if ($row['type'] = 'sql') {
-					if (isset($row['sql'])) {
-						if (is_array($row['sql'])) {
-							$sql = trim($row['sql'][$db_type])." ";
-						}
-						else {
-							$sql = trim($row['sql'])." ";
-						}
-					}
-					else {
-						$field_count = count($row['field']);
-						$fields = '';
-						$c = 1;
-						foreach ($row['field'] as $key => $value) {
-							if ($field_count != $c) { $delimiter = ','; } else { $delimiter = ''; }
-							$fields .= $value." as ".$key.$delimiter." ";
-							$c++;
-						}
-						$sql = "select ".$fields;
-						$sql .= " from v_".$row['name']." ";
-					}
-					if (isset($row['where'])) {
-						$sql .= trim($row['where'])." ";
-					}
-					$sql .= "order by ".trim($row['order_by']);
-					$sql = str_replace("\${domain_uuid}", $_SESSION['domain_uuid'], $sql);
-					$sql = trim($sql);
-					$statement = $db->prepare($sql);
-					$statement->execute();
-					$result = $statement->fetchAll(PDO::FETCH_NAMED);
-					unset($statement);
-
-					$this->destinations[$x]['result']['sql'] = $sql;
-					$this->destinations[$x]['result']['data'] = $result;
-				}
-				$x++;
-			}
-			$this->destinations[$x]['type'] = 'array';
-			$this->destinations[$x]['label'] = 'other';
-			$this->destinations[$x]['name'] = 'dialplan';
-			$this->destinations[$x]['field']['name'] = "name";
-			$this->destinations[$x]['field']['destination'] = "destination";
-			$this->destinations[$x]['select_value']['dialplan'] = "transfer:\${destination}";
-			$this->destinations[$x]['select_value']['ivr'] = "menu-exec-app:transfer \${destination}";
-			$this->destinations[$x]['select_label'] = "\${name}";
-			$y = 0;
-			$this->destinations[$x]['result']['data'][$y]['label'] = 'check_voicemail';
-			$this->destinations[$x]['result']['data'][$y]['name'] = '*98';
-			$this->destinations[$x]['result']['data'][$y]['destination'] = '*98 XML ${context}';
-			$y++;
-			$this->destinations[$x]['result']['data'][$y]['label'] = 'company_directory';
-			$this->destinations[$x]['result']['data'][$y]['name'] = '*411';
-			$this->destinations[$x]['result']['data'][$y]['destination'] = '*411 XML ${context}';
-			$y++;
-			$this->destinations[$x]['result']['data'][$y]['label'] = 'hangup';
-			$this->destinations[$x]['result']['data'][$y]['name'] = 'hangup';
-			$this->destinations[$x]['result']['data'][$y]['application'] = 'hangup';
-			$this->destinations[$x]['result']['data'][$y]['destination'] = '';
-			$y++;
-			$this->destinations[$x]['result']['data'][$y]['label'] = 'record';
-			$this->destinations[$x]['result']['data'][$y]['name'] = '*732';
-			$this->destinations[$x]['result']['data'][$y]['destination'] = '*732 XML ${context}';
-			$y++;
-	}
-
-	/**
-	 * Called when there are no references to a particular object
-	 * unset the variables used in the class
-	 */
-	public function __destruct() {
-		foreach ($this as $key => $value) {
-			unset($this->$key);
-		}
-	}
-
-	/**
-	 * Get the destination menu
-	 * @var string $destination_type can be ivr, dialplan, call_center_contact or bridge
-	 * @var string $destination_name - current name
-	 * @var string $destination_value - current value
-	 */
-	public function select($destination_type, $destination_name, $destination_value) {
-
-		//remove special characters from the name
-			$destination_id = str_replace("]", "", $destination_name);
-			$destination_id = str_replace("[", "_", $destination_id);
-
-		//add additional
-			if (if_group("superadmin")) {
-				$response = "<script>\n";
-				$response .= "var Objs;\n";
-				$response .= "\n";
-				$response .= "function changeToInput".$destination_id."(obj){\n";
-				$response .= "	tb=document.createElement('INPUT');\n";
-				$response .= "	tb.type='text';\n";
-				$response .= "	tb.name=obj.name;\n";
-				$response .= "	tb.className='formfld';\n";
-				$response .= "	tb.setAttribute('id', '".$destination_id."');\n";
-				$response .= "	tb.setAttribute('style', '".$select_style."');\n";
-				if ($onchange != '') {
-					$response .= "	tb.setAttribute('onchange', \"".$onchange."\");\n";
-					$response .= "	tb.setAttribute('onkeyup', \"".$onchange."\");\n";
-				}
-				$response .= "	tb.value=obj.options[obj.selectedIndex].value;\n";
-				$response .= "	document.getElementById('btn_select_to_input_".$destination_id."').style.visibility = 'hidden';\n";
-				$response .= "	tbb=document.createElement('INPUT');\n";
-				$response .= "	tbb.setAttribute('class', 'btn');\n";
-				$response .= "	tbb.setAttribute('style', 'margin-left: 4px;');\n";
-				$response .= "	tbb.type='button';\n";
-				$response .= "	tbb.value=$('<div />').html('&#9665;').text();\n";
-				$response .= "	tbb.objs=[obj,tb,tbb];\n";
-				$response .= "	tbb.onclick=function(){ Replace".$destination_id."(this.objs); }\n";
-				$response .= "	obj.parentNode.insertBefore(tb,obj);\n";
-				$response .= "	obj.parentNode.insertBefore(tbb,obj);\n";
-				$response .= "	obj.parentNode.removeChild(obj);\n";
-				$response .= "	Replace".$destination_id."(this.objs);\n";
-				$response .= "}\n";
-				$response .= "\n";
-				$response .= "function Replace".$destination_id."(obj){\n";
-				$response .= "	obj[2].parentNode.insertBefore(obj[0],obj[2]);\n";
-				$response .= "	obj[0].parentNode.removeChild(obj[1]);\n";
-				$response .= "	obj[0].parentNode.removeChild(obj[2]);\n";
-				$response .= "	document.getElementById('btn_select_to_input_".$destination_id."').style.visibility = 'visible';\n";
-				if ($onchange != '') {
-					$response .= "	".$onchange.";\n";
-				}
-				$response .= "}\n";
-				$response .= "</script>\n";
-				$response .= "\n";
-			}
-
-			//set default to false
-			$select_found = false;
-
-			$response .= "	<select name='".$destination_name."' id='".$destination_id."' class='formfld' style='".$select_style."' onchange=\"".$onchange."\">\n";
-			$response .= "			<option value=''></option>\n";
-			foreach ($this->destinations as $row) {
-
-				$name = $row['name'];
-				$label = $row['label'];
-				$destination = $row['field']['destination'];
-
-				//add multi-lingual support
-				if (file_exists($_SERVER["PROJECT_ROOT"]."/app/".$name."/app_languages.php")) {
-					$language2 = new text;
-					$text2 = $language2->get($_SESSION['domain']['language']['code'], 'app/'.$name);
-				}
-
-				if (count($row['result']['data']) > 0 and strlen($row['select_value'][$destination_type]) > 0) {
-					$response .= "		<optgroup label='".$text2['title-'.$label]."'>\n";
-					$label2 = $label;
-					foreach ($row['result']['data'] as $data) {
-						$select_value = $row['select_value'][$destination_type];
-						$select_label = $row['select_label'];
-						foreach ($row['field'] as $key => $value) {
-							if ($key == 'destination' and is_array($value)){
-								if ($value['type'] == 'csv') {
-									$array = explode($value['delimiter'], $data[$key]);
-									$select_value = str_replace("\${destination}", $array[0], $select_value);
-									$select_label = str_replace("\${destination}", $array[0], $select_label);
-								}
-							}
-							else {
-								if (strpos($value,',') !== false) {
-									$keys = explode(",", $value);
-									foreach ($keys as $k) {
-										if (strlen($data[$k]) > 0) {
-											$select_value = str_replace("\${".$key."}", $data[$k], $select_value);
-											if (strlen($data['label']) == 0) {
-												$select_label = str_replace("\${".$key."}", $data[$k], $select_label);
-											}
-											else {
-												$label = $data['label'];
-												$select_label = str_replace("\${".$key."}", $text2['option-'.$label], $select_label);
-											}
-										}
-									}
-
-								}
-								else {
-									$select_value = str_replace("\${".$key."}", $data[$key], $select_value);
-									if (strlen($data['label']) == 0) {
-										$select_label = str_replace("\${".$key."}", $data[$key], $select_label);
-									}
-									else {
-										$label = $data['label'];
-										$select_label = str_replace("\${".$key."}", $text2['option-'.$label], $select_label);
-									}
-								}
-								//application: hangup
-								if (strlen($data['application']) > 0) {
-									$select_value = str_replace("transfer", $data['application'], $select_value);
-								}
-							}
-						}
-
-						$select_value = str_replace("\${domain_name}", $_SESSION['domain_name'], $select_value);
-						$select_value = str_replace("\${context}", $_SESSION['context'], $select_value); //to do: context can come from the array
-						$select_label = str_replace("\${domain_name}", $_SESSION['domain_name'], $select_label);
-						$select_label = str_replace("\${context}", $_SESSION['context'], $select_label);
-						$select_label = trim($select_label);
-						if ($select_value == $destination_value) { $selected = "selected='selected' "; $select_found = true; } else { $selected = ''; }
-						if ($label2 == 'destinations') { $select_label = format_phone($select_label); }
-						$response .= "			<option value='".$select_value."' ".$selected.">".$select_label."</option>\n";
-					}
-					$response .= "		</optgroup>\n";
-					unset($text);
-				}
-			}
-			if (!$select_found) {
-				$destination_label = str_replace(":", " ", $destination_value);
-				$destination_label = str_replace("menu-exec-app:", " ", $destination_label);
-				$response .= "			<option value='".$destination_value."' selected='selected'>".trim($destination_label)."</option>\n";
-			}
-			$response .= "	</select>\n";
-			if (if_group("superadmin")) {
-				$response .= "<input type='button' id='btn_select_to_input_".$destination_id."' class='btn' name='' alt='back' onclick='changeToInput".$destination_id."(document.getElementById(\"".$destination_id."\"));this.style.visibility = \"hidden\";' value='&#9665;'>";
-			}
-
-		//return the formatted destinations
-			return $response;
-	}
-}
-/*
-$obj = new destinations;
-//$destinations = $obj->destinations;
-echo $obj->select('ivr', 'example1', 'menu-exec-app:transfer 32 XML voip.fusionpbx.com');
-echo $obj->select('ivr', 'example2', '');
-echo $obj->select('ivr', 'example3', '');
-echo $obj->select('ivr', 'example4', '');
-echo $obj->select('ivr', 'example5', '');
-echo $obj->select('ivr', 'example6', '');
-*/
-
-?>
+<?php
+
+/**
+ * destinations
+ *
+ * @method get_array get the destinations
+ * @method select build the html select
+ */
+class destinations {
+
+	/**
+	 * destinations array
+	 */
+	public $destinations;
+
+	/**
+	 * Called when the object is created
+	 */
+	public function __construct() {
+		//set the global variables
+			global $db, $db_type;
+
+		//get the array from the app_config.php files
+			$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php");
+			$x = 0;
+			foreach ($config_list as &$config_path) {
+				include($config_path);
+				$x++;
+			}
+			$i = 0;
+			foreach ($apps as $x => &$app) {
+				if (isset($app['destinations'])) foreach ($app['destinations'] as &$row) {
+					$this->destinations[] = $row;
+				}
+			}
+
+		//put the array in order
+			foreach ($this->destinations as $row) {
+				$option_groups[] = $row['label'];
+			}
+			array_multisort($option_groups, SORT_ASC, $this->destinations);
+
+		//add the sql and data to the array
+			$x = 0;
+			foreach ($this->destinations as $row) {
+				if ($row['type'] = 'sql') {
+					if (isset($row['sql'])) {
+						if (is_array($row['sql'])) {
+							$sql = trim($row['sql'][$db_type])." ";
+						}
+						else {
+							$sql = trim($row['sql'])." ";
+						}
+					}
+					else {
+						$field_count = count($row['field']);
+						$fields = '';
+						$c = 1;
+						foreach ($row['field'] as $key => $value) {
+							if ($field_count != $c) { $delimiter = ','; } else { $delimiter = ''; }
+							$fields .= $value." as ".$key.$delimiter." ";
+							$c++;
+						}
+						$sql = "select ".$fields;
+						$sql .= " from v_".$row['name']." ";
+					}
+					if (isset($row['where'])) {
+						$sql .= trim($row['where'])." ";
+					}
+					$sql .= "order by ".trim($row['order_by']);
+					$sql = str_replace("\${domain_uuid}", $_SESSION['domain_uuid'], $sql);
+					$sql = trim($sql);
+					$statement = $db->prepare($sql);
+					$statement->execute();
+					$result = $statement->fetchAll(PDO::FETCH_NAMED);
+					unset($statement);
+
+					$this->destinations[$x]['result']['sql'] = $sql;
+					$this->destinations[$x]['result']['data'] = $result;
+				}
+				$x++;
+			}
+			$this->destinations[$x]['type'] = 'array';
+			$this->destinations[$x]['label'] = 'other';
+			$this->destinations[$x]['name'] = 'dialplan';
+			$this->destinations[$x]['field']['name'] = "name";
+			$this->destinations[$x]['field']['destination'] = "destination";
+			$this->destinations[$x]['select_value']['dialplan'] = "transfer:\${destination}";
+			$this->destinations[$x]['select_value']['ivr'] = "menu-exec-app:transfer \${destination}";
+			$this->destinations[$x]['select_label'] = "\${name}";
+			$y = 0;
+			$this->destinations[$x]['result']['data'][$y]['label'] = 'check_voicemail';
+			$this->destinations[$x]['result']['data'][$y]['name'] = '*98';
+			$this->destinations[$x]['result']['data'][$y]['destination'] = '*98 XML ${context}';
+			$y++;
+			$this->destinations[$x]['result']['data'][$y]['label'] = 'company_directory';
+			$this->destinations[$x]['result']['data'][$y]['name'] = '*411';
+			$this->destinations[$x]['result']['data'][$y]['destination'] = '*411 XML ${context}';
+			$y++;
+			$this->destinations[$x]['result']['data'][$y]['label'] = 'hangup';
+			$this->destinations[$x]['result']['data'][$y]['name'] = 'hangup';
+			$this->destinations[$x]['result']['data'][$y]['application'] = 'hangup';
+			$this->destinations[$x]['result']['data'][$y]['destination'] = '';
+			$y++;
+			$this->destinations[$x]['result']['data'][$y]['label'] = 'record';
+			$this->destinations[$x]['result']['data'][$y]['name'] = '*732';
+			$this->destinations[$x]['result']['data'][$y]['destination'] = '*732 XML ${context}';
+			$y++;
+	}
+
+	/**
+	 * Called when there are no references to a particular object
+	 * unset the variables used in the class
+	 */
+	public function __destruct() {
+		foreach ($this as $key => $value) {
+			unset($this->$key);
+		}
+	}
+
+	/**
+	 * Get the destination menu
+	 * @var string $destination_type can be ivr, dialplan, call_center_contact or bridge
+	 * @var string $destination_name - current name
+	 * @var string $destination_value - current value
+	 */
+	public function select($destination_type, $destination_name, $destination_value) {
+
+		//remove special characters from the name
+			$destination_id = str_replace("]", "", $destination_name);
+			$destination_id = str_replace("[", "_", $destination_id);
+
+		//add additional
+			if (if_group("superadmin")) {
+				$response = "<script>\n";
+				$response .= "var Objs;\n";
+				$response .= "\n";
+				$response .= "function changeToInput".$destination_id."(obj){\n";
+				$response .= "	tb=document.createElement('INPUT');\n";
+				$response .= "	tb.type='text';\n";
+				$response .= "	tb.name=obj.name;\n";
+				$response .= "	tb.className='formfld';\n";
+				$response .= "	tb.setAttribute('id', '".$destination_id."');\n";
+				$response .= "	tb.setAttribute('style', '".$select_style."');\n";
+				if ($onchange != '') {
+					$response .= "	tb.setAttribute('onchange', \"".$onchange."\");\n";
+					$response .= "	tb.setAttribute('onkeyup', \"".$onchange."\");\n";
+				}
+				$response .= "	tb.value=obj.options[obj.selectedIndex].value;\n";
+				$response .= "	document.getElementById('btn_select_to_input_".$destination_id."').style.visibility = 'hidden';\n";
+				$response .= "	tbb=document.createElement('INPUT');\n";
+				$response .= "	tbb.setAttribute('class', 'btn');\n";
+				$response .= "	tbb.setAttribute('style', 'margin-left: 4px;');\n";
+				$response .= "	tbb.type='button';\n";
+				$response .= "	tbb.value=$('<div />').html('&#9665;').text();\n";
+				$response .= "	tbb.objs=[obj,tb,tbb];\n";
+				$response .= "	tbb.onclick=function(){ Replace".$destination_id."(this.objs); }\n";
+				$response .= "	obj.parentNode.insertBefore(tb,obj);\n";
+				$response .= "	obj.parentNode.insertBefore(tbb,obj);\n";
+				$response .= "	obj.parentNode.removeChild(obj);\n";
+				$response .= "	Replace".$destination_id."(this.objs);\n";
+				$response .= "}\n";
+				$response .= "\n";
+				$response .= "function Replace".$destination_id."(obj){\n";
+				$response .= "	obj[2].parentNode.insertBefore(obj[0],obj[2]);\n";
+				$response .= "	obj[0].parentNode.removeChild(obj[1]);\n";
+				$response .= "	obj[0].parentNode.removeChild(obj[2]);\n";
+				$response .= "	document.getElementById('btn_select_to_input_".$destination_id."').style.visibility = 'visible';\n";
+				if ($onchange != '') {
+					$response .= "	".$onchange.";\n";
+				}
+				$response .= "}\n";
+				$response .= "</script>\n";
+				$response .= "\n";
+			}
+
+			//set default to false
+			$select_found = false;
+
+			$response .= "	<select name='".$destination_name."' id='".$destination_id."' class='formfld' style='".$select_style."' onchange=\"".$onchange."\">\n";
+			$response .= "			<option value=''></option>\n";
+			foreach ($this->destinations as $row) {
+
+				$name = $row['name'];
+				$label = $row['label'];
+				$destination = $row['field']['destination'];
+
+				//add multi-lingual support
+				if (file_exists($_SERVER["PROJECT_ROOT"]."/app/".$name."/app_languages.php")) {
+					$language2 = new text;
+					$text2 = $language2->get($_SESSION['domain']['language']['code'], 'app/'.$name);
+				}
+
+				if (count($row['result']['data']) > 0 and strlen($row['select_value'][$destination_type]) > 0) {
+					$response .= "		<optgroup label='".$text2['title-'.$label]."'>\n";
+					$label2 = $label;
+					foreach ($row['result']['data'] as $data) {
+						$select_value = $row['select_value'][$destination_type];
+						$select_label = $row['select_label'];
+						foreach ($row['field'] as $key => $value) {
+							if ($key == 'destination' and is_array($value)){
+								if ($value['type'] == 'csv') {
+									$array = explode($value['delimiter'], $data[$key]);
+									$select_value = str_replace("\${destination}", $array[0], $select_value);
+									$select_label = str_replace("\${destination}", $array[0], $select_label);
+								}
+							}
+							else {
+								if (strpos($value,',') !== false) {
+									$keys = explode(",", $value);
+									foreach ($keys as $k) {
+										if (strlen($data[$k]) > 0) {
+											$select_value = str_replace("\${".$key."}", $data[$k], $select_value);
+											if (strlen($data['label']) == 0) {
+												$select_label = str_replace("\${".$key."}", $data[$k], $select_label);
+											}
+											else {
+												$label = $data['label'];
+												$select_label = str_replace("\${".$key."}", $text2['option-'.$label], $select_label);
+											}
+										}
+									}
+
+								}
+								else {
+									$select_value = str_replace("\${".$key."}", $data[$key], $select_value);
+									if (strlen($data['label']) == 0) {
+										$select_label = str_replace("\${".$key."}", $data[$key], $select_label);
+									}
+									else {
+										$label = $data['label'];
+										$select_label = str_replace("\${".$key."}", $text2['option-'.$label], $select_label);
+									}
+								}
+								//application: hangup
+								if (strlen($data['application']) > 0) {
+									$select_value = str_replace("transfer", $data['application'], $select_value);
+								}
+							}
+						}
+
+						$select_value = str_replace("\${domain_name}", $_SESSION['domain_name'], $select_value);
+						$select_value = str_replace("\${context}", $_SESSION['context'], $select_value); //to do: context can come from the array
+						$select_label = str_replace("\${domain_name}", $_SESSION['domain_name'], $select_label);
+						$select_label = str_replace("\${context}", $_SESSION['context'], $select_label);
+						$select_label = trim($select_label);
+						if ($select_value == $destination_value) { $selected = "selected='selected' "; $select_found = true; } else { $selected = ''; }
+						if ($label2 == 'destinations') { $select_label = format_phone($select_label); }
+						$response .= "			<option value='".$select_value."' ".$selected.">".$select_label."</option>\n";
+					}
+					$response .= "		</optgroup>\n";
+					unset($text);
+				}
+			}
+			if (!$select_found) {
+				$destination_label = str_replace(":", " ", $destination_value);
+				$destination_label = str_replace("menu-exec-app:", " ", $destination_label);
+				$response .= "			<option value='".$destination_value."' selected='selected'>".trim($destination_label)."</option>\n";
+			}
+			$response .= "	</select>\n";
+			if (if_group("superadmin")) {
+				$response .= "<input type='button' id='btn_select_to_input_".$destination_id."' class='btn' name='' alt='back' onclick='changeToInput".$destination_id."(document.getElementById(\"".$destination_id."\"));this.style.visibility = \"hidden\";' value='&#9665;'>";
+			}
+
+		//return the formatted destinations
+			return $response;
+	}
+}
+/*
+$obj = new destinations;
+//$destinations = $obj->destinations;
+echo $obj->select('ivr', 'example1', 'menu-exec-app:transfer 32 XML voip.fusionpbx.com');
+echo $obj->select('ivr', 'example2', '');
+echo $obj->select('ivr', 'example3', '');
+echo $obj->select('ivr', 'example4', '');
+echo $obj->select('ivr', 'example5', '');
+echo $obj->select('ivr', 'example6', '');
+*/
+
+?>

+ 190 - 190
resources/classes/groups.php

@@ -1,191 +1,191 @@
-<?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) 2016
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-
-
-/**
- * groups class provides methods for add, delete groups, and add default groups
- *
- * @method string add
- * @method boolean delete
- * @method boolean defaults
- */
-if (!class_exists('groups')) {
-	class groups {
-
-		public $db;
-
-		/**
-		 * Called when the object is created
-		 */
-		public function __construct() {
-			//connect to the database if not connected
-			if (!$this->db) {
-				require_once "resources/classes/database.php";
-				$database = new database;
-				$database->connect();
-				$this->db = $database->db;
-			}
-		}
-
-		/**
-		 * Called when there are no references to a particular object
-		 * unset the variables used in the class
-		 */
-		public function __destruct() {
-			foreach ($this as $key => $value) {
-				unset($this->$key);
-			}
-		}
-
-		/**
-		 * add a group
-		 */
-		public function add() {
-			$id = uuid();
-			//return $id;
-			return false;
-		}
-
-		/**
-		 * delete a group
-		 */
-		public function delete($id) {
-			return false;
-		}
-
-		/**
-		 * add defaults groups
-		 */
-		public function defaults() {
-
-			//if the are no groups add the default groups
-				$sql = "SELECT * FROM v_groups ";
-				$sql .= "WHERE domain_uuid is null ";
-				$result = $this->db->query($sql)->fetch();
-				$prep_statement = $this->db->prepare(check_sql($sql));
-				if ($prep_statement) {
-					$prep_statement->execute();
-					$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
-					if (count($result) == 0) {
-						$x = 0;
-						$tmp[$x]['group_name'] = 'superadmin';
-						$tmp[$x]['group_description'] = 'Super Administrator Group';
-						$tmp[$x]['group_protected'] = 'false';
-						$x++;
-						$tmp[$x]['group_name'] = 'admin';
-						$tmp[$x]['group_description'] = 'Administrator Group';
-						$tmp[$x]['group_protected'] = 'false';
-						$x++;
-						$tmp[$x]['group_name'] = 'user';
-						$tmp[$x]['group_description'] = 'User Group';
-						$tmp[$x]['group_protected'] = 'false';
-						$x++;
-						$tmp[$x]['group_name'] = 'public';
-						$tmp[$x]['group_description'] = 'Public Group';
-						$tmp[$x]['group_protected'] = 'false';
-						$x++;
-						$tmp[$x]['group_name'] = 'agent';
-						$tmp[$x]['group_description'] = 'Call Center Agent Group';
-						$tmp[$x]['group_protected'] = 'false';
-						$this->db->beginTransaction();
-						foreach($tmp as $row) {
-							if (strlen($row['group_name']) > 0) {
-								$sql = "insert into v_groups ";
-								$sql .= "(";
-								$sql .= "domain_uuid, ";
-								$sql .= "group_uuid, ";
-								$sql .= "group_name, ";
-								$sql .= "group_description, ";
-								$sql .= "group_protected ";
-								$sql .= ")";
-								$sql .= "values ";
-								$sql .= "(";
-								$sql .= "null, ";
-								$sql .= "'".uuid()."', ";
-								$sql .= "'".$row['group_name']."', ";
-								$sql .= "'".$row['group_description']."', ";
-								$sql .= "'".$row['group_protected']."' ";
-								$sql .= ")";
-								$this->db->exec($sql);
-								unset($sql);
-							}
-						}
-						$this->db->commit();
-					}
-					unset($prep_statement, $result);
-				}
-
-			//if there are no permissions listed in v_group_permissions then set the default permissions
-				$sql = "select count(*) as count from v_group_permissions ";
-				$sql .= "where domain_uuid is null ";
-				$prep_statement = $this->db->prepare($sql);
-				$prep_statement->execute();
-				$result = $prep_statement->fetch(PDO::FETCH_ASSOC);
-				unset ($prep_statement);
-				if ($result['count'] == 0) {
-					//build the apps array
-						$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php");
-						$x = 0;
-						foreach ($config_list as &$config_path) {
-							include($config_path);
-							$x++;
-						}
-					//no permissions found add the defaults
-						$this->db->beginTransaction();
-						foreach($apps as $app) {
-							foreach ($app['permissions'] as $row) {
-								foreach ($row['groups'] as $group) {
-									//add the record
-									$sql = "insert into v_group_permissions ";
-									$sql .= "(";
-									$sql .= "group_permission_uuid, ";
-									$sql .= "domain_uuid, ";
-									$sql .= "permission_name, ";
-									$sql .= "group_name ";
-									$sql .= ")";
-									$sql .= "values ";
-									$sql .= "(";
-									$sql .= "'".uuid()."', ";
-									$sql .= "null, ";
-									$sql .= "'".$row['name']."', ";
-									$sql .= "'".$group."' ";
-									$sql .= ")";
-									$this->db->exec($sql);
-									unset($sql);
-								}
-							}
-						}
-						$this->db->commit();
-				}
-		}
-	} //end scripts class
-}
-/*
-//example use
-	$group = new groups;
-	$group->defaults();
-*/
+<?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) 2016
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
+
+
+/**
+ * groups class provides methods for add, delete groups, and add default groups
+ *
+ * @method string add
+ * @method boolean delete
+ * @method boolean defaults
+ */
+if (!class_exists('groups')) {
+	class groups {
+
+		public $db;
+
+		/**
+		 * Called when the object is created
+		 */
+		public function __construct() {
+			//connect to the database if not connected
+			if (!$this->db) {
+				require_once "resources/classes/database.php";
+				$database = new database;
+				$database->connect();
+				$this->db = $database->db;
+			}
+		}
+
+		/**
+		 * Called when there are no references to a particular object
+		 * unset the variables used in the class
+		 */
+		public function __destruct() {
+			foreach ($this as $key => $value) {
+				unset($this->$key);
+			}
+		}
+
+		/**
+		 * add a group
+		 */
+		public function add() {
+			$id = uuid();
+			//return $id;
+			return false;
+		}
+
+		/**
+		 * delete a group
+		 */
+		public function delete($id) {
+			return false;
+		}
+
+		/**
+		 * add defaults groups
+		 */
+		public function defaults() {
+
+			//if the are no groups add the default groups
+				$sql = "SELECT * FROM v_groups ";
+				$sql .= "WHERE domain_uuid is null ";
+				$result = $this->db->query($sql)->fetch();
+				$prep_statement = $this->db->prepare(check_sql($sql));
+				if ($prep_statement) {
+					$prep_statement->execute();
+					$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
+					if (count($result) == 0) {
+						$x = 0;
+						$tmp[$x]['group_name'] = 'superadmin';
+						$tmp[$x]['group_description'] = 'Super Administrator Group';
+						$tmp[$x]['group_protected'] = 'false';
+						$x++;
+						$tmp[$x]['group_name'] = 'admin';
+						$tmp[$x]['group_description'] = 'Administrator Group';
+						$tmp[$x]['group_protected'] = 'false';
+						$x++;
+						$tmp[$x]['group_name'] = 'user';
+						$tmp[$x]['group_description'] = 'User Group';
+						$tmp[$x]['group_protected'] = 'false';
+						$x++;
+						$tmp[$x]['group_name'] = 'public';
+						$tmp[$x]['group_description'] = 'Public Group';
+						$tmp[$x]['group_protected'] = 'false';
+						$x++;
+						$tmp[$x]['group_name'] = 'agent';
+						$tmp[$x]['group_description'] = 'Call Center Agent Group';
+						$tmp[$x]['group_protected'] = 'false';
+						$this->db->beginTransaction();
+						foreach($tmp as $row) {
+							if (strlen($row['group_name']) > 0) {
+								$sql = "insert into v_groups ";
+								$sql .= "(";
+								$sql .= "domain_uuid, ";
+								$sql .= "group_uuid, ";
+								$sql .= "group_name, ";
+								$sql .= "group_description, ";
+								$sql .= "group_protected ";
+								$sql .= ")";
+								$sql .= "values ";
+								$sql .= "(";
+								$sql .= "null, ";
+								$sql .= "'".uuid()."', ";
+								$sql .= "'".$row['group_name']."', ";
+								$sql .= "'".$row['group_description']."', ";
+								$sql .= "'".$row['group_protected']."' ";
+								$sql .= ")";
+								$this->db->exec($sql);
+								unset($sql);
+							}
+						}
+						$this->db->commit();
+					}
+					unset($prep_statement, $result);
+				}
+
+			//if there are no permissions listed in v_group_permissions then set the default permissions
+				$sql = "select count(*) as count from v_group_permissions ";
+				$sql .= "where domain_uuid is null ";
+				$prep_statement = $this->db->prepare($sql);
+				$prep_statement->execute();
+				$result = $prep_statement->fetch(PDO::FETCH_ASSOC);
+				unset ($prep_statement);
+				if ($result['count'] == 0) {
+					//build the apps array
+						$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php");
+						$x = 0;
+						foreach ($config_list as &$config_path) {
+							include($config_path);
+							$x++;
+						}
+					//no permissions found add the defaults
+						$this->db->beginTransaction();
+						foreach($apps as $app) {
+							foreach ($app['permissions'] as $row) {
+								foreach ($row['groups'] as $group) {
+									//add the record
+									$sql = "insert into v_group_permissions ";
+									$sql .= "(";
+									$sql .= "group_permission_uuid, ";
+									$sql .= "domain_uuid, ";
+									$sql .= "permission_name, ";
+									$sql .= "group_name ";
+									$sql .= ")";
+									$sql .= "values ";
+									$sql .= "(";
+									$sql .= "'".uuid()."', ";
+									$sql .= "null, ";
+									$sql .= "'".$row['name']."', ";
+									$sql .= "'".$group."' ";
+									$sql .= ")";
+									$this->db->exec($sql);
+									unset($sql);
+								}
+							}
+						}
+						$this->db->commit();
+				}
+		}
+	} //end scripts class
+}
+/*
+//example use
+	$group = new groups;
+	$group->defaults();
+*/
 ?>

+ 104 - 104
resources/classes/permissions.php

@@ -1,105 +1,105 @@
-<?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]>
-	Copyright (C) 2015	All Rights Reserved.
-
-*/
-
-/**
- * permission class
- *
- * @method string add
- * @method string delete
- * @method string exists
- */
-	if (!class_exists('permissions')) {
-		class permissions {
-
-				/**
-				 * Add a permission
-				 * @var string $permission
-				 */
-				public function add($permission, $type = '') {
-					if (!$this->exists($permission)) {
-						//set the ordinal number
-							$i = count($_SESSION["permissions"])+1;
-
-						//set the permission
-							$_SESSION["permissions"][$i]["permission_name"] = $permission;
-							$_SESSION["permissions"][$i]["permission_type"] = "temp";
-					}
-				}
-
-				/**
-				 * Remove the permission
-				 * @var string $permission
-				 */
-				public function delete($permission, $type = '') {
-					if ($this->exists($permission)) {
-						foreach($_SESSION["permissions"] as $key => $row) {
-							if ($row['permission_name'] == $permission) {
-								if ($row['permission_name'] == $permission) {
-									if ($type == 'temp') {
-										if ($row['permission_type'] == "temp") {
-											unset($_SESSION["permissions"][$key]);
-										}
-									}
-									else {
-										unset($_SESSION["permissions"][$key]);
-									}
-								}
-								break;
-							}
-						}
-					}
-				}
-
-				/**
-				 * Check to see if the permission exists
-				 * @var string $permission
-				 */
-				function exists($permission) {
-					//set default false
-						$result = false;
-					//search for the permission
-						if (count($_SESSION["permissions"]) > 0) {
-							foreach($_SESSION["permissions"] as $row) {
-								if ($row['permission_name'] == $permission) {
-									$result = true;
-									break;
-								}
-							}
-						}
-					//return the result
-						return $result;
-				}
-		}
-	}
-
-	//examples
-		/*
-		//add the permission
-			$p = new permissions;
-			$p->add($permission);
-		//delete the permission
-			$p = new permissions;
-			$p->delete($permission);
-		*/
-
+<?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]>
+	Copyright (C) 2015	All Rights Reserved.
+
+*/
+
+/**
+ * permission class
+ *
+ * @method string add
+ * @method string delete
+ * @method string exists
+ */
+	if (!class_exists('permissions')) {
+		class permissions {
+
+				/**
+				 * Add a permission
+				 * @var string $permission
+				 */
+				public function add($permission, $type = '') {
+					if (!$this->exists($permission)) {
+						//set the ordinal number
+							$i = count($_SESSION["permissions"])+1;
+
+						//set the permission
+							$_SESSION["permissions"][$i]["permission_name"] = $permission;
+							$_SESSION["permissions"][$i]["permission_type"] = "temp";
+					}
+				}
+
+				/**
+				 * Remove the permission
+				 * @var string $permission
+				 */
+				public function delete($permission, $type = '') {
+					if ($this->exists($permission)) {
+						foreach($_SESSION["permissions"] as $key => $row) {
+							if ($row['permission_name'] == $permission) {
+								if ($row['permission_name'] == $permission) {
+									if ($type == 'temp') {
+										if ($row['permission_type'] == "temp") {
+											unset($_SESSION["permissions"][$key]);
+										}
+									}
+									else {
+										unset($_SESSION["permissions"][$key]);
+									}
+								}
+								break;
+							}
+						}
+					}
+				}
+
+				/**
+				 * Check to see if the permission exists
+				 * @var string $permission
+				 */
+				function exists($permission) {
+					//set default false
+						$result = false;
+					//search for the permission
+						if (count($_SESSION["permissions"]) > 0) {
+							foreach($_SESSION["permissions"] as $row) {
+								if ($row['permission_name'] == $permission) {
+									$result = true;
+									break;
+								}
+							}
+						}
+					//return the result
+						return $result;
+				}
+		}
+	}
+
+	//examples
+		/*
+		//add the permission
+			$p = new permissions;
+			$p->add($permission);
+		//delete the permission
+			$p = new permissions;
+			$p->delete($permission);
+		*/
+
 ?>

+ 286 - 286
resources/classes/switch_settings.php

@@ -1,286 +1,286 @@
-<?php
-
-/**
- * switch_settings class provides access methods related to FreeSWITCH
- *
- * @method settings will add missing switch directories to default settings
- */
-if (!class_exists('switch_settings')) {
-	class switch_settings {
-
-		public $db;
-		public $event_socket_ip_address;
-		public $event_socket_port;
-		public $event_socket_password;
-
-		/**
-		 * Called when the object is created
-		 */
-		public function __construct() {
-			//connect to the database if not connected
-			if (!$this->db) {
-				require_once "resources/classes/database.php";
-				$database = new database;
-				$database->connect();
-				$this->db = $database->db;
-			}
-		}
-
-		/**
-		 * Called when there are no references to a particular object
-		 * unset the variables used in the class
-		 */
-		public function __destruct() {
-			foreach ($this as $key => $value) {
-				unset($this->$key);
-			}
-		}
-
-		/**
-		 * settings Set switch directories in default settings
-		 */
-		public function settings() {
-
-			//define the variables
-				if (!isset($this->event_socket_ip_address)) {
-					if (strlen($_SESSION['event_socket_ip_address']) > 0) {
-						$this->event_socket_ip_address = $_SESSION['event_socket_ip_address'];
-					}
-					else {
-						$this->event_socket_ip_address = '127.0.0.1';
-					}
-				}
-				if (!isset($this->event_socket_port)) {
-					if (strlen($_SESSION['event_socket_ip_address']) > 0) {
-						$this->event_socket_port = $_SESSION['event_socket_port'];
-					}
-					else {
-						$this->event_socket_port = '8021';
-					}
-				}
-				if (!isset($this->event_socket_password)) {
-					if (strlen($_SESSION['event_socket_ip_address']) > 0) {
-						$this->event_socket_password = $_SESSION['event_socket_password'];
-					}
-					else {
-						$this->event_socket_password = 'ClueCon';
-					}
-				}
-
-				{ 	//connect to event socket
-					$esl = new event_socket;
-					$esl->connect($this->event_socket_ip_address, $this->event_socket_port, $this->event_socket_password);
-
-					//run the api command
-					$result = $esl->request('api global_getvar');
-				}	//close event socket
-
-
-			//set the result as a named array
-				$vars = array();
-				foreach (explode("\n", $result) as $row) {
-					$a = explode("=", $row);
-					if (substr($a[0], -4) == "_dir") {
-						$vars[$a[0]] = $a[1];
-					}
-				}
-
-			//set the bin directory
-				if ($vars['base_dir'] == "/usr/local/freeswitch") {
-					$bin = "/usr/local/freeswitch/bin"; 
-				} else {
-					$bin = "";
-				}
-
-			//create the default settings array
-				$x=0;
-				$array[$x]['default_setting_category'] = 'switch';
-				$array[$x]['default_setting_subcategory'] = 'bin';
-				$array[$x]['default_setting_name'] = 'dir';
-				$array[$x]['default_setting_value'] = $bin;
-				$array[$x]['default_setting_enabled'] = 'true';
-				$array[$x]['default_setting_description'] = '';
-				$x++;
-				$array[$x]['default_setting_category'] = 'switch';
-				$array[$x]['default_setting_subcategory'] = 'base';
-				$array[$x]['default_setting_name'] = 'dir';
-				$array[$x]['default_setting_value'] = $vars['base_dir'];
-				$array[$x]['default_setting_enabled'] = 'true';
-				$array[$x]['default_setting_description'] = '';
-				$x++;
-				$array[$x]['default_setting_category'] = 'switch';
-				$array[$x]['default_setting_subcategory'] = 'call_center';
-				$array[$x]['default_setting_name'] = 'dir';
-				$array[$x]['default_setting_value'] = $vars['conf_dir'].'/autoload_configs';
-				$array[$x]['default_setting_enabled'] = 'false';
-				$array[$x]['default_setting_description'] = '';
-				$x++;
-				$array[$x]['default_setting_category'] = 'switch';
-				$array[$x]['default_setting_subcategory'] = 'conf';
-				$array[$x]['default_setting_name'] = 'dir';
-				$array[$x]['default_setting_value'] = $vars['conf_dir'];
-				$array[$x]['default_setting_enabled'] = 'true';
-				$array[$x]['default_setting_description'] = '';
-				$x++;
-				$array[$x]['default_setting_category'] = 'switch';
-				$array[$x]['default_setting_subcategory'] = 'db';
-				$array[$x]['default_setting_name'] = 'dir';
-				$array[$x]['default_setting_value'] = $vars['db_dir'];
-				$array[$x]['default_setting_enabled'] = 'true';
-				$array[$x]['default_setting_description'] = '';
-				$x++;
-				$array[$x]['default_setting_category'] = 'switch';
-				$array[$x]['default_setting_subcategory'] = 'dialplan';
-				$array[$x]['default_setting_name'] = 'dir';
-				$array[$x]['default_setting_value'] = $vars['conf_dir'].'/dialplan';
-				$array[$x]['default_setting_enabled'] = 'false';
-				$array[$x]['default_setting_description'] = '';
-				$x++;
-				$array[$x]['default_setting_category'] = 'switch';
-				$array[$x]['default_setting_subcategory'] = 'extensions';
-				$array[$x]['default_setting_name'] = 'dir';
-				$array[$x]['default_setting_value'] = $vars['conf_dir'].'/directory';
-				$array[$x]['default_setting_enabled'] = 'false';
-				$array[$x]['default_setting_description'] = '';
-				$x++;
-				$array[$x]['default_setting_category'] = 'switch';
-				$array[$x]['default_setting_subcategory'] = 'grammar';
-				$array[$x]['default_setting_name'] = 'dir';
-				$array[$x]['default_setting_value'] = $vars['grammar_dir'];
-				$array[$x]['default_setting_enabled'] = 'true';
-				$array[$x]['default_setting_description'] = '';
-				$x++;
-				$array[$x]['default_setting_category'] = 'switch';
-				$array[$x]['default_setting_subcategory'] = 'log';
-				$array[$x]['default_setting_name'] = 'dir';
-				$array[$x]['default_setting_value'] = $vars['log_dir'];
-				$array[$x]['default_setting_enabled'] = 'true';
-				$array[$x]['default_setting_description'] = '';
-				$x++;
-				$array[$x]['default_setting_category'] = 'switch';
-				$array[$x]['default_setting_subcategory'] = 'mod';
-				$array[$x]['default_setting_name'] = 'dir';
-				$array[$x]['default_setting_value'] = $vars['mod_dir'];
-				$array[$x]['default_setting_enabled'] = 'true';
-				$array[$x]['default_setting_description'] = '';
-				$x++;
-				$array[$x]['default_setting_category'] = 'switch';
-				$array[$x]['default_setting_subcategory'] = 'phrases';
-				$array[$x]['default_setting_name'] = 'dir';
-				$array[$x]['default_setting_value'] = $vars['conf_dir'].'/lang';
-				$array[$x]['default_setting_enabled'] = 'false';
-				$array[$x]['default_setting_description'] = '';
-				$x++;
-				$array[$x]['default_setting_category'] = 'switch';
-				$array[$x]['default_setting_subcategory'] = 'recordings';
-				$array[$x]['default_setting_name'] = 'dir';
-				$array[$x]['default_setting_value'] = $vars['recordings_dir'];
-				$array[$x]['default_setting_enabled'] = 'true';
-				$array[$x]['default_setting_description'] = '';
-				$x++;
-				$array[$x]['default_setting_category'] = 'switch';
-				$array[$x]['default_setting_subcategory'] = 'scripts';
-				$array[$x]['default_setting_name'] = 'dir';
-				$array[$x]['default_setting_value'] = $vars['script_dir'];
-				$array[$x]['default_setting_enabled'] = 'true';
-				$array[$x]['default_setting_description'] = '';
-				$x++;
-				$array[$x]['default_setting_category'] = 'switch';
-				$array[$x]['default_setting_subcategory'] = 'sip_profiles';
-				$array[$x]['default_setting_name'] = 'dir';
-				$array[$x]['default_setting_value'] = $vars['conf_dir'].'/sip_profiles';
-				$array[$x]['default_setting_enabled'] = 'false';
-				$array[$x]['default_setting_description'] = '';
-				$x++;
-				$array[$x]['default_setting_category'] = 'switch';
-				$array[$x]['default_setting_subcategory'] = 'sounds';
-				$array[$x]['default_setting_name'] = 'dir';
-				$array[$x]['default_setting_value'] = $vars['sounds_dir'];
-				$array[$x]['default_setting_enabled'] = 'true';
-				$array[$x]['default_setting_description'] = '';
-				$x++;
-				$array[$x]['default_setting_category'] = 'switch';
-				$array[$x]['default_setting_subcategory'] = 'storage';
-				$array[$x]['default_setting_name'] = 'dir';
-				$array[$x]['default_setting_value'] = $vars['storage_dir'];
-				$array[$x]['default_setting_enabled'] = 'true';
-				$array[$x]['default_setting_description'] = '';
-				$x++;
-				$array[$x]['default_setting_category'] = 'switch';
-				$array[$x]['default_setting_subcategory'] = 'voicemail';
-				$array[$x]['default_setting_name'] = 'dir';
-				$array[$x]['default_setting_value'] = $vars['storage_dir'].'/voicemail';
-				$array[$x]['default_setting_enabled'] = 'true';
-				$array[$x]['default_setting_description'] = '';
-				$x++;
-
-			//get an array of the default settings
-				$sql = "select * from v_default_settings ";
-				$sql .= "where default_setting_category = 'switch' ";
-				$prep_statement = $this->db->prepare($sql);
-				$prep_statement->execute();
-				$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-				unset ($prep_statement, $sql);
-
-			//find the missing default settings
-				$x = 0;
-				foreach ($array as $setting) {
-					$found = false;
-					$missing[$x] = $setting;
-					foreach ($default_settings as $row) {
-						if (trim($row['default_setting_subcategory']) == trim($setting['default_setting_subcategory'])) {
-							$found = true;
-							//remove items from the array that were found
-							unset($missing[$x]);
-						}
-					}
-					$x++;
-				}
-
-			//add the missing default settings
-				if (is_array($missing)) {
-					$sql = "insert into v_default_settings (";
-					$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 .= ") values \n";
-					$i = 1;
-					foreach ($missing as $row) {
-						$sql .= "(";
-						$sql .= "'".uuid()."', ";
-						$sql .= "'".check_str($row['default_setting_category'])."', ";
-						$sql .= "'".check_str($row['default_setting_subcategory'])."', ";
-						$sql .= "'".check_str($row['default_setting_name'])."', ";
-						$sql .= "'".check_str($row['default_setting_value'])."', ";
-						$sql .= "'".check_str($row['default_setting_enabled'])."', ";
-						$sql .= "'".check_str($row['default_setting_description'])."' ";
-						$sql .= ")";
-						if (sizeof($missing) != $i) { 
-							$sql .= ",\n";
-						}
-						$i++;
-					}
-					$this->db->exec(check_sql($sql));
-					unset($missing);
-				}
-
-			//set the default settings
-				foreach ($array as $row) {
-					if (!isset($_SESSION['switch'][$row['default_setting_subcategory']])) {
-						if ($row['default_setting_enabled'] != "false") {
-							$_SESSION['switch'][$row['default_setting_subcategory']] = $row['default_setting_value'];
-						}
-					}
-				}
-
-			//unset the array variable
-				unset($array);
-		}
-	}
-}
-
-?>
+<?php
+
+/**
+ * switch_settings class provides access methods related to FreeSWITCH
+ *
+ * @method settings will add missing switch directories to default settings
+ */
+if (!class_exists('switch_settings')) {
+	class switch_settings {
+
+		public $db;
+		public $event_socket_ip_address;
+		public $event_socket_port;
+		public $event_socket_password;
+
+		/**
+		 * Called when the object is created
+		 */
+		public function __construct() {
+			//connect to the database if not connected
+			if (!$this->db) {
+				require_once "resources/classes/database.php";
+				$database = new database;
+				$database->connect();
+				$this->db = $database->db;
+			}
+		}
+
+		/**
+		 * Called when there are no references to a particular object
+		 * unset the variables used in the class
+		 */
+		public function __destruct() {
+			foreach ($this as $key => $value) {
+				unset($this->$key);
+			}
+		}
+
+		/**
+		 * settings Set switch directories in default settings
+		 */
+		public function settings() {
+
+			//define the variables
+				if (!isset($this->event_socket_ip_address)) {
+					if (strlen($_SESSION['event_socket_ip_address']) > 0) {
+						$this->event_socket_ip_address = $_SESSION['event_socket_ip_address'];
+					}
+					else {
+						$this->event_socket_ip_address = '127.0.0.1';
+					}
+				}
+				if (!isset($this->event_socket_port)) {
+					if (strlen($_SESSION['event_socket_ip_address']) > 0) {
+						$this->event_socket_port = $_SESSION['event_socket_port'];
+					}
+					else {
+						$this->event_socket_port = '8021';
+					}
+				}
+				if (!isset($this->event_socket_password)) {
+					if (strlen($_SESSION['event_socket_ip_address']) > 0) {
+						$this->event_socket_password = $_SESSION['event_socket_password'];
+					}
+					else {
+						$this->event_socket_password = 'ClueCon';
+					}
+				}
+
+				{ 	//connect to event socket
+					$esl = new event_socket;
+					$esl->connect($this->event_socket_ip_address, $this->event_socket_port, $this->event_socket_password);
+
+					//run the api command
+					$result = $esl->request('api global_getvar');
+				}	//close event socket
+
+
+			//set the result as a named array
+				$vars = array();
+				foreach (explode("\n", $result) as $row) {
+					$a = explode("=", $row);
+					if (substr($a[0], -4) == "_dir") {
+						$vars[$a[0]] = $a[1];
+					}
+				}
+
+			//set the bin directory
+				if ($vars['base_dir'] == "/usr/local/freeswitch") {
+					$bin = "/usr/local/freeswitch/bin"; 
+				} else {
+					$bin = "";
+				}
+
+			//create the default settings array
+				$x=0;
+				$array[$x]['default_setting_category'] = 'switch';
+				$array[$x]['default_setting_subcategory'] = 'bin';
+				$array[$x]['default_setting_name'] = 'dir';
+				$array[$x]['default_setting_value'] = $bin;
+				$array[$x]['default_setting_enabled'] = 'true';
+				$array[$x]['default_setting_description'] = '';
+				$x++;
+				$array[$x]['default_setting_category'] = 'switch';
+				$array[$x]['default_setting_subcategory'] = 'base';
+				$array[$x]['default_setting_name'] = 'dir';
+				$array[$x]['default_setting_value'] = $vars['base_dir'];
+				$array[$x]['default_setting_enabled'] = 'true';
+				$array[$x]['default_setting_description'] = '';
+				$x++;
+				$array[$x]['default_setting_category'] = 'switch';
+				$array[$x]['default_setting_subcategory'] = 'call_center';
+				$array[$x]['default_setting_name'] = 'dir';
+				$array[$x]['default_setting_value'] = $vars['conf_dir'].'/autoload_configs';
+				$array[$x]['default_setting_enabled'] = 'false';
+				$array[$x]['default_setting_description'] = '';
+				$x++;
+				$array[$x]['default_setting_category'] = 'switch';
+				$array[$x]['default_setting_subcategory'] = 'conf';
+				$array[$x]['default_setting_name'] = 'dir';
+				$array[$x]['default_setting_value'] = $vars['conf_dir'];
+				$array[$x]['default_setting_enabled'] = 'true';
+				$array[$x]['default_setting_description'] = '';
+				$x++;
+				$array[$x]['default_setting_category'] = 'switch';
+				$array[$x]['default_setting_subcategory'] = 'db';
+				$array[$x]['default_setting_name'] = 'dir';
+				$array[$x]['default_setting_value'] = $vars['db_dir'];
+				$array[$x]['default_setting_enabled'] = 'true';
+				$array[$x]['default_setting_description'] = '';
+				$x++;
+				$array[$x]['default_setting_category'] = 'switch';
+				$array[$x]['default_setting_subcategory'] = 'dialplan';
+				$array[$x]['default_setting_name'] = 'dir';
+				$array[$x]['default_setting_value'] = $vars['conf_dir'].'/dialplan';
+				$array[$x]['default_setting_enabled'] = 'false';
+				$array[$x]['default_setting_description'] = '';
+				$x++;
+				$array[$x]['default_setting_category'] = 'switch';
+				$array[$x]['default_setting_subcategory'] = 'extensions';
+				$array[$x]['default_setting_name'] = 'dir';
+				$array[$x]['default_setting_value'] = $vars['conf_dir'].'/directory';
+				$array[$x]['default_setting_enabled'] = 'false';
+				$array[$x]['default_setting_description'] = '';
+				$x++;
+				$array[$x]['default_setting_category'] = 'switch';
+				$array[$x]['default_setting_subcategory'] = 'grammar';
+				$array[$x]['default_setting_name'] = 'dir';
+				$array[$x]['default_setting_value'] = $vars['grammar_dir'];
+				$array[$x]['default_setting_enabled'] = 'true';
+				$array[$x]['default_setting_description'] = '';
+				$x++;
+				$array[$x]['default_setting_category'] = 'switch';
+				$array[$x]['default_setting_subcategory'] = 'log';
+				$array[$x]['default_setting_name'] = 'dir';
+				$array[$x]['default_setting_value'] = $vars['log_dir'];
+				$array[$x]['default_setting_enabled'] = 'true';
+				$array[$x]['default_setting_description'] = '';
+				$x++;
+				$array[$x]['default_setting_category'] = 'switch';
+				$array[$x]['default_setting_subcategory'] = 'mod';
+				$array[$x]['default_setting_name'] = 'dir';
+				$array[$x]['default_setting_value'] = $vars['mod_dir'];
+				$array[$x]['default_setting_enabled'] = 'true';
+				$array[$x]['default_setting_description'] = '';
+				$x++;
+				$array[$x]['default_setting_category'] = 'switch';
+				$array[$x]['default_setting_subcategory'] = 'phrases';
+				$array[$x]['default_setting_name'] = 'dir';
+				$array[$x]['default_setting_value'] = $vars['conf_dir'].'/lang';
+				$array[$x]['default_setting_enabled'] = 'false';
+				$array[$x]['default_setting_description'] = '';
+				$x++;
+				$array[$x]['default_setting_category'] = 'switch';
+				$array[$x]['default_setting_subcategory'] = 'recordings';
+				$array[$x]['default_setting_name'] = 'dir';
+				$array[$x]['default_setting_value'] = $vars['recordings_dir'];
+				$array[$x]['default_setting_enabled'] = 'true';
+				$array[$x]['default_setting_description'] = '';
+				$x++;
+				$array[$x]['default_setting_category'] = 'switch';
+				$array[$x]['default_setting_subcategory'] = 'scripts';
+				$array[$x]['default_setting_name'] = 'dir';
+				$array[$x]['default_setting_value'] = $vars['script_dir'];
+				$array[$x]['default_setting_enabled'] = 'true';
+				$array[$x]['default_setting_description'] = '';
+				$x++;
+				$array[$x]['default_setting_category'] = 'switch';
+				$array[$x]['default_setting_subcategory'] = 'sip_profiles';
+				$array[$x]['default_setting_name'] = 'dir';
+				$array[$x]['default_setting_value'] = $vars['conf_dir'].'/sip_profiles';
+				$array[$x]['default_setting_enabled'] = 'false';
+				$array[$x]['default_setting_description'] = '';
+				$x++;
+				$array[$x]['default_setting_category'] = 'switch';
+				$array[$x]['default_setting_subcategory'] = 'sounds';
+				$array[$x]['default_setting_name'] = 'dir';
+				$array[$x]['default_setting_value'] = $vars['sounds_dir'];
+				$array[$x]['default_setting_enabled'] = 'true';
+				$array[$x]['default_setting_description'] = '';
+				$x++;
+				$array[$x]['default_setting_category'] = 'switch';
+				$array[$x]['default_setting_subcategory'] = 'storage';
+				$array[$x]['default_setting_name'] = 'dir';
+				$array[$x]['default_setting_value'] = $vars['storage_dir'];
+				$array[$x]['default_setting_enabled'] = 'true';
+				$array[$x]['default_setting_description'] = '';
+				$x++;
+				$array[$x]['default_setting_category'] = 'switch';
+				$array[$x]['default_setting_subcategory'] = 'voicemail';
+				$array[$x]['default_setting_name'] = 'dir';
+				$array[$x]['default_setting_value'] = $vars['storage_dir'].'/voicemail';
+				$array[$x]['default_setting_enabled'] = 'true';
+				$array[$x]['default_setting_description'] = '';
+				$x++;
+
+			//get an array of the default settings
+				$sql = "select * from v_default_settings ";
+				$sql .= "where default_setting_category = 'switch' ";
+				$prep_statement = $this->db->prepare($sql);
+				$prep_statement->execute();
+				$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+				unset ($prep_statement, $sql);
+
+			//find the missing default settings
+				$x = 0;
+				foreach ($array as $setting) {
+					$found = false;
+					$missing[$x] = $setting;
+					foreach ($default_settings as $row) {
+						if (trim($row['default_setting_subcategory']) == trim($setting['default_setting_subcategory'])) {
+							$found = true;
+							//remove items from the array that were found
+							unset($missing[$x]);
+						}
+					}
+					$x++;
+				}
+
+			//add the missing default settings
+				if (is_array($missing)) {
+					$sql = "insert into v_default_settings (";
+					$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 .= ") values \n";
+					$i = 1;
+					foreach ($missing as $row) {
+						$sql .= "(";
+						$sql .= "'".uuid()."', ";
+						$sql .= "'".check_str($row['default_setting_category'])."', ";
+						$sql .= "'".check_str($row['default_setting_subcategory'])."', ";
+						$sql .= "'".check_str($row['default_setting_name'])."', ";
+						$sql .= "'".check_str($row['default_setting_value'])."', ";
+						$sql .= "'".check_str($row['default_setting_enabled'])."', ";
+						$sql .= "'".check_str($row['default_setting_description'])."' ";
+						$sql .= ")";
+						if (sizeof($missing) != $i) { 
+							$sql .= ",\n";
+						}
+						$i++;
+					}
+					$this->db->exec(check_sql($sql));
+					unset($missing);
+				}
+
+			//set the default settings
+				foreach ($array as $row) {
+					if (!isset($_SESSION['switch'][$row['default_setting_subcategory']])) {
+						if ($row['default_setting_enabled'] != "false") {
+							$_SESSION['switch'][$row['default_setting_subcategory']] = $row['default_setting_value'];
+						}
+					}
+				}
+
+			//unset the array variable
+				unset($array);
+		}
+	}
+}
+
+?>

+ 101 - 101
resources/classes/template.php

@@ -1,101 +1,101 @@
-<?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]>
-	Copyright (C) 2013
-	All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-
-//define the template class
-	if (!class_exists('template')) {
-		class template {
-
-			public $engine;
-			public $template_dir;
-			public $cache_dir;
-			private $object;
-			private $var_array;
-
-			public function __construct(){
-			}
-
-			public function init() {
-				if ($this->engine === 'smarty') {
-					require_once "resources/templates/engine/smarty/Smarty.class.php";
-					$this->object = new Smarty();
-					$this->object->setTemplateDir($this->template_dir);
-					$this->object->setCompileDir($this->cache_dir);
-					$this->object->setCacheDir($this->cache_dir);
-				}
-				if ($this->engine === 'raintpl') {
-					require_once "resources/templates/engine/raintpl/rain.tpl.class.php";
-					$this->object = new RainTPL();
-					RainTPL::configure('tpl_dir', realpath($this->template_dir)."/");
-					RainTPL::configure('cache_dir', realpath($this->cache_dir)."/");
-				}
-				if ($this->engine === 'twig') {
-					require_once "resources/templates/engine/Twig/Autoloader.php";
-					Twig_Autoloader::register();
-					$loader = new Twig_Loader_Filesystem($this->template_dir);
-					$this->object = new Twig_Environment($loader);
-					$lexer = new Twig_Lexer($this->object, array(
-						'tag_comment'  => array('{*', '*}'),
-						'tag_block'    => array('{', '}'),
-						'tag_variable' => array('{$', '}'),
-					));
-					$this->object->setLexer($lexer);
-				}
-			}
-
-			public function __destruct() {
-				foreach ($this as $key => $value) {
-					unset($this->$key);
-				}
-			}
-
-			public function assign($key, $value) {
-				if ($this->engine === 'smarty') {
-					$this->object->assign($key, $value);
-				}
-				if ($this->engine === 'raintpl') {
-					$this->object->assign($key, $value);
-				}
-				if ($this->engine === 'twig') {
-					$this->var_array[$key] = $value;
-				}
-			}
-
-			public function render($name) {
-				if ($this->engine === 'smarty') {
-					return $this->object->fetch($name);
-				}
-				if ($this->engine === 'raintpl') {
-					return $this->object-> draw($name, 'return_string=true');
-				}
-				if ($this->engine === 'twig') {
-					return $this->object->render($name,$this->var_array);
-				}
-			}
-		}
-	}
-
-?>
+<?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]>
+	Copyright (C) 2013
+	All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
+include "root.php";
+
+//define the template class
+	if (!class_exists('template')) {
+		class template {
+
+			public $engine;
+			public $template_dir;
+			public $cache_dir;
+			private $object;
+			private $var_array;
+
+			public function __construct(){
+			}
+
+			public function init() {
+				if ($this->engine === 'smarty') {
+					require_once "resources/templates/engine/smarty/Smarty.class.php";
+					$this->object = new Smarty();
+					$this->object->setTemplateDir($this->template_dir);
+					$this->object->setCompileDir($this->cache_dir);
+					$this->object->setCacheDir($this->cache_dir);
+				}
+				if ($this->engine === 'raintpl') {
+					require_once "resources/templates/engine/raintpl/rain.tpl.class.php";
+					$this->object = new RainTPL();
+					RainTPL::configure('tpl_dir', realpath($this->template_dir)."/");
+					RainTPL::configure('cache_dir', realpath($this->cache_dir)."/");
+				}
+				if ($this->engine === 'twig') {
+					require_once "resources/templates/engine/Twig/Autoloader.php";
+					Twig_Autoloader::register();
+					$loader = new Twig_Loader_Filesystem($this->template_dir);
+					$this->object = new Twig_Environment($loader);
+					$lexer = new Twig_Lexer($this->object, array(
+						'tag_comment'  => array('{*', '*}'),
+						'tag_block'    => array('{', '}'),
+						'tag_variable' => array('{$', '}'),
+					));
+					$this->object->setLexer($lexer);
+				}
+			}
+
+			public function __destruct() {
+				foreach ($this as $key => $value) {
+					unset($this->$key);
+				}
+			}
+
+			public function assign($key, $value) {
+				if ($this->engine === 'smarty') {
+					$this->object->assign($key, $value);
+				}
+				if ($this->engine === 'raintpl') {
+					$this->object->assign($key, $value);
+				}
+				if ($this->engine === 'twig') {
+					$this->var_array[$key] = $value;
+				}
+			}
+
+			public function render($name) {
+				if ($this->engine === 'smarty') {
+					return $this->object->fetch($name);
+				}
+				if ($this->engine === 'raintpl') {
+					return $this->object-> draw($name, 'return_string=true');
+				}
+				if ($this->engine === 'twig') {
+					return $this->object->render($name,$this->var_array);
+				}
+			}
+		}
+	}
+
+?>

+ 82 - 82
resources/classes/text.php

@@ -1,83 +1,83 @@
-<?php
-/**
- * Get the text for the correct translation
- *
- * @method array get
- */
-class text {
-
-	/**
-	 * Called when the object is created
-	 */
-	public function __construct() {
-		//place holder
-	}
-
-	/**
-	 * Called when there are no references to a particular object
-	 * unset the variables used in the class
-	 */
-	public function __destruct() {
-		foreach ($this as $key => $value) {
-			unset($this->$key);
-		}
-	}
-
-	/**
-	 * Get a specific item from the cache
-	 * @var string $language_code	examples: en-us, es-cl, fr-fr, pt-pt
-	 * @var string $app_path		examples: app/exec or core/domains
-	 */
-	public function get($language_code = null, $app_path = null, $exclude_global = false) {
-		//get the global app_languages.php
-			if (!$exclude_global){
-				include $_SERVER["PROJECT_ROOT"]."/resources/app_languages.php";
-			}
-
-		//get the app_languages.php
-			if ($app_path != null) {
-				$lang_path = $_SERVER["PROJECT_ROOT"]."/".$app_path."/app_languages.php";
-			}
-			else {
-				$lang_path = getcwd().'/app_languages.php';
-			}
-			if(file_exists($lang_path)){
-				require $lang_path;
-			}
-
-		//get the available languages
-			krsort($text);
-			foreach ($text as $lang_label => $lang_codes) {
-				foreach ($lang_codes as $lang_code => $lang_text) {
-					if ($lang_text != '') {
-						$app_languages[] = $lang_code;
-					}
-				}
-			}
-			$_SESSION['app']['languages'] = array_unique($app_languages);
-
-		//check the session language
-			if (isset($_SESSION['domain']) and $language_code == null){
-				$language_code = $_SESSION['domain']['language']['code'];
-			} elseif ($language_code == null){
-				$language_code = 'en-us';
-			}
-
-		//reduce to specific language
-			if ($language_code != 'all') {
-				foreach ($text as $key => $value) {
-					if (strlen($value[$language_code]) > 0) {
-						$text[$key] = $value[$language_code];
-					} else {
-						//fallback to en-us
-						$text[$key] = $value['en-us'];
-					}
-				}
-			}
-
-		//return the array of translations
-			return $text;
-	}
-}
-
+<?php
+/**
+ * Get the text for the correct translation
+ *
+ * @method array get
+ */
+class text {
+
+	/**
+	 * Called when the object is created
+	 */
+	public function __construct() {
+		//place holder
+	}
+
+	/**
+	 * Called when there are no references to a particular object
+	 * unset the variables used in the class
+	 */
+	public function __destruct() {
+		foreach ($this as $key => $value) {
+			unset($this->$key);
+		}
+	}
+
+	/**
+	 * Get a specific item from the cache
+	 * @var string $language_code	examples: en-us, es-cl, fr-fr, pt-pt
+	 * @var string $app_path		examples: app/exec or core/domains
+	 */
+	public function get($language_code = null, $app_path = null, $exclude_global = false) {
+		//get the global app_languages.php
+			if (!$exclude_global){
+				include $_SERVER["PROJECT_ROOT"]."/resources/app_languages.php";
+			}
+
+		//get the app_languages.php
+			if ($app_path != null) {
+				$lang_path = $_SERVER["PROJECT_ROOT"]."/".$app_path."/app_languages.php";
+			}
+			else {
+				$lang_path = getcwd().'/app_languages.php';
+			}
+			if(file_exists($lang_path)){
+				require $lang_path;
+			}
+
+		//get the available languages
+			krsort($text);
+			foreach ($text as $lang_label => $lang_codes) {
+				foreach ($lang_codes as $lang_code => $lang_text) {
+					if ($lang_text != '') {
+						$app_languages[] = $lang_code;
+					}
+				}
+			}
+			$_SESSION['app']['languages'] = array_unique($app_languages);
+
+		//check the session language
+			if (isset($_SESSION['domain']) and $language_code == null){
+				$language_code = $_SESSION['domain']['language']['code'];
+			} elseif ($language_code == null){
+				$language_code = 'en-us';
+			}
+
+		//reduce to specific language
+			if ($language_code != 'all') {
+				foreach ($text as $key => $value) {
+					if (strlen($value[$language_code]) > 0) {
+						$text[$key] = $value[$language_code];
+					} else {
+						//fallback to en-us
+						$text[$key] = $value['en-us'];
+					}
+				}
+			}
+
+		//return the array of translations
+			return $text;
+	}
+}
+
 ?>

+ 76 - 76
resources/classes/users.php

@@ -1,77 +1,77 @@
-<?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) 2016
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-
-
-/**
- * users class provides methods for adding and removing users
- *
- * @method string add
- * @method boolean delete
- */
-if (!class_exists('users')) {
-	class users {
-
-		/**
-		 * Called when the object is created
-		 */
-		public function __construct() {
-			//place holder
-		}
-
-		/**
-		 * Called when there are no references to a particular object
-		 * unset the variables used in the class
-		 */
-		public function __destruct() {
-			foreach ($this as $key => $value) {
-				unset($this->$key);
-			}
-		}
-
-		/**
-		 * add a user
-		 */
-		public function add($username, $password) {
-			$id = uuid();
-			//return $id;
-			return false;
-		}
-
-		/**
-		 * delete a user
-		 */
-		public function delete($id) {
-			return false;
-		}
-
-	} //end scripts class
-}
-/*
-//example use
-	$user = new users;
-	$user->add($username, $password);
-*/
+<?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) 2016
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
+
+
+/**
+ * users class provides methods for adding and removing users
+ *
+ * @method string add
+ * @method boolean delete
+ */
+if (!class_exists('users')) {
+	class users {
+
+		/**
+		 * Called when the object is created
+		 */
+		public function __construct() {
+			//place holder
+		}
+
+		/**
+		 * Called when there are no references to a particular object
+		 * unset the variables used in the class
+		 */
+		public function __destruct() {
+			foreach ($this as $key => $value) {
+				unset($this->$key);
+			}
+		}
+
+		/**
+		 * add a user
+		 */
+		public function add($username, $password) {
+			$id = uuid();
+			//return $id;
+			return false;
+		}
+
+		/**
+		 * delete a user
+		 */
+		public function delete($id) {
+			return false;
+		}
+
+	} //end scripts class
+}
+/*
+//example use
+	$user = new users;
+	$user->add($username, $password);
+*/
 ?>

+ 915 - 915
resources/countries.php

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

+ 51 - 51
resources/fpdi/filters/FilterASCIIHexDecode.php

@@ -1,52 +1,52 @@
-<?php
-//
-//  FPDI - Version 1.5.2
-//
-//    Copyright 2004-2014 Setasign - Jan Slabon
-//
-//  Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
-//
-//  Unless required by applicable law or agreed to in writing, software
-//  distributed under the License is distributed on an "AS IS" BASIS,
-//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//  See the License for the specific language governing permissions and
-//  limitations under the License.
-//
-
-/**
- * Class FilterASCIIHexDecode
- */
-class FilterASCIIHexDecode
-{
-    /**
-     * Converts an ASCII hexadecimal encoded string into it's binary representation.
-     *
-     * @param string $data The input string
-     * @return string
-     */
-    public function decode($data)
-    {
-        $data = preg_replace('/[^0-9A-Fa-f]/', '', rtrim($data, '>'));
-        if ((strlen($data) % 2) == 1) {
-            $data .= '0';
-        }
-
-        return pack('H*', $data);
-    }
-
-    /**
-     * Converts a string into ASCII hexadecimal representation.
-     *
-     * @param string $data The input string
-     * @param boolean $leaveEOD
-     * @return string
-     */
-    public function encode($data, $leaveEOD = false)
-    {
-        return current(unpack('H*', $data)) . ($leaveEOD ? '' : '>');
-    }
+<?php
+//
+//  FPDI - Version 1.5.2
+//
+//    Copyright 2004-2014 Setasign - Jan Slabon
+//
+//  Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+
+/**
+ * Class FilterASCIIHexDecode
+ */
+class FilterASCIIHexDecode
+{
+    /**
+     * Converts an ASCII hexadecimal encoded string into it's binary representation.
+     *
+     * @param string $data The input string
+     * @return string
+     */
+    public function decode($data)
+    {
+        $data = preg_replace('/[^0-9A-Fa-f]/', '', rtrim($data, '>'));
+        if ((strlen($data) % 2) == 1) {
+            $data .= '0';
+        }
+
+        return pack('H*', $data);
+    }
+
+    /**
+     * Converts a string into ASCII hexadecimal representation.
+     *
+     * @param string $data The input string
+     * @param boolean $leaveEOD
+     * @return string
+     */
+    public function encode($data, $leaveEOD = false)
+    {
+        return current(unpack('H*', $data)) . ($leaveEOD ? '' : '>');
+    }
 }

+ 694 - 694
resources/fpdi/fpdi.php

@@ -1,695 +1,695 @@
-<?php
-//
-//  FPDI - Version 1.5.2
-//
-//    Copyright 2004-2014 Setasign - Jan Slabon
-//
-//  Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
-//
-//  Unless required by applicable law or agreed to in writing, software
-//  distributed under the License is distributed on an "AS IS" BASIS,
-//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//  See the License for the specific language governing permissions and
-//  limitations under the License.
-//
-
-require_once('fpdf_tpl.php');
-
-/**
- * Class FPDI
- */
-class FPDI extends FPDF_TPL
-{
-    /**
-     * FPDI version
-     *
-     * @string
-     */
-    const VERSION = '1.5.2';
-
-    /**
-     * Actual filename
-     *
-     * @var string
-     */
-    public $currentFilename;
-
-    /**
-     * Parser-Objects
-     *
-     * @var fpdi_pdf_parser[]
-     */
-    public $parsers = array();
-
-    /**
-     * Current parser
-     *
-     * @var fpdi_pdf_parser
-     */
-    public $currentParser;
-
-    /**
-     * The name of the last imported page box
-     *
-     * @var string
-     */
-    public $lastUsedPageBox;
-
-    /**
-     * Object stack
-     *
-     * @var array
-     */
-    protected $_objStack;
-
-    /**
-     * Done object stack
-     *
-     * @var array
-     */
-    protected $_doneObjStack;
-
-    /**
-     * Current Object Id.
-     *
-     * @var integer
-     */
-    protected $_currentObjId;
-
-    /**
-     * Cache for imported pages/template ids
-     *
-     * @var array
-     */
-    protected $_importedPages = array();
-
-    /**
-     * Set a source-file.
-     *
-     * Depending on the PDF version of the used document the PDF version of the resulting document will
-     * be adjusted to the higher version.
-     *
-     * @param string $filename A valid path to the PDF document from which pages should be imported from
-     * @return int The number of pages in the document
-     */
-    public function setSourceFile($filename)
-    {
-        $_filename = realpath($filename);
-        if (false !== $_filename)
-            $filename = $_filename;
-
-        $this->currentFilename = $filename;
-
-        if (!isset($this->parsers[$filename])) {
-            $this->parsers[$filename] = $this->_getPdfParser($filename);
-            $this->setPdfVersion(
-                max($this->getPdfVersion(), $this->parsers[$filename]->getPdfVersion())
-            );
-        }
-
-        $this->currentParser =& $this->parsers[$filename];
-
-        return $this->parsers[$filename]->getPageCount();
-    }
-
-    /**
-     * Returns a PDF parser object
-     *
-     * @param string $filename
-     * @return fpdi_pdf_parser
-     */
-    protected function _getPdfParser($filename)
-    {
-        require_once('fpdi_pdf_parser.php');
-    	return new fpdi_pdf_parser($filename);
-    }
-
-    /**
-     * Get the current PDF version.
-     *
-     * @return string
-     */
-    public function getPdfVersion()
-    {
-		return $this->PDFVersion;
-	}
-
-    /**
-     * Set the PDF version.
-     *
-     * @param string $version
-     */
-    public function setPdfVersion($version = '1.3')
-    {
-        $this->PDFVersion = sprintf('%.1F', $version);
-    }
-
-    /**
-     * Import a page.
-     *
-     * The second parameter defines the bounding box that should be used to transform the page into a
-     * form XObject.
-     *
-     * Following values are available: MediaBox, CropBox, BleedBox, TrimBox, ArtBox.
-     * If a box is not especially defined its default box will be used:
-     *
-     * <ul>
-     *   <li>CropBox: Default -> MediaBox</li>
-     *   <li>BleedBox: Default -> CropBox</li>
-     *   <li>TrimBox: Default -> CropBox</li>
-     *   <li>ArtBox: Default -> CropBox</li>
-     * </ul>
-     *
-     * It is possible to get the used page box by the {@link getLastUsedPageBox()} method.
-     *
-     * @param int $pageNo The page number
-     * @param string $boxName The boundary box to use when transforming the page into a form XObject
-     * @param boolean $groupXObject Define the form XObject as a group XObject to support transparency (if used)
-     * @return int An id of the imported page/template to use with e.g. fpdf_tpl::useTemplate()
-     * @throws LogicException|InvalidArgumentException
-     * @see getLastUsedPageBox()
-     */
-    public function importPage($pageNo, $boxName = 'CropBox', $groupXObject = true)
-    {
-        if ($this->_inTpl) {
-            throw new LogicException('Please import the desired pages before creating a new template.');
-        }
-
-        $fn = $this->currentFilename;
-        $boxName = '/' . ltrim($boxName, '/');
-
-        // check if page already imported
-        $pageKey = $fn . '-' . ((int)$pageNo) . $boxName;
-        if (isset($this->_importedPages[$pageKey])) {
-            return $this->_importedPages[$pageKey];
-        }
-
-        $parser = $this->parsers[$fn];
-        $parser->setPageNo($pageNo);
-
-        if (!in_array($boxName, $parser->availableBoxes)) {
-            throw new InvalidArgumentException(sprintf('Unknown box: %s', $boxName));
-        }
-
-        $pageBoxes = $parser->getPageBoxes($pageNo, $this->k);
-
-        /**
-         * MediaBox
-         * CropBox: Default -> MediaBox
-         * BleedBox: Default -> CropBox
-         * TrimBox: Default -> CropBox
-         * ArtBox: Default -> CropBox
-         */
-        if (!isset($pageBoxes[$boxName]) && ($boxName == '/BleedBox' || $boxName == '/TrimBox' || $boxName == '/ArtBox'))
-            $boxName = '/CropBox';
-        if (!isset($pageBoxes[$boxName]) && $boxName == '/CropBox')
-            $boxName = '/MediaBox';
-
-        if (!isset($pageBoxes[$boxName]))
-            return false;
-
-        $this->lastUsedPageBox = $boxName;
-
-        $box = $pageBoxes[$boxName];
-
-        $this->tpl++;
-        $this->_tpls[$this->tpl] = array();
-        $tpl =& $this->_tpls[$this->tpl];
-        $tpl['parser'] = $parser;
-        $tpl['resources'] = $parser->getPageResources();
-        $tpl['buffer'] = $parser->getContent();
-        $tpl['box'] = $box;
-        $tpl['groupXObject'] = $groupXObject;
-        if ($groupXObject) {
-            $this->setPdfVersion(max($this->getPdfVersion(), 1.4));
-        }
-
-        // To build an array that can be used by PDF_TPL::useTemplate()
-        $this->_tpls[$this->tpl] = array_merge($this->_tpls[$this->tpl], $box);
-
-        // An imported page will start at 0,0 all the time. Translation will be set in _putformxobjects()
-        $tpl['x'] = 0;
-        $tpl['y'] = 0;
-
-        // handle rotated pages
-        $rotation = $parser->getPageRotation($pageNo);
-        $tpl['_rotationAngle'] = 0;
-        if (isset($rotation[1]) && ($angle = $rotation[1] % 360) != 0) {
-        	$steps = $angle / 90;
-
-            $_w = $tpl['w'];
-            $_h = $tpl['h'];
-            $tpl['w'] = $steps % 2 == 0 ? $_w : $_h;
-            $tpl['h'] = $steps % 2 == 0 ? $_h : $_w;
-
-            if ($angle < 0)
-            	$angle += 360;
-
-        	$tpl['_rotationAngle'] = $angle * -1;
-        }
-
-        $this->_importedPages[$pageKey] = $this->tpl;
-
-        return $this->tpl;
-    }
-
-    /**
-     * Returns the last used page boundary box.
-     *
-     * @return string The used boundary box: MediaBox, CropBox, BleedBox, TrimBox or ArtBox
-     */
-    public function getLastUsedPageBox()
-    {
-        return $this->lastUsedPageBox;
-    }
-
-    /**
-     * Use a template or imported page in current page or other template.
-     *
-     * You can use a template in a page or in another template.
-     * You can give the used template a new size. All parameters are optional.
-     * The width or height is calculated automatically if one is given. If no
-     * parameter is given the origin size as defined in beginTemplate() or of
-     * the imported page is used.
-     *
-     * The calculated or used width and height are returned as an array.
-     *
-     * @param int $tplIdx A valid template-id
-     * @param int $x The x-position
-     * @param int $y The y-position
-     * @param int $w The new width of the template
-     * @param int $h The new height of the template
-     * @param boolean $adjustPageSize If set to true the current page will be resized to fit the dimensions
-     *                                of the template
-     *
-     * @return array The height and width of the template (array('w' => ..., 'h' => ...))
-     * @throws LogicException|InvalidArgumentException
-     */
-    public function useTemplate($tplIdx, $x = null, $y = null, $w = 0, $h = 0, $adjustPageSize = false)
-    {
-        if ($adjustPageSize == true && is_null($x) && is_null($y)) {
-            $size = $this->getTemplateSize($tplIdx, $w, $h);
-            $orientation = $size['w'] > $size['h'] ? 'L' : 'P';
-            $size = array($size['w'], $size['h']);
-
-            if (is_subclass_of($this, 'TCPDF')) {
-            	$this->setPageFormat($size, $orientation);
-            } else {
-            	$size = $this->_getpagesize($size);
-
-            	if($orientation != $this->CurOrientation ||
-                    $size[0] != $this->CurPageSize[0] ||
-                    $size[1] != $this->CurPageSize[1]
-                ) {
-					// New size or orientation
-					if ($orientation=='P') {
-						$this->w = $size[0];
-						$this->h = $size[1];
-					} else {
-						$this->w = $size[1];
-						$this->h = $size[0];
-					}
-					$this->wPt = $this->w * $this->k;
-					$this->hPt = $this->h * $this->k;
-					$this->PageBreakTrigger = $this->h - $this->bMargin;
-					$this->CurOrientation = $orientation;
-					$this->CurPageSize = $size;
-					$this->PageSizes[$this->page] = array($this->wPt, $this->hPt);
-				}
-            }
-        }
-
-        $this->_out('q 0 J 1 w 0 j 0 G 0 g'); // reset standard values
-        $size = parent::useTemplate($tplIdx, $x, $y, $w, $h);
-        $this->_out('Q');
-
-        return $size;
-    }
-
-    /**
-     * Copy all imported objects to the resulting document.
-     */
-    protected function _putimportedobjects()
-    {
-        foreach($this->parsers AS $filename => $p) {
-            $this->currentParser =& $p;
-            if (!isset($this->_objStack[$filename]) || !is_array($this->_objStack[$filename])) {
-                continue;
-            }
-            while(($n = key($this->_objStack[$filename])) !== null) {
-                try {
-                    $nObj = $this->currentParser->resolveObject($this->_objStack[$filename][$n][1]);
-                } catch (Exception $e) {
-                    $nObj = array(pdf_parser::TYPE_OBJECT, pdf_parser::TYPE_NULL);
-                }
-
-                $this->_newobj($this->_objStack[$filename][$n][0]);
-
-                if ($nObj[0] == pdf_parser::TYPE_STREAM) {
-                    $this->_writeValue($nObj);
-                } else {
-                    $this->_writeValue($nObj[1]);
-                }
-
-                $this->_out("\nendobj");
-                $this->_objStack[$filename][$n] = null; // free memory
-                unset($this->_objStack[$filename][$n]);
-                reset($this->_objStack[$filename]);
-            }
-        }
-    }
-
-    /**
-     * Writes the form XObjects to the PDF document.
-     */
-    protected function _putformxobjects()
-    {
-        $filter = ($this->compress) ? '/Filter /FlateDecode ' : '';
-	    reset($this->_tpls);
-        foreach($this->_tpls AS $tplIdx => $tpl) {
-            $this->_newobj();
-    		$currentN = $this->n; // TCPDF/Protection: rem current "n"
-
-    		$this->_tpls[$tplIdx]['n'] = $this->n;
-    		$this->_out('<<' . $filter . '/Type /XObject');
-            $this->_out('/Subtype /Form');
-            $this->_out('/FormType 1');
-
-            $this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]',
-                (isset($tpl['box']['llx']) ? $tpl['box']['llx'] : $tpl['x']) * $this->k,
-                (isset($tpl['box']['lly']) ? $tpl['box']['lly'] : -$tpl['y']) * $this->k,
-                (isset($tpl['box']['urx']) ? $tpl['box']['urx'] : $tpl['w'] + $tpl['x']) * $this->k,
-                (isset($tpl['box']['ury']) ? $tpl['box']['ury'] : $tpl['h'] - $tpl['y']) * $this->k
-            ));
-
-            $c = 1;
-            $s = 0;
-            $tx = 0;
-            $ty = 0;
-
-            if (isset($tpl['box'])) {
-                $tx = -$tpl['box']['llx'];
-                $ty = -$tpl['box']['lly'];
-
-                if ($tpl['_rotationAngle'] <> 0) {
-                    $angle = $tpl['_rotationAngle'] * M_PI/180;
-                    $c = cos($angle);
-                    $s = sin($angle);
-
-                    switch($tpl['_rotationAngle']) {
-                        case -90:
-                           $tx = -$tpl['box']['lly'];
-                           $ty = $tpl['box']['urx'];
-                           break;
-                        case -180:
-                            $tx = $tpl['box']['urx'];
-                            $ty = $tpl['box']['ury'];
-                            break;
-                        case -270:
-                        	$tx = $tpl['box']['ury'];
-                            $ty = -$tpl['box']['llx'];
-                            break;
-                    }
-                }
-            } else if ($tpl['x'] != 0 || $tpl['y'] != 0) {
-                $tx = -$tpl['x'] * 2;
-                $ty = $tpl['y'] * 2;
-            }
-
-            $tx *= $this->k;
-            $ty *= $this->k;
-
-            if ($c != 1 || $s != 0 || $tx != 0 || $ty != 0) {
-                $this->_out(sprintf('/Matrix [%.5F %.5F %.5F %.5F %.5F %.5F]',
-                    $c, $s, -$s, $c, $tx, $ty
-                ));
-            }
-
-            $this->_out('/Resources ');
-
-            if (isset($tpl['resources'])) {
-                $this->currentParser = $tpl['parser'];
-                $this->_writeValue($tpl['resources']); // "n" will be changed
-            } else {
-
-                $this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
-                if (isset($this->_res['tpl'][$tplIdx])) {
-                    $res = $this->_res['tpl'][$tplIdx];
-
-                    if (isset($res['fonts']) && count($res['fonts'])) {
-                        $this->_out('/Font <<');
-                        foreach ($res['fonts'] as $font)
-                            $this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R');
-                        $this->_out('>>');
-                    }
-                    if (isset($res['images']) && count($res['images']) ||
-                       isset($res['tpls']) && count($res['tpls']))
-                    {
-                        $this->_out('/XObject <<');
-                        if (isset($res['images'])) {
-                            foreach ($res['images'] as $image)
-                                $this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R');
-                        }
-                        if (isset($res['tpls'])) {
-                            foreach ($res['tpls'] as $i => $_tpl)
-                                $this->_out($this->tplPrefix . $i . ' ' . $_tpl['n'] . ' 0 R');
-                        }
-                        $this->_out('>>');
-                    }
-                    $this->_out('>>');
-                }
-            }
-
-            if (isset($tpl['groupXObject']) && $tpl['groupXObject']) {
-                $this->_out('/Group <</Type/Group/S/Transparency>>');
-            }
-
-            $newN = $this->n; // TCPDF: rem new "n"
-            $this->n = $currentN; // TCPDF: reset to current "n"
-
-            $buffer = ($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer'];
-
-            if (is_subclass_of($this, 'TCPDF')) {
-            	$buffer = $this->_getrawstream($buffer);
-            	$this->_out('/Length ' . strlen($buffer) . ' >>');
-            	$this->_out("stream\n" . $buffer . "\nendstream");
-            } else {
-	            $this->_out('/Length ' . strlen($buffer) . ' >>');
-	    		$this->_putstream($buffer);
-            }
-    		$this->_out('endobj');
-    		$this->n = $newN; // TCPDF: reset to new "n"
-        }
-
-        $this->_putimportedobjects();
-    }
-
-    /**
-     * Creates and optionally write the object definition to the document.
-     *
-     * Rewritten to handle existing own defined objects
-     *
-     * @param bool $objId
-     * @param bool $onlyNewObj
-     * @return bool|int
-     */
-    public function _newobj($objId = false, $onlyNewObj = false)
-    {
-        if (!$objId) {
-            $objId = ++$this->n;
-        }
-
-        //Begin a new object
-        if (!$onlyNewObj) {
-            $this->offsets[$objId] = is_subclass_of($this, 'TCPDF') ? $this->bufferlen : strlen($this->buffer);
-            $this->_out($objId . ' 0 obj');
-            $this->_currentObjId = $objId; // for later use with encryption
-        }
-
-        return $objId;
-    }
-
-    /**
-     * Writes a PDF value to the resulting document.
-     *
-     * Needed to rebuild the source document
-     *
-     * @param mixed $value A PDF-Value. Structure of values see cases in this method
-     */
-    protected function _writeValue(&$value)
-    {
-        if (is_subclass_of($this, 'TCPDF')) {
-            parent::_prepareValue($value);
-        }
-
-        switch ($value[0]) {
-
-    		case pdf_parser::TYPE_TOKEN:
-                $this->_straightOut($value[1] . ' ');
-    			break;
-		    case pdf_parser::TYPE_NUMERIC:
-    		case pdf_parser::TYPE_REAL:
-                if (is_float($value[1]) && $value[1] != 0) {
-    			    $this->_straightOut(rtrim(rtrim(sprintf('%F', $value[1]), '0'), '.') . ' ');
-    			} else {
-        			$this->_straightOut($value[1] . ' ');
-    			}
-    			break;
-
-    		case pdf_parser::TYPE_ARRAY:
-
-    			// An array. Output the proper
-    			// structure and move on.
-
-    			$this->_straightOut('[');
-                for ($i = 0; $i < count($value[1]); $i++) {
-    				$this->_writeValue($value[1][$i]);
-    			}
-
-    			$this->_out(']');
-    			break;
-
-    		case pdf_parser::TYPE_DICTIONARY:
-
-    			// A dictionary.
-    			$this->_straightOut('<<');
-
-    			reset ($value[1]);
-
-    			while (list($k, $v) = each($value[1])) {
-    				$this->_straightOut($k . ' ');
-    				$this->_writeValue($v);
-    			}
-
-    			$this->_straightOut('>>');
-    			break;
-
-    		case pdf_parser::TYPE_OBJREF:
-
-    			// An indirect object reference
-    			// Fill the object stack if needed
-    			$cpfn =& $this->currentParser->filename;
-    			if (!isset($this->_doneObjStack[$cpfn][$value[1]])) {
-    			    $this->_newobj(false, true);
-    			    $this->_objStack[$cpfn][$value[1]] = array($this->n, $value);
-                    $this->_doneObjStack[$cpfn][$value[1]] = array($this->n, $value);
-                }
-                $objId = $this->_doneObjStack[$cpfn][$value[1]][0];
-
-    			$this->_out($objId . ' 0 R');
-    			break;
-
-    		case pdf_parser::TYPE_STRING:
-
-    			// A string.
-                $this->_straightOut('(' . $value[1] . ')');
-
-    			break;
-
-    		case pdf_parser::TYPE_STREAM:
-
-    			// A stream. First, output the
-    			// stream dictionary, then the
-    			// stream data itself.
-                $this->_writeValue($value[1]);
-    			$this->_out('stream');
-    			$this->_out($value[2][1]);
-    			$this->_straightOut("endstream");
-    			break;
-
-            case pdf_parser::TYPE_HEX:
-                $this->_straightOut('<' . $value[1] . '>');
-                break;
-
-            case pdf_parser::TYPE_BOOLEAN:
-    		    $this->_straightOut($value[1] ? 'true ' : 'false ');
-    		    break;
-
-    		case pdf_parser::TYPE_NULL:
-                // The null object.
-
-    			$this->_straightOut('null ');
-    			break;
-    	}
-    }
-
-
-    /**
-     * Modified _out() method so not each call will add a newline to the output.
-     */
-    protected function _straightOut($s)
-    {
-        if (!is_subclass_of($this, 'TCPDF')) {
-            if ($this->state == 2) {
-        		$this->pages[$this->page] .= $s;
-            } else {
-        		$this->buffer .= $s;
-            }
-
-        } else {
-            if ($this->state == 2) {
-				if ($this->inxobj) {
-					// we are inside an XObject template
-					$this->xobjects[$this->xobjid]['outdata'] .= $s;
-				} else if ((!$this->InFooter) AND isset($this->footerlen[$this->page]) AND ($this->footerlen[$this->page] > 0)) {
-					// puts data before page footer
-					$pagebuff = $this->getPageBuffer($this->page);
-					$page = substr($pagebuff, 0, -$this->footerlen[$this->page]);
-					$footer = substr($pagebuff, -$this->footerlen[$this->page]);
-					$this->setPageBuffer($this->page, $page . $s . $footer);
-					// update footer position
-					$this->footerpos[$this->page] += strlen($s);
-				} else {
-					// set page data
-					$this->setPageBuffer($this->page, $s, true);
-				}
-			} else if ($this->state > 0) {
-				// set general data
-				$this->setBuffer($s);
-			}
-        }
-    }
-
-    /**
-     * Ends the document
-     *
-     * Overwritten to close opened parsers
-     */
-    public function _enddoc()
-    {
-        parent::_enddoc();
-        $this->_closeParsers();
-    }
-
-    /**
-     * Close all files opened by parsers.
-     *
-     * @return boolean
-     */
-    protected function _closeParsers()
-    {
-        if ($this->state > 2) {
-          	$this->cleanUp();
-            return true;
-        }
-
-        return false;
-    }
-
-    /**
-     * Removes cycled references and closes the file handles of the parser objects.
-     */
-    public function cleanUp()
-    {
-        while (($parser = array_pop($this->parsers)) !== null) {
-            /**
-             * @var fpdi_pdf_parser $parser
-             */
-            $parser->closeFile();
-        }
-    }
+<?php
+//
+//  FPDI - Version 1.5.2
+//
+//    Copyright 2004-2014 Setasign - Jan Slabon
+//
+//  Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+
+require_once('fpdf_tpl.php');
+
+/**
+ * Class FPDI
+ */
+class FPDI extends FPDF_TPL
+{
+    /**
+     * FPDI version
+     *
+     * @string
+     */
+    const VERSION = '1.5.2';
+
+    /**
+     * Actual filename
+     *
+     * @var string
+     */
+    public $currentFilename;
+
+    /**
+     * Parser-Objects
+     *
+     * @var fpdi_pdf_parser[]
+     */
+    public $parsers = array();
+
+    /**
+     * Current parser
+     *
+     * @var fpdi_pdf_parser
+     */
+    public $currentParser;
+
+    /**
+     * The name of the last imported page box
+     *
+     * @var string
+     */
+    public $lastUsedPageBox;
+
+    /**
+     * Object stack
+     *
+     * @var array
+     */
+    protected $_objStack;
+
+    /**
+     * Done object stack
+     *
+     * @var array
+     */
+    protected $_doneObjStack;
+
+    /**
+     * Current Object Id.
+     *
+     * @var integer
+     */
+    protected $_currentObjId;
+
+    /**
+     * Cache for imported pages/template ids
+     *
+     * @var array
+     */
+    protected $_importedPages = array();
+
+    /**
+     * Set a source-file.
+     *
+     * Depending on the PDF version of the used document the PDF version of the resulting document will
+     * be adjusted to the higher version.
+     *
+     * @param string $filename A valid path to the PDF document from which pages should be imported from
+     * @return int The number of pages in the document
+     */
+    public function setSourceFile($filename)
+    {
+        $_filename = realpath($filename);
+        if (false !== $_filename)
+            $filename = $_filename;
+
+        $this->currentFilename = $filename;
+
+        if (!isset($this->parsers[$filename])) {
+            $this->parsers[$filename] = $this->_getPdfParser($filename);
+            $this->setPdfVersion(
+                max($this->getPdfVersion(), $this->parsers[$filename]->getPdfVersion())
+            );
+        }
+
+        $this->currentParser =& $this->parsers[$filename];
+
+        return $this->parsers[$filename]->getPageCount();
+    }
+
+    /**
+     * Returns a PDF parser object
+     *
+     * @param string $filename
+     * @return fpdi_pdf_parser
+     */
+    protected function _getPdfParser($filename)
+    {
+        require_once('fpdi_pdf_parser.php');
+    	return new fpdi_pdf_parser($filename);
+    }
+
+    /**
+     * Get the current PDF version.
+     *
+     * @return string
+     */
+    public function getPdfVersion()
+    {
+		return $this->PDFVersion;
+	}
+
+    /**
+     * Set the PDF version.
+     *
+     * @param string $version
+     */
+    public function setPdfVersion($version = '1.3')
+    {
+        $this->PDFVersion = sprintf('%.1F', $version);
+    }
+
+    /**
+     * Import a page.
+     *
+     * The second parameter defines the bounding box that should be used to transform the page into a
+     * form XObject.
+     *
+     * Following values are available: MediaBox, CropBox, BleedBox, TrimBox, ArtBox.
+     * If a box is not especially defined its default box will be used:
+     *
+     * <ul>
+     *   <li>CropBox: Default -> MediaBox</li>
+     *   <li>BleedBox: Default -> CropBox</li>
+     *   <li>TrimBox: Default -> CropBox</li>
+     *   <li>ArtBox: Default -> CropBox</li>
+     * </ul>
+     *
+     * It is possible to get the used page box by the {@link getLastUsedPageBox()} method.
+     *
+     * @param int $pageNo The page number
+     * @param string $boxName The boundary box to use when transforming the page into a form XObject
+     * @param boolean $groupXObject Define the form XObject as a group XObject to support transparency (if used)
+     * @return int An id of the imported page/template to use with e.g. fpdf_tpl::useTemplate()
+     * @throws LogicException|InvalidArgumentException
+     * @see getLastUsedPageBox()
+     */
+    public function importPage($pageNo, $boxName = 'CropBox', $groupXObject = true)
+    {
+        if ($this->_inTpl) {
+            throw new LogicException('Please import the desired pages before creating a new template.');
+        }
+
+        $fn = $this->currentFilename;
+        $boxName = '/' . ltrim($boxName, '/');
+
+        // check if page already imported
+        $pageKey = $fn . '-' . ((int)$pageNo) . $boxName;
+        if (isset($this->_importedPages[$pageKey])) {
+            return $this->_importedPages[$pageKey];
+        }
+
+        $parser = $this->parsers[$fn];
+        $parser->setPageNo($pageNo);
+
+        if (!in_array($boxName, $parser->availableBoxes)) {
+            throw new InvalidArgumentException(sprintf('Unknown box: %s', $boxName));
+        }
+
+        $pageBoxes = $parser->getPageBoxes($pageNo, $this->k);
+
+        /**
+         * MediaBox
+         * CropBox: Default -> MediaBox
+         * BleedBox: Default -> CropBox
+         * TrimBox: Default -> CropBox
+         * ArtBox: Default -> CropBox
+         */
+        if (!isset($pageBoxes[$boxName]) && ($boxName == '/BleedBox' || $boxName == '/TrimBox' || $boxName == '/ArtBox'))
+            $boxName = '/CropBox';
+        if (!isset($pageBoxes[$boxName]) && $boxName == '/CropBox')
+            $boxName = '/MediaBox';
+
+        if (!isset($pageBoxes[$boxName]))
+            return false;
+
+        $this->lastUsedPageBox = $boxName;
+
+        $box = $pageBoxes[$boxName];
+
+        $this->tpl++;
+        $this->_tpls[$this->tpl] = array();
+        $tpl =& $this->_tpls[$this->tpl];
+        $tpl['parser'] = $parser;
+        $tpl['resources'] = $parser->getPageResources();
+        $tpl['buffer'] = $parser->getContent();
+        $tpl['box'] = $box;
+        $tpl['groupXObject'] = $groupXObject;
+        if ($groupXObject) {
+            $this->setPdfVersion(max($this->getPdfVersion(), 1.4));
+        }
+
+        // To build an array that can be used by PDF_TPL::useTemplate()
+        $this->_tpls[$this->tpl] = array_merge($this->_tpls[$this->tpl], $box);
+
+        // An imported page will start at 0,0 all the time. Translation will be set in _putformxobjects()
+        $tpl['x'] = 0;
+        $tpl['y'] = 0;
+
+        // handle rotated pages
+        $rotation = $parser->getPageRotation($pageNo);
+        $tpl['_rotationAngle'] = 0;
+        if (isset($rotation[1]) && ($angle = $rotation[1] % 360) != 0) {
+        	$steps = $angle / 90;
+
+            $_w = $tpl['w'];
+            $_h = $tpl['h'];
+            $tpl['w'] = $steps % 2 == 0 ? $_w : $_h;
+            $tpl['h'] = $steps % 2 == 0 ? $_h : $_w;
+
+            if ($angle < 0)
+            	$angle += 360;
+
+        	$tpl['_rotationAngle'] = $angle * -1;
+        }
+
+        $this->_importedPages[$pageKey] = $this->tpl;
+
+        return $this->tpl;
+    }
+
+    /**
+     * Returns the last used page boundary box.
+     *
+     * @return string The used boundary box: MediaBox, CropBox, BleedBox, TrimBox or ArtBox
+     */
+    public function getLastUsedPageBox()
+    {
+        return $this->lastUsedPageBox;
+    }
+
+    /**
+     * Use a template or imported page in current page or other template.
+     *
+     * You can use a template in a page or in another template.
+     * You can give the used template a new size. All parameters are optional.
+     * The width or height is calculated automatically if one is given. If no
+     * parameter is given the origin size as defined in beginTemplate() or of
+     * the imported page is used.
+     *
+     * The calculated or used width and height are returned as an array.
+     *
+     * @param int $tplIdx A valid template-id
+     * @param int $x The x-position
+     * @param int $y The y-position
+     * @param int $w The new width of the template
+     * @param int $h The new height of the template
+     * @param boolean $adjustPageSize If set to true the current page will be resized to fit the dimensions
+     *                                of the template
+     *
+     * @return array The height and width of the template (array('w' => ..., 'h' => ...))
+     * @throws LogicException|InvalidArgumentException
+     */
+    public function useTemplate($tplIdx, $x = null, $y = null, $w = 0, $h = 0, $adjustPageSize = false)
+    {
+        if ($adjustPageSize == true && is_null($x) && is_null($y)) {
+            $size = $this->getTemplateSize($tplIdx, $w, $h);
+            $orientation = $size['w'] > $size['h'] ? 'L' : 'P';
+            $size = array($size['w'], $size['h']);
+
+            if (is_subclass_of($this, 'TCPDF')) {
+            	$this->setPageFormat($size, $orientation);
+            } else {
+            	$size = $this->_getpagesize($size);
+
+            	if($orientation != $this->CurOrientation ||
+                    $size[0] != $this->CurPageSize[0] ||
+                    $size[1] != $this->CurPageSize[1]
+                ) {
+					// New size or orientation
+					if ($orientation=='P') {
+						$this->w = $size[0];
+						$this->h = $size[1];
+					} else {
+						$this->w = $size[1];
+						$this->h = $size[0];
+					}
+					$this->wPt = $this->w * $this->k;
+					$this->hPt = $this->h * $this->k;
+					$this->PageBreakTrigger = $this->h - $this->bMargin;
+					$this->CurOrientation = $orientation;
+					$this->CurPageSize = $size;
+					$this->PageSizes[$this->page] = array($this->wPt, $this->hPt);
+				}
+            }
+        }
+
+        $this->_out('q 0 J 1 w 0 j 0 G 0 g'); // reset standard values
+        $size = parent::useTemplate($tplIdx, $x, $y, $w, $h);
+        $this->_out('Q');
+
+        return $size;
+    }
+
+    /**
+     * Copy all imported objects to the resulting document.
+     */
+    protected function _putimportedobjects()
+    {
+        foreach($this->parsers AS $filename => $p) {
+            $this->currentParser =& $p;
+            if (!isset($this->_objStack[$filename]) || !is_array($this->_objStack[$filename])) {
+                continue;
+            }
+            while(($n = key($this->_objStack[$filename])) !== null) {
+                try {
+                    $nObj = $this->currentParser->resolveObject($this->_objStack[$filename][$n][1]);
+                } catch (Exception $e) {
+                    $nObj = array(pdf_parser::TYPE_OBJECT, pdf_parser::TYPE_NULL);
+                }
+
+                $this->_newobj($this->_objStack[$filename][$n][0]);
+
+                if ($nObj[0] == pdf_parser::TYPE_STREAM) {
+                    $this->_writeValue($nObj);
+                } else {
+                    $this->_writeValue($nObj[1]);
+                }
+
+                $this->_out("\nendobj");
+                $this->_objStack[$filename][$n] = null; // free memory
+                unset($this->_objStack[$filename][$n]);
+                reset($this->_objStack[$filename]);
+            }
+        }
+    }
+
+    /**
+     * Writes the form XObjects to the PDF document.
+     */
+    protected function _putformxobjects()
+    {
+        $filter = ($this->compress) ? '/Filter /FlateDecode ' : '';
+	    reset($this->_tpls);
+        foreach($this->_tpls AS $tplIdx => $tpl) {
+            $this->_newobj();
+    		$currentN = $this->n; // TCPDF/Protection: rem current "n"
+
+    		$this->_tpls[$tplIdx]['n'] = $this->n;
+    		$this->_out('<<' . $filter . '/Type /XObject');
+            $this->_out('/Subtype /Form');
+            $this->_out('/FormType 1');
+
+            $this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]',
+                (isset($tpl['box']['llx']) ? $tpl['box']['llx'] : $tpl['x']) * $this->k,
+                (isset($tpl['box']['lly']) ? $tpl['box']['lly'] : -$tpl['y']) * $this->k,
+                (isset($tpl['box']['urx']) ? $tpl['box']['urx'] : $tpl['w'] + $tpl['x']) * $this->k,
+                (isset($tpl['box']['ury']) ? $tpl['box']['ury'] : $tpl['h'] - $tpl['y']) * $this->k
+            ));
+
+            $c = 1;
+            $s = 0;
+            $tx = 0;
+            $ty = 0;
+
+            if (isset($tpl['box'])) {
+                $tx = -$tpl['box']['llx'];
+                $ty = -$tpl['box']['lly'];
+
+                if ($tpl['_rotationAngle'] <> 0) {
+                    $angle = $tpl['_rotationAngle'] * M_PI/180;
+                    $c = cos($angle);
+                    $s = sin($angle);
+
+                    switch($tpl['_rotationAngle']) {
+                        case -90:
+                           $tx = -$tpl['box']['lly'];
+                           $ty = $tpl['box']['urx'];
+                           break;
+                        case -180:
+                            $tx = $tpl['box']['urx'];
+                            $ty = $tpl['box']['ury'];
+                            break;
+                        case -270:
+                        	$tx = $tpl['box']['ury'];
+                            $ty = -$tpl['box']['llx'];
+                            break;
+                    }
+                }
+            } else if ($tpl['x'] != 0 || $tpl['y'] != 0) {
+                $tx = -$tpl['x'] * 2;
+                $ty = $tpl['y'] * 2;
+            }
+
+            $tx *= $this->k;
+            $ty *= $this->k;
+
+            if ($c != 1 || $s != 0 || $tx != 0 || $ty != 0) {
+                $this->_out(sprintf('/Matrix [%.5F %.5F %.5F %.5F %.5F %.5F]',
+                    $c, $s, -$s, $c, $tx, $ty
+                ));
+            }
+
+            $this->_out('/Resources ');
+
+            if (isset($tpl['resources'])) {
+                $this->currentParser = $tpl['parser'];
+                $this->_writeValue($tpl['resources']); // "n" will be changed
+            } else {
+
+                $this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
+                if (isset($this->_res['tpl'][$tplIdx])) {
+                    $res = $this->_res['tpl'][$tplIdx];
+
+                    if (isset($res['fonts']) && count($res['fonts'])) {
+                        $this->_out('/Font <<');
+                        foreach ($res['fonts'] as $font)
+                            $this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R');
+                        $this->_out('>>');
+                    }
+                    if (isset($res['images']) && count($res['images']) ||
+                       isset($res['tpls']) && count($res['tpls']))
+                    {
+                        $this->_out('/XObject <<');
+                        if (isset($res['images'])) {
+                            foreach ($res['images'] as $image)
+                                $this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R');
+                        }
+                        if (isset($res['tpls'])) {
+                            foreach ($res['tpls'] as $i => $_tpl)
+                                $this->_out($this->tplPrefix . $i . ' ' . $_tpl['n'] . ' 0 R');
+                        }
+                        $this->_out('>>');
+                    }
+                    $this->_out('>>');
+                }
+            }
+
+            if (isset($tpl['groupXObject']) && $tpl['groupXObject']) {
+                $this->_out('/Group <</Type/Group/S/Transparency>>');
+            }
+
+            $newN = $this->n; // TCPDF: rem new "n"
+            $this->n = $currentN; // TCPDF: reset to current "n"
+
+            $buffer = ($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer'];
+
+            if (is_subclass_of($this, 'TCPDF')) {
+            	$buffer = $this->_getrawstream($buffer);
+            	$this->_out('/Length ' . strlen($buffer) . ' >>');
+            	$this->_out("stream\n" . $buffer . "\nendstream");
+            } else {
+	            $this->_out('/Length ' . strlen($buffer) . ' >>');
+	    		$this->_putstream($buffer);
+            }
+    		$this->_out('endobj');
+    		$this->n = $newN; // TCPDF: reset to new "n"
+        }
+
+        $this->_putimportedobjects();
+    }
+
+    /**
+     * Creates and optionally write the object definition to the document.
+     *
+     * Rewritten to handle existing own defined objects
+     *
+     * @param bool $objId
+     * @param bool $onlyNewObj
+     * @return bool|int
+     */
+    public function _newobj($objId = false, $onlyNewObj = false)
+    {
+        if (!$objId) {
+            $objId = ++$this->n;
+        }
+
+        //Begin a new object
+        if (!$onlyNewObj) {
+            $this->offsets[$objId] = is_subclass_of($this, 'TCPDF') ? $this->bufferlen : strlen($this->buffer);
+            $this->_out($objId . ' 0 obj');
+            $this->_currentObjId = $objId; // for later use with encryption
+        }
+
+        return $objId;
+    }
+
+    /**
+     * Writes a PDF value to the resulting document.
+     *
+     * Needed to rebuild the source document
+     *
+     * @param mixed $value A PDF-Value. Structure of values see cases in this method
+     */
+    protected function _writeValue(&$value)
+    {
+        if (is_subclass_of($this, 'TCPDF')) {
+            parent::_prepareValue($value);
+        }
+
+        switch ($value[0]) {
+
+    		case pdf_parser::TYPE_TOKEN:
+                $this->_straightOut($value[1] . ' ');
+    			break;
+		    case pdf_parser::TYPE_NUMERIC:
+    		case pdf_parser::TYPE_REAL:
+                if (is_float($value[1]) && $value[1] != 0) {
+    			    $this->_straightOut(rtrim(rtrim(sprintf('%F', $value[1]), '0'), '.') . ' ');
+    			} else {
+        			$this->_straightOut($value[1] . ' ');
+    			}
+    			break;
+
+    		case pdf_parser::TYPE_ARRAY:
+
+    			// An array. Output the proper
+    			// structure and move on.
+
+    			$this->_straightOut('[');
+                for ($i = 0; $i < count($value[1]); $i++) {
+    				$this->_writeValue($value[1][$i]);
+    			}
+
+    			$this->_out(']');
+    			break;
+
+    		case pdf_parser::TYPE_DICTIONARY:
+
+    			// A dictionary.
+    			$this->_straightOut('<<');
+
+    			reset ($value[1]);
+
+    			while (list($k, $v) = each($value[1])) {
+    				$this->_straightOut($k . ' ');
+    				$this->_writeValue($v);
+    			}
+
+    			$this->_straightOut('>>');
+    			break;
+
+    		case pdf_parser::TYPE_OBJREF:
+
+    			// An indirect object reference
+    			// Fill the object stack if needed
+    			$cpfn =& $this->currentParser->filename;
+    			if (!isset($this->_doneObjStack[$cpfn][$value[1]])) {
+    			    $this->_newobj(false, true);
+    			    $this->_objStack[$cpfn][$value[1]] = array($this->n, $value);
+                    $this->_doneObjStack[$cpfn][$value[1]] = array($this->n, $value);
+                }
+                $objId = $this->_doneObjStack[$cpfn][$value[1]][0];
+
+    			$this->_out($objId . ' 0 R');
+    			break;
+
+    		case pdf_parser::TYPE_STRING:
+
+    			// A string.
+                $this->_straightOut('(' . $value[1] . ')');
+
+    			break;
+
+    		case pdf_parser::TYPE_STREAM:
+
+    			// A stream. First, output the
+    			// stream dictionary, then the
+    			// stream data itself.
+                $this->_writeValue($value[1]);
+    			$this->_out('stream');
+    			$this->_out($value[2][1]);
+    			$this->_straightOut("endstream");
+    			break;
+
+            case pdf_parser::TYPE_HEX:
+                $this->_straightOut('<' . $value[1] . '>');
+                break;
+
+            case pdf_parser::TYPE_BOOLEAN:
+    		    $this->_straightOut($value[1] ? 'true ' : 'false ');
+    		    break;
+
+    		case pdf_parser::TYPE_NULL:
+                // The null object.
+
+    			$this->_straightOut('null ');
+    			break;
+    	}
+    }
+
+
+    /**
+     * Modified _out() method so not each call will add a newline to the output.
+     */
+    protected function _straightOut($s)
+    {
+        if (!is_subclass_of($this, 'TCPDF')) {
+            if ($this->state == 2) {
+        		$this->pages[$this->page] .= $s;
+            } else {
+        		$this->buffer .= $s;
+            }
+
+        } else {
+            if ($this->state == 2) {
+				if ($this->inxobj) {
+					// we are inside an XObject template
+					$this->xobjects[$this->xobjid]['outdata'] .= $s;
+				} else if ((!$this->InFooter) AND isset($this->footerlen[$this->page]) AND ($this->footerlen[$this->page] > 0)) {
+					// puts data before page footer
+					$pagebuff = $this->getPageBuffer($this->page);
+					$page = substr($pagebuff, 0, -$this->footerlen[$this->page]);
+					$footer = substr($pagebuff, -$this->footerlen[$this->page]);
+					$this->setPageBuffer($this->page, $page . $s . $footer);
+					// update footer position
+					$this->footerpos[$this->page] += strlen($s);
+				} else {
+					// set page data
+					$this->setPageBuffer($this->page, $s, true);
+				}
+			} else if ($this->state > 0) {
+				// set general data
+				$this->setBuffer($s);
+			}
+        }
+    }
+
+    /**
+     * Ends the document
+     *
+     * Overwritten to close opened parsers
+     */
+    public function _enddoc()
+    {
+        parent::_enddoc();
+        $this->_closeParsers();
+    }
+
+    /**
+     * Close all files opened by parsers.
+     *
+     * @return boolean
+     */
+    protected function _closeParsers()
+    {
+        if ($this->state > 2) {
+          	$this->cleanUp();
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Removes cycled references and closes the file handles of the parser objects.
+     */
+    public function cleanUp()
+    {
+        while (($parser = array_pop($this->parsers)) !== null) {
+            /**
+             * @var fpdi_pdf_parser $parser
+             */
+            $parser->closeFile();
+        }
+    }
 }

+ 353 - 353
resources/fpdi/fpdi_pdf_parser.php

@@ -1,354 +1,354 @@
-<?php
-//
-//  FPDI - Version 1.5.2
-//
-//    Copyright 2004-2014 Setasign - Jan Slabon
-//
-//  Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
-//
-//  Unless required by applicable law or agreed to in writing, software
-//  distributed under the License is distributed on an "AS IS" BASIS,
-//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//  See the License for the specific language governing permissions and
-//  limitations under the License.
-//
-
-require_once('pdf_parser.php');
-
-/**
- * Class fpdi_pdf_parser
- */
-class fpdi_pdf_parser extends pdf_parser
-{
-    /**
-     * Pages
-     *
-     * Index begins at 0
-     *
-     * @var array
-     */
-    protected $_pages;
-
-    /**
-     * Page count
-     *
-     * @var integer
-     */
-    protected $_pageCount;
-
-    /**
-     * Current page number
-     *
-     * @var integer
-     */
-    public $pageNo;
-
-    /**
-     * PDF version of imported document
-     *
-     * @var string
-     */
-    public $_pdfVersion;
-
-    /**
-     * Available BoxTypes
-     *
-     * @var array
-     */
-    public $availableBoxes = array('/MediaBox', '/CropBox', '/BleedBox', '/TrimBox', '/ArtBox');
-
-    /**
-     * The constructor.
-     *
-     * @param string $filename The source filename
-     */
-    public function __construct($filename)
-    {
-        parent::__construct($filename);
-
-        // resolve Pages-Dictonary
-        $pages = $this->resolveObject($this->_root[1][1]['/Pages']);
-
-        // Read pages
-        $this->_readPages($pages, $this->_pages);
-
-        // count pages;
-        $this->_pageCount = count($this->_pages);
-    }
-
-    /**
-     * Get page count from source file.
-     *
-     * @return int
-     */
-    public function getPageCount()
-    {
-        return $this->_pageCount;
-    }
-
-    /**
-     * Set the page number.
-     *
-     * @param int $pageNo Page number to use
-     * @throws InvalidArgumentException
-     */
-    public function setPageNo($pageNo)
-    {
-        $pageNo = ((int) $pageNo) - 1;
-
-        if ($pageNo < 0 || $pageNo >= $this->getPageCount()) {
-            throw new InvalidArgumentException('Invalid page number!');
-        }
-
-        $this->pageNo = $pageNo;
-    }
-
-    /**
-     * Get page-resources from current page
-     *
-     * @return array|boolean
-     */
-    public function getPageResources()
-    {
-        return $this->_getPageResources($this->_pages[$this->pageNo]);
-    }
-
-    /**
-     * Get page-resources from a /Page dictionary.
-     *
-     * @param array $obj Array of pdf-data
-     * @return array|boolean
-     */
-    protected function _getPageResources($obj)
-    {
-    	$obj = $this->resolveObject($obj);
-
-        // If the current object has a resources
-    	// dictionary associated with it, we use
-    	// it. Otherwise, we move back to its
-    	// parent object.
-        if (isset($obj[1][1]['/Resources'])) {
-    		$res = $this->resolveObject($obj[1][1]['/Resources']);
-    		if ($res[0] == pdf_parser::TYPE_OBJECT)
-                return $res[1];
-            return $res;
-    	}
-
-        if (!isset($obj[1][1]['/Parent'])) {
-            return false;
-        }
-
-        $res = $this->_getPageResources($obj[1][1]['/Parent']);
-        if ($res[0] == pdf_parser::TYPE_OBJECT)
-            return $res[1];
-        return $res;
-    }
-
-    /**
-     * Get content of current page.
-     *
-     * If /Contents is an array, the streams are concatenated
-     *
-     * @return string
-     */
-    public function getContent()
-    {
-        $buffer = '';
-
-        if (isset($this->_pages[$this->pageNo][1][1]['/Contents'])) {
-            $contents = $this->_getPageContent($this->_pages[$this->pageNo][1][1]['/Contents']);
-            foreach ($contents AS $tmpContent) {
-                $buffer .= $this->_unFilterStream($tmpContent) . ' ';
-            }
-        }
-
-        return $buffer;
-    }
-
-    /**
-     * Resolve all content objects.
-     *
-     * @param array $contentRef
-     * @return array
-     */
-    protected function _getPageContent($contentRef)
-    {
-        $contents = array();
-
-        if ($contentRef[0] == pdf_parser::TYPE_OBJREF) {
-            $content = $this->resolveObject($contentRef);
-            if ($content[1][0] == pdf_parser::TYPE_ARRAY) {
-                $contents = $this->_getPageContent($content[1]);
-            } else {
-                $contents[] = $content;
-            }
-        } else if ($contentRef[0] == pdf_parser::TYPE_ARRAY) {
-            foreach ($contentRef[1] AS $tmp_content_ref) {
-                $contents = array_merge($contents, $this->_getPageContent($tmp_content_ref));
-            }
-        }
-
-        return $contents;
-    }
-
-    /**
-     * Get a boundary box from a page
-     *
-     * Array format is same as used by FPDF_TPL.
-     *
-     * @param array $page a /Page dictionary
-     * @param string $boxIndex Type of box {see {@link $availableBoxes})
-     * @param float Scale factor from user space units to points
-     *
-     * @return array|boolean
-     */
-    protected function _getPageBox($page, $boxIndex, $k)
-    {
-        $page = $this->resolveObject($page);
-        $box = null;
-        if (isset($page[1][1][$boxIndex])) {
-            $box = $page[1][1][$boxIndex];
-        }
-
-        if (!is_null($box) && $box[0] == pdf_parser::TYPE_OBJREF) {
-            $tmp_box = $this->resolveObject($box);
-            $box = $tmp_box[1];
-        }
-
-        if (!is_null($box) && $box[0] == pdf_parser::TYPE_ARRAY) {
-            $b = $box[1];
-            return array(
-                'x' => $b[0][1] / $k,
-                'y' => $b[1][1] / $k,
-                'w' => abs($b[0][1] - $b[2][1]) / $k,
-                'h' => abs($b[1][1] - $b[3][1]) / $k,
-                'llx' => min($b[0][1], $b[2][1]) / $k,
-                'lly' => min($b[1][1], $b[3][1]) / $k,
-                'urx' => max($b[0][1], $b[2][1]) / $k,
-                'ury' => max($b[1][1], $b[3][1]) / $k,
-            );
-        } else if (!isset($page[1][1]['/Parent'])) {
-            return false;
-        } else {
-            return $this->_getPageBox($this->resolveObject($page[1][1]['/Parent']), $boxIndex, $k);
-        }
-    }
-
-    /**
-     * Get all page boundary boxes by page number
-     *
-     * @param int $pageNo The page number
-     * @param float $k Scale factor from user space units to points
-     * @return array
-     * @throws InvalidArgumentException
-     */
-    public function getPageBoxes($pageNo, $k)
-    {
-        if (!isset($this->_pages[$pageNo - 1])) {
-            throw new InvalidArgumentException('Page ' . $pageNo . ' does not exists.');
-        }
-
-        return $this->_getPageBoxes($this->_pages[$pageNo - 1], $k);
-    }
-
-    /**
-     * Get all boxes from /Page dictionary
-     *
-     * @param array $page A /Page dictionary
-     * @param float $k Scale factor from user space units to points
-     * @return array
-     */
-    protected function _getPageBoxes($page, $k)
-    {
-        $boxes = array();
-
-        foreach($this->availableBoxes AS $box) {
-            if ($_box = $this->_getPageBox($page, $box, $k)) {
-                $boxes[$box] = $_box;
-            }
-        }
-
-        return $boxes;
-    }
-
-    /**
-     * Get the page rotation by page number
-     *
-     * @param integer $pageNo
-     * @throws InvalidArgumentException
-     * @return array
-     */
-    public function getPageRotation($pageNo)
-    {
-        if (!isset($this->_pages[$pageNo - 1])) {
-            throw new InvalidArgumentException('Page ' . $pageNo . ' does not exists.');
-        }
-
-        return $this->_getPageRotation($this->_pages[$pageNo - 1]);
-    }
-
-    /**
-     * Get the rotation value of a page
-     *
-     * @param array $obj A /Page dictionary
-     * @return array|bool
-     */
-    protected function _getPageRotation($obj)
-    {
-    	$obj = $this->resolveObject($obj);
-    	if (isset($obj[1][1]['/Rotate'])) {
-    		$res = $this->resolveObject($obj[1][1]['/Rotate']);
-    		if ($res[0] == pdf_parser::TYPE_OBJECT)
-                return $res[1];
-            return $res;
-    	}
-
-        if (!isset($obj[1][1]['/Parent'])) {
-            return false;
-        }
-
-        $res = $this->_getPageRotation($obj[1][1]['/Parent']);
-        if ($res[0] == pdf_parser::TYPE_OBJECT)
-            return $res[1];
-
-        return $res;
-    }
-
-    /**
-     * Read all pages
-     *
-     * @param array $pages /Pages dictionary
-     * @param array $result The result array
-     * @throws Exception
-     */
-    protected function _readPages(&$pages, &$result)
-    {
-        // Get the kids dictionary
-    	$_kids = $this->resolveObject($pages[1][1]['/Kids']);
-
-        if (!is_array($_kids)) {
-            throw new Exception('Cannot find /Kids in current /Page-Dictionary');
-        }
-
-        if ($_kids[0] === self::TYPE_OBJECT) {
-            $_kids =  $_kids[1];
-        }
-
-        $kids = $_kids[1];
-
-        foreach ($kids as $v) {
-    		$pg = $this->resolveObject($v);
-            if ($pg[1][1]['/Type'][1] === '/Pages') {
-                // If one of the kids is an embedded
-    			// /Pages array, resolve it as well.
-                $this->_readPages($pg, $result);
-    		} else {
-    			$result[] = $pg;
-    		}
-    	}
-    }
+<?php
+//
+//  FPDI - Version 1.5.2
+//
+//    Copyright 2004-2014 Setasign - Jan Slabon
+//
+//  Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+
+require_once('pdf_parser.php');
+
+/**
+ * Class fpdi_pdf_parser
+ */
+class fpdi_pdf_parser extends pdf_parser
+{
+    /**
+     * Pages
+     *
+     * Index begins at 0
+     *
+     * @var array
+     */
+    protected $_pages;
+
+    /**
+     * Page count
+     *
+     * @var integer
+     */
+    protected $_pageCount;
+
+    /**
+     * Current page number
+     *
+     * @var integer
+     */
+    public $pageNo;
+
+    /**
+     * PDF version of imported document
+     *
+     * @var string
+     */
+    public $_pdfVersion;
+
+    /**
+     * Available BoxTypes
+     *
+     * @var array
+     */
+    public $availableBoxes = array('/MediaBox', '/CropBox', '/BleedBox', '/TrimBox', '/ArtBox');
+
+    /**
+     * The constructor.
+     *
+     * @param string $filename The source filename
+     */
+    public function __construct($filename)
+    {
+        parent::__construct($filename);
+
+        // resolve Pages-Dictonary
+        $pages = $this->resolveObject($this->_root[1][1]['/Pages']);
+
+        // Read pages
+        $this->_readPages($pages, $this->_pages);
+
+        // count pages;
+        $this->_pageCount = count($this->_pages);
+    }
+
+    /**
+     * Get page count from source file.
+     *
+     * @return int
+     */
+    public function getPageCount()
+    {
+        return $this->_pageCount;
+    }
+
+    /**
+     * Set the page number.
+     *
+     * @param int $pageNo Page number to use
+     * @throws InvalidArgumentException
+     */
+    public function setPageNo($pageNo)
+    {
+        $pageNo = ((int) $pageNo) - 1;
+
+        if ($pageNo < 0 || $pageNo >= $this->getPageCount()) {
+            throw new InvalidArgumentException('Invalid page number!');
+        }
+
+        $this->pageNo = $pageNo;
+    }
+
+    /**
+     * Get page-resources from current page
+     *
+     * @return array|boolean
+     */
+    public function getPageResources()
+    {
+        return $this->_getPageResources($this->_pages[$this->pageNo]);
+    }
+
+    /**
+     * Get page-resources from a /Page dictionary.
+     *
+     * @param array $obj Array of pdf-data
+     * @return array|boolean
+     */
+    protected function _getPageResources($obj)
+    {
+    	$obj = $this->resolveObject($obj);
+
+        // If the current object has a resources
+    	// dictionary associated with it, we use
+    	// it. Otherwise, we move back to its
+    	// parent object.
+        if (isset($obj[1][1]['/Resources'])) {
+    		$res = $this->resolveObject($obj[1][1]['/Resources']);
+    		if ($res[0] == pdf_parser::TYPE_OBJECT)
+                return $res[1];
+            return $res;
+    	}
+
+        if (!isset($obj[1][1]['/Parent'])) {
+            return false;
+        }
+
+        $res = $this->_getPageResources($obj[1][1]['/Parent']);
+        if ($res[0] == pdf_parser::TYPE_OBJECT)
+            return $res[1];
+        return $res;
+    }
+
+    /**
+     * Get content of current page.
+     *
+     * If /Contents is an array, the streams are concatenated
+     *
+     * @return string
+     */
+    public function getContent()
+    {
+        $buffer = '';
+
+        if (isset($this->_pages[$this->pageNo][1][1]['/Contents'])) {
+            $contents = $this->_getPageContent($this->_pages[$this->pageNo][1][1]['/Contents']);
+            foreach ($contents AS $tmpContent) {
+                $buffer .= $this->_unFilterStream($tmpContent) . ' ';
+            }
+        }
+
+        return $buffer;
+    }
+
+    /**
+     * Resolve all content objects.
+     *
+     * @param array $contentRef
+     * @return array
+     */
+    protected function _getPageContent($contentRef)
+    {
+        $contents = array();
+
+        if ($contentRef[0] == pdf_parser::TYPE_OBJREF) {
+            $content = $this->resolveObject($contentRef);
+            if ($content[1][0] == pdf_parser::TYPE_ARRAY) {
+                $contents = $this->_getPageContent($content[1]);
+            } else {
+                $contents[] = $content;
+            }
+        } else if ($contentRef[0] == pdf_parser::TYPE_ARRAY) {
+            foreach ($contentRef[1] AS $tmp_content_ref) {
+                $contents = array_merge($contents, $this->_getPageContent($tmp_content_ref));
+            }
+        }
+
+        return $contents;
+    }
+
+    /**
+     * Get a boundary box from a page
+     *
+     * Array format is same as used by FPDF_TPL.
+     *
+     * @param array $page a /Page dictionary
+     * @param string $boxIndex Type of box {see {@link $availableBoxes})
+     * @param float Scale factor from user space units to points
+     *
+     * @return array|boolean
+     */
+    protected function _getPageBox($page, $boxIndex, $k)
+    {
+        $page = $this->resolveObject($page);
+        $box = null;
+        if (isset($page[1][1][$boxIndex])) {
+            $box = $page[1][1][$boxIndex];
+        }
+
+        if (!is_null($box) && $box[0] == pdf_parser::TYPE_OBJREF) {
+            $tmp_box = $this->resolveObject($box);
+            $box = $tmp_box[1];
+        }
+
+        if (!is_null($box) && $box[0] == pdf_parser::TYPE_ARRAY) {
+            $b = $box[1];
+            return array(
+                'x' => $b[0][1] / $k,
+                'y' => $b[1][1] / $k,
+                'w' => abs($b[0][1] - $b[2][1]) / $k,
+                'h' => abs($b[1][1] - $b[3][1]) / $k,
+                'llx' => min($b[0][1], $b[2][1]) / $k,
+                'lly' => min($b[1][1], $b[3][1]) / $k,
+                'urx' => max($b[0][1], $b[2][1]) / $k,
+                'ury' => max($b[1][1], $b[3][1]) / $k,
+            );
+        } else if (!isset($page[1][1]['/Parent'])) {
+            return false;
+        } else {
+            return $this->_getPageBox($this->resolveObject($page[1][1]['/Parent']), $boxIndex, $k);
+        }
+    }
+
+    /**
+     * Get all page boundary boxes by page number
+     *
+     * @param int $pageNo The page number
+     * @param float $k Scale factor from user space units to points
+     * @return array
+     * @throws InvalidArgumentException
+     */
+    public function getPageBoxes($pageNo, $k)
+    {
+        if (!isset($this->_pages[$pageNo - 1])) {
+            throw new InvalidArgumentException('Page ' . $pageNo . ' does not exists.');
+        }
+
+        return $this->_getPageBoxes($this->_pages[$pageNo - 1], $k);
+    }
+
+    /**
+     * Get all boxes from /Page dictionary
+     *
+     * @param array $page A /Page dictionary
+     * @param float $k Scale factor from user space units to points
+     * @return array
+     */
+    protected function _getPageBoxes($page, $k)
+    {
+        $boxes = array();
+
+        foreach($this->availableBoxes AS $box) {
+            if ($_box = $this->_getPageBox($page, $box, $k)) {
+                $boxes[$box] = $_box;
+            }
+        }
+
+        return $boxes;
+    }
+
+    /**
+     * Get the page rotation by page number
+     *
+     * @param integer $pageNo
+     * @throws InvalidArgumentException
+     * @return array
+     */
+    public function getPageRotation($pageNo)
+    {
+        if (!isset($this->_pages[$pageNo - 1])) {
+            throw new InvalidArgumentException('Page ' . $pageNo . ' does not exists.');
+        }
+
+        return $this->_getPageRotation($this->_pages[$pageNo - 1]);
+    }
+
+    /**
+     * Get the rotation value of a page
+     *
+     * @param array $obj A /Page dictionary
+     * @return array|bool
+     */
+    protected function _getPageRotation($obj)
+    {
+    	$obj = $this->resolveObject($obj);
+    	if (isset($obj[1][1]['/Rotate'])) {
+    		$res = $this->resolveObject($obj[1][1]['/Rotate']);
+    		if ($res[0] == pdf_parser::TYPE_OBJECT)
+                return $res[1];
+            return $res;
+    	}
+
+        if (!isset($obj[1][1]['/Parent'])) {
+            return false;
+        }
+
+        $res = $this->_getPageRotation($obj[1][1]['/Parent']);
+        if ($res[0] == pdf_parser::TYPE_OBJECT)
+            return $res[1];
+
+        return $res;
+    }
+
+    /**
+     * Read all pages
+     *
+     * @param array $pages /Pages dictionary
+     * @param array $result The result array
+     * @throws Exception
+     */
+    protected function _readPages(&$pages, &$result)
+    {
+        // Get the kids dictionary
+    	$_kids = $this->resolveObject($pages[1][1]['/Kids']);
+
+        if (!is_array($_kids)) {
+            throw new Exception('Cannot find /Kids in current /Page-Dictionary');
+        }
+
+        if ($_kids[0] === self::TYPE_OBJECT) {
+            $_kids =  $_kids[1];
+        }
+
+        $kids = $_kids[1];
+
+        foreach ($kids as $v) {
+    		$pg = $this->resolveObject($v);
+            if ($pg[1][1]['/Type'][1] === '/Pages') {
+                // If one of the kids is an embedded
+    			// /Pages array, resolve it as well.
+                $this->_readPages($pg, $result);
+    		} else {
+    			$result[] = $pg;
+    		}
+    	}
+    }
 }

+ 152 - 152
resources/fpdi/pdf_context.php

@@ -1,153 +1,153 @@
-<?php
-//
-//  FPDI - Version 1.5.2
-//
-//    Copyright 2004-2014 Setasign - Jan Slabon
-//
-//  Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
-//
-//  Unless required by applicable law or agreed to in writing, software
-//  distributed under the License is distributed on an "AS IS" BASIS,
-//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//  See the License for the specific language governing permissions and
-//  limitations under the License.
-//
-
-/**
- * Class pdf_context
- */
-class pdf_context
-{
-    /**
-     * Mode
-     *
-     * @var integer 0 = file | 1 = string
-     */
-    protected $_mode = 0;
-
-    /**
-     * @var resource|string
-     */
-    public $file;
-
-    /**
-     * @var string
-     */
-    public $buffer;
-
-    /**
-     * @var integer
-     */
-    public $offset;
-
-    /**
-     * @var integer
-     */
-    public $length;
-
-    /**
-     * @var array
-     */
-    public $stack;
-
-    /**
-     * The constructor
-     *
-     * @param resource $f
-     */
-    public function __construct(&$f)
-    {
-        $this->file =& $f;
-        if (is_string($this->file))
-            $this->_mode = 1;
-
-        $this->reset();
-    }
-
-    /**
-     * Get the position in the file stream
-     *
-     * @return int
-     */
-    public function getPos()
-    {
-        if ($this->_mode == 0) {
-            return ftell($this->file);
-        } else {
-            return 0;
-        }
-    }
-
-    /**
-     * Reset the position in the file stream.
-     *
-     * Optionally move the file pointer to a new location and reset the buffered data.
-     *
-     * @param null $pos
-     * @param int $l
-     */
-    public function reset($pos = null, $l = 100)
-    {
-        if ($this->_mode == 0) {
-            if (!is_null($pos)) {
-                fseek ($this->file, $pos);
-            }
-
-            $this->buffer = $l > 0 ? fread($this->file, $l) : '';
-            $this->length = strlen($this->buffer);
-            if ($this->length < $l)
-                $this->increaseLength($l - $this->length);
-        } else {
-            $this->buffer = $this->file;
-            $this->length = strlen($this->buffer);
-        }
-        $this->offset = 0;
-        $this->stack = array();
-    }
-
-    /**
-     * Make sure that there is at least one character beyond the current offset in the buffer.
-     *
-     * To prevent the tokenizer from attempting to access data that does not exist.
-     *
-     * @return bool
-     */
-    public function ensureContent()
-    {
-        if ($this->offset >= $this->length - 1) {
-            return $this->increaseLength();
-        } else {
-            return true;
-        }
-    }
-
-    /**
-     * Forcefully read more data into the buffer
-     *
-     * @param int $l
-     * @return bool
-     */
-    public function increaseLength($l = 100)
-    {
-        if ($this->_mode == 0 && feof($this->file)) {
-            return false;
-        } else if ($this->_mode == 0) {
-            $totalLength = $this->length + $l;
-            do {
-                $toRead = $totalLength - $this->length;
-                if ($toRead < 1)
-                    break;
-
-                $this->buffer .= fread($this->file, $toRead);
-            } while ((($this->length = strlen($this->buffer)) != $totalLength) && !feof($this->file));
-
-            return true;
-        } else {
-            return false;
-        }
-    }
+<?php
+//
+//  FPDI - Version 1.5.2
+//
+//    Copyright 2004-2014 Setasign - Jan Slabon
+//
+//  Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+
+/**
+ * Class pdf_context
+ */
+class pdf_context
+{
+    /**
+     * Mode
+     *
+     * @var integer 0 = file | 1 = string
+     */
+    protected $_mode = 0;
+
+    /**
+     * @var resource|string
+     */
+    public $file;
+
+    /**
+     * @var string
+     */
+    public $buffer;
+
+    /**
+     * @var integer
+     */
+    public $offset;
+
+    /**
+     * @var integer
+     */
+    public $length;
+
+    /**
+     * @var array
+     */
+    public $stack;
+
+    /**
+     * The constructor
+     *
+     * @param resource $f
+     */
+    public function __construct(&$f)
+    {
+        $this->file =& $f;
+        if (is_string($this->file))
+            $this->_mode = 1;
+
+        $this->reset();
+    }
+
+    /**
+     * Get the position in the file stream
+     *
+     * @return int
+     */
+    public function getPos()
+    {
+        if ($this->_mode == 0) {
+            return ftell($this->file);
+        } else {
+            return 0;
+        }
+    }
+
+    /**
+     * Reset the position in the file stream.
+     *
+     * Optionally move the file pointer to a new location and reset the buffered data.
+     *
+     * @param null $pos
+     * @param int $l
+     */
+    public function reset($pos = null, $l = 100)
+    {
+        if ($this->_mode == 0) {
+            if (!is_null($pos)) {
+                fseek ($this->file, $pos);
+            }
+
+            $this->buffer = $l > 0 ? fread($this->file, $l) : '';
+            $this->length = strlen($this->buffer);
+            if ($this->length < $l)
+                $this->increaseLength($l - $this->length);
+        } else {
+            $this->buffer = $this->file;
+            $this->length = strlen($this->buffer);
+        }
+        $this->offset = 0;
+        $this->stack = array();
+    }
+
+    /**
+     * Make sure that there is at least one character beyond the current offset in the buffer.
+     *
+     * To prevent the tokenizer from attempting to access data that does not exist.
+     *
+     * @return bool
+     */
+    public function ensureContent()
+    {
+        if ($this->offset >= $this->length - 1) {
+            return $this->increaseLength();
+        } else {
+            return true;
+        }
+    }
+
+    /**
+     * Forcefully read more data into the buffer
+     *
+     * @param int $l
+     * @return bool
+     */
+    public function increaseLength($l = 100)
+    {
+        if ($this->_mode == 0 && feof($this->file)) {
+            return false;
+        } else if ($this->_mode == 0) {
+            $totalLength = $this->length + $l;
+            do {
+                $toRead = $totalLength - $this->length;
+                if ($toRead < 1)
+                    break;
+
+                $this->buffer .= fread($this->file, $toRead);
+            } while ((($this->length = strlen($this->buffer)) != $totalLength) && !feof($this->file));
+
+            return true;
+        } else {
+            return false;
+        }
+    }
 }

+ 912 - 912
resources/fpdi/pdf_parser.php

@@ -1,913 +1,913 @@
-<?php
-//
-//  FPDI - Version 1.5.2
-//
-//    Copyright 2004-2014 Setasign - Jan Slabon
-//
-//  Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
-//
-//  Unless required by applicable law or agreed to in writing, software
-//  distributed under the License is distributed on an "AS IS" BASIS,
-//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//  See the License for the specific language governing permissions and
-//  limitations under the License.
-//
-
-/**
- * Class pdf_parser
- */
-class pdf_parser
-{
-    /**
-     * Type constant
-     *
-     * @var integer
-     */
-    const TYPE_NULL = 0;
-
-    /**
-     * Type constant
-     *
-     * @var integer
-     */
-    const TYPE_NUMERIC = 1;
-
-    /**
-     * Type constant
-     *
-     * @var integer
-     */
-    const TYPE_TOKEN = 2;
-
-    /**
-     * Type constant
-     *
-     * @var integer
-     */
-    const TYPE_HEX = 3;
-
-    /**
-     * Type constant
-     *
-     * @var integer
-     */
-    const TYPE_STRING = 4;
-
-    /**
-     * Type constant
-     *
-     * @var integer
-     */
-    const TYPE_DICTIONARY = 5;
-
-    /**
-     * Type constant
-     *
-     * @var integer
-     */
-    const TYPE_ARRAY = 6;
-
-    /**
-     * Type constant
-     *
-     * @var integer
-     */
-    const TYPE_OBJDEC = 7;
-
-    /**
-     * Type constant
-     *
-     * @var integer
-     */
-    const TYPE_OBJREF = 8;
-
-    /**
-     * Type constant
-     *
-     * @var integer
-     */
-    const TYPE_OBJECT = 9;
-
-    /**
-     * Type constant
-     *
-     * @var integer
-     */
-    const TYPE_STREAM = 10;
-
-    /**
-     * Type constant
-     *
-     * @var integer
-     */
-    const TYPE_BOOLEAN = 11;
-
-    /**
-     * Type constant
-     *
-     * @var integer
-     */
-    const TYPE_REAL = 12;
-
-    /**
-     * Define the amount of byte in which the initial keyword of a PDF document should be searched.
-     *
-     * @var int
-     */
-    static public $searchForStartxrefLength = 5500;
-
-    /**
-     * Filename
-     *
-     * @var string
-     */
-    public $filename;
-
-    /**
-     * File resource
-     *
-     * @var resource
-     */
-    protected $_f;
-
-    /**
-     * PDF Context
-     *
-     * @var pdf_context
-     */
-    protected $_c;
-
-    /**
-     * xref-Data
-     *
-     * @var array
-     */
-    protected $_xref;
-
-    /**
-     * Data of the Root object
-     *
-     * @var array
-     */
-    protected $_root;
-
-    /**
-     * PDF version of the loaded document
-     *
-     * @var string
-     */
-    protected $_pdfVersion;
-
-    /**
-     * For reading encrypted documents and xref/object streams are in use
-     *
-     * @var boolean
-     */
-    protected $_readPlain = true;
-
-    /**
-     * The current read object
-     *
-     * @var array
-     */
-    protected $_currentObj;
-
-    /**
-     * Constructor
-     *
-     * @param string $filename Source filename
-     * @throws InvalidArgumentException
-     */
-    public function __construct($filename)
-    {
-        $this->filename = $filename;
-
-        $this->_f = @fopen($this->filename, 'rb');
-
-        if (!$this->_f) {
-            throw new InvalidArgumentException(sprintf('Cannot open %s !', $filename));
-        }
-
-        $this->getPdfVersion();
-
-        require_once('pdf_context.php');
-        $this->_c = new pdf_context($this->_f);
-
-        // Read xref-Data
-        $this->_xref = array();
-        $this->_readXref($this->_xref, $this->_findXref());
-
-        // Check for Encryption
-        $this->getEncryption();
-
-        // Read root
-        $this->_readRoot();
-    }
-
-    /**
-     * Destructor
-     */
-    public function __destruct()
-    {
-        $this->closeFile();
-    }
-
-    /**
-     * Close the opened file
-     */
-    public function closeFile()
-    {
-        if (isset($this->_f) && is_resource($this->_f)) {
-            fclose($this->_f);
-            unset($this->_f);
-        }
-    }
-
-    /**
-     * Check Trailer for Encryption
-     *
-     * @throws Exception
-     */
-    public function getEncryption()
-    {
-        if (isset($this->_xref['trailer'][1]['/Encrypt'])) {
-            throw new Exception('File is encrypted!');
-        }
-    }
-
-    /**
-     * Get PDF-Version
-     *
-     * @return string
-     */
-    public function getPdfVersion()
-    {
-        if ($this->_pdfVersion === null) {
-            fseek($this->_f, 0);
-            preg_match('/\d\.\d/', fread($this->_f, 16), $m);
-            if (isset($m[0]))
-                $this->_pdfVersion = $m[0];
-        }
-
-        return $this->_pdfVersion;
-    }
-
-    /**
-     * Read the /Root dictionary
-     */
-    protected function _readRoot()
-    {
-        if ($this->_xref['trailer'][1]['/Root'][0] != self::TYPE_OBJREF) {
-            throw new Exception('Wrong Type of Root-Element! Must be an indirect reference');
-        }
-
-        $this->_root = $this->resolveObject($this->_xref['trailer'][1]['/Root']);
-    }
-
-    /**
-     * Find the xref table
-     *
-     * @return integer
-     * @throws Exception
-     */
-    protected function _findXref()
-    {
-        $toRead = self::$searchForStartxrefLength;
-
-        $stat = fseek($this->_f, -$toRead, SEEK_END);
-        if ($stat === -1) {
-            fseek($this->_f, 0);
-        }
-
-        $data = fread($this->_f, $toRead);
-
-        $keywordPos = strpos(strrev($data), strrev('startxref'));
-        if (false === $keywordPos) {
-            $keywordPos = strpos(strrev($data), strrev('startref'));
-        }
-
-        if (false === $keywordPos) {
-            throw new Exception('Unable to find "startxref" keyword.');
-        }
-
-        $pos = strlen($data) - $keywordPos;
-        $data = substr($data, $pos);
-
-        if (!preg_match('/\s*(\d+).*$/s', $data, $matches)) {
-            throw new Exception('Unable to find pointer to xref table.');
-        }
-
-        return (int) $matches[1];
-    }
-
-    /**
-     * Read the xref table
-     *
-     * @param array $result Array of xref table entries
-     * @param integer $offset of xref table
-     * @return boolean
-     * @throws Exception
-     */
-    protected function _readXref(&$result, $offset)
-    {
-        $tempPos = $offset - min(20, $offset);
-        fseek($this->_f, $tempPos); // set some bytes backwards to fetch corrupted docs
-
-        $data = fread($this->_f, 100);
-
-        $xrefPos = strrpos($data, 'xref');
-
-        if ($xrefPos === false) {
-            $this->_c->reset($offset);
-            $xrefStreamObjDec = $this->_readValue($this->_c);
-
-            if (is_array($xrefStreamObjDec) && isset($xrefStreamObjDec[0]) && $xrefStreamObjDec[0] == self::TYPE_OBJDEC) {
-                throw new Exception(
-                    sprintf(
-                        'This document (%s) probably uses a compression technique which is not supported by the ' .
-                        'free parser shipped with FPDI. (See https://www.setasign.com/fpdi-pdf-parser for more details)',
-                        $this->filename
-                    )
-                );
-            } else {
-                throw new Exception('Unable to find xref table.');
-            }
-        }
-
-        if (!isset($result['xrefLocation'])) {
-            $result['xrefLocation'] = $tempPos + $xrefPos;
-            $result['maxObject'] = 0;
-        }
-
-        $cycles = -1;
-        $bytesPerCycle = 100;
-
-        fseek($this->_f, $tempPos = $tempPos + $xrefPos + 4); // set the handle directly after the "xref"-keyword
-        $data = fread($this->_f, $bytesPerCycle);
-
-        while (($trailerPos = strpos($data, 'trailer', max($bytesPerCycle * $cycles++, 0))) === false && !feof($this->_f)) {
-            $data .= fread($this->_f, $bytesPerCycle);
-        }
-
-        if ($trailerPos === false) {
-            throw new Exception('Trailer keyword not found after xref table');
-        }
-
-        $data = ltrim(substr($data, 0, $trailerPos));
-
-        // get Line-Ending
-        preg_match_all("/(\r\n|\n|\r)/", substr($data, 0, 100), $m); // check the first 100 bytes for line breaks
-
-        $differentLineEndings = count(array_unique($m[0]));
-        if ($differentLineEndings > 1) {
-            $lines = preg_split("/(\r\n|\n|\r)/", $data, -1, PREG_SPLIT_NO_EMPTY);
-        } else {
-            $lines = explode($m[0][0], $data);
-        }
-
-        $data = $differentLineEndings = $m = null;
-        unset($data, $differentLineEndings, $m);
-
-        $linesCount = count($lines);
-
-        $start = 1;
-
-        for ($i = 0; $i < $linesCount; $i++) {
-            $line = trim($lines[$i]);
-            if ($line) {
-                $pieces = explode(' ', $line);
-                $c = count($pieces);
-                switch($c) {
-                    case 2:
-                        $start = (int)$pieces[0];
-                        $end   = $start + (int)$pieces[1];
-                        if ($end > $result['maxObject'])
-                            $result['maxObject'] = $end;
-                        break;
-                    case 3:
-                        if (!isset($result['xref'][$start]))
-                            $result['xref'][$start] = array();
-
-                        if (!array_key_exists($gen = (int) $pieces[1], $result['xref'][$start])) {
-                            $result['xref'][$start][$gen] = $pieces[2] == 'n' ? (int) $pieces[0] : null;
-                        }
-                        $start++;
-                        break;
-                    default:
-                        throw new Exception('Unexpected data in xref table');
-                }
-            }
-        }
-
-        $lines = $pieces = $line = $start = $end = $gen = null;
-        unset($lines, $pieces, $line, $start, $end, $gen);
-
-        $this->_c->reset($tempPos + $trailerPos + 7);
-        $trailer = $this->_readValue($this->_c);
-
-        if (!isset($result['trailer'])) {
-            $result['trailer'] = $trailer;
-        }
-
-        if (isset($trailer[1]['/Prev'])) {
-            $this->_readXref($result, $trailer[1]['/Prev'][1]);
-        }
-
-        $trailer = null;
-        unset($trailer);
-
-        return true;
-    }
-
-    /**
-     * Reads a PDF value
-     *
-     * @param pdf_context $c
-     * @param string $token A token
-     * @return mixed
-     */
-    protected function _readValue(&$c, $token = null)
-    {
-        if (is_null($token)) {
-            $token = $this->_readToken($c);
-        }
-
-        if ($token === false) {
-            return false;
-        }
-
-        switch ($token) {
-            case '<':
-                // This is a hex string.
-                // Read the value, then the terminator
-
-                $pos = $c->offset;
-
-                while(1) {
-
-                    $match = strpos ($c->buffer, '>', $pos);
-
-                    // If you can't find it, try
-                    // reading more data from the stream
-
-                    if ($match === false) {
-                        if (!$c->increaseLength()) {
-                            return false;
-                        } else {
-                            continue;
-                        }
-                    }
-
-                    $result = substr ($c->buffer, $c->offset, $match - $c->offset);
-                    $c->offset = $match + 1;
-
-                    return array (self::TYPE_HEX, $result);
-                }
-                break;
-
-            case '<<':
-                // This is a dictionary.
-
-                $result = array();
-
-                // Recurse into this function until we reach
-                // the end of the dictionary.
-                while (($key = $this->_readToken($c)) !== '>>') {
-                    if ($key === false) {
-                        return false;
-                    }
-
-                    if (($value =   $this->_readValue($c)) === false) {
-                        return false;
-                    }
-
-                    // Catch missing value
-                    if ($value[0] == self::TYPE_TOKEN && $value[1] == '>>') {
-                        $result[$key] = array(self::TYPE_NULL);
-                        break;
-                    }
-
-                    $result[$key] = $value;
-                }
-
-                return array (self::TYPE_DICTIONARY, $result);
-
-            case '[':
-                // This is an array.
-
-                $result = array();
-
-                // Recurse into this function until we reach
-                // the end of the array.
-                while (($token = $this->_readToken($c)) !== ']') {
-                    if ($token === false) {
-                        return false;
-                    }
-
-                    if (($value = $this->_readValue($c, $token)) === false) {
-                        return false;
-                    }
-
-                    $result[] = $value;
-                }
-
-                return array (self::TYPE_ARRAY, $result);
-
-            case '(':
-                // This is a string
-                $pos = $c->offset;
-
-                $openBrackets = 1;
-                do {
-                    for (; $openBrackets != 0 && $pos < $c->length; $pos++) {
-                        switch (ord($c->buffer[$pos])) {
-                            case 0x28: // '('
-                                $openBrackets++;
-                                break;
-                            case 0x29: // ')'
-                                $openBrackets--;
-                                break;
-                            case 0x5C: // backslash
-                                $pos++;
-                        }
-                    }
-                } while($openBrackets != 0 && $c->increaseLength());
-
-                $result = substr($c->buffer, $c->offset, $pos - $c->offset - 1);
-                $c->offset = $pos;
-
-                return array (self::TYPE_STRING, $result);
-
-            case 'stream':
-                $tempPos = $c->getPos() - strlen($c->buffer);
-                $tempOffset = $c->offset;
-
-                $c->reset($startPos = $tempPos + $tempOffset);
-
-                $e = 0; // ensure line breaks in front of the stream
-                if ($c->buffer[0] == chr(10) || $c->buffer[0] == chr(13))
-                    $e++;
-                if ($c->buffer[1] == chr(10) && $c->buffer[0] != chr(10))
-                    $e++;
-
-                if ($this->_currentObj[1][1]['/Length'][0] == self::TYPE_OBJREF) {
-                    $tmpLength = $this->resolveObject($this->_currentObj[1][1]['/Length']);
-                    $length = $tmpLength[1][1];
-                } else {
-                    $length = $this->_currentObj[1][1]['/Length'][1];
-                }
-
-                if ($length > 0) {
-                    $c->reset($startPos + $e, $length);
-                    $v = $c->buffer;
-                } else {
-                    $v = '';
-                }
-
-                $c->reset($startPos + $e + $length);
-                $endstream = $this->_readToken($c);
-
-                if ($endstream != 'endstream') {
-                    $c->reset($startPos + $e + $length + 9); // 9 = strlen("endstream")
-                    // We don't throw an error here because the next
-                    // round trip will start at a new offset
-                }
-
-                return array(self::TYPE_STREAM, $v);
-
-            default	:
-                if (is_numeric($token)) {
-                    // A numeric token. Make sure that
-                    // it is not part of something else.
-                    if (($tok2 = $this->_readToken($c)) !== false) {
-                        if (is_numeric($tok2)) {
-
-                            // Two numeric tokens in a row.
-                            // In this case, we're probably in
-                            // front of either an object reference
-                            // or an object specification.
-                            // Determine the case and return the data
-                            if (($tok3 = $this->_readToken($c)) !== false) {
-                                switch ($tok3) {
-                                    case 'obj':
-                                        return array(self::TYPE_OBJDEC, (int)$token, (int)$tok2);
-                                    case 'R':
-                                        return array(self::TYPE_OBJREF, (int)$token, (int)$tok2);
-                                }
-                                // If we get to this point, that numeric value up
-                                // there was just a numeric value. Push the extra
-                                // tokens back into the stack and return the value.
-                                array_push($c->stack, $tok3);
-                            }
-                        }
-
-                        array_push($c->stack, $tok2);
-                    }
-
-                    if ($token === (string)((int)$token))
-                        return array(self::TYPE_NUMERIC, (int)$token);
-                    else
-                        return array(self::TYPE_REAL, (float)$token);
-                } else if ($token == 'true' || $token == 'false') {
-                    return array(self::TYPE_BOOLEAN, $token == 'true');
-                } else if ($token == 'null') {
-                   return array(self::TYPE_NULL);
-                } else {
-                    // Just a token. Return it.
-                    return array(self::TYPE_TOKEN, $token);
-                }
-         }
-    }
-
-    /**
-     * Resolve an object
-     *
-     * @param array $objSpec The object-data
-     * @return array|boolean
-     * @throws Exception
-     */
-    public function resolveObject($objSpec)
-    {
-        $c = $this->_c;
-
-        // Exit if we get invalid data
-        if (!is_array($objSpec)) {
-            return false;
-        }
-
-        if ($objSpec[0] == self::TYPE_OBJREF) {
-
-            // This is a reference, resolve it
-            if (isset($this->_xref['xref'][$objSpec[1]][$objSpec[2]])) {
-
-                // Save current file position
-                // This is needed if you want to resolve
-                // references while you're reading another object
-                // (e.g.: if you need to determine the length
-                // of a stream)
-
-                $oldPos = $c->getPos();
-
-                // Reposition the file pointer and
-                // load the object header.
-
-                $c->reset($this->_xref['xref'][$objSpec[1]][$objSpec[2]]);
-
-                $header = $this->_readValue($c);
-
-                if ($header[0] != self::TYPE_OBJDEC || $header[1] != $objSpec[1] || $header[2] != $objSpec[2]) {
-                    $toSearchFor = $objSpec[1] . ' ' . $objSpec[2] . ' obj';
-                    if (preg_match('/' . $toSearchFor . '/', $c->buffer)) {
-                        $c->offset = strpos($c->buffer, $toSearchFor) + strlen($toSearchFor);
-                        // reset stack
-                        $c->stack = array();
-                    } else {
-                        throw new Exception(
-                            sprintf("Unable to find object (%s, %s) at expected location.", $objSpec[1], $objSpec[2])
-                        );
-                    }
-                }
-
-                // If we're being asked to store all the information
-                // about the object, we add the object ID and generation
-                // number for later use
-                $result = array (
-                    self::TYPE_OBJECT,
-                    'obj' => $objSpec[1],
-                    'gen' => $objSpec[2]
-                );
-
-                $this->_currentObj =& $result;
-
-                // Now simply read the object data until
-                // we encounter an end-of-object marker
-                while (true) {
-                    $value = $this->_readValue($c);
-                    if ($value === false || count($result) > 4) {
-                        // in this case the parser couldn't find an "endobj" so we break here
-                        break;
-                    }
-
-                    if ($value[0] == self::TYPE_TOKEN && $value[1] === 'endobj') {
-                        break;
-                    }
-
-                    $result[] = $value;
-                }
-
-                $c->reset($oldPos);
-
-                if (isset($result[2][0]) && $result[2][0] == self::TYPE_STREAM) {
-                    $result[0] = self::TYPE_STREAM;
-                }
-
-            } else {
-                throw new Exception(
-                    sprintf("Unable to find object (%s, %s) at expected location.", $objSpec[1], $objSpec[2])
-                );
-            }
-
-            return $result;
-        } else {
-            return $objSpec;
-        }
-    }
-
-    /**
-     * Reads a token from the context
-     *
-     * @param pdf_context $c
-     * @return mixed
-     */
-    protected function _readToken($c)
-    {
-        // If there is a token available
-        // on the stack, pop it out and
-        // return it.
-
-        if (count($c->stack)) {
-            return array_pop($c->stack);
-        }
-
-        // Strip away any whitespace
-
-        do {
-            if (!$c->ensureContent()) {
-                return false;
-            }
-            $c->offset += strspn($c->buffer, "\x20\x0A\x0C\x0D\x09\x00", $c->offset);
-        } while ($c->offset >= $c->length - 1);
-
-        // Get the first character in the stream
-
-        $char = $c->buffer[$c->offset++];
-
-        switch ($char) {
-
-            case '[':
-            case ']':
-            case '(':
-            case ')':
-
-                // This is either an array or literal string
-                // delimiter, Return it
-
-                return $char;
-
-            case '<':
-            case '>':
-
-                // This could either be a hex string or
-                // dictionary delimiter. Determine the
-                // appropriate case and return the token
-
-                if ($c->buffer[$c->offset] == $char) {
-                    if (!$c->ensureContent()) {
-                        return false;
-                    }
-                    $c->offset++;
-                    return $char . $char;
-                } else {
-                    return $char;
-                }
-
-            case '%':
-
-                // This is a comment - jump over it!
-
-                $pos = $c->offset;
-                while(1) {
-                    $match = preg_match("/(\r\n|\r|\n)/", $c->buffer, $m, PREG_OFFSET_CAPTURE, $pos);
-                    if ($match === 0) {
-                        if (!$c->increaseLength()) {
-                            return false;
-                        } else {
-                            continue;
-                        }
-                    }
-
-                    $c->offset = $m[0][1] + strlen($m[0][0]);
-
-                    return $this->_readToken($c);
-                }
-
-            default:
-
-                // This is "another" type of token (probably
-                // a dictionary entry or a numeric value)
-                // Find the end and return it.
-
-                if (!$c->ensureContent()) {
-                    return false;
-                }
-
-                while(1) {
-
-                    // Determine the length of the token
-
-                    $pos = strcspn($c->buffer, "\x20%[]<>()/\x0A\x0C\x0D\x09\x00", $c->offset);
-
-                    if ($c->offset + $pos <= $c->length - 1) {
-                        break;
-                    } else {
-                        // If the script reaches this point,
-                        // the token may span beyond the end
-                        // of the current buffer. Therefore,
-                        // we increase the size of the buffer
-                        // and try again--just to be safe.
-
-                        $c->increaseLength();
-                    }
-                }
-
-                $result = substr($c->buffer, $c->offset - 1, $pos + 1);
-
-                $c->offset += $pos;
-
-                return $result;
-        }
-    }
-
-    /**
-     * Un-filter a stream object
-     *
-     * @param array $obj
-     * @return string
-     * @throws Exception
-     */
-    protected function _unFilterStream($obj)
-    {
-        $filters = array();
-
-        if (isset($obj[1][1]['/Filter'])) {
-            $filter = $obj[1][1]['/Filter'];
-
-            if ($filter[0] == pdf_parser::TYPE_OBJREF) {
-                $tmpFilter = $this->resolveObject($filter);
-                $filter = $tmpFilter[1];
-            }
-
-            if ($filter[0] == pdf_parser::TYPE_TOKEN) {
-                $filters[] = $filter;
-            } else if ($filter[0] == pdf_parser::TYPE_ARRAY) {
-                $filters = $filter[1];
-            }
-        }
-
-        $stream = $obj[2][1];
-
-        foreach ($filters AS $filter) {
-            switch ($filter[1]) {
-                case '/FlateDecode':
-                case '/Fl':
-                    if (function_exists('gzuncompress')) {
-                        $oStream = $stream;
-                        $stream = (strlen($stream) > 0) ? @gzuncompress($stream) : '';
-                    } else {
-                        throw new Exception(
-                            sprintf('To handle %s filter, please compile php with zlib support.', $filter[1])
-                        );
-                    }
-
-                    if ($stream === false) {
-                        $tries = 0;
-                        while ($tries < 8 && ($stream === false || strlen($stream) < strlen($oStream))) {
-                            $oStream = substr($oStream, 1);
-                            $stream = @gzinflate($oStream);
-                            $tries++;
-                        }
-
-                        if ($stream === false) {
-                            throw new Exception('Error while decompressing stream.');
-                        }
-                    }
-                    break;
-                case '/LZWDecode':
-                    require_once('filters/FilterLZW.php');
-                    $decoder = new FilterLZW();
-                    $stream = $decoder->decode($stream);
-                    break;
-                case '/ASCII85Decode':
-                    require_once('filters/FilterASCII85.php');
-                    $decoder = new FilterASCII85();
-                    $stream = $decoder->decode($stream);
-                    break;
-                case '/ASCIIHexDecode':
-                    require_once('filters/FilterASCIIHexDecode.php');
-                    $decoder = new FilterASCIIHexDecode();
-                    $stream = $decoder->decode($stream);
-                    break;
-                case null:
-                    break;
-                default:
-                    throw new Exception(sprintf('Unsupported Filter: %s', $filter[1]));
-            }
-        }
-
-        return $stream;
-    }
+<?php
+//
+//  FPDI - Version 1.5.2
+//
+//    Copyright 2004-2014 Setasign - Jan Slabon
+//
+//  Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+
+/**
+ * Class pdf_parser
+ */
+class pdf_parser
+{
+    /**
+     * Type constant
+     *
+     * @var integer
+     */
+    const TYPE_NULL = 0;
+
+    /**
+     * Type constant
+     *
+     * @var integer
+     */
+    const TYPE_NUMERIC = 1;
+
+    /**
+     * Type constant
+     *
+     * @var integer
+     */
+    const TYPE_TOKEN = 2;
+
+    /**
+     * Type constant
+     *
+     * @var integer
+     */
+    const TYPE_HEX = 3;
+
+    /**
+     * Type constant
+     *
+     * @var integer
+     */
+    const TYPE_STRING = 4;
+
+    /**
+     * Type constant
+     *
+     * @var integer
+     */
+    const TYPE_DICTIONARY = 5;
+
+    /**
+     * Type constant
+     *
+     * @var integer
+     */
+    const TYPE_ARRAY = 6;
+
+    /**
+     * Type constant
+     *
+     * @var integer
+     */
+    const TYPE_OBJDEC = 7;
+
+    /**
+     * Type constant
+     *
+     * @var integer
+     */
+    const TYPE_OBJREF = 8;
+
+    /**
+     * Type constant
+     *
+     * @var integer
+     */
+    const TYPE_OBJECT = 9;
+
+    /**
+     * Type constant
+     *
+     * @var integer
+     */
+    const TYPE_STREAM = 10;
+
+    /**
+     * Type constant
+     *
+     * @var integer
+     */
+    const TYPE_BOOLEAN = 11;
+
+    /**
+     * Type constant
+     *
+     * @var integer
+     */
+    const TYPE_REAL = 12;
+
+    /**
+     * Define the amount of byte in which the initial keyword of a PDF document should be searched.
+     *
+     * @var int
+     */
+    static public $searchForStartxrefLength = 5500;
+
+    /**
+     * Filename
+     *
+     * @var string
+     */
+    public $filename;
+
+    /**
+     * File resource
+     *
+     * @var resource
+     */
+    protected $_f;
+
+    /**
+     * PDF Context
+     *
+     * @var pdf_context
+     */
+    protected $_c;
+
+    /**
+     * xref-Data
+     *
+     * @var array
+     */
+    protected $_xref;
+
+    /**
+     * Data of the Root object
+     *
+     * @var array
+     */
+    protected $_root;
+
+    /**
+     * PDF version of the loaded document
+     *
+     * @var string
+     */
+    protected $_pdfVersion;
+
+    /**
+     * For reading encrypted documents and xref/object streams are in use
+     *
+     * @var boolean
+     */
+    protected $_readPlain = true;
+
+    /**
+     * The current read object
+     *
+     * @var array
+     */
+    protected $_currentObj;
+
+    /**
+     * Constructor
+     *
+     * @param string $filename Source filename
+     * @throws InvalidArgumentException
+     */
+    public function __construct($filename)
+    {
+        $this->filename = $filename;
+
+        $this->_f = @fopen($this->filename, 'rb');
+
+        if (!$this->_f) {
+            throw new InvalidArgumentException(sprintf('Cannot open %s !', $filename));
+        }
+
+        $this->getPdfVersion();
+
+        require_once('pdf_context.php');
+        $this->_c = new pdf_context($this->_f);
+
+        // Read xref-Data
+        $this->_xref = array();
+        $this->_readXref($this->_xref, $this->_findXref());
+
+        // Check for Encryption
+        $this->getEncryption();
+
+        // Read root
+        $this->_readRoot();
+    }
+
+    /**
+     * Destructor
+     */
+    public function __destruct()
+    {
+        $this->closeFile();
+    }
+
+    /**
+     * Close the opened file
+     */
+    public function closeFile()
+    {
+        if (isset($this->_f) && is_resource($this->_f)) {
+            fclose($this->_f);
+            unset($this->_f);
+        }
+    }
+
+    /**
+     * Check Trailer for Encryption
+     *
+     * @throws Exception
+     */
+    public function getEncryption()
+    {
+        if (isset($this->_xref['trailer'][1]['/Encrypt'])) {
+            throw new Exception('File is encrypted!');
+        }
+    }
+
+    /**
+     * Get PDF-Version
+     *
+     * @return string
+     */
+    public function getPdfVersion()
+    {
+        if ($this->_pdfVersion === null) {
+            fseek($this->_f, 0);
+            preg_match('/\d\.\d/', fread($this->_f, 16), $m);
+            if (isset($m[0]))
+                $this->_pdfVersion = $m[0];
+        }
+
+        return $this->_pdfVersion;
+    }
+
+    /**
+     * Read the /Root dictionary
+     */
+    protected function _readRoot()
+    {
+        if ($this->_xref['trailer'][1]['/Root'][0] != self::TYPE_OBJREF) {
+            throw new Exception('Wrong Type of Root-Element! Must be an indirect reference');
+        }
+
+        $this->_root = $this->resolveObject($this->_xref['trailer'][1]['/Root']);
+    }
+
+    /**
+     * Find the xref table
+     *
+     * @return integer
+     * @throws Exception
+     */
+    protected function _findXref()
+    {
+        $toRead = self::$searchForStartxrefLength;
+
+        $stat = fseek($this->_f, -$toRead, SEEK_END);
+        if ($stat === -1) {
+            fseek($this->_f, 0);
+        }
+
+        $data = fread($this->_f, $toRead);
+
+        $keywordPos = strpos(strrev($data), strrev('startxref'));
+        if (false === $keywordPos) {
+            $keywordPos = strpos(strrev($data), strrev('startref'));
+        }
+
+        if (false === $keywordPos) {
+            throw new Exception('Unable to find "startxref" keyword.');
+        }
+
+        $pos = strlen($data) - $keywordPos;
+        $data = substr($data, $pos);
+
+        if (!preg_match('/\s*(\d+).*$/s', $data, $matches)) {
+            throw new Exception('Unable to find pointer to xref table.');
+        }
+
+        return (int) $matches[1];
+    }
+
+    /**
+     * Read the xref table
+     *
+     * @param array $result Array of xref table entries
+     * @param integer $offset of xref table
+     * @return boolean
+     * @throws Exception
+     */
+    protected function _readXref(&$result, $offset)
+    {
+        $tempPos = $offset - min(20, $offset);
+        fseek($this->_f, $tempPos); // set some bytes backwards to fetch corrupted docs
+
+        $data = fread($this->_f, 100);
+
+        $xrefPos = strrpos($data, 'xref');
+
+        if ($xrefPos === false) {
+            $this->_c->reset($offset);
+            $xrefStreamObjDec = $this->_readValue($this->_c);
+
+            if (is_array($xrefStreamObjDec) && isset($xrefStreamObjDec[0]) && $xrefStreamObjDec[0] == self::TYPE_OBJDEC) {
+                throw new Exception(
+                    sprintf(
+                        'This document (%s) probably uses a compression technique which is not supported by the ' .
+                        'free parser shipped with FPDI. (See https://www.setasign.com/fpdi-pdf-parser for more details)',
+                        $this->filename
+                    )
+                );
+            } else {
+                throw new Exception('Unable to find xref table.');
+            }
+        }
+
+        if (!isset($result['xrefLocation'])) {
+            $result['xrefLocation'] = $tempPos + $xrefPos;
+            $result['maxObject'] = 0;
+        }
+
+        $cycles = -1;
+        $bytesPerCycle = 100;
+
+        fseek($this->_f, $tempPos = $tempPos + $xrefPos + 4); // set the handle directly after the "xref"-keyword
+        $data = fread($this->_f, $bytesPerCycle);
+
+        while (($trailerPos = strpos($data, 'trailer', max($bytesPerCycle * $cycles++, 0))) === false && !feof($this->_f)) {
+            $data .= fread($this->_f, $bytesPerCycle);
+        }
+
+        if ($trailerPos === false) {
+            throw new Exception('Trailer keyword not found after xref table');
+        }
+
+        $data = ltrim(substr($data, 0, $trailerPos));
+
+        // get Line-Ending
+        preg_match_all("/(\r\n|\n|\r)/", substr($data, 0, 100), $m); // check the first 100 bytes for line breaks
+
+        $differentLineEndings = count(array_unique($m[0]));
+        if ($differentLineEndings > 1) {
+            $lines = preg_split("/(\r\n|\n|\r)/", $data, -1, PREG_SPLIT_NO_EMPTY);
+        } else {
+            $lines = explode($m[0][0], $data);
+        }
+
+        $data = $differentLineEndings = $m = null;
+        unset($data, $differentLineEndings, $m);
+
+        $linesCount = count($lines);
+
+        $start = 1;
+
+        for ($i = 0; $i < $linesCount; $i++) {
+            $line = trim($lines[$i]);
+            if ($line) {
+                $pieces = explode(' ', $line);
+                $c = count($pieces);
+                switch($c) {
+                    case 2:
+                        $start = (int)$pieces[0];
+                        $end   = $start + (int)$pieces[1];
+                        if ($end > $result['maxObject'])
+                            $result['maxObject'] = $end;
+                        break;
+                    case 3:
+                        if (!isset($result['xref'][$start]))
+                            $result['xref'][$start] = array();
+
+                        if (!array_key_exists($gen = (int) $pieces[1], $result['xref'][$start])) {
+                            $result['xref'][$start][$gen] = $pieces[2] == 'n' ? (int) $pieces[0] : null;
+                        }
+                        $start++;
+                        break;
+                    default:
+                        throw new Exception('Unexpected data in xref table');
+                }
+            }
+        }
+
+        $lines = $pieces = $line = $start = $end = $gen = null;
+        unset($lines, $pieces, $line, $start, $end, $gen);
+
+        $this->_c->reset($tempPos + $trailerPos + 7);
+        $trailer = $this->_readValue($this->_c);
+
+        if (!isset($result['trailer'])) {
+            $result['trailer'] = $trailer;
+        }
+
+        if (isset($trailer[1]['/Prev'])) {
+            $this->_readXref($result, $trailer[1]['/Prev'][1]);
+        }
+
+        $trailer = null;
+        unset($trailer);
+
+        return true;
+    }
+
+    /**
+     * Reads a PDF value
+     *
+     * @param pdf_context $c
+     * @param string $token A token
+     * @return mixed
+     */
+    protected function _readValue(&$c, $token = null)
+    {
+        if (is_null($token)) {
+            $token = $this->_readToken($c);
+        }
+
+        if ($token === false) {
+            return false;
+        }
+
+        switch ($token) {
+            case '<':
+                // This is a hex string.
+                // Read the value, then the terminator
+
+                $pos = $c->offset;
+
+                while(1) {
+
+                    $match = strpos ($c->buffer, '>', $pos);
+
+                    // If you can't find it, try
+                    // reading more data from the stream
+
+                    if ($match === false) {
+                        if (!$c->increaseLength()) {
+                            return false;
+                        } else {
+                            continue;
+                        }
+                    }
+
+                    $result = substr ($c->buffer, $c->offset, $match - $c->offset);
+                    $c->offset = $match + 1;
+
+                    return array (self::TYPE_HEX, $result);
+                }
+                break;
+
+            case '<<':
+                // This is a dictionary.
+
+                $result = array();
+
+                // Recurse into this function until we reach
+                // the end of the dictionary.
+                while (($key = $this->_readToken($c)) !== '>>') {
+                    if ($key === false) {
+                        return false;
+                    }
+
+                    if (($value =   $this->_readValue($c)) === false) {
+                        return false;
+                    }
+
+                    // Catch missing value
+                    if ($value[0] == self::TYPE_TOKEN && $value[1] == '>>') {
+                        $result[$key] = array(self::TYPE_NULL);
+                        break;
+                    }
+
+                    $result[$key] = $value;
+                }
+
+                return array (self::TYPE_DICTIONARY, $result);
+
+            case '[':
+                // This is an array.
+
+                $result = array();
+
+                // Recurse into this function until we reach
+                // the end of the array.
+                while (($token = $this->_readToken($c)) !== ']') {
+                    if ($token === false) {
+                        return false;
+                    }
+
+                    if (($value = $this->_readValue($c, $token)) === false) {
+                        return false;
+                    }
+
+                    $result[] = $value;
+                }
+
+                return array (self::TYPE_ARRAY, $result);
+
+            case '(':
+                // This is a string
+                $pos = $c->offset;
+
+                $openBrackets = 1;
+                do {
+                    for (; $openBrackets != 0 && $pos < $c->length; $pos++) {
+                        switch (ord($c->buffer[$pos])) {
+                            case 0x28: // '('
+                                $openBrackets++;
+                                break;
+                            case 0x29: // ')'
+                                $openBrackets--;
+                                break;
+                            case 0x5C: // backslash
+                                $pos++;
+                        }
+                    }
+                } while($openBrackets != 0 && $c->increaseLength());
+
+                $result = substr($c->buffer, $c->offset, $pos - $c->offset - 1);
+                $c->offset = $pos;
+
+                return array (self::TYPE_STRING, $result);
+
+            case 'stream':
+                $tempPos = $c->getPos() - strlen($c->buffer);
+                $tempOffset = $c->offset;
+
+                $c->reset($startPos = $tempPos + $tempOffset);
+
+                $e = 0; // ensure line breaks in front of the stream
+                if ($c->buffer[0] == chr(10) || $c->buffer[0] == chr(13))
+                    $e++;
+                if ($c->buffer[1] == chr(10) && $c->buffer[0] != chr(10))
+                    $e++;
+
+                if ($this->_currentObj[1][1]['/Length'][0] == self::TYPE_OBJREF) {
+                    $tmpLength = $this->resolveObject($this->_currentObj[1][1]['/Length']);
+                    $length = $tmpLength[1][1];
+                } else {
+                    $length = $this->_currentObj[1][1]['/Length'][1];
+                }
+
+                if ($length > 0) {
+                    $c->reset($startPos + $e, $length);
+                    $v = $c->buffer;
+                } else {
+                    $v = '';
+                }
+
+                $c->reset($startPos + $e + $length);
+                $endstream = $this->_readToken($c);
+
+                if ($endstream != 'endstream') {
+                    $c->reset($startPos + $e + $length + 9); // 9 = strlen("endstream")
+                    // We don't throw an error here because the next
+                    // round trip will start at a new offset
+                }
+
+                return array(self::TYPE_STREAM, $v);
+
+            default	:
+                if (is_numeric($token)) {
+                    // A numeric token. Make sure that
+                    // it is not part of something else.
+                    if (($tok2 = $this->_readToken($c)) !== false) {
+                        if (is_numeric($tok2)) {
+
+                            // Two numeric tokens in a row.
+                            // In this case, we're probably in
+                            // front of either an object reference
+                            // or an object specification.
+                            // Determine the case and return the data
+                            if (($tok3 = $this->_readToken($c)) !== false) {
+                                switch ($tok3) {
+                                    case 'obj':
+                                        return array(self::TYPE_OBJDEC, (int)$token, (int)$tok2);
+                                    case 'R':
+                                        return array(self::TYPE_OBJREF, (int)$token, (int)$tok2);
+                                }
+                                // If we get to this point, that numeric value up
+                                // there was just a numeric value. Push the extra
+                                // tokens back into the stack and return the value.
+                                array_push($c->stack, $tok3);
+                            }
+                        }
+
+                        array_push($c->stack, $tok2);
+                    }
+
+                    if ($token === (string)((int)$token))
+                        return array(self::TYPE_NUMERIC, (int)$token);
+                    else
+                        return array(self::TYPE_REAL, (float)$token);
+                } else if ($token == 'true' || $token == 'false') {
+                    return array(self::TYPE_BOOLEAN, $token == 'true');
+                } else if ($token == 'null') {
+                   return array(self::TYPE_NULL);
+                } else {
+                    // Just a token. Return it.
+                    return array(self::TYPE_TOKEN, $token);
+                }
+         }
+    }
+
+    /**
+     * Resolve an object
+     *
+     * @param array $objSpec The object-data
+     * @return array|boolean
+     * @throws Exception
+     */
+    public function resolveObject($objSpec)
+    {
+        $c = $this->_c;
+
+        // Exit if we get invalid data
+        if (!is_array($objSpec)) {
+            return false;
+        }
+
+        if ($objSpec[0] == self::TYPE_OBJREF) {
+
+            // This is a reference, resolve it
+            if (isset($this->_xref['xref'][$objSpec[1]][$objSpec[2]])) {
+
+                // Save current file position
+                // This is needed if you want to resolve
+                // references while you're reading another object
+                // (e.g.: if you need to determine the length
+                // of a stream)
+
+                $oldPos = $c->getPos();
+
+                // Reposition the file pointer and
+                // load the object header.
+
+                $c->reset($this->_xref['xref'][$objSpec[1]][$objSpec[2]]);
+
+                $header = $this->_readValue($c);
+
+                if ($header[0] != self::TYPE_OBJDEC || $header[1] != $objSpec[1] || $header[2] != $objSpec[2]) {
+                    $toSearchFor = $objSpec[1] . ' ' . $objSpec[2] . ' obj';
+                    if (preg_match('/' . $toSearchFor . '/', $c->buffer)) {
+                        $c->offset = strpos($c->buffer, $toSearchFor) + strlen($toSearchFor);
+                        // reset stack
+                        $c->stack = array();
+                    } else {
+                        throw new Exception(
+                            sprintf("Unable to find object (%s, %s) at expected location.", $objSpec[1], $objSpec[2])
+                        );
+                    }
+                }
+
+                // If we're being asked to store all the information
+                // about the object, we add the object ID and generation
+                // number for later use
+                $result = array (
+                    self::TYPE_OBJECT,
+                    'obj' => $objSpec[1],
+                    'gen' => $objSpec[2]
+                );
+
+                $this->_currentObj =& $result;
+
+                // Now simply read the object data until
+                // we encounter an end-of-object marker
+                while (true) {
+                    $value = $this->_readValue($c);
+                    if ($value === false || count($result) > 4) {
+                        // in this case the parser couldn't find an "endobj" so we break here
+                        break;
+                    }
+
+                    if ($value[0] == self::TYPE_TOKEN && $value[1] === 'endobj') {
+                        break;
+                    }
+
+                    $result[] = $value;
+                }
+
+                $c->reset($oldPos);
+
+                if (isset($result[2][0]) && $result[2][0] == self::TYPE_STREAM) {
+                    $result[0] = self::TYPE_STREAM;
+                }
+
+            } else {
+                throw new Exception(
+                    sprintf("Unable to find object (%s, %s) at expected location.", $objSpec[1], $objSpec[2])
+                );
+            }
+
+            return $result;
+        } else {
+            return $objSpec;
+        }
+    }
+
+    /**
+     * Reads a token from the context
+     *
+     * @param pdf_context $c
+     * @return mixed
+     */
+    protected function _readToken($c)
+    {
+        // If there is a token available
+        // on the stack, pop it out and
+        // return it.
+
+        if (count($c->stack)) {
+            return array_pop($c->stack);
+        }
+
+        // Strip away any whitespace
+
+        do {
+            if (!$c->ensureContent()) {
+                return false;
+            }
+            $c->offset += strspn($c->buffer, "\x20\x0A\x0C\x0D\x09\x00", $c->offset);
+        } while ($c->offset >= $c->length - 1);
+
+        // Get the first character in the stream
+
+        $char = $c->buffer[$c->offset++];
+
+        switch ($char) {
+
+            case '[':
+            case ']':
+            case '(':
+            case ')':
+
+                // This is either an array or literal string
+                // delimiter, Return it
+
+                return $char;
+
+            case '<':
+            case '>':
+
+                // This could either be a hex string or
+                // dictionary delimiter. Determine the
+                // appropriate case and return the token
+
+                if ($c->buffer[$c->offset] == $char) {
+                    if (!$c->ensureContent()) {
+                        return false;
+                    }
+                    $c->offset++;
+                    return $char . $char;
+                } else {
+                    return $char;
+                }
+
+            case '%':
+
+                // This is a comment - jump over it!
+
+                $pos = $c->offset;
+                while(1) {
+                    $match = preg_match("/(\r\n|\r|\n)/", $c->buffer, $m, PREG_OFFSET_CAPTURE, $pos);
+                    if ($match === 0) {
+                        if (!$c->increaseLength()) {
+                            return false;
+                        } else {
+                            continue;
+                        }
+                    }
+
+                    $c->offset = $m[0][1] + strlen($m[0][0]);
+
+                    return $this->_readToken($c);
+                }
+
+            default:
+
+                // This is "another" type of token (probably
+                // a dictionary entry or a numeric value)
+                // Find the end and return it.
+
+                if (!$c->ensureContent()) {
+                    return false;
+                }
+
+                while(1) {
+
+                    // Determine the length of the token
+
+                    $pos = strcspn($c->buffer, "\x20%[]<>()/\x0A\x0C\x0D\x09\x00", $c->offset);
+
+                    if ($c->offset + $pos <= $c->length - 1) {
+                        break;
+                    } else {
+                        // If the script reaches this point,
+                        // the token may span beyond the end
+                        // of the current buffer. Therefore,
+                        // we increase the size of the buffer
+                        // and try again--just to be safe.
+
+                        $c->increaseLength();
+                    }
+                }
+
+                $result = substr($c->buffer, $c->offset - 1, $pos + 1);
+
+                $c->offset += $pos;
+
+                return $result;
+        }
+    }
+
+    /**
+     * Un-filter a stream object
+     *
+     * @param array $obj
+     * @return string
+     * @throws Exception
+     */
+    protected function _unFilterStream($obj)
+    {
+        $filters = array();
+
+        if (isset($obj[1][1]['/Filter'])) {
+            $filter = $obj[1][1]['/Filter'];
+
+            if ($filter[0] == pdf_parser::TYPE_OBJREF) {
+                $tmpFilter = $this->resolveObject($filter);
+                $filter = $tmpFilter[1];
+            }
+
+            if ($filter[0] == pdf_parser::TYPE_TOKEN) {
+                $filters[] = $filter;
+            } else if ($filter[0] == pdf_parser::TYPE_ARRAY) {
+                $filters = $filter[1];
+            }
+        }
+
+        $stream = $obj[2][1];
+
+        foreach ($filters AS $filter) {
+            switch ($filter[1]) {
+                case '/FlateDecode':
+                case '/Fl':
+                    if (function_exists('gzuncompress')) {
+                        $oStream = $stream;
+                        $stream = (strlen($stream) > 0) ? @gzuncompress($stream) : '';
+                    } else {
+                        throw new Exception(
+                            sprintf('To handle %s filter, please compile php with zlib support.', $filter[1])
+                        );
+                    }
+
+                    if ($stream === false) {
+                        $tries = 0;
+                        while ($tries < 8 && ($stream === false || strlen($stream) < strlen($oStream))) {
+                            $oStream = substr($oStream, 1);
+                            $stream = @gzinflate($oStream);
+                            $tries++;
+                        }
+
+                        if ($stream === false) {
+                            throw new Exception('Error while decompressing stream.');
+                        }
+                    }
+                    break;
+                case '/LZWDecode':
+                    require_once('filters/FilterLZW.php');
+                    $decoder = new FilterLZW();
+                    $stream = $decoder->decode($stream);
+                    break;
+                case '/ASCII85Decode':
+                    require_once('filters/FilterASCII85.php');
+                    $decoder = new FilterASCII85();
+                    $stream = $decoder->decode($stream);
+                    break;
+                case '/ASCIIHexDecode':
+                    require_once('filters/FilterASCIIHexDecode.php');
+                    $decoder = new FilterASCIIHexDecode();
+                    $stream = $decoder->decode($stream);
+                    break;
+                case null:
+                    break;
+                default:
+                    throw new Exception(sprintf('Unsupported Filter: %s', $filter[1]));
+            }
+        }
+
+        return $stream;
+    }
 }

+ 393 - 393
resources/templates/engine/smarty/sysplugins/smarty_internal_parsetree.php

@@ -1,393 +1,393 @@
-<?php
-/**
- * Smarty Internal Plugin Templateparser Parsetrees
- *
- * These are classes to build parsetrees in the template parser
- *
- * @package Smarty
- * @subpackage Compiler
- * @author Thue Kristensen
- * @author Uwe Tews
- */
-
-/**
- * @package Smarty
- * @subpackage Compiler
- * @ignore
- */
-abstract class _smarty_parsetree
-{
-    /**
-     * Parser object
-     * @var object
-     */
-    public $parser;
-    /**
-     * Buffer content
-     * @var mixed
-     */
-    public $data;
-
-    /**
-     * Return buffer
-     *
-     * @return string buffer content
-     */
-    abstract public function to_smarty_php();
-
-}
-
-/**
- * A complete smarty tag.
- *
- * @package Smarty
- * @subpackage Compiler
- * @ignore
- */
-class _smarty_tag extends _smarty_parsetree
-{
-    /**
-     * Saved block nesting level
-     * @var int
-     */
-    public $saved_block_nesting;
-
-    /**
-     * Create parse tree buffer for Smarty tag
-     *
-     * @param object $parser parser object
-     * @param string $data   content
-     */
-    public function __construct($parser, $data)
-    {
-        $this->parser = $parser;
-        $this->data = $data;
-        $this->saved_block_nesting = $parser->block_nesting_level;
-    }
-
-    /**
-     * Return buffer content
-     *
-     * @return string content
-     */
-    public function to_smarty_php()
-    {
-        return $this->data;
-    }
-
-    /**
-     * Return complied code that loads the evaluated outout of buffer content into a temporary variable
-     *
-     * @return string template code
-     */
-    public function assign_to_var()
-    {
-        $var = sprintf('$_tmp%d', ++Smarty_Internal_Templateparser::$prefix_number);
-        $this->parser->compiler->prefix_code[] = sprintf('<?php ob_start();?>%s<?php %s=ob_get_clean();?>', $this->data, $var);
-
-        return $var;
-    }
-
-}
-
-/**
- * Code fragment inside a tag.
- *
- * @package Smarty
- * @subpackage Compiler
- * @ignore
- */
-class _smarty_code extends _smarty_parsetree
-{
-    /**
-     * Create parse tree buffer for code fragment
-     *
-     * @param object $parser parser object
-     * @param string $data   content
-     */
-    public function __construct($parser, $data)
-    {
-        $this->parser = $parser;
-        $this->data = $data;
-    }
-
-    /**
-     * Return buffer content in parentheses
-     *
-     * @return string content
-     */
-    public function to_smarty_php()
-    {
-        return sprintf("(%s)", $this->data);
-    }
-
-}
-
-/**
- * Double quoted string inside a tag.
- *
- * @package Smarty
- * @subpackage Compiler
- * @ignore
- */
-class _smarty_doublequoted extends _smarty_parsetree
-{
-    /**
-     * Create parse tree buffer for double quoted string subtrees
-     *
-     * @param object            $parser  parser object
-     * @param _smarty_parsetree $subtree parsetree buffer
-     */
-    public function __construct($parser, _smarty_parsetree $subtree)
-    {
-        $this->parser = $parser;
-        $this->subtrees[] = $subtree;
-        if ($subtree instanceof _smarty_tag) {
-            $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);
-        }
-    }
-
-    /**
-     * Append buffer to subtree
-     *
-     * @param _smarty_parsetree $subtree parsetree buffer
-     */
-    public function append_subtree(_smarty_parsetree $subtree)
-    {
-        $last_subtree = count($this->subtrees) - 1;
-        if ($last_subtree >= 0 && $this->subtrees[$last_subtree] instanceof _smarty_tag && $this->subtrees[$last_subtree]->saved_block_nesting < $this->parser->block_nesting_level) {
-            if ($subtree instanceof _smarty_code) {
-                $this->subtrees[$last_subtree]->data .= '<?php echo ' . $subtree->data . ';?>';
-            } elseif ($subtree instanceof _smarty_dq_content) {
-                $this->subtrees[$last_subtree]->data .= '<?php echo "' . $subtree->data . '";?>';
-            } else {
-                $this->subtrees[$last_subtree]->data .= $subtree->data;
-            }
-        } else {
-            $this->subtrees[] = $subtree;
-        }
-        if ($subtree instanceof _smarty_tag) {
-            $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);
-        }
-    }
-
-    /**
-     * Merge subtree buffer content together
-     *
-     * @return string compiled template code
-     */
-    public function to_smarty_php()
-    {
-        $code = '';
-        foreach ($this->subtrees as $subtree) {
-            if ($code !== "") {
-                $code .= ".";
-            }
-            if ($subtree instanceof _smarty_tag) {
-                $more_php = $subtree->assign_to_var();
-            } else {
-                $more_php = $subtree->to_smarty_php();
-            }
-
-            $code .= $more_php;
-
-            if (!$subtree instanceof _smarty_dq_content) {
-                $this->parser->compiler->has_variable_string = true;
-            }
-        }
-
-        return $code;
-    }
-
-}
-
-/**
- * Raw chars as part of a double quoted string.
- *
- * @package Smarty
- * @subpackage Compiler
- * @ignore
- */
-class _smarty_dq_content extends _smarty_parsetree
-{
-    /**
-     * Create parse tree buffer with string content
-     *
-     * @param object $parser parser object
-     * @param string $data   string section
-     */
-    public function __construct($parser, $data)
-    {
-        $this->parser = $parser;
-        $this->data = $data;
-    }
-
-    /**
-     * Return content as double quoted string
-     *
-     * @return string doubled quoted string
-     */
-    public function to_smarty_php()
-    {
-        return '"' . $this->data . '"';
-    }
-
-}
-
-/**
- * Template element
- *
- * @package Smarty
- * @subpackage Compiler
- * @ignore
- */
-class _smarty_template_buffer extends _smarty_parsetree
-{
-    /**
-     * Array of template elements
-     *
-     * @var array
-     */
-    public $subtrees = Array();
-
-    /**
-     * Create root of parse tree for template elements
-     *
-     * @param object $parser parse object
-     */
-    public function __construct($parser)
-    {
-        $this->parser = $parser;
-    }
-
-    /**
-     * Append buffer to subtree
-     *
-     * @param _smarty_parsetree $subtree
-     */
-    public function append_subtree(_smarty_parsetree $subtree)
-    {
-        $this->subtrees[] = $subtree;
-    }
-
-    /**
-     * Sanitize and merge subtree buffers together
-     *
-     * @return string template code content
-     */
-    public function to_smarty_php()
-    {
-        $code = '';
-        for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) {
-            if ($key + 2 < $cnt) {
-                if ($this->subtrees[$key] instanceof _smarty_linebreak && $this->subtrees[$key + 1] instanceof _smarty_tag && $this->subtrees[$key + 1]->data == '' && $this->subtrees[$key + 2] instanceof _smarty_linebreak) {
-                    $key = $key + 1;
-                    continue;
-                }
-                if (substr($this->subtrees[$key]->data, -1) == '<' && $this->subtrees[$key + 1]->data == '' && substr($this->subtrees[$key + 2]->data, -1) == '?') {
-                    $key = $key + 2;
-                    continue;
-                }
-            }
-            if (substr($code, -1) == '<') {
-                $subtree = $this->subtrees[$key]->to_smarty_php();
-                if (substr($subtree, 0, 1) == '?') {
-                    $code = substr($code, 0, strlen($code) - 1) . '<<?php ?>?' . substr($subtree, 1);
-                } elseif ($this->parser->asp_tags && substr($subtree, 0, 1) == '%') {
-                    $code = substr($code, 0, strlen($code) - 1) . '<<?php ?>%' . substr($subtree, 1);
-                } else {
-                    $code .= $subtree;
-                }
-                continue;
-            }
-            if ($this->parser->asp_tags && substr($code, -1) == '%') {
-                $subtree = $this->subtrees[$key]->to_smarty_php();
-                if (substr($subtree, 0, 1) == '>') {
-                    $code = substr($code, 0, strlen($code) - 1) . '%<?php ?>>' . substr($subtree, 1);
-                } else {
-                    $code .= $subtree;
-                }
-                continue;
-            }
-            if (substr($code, -1) == '?') {
-                $subtree = $this->subtrees[$key]->to_smarty_php();
-                if (substr($subtree, 0, 1) == '>') {
-                    $code = substr($code, 0, strlen($code) - 1) . '?<?php ?>>' . substr($subtree, 1);
-                } else {
-                    $code .= $subtree;
-                }
-                continue;
-            }
-            $code .= $this->subtrees[$key]->to_smarty_php();
-        }
-
-        return $code;
-    }
-
-}
-
-/**
- * template text
- *
- * @package Smarty
- * @subpackage Compiler
- * @ignore
- */
-class _smarty_text extends _smarty_parsetree
-{
-    /**
-     * Create template text buffer
-     *
-     * @param object $parser parser object
-     * @param string $data   text
-     */
-    public function __construct($parser, $data)
-    {
-        $this->parser = $parser;
-        $this->data = $data;
-    }
-
-    /**
-     * Return buffer content
-     *
-     * @return strint text
-     */
-    public function to_smarty_php()
-    {
-        return $this->data;
-    }
-
-}
-
-/**
- * template linebreaks
- *
- * @package Smarty
- * @subpackage Compiler
- * @ignore
- */
-class _smarty_linebreak extends _smarty_parsetree
-{
-    /**
-     * Create buffer with linebreak content
-     *
-     * @param object $parser parser object
-     * @param string $data   linebreak string
-     */
-    public function __construct($parser, $data)
-    {
-        $this->parser = $parser;
-        $this->data = $data;
-    }
-
-    /**
-     * Return linebrak
-     *
-     * @return string linebreak
-     */
-    public function to_smarty_php()
-    {
-        return $this->data;
-    }
-
-}
+<?php
+/**
+ * Smarty Internal Plugin Templateparser Parsetrees
+ *
+ * These are classes to build parsetrees in the template parser
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Thue Kristensen
+ * @author Uwe Tews
+ */
+
+/**
+ * @package Smarty
+ * @subpackage Compiler
+ * @ignore
+ */
+abstract class _smarty_parsetree
+{
+    /**
+     * Parser object
+     * @var object
+     */
+    public $parser;
+    /**
+     * Buffer content
+     * @var mixed
+     */
+    public $data;
+
+    /**
+     * Return buffer
+     *
+     * @return string buffer content
+     */
+    abstract public function to_smarty_php();
+
+}
+
+/**
+ * A complete smarty tag.
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @ignore
+ */
+class _smarty_tag extends _smarty_parsetree
+{
+    /**
+     * Saved block nesting level
+     * @var int
+     */
+    public $saved_block_nesting;
+
+    /**
+     * Create parse tree buffer for Smarty tag
+     *
+     * @param object $parser parser object
+     * @param string $data   content
+     */
+    public function __construct($parser, $data)
+    {
+        $this->parser = $parser;
+        $this->data = $data;
+        $this->saved_block_nesting = $parser->block_nesting_level;
+    }
+
+    /**
+     * Return buffer content
+     *
+     * @return string content
+     */
+    public function to_smarty_php()
+    {
+        return $this->data;
+    }
+
+    /**
+     * Return complied code that loads the evaluated outout of buffer content into a temporary variable
+     *
+     * @return string template code
+     */
+    public function assign_to_var()
+    {
+        $var = sprintf('$_tmp%d', ++Smarty_Internal_Templateparser::$prefix_number);
+        $this->parser->compiler->prefix_code[] = sprintf('<?php ob_start();?>%s<?php %s=ob_get_clean();?>', $this->data, $var);
+
+        return $var;
+    }
+
+}
+
+/**
+ * Code fragment inside a tag.
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @ignore
+ */
+class _smarty_code extends _smarty_parsetree
+{
+    /**
+     * Create parse tree buffer for code fragment
+     *
+     * @param object $parser parser object
+     * @param string $data   content
+     */
+    public function __construct($parser, $data)
+    {
+        $this->parser = $parser;
+        $this->data = $data;
+    }
+
+    /**
+     * Return buffer content in parentheses
+     *
+     * @return string content
+     */
+    public function to_smarty_php()
+    {
+        return sprintf("(%s)", $this->data);
+    }
+
+}
+
+/**
+ * Double quoted string inside a tag.
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @ignore
+ */
+class _smarty_doublequoted extends _smarty_parsetree
+{
+    /**
+     * Create parse tree buffer for double quoted string subtrees
+     *
+     * @param object            $parser  parser object
+     * @param _smarty_parsetree $subtree parsetree buffer
+     */
+    public function __construct($parser, _smarty_parsetree $subtree)
+    {
+        $this->parser = $parser;
+        $this->subtrees[] = $subtree;
+        if ($subtree instanceof _smarty_tag) {
+            $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);
+        }
+    }
+
+    /**
+     * Append buffer to subtree
+     *
+     * @param _smarty_parsetree $subtree parsetree buffer
+     */
+    public function append_subtree(_smarty_parsetree $subtree)
+    {
+        $last_subtree = count($this->subtrees) - 1;
+        if ($last_subtree >= 0 && $this->subtrees[$last_subtree] instanceof _smarty_tag && $this->subtrees[$last_subtree]->saved_block_nesting < $this->parser->block_nesting_level) {
+            if ($subtree instanceof _smarty_code) {
+                $this->subtrees[$last_subtree]->data .= '<?php echo ' . $subtree->data . ';?>';
+            } elseif ($subtree instanceof _smarty_dq_content) {
+                $this->subtrees[$last_subtree]->data .= '<?php echo "' . $subtree->data . '";?>';
+            } else {
+                $this->subtrees[$last_subtree]->data .= $subtree->data;
+            }
+        } else {
+            $this->subtrees[] = $subtree;
+        }
+        if ($subtree instanceof _smarty_tag) {
+            $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);
+        }
+    }
+
+    /**
+     * Merge subtree buffer content together
+     *
+     * @return string compiled template code
+     */
+    public function to_smarty_php()
+    {
+        $code = '';
+        foreach ($this->subtrees as $subtree) {
+            if ($code !== "") {
+                $code .= ".";
+            }
+            if ($subtree instanceof _smarty_tag) {
+                $more_php = $subtree->assign_to_var();
+            } else {
+                $more_php = $subtree->to_smarty_php();
+            }
+
+            $code .= $more_php;
+
+            if (!$subtree instanceof _smarty_dq_content) {
+                $this->parser->compiler->has_variable_string = true;
+            }
+        }
+
+        return $code;
+    }
+
+}
+
+/**
+ * Raw chars as part of a double quoted string.
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @ignore
+ */
+class _smarty_dq_content extends _smarty_parsetree
+{
+    /**
+     * Create parse tree buffer with string content
+     *
+     * @param object $parser parser object
+     * @param string $data   string section
+     */
+    public function __construct($parser, $data)
+    {
+        $this->parser = $parser;
+        $this->data = $data;
+    }
+
+    /**
+     * Return content as double quoted string
+     *
+     * @return string doubled quoted string
+     */
+    public function to_smarty_php()
+    {
+        return '"' . $this->data . '"';
+    }
+
+}
+
+/**
+ * Template element
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @ignore
+ */
+class _smarty_template_buffer extends _smarty_parsetree
+{
+    /**
+     * Array of template elements
+     *
+     * @var array
+     */
+    public $subtrees = Array();
+
+    /**
+     * Create root of parse tree for template elements
+     *
+     * @param object $parser parse object
+     */
+    public function __construct($parser)
+    {
+        $this->parser = $parser;
+    }
+
+    /**
+     * Append buffer to subtree
+     *
+     * @param _smarty_parsetree $subtree
+     */
+    public function append_subtree(_smarty_parsetree $subtree)
+    {
+        $this->subtrees[] = $subtree;
+    }
+
+    /**
+     * Sanitize and merge subtree buffers together
+     *
+     * @return string template code content
+     */
+    public function to_smarty_php()
+    {
+        $code = '';
+        for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) {
+            if ($key + 2 < $cnt) {
+                if ($this->subtrees[$key] instanceof _smarty_linebreak && $this->subtrees[$key + 1] instanceof _smarty_tag && $this->subtrees[$key + 1]->data == '' && $this->subtrees[$key + 2] instanceof _smarty_linebreak) {
+                    $key = $key + 1;
+                    continue;
+                }
+                if (substr($this->subtrees[$key]->data, -1) == '<' && $this->subtrees[$key + 1]->data == '' && substr($this->subtrees[$key + 2]->data, -1) == '?') {
+                    $key = $key + 2;
+                    continue;
+                }
+            }
+            if (substr($code, -1) == '<') {
+                $subtree = $this->subtrees[$key]->to_smarty_php();
+                if (substr($subtree, 0, 1) == '?') {
+                    $code = substr($code, 0, strlen($code) - 1) . '<<?php ?>?' . substr($subtree, 1);
+                } elseif ($this->parser->asp_tags && substr($subtree, 0, 1) == '%') {
+                    $code = substr($code, 0, strlen($code) - 1) . '<<?php ?>%' . substr($subtree, 1);
+                } else {
+                    $code .= $subtree;
+                }
+                continue;
+            }
+            if ($this->parser->asp_tags && substr($code, -1) == '%') {
+                $subtree = $this->subtrees[$key]->to_smarty_php();
+                if (substr($subtree, 0, 1) == '>') {
+                    $code = substr($code, 0, strlen($code) - 1) . '%<?php ?>>' . substr($subtree, 1);
+                } else {
+                    $code .= $subtree;
+                }
+                continue;
+            }
+            if (substr($code, -1) == '?') {
+                $subtree = $this->subtrees[$key]->to_smarty_php();
+                if (substr($subtree, 0, 1) == '>') {
+                    $code = substr($code, 0, strlen($code) - 1) . '?<?php ?>>' . substr($subtree, 1);
+                } else {
+                    $code .= $subtree;
+                }
+                continue;
+            }
+            $code .= $this->subtrees[$key]->to_smarty_php();
+        }
+
+        return $code;
+    }
+
+}
+
+/**
+ * template text
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @ignore
+ */
+class _smarty_text extends _smarty_parsetree
+{
+    /**
+     * Create template text buffer
+     *
+     * @param object $parser parser object
+     * @param string $data   text
+     */
+    public function __construct($parser, $data)
+    {
+        $this->parser = $parser;
+        $this->data = $data;
+    }
+
+    /**
+     * Return buffer content
+     *
+     * @return strint text
+     */
+    public function to_smarty_php()
+    {
+        return $this->data;
+    }
+
+}
+
+/**
+ * template linebreaks
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @ignore
+ */
+class _smarty_linebreak extends _smarty_parsetree
+{
+    /**
+     * Create buffer with linebreak content
+     *
+     * @param object $parser parser object
+     * @param string $data   linebreak string
+     */
+    public function __construct($parser, $data)
+    {
+        $this->parser = $parser;
+        $this->data = $data;
+    }
+
+    /**
+     * Return linebrak
+     *
+     * @return string linebreak
+     */
+    public function to_smarty_php()
+    {
+        return $this->data;
+    }
+
+}

+ 822 - 822
resources/templates/engine/smarty/sysplugins/smarty_internal_templatebase.php

@@ -1,822 +1,822 @@
-<?php
-/**
- * Smarty Internal Plugin Smarty Template  Base
- *
- * This file contains the basic shared methodes for template handling
- *
- * @package Smarty
- * @subpackage Template
- * @author Uwe Tews
- */
-
-/**
- * Class with shared template methodes
- *
- * @package Smarty
- * @subpackage Template
- */
-abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
-{
-    /**
-     * fetches a rendered Smarty template
-     *
-     * @param  string $template         the resource handle of the template file or template object
-     * @param  mixed  $cache_id         cache id to be used with this template
-     * @param  mixed  $compile_id       compile id to be used with this template
-     * @param  object $parent           next higher level of Smarty variables
-     * @param  bool   $display          true: display, false: fetch
-     * @param  bool   $merge_tpl_vars   if true parent template variables merged in to local scope
-     * @param  bool   $no_output_filter if true do not run output filter
-     * @return string rendered template output
-     */
-    public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null, $display = false, $merge_tpl_vars = true, $no_output_filter = false)
-    {
-        if ($template === null && $this instanceof $this->template_class) {
-            $template = $this;
-        }
-        if (!empty($cache_id) && is_object($cache_id)) {
-            $parent = $cache_id;
-            $cache_id = null;
-        }
-        if ($parent === null && ($this instanceof Smarty || is_string($template))) {
-            $parent = $this;
-        }
-        // create template object if necessary
-        $_template = ($template instanceof $this->template_class)
-        ? $template
-        : $this->smarty->createTemplate($template, $cache_id, $compile_id, $parent, false);
-        // if called by Smarty object make sure we use current caching status
-        if ($this instanceof Smarty) {
-            $_template->caching = $this->caching;
-        }
-        // merge all variable scopes into template
-        if ($merge_tpl_vars) {
-            // save local variables
-            $save_tpl_vars = $_template->tpl_vars;
-            $save_config_vars = $_template->config_vars;
-            $ptr_array = array($_template);
-            $ptr = $_template;
-            while (isset($ptr->parent)) {
-                $ptr_array[] = $ptr = $ptr->parent;
-            }
-            $ptr_array = array_reverse($ptr_array);
-            $parent_ptr = reset($ptr_array);
-            $tpl_vars = $parent_ptr->tpl_vars;
-            $config_vars = $parent_ptr->config_vars;
-            while ($parent_ptr = next($ptr_array)) {
-                if (!empty($parent_ptr->tpl_vars)) {
-                    $tpl_vars = array_merge($tpl_vars, $parent_ptr->tpl_vars);
-                }
-                if (!empty($parent_ptr->config_vars)) {
-                    $config_vars = array_merge($config_vars, $parent_ptr->config_vars);
-                }
-            }
-            if (!empty(Smarty::$global_tpl_vars)) {
-                $tpl_vars = array_merge(Smarty::$global_tpl_vars, $tpl_vars);
-            }
-            $_template->tpl_vars = $tpl_vars;
-            $_template->config_vars = $config_vars;
-        }
-        // dummy local smarty variable
-        if (!isset($_template->tpl_vars['smarty'])) {
-            $_template->tpl_vars['smarty'] = new Smarty_Variable;
-        }
-        if (isset($this->smarty->error_reporting)) {
-            $_smarty_old_error_level = error_reporting($this->smarty->error_reporting);
-        }
-        // check URL debugging control
-        if (!$this->smarty->debugging && $this->smarty->debugging_ctrl == 'URL') {
-            if (isset($_SERVER['QUERY_STRING'])) {
-                $_query_string = $_SERVER['QUERY_STRING'];
-            } else {
-                $_query_string = '';
-            }
-            if (false !== strpos($_query_string, $this->smarty->smarty_debug_id)) {
-                if (false !== strpos($_query_string, $this->smarty->smarty_debug_id . '=on')) {
-                    // enable debugging for this browser session
-                    setcookie('SMARTY_DEBUG', true);
-                    $this->smarty->debugging = true;
-                } elseif (false !== strpos($_query_string, $this->smarty->smarty_debug_id . '=off')) {
-                    // disable debugging for this browser session
-                    setcookie('SMARTY_DEBUG', false);
-                    $this->smarty->debugging = false;
-                } else {
-                    // enable debugging for this page
-                    $this->smarty->debugging = true;
-                }
-            } else {
-                if (isset($_COOKIE['SMARTY_DEBUG'])) {
-                    $this->smarty->debugging = true;
-                }
-            }
-        }
-        // must reset merge template date
-        $_template->smarty->merged_templates_func = array();
-        // get rendered template
-        // disable caching for evaluated code
-        if ($_template->source->recompiled) {
-            $_template->caching = false;
-        }
-        // checks if template exists
-        if (!$_template->source->exists) {
-            if ($_template->parent instanceof Smarty_Internal_Template) {
-                $parent_resource = " in '{$_template->parent->template_resource}'";
-            } else {
-                $parent_resource = '';
-            }
-            throw new SmartyException("Unable to load template {$_template->source->type} '{$_template->source->name}'{$parent_resource}");
-        }
-        // read from cache or render
-        if (!($_template->caching == Smarty::CACHING_LIFETIME_CURRENT || $_template->caching == Smarty::CACHING_LIFETIME_SAVED) || !$_template->cached->valid) {
-            // render template (not loaded and not in cache)
-            if (!$_template->source->uncompiled) {
-                $_smarty_tpl = $_template;
-                if ($_template->source->recompiled) {
-                    $code = $_template->compiler->compileTemplate($_template);
-                    if ($this->smarty->debugging) {
-                        Smarty_Internal_Debug::start_render($_template);
-                    }
-                    try {
-                        ob_start();
-                        eval("?>" . $code);
-                        unset($code);
-                    } catch (Exception $e) {
-                        ob_get_clean();
-                        throw $e;
-                    }
-                } else {
-                    if (!$_template->compiled->exists || ($_template->smarty->force_compile && !$_template->compiled->isCompiled)) {
-                        $_template->compileTemplateSource();
-                        $code = file_get_contents($_template->compiled->filepath);
-                        eval("?>" . $code);
-                        unset($code);
-                        $_template->compiled->loaded = true;
-                        $_template->compiled->isCompiled = true;
-                    }
-                    if ($this->smarty->debugging) {
-                        Smarty_Internal_Debug::start_render($_template);
-                    }
-                    if (!$_template->compiled->loaded) {
-                        include($_template->compiled->filepath);
-                        if ($_template->mustCompile) {
-                            // recompile and load again
-                            $_template->compileTemplateSource();
-                            $code = file_get_contents($_template->compiled->filepath);
-                            eval("?>" . $code);
-                            unset($code);
-                            $_template->compiled->isCompiled = true;
-                        }
-                        $_template->compiled->loaded = true;
-                    } else {
-                        $_template->decodeProperties($_template->compiled->_properties, false);
-                    }
-                    try {
-                        ob_start();
-                        if (empty($_template->properties['unifunc']) || !is_callable($_template->properties['unifunc'])) {
-                            throw new SmartyException("Invalid compiled template for '{$_template->template_resource}'");
-                        }
-                        array_unshift($_template->_capture_stack,array());
-                        //
-                        // render compiled template
-                        //
-                        $_template->properties['unifunc']($_template);
-                        // any unclosed {capture} tags ?
-                        if (isset($_template->_capture_stack[0][0])) {
-                            $_template->capture_error();
-                        }
-                        array_shift($_template->_capture_stack);
-                    } catch (Exception $e) {
-                        ob_get_clean();
-                        throw $e;
-                    }
-                }
-            } else {
-                if ($_template->source->uncompiled) {
-                    if ($this->smarty->debugging) {
-                        Smarty_Internal_Debug::start_render($_template);
-                    }
-                    try {
-                        ob_start();
-                        $_template->source->renderUncompiled($_template);
-                    } catch (Exception $e) {
-                        ob_get_clean();
-                        throw $e;
-                    }
-                } else {
-                    throw new SmartyException("Resource '$_template->source->type' must have 'renderUncompiled' method");
-                }
-            }
-            $_output = ob_get_clean();
-            if (!$_template->source->recompiled && empty($_template->properties['file_dependency'][$_template->source->uid])) {
-                $_template->properties['file_dependency'][$_template->source->uid] = array($_template->source->filepath, $_template->source->timestamp, $_template->source->type);
-            }
-            if ($_template->parent instanceof Smarty_Internal_Template) {
-                $_template->parent->properties['file_dependency'] = array_merge($_template->parent->properties['file_dependency'], $_template->properties['file_dependency']);
-                foreach ($_template->required_plugins as $code => $tmp1) {
-                    foreach ($tmp1 as $name => $tmp) {
-                        foreach ($tmp as $type => $data) {
-                            $_template->parent->required_plugins[$code][$name][$type] = $data;
-                        }
-                    }
-                }
-            }
-            if ($this->smarty->debugging) {
-                Smarty_Internal_Debug::end_render($_template);
-            }
-            // write to cache when nessecary
-            if (!$_template->source->recompiled && ($_template->caching == Smarty::CACHING_LIFETIME_SAVED || $_template->caching == Smarty::CACHING_LIFETIME_CURRENT)) {
-                if ($this->smarty->debugging) {
-                    Smarty_Internal_Debug::start_cache($_template);
-                }
-                $_template->properties['has_nocache_code'] = false;
-                // get text between non-cached items
-                $cache_split = preg_split("!/\*%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*\/(.+?)/\*/%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*/!s", $_output);
-                // get non-cached items
-                preg_match_all("!/\*%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*\/(.+?)/\*/%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*/!s", $_output, $cache_parts);
-                $output = '';
-                // loop over items, stitch back together
-                foreach ($cache_split as $curr_idx => $curr_split) {
-                    // escape PHP tags in template content
-                    $output .= preg_replace('/(<%|%>|<\?php|<\?|\?>)/', "<?php echo '\$1'; ?>\n", $curr_split);
-                    if (isset($cache_parts[0][$curr_idx])) {
-                        $_template->properties['has_nocache_code'] = true;
-                        // remove nocache tags from cache output
-                        $output .= preg_replace("!/\*/?%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*/!", '', $cache_parts[0][$curr_idx]);
-                    }
-                }
-                if (!$no_output_filter && !$_template->has_nocache_code && (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output']))) {
-                    $output = Smarty_Internal_Filter_Handler::runFilter('output', $output, $_template);
-                }
-                // rendering (must be done before writing cache file because of {function} nocache handling)
-                $_smarty_tpl = $_template;
-                try {
-                    ob_start();
-                    eval("?>" . $output);
-                    $_output = ob_get_clean();
-                } catch (Exception $e) {
-                    ob_get_clean();
-                    throw $e;
-                }
-                // write cache file content
-                $_template->writeCachedContent($output);
-                if ($this->smarty->debugging) {
-                    Smarty_Internal_Debug::end_cache($_template);
-                }
-            } else {
-                // var_dump('renderTemplate', $_template->has_nocache_code, $_template->template_resource, $_template->properties['nocache_hash'], $_template->parent->properties['nocache_hash'], $_output);
-                if (!empty($_template->properties['nocache_hash']) && !empty($_template->parent->properties['nocache_hash'])) {
-                    // replace nocache_hash
-                    $_output = str_replace("{$_template->properties['nocache_hash']}", $_template->parent->properties['nocache_hash'], $_output);
-                    $_template->parent->has_nocache_code = $_template->parent->has_nocache_code || $_template->has_nocache_code;
-                }
-            }
-        } else {
-            if ($this->smarty->debugging) {
-                Smarty_Internal_Debug::start_cache($_template);
-            }
-            try {
-                ob_start();
-                array_unshift($_template->_capture_stack,array());
-                //
-                // render cached template
-                //
-                $_template->properties['unifunc']($_template);
-                // any unclosed {capture} tags ?
-                if (isset($_template->_capture_stack[0][0])) {
-                    $_template->capture_error();
-                }
-                array_shift($_template->_capture_stack);
-                $_output = ob_get_clean();
-            } catch (Exception $e) {
-                ob_get_clean();
-                throw $e;
-            }
-            if ($this->smarty->debugging) {
-                Smarty_Internal_Debug::end_cache($_template);
-            }
-        }
-        if ((!$this->caching || $_template->has_nocache_code || $_template->source->recompiled) && !$no_output_filter && (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output']))) {
-            $_output = Smarty_Internal_Filter_Handler::runFilter('output', $_output, $_template);
-        }
-        if (isset($this->error_reporting)) {
-            error_reporting($_smarty_old_error_level);
-        }
-        // display or fetch
-        if ($display) {
-            if ($this->caching && $this->cache_modified_check) {
-                $_isCached = $_template->isCached() && !$_template->has_nocache_code;
-                $_last_modified_date = @substr($_SERVER['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_SERVER['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3);
-                if ($_isCached && $_template->cached->timestamp <= strtotime($_last_modified_date)) {
-                    switch (PHP_SAPI) {
-                        case 'cgi':         // php-cgi < 5.3
-                        case 'cgi-fcgi':    // php-cgi >= 5.3
-                        case 'fpm-fcgi':    // php-fpm >= 5.3.3
-                        header('Status: 304 Not Modified');
-                        break;
-
-                        case 'cli':
-                        if (/* ^phpunit */!empty($_SERVER['SMARTY_PHPUNIT_DISABLE_HEADERS'])/* phpunit$ */) {
-                            $_SERVER['SMARTY_PHPUNIT_HEADERS'][] = '304 Not Modified';
-                        }
-                        break;
-
-                        default:
-                        header($_SERVER['SERVER_PROTOCOL'].' 304 Not Modified');
-                        break;
-                    }
-                } else {
-                    switch (PHP_SAPI) {
-                        case 'cli':
-                        if (/* ^phpunit */!empty($_SERVER['SMARTY_PHPUNIT_DISABLE_HEADERS'])/* phpunit$ */) {
-                            $_SERVER['SMARTY_PHPUNIT_HEADERS'][] = 'Last-Modified: ' . gmdate('D, d M Y H:i:s', $_template->cached->timestamp) . ' GMT';
-                        }
-                        break;
-
-                        default:
-                        header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $_template->cached->timestamp) . ' GMT');
-                        break;
-                    }
-                    echo $_output;
-                }
-            } else {
-                echo $_output;
-            }
-            // debug output
-            if ($this->smarty->debugging) {
-                Smarty_Internal_Debug::display_debug($this);
-            }
-            if ($merge_tpl_vars) {
-                // restore local variables
-                $_template->tpl_vars = $save_tpl_vars;
-                $_template->config_vars =  $save_config_vars;
-            }
-
-            return;
-        } else {
-            if ($merge_tpl_vars) {
-                // restore local variables
-                $_template->tpl_vars = $save_tpl_vars;
-                $_template->config_vars =  $save_config_vars;
-            }
-            // return fetched content
-            return $_output;
-        }
-    }
-
-    /**
-     * displays a Smarty template
-     *
-     * @param string $template   the resource handle of the template file or template object
-     * @param mixed  $cache_id   cache id to be used with this template
-     * @param mixed  $compile_id compile id to be used with this template
-     * @param object $parent     next higher level of Smarty variables
-     */
-    public function display($template = null, $cache_id = null, $compile_id = null, $parent = null)
-    {
-        // display template
-        $this->fetch($template, $cache_id, $compile_id, $parent, true);
-    }
-
-    /**
-     * test if cache is valid
-     *
-     * @param  string|object $template   the resource handle of the template file or template object
-     * @param  mixed         $cache_id   cache id to be used with this template
-     * @param  mixed         $compile_id compile id to be used with this template
-     * @param  object        $parent     next higher level of Smarty variables
-     * @return boolean       cache status
-     */
-    public function isCached($template = null, $cache_id = null, $compile_id = null, $parent = null)
-    {
-        if ($template === null && $this instanceof $this->template_class) {
-            return $this->cached->valid;
-        }
-        if (!($template instanceof $this->template_class)) {
-            if ($parent === null) {
-                $parent = $this;
-            }
-            $template = $this->smarty->createTemplate($template, $cache_id, $compile_id, $parent, false);
-        }
-        // return cache status of template
-        return $template->cached->valid;
-    }
-
-    /**
-     * creates a data object
-     *
-     * @param object $parent next higher level of Smarty variables
-     * @returns Smarty_Data data object
-     */
-    public function createData($parent = null)
-    {
-        return new Smarty_Data($parent, $this);
-    }
-
-    /**
-     * Registers plugin to be used in templates
-     *
-     * @param  string                       $type       plugin type
-     * @param  string                       $tag        name of template tag
-     * @param  callback                     $callback   PHP callback to register
-     * @param  boolean                      $cacheable  if true (default) this fuction is cachable
-     * @param  array                        $cache_attr caching attributes if any
-     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
-     * @throws SmartyException              when the plugin tag is invalid
-     */
-    public function registerPlugin($type, $tag, $callback, $cacheable = true, $cache_attr = null)
-    {
-        if (isset($this->smarty->registered_plugins[$type][$tag])) {
-            throw new SmartyException("Plugin tag \"{$tag}\" already registered");
-        } elseif (!is_callable($callback)) {
-            throw new SmartyException("Plugin \"{$tag}\" not callable");
-        } else {
-            $this->smarty->registered_plugins[$type][$tag] = array($callback, (bool) $cacheable, (array) $cache_attr);
-        }
-
-        return $this;
-    }
-
-    /**
-     * Unregister Plugin
-     *
-     * @param  string                       $type of plugin
-     * @param  string                       $tag  name of plugin
-     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
-     */
-    public function unregisterPlugin($type, $tag)
-    {
-        if (isset($this->smarty->registered_plugins[$type][$tag])) {
-            unset($this->smarty->registered_plugins[$type][$tag]);
-        }
-
-        return $this;
-    }
-
-    /**
-     * Registers a resource to fetch a template
-     *
-     * @param  string                       $type     name of resource type
-     * @param  Smarty_Resource|array        $callback or instance of Smarty_Resource, or array of callbacks to handle resource (deprecated)
-     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
-     */
-    public function registerResource($type, $callback)
-    {
-        $this->smarty->registered_resources[$type] = $callback instanceof Smarty_Resource ? $callback : array($callback, false);
-
-        return $this;
-    }
-
-    /**
-     * Unregisters a resource
-     *
-     * @param  string                       $type name of resource type
-     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
-     */
-    public function unregisterResource($type)
-    {
-        if (isset($this->smarty->registered_resources[$type])) {
-            unset($this->smarty->registered_resources[$type]);
-        }
-
-        return $this;
-    }
-
-    /**
-     * Registers a cache resource to cache a template's output
-     *
-     * @param  string                       $type     name of cache resource type
-     * @param  Smarty_CacheResource         $callback instance of Smarty_CacheResource to handle output caching
-     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
-     */
-    public function registerCacheResource($type, Smarty_CacheResource $callback)
-    {
-        $this->smarty->registered_cache_resources[$type] = $callback;
-
-        return $this;
-    }
-
-    /**
-     * Unregisters a cache resource
-     *
-     * @param  string                       $type name of cache resource type
-     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
-     */
-    public function unregisterCacheResource($type)
-    {
-        if (isset($this->smarty->registered_cache_resources[$type])) {
-            unset($this->smarty->registered_cache_resources[$type]);
-        }
-
-        return $this;
-    }
-
-    /**
-     * Registers object to be used in templates
-     *
-     * @param  string                       $object        name of template object
-     * @param  object                       $object_impl   the referenced PHP object to register
-     * @param  array                        $allowed       list of allowed methods (empty = all)
-     * @param  boolean                      $smarty_args   smarty argument format, else traditional
-     * @param  array                        $block_methods list of block-methods
-     * @param  array                        $block_functs  list of methods that are block format
-     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
-     * @throws SmartyException              if any of the methods in $allowed or $block_methods are invalid
-     */
-    public function registerObject($object_name, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
-    {
-        // test if allowed methodes callable
-        if (!empty($allowed)) {
-            foreach ((array) $allowed as $method) {
-                if (!is_callable(array($object_impl, $method)) && !property_exists($object_impl, $method)) {
-                    throw new SmartyException("Undefined method or property '$method' in registered object");
-                }
-            }
-        }
-        // test if block methodes callable
-        if (!empty($block_methods)) {
-            foreach ((array) $block_methods as $method) {
-                if (!is_callable(array($object_impl, $method))) {
-                    throw new SmartyException("Undefined method '$method' in registered object");
-                }
-            }
-        }
-        // register the object
-        $this->smarty->registered_objects[$object_name] =
-        array($object_impl, (array) $allowed, (boolean) $smarty_args, (array) $block_methods);
-
-        return $this;
-    }
-
-    /**
-     * return a reference to a registered object
-     *
-     * @param  string          $name object name
-     * @return object
-     * @throws SmartyException if no such object is found
-     */
-    public function getRegisteredObject($name)
-    {
-        if (!isset($this->smarty->registered_objects[$name])) {
-            throw new SmartyException("'$name' is not a registered object");
-        }
-        if (!is_object($this->smarty->registered_objects[$name][0])) {
-            throw new SmartyException("registered '$name' is not an object");
-        }
-
-        return $this->smarty->registered_objects[$name][0];
-    }
-
-    /**
-     * unregister an object
-     *
-     * @param  string                       $name object name
-     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
-     */
-    public function unregisterObject($name)
-    {
-        if (isset($this->smarty->registered_objects[$name])) {
-            unset($this->smarty->registered_objects[$name]);
-        }
-
-        return $this;
-    }
-
-    /**
-     * Registers static classes to be used in templates
-     *
-     * @param  string                       $class      name of template class
-     * @param  string                       $class_impl the referenced PHP class to register
-     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
-     * @throws SmartyException              if $class_impl does not refer to an existing class
-     */
-    public function registerClass($class_name, $class_impl)
-    {
-        // test if exists
-        if (!class_exists($class_impl)) {
-            throw new SmartyException("Undefined class '$class_impl' in register template class");
-        }
-        // register the class
-        $this->smarty->registered_classes[$class_name] = $class_impl;
-
-        return $this;
-    }
-
-    /**
-     * Registers a default plugin handler
-     *
-     * @param  callable                     $callback class/method name
-     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
-     * @throws SmartyException              if $callback is not callable
-     */
-    public function registerDefaultPluginHandler($callback)
-    {
-        if (is_callable($callback)) {
-            $this->smarty->default_plugin_handler_func = $callback;
-        } else {
-            throw new SmartyException("Default plugin handler '$callback' not callable");
-        }
-
-        return $this;
-    }
-
-    /**
-     * Registers a default template handler
-     *
-     * @param  callable                     $callback class/method name
-     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
-     * @throws SmartyException              if $callback is not callable
-     */
-    public function registerDefaultTemplateHandler($callback)
-    {
-        if (is_callable($callback)) {
-            $this->smarty->default_template_handler_func = $callback;
-        } else {
-            throw new SmartyException("Default template handler '$callback' not callable");
-        }
-
-        return $this;
-    }
-
-    /**
-     * Registers a default template handler
-     *
-     * @param  callable                     $callback class/method name
-     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
-     * @throws SmartyException              if $callback is not callable
-     */
-    public function registerDefaultConfigHandler($callback)
-    {
-        if (is_callable($callback)) {
-            $this->smarty->default_config_handler_func = $callback;
-        } else {
-            throw new SmartyException("Default config handler '$callback' not callable");
-        }
-
-        return $this;
-    }
-
-    /**
-     * Registers a filter function
-     *
-     * @param  string                       $type     filter type
-     * @param  callback                     $callback
-     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
-     */
-    public function registerFilter($type, $callback)
-    {
-        $this->smarty->registered_filters[$type][$this->_get_filter_name($callback)] = $callback;
-
-        return $this;
-    }
-
-    /**
-     * Unregisters a filter function
-     *
-     * @param  string                       $type     filter type
-     * @param  callback                     $callback
-     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
-     */
-    public function unregisterFilter($type, $callback)
-    {
-        $name = $this->_get_filter_name($callback);
-        if (isset($this->smarty->registered_filters[$type][$name])) {
-            unset($this->smarty->registered_filters[$type][$name]);
-        }
-
-        return $this;
-    }
-
-    /**
-     * Return internal filter name
-     *
-     * @param  callback $function_name
-     * @return string   internal filter name
-     */
-    public function _get_filter_name($function_name)
-    {
-        if (is_array($function_name)) {
-            $_class_name = (is_object($function_name[0]) ?
-            get_class($function_name[0]) : $function_name[0]);
-
-            return $_class_name . '_' . $function_name[1];
-        } else {
-            return $function_name;
-        }
-    }
-
-    /**
-     * load a filter of specified type and name
-     *
-     * @param  string          $type filter type
-     * @param  string          $name filter name
-     * @throws SmartyException if filter could not be loaded
-     */
-    public function loadFilter($type, $name)
-    {
-        $_plugin = "smarty_{$type}filter_{$name}";
-        $_filter_name = $_plugin;
-        if ($this->smarty->loadPlugin($_plugin)) {
-            if (class_exists($_plugin, false)) {
-                $_plugin = array($_plugin, 'execute');
-            }
-            if (is_callable($_plugin)) {
-                $this->smarty->registered_filters[$type][$_filter_name] = $_plugin;
-
-                return true;
-            }
-        }
-        throw new SmartyException("{$type}filter \"{$name}\" not callable");
-    }
-
-    /**
-     * unload a filter of specified type and name
-     *
-     * @param  string                       $type filter type
-     * @param  string                       $name filter name
-     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
-     */
-    public function unloadFilter($type, $name)
-    {
-        $_filter_name = "smarty_{$type}filter_{$name}";
-        if (isset($this->smarty->registered_filters[$type][$_filter_name])) {
-            unset ($this->smarty->registered_filters[$type][$_filter_name]);
-        }
-
-        return $this;
-    }
-
-    /**
-     * preg_replace callback to convert camelcase getter/setter to underscore property names
-     *
-     * @param  string $match match string
-     * @return string replacemant
-     */
-    private function replaceCamelcase($match)
-    {
-        return "_" . strtolower($match[1]);
-    }
-
-    /**
-     * Handle unknown class methods
-     *
-     * @param string $name unknown method-name
-     * @param array  $args argument array
-     */
-    public function __call($name, $args)
-    {
-        static $_prefixes = array('set' => true, 'get' => true);
-        static $_resolved_property_name = array();
-        static $_resolved_property_source = array();
-
-        // method of Smarty object?
-        if (method_exists($this->smarty, $name)) {
-            return call_user_func_array(array($this->smarty, $name), $args);
-        }
-        // see if this is a set/get for a property
-        $first3 = strtolower(substr($name, 0, 3));
-        if (isset($_prefixes[$first3]) && isset($name[3]) && $name[3] !== '_') {
-            if (isset($_resolved_property_name[$name])) {
-                $property_name = $_resolved_property_name[$name];
-            } else {
-                // try to keep case correct for future PHP 6.0 case-sensitive class methods
-                // lcfirst() not available < PHP 5.3.0, so improvise
-                $property_name = strtolower(substr($name, 3, 1)) . substr($name, 4);
-                // convert camel case to underscored name
-                $property_name = preg_replace_callback('/([A-Z])/', array($this,'replaceCamelcase'), $property_name);
-                $_resolved_property_name[$name] = $property_name;
-            }
-            if (isset($_resolved_property_source[$property_name])) {
-                $_is_this = $_resolved_property_source[$property_name];
-            } else {
-                $_is_this = null;
-                if (property_exists($this, $property_name)) {
-                    $_is_this = true;
-                } elseif (property_exists($this->smarty, $property_name)) {
-                    $_is_this = false;
-                }
-                $_resolved_property_source[$property_name] = $_is_this;
-            }
-            if ($_is_this) {
-                if ($first3 == 'get')
-                return $this->$property_name;
-                else
-                return $this->$property_name = $args[0];
-            } elseif ($_is_this === false) {
-                if ($first3 == 'get')
-                return $this->smarty->$property_name;
-                else
-                return $this->smarty->$property_name = $args[0];
-            } else {
-                throw new SmartyException("property '$property_name' does not exist.");
-
-                return false;
-            }
-        }
-        if ($name == 'Smarty') {
-            throw new SmartyException("PHP5 requires you to call __construct() instead of Smarty()");
-        }
-        // must be unknown
-        throw new SmartyException("Call of unknown method '$name'.");
-    }
-
-}
+<?php
+/**
+ * Smarty Internal Plugin Smarty Template  Base
+ *
+ * This file contains the basic shared methodes for template handling
+ *
+ * @package Smarty
+ * @subpackage Template
+ * @author Uwe Tews
+ */
+
+/**
+ * Class with shared template methodes
+ *
+ * @package Smarty
+ * @subpackage Template
+ */
+abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
+{
+    /**
+     * fetches a rendered Smarty template
+     *
+     * @param  string $template         the resource handle of the template file or template object
+     * @param  mixed  $cache_id         cache id to be used with this template
+     * @param  mixed  $compile_id       compile id to be used with this template
+     * @param  object $parent           next higher level of Smarty variables
+     * @param  bool   $display          true: display, false: fetch
+     * @param  bool   $merge_tpl_vars   if true parent template variables merged in to local scope
+     * @param  bool   $no_output_filter if true do not run output filter
+     * @return string rendered template output
+     */
+    public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null, $display = false, $merge_tpl_vars = true, $no_output_filter = false)
+    {
+        if ($template === null && $this instanceof $this->template_class) {
+            $template = $this;
+        }
+        if (!empty($cache_id) && is_object($cache_id)) {
+            $parent = $cache_id;
+            $cache_id = null;
+        }
+        if ($parent === null && ($this instanceof Smarty || is_string($template))) {
+            $parent = $this;
+        }
+        // create template object if necessary
+        $_template = ($template instanceof $this->template_class)
+        ? $template
+        : $this->smarty->createTemplate($template, $cache_id, $compile_id, $parent, false);
+        // if called by Smarty object make sure we use current caching status
+        if ($this instanceof Smarty) {
+            $_template->caching = $this->caching;
+        }
+        // merge all variable scopes into template
+        if ($merge_tpl_vars) {
+            // save local variables
+            $save_tpl_vars = $_template->tpl_vars;
+            $save_config_vars = $_template->config_vars;
+            $ptr_array = array($_template);
+            $ptr = $_template;
+            while (isset($ptr->parent)) {
+                $ptr_array[] = $ptr = $ptr->parent;
+            }
+            $ptr_array = array_reverse($ptr_array);
+            $parent_ptr = reset($ptr_array);
+            $tpl_vars = $parent_ptr->tpl_vars;
+            $config_vars = $parent_ptr->config_vars;
+            while ($parent_ptr = next($ptr_array)) {
+                if (!empty($parent_ptr->tpl_vars)) {
+                    $tpl_vars = array_merge($tpl_vars, $parent_ptr->tpl_vars);
+                }
+                if (!empty($parent_ptr->config_vars)) {
+                    $config_vars = array_merge($config_vars, $parent_ptr->config_vars);
+                }
+            }
+            if (!empty(Smarty::$global_tpl_vars)) {
+                $tpl_vars = array_merge(Smarty::$global_tpl_vars, $tpl_vars);
+            }
+            $_template->tpl_vars = $tpl_vars;
+            $_template->config_vars = $config_vars;
+        }
+        // dummy local smarty variable
+        if (!isset($_template->tpl_vars['smarty'])) {
+            $_template->tpl_vars['smarty'] = new Smarty_Variable;
+        }
+        if (isset($this->smarty->error_reporting)) {
+            $_smarty_old_error_level = error_reporting($this->smarty->error_reporting);
+        }
+        // check URL debugging control
+        if (!$this->smarty->debugging && $this->smarty->debugging_ctrl == 'URL') {
+            if (isset($_SERVER['QUERY_STRING'])) {
+                $_query_string = $_SERVER['QUERY_STRING'];
+            } else {
+                $_query_string = '';
+            }
+            if (false !== strpos($_query_string, $this->smarty->smarty_debug_id)) {
+                if (false !== strpos($_query_string, $this->smarty->smarty_debug_id . '=on')) {
+                    // enable debugging for this browser session
+                    setcookie('SMARTY_DEBUG', true);
+                    $this->smarty->debugging = true;
+                } elseif (false !== strpos($_query_string, $this->smarty->smarty_debug_id . '=off')) {
+                    // disable debugging for this browser session
+                    setcookie('SMARTY_DEBUG', false);
+                    $this->smarty->debugging = false;
+                } else {
+                    // enable debugging for this page
+                    $this->smarty->debugging = true;
+                }
+            } else {
+                if (isset($_COOKIE['SMARTY_DEBUG'])) {
+                    $this->smarty->debugging = true;
+                }
+            }
+        }
+        // must reset merge template date
+        $_template->smarty->merged_templates_func = array();
+        // get rendered template
+        // disable caching for evaluated code
+        if ($_template->source->recompiled) {
+            $_template->caching = false;
+        }
+        // checks if template exists
+        if (!$_template->source->exists) {
+            if ($_template->parent instanceof Smarty_Internal_Template) {
+                $parent_resource = " in '{$_template->parent->template_resource}'";
+            } else {
+                $parent_resource = '';
+            }
+            throw new SmartyException("Unable to load template {$_template->source->type} '{$_template->source->name}'{$parent_resource}");
+        }
+        // read from cache or render
+        if (!($_template->caching == Smarty::CACHING_LIFETIME_CURRENT || $_template->caching == Smarty::CACHING_LIFETIME_SAVED) || !$_template->cached->valid) {
+            // render template (not loaded and not in cache)
+            if (!$_template->source->uncompiled) {
+                $_smarty_tpl = $_template;
+                if ($_template->source->recompiled) {
+                    $code = $_template->compiler->compileTemplate($_template);
+                    if ($this->smarty->debugging) {
+                        Smarty_Internal_Debug::start_render($_template);
+                    }
+                    try {
+                        ob_start();
+                        eval("?>" . $code);
+                        unset($code);
+                    } catch (Exception $e) {
+                        ob_get_clean();
+                        throw $e;
+                    }
+                } else {
+                    if (!$_template->compiled->exists || ($_template->smarty->force_compile && !$_template->compiled->isCompiled)) {
+                        $_template->compileTemplateSource();
+                        $code = file_get_contents($_template->compiled->filepath);
+                        eval("?>" . $code);
+                        unset($code);
+                        $_template->compiled->loaded = true;
+                        $_template->compiled->isCompiled = true;
+                    }
+                    if ($this->smarty->debugging) {
+                        Smarty_Internal_Debug::start_render($_template);
+                    }
+                    if (!$_template->compiled->loaded) {
+                        include($_template->compiled->filepath);
+                        if ($_template->mustCompile) {
+                            // recompile and load again
+                            $_template->compileTemplateSource();
+                            $code = file_get_contents($_template->compiled->filepath);
+                            eval("?>" . $code);
+                            unset($code);
+                            $_template->compiled->isCompiled = true;
+                        }
+                        $_template->compiled->loaded = true;
+                    } else {
+                        $_template->decodeProperties($_template->compiled->_properties, false);
+                    }
+                    try {
+                        ob_start();
+                        if (empty($_template->properties['unifunc']) || !is_callable($_template->properties['unifunc'])) {
+                            throw new SmartyException("Invalid compiled template for '{$_template->template_resource}'");
+                        }
+                        array_unshift($_template->_capture_stack,array());
+                        //
+                        // render compiled template
+                        //
+                        $_template->properties['unifunc']($_template);
+                        // any unclosed {capture} tags ?
+                        if (isset($_template->_capture_stack[0][0])) {
+                            $_template->capture_error();
+                        }
+                        array_shift($_template->_capture_stack);
+                    } catch (Exception $e) {
+                        ob_get_clean();
+                        throw $e;
+                    }
+                }
+            } else {
+                if ($_template->source->uncompiled) {
+                    if ($this->smarty->debugging) {
+                        Smarty_Internal_Debug::start_render($_template);
+                    }
+                    try {
+                        ob_start();
+                        $_template->source->renderUncompiled($_template);
+                    } catch (Exception $e) {
+                        ob_get_clean();
+                        throw $e;
+                    }
+                } else {
+                    throw new SmartyException("Resource '$_template->source->type' must have 'renderUncompiled' method");
+                }
+            }
+            $_output = ob_get_clean();
+            if (!$_template->source->recompiled && empty($_template->properties['file_dependency'][$_template->source->uid])) {
+                $_template->properties['file_dependency'][$_template->source->uid] = array($_template->source->filepath, $_template->source->timestamp, $_template->source->type);
+            }
+            if ($_template->parent instanceof Smarty_Internal_Template) {
+                $_template->parent->properties['file_dependency'] = array_merge($_template->parent->properties['file_dependency'], $_template->properties['file_dependency']);
+                foreach ($_template->required_plugins as $code => $tmp1) {
+                    foreach ($tmp1 as $name => $tmp) {
+                        foreach ($tmp as $type => $data) {
+                            $_template->parent->required_plugins[$code][$name][$type] = $data;
+                        }
+                    }
+                }
+            }
+            if ($this->smarty->debugging) {
+                Smarty_Internal_Debug::end_render($_template);
+            }
+            // write to cache when nessecary
+            if (!$_template->source->recompiled && ($_template->caching == Smarty::CACHING_LIFETIME_SAVED || $_template->caching == Smarty::CACHING_LIFETIME_CURRENT)) {
+                if ($this->smarty->debugging) {
+                    Smarty_Internal_Debug::start_cache($_template);
+                }
+                $_template->properties['has_nocache_code'] = false;
+                // get text between non-cached items
+                $cache_split = preg_split("!/\*%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*\/(.+?)/\*/%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*/!s", $_output);
+                // get non-cached items
+                preg_match_all("!/\*%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*\/(.+?)/\*/%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*/!s", $_output, $cache_parts);
+                $output = '';
+                // loop over items, stitch back together
+                foreach ($cache_split as $curr_idx => $curr_split) {
+                    // escape PHP tags in template content
+                    $output .= preg_replace('/(<%|%>|<\?php|<\?|\?>)/', "<?php echo '\$1'; ?>\n", $curr_split);
+                    if (isset($cache_parts[0][$curr_idx])) {
+                        $_template->properties['has_nocache_code'] = true;
+                        // remove nocache tags from cache output
+                        $output .= preg_replace("!/\*/?%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*/!", '', $cache_parts[0][$curr_idx]);
+                    }
+                }
+                if (!$no_output_filter && !$_template->has_nocache_code && (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output']))) {
+                    $output = Smarty_Internal_Filter_Handler::runFilter('output', $output, $_template);
+                }
+                // rendering (must be done before writing cache file because of {function} nocache handling)
+                $_smarty_tpl = $_template;
+                try {
+                    ob_start();
+                    eval("?>" . $output);
+                    $_output = ob_get_clean();
+                } catch (Exception $e) {
+                    ob_get_clean();
+                    throw $e;
+                }
+                // write cache file content
+                $_template->writeCachedContent($output);
+                if ($this->smarty->debugging) {
+                    Smarty_Internal_Debug::end_cache($_template);
+                }
+            } else {
+                // var_dump('renderTemplate', $_template->has_nocache_code, $_template->template_resource, $_template->properties['nocache_hash'], $_template->parent->properties['nocache_hash'], $_output);
+                if (!empty($_template->properties['nocache_hash']) && !empty($_template->parent->properties['nocache_hash'])) {
+                    // replace nocache_hash
+                    $_output = str_replace("{$_template->properties['nocache_hash']}", $_template->parent->properties['nocache_hash'], $_output);
+                    $_template->parent->has_nocache_code = $_template->parent->has_nocache_code || $_template->has_nocache_code;
+                }
+            }
+        } else {
+            if ($this->smarty->debugging) {
+                Smarty_Internal_Debug::start_cache($_template);
+            }
+            try {
+                ob_start();
+                array_unshift($_template->_capture_stack,array());
+                //
+                // render cached template
+                //
+                $_template->properties['unifunc']($_template);
+                // any unclosed {capture} tags ?
+                if (isset($_template->_capture_stack[0][0])) {
+                    $_template->capture_error();
+                }
+                array_shift($_template->_capture_stack);
+                $_output = ob_get_clean();
+            } catch (Exception $e) {
+                ob_get_clean();
+                throw $e;
+            }
+            if ($this->smarty->debugging) {
+                Smarty_Internal_Debug::end_cache($_template);
+            }
+        }
+        if ((!$this->caching || $_template->has_nocache_code || $_template->source->recompiled) && !$no_output_filter && (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output']))) {
+            $_output = Smarty_Internal_Filter_Handler::runFilter('output', $_output, $_template);
+        }
+        if (isset($this->error_reporting)) {
+            error_reporting($_smarty_old_error_level);
+        }
+        // display or fetch
+        if ($display) {
+            if ($this->caching && $this->cache_modified_check) {
+                $_isCached = $_template->isCached() && !$_template->has_nocache_code;
+                $_last_modified_date = @substr($_SERVER['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_SERVER['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3);
+                if ($_isCached && $_template->cached->timestamp <= strtotime($_last_modified_date)) {
+                    switch (PHP_SAPI) {
+                        case 'cgi':         // php-cgi < 5.3
+                        case 'cgi-fcgi':    // php-cgi >= 5.3
+                        case 'fpm-fcgi':    // php-fpm >= 5.3.3
+                        header('Status: 304 Not Modified');
+                        break;
+
+                        case 'cli':
+                        if (/* ^phpunit */!empty($_SERVER['SMARTY_PHPUNIT_DISABLE_HEADERS'])/* phpunit$ */) {
+                            $_SERVER['SMARTY_PHPUNIT_HEADERS'][] = '304 Not Modified';
+                        }
+                        break;
+
+                        default:
+                        header($_SERVER['SERVER_PROTOCOL'].' 304 Not Modified');
+                        break;
+                    }
+                } else {
+                    switch (PHP_SAPI) {
+                        case 'cli':
+                        if (/* ^phpunit */!empty($_SERVER['SMARTY_PHPUNIT_DISABLE_HEADERS'])/* phpunit$ */) {
+                            $_SERVER['SMARTY_PHPUNIT_HEADERS'][] = 'Last-Modified: ' . gmdate('D, d M Y H:i:s', $_template->cached->timestamp) . ' GMT';
+                        }
+                        break;
+
+                        default:
+                        header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $_template->cached->timestamp) . ' GMT');
+                        break;
+                    }
+                    echo $_output;
+                }
+            } else {
+                echo $_output;
+            }
+            // debug output
+            if ($this->smarty->debugging) {
+                Smarty_Internal_Debug::display_debug($this);
+            }
+            if ($merge_tpl_vars) {
+                // restore local variables
+                $_template->tpl_vars = $save_tpl_vars;
+                $_template->config_vars =  $save_config_vars;
+            }
+
+            return;
+        } else {
+            if ($merge_tpl_vars) {
+                // restore local variables
+                $_template->tpl_vars = $save_tpl_vars;
+                $_template->config_vars =  $save_config_vars;
+            }
+            // return fetched content
+            return $_output;
+        }
+    }
+
+    /**
+     * displays a Smarty template
+     *
+     * @param string $template   the resource handle of the template file or template object
+     * @param mixed  $cache_id   cache id to be used with this template
+     * @param mixed  $compile_id compile id to be used with this template
+     * @param object $parent     next higher level of Smarty variables
+     */
+    public function display($template = null, $cache_id = null, $compile_id = null, $parent = null)
+    {
+        // display template
+        $this->fetch($template, $cache_id, $compile_id, $parent, true);
+    }
+
+    /**
+     * test if cache is valid
+     *
+     * @param  string|object $template   the resource handle of the template file or template object
+     * @param  mixed         $cache_id   cache id to be used with this template
+     * @param  mixed         $compile_id compile id to be used with this template
+     * @param  object        $parent     next higher level of Smarty variables
+     * @return boolean       cache status
+     */
+    public function isCached($template = null, $cache_id = null, $compile_id = null, $parent = null)
+    {
+        if ($template === null && $this instanceof $this->template_class) {
+            return $this->cached->valid;
+        }
+        if (!($template instanceof $this->template_class)) {
+            if ($parent === null) {
+                $parent = $this;
+            }
+            $template = $this->smarty->createTemplate($template, $cache_id, $compile_id, $parent, false);
+        }
+        // return cache status of template
+        return $template->cached->valid;
+    }
+
+    /**
+     * creates a data object
+     *
+     * @param object $parent next higher level of Smarty variables
+     * @returns Smarty_Data data object
+     */
+    public function createData($parent = null)
+    {
+        return new Smarty_Data($parent, $this);
+    }
+
+    /**
+     * Registers plugin to be used in templates
+     *
+     * @param  string                       $type       plugin type
+     * @param  string                       $tag        name of template tag
+     * @param  callback                     $callback   PHP callback to register
+     * @param  boolean                      $cacheable  if true (default) this fuction is cachable
+     * @param  array                        $cache_attr caching attributes if any
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
+     * @throws SmartyException              when the plugin tag is invalid
+     */
+    public function registerPlugin($type, $tag, $callback, $cacheable = true, $cache_attr = null)
+    {
+        if (isset($this->smarty->registered_plugins[$type][$tag])) {
+            throw new SmartyException("Plugin tag \"{$tag}\" already registered");
+        } elseif (!is_callable($callback)) {
+            throw new SmartyException("Plugin \"{$tag}\" not callable");
+        } else {
+            $this->smarty->registered_plugins[$type][$tag] = array($callback, (bool) $cacheable, (array) $cache_attr);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Unregister Plugin
+     *
+     * @param  string                       $type of plugin
+     * @param  string                       $tag  name of plugin
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function unregisterPlugin($type, $tag)
+    {
+        if (isset($this->smarty->registered_plugins[$type][$tag])) {
+            unset($this->smarty->registered_plugins[$type][$tag]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Registers a resource to fetch a template
+     *
+     * @param  string                       $type     name of resource type
+     * @param  Smarty_Resource|array        $callback or instance of Smarty_Resource, or array of callbacks to handle resource (deprecated)
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function registerResource($type, $callback)
+    {
+        $this->smarty->registered_resources[$type] = $callback instanceof Smarty_Resource ? $callback : array($callback, false);
+
+        return $this;
+    }
+
+    /**
+     * Unregisters a resource
+     *
+     * @param  string                       $type name of resource type
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function unregisterResource($type)
+    {
+        if (isset($this->smarty->registered_resources[$type])) {
+            unset($this->smarty->registered_resources[$type]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Registers a cache resource to cache a template's output
+     *
+     * @param  string                       $type     name of cache resource type
+     * @param  Smarty_CacheResource         $callback instance of Smarty_CacheResource to handle output caching
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function registerCacheResource($type, Smarty_CacheResource $callback)
+    {
+        $this->smarty->registered_cache_resources[$type] = $callback;
+
+        return $this;
+    }
+
+    /**
+     * Unregisters a cache resource
+     *
+     * @param  string                       $type name of cache resource type
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function unregisterCacheResource($type)
+    {
+        if (isset($this->smarty->registered_cache_resources[$type])) {
+            unset($this->smarty->registered_cache_resources[$type]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Registers object to be used in templates
+     *
+     * @param  string                       $object        name of template object
+     * @param  object                       $object_impl   the referenced PHP object to register
+     * @param  array                        $allowed       list of allowed methods (empty = all)
+     * @param  boolean                      $smarty_args   smarty argument format, else traditional
+     * @param  array                        $block_methods list of block-methods
+     * @param  array                        $block_functs  list of methods that are block format
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
+     * @throws SmartyException              if any of the methods in $allowed or $block_methods are invalid
+     */
+    public function registerObject($object_name, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
+    {
+        // test if allowed methodes callable
+        if (!empty($allowed)) {
+            foreach ((array) $allowed as $method) {
+                if (!is_callable(array($object_impl, $method)) && !property_exists($object_impl, $method)) {
+                    throw new SmartyException("Undefined method or property '$method' in registered object");
+                }
+            }
+        }
+        // test if block methodes callable
+        if (!empty($block_methods)) {
+            foreach ((array) $block_methods as $method) {
+                if (!is_callable(array($object_impl, $method))) {
+                    throw new SmartyException("Undefined method '$method' in registered object");
+                }
+            }
+        }
+        // register the object
+        $this->smarty->registered_objects[$object_name] =
+        array($object_impl, (array) $allowed, (boolean) $smarty_args, (array) $block_methods);
+
+        return $this;
+    }
+
+    /**
+     * return a reference to a registered object
+     *
+     * @param  string          $name object name
+     * @return object
+     * @throws SmartyException if no such object is found
+     */
+    public function getRegisteredObject($name)
+    {
+        if (!isset($this->smarty->registered_objects[$name])) {
+            throw new SmartyException("'$name' is not a registered object");
+        }
+        if (!is_object($this->smarty->registered_objects[$name][0])) {
+            throw new SmartyException("registered '$name' is not an object");
+        }
+
+        return $this->smarty->registered_objects[$name][0];
+    }
+
+    /**
+     * unregister an object
+     *
+     * @param  string                       $name object name
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function unregisterObject($name)
+    {
+        if (isset($this->smarty->registered_objects[$name])) {
+            unset($this->smarty->registered_objects[$name]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Registers static classes to be used in templates
+     *
+     * @param  string                       $class      name of template class
+     * @param  string                       $class_impl the referenced PHP class to register
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
+     * @throws SmartyException              if $class_impl does not refer to an existing class
+     */
+    public function registerClass($class_name, $class_impl)
+    {
+        // test if exists
+        if (!class_exists($class_impl)) {
+            throw new SmartyException("Undefined class '$class_impl' in register template class");
+        }
+        // register the class
+        $this->smarty->registered_classes[$class_name] = $class_impl;
+
+        return $this;
+    }
+
+    /**
+     * Registers a default plugin handler
+     *
+     * @param  callable                     $callback class/method name
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
+     * @throws SmartyException              if $callback is not callable
+     */
+    public function registerDefaultPluginHandler($callback)
+    {
+        if (is_callable($callback)) {
+            $this->smarty->default_plugin_handler_func = $callback;
+        } else {
+            throw new SmartyException("Default plugin handler '$callback' not callable");
+        }
+
+        return $this;
+    }
+
+    /**
+     * Registers a default template handler
+     *
+     * @param  callable                     $callback class/method name
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
+     * @throws SmartyException              if $callback is not callable
+     */
+    public function registerDefaultTemplateHandler($callback)
+    {
+        if (is_callable($callback)) {
+            $this->smarty->default_template_handler_func = $callback;
+        } else {
+            throw new SmartyException("Default template handler '$callback' not callable");
+        }
+
+        return $this;
+    }
+
+    /**
+     * Registers a default template handler
+     *
+     * @param  callable                     $callback class/method name
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
+     * @throws SmartyException              if $callback is not callable
+     */
+    public function registerDefaultConfigHandler($callback)
+    {
+        if (is_callable($callback)) {
+            $this->smarty->default_config_handler_func = $callback;
+        } else {
+            throw new SmartyException("Default config handler '$callback' not callable");
+        }
+
+        return $this;
+    }
+
+    /**
+     * Registers a filter function
+     *
+     * @param  string                       $type     filter type
+     * @param  callback                     $callback
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function registerFilter($type, $callback)
+    {
+        $this->smarty->registered_filters[$type][$this->_get_filter_name($callback)] = $callback;
+
+        return $this;
+    }
+
+    /**
+     * Unregisters a filter function
+     *
+     * @param  string                       $type     filter type
+     * @param  callback                     $callback
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function unregisterFilter($type, $callback)
+    {
+        $name = $this->_get_filter_name($callback);
+        if (isset($this->smarty->registered_filters[$type][$name])) {
+            unset($this->smarty->registered_filters[$type][$name]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Return internal filter name
+     *
+     * @param  callback $function_name
+     * @return string   internal filter name
+     */
+    public function _get_filter_name($function_name)
+    {
+        if (is_array($function_name)) {
+            $_class_name = (is_object($function_name[0]) ?
+            get_class($function_name[0]) : $function_name[0]);
+
+            return $_class_name . '_' . $function_name[1];
+        } else {
+            return $function_name;
+        }
+    }
+
+    /**
+     * load a filter of specified type and name
+     *
+     * @param  string          $type filter type
+     * @param  string          $name filter name
+     * @throws SmartyException if filter could not be loaded
+     */
+    public function loadFilter($type, $name)
+    {
+        $_plugin = "smarty_{$type}filter_{$name}";
+        $_filter_name = $_plugin;
+        if ($this->smarty->loadPlugin($_plugin)) {
+            if (class_exists($_plugin, false)) {
+                $_plugin = array($_plugin, 'execute');
+            }
+            if (is_callable($_plugin)) {
+                $this->smarty->registered_filters[$type][$_filter_name] = $_plugin;
+
+                return true;
+            }
+        }
+        throw new SmartyException("{$type}filter \"{$name}\" not callable");
+    }
+
+    /**
+     * unload a filter of specified type and name
+     *
+     * @param  string                       $type filter type
+     * @param  string                       $name filter name
+     * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
+     */
+    public function unloadFilter($type, $name)
+    {
+        $_filter_name = "smarty_{$type}filter_{$name}";
+        if (isset($this->smarty->registered_filters[$type][$_filter_name])) {
+            unset ($this->smarty->registered_filters[$type][$_filter_name]);
+        }
+
+        return $this;
+    }
+
+    /**
+     * preg_replace callback to convert camelcase getter/setter to underscore property names
+     *
+     * @param  string $match match string
+     * @return string replacemant
+     */
+    private function replaceCamelcase($match)
+    {
+        return "_" . strtolower($match[1]);
+    }
+
+    /**
+     * Handle unknown class methods
+     *
+     * @param string $name unknown method-name
+     * @param array  $args argument array
+     */
+    public function __call($name, $args)
+    {
+        static $_prefixes = array('set' => true, 'get' => true);
+        static $_resolved_property_name = array();
+        static $_resolved_property_source = array();
+
+        // method of Smarty object?
+        if (method_exists($this->smarty, $name)) {
+            return call_user_func_array(array($this->smarty, $name), $args);
+        }
+        // see if this is a set/get for a property
+        $first3 = strtolower(substr($name, 0, 3));
+        if (isset($_prefixes[$first3]) && isset($name[3]) && $name[3] !== '_') {
+            if (isset($_resolved_property_name[$name])) {
+                $property_name = $_resolved_property_name[$name];
+            } else {
+                // try to keep case correct for future PHP 6.0 case-sensitive class methods
+                // lcfirst() not available < PHP 5.3.0, so improvise
+                $property_name = strtolower(substr($name, 3, 1)) . substr($name, 4);
+                // convert camel case to underscored name
+                $property_name = preg_replace_callback('/([A-Z])/', array($this,'replaceCamelcase'), $property_name);
+                $_resolved_property_name[$name] = $property_name;
+            }
+            if (isset($_resolved_property_source[$property_name])) {
+                $_is_this = $_resolved_property_source[$property_name];
+            } else {
+                $_is_this = null;
+                if (property_exists($this, $property_name)) {
+                    $_is_this = true;
+                } elseif (property_exists($this->smarty, $property_name)) {
+                    $_is_this = false;
+                }
+                $_resolved_property_source[$property_name] = $_is_this;
+            }
+            if ($_is_this) {
+                if ($first3 == 'get')
+                return $this->$property_name;
+                else
+                return $this->$property_name = $args[0];
+            } elseif ($_is_this === false) {
+                if ($first3 == 'get')
+                return $this->smarty->$property_name;
+                else
+                return $this->smarty->$property_name = $args[0];
+            } else {
+                throw new SmartyException("property '$property_name' does not exist.");
+
+                return false;
+            }
+        }
+        if ($name == 'Smarty') {
+            throw new SmartyException("PHP5 requires you to call __construct() instead of Smarty()");
+        }
+        // must be unknown
+        throw new SmartyException("Call of unknown method '$name'.");
+    }
+
+}

+ 809 - 809
resources/templates/engine/smarty/sysplugins/smarty_internal_templatecompilerbase.php

@@ -1,809 +1,809 @@
-<?php
-
-/**
- * Smarty Internal Plugin Smarty Template Compiler Base
- *
- * This file contains the basic classes and methodes for compiling Smarty templates with lexer/parser
- *
- * @package Smarty
- * @subpackage Compiler
- * @author Uwe Tews
- */
-
-/**
- * Main abstract compiler class
- *
- * @package Smarty
- * @subpackage Compiler
- */
-abstract class Smarty_Internal_TemplateCompilerBase
-{
-    /**
-     * hash for nocache sections
-     *
-     * @var mixed
-     */
-    private $nocache_hash = null;
-
-    /**
-     * suppress generation of nocache code
-     *
-     * @var bool
-     */
-    public $suppressNocacheProcessing = false;
-
-    /**
-     * suppress generation of merged template code
-     *
-     * @var bool
-     */
-    public $suppressMergedTemplates = false;
-
-    /**
-     * compile tag objects
-     *
-     * @var array
-     */
-    public static $_tag_objects = array();
-
-    /**
-     * tag stack
-     *
-     * @var array
-     */
-    public $_tag_stack = array();
-
-    /**
-     * current template
-     *
-     * @var Smarty_Internal_Template
-     */
-    public $template = null;
-
-    /**
-     * merged templates
-     *
-     * @var array
-     */
-    public $merged_templates = array();
-
-    /**
-     * sources which must be compiled
-     *
-     * @var array
-     */
-    public $sources = array();
-
-    /**
-     * flag that we are inside {block}
-     *
-     * @var bool
-     */
-    public $inheritance = false;
-
-    /**
-     * flag when compiling inheritance child template
-     *
-     * @var bool
-     */
-    public $inheritance_child = false;
-
-    /**
-     * uid of templates called by {extends} for recursion check
-     *
-     * @var array
-     */
-    public $extends_uid = array();
-
-    /**
-     * source line offset for error messages
-     *
-     * @var int
-     */
-    public $trace_line_offset = 0;
-
-    /**
-     * trace uid
-     *
-     * @var string
-     */
-    public $trace_uid = '';
-
-    /**
-     * trace file path
-     *
-     * @var string
-     */
-    public $trace_filepath = '';
-    /**
-     * stack for tracing file and line of nested {block} tags
-     *
-     * @var array
-     */
-    public $trace_stack = array();
-
-    /**
-     * plugins loaded by default plugin handler
-     *
-     * @var array
-     */
-    public $default_handler_plugins = array();
-
-    /**
-     * saved preprocessed modifier list
-     *
-     * @var mixed
-     */
-    public $default_modifier_list = null;
-
-    /**
-     * force compilation of complete template as nocache
-     * @var boolean
-     */
-    public $forceNocache = false;
-
-    /**
-     * suppress Smarty header code in compiled template
-     * @var bool
-     */
-    public $suppressHeader = false;
-
-    /**
-     * suppress template property header code in compiled template
-     * @var bool
-     */
-    public $suppressTemplatePropertyHeader = false;
-
-    /**
-     * suppress pre and post filter
-     * @var bool
-     */
-    public $suppressFilter = false;
-
-    /**
-     * flag if compiled template file shall we written
-     * @var bool
-     */
-    public $write_compiled_code = true;
-
-    /**
-     * flag if currently a template function is compiled
-     * @var bool
-     */
-    public $compiles_template_function = false;
-
-    /**
-     * called subfuntions from template function
-     * @var array
-     */
-    public $called_functions = array();
-
-    /**
-     * flags for used modifier plugins
-     * @var array
-     */
-    public $modifier_plugins = array();
-
-    /**
-     * type of already compiled modifier
-     * @var array
-     */
-    public $known_modifier_type = array();
-
-    /**
-     * Methode to compile a Smarty template
-     *
-     * @param  mixed $_content template source
-     * @return bool  true if compiling succeeded, false if it failed
-     */
-    abstract protected function doCompile($_content);
-
-    /**
-     * Initialize compiler
-     */
-    public function __construct()
-    {
-        $this->nocache_hash = str_replace('.', '-', uniqid(rand(), true));
-    }
-
-    /**
-     * Method to compile a Smarty template
-     *
-     * @param  Smarty_Internal_Template $template template object to compile
-     * @param  bool $nocache    true is shall be compiled in nocache mode
-     * @return bool             true if compiling succeeded, false if it failed
-     */
-    public function compileTemplate(Smarty_Internal_Template $template, $nocache = false)
-    {
-        if (empty($template->properties['nocache_hash'])) {
-            $template->properties['nocache_hash'] = $this->nocache_hash;
-        } else {
-            $this->nocache_hash = $template->properties['nocache_hash'];
-        }
-        // flag for nochache sections
-        $this->nocache = $nocache;
-        $this->tag_nocache = false;
-        // save template object in compiler class
-        $this->template = $template;
-        // reset has nocache code flag
-        $this->template->has_nocache_code = false;
-        $save_source = $this->template->source;
-        // template header code
-        $template_header = '';
-        if (!$this->suppressHeader) {
-            $template_header .= "<?php /* Smarty version " . Smarty::SMARTY_VERSION . ", created on " . strftime("%Y-%m-%d %H:%M:%S") . "\n";
-            $template_header .= "         compiled from \"" . $this->template->source->filepath . "\" */ ?>\n";
-        }
-
-        if (empty($this->template->source->components)) {
-            $this->sources = array($template->source);
-        } else {
-            // we have array of inheritance templates by extends: resource
-            $this->sources = array_reverse($template->source->components);
-        }
-        $loop = 0;
-        // the $this->sources array can get additional elements while compiling by the {extends} tag
-        while ($this->template->source = array_shift($this->sources)) {
-            $this->smarty->_current_file = $this->template->source->filepath;
-            if ($this->smarty->debugging) {
-                Smarty_Internal_Debug::start_compile($this->template);
-            }
-            $no_sources = count($this->sources);
-            if ($loop || $no_sources) {
-                $this->template->properties['file_dependency'][$this->template->source->uid] = array($this->template->source->filepath, $this->template->source->timestamp, $this->template->source->type);
-            }
-            $loop++;
-            if ($no_sources) {
-                $this->inheritance_child = true;
-            } else {
-                $this->inheritance_child = false;
-            }
-            do {
-                $_compiled_code = '';
-                // flag for aborting current and start recompile
-                $this->abort_and_recompile = false;
-                // get template source
-                $_content = $this->template->source->content;
-                if ($_content != '') {
-                    // run prefilter if required
-                    if ((isset($this->smarty->autoload_filters['pre']) || isset($this->smarty->registered_filters['pre'])) && !$this->suppressFilter) {
-                        $_content = Smarty_Internal_Filter_Handler::runFilter('pre', $_content, $template);
-                    }
-                    // call compiler
-                    $_compiled_code = $this->doCompile($_content);
-                }
-            } while ($this->abort_and_recompile);
-            if ($this->smarty->debugging) {
-                Smarty_Internal_Debug::end_compile($this->template);
-            }
-        }
-        // restore source
-        $this->template->source = $save_source;
-        unset($save_source);
-        $this->smarty->_current_file = $this->template->source->filepath;
-        // free memory
-        unset($this->parser->root_buffer, $this->parser->current_buffer, $this->parser, $this->lex, $this->template);
-        self::$_tag_objects = array();
-        // return compiled code to template object
-        $merged_code = '';
-        if (!$this->suppressMergedTemplates && !empty($this->merged_templates)) {
-            foreach ($this->merged_templates as $code) {
-                $merged_code .= $code;
-            }
-        }
-        // run postfilter if required on compiled template code
-        if ((isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) && !$this->suppressFilter && $_compiled_code != '') {
-            $_compiled_code = Smarty_Internal_Filter_Handler::runFilter('post', $_compiled_code, $template);
-        }
-        if ($this->suppressTemplatePropertyHeader) {
-            $code = $_compiled_code . $merged_code;
-        } else {
-            $code = $template_header . $template->createTemplateCodeFrame($_compiled_code) . $merged_code;
-        }
-        // unset content because template inheritance could have replace source with parent code
-        unset ($template->source->content);
-
-        return $code;
-    }
-
-    /**
-     * Compile Tag
-     *
-     * This is a call back from the lexer/parser
-     * It executes the required compile plugin for the Smarty tag
-     *
-     * @param  string $tag       tag name
-     * @param  array $args      array with tag attributes
-     * @param  array $parameter array with compilation parameter
-     * @return string compiled code
-     */
-    public function compileTag($tag, $args, $parameter = array())
-    {
-        // $args contains the attributes parsed and compiled by the lexer/parser
-        // assume that tag does compile into code, but creates no HTML output
-        $this->has_code = true;
-        $this->has_output = false;
-        // log tag/attributes
-        if (isset($this->smarty->get_used_tags) && $this->smarty->get_used_tags) {
-            $this->template->used_tags[] = array($tag, $args);
-        }
-        // check nocache option flag
-        if (in_array("'nocache'", $args) || in_array(array('nocache' => 'true'), $args)
-            || in_array(array('nocache' => '"true"'), $args) || in_array(array('nocache' => "'true'"), $args)
-        ) {
-            $this->tag_nocache = true;
-        }
-        // compile the smarty tag (required compile classes to compile the tag are autoloaded)
-        if (($_output = $this->callTagCompiler($tag, $args, $parameter)) === false) {
-            if (isset($this->smarty->template_functions[$tag])) {
-                // template defined by {template} tag
-                $args['_attr']['name'] = "'" . $tag . "'";
-                $_output = $this->callTagCompiler('call', $args, $parameter);
-            }
-        }
-        if ($_output !== false) {
-            if ($_output !== true) {
-                // did we get compiled code
-                if ($this->has_code) {
-                    // Does it create output?
-                    if ($this->has_output) {
-                        $_output .= "\n";
-                    }
-                    // return compiled code
-                    return $_output;
-                }
-            }
-            // tag did not produce compiled code
-            return null;
-        } else {
-            // map_named attributes
-            if (isset($args['_attr'])) {
-                foreach ($args['_attr'] as $key => $attribute) {
-                    if (is_array($attribute)) {
-                        $args = array_merge($args, $attribute);
-                    }
-                }
-            }
-            // not an internal compiler tag
-            if (strlen($tag) < 6 || substr($tag, -5) != 'close') {
-                // check if tag is a registered object
-                if (isset($this->smarty->registered_objects[$tag]) && isset($parameter['object_methode'])) {
-                    $methode = $parameter['object_methode'];
-                    if (!in_array($methode, $this->smarty->registered_objects[$tag][3]) &&
-                        (empty($this->smarty->registered_objects[$tag][1]) || in_array($methode, $this->smarty->registered_objects[$tag][1]))
-                    ) {
-                        return $this->callTagCompiler('private_object_function', $args, $parameter, $tag, $methode);
-                    } elseif (in_array($methode, $this->smarty->registered_objects[$tag][3])) {
-                        return $this->callTagCompiler('private_object_block_function', $args, $parameter, $tag, $methode);
-                    } else {
-                        return $this->trigger_template_error('unallowed methode "' . $methode . '" in registered object "' . $tag . '"', $this->lex->taglineno);
-                    }
-                }
-                // check if tag is registered
-                foreach (array(Smarty::PLUGIN_COMPILER, Smarty::PLUGIN_FUNCTION, Smarty::PLUGIN_BLOCK) as $plugin_type) {
-                    if (isset($this->smarty->registered_plugins[$plugin_type][$tag])) {
-                        // if compiler function plugin call it now
-                        if ($plugin_type == Smarty::PLUGIN_COMPILER) {
-                            $new_args = array();
-                            foreach ($args as $key => $mixed) {
-                                if (is_array($mixed)) {
-                                    $new_args = array_merge($new_args, $mixed);
-                                } else {
-                                    $new_args[$key] = $mixed;
-                                }
-                            }
-                            if (!$this->smarty->registered_plugins[$plugin_type][$tag][1]) {
-                                $this->tag_nocache = true;
-                            }
-                            $function = $this->smarty->registered_plugins[$plugin_type][$tag][0];
-                            if (!is_array($function)) {
-                                return $function($new_args, $this);
-                            } elseif (is_object($function[0])) {
-                                return $this->smarty->registered_plugins[$plugin_type][$tag][0][0]->$function[1]($new_args, $this);
-                            } else {
-                                return call_user_func_array($function, array($new_args, $this));
-                            }
-                        }
-                        // compile registered function or block function
-                        if ($plugin_type == Smarty::PLUGIN_FUNCTION || $plugin_type == Smarty::PLUGIN_BLOCK) {
-                            return $this->callTagCompiler('private_registered_' . $plugin_type, $args, $parameter, $tag);
-                        }
-                    }
-                }
-                // check plugins from plugins folder
-                foreach ($this->smarty->plugin_search_order as $plugin_type) {
-                    if ($plugin_type == Smarty::PLUGIN_COMPILER && $this->smarty->loadPlugin('smarty_compiler_' . $tag) && (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this))) {
-                        $plugin = 'smarty_compiler_' . $tag;
-                        if (is_callable($plugin)) {
-                            // convert arguments format for old compiler plugins
-                            $new_args = array();
-                            foreach ($args as $key => $mixed) {
-                                if (is_array($mixed)) {
-                                    $new_args = array_merge($new_args, $mixed);
-                                } else {
-                                    $new_args[$key] = $mixed;
-                                }
-                            }
-
-                            return $plugin($new_args, $this->smarty);
-                        }
-                        if (class_exists($plugin, false)) {
-                            $plugin_object = new $plugin;
-                            if (method_exists($plugin_object, 'compile')) {
-                                return $plugin_object->compile($args, $this);
-                            }
-                        }
-                        throw new SmartyException("Plugin \"{$tag}\" not callable");
-                    } else {
-                        if ($function = $this->getPlugin($tag, $plugin_type)) {
-                            if (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this)) {
-                                return $this->callTagCompiler('private_' . $plugin_type . '_plugin', $args, $parameter, $tag, $function);
-                            }
-                        }
-                    }
-                }
-                if (is_callable($this->smarty->default_plugin_handler_func)) {
-                    $found = false;
-                    // look for already resolved tags
-                    foreach ($this->smarty->plugin_search_order as $plugin_type) {
-                        if (isset($this->default_handler_plugins[$plugin_type][$tag])) {
-                            $found = true;
-                            break;
-                        }
-                    }
-                    if (!$found) {
-                        // call default handler
-                        foreach ($this->smarty->plugin_search_order as $plugin_type) {
-                            if ($this->getPluginFromDefaultHandler($tag, $plugin_type)) {
-                                $found = true;
-                                break;
-                            }
-                        }
-                    }
-                    if ($found) {
-                        // if compiler function plugin call it now
-                        if ($plugin_type == Smarty::PLUGIN_COMPILER) {
-                            $new_args = array();
-                            foreach ($args as $mixed) {
-                                $new_args = array_merge($new_args, $mixed);
-                            }
-                            $function = $this->default_handler_plugins[$plugin_type][$tag][0];
-                            if (!is_array($function)) {
-                                return $function($new_args, $this);
-                            } elseif (is_object($function[0])) {
-                                return $this->default_handler_plugins[$plugin_type][$tag][0][0]->$function[1]($new_args, $this);
-                            } else {
-                                return call_user_func_array($function, array($new_args, $this));
-                            }
-                        } else {
-                            return $this->callTagCompiler('private_registered_' . $plugin_type, $args, $parameter, $tag);
-                        }
-                    }
-                }
-            } else {
-                // compile closing tag of block function
-                $base_tag = substr($tag, 0, -5);
-                // check if closing tag is a registered object
-                if (isset($this->smarty->registered_objects[$base_tag]) && isset($parameter['object_methode'])) {
-                    $methode = $parameter['object_methode'];
-                    if (in_array($methode, $this->smarty->registered_objects[$base_tag][3])) {
-                        return $this->callTagCompiler('private_object_block_function', $args, $parameter, $tag, $methode);
-                    } else {
-                        return $this->trigger_template_error('unallowed closing tag methode "' . $methode . '" in registered object "' . $base_tag . '"', $this->lex->taglineno);
-                    }
-                }
-                // registered block tag ?
-                if (isset($this->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$base_tag]) || isset($this->default_handler_plugins[Smarty::PLUGIN_BLOCK][$base_tag])) {
-                    return $this->callTagCompiler('private_registered_block', $args, $parameter, $tag);
-                }
-                // block plugin?
-                if ($function = $this->getPlugin($base_tag, Smarty::PLUGIN_BLOCK)) {
-                    return $this->callTagCompiler('private_block_plugin', $args, $parameter, $tag, $function);
-                }
-                // registered compiler plugin ?
-                if (isset($this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag])) {
-                    // if compiler function plugin call it now
-                    $args = array();
-                    if (!$this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag][1]) {
-                        $this->tag_nocache = true;
-                    }
-                    $function = $this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag][0];
-                    if (!is_array($function)) {
-                        return $function($args, $this);
-                    } elseif (is_object($function[0])) {
-                        return $this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag][0][0]->$function[1]($args, $this);
-                    } else {
-                        return call_user_func_array($function, array($args, $this));
-                    }
-                }
-                if ($this->smarty->loadPlugin('smarty_compiler_' . $tag)) {
-                    $plugin = 'smarty_compiler_' . $tag;
-                    if (is_callable($plugin)) {
-                        return $plugin($args, $this->smarty);
-                    }
-                    if (class_exists($plugin, false)) {
-                        $plugin_object = new $plugin;
-                        if (method_exists($plugin_object, 'compile')) {
-                            return $plugin_object->compile($args, $this);
-                        }
-                    }
-                    throw new SmartyException("Plugin \"{$tag}\" not callable");
-                }
-            }
-            $this->trigger_template_error("unknown tag \"" . $tag . "\"", $this->lex->taglineno);
-        }
-    }
-
-    /**
-     * lazy loads internal compile plugin for tag and calls the compile methode
-     *
-     * compile objects cached for reuse.
-     * class name format:  Smarty_Internal_Compile_TagName
-     * plugin filename format: Smarty_Internal_Tagname.php
-     *
-     * @param  string $tag    tag name
-     * @param  array $args   list of tag attributes
-     * @param  mixed $param1 optional parameter
-     * @param  mixed $param2 optional parameter
-     * @param  mixed $param3 optional parameter
-     * @return string compiled code
-     */
-    public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null)
-    {
-        // re-use object if already exists
-        if (isset(self::$_tag_objects[$tag])) {
-            // compile this tag
-            return self::$_tag_objects[$tag]->compile($args, $this, $param1, $param2, $param3);
-        }
-        // lazy load internal compiler plugin
-        $class_name = 'Smarty_Internal_Compile_' . $tag;
-        if ($this->smarty->loadPlugin($class_name)) {
-            // check if tag allowed by security
-            if (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this)) {
-                // use plugin if found
-                self::$_tag_objects[$tag] = new $class_name;
-                // compile this tag
-                return self::$_tag_objects[$tag]->compile($args, $this, $param1, $param2, $param3);
-            }
-        }
-        // no internal compile plugin for this tag
-        return false;
-    }
-
-    /**
-     * Check for plugins and return function name
-     *
-     * @param  string $pugin_name  name of plugin or function
-     * @param  string $plugin_type type of plugin
-     * @return string call name of function
-     */
-    public function getPlugin($plugin_name, $plugin_type)
-    {
-        $function = null;
-        if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {
-            if (isset($this->template->required_plugins['nocache'][$plugin_name][$plugin_type])) {
-                $function = $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['function'];
-            } elseif (isset($this->template->required_plugins['compiled'][$plugin_name][$plugin_type])) {
-                $this->template->required_plugins['nocache'][$plugin_name][$plugin_type] = $this->template->required_plugins['compiled'][$plugin_name][$plugin_type];
-                $function = $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['function'];
-            }
-        } else {
-            if (isset($this->template->required_plugins['compiled'][$plugin_name][$plugin_type])) {
-                $function = $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['function'];
-            } elseif (isset($this->template->required_plugins['nocache'][$plugin_name][$plugin_type])) {
-                $this->template->required_plugins['compiled'][$plugin_name][$plugin_type] = $this->template->required_plugins['nocache'][$plugin_name][$plugin_type];
-                $function = $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['function'];
-            }
-        }
-        if (isset($function)) {
-            if ($plugin_type == 'modifier') {
-                $this->modifier_plugins[$plugin_name] = true;
-            }
-
-            return $function;
-        }
-        // loop through plugin dirs and find the plugin
-        $function = 'smarty_' . $plugin_type . '_' . $plugin_name;
-        $file = $this->smarty->loadPlugin($function, false);
-
-        if (is_string($file)) {
-            if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {
-                $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['file'] = $file;
-                $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['function'] = $function;
-            } else {
-                $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['file'] = $file;
-                $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['function'] = $function;
-            }
-            if ($plugin_type == 'modifier') {
-                $this->modifier_plugins[$plugin_name] = true;
-            }
-
-            return $function;
-        }
-        if (is_callable($function)) {
-            // plugin function is defined in the script
-            return $function;
-        }
-
-        return false;
-    }
-
-    /**
-     * Check for plugins by default plugin handler
-     *
-     * @param  string $tag         name of tag
-     * @param  string $plugin_type type of plugin
-     * @return boolean true if found
-     */
-    public function getPluginFromDefaultHandler($tag, $plugin_type)
-    {
-        $callback = null;
-        $script = null;
-        $cacheable = true;
-        $result = call_user_func_array(
-            $this->smarty->default_plugin_handler_func, array($tag, $plugin_type, $this->template, &$callback, &$script, &$cacheable)
-        );
-        if ($result) {
-            $this->tag_nocache = $this->tag_nocache || !$cacheable;
-            if ($script !== null) {
-                if (is_file($script)) {
-                    if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {
-                        $this->template->required_plugins['nocache'][$tag][$plugin_type]['file'] = $script;
-                        $this->template->required_plugins['nocache'][$tag][$plugin_type]['function'] = $callback;
-                    } else {
-                        $this->template->required_plugins['compiled'][$tag][$plugin_type]['file'] = $script;
-                        $this->template->required_plugins['compiled'][$tag][$plugin_type]['function'] = $callback;
-                    }
-                    include_once $script;
-                } else {
-                    $this->trigger_template_error("Default plugin handler: Returned script file \"{$script}\" for \"{$tag}\" not found");
-                }
-            }
-            if (!is_string($callback) && !(is_array($callback) && is_string($callback[0]) && is_string($callback[1]))) {
-                $this->trigger_template_error("Default plugin handler: Returned callback for \"{$tag}\" must be a static function name or array of class and function name");
-            }
-            if (is_callable($callback)) {
-                $this->default_handler_plugins[$plugin_type][$tag] = array($callback, true, array());
-
-                return true;
-            } else {
-                $this->trigger_template_error("Default plugin handler: Returned callback for \"{$tag}\" not callable");
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Inject inline code for nocache template sections
-     *
-     * This method gets the content of each template element from the parser.
-     * If the content is compiled code and it should be not cached the code is injected
-     * into the rendered output.
-     *
-     * @param  string $content content of template element
-     * @param  boolean $is_code true if content is compiled code
-     * @return string  content
-     */
-    public function processNocacheCode($content, $is_code)
-    {
-        // If the template is not evaluated and we have a nocache section and or a nocache tag
-        if ($is_code && !empty($content)) {
-            // generate replacement code
-            if ((!($this->template->source->recompiled) || $this->forceNocache) && $this->template->caching && !$this->suppressNocacheProcessing &&
-                ($this->nocache || $this->tag_nocache)
-            ) {
-                $this->template->has_nocache_code = true;
-                $_output = addcslashes($content, '\'\\');
-                $_output = str_replace("^#^", "'", $_output);
-                $_output = "<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\n";
-                // make sure we include modifier plugins for nocache code
-                foreach ($this->modifier_plugins as $plugin_name => $dummy) {
-                    if (isset($this->template->required_plugins['compiled'][$plugin_name]['modifier'])) {
-                        $this->template->required_plugins['nocache'][$plugin_name]['modifier'] = $this->template->required_plugins['compiled'][$plugin_name]['modifier'];
-                    }
-                }
-            } else {
-                $_output = $content;
-            }
-        } else {
-            $_output = $content;
-        }
-        $this->modifier_plugins = array();
-        $this->suppressNocacheProcessing = false;
-        $this->tag_nocache = false;
-
-        return $_output;
-    }
-
-    /**
-     *  push current file and line offset on stack for tracing {block} source lines
-     *
-     * @param string $file new filename
-     * @param string $uid uid of file
-     * @param string $debug false debug end_compile shall not be called
-     * @param int $line line offset to source
-     */
-    public function pushTrace($file, $uid, $line, $debug = true)
-    {
-        if ($this->smarty->debugging && $debug) {
-            Smarty_Internal_Debug::end_compile($this->template);
-        }
-        array_push($this->trace_stack, array($this->smarty->_current_file, $this->trace_filepath, $this->trace_uid, $this->trace_line_offset));
-        $this->trace_filepath = $this->smarty->_current_file = $file;
-        $this->trace_uid = $uid;
-        $this->trace_line_offset = $line ;
-        if ($this->smarty->debugging) {
-            Smarty_Internal_Debug::start_compile($this->template);
-        }
-    }
-
-    /**
-     *  restore file and line offset
-     *
-     */
-    public function popTrace()
-    {
-        if ($this->smarty->debugging) {
-            Smarty_Internal_Debug::end_compile($this->template);
-        }
-        $r = array_pop($this->trace_stack);
-        $this->smarty->_current_file = $r[0];
-        $this->trace_filepath = $r[1];
-        $this->trace_uid = $r[2];
-        $this->trace_line_offset = $r[3];
-        if ($this->smarty->debugging) {
-            Smarty_Internal_Debug::start_compile($this->template);
-        }
-    }
-
-    /**
-     * display compiler error messages without dying
-     *
-     * If parameter $args is empty it is a parser detected syntax error.
-     * In this case the parser is called to obtain information about expected tokens.
-     *
-     * If parameter $args contains a string this is used as error message
-     *
-     * @param  string $args individual error message or null
-     * @param  string $line line-number
-     * @throws SmartyCompilerException when an unexpected token is found
-     */
-    public function trigger_template_error($args = null, $line = null)
-    {
-        // get template source line which has error
-        if (!isset($line)) {
-            $line = $this->lex->line;
-        }
-//        $line += $this->trace_line_offset;
-        $match = preg_split("/\n/", $this->lex->data);
-        $error_text = 'Syntax error in template "' . (empty($this->trace_filepath) ? $this->template->source->filepath : $this->trace_filepath) . '"  on line ' . ($line + $this->trace_line_offset)  . ' "' . trim(preg_replace('![\t\r\n]+!', ' ', $match[$line - 1])) . '" ';
-        if (isset($args)) {
-            // individual error message
-            $error_text .= $args;
-        } else {
-            // expected token from parser
-            $error_text .= ' - Unexpected "' . $this->lex->value . '"';
-            if (count($this->parser->yy_get_expected_tokens($this->parser->yymajor)) <= 4) {
-                foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) {
-                    $exp_token = $this->parser->yyTokenName[$token];
-                    if (isset($this->lex->smarty_token_names[$exp_token])) {
-                        // token type from lexer
-                        $expect[] = '"' . $this->lex->smarty_token_names[$exp_token] . '"';
-                    } else {
-                        // otherwise internal token name
-                        $expect[] = $this->parser->yyTokenName[$token];
-                    }
-                }
-                $error_text .= ', expected one of: ' . implode(' , ', $expect);
-            }
-        }
-        $e = new SmartyCompilerException($error_text);
-        $e->line = $line;
-        $e->source = trim(preg_replace('![\t\r\n]+!', ' ', $match[$line - 1]));
-        $e->desc = $args;
-        $e->template = $this->template->source->filepath;
-        throw $e;
-    }
-
-}
+<?php
+
+/**
+ * Smarty Internal Plugin Smarty Template Compiler Base
+ *
+ * This file contains the basic classes and methodes for compiling Smarty templates with lexer/parser
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Main abstract compiler class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+abstract class Smarty_Internal_TemplateCompilerBase
+{
+    /**
+     * hash for nocache sections
+     *
+     * @var mixed
+     */
+    private $nocache_hash = null;
+
+    /**
+     * suppress generation of nocache code
+     *
+     * @var bool
+     */
+    public $suppressNocacheProcessing = false;
+
+    /**
+     * suppress generation of merged template code
+     *
+     * @var bool
+     */
+    public $suppressMergedTemplates = false;
+
+    /**
+     * compile tag objects
+     *
+     * @var array
+     */
+    public static $_tag_objects = array();
+
+    /**
+     * tag stack
+     *
+     * @var array
+     */
+    public $_tag_stack = array();
+
+    /**
+     * current template
+     *
+     * @var Smarty_Internal_Template
+     */
+    public $template = null;
+
+    /**
+     * merged templates
+     *
+     * @var array
+     */
+    public $merged_templates = array();
+
+    /**
+     * sources which must be compiled
+     *
+     * @var array
+     */
+    public $sources = array();
+
+    /**
+     * flag that we are inside {block}
+     *
+     * @var bool
+     */
+    public $inheritance = false;
+
+    /**
+     * flag when compiling inheritance child template
+     *
+     * @var bool
+     */
+    public $inheritance_child = false;
+
+    /**
+     * uid of templates called by {extends} for recursion check
+     *
+     * @var array
+     */
+    public $extends_uid = array();
+
+    /**
+     * source line offset for error messages
+     *
+     * @var int
+     */
+    public $trace_line_offset = 0;
+
+    /**
+     * trace uid
+     *
+     * @var string
+     */
+    public $trace_uid = '';
+
+    /**
+     * trace file path
+     *
+     * @var string
+     */
+    public $trace_filepath = '';
+    /**
+     * stack for tracing file and line of nested {block} tags
+     *
+     * @var array
+     */
+    public $trace_stack = array();
+
+    /**
+     * plugins loaded by default plugin handler
+     *
+     * @var array
+     */
+    public $default_handler_plugins = array();
+
+    /**
+     * saved preprocessed modifier list
+     *
+     * @var mixed
+     */
+    public $default_modifier_list = null;
+
+    /**
+     * force compilation of complete template as nocache
+     * @var boolean
+     */
+    public $forceNocache = false;
+
+    /**
+     * suppress Smarty header code in compiled template
+     * @var bool
+     */
+    public $suppressHeader = false;
+
+    /**
+     * suppress template property header code in compiled template
+     * @var bool
+     */
+    public $suppressTemplatePropertyHeader = false;
+
+    /**
+     * suppress pre and post filter
+     * @var bool
+     */
+    public $suppressFilter = false;
+
+    /**
+     * flag if compiled template file shall we written
+     * @var bool
+     */
+    public $write_compiled_code = true;
+
+    /**
+     * flag if currently a template function is compiled
+     * @var bool
+     */
+    public $compiles_template_function = false;
+
+    /**
+     * called subfuntions from template function
+     * @var array
+     */
+    public $called_functions = array();
+
+    /**
+     * flags for used modifier plugins
+     * @var array
+     */
+    public $modifier_plugins = array();
+
+    /**
+     * type of already compiled modifier
+     * @var array
+     */
+    public $known_modifier_type = array();
+
+    /**
+     * Methode to compile a Smarty template
+     *
+     * @param  mixed $_content template source
+     * @return bool  true if compiling succeeded, false if it failed
+     */
+    abstract protected function doCompile($_content);
+
+    /**
+     * Initialize compiler
+     */
+    public function __construct()
+    {
+        $this->nocache_hash = str_replace('.', '-', uniqid(rand(), true));
+    }
+
+    /**
+     * Method to compile a Smarty template
+     *
+     * @param  Smarty_Internal_Template $template template object to compile
+     * @param  bool $nocache    true is shall be compiled in nocache mode
+     * @return bool             true if compiling succeeded, false if it failed
+     */
+    public function compileTemplate(Smarty_Internal_Template $template, $nocache = false)
+    {
+        if (empty($template->properties['nocache_hash'])) {
+            $template->properties['nocache_hash'] = $this->nocache_hash;
+        } else {
+            $this->nocache_hash = $template->properties['nocache_hash'];
+        }
+        // flag for nochache sections
+        $this->nocache = $nocache;
+        $this->tag_nocache = false;
+        // save template object in compiler class
+        $this->template = $template;
+        // reset has nocache code flag
+        $this->template->has_nocache_code = false;
+        $save_source = $this->template->source;
+        // template header code
+        $template_header = '';
+        if (!$this->suppressHeader) {
+            $template_header .= "<?php /* Smarty version " . Smarty::SMARTY_VERSION . ", created on " . strftime("%Y-%m-%d %H:%M:%S") . "\n";
+            $template_header .= "         compiled from \"" . $this->template->source->filepath . "\" */ ?>\n";
+        }
+
+        if (empty($this->template->source->components)) {
+            $this->sources = array($template->source);
+        } else {
+            // we have array of inheritance templates by extends: resource
+            $this->sources = array_reverse($template->source->components);
+        }
+        $loop = 0;
+        // the $this->sources array can get additional elements while compiling by the {extends} tag
+        while ($this->template->source = array_shift($this->sources)) {
+            $this->smarty->_current_file = $this->template->source->filepath;
+            if ($this->smarty->debugging) {
+                Smarty_Internal_Debug::start_compile($this->template);
+            }
+            $no_sources = count($this->sources);
+            if ($loop || $no_sources) {
+                $this->template->properties['file_dependency'][$this->template->source->uid] = array($this->template->source->filepath, $this->template->source->timestamp, $this->template->source->type);
+            }
+            $loop++;
+            if ($no_sources) {
+                $this->inheritance_child = true;
+            } else {
+                $this->inheritance_child = false;
+            }
+            do {
+                $_compiled_code = '';
+                // flag for aborting current and start recompile
+                $this->abort_and_recompile = false;
+                // get template source
+                $_content = $this->template->source->content;
+                if ($_content != '') {
+                    // run prefilter if required
+                    if ((isset($this->smarty->autoload_filters['pre']) || isset($this->smarty->registered_filters['pre'])) && !$this->suppressFilter) {
+                        $_content = Smarty_Internal_Filter_Handler::runFilter('pre', $_content, $template);
+                    }
+                    // call compiler
+                    $_compiled_code = $this->doCompile($_content);
+                }
+            } while ($this->abort_and_recompile);
+            if ($this->smarty->debugging) {
+                Smarty_Internal_Debug::end_compile($this->template);
+            }
+        }
+        // restore source
+        $this->template->source = $save_source;
+        unset($save_source);
+        $this->smarty->_current_file = $this->template->source->filepath;
+        // free memory
+        unset($this->parser->root_buffer, $this->parser->current_buffer, $this->parser, $this->lex, $this->template);
+        self::$_tag_objects = array();
+        // return compiled code to template object
+        $merged_code = '';
+        if (!$this->suppressMergedTemplates && !empty($this->merged_templates)) {
+            foreach ($this->merged_templates as $code) {
+                $merged_code .= $code;
+            }
+        }
+        // run postfilter if required on compiled template code
+        if ((isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) && !$this->suppressFilter && $_compiled_code != '') {
+            $_compiled_code = Smarty_Internal_Filter_Handler::runFilter('post', $_compiled_code, $template);
+        }
+        if ($this->suppressTemplatePropertyHeader) {
+            $code = $_compiled_code . $merged_code;
+        } else {
+            $code = $template_header . $template->createTemplateCodeFrame($_compiled_code) . $merged_code;
+        }
+        // unset content because template inheritance could have replace source with parent code
+        unset ($template->source->content);
+
+        return $code;
+    }
+
+    /**
+     * Compile Tag
+     *
+     * This is a call back from the lexer/parser
+     * It executes the required compile plugin for the Smarty tag
+     *
+     * @param  string $tag       tag name
+     * @param  array $args      array with tag attributes
+     * @param  array $parameter array with compilation parameter
+     * @return string compiled code
+     */
+    public function compileTag($tag, $args, $parameter = array())
+    {
+        // $args contains the attributes parsed and compiled by the lexer/parser
+        // assume that tag does compile into code, but creates no HTML output
+        $this->has_code = true;
+        $this->has_output = false;
+        // log tag/attributes
+        if (isset($this->smarty->get_used_tags) && $this->smarty->get_used_tags) {
+            $this->template->used_tags[] = array($tag, $args);
+        }
+        // check nocache option flag
+        if (in_array("'nocache'", $args) || in_array(array('nocache' => 'true'), $args)
+            || in_array(array('nocache' => '"true"'), $args) || in_array(array('nocache' => "'true'"), $args)
+        ) {
+            $this->tag_nocache = true;
+        }
+        // compile the smarty tag (required compile classes to compile the tag are autoloaded)
+        if (($_output = $this->callTagCompiler($tag, $args, $parameter)) === false) {
+            if (isset($this->smarty->template_functions[$tag])) {
+                // template defined by {template} tag
+                $args['_attr']['name'] = "'" . $tag . "'";
+                $_output = $this->callTagCompiler('call', $args, $parameter);
+            }
+        }
+        if ($_output !== false) {
+            if ($_output !== true) {
+                // did we get compiled code
+                if ($this->has_code) {
+                    // Does it create output?
+                    if ($this->has_output) {
+                        $_output .= "\n";
+                    }
+                    // return compiled code
+                    return $_output;
+                }
+            }
+            // tag did not produce compiled code
+            return null;
+        } else {
+            // map_named attributes
+            if (isset($args['_attr'])) {
+                foreach ($args['_attr'] as $key => $attribute) {
+                    if (is_array($attribute)) {
+                        $args = array_merge($args, $attribute);
+                    }
+                }
+            }
+            // not an internal compiler tag
+            if (strlen($tag) < 6 || substr($tag, -5) != 'close') {
+                // check if tag is a registered object
+                if (isset($this->smarty->registered_objects[$tag]) && isset($parameter['object_methode'])) {
+                    $methode = $parameter['object_methode'];
+                    if (!in_array($methode, $this->smarty->registered_objects[$tag][3]) &&
+                        (empty($this->smarty->registered_objects[$tag][1]) || in_array($methode, $this->smarty->registered_objects[$tag][1]))
+                    ) {
+                        return $this->callTagCompiler('private_object_function', $args, $parameter, $tag, $methode);
+                    } elseif (in_array($methode, $this->smarty->registered_objects[$tag][3])) {
+                        return $this->callTagCompiler('private_object_block_function', $args, $parameter, $tag, $methode);
+                    } else {
+                        return $this->trigger_template_error('unallowed methode "' . $methode . '" in registered object "' . $tag . '"', $this->lex->taglineno);
+                    }
+                }
+                // check if tag is registered
+                foreach (array(Smarty::PLUGIN_COMPILER, Smarty::PLUGIN_FUNCTION, Smarty::PLUGIN_BLOCK) as $plugin_type) {
+                    if (isset($this->smarty->registered_plugins[$plugin_type][$tag])) {
+                        // if compiler function plugin call it now
+                        if ($plugin_type == Smarty::PLUGIN_COMPILER) {
+                            $new_args = array();
+                            foreach ($args as $key => $mixed) {
+                                if (is_array($mixed)) {
+                                    $new_args = array_merge($new_args, $mixed);
+                                } else {
+                                    $new_args[$key] = $mixed;
+                                }
+                            }
+                            if (!$this->smarty->registered_plugins[$plugin_type][$tag][1]) {
+                                $this->tag_nocache = true;
+                            }
+                            $function = $this->smarty->registered_plugins[$plugin_type][$tag][0];
+                            if (!is_array($function)) {
+                                return $function($new_args, $this);
+                            } elseif (is_object($function[0])) {
+                                return $this->smarty->registered_plugins[$plugin_type][$tag][0][0]->$function[1]($new_args, $this);
+                            } else {
+                                return call_user_func_array($function, array($new_args, $this));
+                            }
+                        }
+                        // compile registered function or block function
+                        if ($plugin_type == Smarty::PLUGIN_FUNCTION || $plugin_type == Smarty::PLUGIN_BLOCK) {
+                            return $this->callTagCompiler('private_registered_' . $plugin_type, $args, $parameter, $tag);
+                        }
+                    }
+                }
+                // check plugins from plugins folder
+                foreach ($this->smarty->plugin_search_order as $plugin_type) {
+                    if ($plugin_type == Smarty::PLUGIN_COMPILER && $this->smarty->loadPlugin('smarty_compiler_' . $tag) && (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this))) {
+                        $plugin = 'smarty_compiler_' . $tag;
+                        if (is_callable($plugin)) {
+                            // convert arguments format for old compiler plugins
+                            $new_args = array();
+                            foreach ($args as $key => $mixed) {
+                                if (is_array($mixed)) {
+                                    $new_args = array_merge($new_args, $mixed);
+                                } else {
+                                    $new_args[$key] = $mixed;
+                                }
+                            }
+
+                            return $plugin($new_args, $this->smarty);
+                        }
+                        if (class_exists($plugin, false)) {
+                            $plugin_object = new $plugin;
+                            if (method_exists($plugin_object, 'compile')) {
+                                return $plugin_object->compile($args, $this);
+                            }
+                        }
+                        throw new SmartyException("Plugin \"{$tag}\" not callable");
+                    } else {
+                        if ($function = $this->getPlugin($tag, $plugin_type)) {
+                            if (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this)) {
+                                return $this->callTagCompiler('private_' . $plugin_type . '_plugin', $args, $parameter, $tag, $function);
+                            }
+                        }
+                    }
+                }
+                if (is_callable($this->smarty->default_plugin_handler_func)) {
+                    $found = false;
+                    // look for already resolved tags
+                    foreach ($this->smarty->plugin_search_order as $plugin_type) {
+                        if (isset($this->default_handler_plugins[$plugin_type][$tag])) {
+                            $found = true;
+                            break;
+                        }
+                    }
+                    if (!$found) {
+                        // call default handler
+                        foreach ($this->smarty->plugin_search_order as $plugin_type) {
+                            if ($this->getPluginFromDefaultHandler($tag, $plugin_type)) {
+                                $found = true;
+                                break;
+                            }
+                        }
+                    }
+                    if ($found) {
+                        // if compiler function plugin call it now
+                        if ($plugin_type == Smarty::PLUGIN_COMPILER) {
+                            $new_args = array();
+                            foreach ($args as $mixed) {
+                                $new_args = array_merge($new_args, $mixed);
+                            }
+                            $function = $this->default_handler_plugins[$plugin_type][$tag][0];
+                            if (!is_array($function)) {
+                                return $function($new_args, $this);
+                            } elseif (is_object($function[0])) {
+                                return $this->default_handler_plugins[$plugin_type][$tag][0][0]->$function[1]($new_args, $this);
+                            } else {
+                                return call_user_func_array($function, array($new_args, $this));
+                            }
+                        } else {
+                            return $this->callTagCompiler('private_registered_' . $plugin_type, $args, $parameter, $tag);
+                        }
+                    }
+                }
+            } else {
+                // compile closing tag of block function
+                $base_tag = substr($tag, 0, -5);
+                // check if closing tag is a registered object
+                if (isset($this->smarty->registered_objects[$base_tag]) && isset($parameter['object_methode'])) {
+                    $methode = $parameter['object_methode'];
+                    if (in_array($methode, $this->smarty->registered_objects[$base_tag][3])) {
+                        return $this->callTagCompiler('private_object_block_function', $args, $parameter, $tag, $methode);
+                    } else {
+                        return $this->trigger_template_error('unallowed closing tag methode "' . $methode . '" in registered object "' . $base_tag . '"', $this->lex->taglineno);
+                    }
+                }
+                // registered block tag ?
+                if (isset($this->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$base_tag]) || isset($this->default_handler_plugins[Smarty::PLUGIN_BLOCK][$base_tag])) {
+                    return $this->callTagCompiler('private_registered_block', $args, $parameter, $tag);
+                }
+                // block plugin?
+                if ($function = $this->getPlugin($base_tag, Smarty::PLUGIN_BLOCK)) {
+                    return $this->callTagCompiler('private_block_plugin', $args, $parameter, $tag, $function);
+                }
+                // registered compiler plugin ?
+                if (isset($this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag])) {
+                    // if compiler function plugin call it now
+                    $args = array();
+                    if (!$this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag][1]) {
+                        $this->tag_nocache = true;
+                    }
+                    $function = $this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag][0];
+                    if (!is_array($function)) {
+                        return $function($args, $this);
+                    } elseif (is_object($function[0])) {
+                        return $this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag][0][0]->$function[1]($args, $this);
+                    } else {
+                        return call_user_func_array($function, array($args, $this));
+                    }
+                }
+                if ($this->smarty->loadPlugin('smarty_compiler_' . $tag)) {
+                    $plugin = 'smarty_compiler_' . $tag;
+                    if (is_callable($plugin)) {
+                        return $plugin($args, $this->smarty);
+                    }
+                    if (class_exists($plugin, false)) {
+                        $plugin_object = new $plugin;
+                        if (method_exists($plugin_object, 'compile')) {
+                            return $plugin_object->compile($args, $this);
+                        }
+                    }
+                    throw new SmartyException("Plugin \"{$tag}\" not callable");
+                }
+            }
+            $this->trigger_template_error("unknown tag \"" . $tag . "\"", $this->lex->taglineno);
+        }
+    }
+
+    /**
+     * lazy loads internal compile plugin for tag and calls the compile methode
+     *
+     * compile objects cached for reuse.
+     * class name format:  Smarty_Internal_Compile_TagName
+     * plugin filename format: Smarty_Internal_Tagname.php
+     *
+     * @param  string $tag    tag name
+     * @param  array $args   list of tag attributes
+     * @param  mixed $param1 optional parameter
+     * @param  mixed $param2 optional parameter
+     * @param  mixed $param3 optional parameter
+     * @return string compiled code
+     */
+    public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null)
+    {
+        // re-use object if already exists
+        if (isset(self::$_tag_objects[$tag])) {
+            // compile this tag
+            return self::$_tag_objects[$tag]->compile($args, $this, $param1, $param2, $param3);
+        }
+        // lazy load internal compiler plugin
+        $class_name = 'Smarty_Internal_Compile_' . $tag;
+        if ($this->smarty->loadPlugin($class_name)) {
+            // check if tag allowed by security
+            if (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this)) {
+                // use plugin if found
+                self::$_tag_objects[$tag] = new $class_name;
+                // compile this tag
+                return self::$_tag_objects[$tag]->compile($args, $this, $param1, $param2, $param3);
+            }
+        }
+        // no internal compile plugin for this tag
+        return false;
+    }
+
+    /**
+     * Check for plugins and return function name
+     *
+     * @param  string $pugin_name  name of plugin or function
+     * @param  string $plugin_type type of plugin
+     * @return string call name of function
+     */
+    public function getPlugin($plugin_name, $plugin_type)
+    {
+        $function = null;
+        if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {
+            if (isset($this->template->required_plugins['nocache'][$plugin_name][$plugin_type])) {
+                $function = $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['function'];
+            } elseif (isset($this->template->required_plugins['compiled'][$plugin_name][$plugin_type])) {
+                $this->template->required_plugins['nocache'][$plugin_name][$plugin_type] = $this->template->required_plugins['compiled'][$plugin_name][$plugin_type];
+                $function = $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['function'];
+            }
+        } else {
+            if (isset($this->template->required_plugins['compiled'][$plugin_name][$plugin_type])) {
+                $function = $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['function'];
+            } elseif (isset($this->template->required_plugins['nocache'][$plugin_name][$plugin_type])) {
+                $this->template->required_plugins['compiled'][$plugin_name][$plugin_type] = $this->template->required_plugins['nocache'][$plugin_name][$plugin_type];
+                $function = $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['function'];
+            }
+        }
+        if (isset($function)) {
+            if ($plugin_type == 'modifier') {
+                $this->modifier_plugins[$plugin_name] = true;
+            }
+
+            return $function;
+        }
+        // loop through plugin dirs and find the plugin
+        $function = 'smarty_' . $plugin_type . '_' . $plugin_name;
+        $file = $this->smarty->loadPlugin($function, false);
+
+        if (is_string($file)) {
+            if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {
+                $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['file'] = $file;
+                $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['function'] = $function;
+            } else {
+                $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['file'] = $file;
+                $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['function'] = $function;
+            }
+            if ($plugin_type == 'modifier') {
+                $this->modifier_plugins[$plugin_name] = true;
+            }
+
+            return $function;
+        }
+        if (is_callable($function)) {
+            // plugin function is defined in the script
+            return $function;
+        }
+
+        return false;
+    }
+
+    /**
+     * Check for plugins by default plugin handler
+     *
+     * @param  string $tag         name of tag
+     * @param  string $plugin_type type of plugin
+     * @return boolean true if found
+     */
+    public function getPluginFromDefaultHandler($tag, $plugin_type)
+    {
+        $callback = null;
+        $script = null;
+        $cacheable = true;
+        $result = call_user_func_array(
+            $this->smarty->default_plugin_handler_func, array($tag, $plugin_type, $this->template, &$callback, &$script, &$cacheable)
+        );
+        if ($result) {
+            $this->tag_nocache = $this->tag_nocache || !$cacheable;
+            if ($script !== null) {
+                if (is_file($script)) {
+                    if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {
+                        $this->template->required_plugins['nocache'][$tag][$plugin_type]['file'] = $script;
+                        $this->template->required_plugins['nocache'][$tag][$plugin_type]['function'] = $callback;
+                    } else {
+                        $this->template->required_plugins['compiled'][$tag][$plugin_type]['file'] = $script;
+                        $this->template->required_plugins['compiled'][$tag][$plugin_type]['function'] = $callback;
+                    }
+                    include_once $script;
+                } else {
+                    $this->trigger_template_error("Default plugin handler: Returned script file \"{$script}\" for \"{$tag}\" not found");
+                }
+            }
+            if (!is_string($callback) && !(is_array($callback) && is_string($callback[0]) && is_string($callback[1]))) {
+                $this->trigger_template_error("Default plugin handler: Returned callback for \"{$tag}\" must be a static function name or array of class and function name");
+            }
+            if (is_callable($callback)) {
+                $this->default_handler_plugins[$plugin_type][$tag] = array($callback, true, array());
+
+                return true;
+            } else {
+                $this->trigger_template_error("Default plugin handler: Returned callback for \"{$tag}\" not callable");
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Inject inline code for nocache template sections
+     *
+     * This method gets the content of each template element from the parser.
+     * If the content is compiled code and it should be not cached the code is injected
+     * into the rendered output.
+     *
+     * @param  string $content content of template element
+     * @param  boolean $is_code true if content is compiled code
+     * @return string  content
+     */
+    public function processNocacheCode($content, $is_code)
+    {
+        // If the template is not evaluated and we have a nocache section and or a nocache tag
+        if ($is_code && !empty($content)) {
+            // generate replacement code
+            if ((!($this->template->source->recompiled) || $this->forceNocache) && $this->template->caching && !$this->suppressNocacheProcessing &&
+                ($this->nocache || $this->tag_nocache)
+            ) {
+                $this->template->has_nocache_code = true;
+                $_output = addcslashes($content, '\'\\');
+                $_output = str_replace("^#^", "'", $_output);
+                $_output = "<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\n";
+                // make sure we include modifier plugins for nocache code
+                foreach ($this->modifier_plugins as $plugin_name => $dummy) {
+                    if (isset($this->template->required_plugins['compiled'][$plugin_name]['modifier'])) {
+                        $this->template->required_plugins['nocache'][$plugin_name]['modifier'] = $this->template->required_plugins['compiled'][$plugin_name]['modifier'];
+                    }
+                }
+            } else {
+                $_output = $content;
+            }
+        } else {
+            $_output = $content;
+        }
+        $this->modifier_plugins = array();
+        $this->suppressNocacheProcessing = false;
+        $this->tag_nocache = false;
+
+        return $_output;
+    }
+
+    /**
+     *  push current file and line offset on stack for tracing {block} source lines
+     *
+     * @param string $file new filename
+     * @param string $uid uid of file
+     * @param string $debug false debug end_compile shall not be called
+     * @param int $line line offset to source
+     */
+    public function pushTrace($file, $uid, $line, $debug = true)
+    {
+        if ($this->smarty->debugging && $debug) {
+            Smarty_Internal_Debug::end_compile($this->template);
+        }
+        array_push($this->trace_stack, array($this->smarty->_current_file, $this->trace_filepath, $this->trace_uid, $this->trace_line_offset));
+        $this->trace_filepath = $this->smarty->_current_file = $file;
+        $this->trace_uid = $uid;
+        $this->trace_line_offset = $line ;
+        if ($this->smarty->debugging) {
+            Smarty_Internal_Debug::start_compile($this->template);
+        }
+    }
+
+    /**
+     *  restore file and line offset
+     *
+     */
+    public function popTrace()
+    {
+        if ($this->smarty->debugging) {
+            Smarty_Internal_Debug::end_compile($this->template);
+        }
+        $r = array_pop($this->trace_stack);
+        $this->smarty->_current_file = $r[0];
+        $this->trace_filepath = $r[1];
+        $this->trace_uid = $r[2];
+        $this->trace_line_offset = $r[3];
+        if ($this->smarty->debugging) {
+            Smarty_Internal_Debug::start_compile($this->template);
+        }
+    }
+
+    /**
+     * display compiler error messages without dying
+     *
+     * If parameter $args is empty it is a parser detected syntax error.
+     * In this case the parser is called to obtain information about expected tokens.
+     *
+     * If parameter $args contains a string this is used as error message
+     *
+     * @param  string $args individual error message or null
+     * @param  string $line line-number
+     * @throws SmartyCompilerException when an unexpected token is found
+     */
+    public function trigger_template_error($args = null, $line = null)
+    {
+        // get template source line which has error
+        if (!isset($line)) {
+            $line = $this->lex->line;
+        }
+//        $line += $this->trace_line_offset;
+        $match = preg_split("/\n/", $this->lex->data);
+        $error_text = 'Syntax error in template "' . (empty($this->trace_filepath) ? $this->template->source->filepath : $this->trace_filepath) . '"  on line ' . ($line + $this->trace_line_offset)  . ' "' . trim(preg_replace('![\t\r\n]+!', ' ', $match[$line - 1])) . '" ';
+        if (isset($args)) {
+            // individual error message
+            $error_text .= $args;
+        } else {
+            // expected token from parser
+            $error_text .= ' - Unexpected "' . $this->lex->value . '"';
+            if (count($this->parser->yy_get_expected_tokens($this->parser->yymajor)) <= 4) {
+                foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) {
+                    $exp_token = $this->parser->yyTokenName[$token];
+                    if (isset($this->lex->smarty_token_names[$exp_token])) {
+                        // token type from lexer
+                        $expect[] = '"' . $this->lex->smarty_token_names[$exp_token] . '"';
+                    } else {
+                        // otherwise internal token name
+                        $expect[] = $this->parser->yyTokenName[$token];
+                    }
+                }
+                $error_text .= ', expected one of: ' . implode(' , ', $expect);
+            }
+        }
+        $e = new SmartyCompilerException($error_text);
+        $e->line = $line;
+        $e->source = trim(preg_replace('![\t\r\n]+!', ' ', $match[$line - 1]));
+        $e->desc = $args;
+        $e->template = $this->template->source->filepath;
+        throw $e;
+    }
+
+}

+ 822 - 822
resources/templates/engine/smarty/sysplugins/smarty_internal_utility.php

@@ -1,822 +1,822 @@
-<?php
-/**
- * Project:     Smarty: the PHP compiling template engine
- * File:        smarty_internal_utility.php
- * SVN:         $Id: $
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * For questions, help, comments, discussion, etc., please join the
- * Smarty mailing list. Send a blank e-mail to
- * [email protected]
- *
- * @link http://www.smarty.net/
- * @copyright 2008 New Digital Group, Inc.
- * @author Monte Ohrt <monte at ohrt dot com>
- * @author Uwe Tews
- * @package Smarty
- * @subpackage PluginsInternal
- * @version 3-SVN$Rev: 3286 $
- */
-
-/**
- * Utility class
- *
- * @package Smarty
- * @subpackage Security
- */
-class Smarty_Internal_Utility
-{
-    /**
-     * private constructor to prevent calls creation of new instances
-     */
-    final private function __construct()
-    {
-        // intentionally left blank
-    }
-
-    /**
-     * Compile all template files
-     *
-     * @param  string  $extension     template file name extension
-     * @param  bool    $force_compile force all to recompile
-     * @param  int     $time_limit    set maximum execution time
-     * @param  int     $max_errors    set maximum allowed errors
-     * @param  Smarty  $smarty        Smarty instance
-     * @return integer number of template files compiled
-     */
-    public static function compileAllTemplates($extension, $force_compile, $time_limit, $max_errors, Smarty $smarty)
-    {
-        // switch off time limit
-        if (function_exists('set_time_limit')) {
-            @set_time_limit($time_limit);
-        }
-        $smarty->force_compile = $force_compile;
-        $_count = 0;
-        $_error_count = 0;
-        // loop over array of template directories
-        foreach ($smarty->getTemplateDir() as $_dir) {
-            $_compileDirs = new RecursiveDirectoryIterator($_dir);
-            $_compile = new RecursiveIteratorIterator($_compileDirs);
-            foreach ($_compile as $_fileinfo) {
-                $_file = $_fileinfo->getFilename();
-                if (substr(basename($_fileinfo->getPathname()),0,1) == '.' || strpos($_file, '.svn') !== false || strpos($_file, '.git') !== false) continue;
-                if (!substr_compare($_file, $extension, - strlen($extension)) == 0) continue;
-                if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
-                   $_template_file = $_file;
-                } else {
-                   $_template_file = substr($_fileinfo->getPath(), strlen($_dir)) . DS . $_file;
-                }
-                echo '<br>', $_dir, '---', $_template_file;
-                flush();
-                $_start_time = microtime(true);
-                try {
-                    $_tpl = $smarty->createTemplate($_template_file,null,null,null,false);
-                    if ($_tpl->mustCompile()) {
-                        $_tpl->compileTemplateSource();
-                        $_count++;
-                        echo ' compiled in  ', microtime(true) - $_start_time, ' seconds';
-                        flush();
-                    } else {
-                        echo ' is up to date';
-                        flush();
-                    }
-                } catch (Exception $e) {
-                    echo 'Error: ', $e->getMessage(), "<br><br>";
-                    $_error_count++;
-                }
-                // free memory
-                $smarty->template_objects = array();
-                $_tpl->smarty->template_objects = array();
-                $_tpl = null;
-                if ($max_errors !== null && $_error_count == $max_errors) {
-                    echo '<br><br>too many errors';
-                    exit();
-                }
-            }
-        }
-
-        return $_count;
-    }
-
-    /**
-     * Compile all config files
-     *
-     * @param  string  $extension     config file name extension
-     * @param  bool    $force_compile force all to recompile
-     * @param  int     $time_limit    set maximum execution time
-     * @param  int     $max_errors    set maximum allowed errors
-     * @param  Smarty  $smarty        Smarty instance
-     * @return integer number of config files compiled
-     */
-    public static function compileAllConfig($extension, $force_compile, $time_limit, $max_errors, Smarty $smarty)
-    {
-        // switch off time limit
-        if (function_exists('set_time_limit')) {
-            @set_time_limit($time_limit);
-        }
-        $smarty->force_compile = $force_compile;
-        $_count = 0;
-        $_error_count = 0;
-        // loop over array of template directories
-        foreach ($smarty->getConfigDir() as $_dir) {
-            $_compileDirs = new RecursiveDirectoryIterator($_dir);
-            $_compile = new RecursiveIteratorIterator($_compileDirs);
-            foreach ($_compile as $_fileinfo) {
-                $_file = $_fileinfo->getFilename();
-                if (substr(basename($_fileinfo->getPathname()),0,1) == '.' || strpos($_file, '.svn') !== false || strpos($_file, '.git') !== false) continue;
-                if (!substr_compare($_file, $extension, - strlen($extension)) == 0) continue;
-                if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
-                    $_config_file = $_file;
-                } else {
-                    $_config_file = substr($_fileinfo->getPath(), strlen($_dir)) . DS . $_file;
-                }
-                echo '<br>', $_dir, '---', $_config_file;
-                flush();
-                $_start_time = microtime(true);
-                try {
-                    $_config = new Smarty_Internal_Config($_config_file, $smarty);
-                    if ($_config->mustCompile()) {
-                        $_config->compileConfigSource();
-                        $_count++;
-                        echo ' compiled in  ', microtime(true) - $_start_time, ' seconds';
-                        flush();
-                    } else {
-                        echo ' is up to date';
-                        flush();
-                    }
-                } catch (Exception $e) {
-                    echo 'Error: ', $e->getMessage(), "<br><br>";
-                    $_error_count++;
-                }
-                if ($max_errors !== null && $_error_count == $max_errors) {
-                    echo '<br><br>too many errors';
-                    exit();
-                }
-            }
-        }
-
-        return $_count;
-    }
-
-    /**
-     * Delete compiled template file
-     *
-     * @param  string  $resource_name template name
-     * @param  string  $compile_id    compile id
-     * @param  integer $exp_time      expiration time
-     * @param  Smarty  $smarty        Smarty instance
-     * @return integer number of template files deleted
-     */
-    public static function clearCompiledTemplate($resource_name, $compile_id, $exp_time, Smarty $smarty)
-    {
-        $_compile_dir = $smarty->getCompileDir();
-        $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null;
-        $_dir_sep = $smarty->use_sub_dirs ? DS : '^';
-        if (isset($resource_name)) {
-            $_save_stat = $smarty->caching;
-            $smarty->caching = false;
-            $tpl = new $smarty->template_class($resource_name, $smarty);
-            $smarty->caching = $_save_stat;
-
-            // remove from template cache
-            $tpl->source; // have the template registered before unset()
-            if ($smarty->allow_ambiguous_resources) {
-                $_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id;
-            } else {
-                $_templateId = $smarty->joined_template_dir . '#' . $resource_name . $tpl->cache_id . $tpl->compile_id;
-            }
-            if (isset($_templateId[150])) {
-                $_templateId = sha1($_templateId);
-            }
-            unset($smarty->template_objects[$_templateId]);
-
-            if ($tpl->source->exists) {
-                 $_resource_part_1 = basename(str_replace('^', '/', $tpl->compiled->filepath));
-                 $_resource_part_1_length = strlen($_resource_part_1);
-            } else {
-                return 0;
-            }
-
-            $_resource_part_2 = str_replace('.php','.cache.php',$_resource_part_1);
-            $_resource_part_2_length = strlen($_resource_part_2);
-        }
-        $_dir = $_compile_dir;
-        if ($smarty->use_sub_dirs && isset($_compile_id)) {
-            $_dir .= $_compile_id . $_dir_sep;
-        }
-        if (isset($_compile_id)) {
-            $_compile_id_part = $_compile_dir . $_compile_id . $_dir_sep;
-            $_compile_id_part_length = strlen($_compile_id_part);
-        }
-        $_count = 0;
-        try {
-            $_compileDirs = new RecursiveDirectoryIterator($_dir);
-        // NOTE: UnexpectedValueException thrown for PHP >= 5.3
-        } catch (Exception $e) {
-            return 0;
-        }
-        $_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST);
-        foreach ($_compile as $_file) {
-            if (substr(basename($_file->getPathname()), 0, 1) == '.' || strpos($_file, '.svn') !== false || strpos($_file, '.git') !== false) continue;
-
-            $_filepath = (string) $_file;
-
-            if ($_file->isDir()) {
-                if (!$_compile->isDot()) {
-                    // delete folder if empty
-                    @rmdir($_file->getPathname());
-                }
-            } else {
-                $unlink = false;
-                if ((!isset($_compile_id) || (isset($_filepath[$_compile_id_part_length]) && !strncmp($_filepath, $_compile_id_part, $_compile_id_part_length)))
-                    && (!isset($resource_name)
-                        || (isset($_filepath[$_resource_part_1_length])
-                            && substr_compare($_filepath, $_resource_part_1, -$_resource_part_1_length, $_resource_part_1_length) == 0)
-                        || (isset($_filepath[$_resource_part_2_length])
-                            && substr_compare($_filepath, $_resource_part_2, -$_resource_part_2_length, $_resource_part_2_length) == 0))) {
-                    if (isset($exp_time)) {
-                        if (time() - @filemtime($_filepath) >= $exp_time) {
-                            $unlink = true;
-                        }
-                    } else {
-                        $unlink = true;
-                    }
-                }
-
-                if ($unlink && @unlink($_filepath)) {
-                    $_count++;
-                }
-            }
-        }
-        // clear compiled cache
-        Smarty_Resource::$sources = array();
-        Smarty_Resource::$compileds = array();
-
-        return $_count;
-    }
-
-    /**
-     * Return array of tag/attributes of all tags used by an template
-     *
-     * @param  Smarty_Internal_Template $templae template object
-     * @return array                    of tag/attributes
-     */
-    public static function getTags(Smarty_Internal_Template $template)
-    {
-        $template->smarty->get_used_tags = true;
-        $template->compileTemplateSource();
-
-        return $template->used_tags;
-    }
-
-    /**
-     * diagnose Smarty setup
-     *
-     * If $errors is secified, the diagnostic report will be appended to the array, rather than being output.
-     *
-     * @param  Smarty $smarty Smarty instance to test
-     * @param  array  $errors array to push results into rather than outputting them
-     * @return bool   status, true if everything is fine, false else
-     */
-    public static function testInstall(Smarty $smarty, &$errors=null)
-    {
-        $status = true;
-
-        if ($errors === null) {
-            echo "<PRE>\n";
-            echo "Smarty Installation test...\n";
-            echo "Testing template directory...\n";
-        }
-
-        $_stream_resolve_include_path = function_exists('stream_resolve_include_path');
-
-        // test if all registered template_dir are accessible
-        foreach ($smarty->getTemplateDir() as $template_dir) {
-            $_template_dir = $template_dir;
-            $template_dir = realpath($template_dir);
-            // resolve include_path or fail existence
-            if (!$template_dir) {
-                if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_template_dir)) {
-                    // try PHP include_path
-                    if ($_stream_resolve_include_path) {
-                        $template_dir = stream_resolve_include_path($_template_dir);
-                    } else {
-                        $template_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_template_dir);
-                    }
-
-                    if ($template_dir !== false) {
-                        if ($errors === null) {
-                            echo "$template_dir is OK.\n";
-                        }
-
-                        continue;
-                    } else {
-                        $status = false;
-                        $message = "FAILED: $_template_dir does not exist (and couldn't be found in include_path either)";
-                        if ($errors === null) {
-                            echo $message . ".\n";
-                        } else {
-                            $errors['template_dir'] = $message;
-                        }
-
-                        continue;
-                    }
-                } else {
-                    $status = false;
-                    $message = "FAILED: $_template_dir does not exist";
-                    if ($errors === null) {
-                        echo $message . ".\n";
-                    } else {
-                        $errors['template_dir'] = $message;
-                    }
-
-                    continue;
-                }
-            }
-
-            if (!is_dir($template_dir)) {
-                $status = false;
-                $message = "FAILED: $template_dir is not a directory";
-                if ($errors === null) {
-                    echo $message . ".\n";
-                } else {
-                    $errors['template_dir'] = $message;
-                }
-            } elseif (!is_readable($template_dir)) {
-                $status = false;
-                $message = "FAILED: $template_dir is not readable";
-                if ($errors === null) {
-                    echo $message . ".\n";
-                } else {
-                    $errors['template_dir'] = $message;
-                }
-            } else {
-                if ($errors === null) {
-                    echo "$template_dir is OK.\n";
-                }
-            }
-        }
-
-        if ($errors === null) {
-            echo "Testing compile directory...\n";
-        }
-
-        // test if registered compile_dir is accessible
-        $__compile_dir = $smarty->getCompileDir();
-        $_compile_dir = realpath($__compile_dir);
-        if (!$_compile_dir) {
-            $status = false;
-            $message = "FAILED: {$__compile_dir} does not exist";
-            if ($errors === null) {
-                echo $message . ".\n";
-            } else {
-                $errors['compile_dir'] = $message;
-            }
-        } elseif (!is_dir($_compile_dir)) {
-            $status = false;
-            $message = "FAILED: {$_compile_dir} is not a directory";
-            if ($errors === null) {
-                echo $message . ".\n";
-            } else {
-                $errors['compile_dir'] = $message;
-            }
-        } elseif (!is_readable($_compile_dir)) {
-            $status = false;
-            $message = "FAILED: {$_compile_dir} is not readable";
-            if ($errors === null) {
-                echo $message . ".\n";
-            } else {
-                $errors['compile_dir'] = $message;
-            }
-        } elseif (!is_writable($_compile_dir)) {
-            $status = false;
-            $message = "FAILED: {$_compile_dir} is not writable";
-            if ($errors === null) {
-                echo $message . ".\n";
-            } else {
-                $errors['compile_dir'] = $message;
-            }
-        } else {
-            if ($errors === null) {
-                echo "{$_compile_dir} is OK.\n";
-            }
-        }
-
-        if ($errors === null) {
-            echo "Testing plugins directory...\n";
-        }
-
-        // test if all registered plugins_dir are accessible
-        // and if core plugins directory is still registered
-        $_core_plugins_dir = realpath(dirname(__FILE__) .'/../plugins');
-        $_core_plugins_available = false;
-        foreach ($smarty->getPluginsDir() as $plugin_dir) {
-            $_plugin_dir = $plugin_dir;
-            $plugin_dir = realpath($plugin_dir);
-            // resolve include_path or fail existence
-            if (!$plugin_dir) {
-                if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) {
-                    // try PHP include_path
-                    if ($_stream_resolve_include_path) {
-                        $plugin_dir = stream_resolve_include_path($_plugin_dir);
-                    } else {
-                        $plugin_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_plugin_dir);
-                    }
-
-                    if ($plugin_dir !== false) {
-                        if ($errors === null) {
-                            echo "$plugin_dir is OK.\n";
-                        }
-
-                        continue;
-                    } else {
-                        $status = false;
-                        $message = "FAILED: $_plugin_dir does not exist (and couldn't be found in include_path either)";
-                        if ($errors === null) {
-                            echo $message . ".\n";
-                        } else {
-                            $errors['plugins_dir'] = $message;
-                        }
-
-                        continue;
-                    }
-                } else {
-                    $status = false;
-                    $message = "FAILED: $_plugin_dir does not exist";
-                    if ($errors === null) {
-                        echo $message . ".\n";
-                    } else {
-                        $errors['plugins_dir'] = $message;
-                    }
-
-                    continue;
-                }
-            }
-
-            if (!is_dir($plugin_dir)) {
-                $status = false;
-                $message = "FAILED: $plugin_dir is not a directory";
-                if ($errors === null) {
-                    echo $message . ".\n";
-                } else {
-                    $errors['plugins_dir'] = $message;
-                }
-            } elseif (!is_readable($plugin_dir)) {
-                $status = false;
-                $message = "FAILED: $plugin_dir is not readable";
-                if ($errors === null) {
-                    echo $message . ".\n";
-                } else {
-                    $errors['plugins_dir'] = $message;
-                }
-            } elseif ($_core_plugins_dir && $_core_plugins_dir == realpath($plugin_dir)) {
-                $_core_plugins_available = true;
-                if ($errors === null) {
-                    echo "$plugin_dir is OK.\n";
-                }
-            } else {
-                if ($errors === null) {
-                    echo "$plugin_dir is OK.\n";
-                }
-            }
-        }
-        if (!$_core_plugins_available) {
-            $status = false;
-            $message = "WARNING: Smarty's own libs/plugins is not available";
-            if ($errors === null) {
-                echo $message . ".\n";
-            } elseif (!isset($errors['plugins_dir'])) {
-                $errors['plugins_dir'] = $message;
-            }
-        }
-
-        if ($errors === null) {
-            echo "Testing cache directory...\n";
-        }
-
-        // test if all registered cache_dir is accessible
-        $__cache_dir = $smarty->getCacheDir();
-        $_cache_dir = realpath($__cache_dir);
-        if (!$_cache_dir) {
-            $status = false;
-            $message = "FAILED: {$__cache_dir} does not exist";
-            if ($errors === null) {
-                echo $message . ".\n";
-            } else {
-                $errors['cache_dir'] = $message;
-            }
-        } elseif (!is_dir($_cache_dir)) {
-            $status = false;
-            $message = "FAILED: {$_cache_dir} is not a directory";
-            if ($errors === null) {
-                echo $message . ".\n";
-            } else {
-                $errors['cache_dir'] = $message;
-            }
-        } elseif (!is_readable($_cache_dir)) {
-            $status = false;
-            $message = "FAILED: {$_cache_dir} is not readable";
-            if ($errors === null) {
-                echo $message . ".\n";
-            } else {
-                $errors['cache_dir'] = $message;
-            }
-        } elseif (!is_writable($_cache_dir)) {
-            $status = false;
-            $message = "FAILED: {$_cache_dir} is not writable";
-            if ($errors === null) {
-                echo $message . ".\n";
-            } else {
-                $errors['cache_dir'] = $message;
-            }
-        } else {
-            if ($errors === null) {
-                echo "{$_cache_dir} is OK.\n";
-            }
-        }
-
-        if ($errors === null) {
-            echo "Testing configs directory...\n";
-        }
-
-        // test if all registered config_dir are accessible
-        foreach ($smarty->getConfigDir() as $config_dir) {
-            $_config_dir = $config_dir;
-            $config_dir = realpath($config_dir);
-            // resolve include_path or fail existence
-            if (!$config_dir) {
-                if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_config_dir)) {
-                    // try PHP include_path
-                    if ($_stream_resolve_include_path) {
-                        $config_dir = stream_resolve_include_path($_config_dir);
-                    } else {
-                        $config_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_config_dir);
-                    }
-
-                    if ($config_dir !== false) {
-                        if ($errors === null) {
-                            echo "$config_dir is OK.\n";
-                        }
-
-                        continue;
-                    } else {
-                        $status = false;
-                        $message = "FAILED: $_config_dir does not exist (and couldn't be found in include_path either)";
-                        if ($errors === null) {
-                            echo $message . ".\n";
-                        } else {
-                            $errors['config_dir'] = $message;
-                        }
-
-                        continue;
-                    }
-                } else {
-                    $status = false;
-                    $message = "FAILED: $_config_dir does not exist";
-                    if ($errors === null) {
-                        echo $message . ".\n";
-                    } else {
-                        $errors['config_dir'] = $message;
-                    }
-
-                    continue;
-                }
-            }
-
-            if (!is_dir($config_dir)) {
-                $status = false;
-                $message = "FAILED: $config_dir is not a directory";
-                if ($errors === null) {
-                    echo $message . ".\n";
-                } else {
-                    $errors['config_dir'] = $message;
-                }
-            } elseif (!is_readable($config_dir)) {
-                $status = false;
-                $message = "FAILED: $config_dir is not readable";
-                if ($errors === null) {
-                    echo $message . ".\n";
-                } else {
-                    $errors['config_dir'] = $message;
-                }
-            } else {
-                if ($errors === null) {
-                    echo "$config_dir is OK.\n";
-                }
-            }
-        }
-
-        if ($errors === null) {
-            echo "Testing sysplugin files...\n";
-        }
-        // test if sysplugins are available
-        $source = SMARTY_SYSPLUGINS_DIR;
-        if (is_dir($source)) {
-            $expected = array(
-                "smarty_cacheresource.php" => true,
-                "smarty_cacheresource_custom.php" => true,
-                "smarty_cacheresource_keyvaluestore.php" => true,
-                "smarty_config_source.php" => true,
-                "smarty_internal_cacheresource_file.php" => true,
-                "smarty_internal_compile_append.php" => true,
-                "smarty_internal_compile_assign.php" => true,
-                "smarty_internal_compile_block.php" => true,
-                "smarty_internal_compile_break.php" => true,
-                "smarty_internal_compile_call.php" => true,
-                "smarty_internal_compile_capture.php" => true,
-                "smarty_internal_compile_config_load.php" => true,
-                "smarty_internal_compile_continue.php" => true,
-                "smarty_internal_compile_debug.php" => true,
-                "smarty_internal_compile_eval.php" => true,
-                "smarty_internal_compile_extends.php" => true,
-                "smarty_internal_compile_for.php" => true,
-                "smarty_internal_compile_foreach.php" => true,
-                "smarty_internal_compile_function.php" => true,
-                "smarty_internal_compile_if.php" => true,
-                "smarty_internal_compile_include.php" => true,
-                "smarty_internal_compile_include_php.php" => true,
-                "smarty_internal_compile_insert.php" => true,
-                "smarty_internal_compile_ldelim.php" => true,
-                "smarty_internal_compile_nocache.php" => true,
-                "smarty_internal_compile_private_block_plugin.php" => true,
-                "smarty_internal_compile_private_function_plugin.php" => true,
-                "smarty_internal_compile_private_modifier.php" => true,
-                "smarty_internal_compile_private_object_block_function.php" => true,
-                "smarty_internal_compile_private_object_function.php" => true,
-                "smarty_internal_compile_private_print_expression.php" => true,
-                "smarty_internal_compile_private_registered_block.php" => true,
-                "smarty_internal_compile_private_registered_function.php" => true,
-                "smarty_internal_compile_private_special_variable.php" => true,
-                "smarty_internal_compile_rdelim.php" => true,
-                "smarty_internal_compile_section.php" => true,
-                "smarty_internal_compile_setfilter.php" => true,
-                "smarty_internal_compile_while.php" => true,
-                "smarty_internal_compilebase.php" => true,
-                "smarty_internal_config.php" => true,
-                "smarty_internal_config_file_compiler.php" => true,
-                "smarty_internal_configfilelexer.php" => true,
-                "smarty_internal_configfileparser.php" => true,
-                "smarty_internal_data.php" => true,
-                "smarty_internal_debug.php" => true,
-                "smarty_internal_filter_handler.php" => true,
-                "smarty_internal_function_call_handler.php" => true,
-                "smarty_internal_get_include_path.php" => true,
-                "smarty_internal_nocache_insert.php" => true,
-                "smarty_internal_parsetree.php" => true,
-                "smarty_internal_resource_eval.php" => true,
-                "smarty_internal_resource_extends.php" => true,
-                "smarty_internal_resource_file.php" => true,
-                "smarty_internal_resource_registered.php" => true,
-                "smarty_internal_resource_stream.php" => true,
-                "smarty_internal_resource_string.php" => true,
-                "smarty_internal_smartytemplatecompiler.php" => true,
-                "smarty_internal_template.php" => true,
-                "smarty_internal_templatebase.php" => true,
-                "smarty_internal_templatecompilerbase.php" => true,
-                "smarty_internal_templatelexer.php" => true,
-                "smarty_internal_templateparser.php" => true,
-                "smarty_internal_utility.php" => true,
-                "smarty_internal_write_file.php" => true,
-                "smarty_resource.php" => true,
-                "smarty_resource_custom.php" => true,
-                "smarty_resource_recompiled.php" => true,
-                "smarty_resource_uncompiled.php" => true,
-                "smarty_security.php" => true,
-            );
-            $iterator = new DirectoryIterator($source);
-            foreach ($iterator as $file) {
-                if (!$file->isDot()) {
-                    $filename = $file->getFilename();
-                    if (isset($expected[$filename])) {
-                        unset($expected[$filename]);
-                    }
-                }
-            }
-            if ($expected) {
-                $status = false;
-                $message = "FAILED: files missing from libs/sysplugins: ". join(', ', array_keys($expected));
-                if ($errors === null) {
-                    echo $message . ".\n";
-                } else {
-                    $errors['sysplugins'] = $message;
-                }
-            } elseif ($errors === null) {
-                echo "... OK\n";
-            }
-        } else {
-            $status = false;
-            $message = "FAILED: ". SMARTY_SYSPLUGINS_DIR .' is not a directory';
-            if ($errors === null) {
-                echo $message . ".\n";
-            } else {
-                $errors['sysplugins_dir_constant'] = $message;
-            }
-        }
-
-        if ($errors === null) {
-            echo "Testing plugin files...\n";
-        }
-        // test if core plugins are available
-        $source = SMARTY_PLUGINS_DIR;
-        if (is_dir($source)) {
-            $expected = array(
-                "block.textformat.php" => true,
-                "function.counter.php" => true,
-                "function.cycle.php" => true,
-                "function.fetch.php" => true,
-                "function.html_checkboxes.php" => true,
-                "function.html_image.php" => true,
-                "function.html_options.php" => true,
-                "function.html_radios.php" => true,
-                "function.html_select_date.php" => true,
-                "function.html_select_time.php" => true,
-                "function.html_table.php" => true,
-                "function.mailto.php" => true,
-                "function.math.php" => true,
-                "modifier.capitalize.php" => true,
-                "modifier.date_format.php" => true,
-                "modifier.debug_print_var.php" => true,
-                "modifier.escape.php" => true,
-                "modifier.regex_replace.php" => true,
-                "modifier.replace.php" => true,
-                "modifier.spacify.php" => true,
-                "modifier.truncate.php" => true,
-                "modifiercompiler.cat.php" => true,
-                "modifiercompiler.count_characters.php" => true,
-                "modifiercompiler.count_paragraphs.php" => true,
-                "modifiercompiler.count_sentences.php" => true,
-                "modifiercompiler.count_words.php" => true,
-                "modifiercompiler.default.php" => true,
-                "modifiercompiler.escape.php" => true,
-                "modifiercompiler.from_charset.php" => true,
-                "modifiercompiler.indent.php" => true,
-                "modifiercompiler.lower.php" => true,
-                "modifiercompiler.noprint.php" => true,
-                "modifiercompiler.string_format.php" => true,
-                "modifiercompiler.strip.php" => true,
-                "modifiercompiler.strip_tags.php" => true,
-                "modifiercompiler.to_charset.php" => true,
-                "modifiercompiler.unescape.php" => true,
-                "modifiercompiler.upper.php" => true,
-                "modifiercompiler.wordwrap.php" => true,
-                "outputfilter.trimwhitespace.php" => true,
-                "shared.escape_special_chars.php" => true,
-                "shared.literal_compiler_param.php" => true,
-                "shared.make_timestamp.php" => true,
-                "shared.mb_str_replace.php" => true,
-                "shared.mb_unicode.php" => true,
-                "shared.mb_wordwrap.php" => true,
-                "variablefilter.htmlspecialchars.php" => true,
-            );
-            $iterator = new DirectoryIterator($source);
-            foreach ($iterator as $file) {
-                if (!$file->isDot()) {
-                    $filename = $file->getFilename();
-                    if (isset($expected[$filename])) {
-                        unset($expected[$filename]);
-                    }
-                }
-            }
-            if ($expected) {
-                $status = false;
-                $message = "FAILED: files missing from libs/plugins: ". join(', ', array_keys($expected));
-                if ($errors === null) {
-                    echo $message . ".\n";
-                } else {
-                    $errors['plugins'] = $message;
-                }
-            } elseif ($errors === null) {
-                echo "... OK\n";
-            }
-        } else {
-            $status = false;
-            $message = "FAILED: ". SMARTY_PLUGINS_DIR .' is not a directory';
-            if ($errors === null) {
-                echo $message . ".\n";
-            } else {
-                $errors['plugins_dir_constant'] = $message;
-            }
-        }
-
-        if ($errors === null) {
-            echo "Tests complete.\n";
-            echo "</PRE>\n";
-        }
-
-        return $status;
-    }
-
-}
+<?php
+/**
+ * Project:     Smarty: the PHP compiling template engine
+ * File:        smarty_internal_utility.php
+ * SVN:         $Id: $
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * For questions, help, comments, discussion, etc., please join the
+ * Smarty mailing list. Send a blank e-mail to
+ * [email protected]
+ *
+ * @link http://www.smarty.net/
+ * @copyright 2008 New Digital Group, Inc.
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author Uwe Tews
+ * @package Smarty
+ * @subpackage PluginsInternal
+ * @version 3-SVN$Rev: 3286 $
+ */
+
+/**
+ * Utility class
+ *
+ * @package Smarty
+ * @subpackage Security
+ */
+class Smarty_Internal_Utility
+{
+    /**
+     * private constructor to prevent calls creation of new instances
+     */
+    final private function __construct()
+    {
+        // intentionally left blank
+    }
+
+    /**
+     * Compile all template files
+     *
+     * @param  string  $extension     template file name extension
+     * @param  bool    $force_compile force all to recompile
+     * @param  int     $time_limit    set maximum execution time
+     * @param  int     $max_errors    set maximum allowed errors
+     * @param  Smarty  $smarty        Smarty instance
+     * @return integer number of template files compiled
+     */
+    public static function compileAllTemplates($extension, $force_compile, $time_limit, $max_errors, Smarty $smarty)
+    {
+        // switch off time limit
+        if (function_exists('set_time_limit')) {
+            @set_time_limit($time_limit);
+        }
+        $smarty->force_compile = $force_compile;
+        $_count = 0;
+        $_error_count = 0;
+        // loop over array of template directories
+        foreach ($smarty->getTemplateDir() as $_dir) {
+            $_compileDirs = new RecursiveDirectoryIterator($_dir);
+            $_compile = new RecursiveIteratorIterator($_compileDirs);
+            foreach ($_compile as $_fileinfo) {
+                $_file = $_fileinfo->getFilename();
+                if (substr(basename($_fileinfo->getPathname()),0,1) == '.' || strpos($_file, '.svn') !== false || strpos($_file, '.git') !== false) continue;
+                if (!substr_compare($_file, $extension, - strlen($extension)) == 0) continue;
+                if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
+                   $_template_file = $_file;
+                } else {
+                   $_template_file = substr($_fileinfo->getPath(), strlen($_dir)) . DS . $_file;
+                }
+                echo '<br>', $_dir, '---', $_template_file;
+                flush();
+                $_start_time = microtime(true);
+                try {
+                    $_tpl = $smarty->createTemplate($_template_file,null,null,null,false);
+                    if ($_tpl->mustCompile()) {
+                        $_tpl->compileTemplateSource();
+                        $_count++;
+                        echo ' compiled in  ', microtime(true) - $_start_time, ' seconds';
+                        flush();
+                    } else {
+                        echo ' is up to date';
+                        flush();
+                    }
+                } catch (Exception $e) {
+                    echo 'Error: ', $e->getMessage(), "<br><br>";
+                    $_error_count++;
+                }
+                // free memory
+                $smarty->template_objects = array();
+                $_tpl->smarty->template_objects = array();
+                $_tpl = null;
+                if ($max_errors !== null && $_error_count == $max_errors) {
+                    echo '<br><br>too many errors';
+                    exit();
+                }
+            }
+        }
+
+        return $_count;
+    }
+
+    /**
+     * Compile all config files
+     *
+     * @param  string  $extension     config file name extension
+     * @param  bool    $force_compile force all to recompile
+     * @param  int     $time_limit    set maximum execution time
+     * @param  int     $max_errors    set maximum allowed errors
+     * @param  Smarty  $smarty        Smarty instance
+     * @return integer number of config files compiled
+     */
+    public static function compileAllConfig($extension, $force_compile, $time_limit, $max_errors, Smarty $smarty)
+    {
+        // switch off time limit
+        if (function_exists('set_time_limit')) {
+            @set_time_limit($time_limit);
+        }
+        $smarty->force_compile = $force_compile;
+        $_count = 0;
+        $_error_count = 0;
+        // loop over array of template directories
+        foreach ($smarty->getConfigDir() as $_dir) {
+            $_compileDirs = new RecursiveDirectoryIterator($_dir);
+            $_compile = new RecursiveIteratorIterator($_compileDirs);
+            foreach ($_compile as $_fileinfo) {
+                $_file = $_fileinfo->getFilename();
+                if (substr(basename($_fileinfo->getPathname()),0,1) == '.' || strpos($_file, '.svn') !== false || strpos($_file, '.git') !== false) continue;
+                if (!substr_compare($_file, $extension, - strlen($extension)) == 0) continue;
+                if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
+                    $_config_file = $_file;
+                } else {
+                    $_config_file = substr($_fileinfo->getPath(), strlen($_dir)) . DS . $_file;
+                }
+                echo '<br>', $_dir, '---', $_config_file;
+                flush();
+                $_start_time = microtime(true);
+                try {
+                    $_config = new Smarty_Internal_Config($_config_file, $smarty);
+                    if ($_config->mustCompile()) {
+                        $_config->compileConfigSource();
+                        $_count++;
+                        echo ' compiled in  ', microtime(true) - $_start_time, ' seconds';
+                        flush();
+                    } else {
+                        echo ' is up to date';
+                        flush();
+                    }
+                } catch (Exception $e) {
+                    echo 'Error: ', $e->getMessage(), "<br><br>";
+                    $_error_count++;
+                }
+                if ($max_errors !== null && $_error_count == $max_errors) {
+                    echo '<br><br>too many errors';
+                    exit();
+                }
+            }
+        }
+
+        return $_count;
+    }
+
+    /**
+     * Delete compiled template file
+     *
+     * @param  string  $resource_name template name
+     * @param  string  $compile_id    compile id
+     * @param  integer $exp_time      expiration time
+     * @param  Smarty  $smarty        Smarty instance
+     * @return integer number of template files deleted
+     */
+    public static function clearCompiledTemplate($resource_name, $compile_id, $exp_time, Smarty $smarty)
+    {
+        $_compile_dir = $smarty->getCompileDir();
+        $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null;
+        $_dir_sep = $smarty->use_sub_dirs ? DS : '^';
+        if (isset($resource_name)) {
+            $_save_stat = $smarty->caching;
+            $smarty->caching = false;
+            $tpl = new $smarty->template_class($resource_name, $smarty);
+            $smarty->caching = $_save_stat;
+
+            // remove from template cache
+            $tpl->source; // have the template registered before unset()
+            if ($smarty->allow_ambiguous_resources) {
+                $_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id;
+            } else {
+                $_templateId = $smarty->joined_template_dir . '#' . $resource_name . $tpl->cache_id . $tpl->compile_id;
+            }
+            if (isset($_templateId[150])) {
+                $_templateId = sha1($_templateId);
+            }
+            unset($smarty->template_objects[$_templateId]);
+
+            if ($tpl->source->exists) {
+                 $_resource_part_1 = basename(str_replace('^', '/', $tpl->compiled->filepath));
+                 $_resource_part_1_length = strlen($_resource_part_1);
+            } else {
+                return 0;
+            }
+
+            $_resource_part_2 = str_replace('.php','.cache.php',$_resource_part_1);
+            $_resource_part_2_length = strlen($_resource_part_2);
+        }
+        $_dir = $_compile_dir;
+        if ($smarty->use_sub_dirs && isset($_compile_id)) {
+            $_dir .= $_compile_id . $_dir_sep;
+        }
+        if (isset($_compile_id)) {
+            $_compile_id_part = $_compile_dir . $_compile_id . $_dir_sep;
+            $_compile_id_part_length = strlen($_compile_id_part);
+        }
+        $_count = 0;
+        try {
+            $_compileDirs = new RecursiveDirectoryIterator($_dir);
+        // NOTE: UnexpectedValueException thrown for PHP >= 5.3
+        } catch (Exception $e) {
+            return 0;
+        }
+        $_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST);
+        foreach ($_compile as $_file) {
+            if (substr(basename($_file->getPathname()), 0, 1) == '.' || strpos($_file, '.svn') !== false || strpos($_file, '.git') !== false) continue;
+
+            $_filepath = (string) $_file;
+
+            if ($_file->isDir()) {
+                if (!$_compile->isDot()) {
+                    // delete folder if empty
+                    @rmdir($_file->getPathname());
+                }
+            } else {
+                $unlink = false;
+                if ((!isset($_compile_id) || (isset($_filepath[$_compile_id_part_length]) && !strncmp($_filepath, $_compile_id_part, $_compile_id_part_length)))
+                    && (!isset($resource_name)
+                        || (isset($_filepath[$_resource_part_1_length])
+                            && substr_compare($_filepath, $_resource_part_1, -$_resource_part_1_length, $_resource_part_1_length) == 0)
+                        || (isset($_filepath[$_resource_part_2_length])
+                            && substr_compare($_filepath, $_resource_part_2, -$_resource_part_2_length, $_resource_part_2_length) == 0))) {
+                    if (isset($exp_time)) {
+                        if (time() - @filemtime($_filepath) >= $exp_time) {
+                            $unlink = true;
+                        }
+                    } else {
+                        $unlink = true;
+                    }
+                }
+
+                if ($unlink && @unlink($_filepath)) {
+                    $_count++;
+                }
+            }
+        }
+        // clear compiled cache
+        Smarty_Resource::$sources = array();
+        Smarty_Resource::$compileds = array();
+
+        return $_count;
+    }
+
+    /**
+     * Return array of tag/attributes of all tags used by an template
+     *
+     * @param  Smarty_Internal_Template $templae template object
+     * @return array                    of tag/attributes
+     */
+    public static function getTags(Smarty_Internal_Template $template)
+    {
+        $template->smarty->get_used_tags = true;
+        $template->compileTemplateSource();
+
+        return $template->used_tags;
+    }
+
+    /**
+     * diagnose Smarty setup
+     *
+     * If $errors is secified, the diagnostic report will be appended to the array, rather than being output.
+     *
+     * @param  Smarty $smarty Smarty instance to test
+     * @param  array  $errors array to push results into rather than outputting them
+     * @return bool   status, true if everything is fine, false else
+     */
+    public static function testInstall(Smarty $smarty, &$errors=null)
+    {
+        $status = true;
+
+        if ($errors === null) {
+            echo "<PRE>\n";
+            echo "Smarty Installation test...\n";
+            echo "Testing template directory...\n";
+        }
+
+        $_stream_resolve_include_path = function_exists('stream_resolve_include_path');
+
+        // test if all registered template_dir are accessible
+        foreach ($smarty->getTemplateDir() as $template_dir) {
+            $_template_dir = $template_dir;
+            $template_dir = realpath($template_dir);
+            // resolve include_path or fail existence
+            if (!$template_dir) {
+                if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_template_dir)) {
+                    // try PHP include_path
+                    if ($_stream_resolve_include_path) {
+                        $template_dir = stream_resolve_include_path($_template_dir);
+                    } else {
+                        $template_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_template_dir);
+                    }
+
+                    if ($template_dir !== false) {
+                        if ($errors === null) {
+                            echo "$template_dir is OK.\n";
+                        }
+
+                        continue;
+                    } else {
+                        $status = false;
+                        $message = "FAILED: $_template_dir does not exist (and couldn't be found in include_path either)";
+                        if ($errors === null) {
+                            echo $message . ".\n";
+                        } else {
+                            $errors['template_dir'] = $message;
+                        }
+
+                        continue;
+                    }
+                } else {
+                    $status = false;
+                    $message = "FAILED: $_template_dir does not exist";
+                    if ($errors === null) {
+                        echo $message . ".\n";
+                    } else {
+                        $errors['template_dir'] = $message;
+                    }
+
+                    continue;
+                }
+            }
+
+            if (!is_dir($template_dir)) {
+                $status = false;
+                $message = "FAILED: $template_dir is not a directory";
+                if ($errors === null) {
+                    echo $message . ".\n";
+                } else {
+                    $errors['template_dir'] = $message;
+                }
+            } elseif (!is_readable($template_dir)) {
+                $status = false;
+                $message = "FAILED: $template_dir is not readable";
+                if ($errors === null) {
+                    echo $message . ".\n";
+                } else {
+                    $errors['template_dir'] = $message;
+                }
+            } else {
+                if ($errors === null) {
+                    echo "$template_dir is OK.\n";
+                }
+            }
+        }
+
+        if ($errors === null) {
+            echo "Testing compile directory...\n";
+        }
+
+        // test if registered compile_dir is accessible
+        $__compile_dir = $smarty->getCompileDir();
+        $_compile_dir = realpath($__compile_dir);
+        if (!$_compile_dir) {
+            $status = false;
+            $message = "FAILED: {$__compile_dir} does not exist";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['compile_dir'] = $message;
+            }
+        } elseif (!is_dir($_compile_dir)) {
+            $status = false;
+            $message = "FAILED: {$_compile_dir} is not a directory";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['compile_dir'] = $message;
+            }
+        } elseif (!is_readable($_compile_dir)) {
+            $status = false;
+            $message = "FAILED: {$_compile_dir} is not readable";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['compile_dir'] = $message;
+            }
+        } elseif (!is_writable($_compile_dir)) {
+            $status = false;
+            $message = "FAILED: {$_compile_dir} is not writable";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['compile_dir'] = $message;
+            }
+        } else {
+            if ($errors === null) {
+                echo "{$_compile_dir} is OK.\n";
+            }
+        }
+
+        if ($errors === null) {
+            echo "Testing plugins directory...\n";
+        }
+
+        // test if all registered plugins_dir are accessible
+        // and if core plugins directory is still registered
+        $_core_plugins_dir = realpath(dirname(__FILE__) .'/../plugins');
+        $_core_plugins_available = false;
+        foreach ($smarty->getPluginsDir() as $plugin_dir) {
+            $_plugin_dir = $plugin_dir;
+            $plugin_dir = realpath($plugin_dir);
+            // resolve include_path or fail existence
+            if (!$plugin_dir) {
+                if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) {
+                    // try PHP include_path
+                    if ($_stream_resolve_include_path) {
+                        $plugin_dir = stream_resolve_include_path($_plugin_dir);
+                    } else {
+                        $plugin_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_plugin_dir);
+                    }
+
+                    if ($plugin_dir !== false) {
+                        if ($errors === null) {
+                            echo "$plugin_dir is OK.\n";
+                        }
+
+                        continue;
+                    } else {
+                        $status = false;
+                        $message = "FAILED: $_plugin_dir does not exist (and couldn't be found in include_path either)";
+                        if ($errors === null) {
+                            echo $message . ".\n";
+                        } else {
+                            $errors['plugins_dir'] = $message;
+                        }
+
+                        continue;
+                    }
+                } else {
+                    $status = false;
+                    $message = "FAILED: $_plugin_dir does not exist";
+                    if ($errors === null) {
+                        echo $message . ".\n";
+                    } else {
+                        $errors['plugins_dir'] = $message;
+                    }
+
+                    continue;
+                }
+            }
+
+            if (!is_dir($plugin_dir)) {
+                $status = false;
+                $message = "FAILED: $plugin_dir is not a directory";
+                if ($errors === null) {
+                    echo $message . ".\n";
+                } else {
+                    $errors['plugins_dir'] = $message;
+                }
+            } elseif (!is_readable($plugin_dir)) {
+                $status = false;
+                $message = "FAILED: $plugin_dir is not readable";
+                if ($errors === null) {
+                    echo $message . ".\n";
+                } else {
+                    $errors['plugins_dir'] = $message;
+                }
+            } elseif ($_core_plugins_dir && $_core_plugins_dir == realpath($plugin_dir)) {
+                $_core_plugins_available = true;
+                if ($errors === null) {
+                    echo "$plugin_dir is OK.\n";
+                }
+            } else {
+                if ($errors === null) {
+                    echo "$plugin_dir is OK.\n";
+                }
+            }
+        }
+        if (!$_core_plugins_available) {
+            $status = false;
+            $message = "WARNING: Smarty's own libs/plugins is not available";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } elseif (!isset($errors['plugins_dir'])) {
+                $errors['plugins_dir'] = $message;
+            }
+        }
+
+        if ($errors === null) {
+            echo "Testing cache directory...\n";
+        }
+
+        // test if all registered cache_dir is accessible
+        $__cache_dir = $smarty->getCacheDir();
+        $_cache_dir = realpath($__cache_dir);
+        if (!$_cache_dir) {
+            $status = false;
+            $message = "FAILED: {$__cache_dir} does not exist";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['cache_dir'] = $message;
+            }
+        } elseif (!is_dir($_cache_dir)) {
+            $status = false;
+            $message = "FAILED: {$_cache_dir} is not a directory";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['cache_dir'] = $message;
+            }
+        } elseif (!is_readable($_cache_dir)) {
+            $status = false;
+            $message = "FAILED: {$_cache_dir} is not readable";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['cache_dir'] = $message;
+            }
+        } elseif (!is_writable($_cache_dir)) {
+            $status = false;
+            $message = "FAILED: {$_cache_dir} is not writable";
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['cache_dir'] = $message;
+            }
+        } else {
+            if ($errors === null) {
+                echo "{$_cache_dir} is OK.\n";
+            }
+        }
+
+        if ($errors === null) {
+            echo "Testing configs directory...\n";
+        }
+
+        // test if all registered config_dir are accessible
+        foreach ($smarty->getConfigDir() as $config_dir) {
+            $_config_dir = $config_dir;
+            $config_dir = realpath($config_dir);
+            // resolve include_path or fail existence
+            if (!$config_dir) {
+                if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_config_dir)) {
+                    // try PHP include_path
+                    if ($_stream_resolve_include_path) {
+                        $config_dir = stream_resolve_include_path($_config_dir);
+                    } else {
+                        $config_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_config_dir);
+                    }
+
+                    if ($config_dir !== false) {
+                        if ($errors === null) {
+                            echo "$config_dir is OK.\n";
+                        }
+
+                        continue;
+                    } else {
+                        $status = false;
+                        $message = "FAILED: $_config_dir does not exist (and couldn't be found in include_path either)";
+                        if ($errors === null) {
+                            echo $message . ".\n";
+                        } else {
+                            $errors['config_dir'] = $message;
+                        }
+
+                        continue;
+                    }
+                } else {
+                    $status = false;
+                    $message = "FAILED: $_config_dir does not exist";
+                    if ($errors === null) {
+                        echo $message . ".\n";
+                    } else {
+                        $errors['config_dir'] = $message;
+                    }
+
+                    continue;
+                }
+            }
+
+            if (!is_dir($config_dir)) {
+                $status = false;
+                $message = "FAILED: $config_dir is not a directory";
+                if ($errors === null) {
+                    echo $message . ".\n";
+                } else {
+                    $errors['config_dir'] = $message;
+                }
+            } elseif (!is_readable($config_dir)) {
+                $status = false;
+                $message = "FAILED: $config_dir is not readable";
+                if ($errors === null) {
+                    echo $message . ".\n";
+                } else {
+                    $errors['config_dir'] = $message;
+                }
+            } else {
+                if ($errors === null) {
+                    echo "$config_dir is OK.\n";
+                }
+            }
+        }
+
+        if ($errors === null) {
+            echo "Testing sysplugin files...\n";
+        }
+        // test if sysplugins are available
+        $source = SMARTY_SYSPLUGINS_DIR;
+        if (is_dir($source)) {
+            $expected = array(
+                "smarty_cacheresource.php" => true,
+                "smarty_cacheresource_custom.php" => true,
+                "smarty_cacheresource_keyvaluestore.php" => true,
+                "smarty_config_source.php" => true,
+                "smarty_internal_cacheresource_file.php" => true,
+                "smarty_internal_compile_append.php" => true,
+                "smarty_internal_compile_assign.php" => true,
+                "smarty_internal_compile_block.php" => true,
+                "smarty_internal_compile_break.php" => true,
+                "smarty_internal_compile_call.php" => true,
+                "smarty_internal_compile_capture.php" => true,
+                "smarty_internal_compile_config_load.php" => true,
+                "smarty_internal_compile_continue.php" => true,
+                "smarty_internal_compile_debug.php" => true,
+                "smarty_internal_compile_eval.php" => true,
+                "smarty_internal_compile_extends.php" => true,
+                "smarty_internal_compile_for.php" => true,
+                "smarty_internal_compile_foreach.php" => true,
+                "smarty_internal_compile_function.php" => true,
+                "smarty_internal_compile_if.php" => true,
+                "smarty_internal_compile_include.php" => true,
+                "smarty_internal_compile_include_php.php" => true,
+                "smarty_internal_compile_insert.php" => true,
+                "smarty_internal_compile_ldelim.php" => true,
+                "smarty_internal_compile_nocache.php" => true,
+                "smarty_internal_compile_private_block_plugin.php" => true,
+                "smarty_internal_compile_private_function_plugin.php" => true,
+                "smarty_internal_compile_private_modifier.php" => true,
+                "smarty_internal_compile_private_object_block_function.php" => true,
+                "smarty_internal_compile_private_object_function.php" => true,
+                "smarty_internal_compile_private_print_expression.php" => true,
+                "smarty_internal_compile_private_registered_block.php" => true,
+                "smarty_internal_compile_private_registered_function.php" => true,
+                "smarty_internal_compile_private_special_variable.php" => true,
+                "smarty_internal_compile_rdelim.php" => true,
+                "smarty_internal_compile_section.php" => true,
+                "smarty_internal_compile_setfilter.php" => true,
+                "smarty_internal_compile_while.php" => true,
+                "smarty_internal_compilebase.php" => true,
+                "smarty_internal_config.php" => true,
+                "smarty_internal_config_file_compiler.php" => true,
+                "smarty_internal_configfilelexer.php" => true,
+                "smarty_internal_configfileparser.php" => true,
+                "smarty_internal_data.php" => true,
+                "smarty_internal_debug.php" => true,
+                "smarty_internal_filter_handler.php" => true,
+                "smarty_internal_function_call_handler.php" => true,
+                "smarty_internal_get_include_path.php" => true,
+                "smarty_internal_nocache_insert.php" => true,
+                "smarty_internal_parsetree.php" => true,
+                "smarty_internal_resource_eval.php" => true,
+                "smarty_internal_resource_extends.php" => true,
+                "smarty_internal_resource_file.php" => true,
+                "smarty_internal_resource_registered.php" => true,
+                "smarty_internal_resource_stream.php" => true,
+                "smarty_internal_resource_string.php" => true,
+                "smarty_internal_smartytemplatecompiler.php" => true,
+                "smarty_internal_template.php" => true,
+                "smarty_internal_templatebase.php" => true,
+                "smarty_internal_templatecompilerbase.php" => true,
+                "smarty_internal_templatelexer.php" => true,
+                "smarty_internal_templateparser.php" => true,
+                "smarty_internal_utility.php" => true,
+                "smarty_internal_write_file.php" => true,
+                "smarty_resource.php" => true,
+                "smarty_resource_custom.php" => true,
+                "smarty_resource_recompiled.php" => true,
+                "smarty_resource_uncompiled.php" => true,
+                "smarty_security.php" => true,
+            );
+            $iterator = new DirectoryIterator($source);
+            foreach ($iterator as $file) {
+                if (!$file->isDot()) {
+                    $filename = $file->getFilename();
+                    if (isset($expected[$filename])) {
+                        unset($expected[$filename]);
+                    }
+                }
+            }
+            if ($expected) {
+                $status = false;
+                $message = "FAILED: files missing from libs/sysplugins: ". join(', ', array_keys($expected));
+                if ($errors === null) {
+                    echo $message . ".\n";
+                } else {
+                    $errors['sysplugins'] = $message;
+                }
+            } elseif ($errors === null) {
+                echo "... OK\n";
+            }
+        } else {
+            $status = false;
+            $message = "FAILED: ". SMARTY_SYSPLUGINS_DIR .' is not a directory';
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['sysplugins_dir_constant'] = $message;
+            }
+        }
+
+        if ($errors === null) {
+            echo "Testing plugin files...\n";
+        }
+        // test if core plugins are available
+        $source = SMARTY_PLUGINS_DIR;
+        if (is_dir($source)) {
+            $expected = array(
+                "block.textformat.php" => true,
+                "function.counter.php" => true,
+                "function.cycle.php" => true,
+                "function.fetch.php" => true,
+                "function.html_checkboxes.php" => true,
+                "function.html_image.php" => true,
+                "function.html_options.php" => true,
+                "function.html_radios.php" => true,
+                "function.html_select_date.php" => true,
+                "function.html_select_time.php" => true,
+                "function.html_table.php" => true,
+                "function.mailto.php" => true,
+                "function.math.php" => true,
+                "modifier.capitalize.php" => true,
+                "modifier.date_format.php" => true,
+                "modifier.debug_print_var.php" => true,
+                "modifier.escape.php" => true,
+                "modifier.regex_replace.php" => true,
+                "modifier.replace.php" => true,
+                "modifier.spacify.php" => true,
+                "modifier.truncate.php" => true,
+                "modifiercompiler.cat.php" => true,
+                "modifiercompiler.count_characters.php" => true,
+                "modifiercompiler.count_paragraphs.php" => true,
+                "modifiercompiler.count_sentences.php" => true,
+                "modifiercompiler.count_words.php" => true,
+                "modifiercompiler.default.php" => true,
+                "modifiercompiler.escape.php" => true,
+                "modifiercompiler.from_charset.php" => true,
+                "modifiercompiler.indent.php" => true,
+                "modifiercompiler.lower.php" => true,
+                "modifiercompiler.noprint.php" => true,
+                "modifiercompiler.string_format.php" => true,
+                "modifiercompiler.strip.php" => true,
+                "modifiercompiler.strip_tags.php" => true,
+                "modifiercompiler.to_charset.php" => true,
+                "modifiercompiler.unescape.php" => true,
+                "modifiercompiler.upper.php" => true,
+                "modifiercompiler.wordwrap.php" => true,
+                "outputfilter.trimwhitespace.php" => true,
+                "shared.escape_special_chars.php" => true,
+                "shared.literal_compiler_param.php" => true,
+                "shared.make_timestamp.php" => true,
+                "shared.mb_str_replace.php" => true,
+                "shared.mb_unicode.php" => true,
+                "shared.mb_wordwrap.php" => true,
+                "variablefilter.htmlspecialchars.php" => true,
+            );
+            $iterator = new DirectoryIterator($source);
+            foreach ($iterator as $file) {
+                if (!$file->isDot()) {
+                    $filename = $file->getFilename();
+                    if (isset($expected[$filename])) {
+                        unset($expected[$filename]);
+                    }
+                }
+            }
+            if ($expected) {
+                $status = false;
+                $message = "FAILED: files missing from libs/plugins: ". join(', ', array_keys($expected));
+                if ($errors === null) {
+                    echo $message . ".\n";
+                } else {
+                    $errors['plugins'] = $message;
+                }
+            } elseif ($errors === null) {
+                echo "... OK\n";
+            }
+        } else {
+            $status = false;
+            $message = "FAILED: ". SMARTY_PLUGINS_DIR .' is not a directory';
+            if ($errors === null) {
+                echo $message . ".\n";
+            } else {
+                $errors['plugins_dir_constant'] = $message;
+            }
+        }
+
+        if ($errors === null) {
+            echo "Tests complete.\n";
+            echo "</PRE>\n";
+        }
+
+        return $status;
+    }
+
+}

+ 1380 - 1380
themes/default/app_defaults.php

@@ -1,1381 +1,1381 @@
-<?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]>
-*/
-
-if ($domains_processed == 1) {
-
-	//get the background images
-		$relative_path = PROJECT_PATH.'/themes/default/images/backgrounds';
-		$backgrounds = opendir($_SERVER["DOCUMENT_ROOT"].'/'.$relative_path);
-		unset($array);
-		$x = 0;
-		while (false !== ($file = readdir($backgrounds))) {
-			if ($file != "." AND $file != ".."){
-				$ext = pathinfo($file, PATHINFO_EXTENSION);
-				if ($ext == "png" || $ext == "jpg" || $ext == "jpeg" || $ext == "gif") {
-					$array[$x]['default_setting_category'] = 'theme';
-					$array[$x]['default_setting_subcategory'] = 'background_image';
-					$array[$x]['default_setting_name'] = 'array';
-					$array[$x]['default_setting_value'] = $relative_path.'/'.$file;
-					$array[$x]['default_setting_enabled'] = 'false';
-					$array[$x]['default_setting_description'] = 'Set a relative path or URL within a selected compatible template.';
-					$x++;
-					$array[$x]['default_setting_category'] = 'theme';
-					$array[$x]['default_setting_subcategory'] = 'login_background_image';
-					$array[$x]['default_setting_name'] = 'array';
-					$array[$x]['default_setting_value'] = $relative_path.'/'.$file;
-					$array[$x]['default_setting_enabled'] = 'false';
-					$array[$x]['default_setting_description'] = 'Set a relative path or URL within a selected compatible template.';
-					$x++;
-				}
-				if ($x > 300) { break; };
-			}
-		}
-
-	//define array of settings
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'background_color';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = '#6c89b5';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_order'] = '0';
-		$array[$x]['default_setting_description'] = 'Set a background color.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'background_color';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = '#144794';
-		$array[$x]['default_setting_order'] = '1';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set a secondary background color, for a gradient effect.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'domain_visible';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'true';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the visibility of the name of the domain currently being managed.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'logout_icon_visible';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'false';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the visibility of the logout icon.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'domain_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#69e5ff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text color (and opacity) for domain name.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'footer_background_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'rgba(0,0,0,0.1)';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) for the footer bar.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'footer_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'rgba(255,255,255,0.1)';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text color (and opacity) for the footer bar.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'footer_border_radius';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '0 0 4px 4px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border radius of the footer bar.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'message_default_background_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ccffcc';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the background color for the positive (default) message bar.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'message_default_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#004200';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the text color for the positive (default) message bar text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'message_negative_background_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffcdcd';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the background color for the negative message bar.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'message_negative_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#670000';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the text color for the negative message bar text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'message_alert_background_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffe585';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the background color for the alert message bar.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'message_alert_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#d66721';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the text color for the alert message bar text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'message_opacity';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '0.9';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the opacity of the message bar (decimal).';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'message_delay';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '1.75';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the hide delay of the message bar (seconds).';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'background_image_enabled';
-		$array[$x]['default_setting_name'] = 'boolean';
-		$array[$x]['default_setting_value'] = 'true';
-		$array[$x]['default_setting_enabled'] = 'false';
-		if ($background_image_enabled) { $array[$x]['default_setting_enabled'] = 'true'; }
-		$array[$x]['default_setting_description'] = 'Enable use of background images.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'body_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set then body background color (and opacity) of the content.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'body_shadow_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#000000';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of the body.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'body_border_radius';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '4px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border radius of the body.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'cache';
-		$array[$x]['default_setting_name'] = 'boolean';
-		$array[$x]['default_setting_value'] = 'false';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set whether to cache the theme in the session.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'domain_selector_shadow_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#888888';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the shadow color (and opacity) of the domain selector pane.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'logo_align';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'center';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the alignment of the header logo (Inline menu only)';
-		$x++;
-		/* menu elements */
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_main_background_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ff0000';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set a background color (and opacity) of the main menu bar.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_main_background_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ff0000';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set a background hover color (and opacity) of the main menu items.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_main_icons';
-		$array[$x]['default_setting_name'] = 'boolean';
-		$array[$x]['default_setting_value'] = 'false';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Show icons next to main menu items.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_main_background_image';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '/themes/default/images/background_black.png';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set a background image for the main menu bar.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_main_shadow_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#000000';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the shadow color (and opacity) of the main menu bar.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_main_text_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text color of the main menu items.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_main_text_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#69e5ff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text hover color of the main menu items.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_main_text_font';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'Arial';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the font of the main menu items.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_main_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '10.25pt';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text size of the main menu items.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_main_border_radius';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '0 0 4px 4px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border radius of the main menu.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_main_border_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '1px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border size of the main menu.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_main_border_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border color (and opacity) of the main menu.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_position';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'top';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the position of the main menu (Fixed menu only).';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_style';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'fixed';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the style of the main menu.';
-		$x++;
-		/* sub menu items */
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_sub_background_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of the sub menus.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_sub_background_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the hover background color (and opacity) of the sub menu items.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_sub_icons';
-		$array[$x]['default_setting_name'] = 'boolean';
-		$array[$x]['default_setting_value'] = 'false';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Show indicator icons next to selected sub menu items.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_sub_shadow_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#000000';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the shadow color (and opacity) of sub menus.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_sub_text_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text color (and opacity) of sub menu items.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_sub_text_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#69e5ff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the hover text color (and opacity) of sub menu items.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_sub_text_font';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'Arial';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the font of the sub menu items.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_sub_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '10pt';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text size of the sub menu items.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_sub_border_radius';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '0 0 4px 4px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border radius of the sub menu.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_sub_border_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '1px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border size of the sub menu.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'menu_sub_border_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border color (and opacity) of the sub menu.';
-		$x++;
-		/* body elements */
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'heading_text_font';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'arial';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the font of the page heading text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'heading_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '15px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the size of the page heading text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'heading_text_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#952424';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of the page heading text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'body_text_font';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'arial';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the font of body text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'body_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '12px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the size of the body text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'body_text_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#5f5f5f';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of the body text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'text_link_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#004083';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the link color (and opacity) of text links outside tables.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'text_link_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#5082ca';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the hover color (and opacity) of text links outside tables.';
-		$x++;
-		/* data tables */
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'table_heading_text_font';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'arial';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text font of table header rows.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'table_heading_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '12px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text size of table header rows.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'table_heading_text_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#3164ad';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text color (and opacity) of table header rows.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'table_heading_background_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of table header rows.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'table_heading_border_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#a4aebf';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the bottom border color (and opacity) of table header rows.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'table_row_text_font';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'arial';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text font of table data rows.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'table_row_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '12px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text size of table data rows.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'table_row_text_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#000';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text color (and opacity) of table data rows.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'table_row_background_color_dark';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#e5e9f0';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the darker background color (and opacity) of table data rows.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'table_row_background_color_medium';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#f0f2f6';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the medium background color (and opacity) of table data rows.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'table_row_background_color_light';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#fff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the lighter background color (and opacity) of table data rows.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'table_row_border_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#c5d1e5';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the bottom border (dividing line) color (and opacity) of table data rows.';
-		/* dashboard elements */
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_border_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#dbe0ea';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border color (and opacity) of the Dashboard blocks.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_border_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#cbd3e1';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border hover color (and opacity) of the Dashboard block.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_border_radius';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '5px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border radius of the Dashboard block.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_heading_background_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#8e96a5';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of the Dashboard block heading.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_heading_background_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#969dab';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background hover color (and opacity) of the Dashboard block heading.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_heading_text_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of the Dashboard block heading text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_heading_text_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the hover color (and opacity) of the Dashboard block heading text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_heading_text_font';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the font of the Dashboard block heading text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_heading_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '10.5pt';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the size of the Dashboard block heading text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_heading_text_shadow_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#000000';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the shadow color (and opacity) of the Dashboard block heading text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_heading_text_shadow_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#000000';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the shadow hover color (and opacity) of the Dashboard block heading text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_number_background_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#a4aebf';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of the Dashboard block number.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_number_background_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#aeb7c5';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background hover color (and opacity) of the Dashboard block number.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_number_text_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of the Dashboard block number.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_number_text_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the hover color (and opacity) of the Dashboard block number.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_number_text_font';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the font of the Dashboard block number.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_number_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '60pt';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the size of the Dashboard block number.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_number_text_shadow_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#737983';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the shadow color (and opacity) of the Dashboard block number.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_number_text_shadow_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#737983';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the shadow hover color (and opacity) of the Dashboard block number.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_number_title_text_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of the Dashboard block number title.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_number_title_text_font';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the font of the Dashboard block number title.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_number_title_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '14px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the size of the Dashboard block number title.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_number_title_text_shadow_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#737983';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the shadow color (and opacity) of the Dashboard block number title.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_detail_heading_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '11px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the size of the Dashboard block detail header text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_detail_row_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '11px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the size of the Dashboard block detail row text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_detail_shadow_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#737983';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the shadow color of the Dashboard block detail box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_detail_background_color_center';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#f9fbfe';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the center gradient color of the Dashboard block detail area.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_detail_background_color_edge';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#edf1f7';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the edge gradient color of the Dashboard block detail area.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_footer_background_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#e5e9f0';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of the Dashboard block footer bar.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_footer_background_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ebeef3';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background hover color (and opacity) of the Dashboard block footer bar.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_footer_dots_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#a4aebf';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of the Dashboard block footer bar dots.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'dashboard_footer_dots_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#a4aebf';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the hover color (and opacity) of the Dashboard block footer bar dots.';
-		$x++;
-		/* form table elements */
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_label_padding';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '7px 8px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the padding of the form label cell.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_label_background_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#e5e9f0';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of the form label cell.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_label_border_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the bottom-border color (and opacity) of the form label cell.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_label_border_radius';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '4px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border radius of the form label cell.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_label_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '9pt';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text size of the form label.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_label_text_font';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'Arial';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text font of the form label.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_label_text_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#000000';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text color (and opacity) of the form label.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_label_required_background_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#e5e9f0';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background color of the required form label cell.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_label_required_border_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#cbcfd5';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the right-border color (and opacity) of the required form label cell.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_label_required_text_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#000000';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text color (and opacity) of the required form label.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_label_required_text_weight';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'bold';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the text weight of the required form label.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_field_padding';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '6px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the padding of the form field cell.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_field_background_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of the form field cell.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_field_border_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#e5e9f0';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the bottom-border color (and opacity) of the form field cell.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_field_border_radius';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '0';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border radius of the form label cell.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_field_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '8pt';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the size of text in the form field cell.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_field_text_font';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'Arial';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the font of text in the form field cell.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_field_text_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#666666';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of text in the form field cell.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_heading_padding';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '8px 8px 4px 8px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the padding of form column headings.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_row_padding';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '3px 0';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the padding of form row cells.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'form_table_row_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '9pt';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the size of text in the form rows.';
-		$x++;
-		/* login box */
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_background_color';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = '#6c89b5';
-		$array[$x]['default_setting_order'] = '0';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background color of the login page.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_background_color';
-		$array[$x]['default_setting_name'] = 'array';
-		$array[$x]['default_setting_value'] = '#144794';
-		$array[$x]['default_setting_order'] = '1';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set a secondary background color of the login page, for a gradient effect.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_background_image_enabled';
-		$array[$x]['default_setting_name'] = 'boolean';
-		$array[$x]['default_setting_value'] = 'true';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Enable use of background images on the login page.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_body_background_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'rgba(255,255,255,0.3)';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the background color for the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_body_shadow_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'rgba(140,140,140,0.3)';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the shadow color of the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_body_padding';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '30px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the padding of the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_body_width';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '100%';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the width of the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_body_border_radius';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '4px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border radius of the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_body_border_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '1px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border size of the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_body_border_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border color (and opacity) of the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_link_text_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#004083';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of text links on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_link_text_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#5082ca';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the hover color (and opacity) of text links on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_link_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '11px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the size of text links on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_link_text_font';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'Arial';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the font of text links on the login box.';
-		$x++;
-		/* buttons */
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'button_background_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#4f4f4f';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background main/top color (and opacity) of buttons.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'button_background_color_bottom';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#000000';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background bottom color (and opacity) of buttons.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'button_background_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#000000';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background main/top hover color (and opacity) of buttons.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'button_background_color_bottom_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#000000';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background bottom hover color (and opacity) of buttons.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'button_border_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '1px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border size of buttons.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'button_border_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#242424';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border color (and opacity) of buttons.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'button_border_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#000000';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border hover color (and opacity) of buttons.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'button_border_radius';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '3px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border radius of buttons.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'button_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '11px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the size of button text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'button_text_font';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'Candara, Calibri, Segoe, "Segoe UI", Optima, Arial, sans-serif';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the font of button text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'button_text_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of button text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'button_text_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the hover color (and opacity) of button text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'button_text_weight';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'bold';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the weight of button text.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'button_padding';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '5px 8px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the padding of buttons.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'button_height';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '28px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the height of buttons.';
-		$x++;
-		/* form input fields */
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'input_background_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of text inputs.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'input_border_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#c0c0c0';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border color (and opacity) of text inputs.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'input_border_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#c0c0c0';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border hover color (and opacity) of text inputs.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'input_border_color_focus';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#c0c0c0';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border focus color (and opacity) of text inputs.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'input_border_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '1px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border size of text inputs.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'input_border_radius';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '3px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border radius of text inputs.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'input_shadow_inner_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#cddaf0';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the inner shadow color (and opacity) of text inputs.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'input_shadow_inner_color_focus';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the inner focus shadow color (and opacity) of text inputs.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'input_shadow_outer_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the outer shadow color (and opacity) of text inputs.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'input_shadow_outer_color_focus';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#cddaf0';
-		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the outer focus shadow color (and opacity) of text inputs.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'input_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '12px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the size of text input content.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'input_text_font';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'Arial';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the font of text input content.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'input_text_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#000000';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of text input content.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'input_text_placeholder_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#999999';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of input placeholder text.';
-		$x++;
-		/* login form input fields */
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_input_background_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of text inputs on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_input_border_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#c0c0c0';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border color (and opacity) of text inputs on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_input_border_color_hover';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#c0c0c0';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border hover color (and opacity) of text inputs on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_input_border_color_focus';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#c0c0c0';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border focus color (and opacity) of text inputs on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_input_border_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '1px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border size of text inputs on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_input_border_radius';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '3px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the border radius of text inputs on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_input_shadow_inner_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#cddaf0';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the inner shadow color (and opacity) of text inputs on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_input_shadow_inner_color_focus';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the inner focus shadow color (and opacity) of text inputs on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_input_shadow_outer_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#ffffff';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the outer shadow color (and opacity) of text inputs on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_input_shadow_outer_color_focus';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#cddaf0';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the outer focus shadow color (and opacity) of text inputs on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_input_text_size';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '12px';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the size of text input content on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_input_text_font';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = 'Arial';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the font of text input content on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_input_text_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#000000';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of text input content on the login box.';
-		$x++;
-		$array[$x]['default_setting_category'] = 'theme';
-		$array[$x]['default_setting_subcategory'] = 'login_input_text_placeholder_color';
-		$array[$x]['default_setting_name'] = 'text';
-		$array[$x]['default_setting_value'] = '#999999';
-		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of input placeholder text on the login box.';
-		$x++;
-
-	//get an array of the default settings
-		$sql = "select * from v_default_settings ";
-		$sql .= "where default_setting_category = 'theme' ";
-		$prep_statement = $db->prepare($sql);
-		$prep_statement->execute();
-		$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-		unset ($prep_statement, $sql);
-
-	//find the missing default settings
-		$i = 0;
-		foreach ($array as $setting) {
-			$found = false;
-			$missing[$i] = $setting;
-			foreach ($default_settings as $row) {
-				if (trim($row['default_setting_subcategory']) == trim($setting['default_setting_subcategory'])) {
-					$found = true;
-					//remove items from the array that were found
-					unset($missing[$i]);
-				}
-			}
-			$i++;
-		}
-
-	//get the missing count
-		$i = 0;
-		foreach ($missing as $row) { $i++; }
-		$missing_count = $i;
-
-	//add the missing default settings
-		$sql = "insert into v_default_settings (";
-		$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 .= ") values \n";
-		$i = 1;
-		foreach ($missing as $row) {
-			$sql .= "(";
-			$sql .= "'".uuid()."', ";
-			$sql .= "'".check_str($row['default_setting_category'])."', ";
-			$sql .= "'".check_str($row['default_setting_subcategory'])."', ";
-			$sql .= "'".check_str($row['default_setting_name'])."', ";
-			$sql .= "'".check_str($row['default_setting_value'])."', ";
-			$sql .= "'".check_str($row['default_setting_enabled'])."', ";
-			$sql .= "'".check_str($row['default_setting_description'])."' ";
-			$sql .= ")";
-			if ($missing_count != $i) { 
-				$sql .= ",\n";
-			}
-			$i++;
-		}
-		$db->exec(check_sql($sql));
-		unset($missing);
-
-	//unset the array variable
-		unset($array);
-}
-
+<?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]>
+*/
+
+if ($domains_processed == 1) {
+
+	//get the background images
+		$relative_path = PROJECT_PATH.'/themes/default/images/backgrounds';
+		$backgrounds = opendir($_SERVER["DOCUMENT_ROOT"].'/'.$relative_path);
+		unset($array);
+		$x = 0;
+		while (false !== ($file = readdir($backgrounds))) {
+			if ($file != "." AND $file != ".."){
+				$ext = pathinfo($file, PATHINFO_EXTENSION);
+				if ($ext == "png" || $ext == "jpg" || $ext == "jpeg" || $ext == "gif") {
+					$array[$x]['default_setting_category'] = 'theme';
+					$array[$x]['default_setting_subcategory'] = 'background_image';
+					$array[$x]['default_setting_name'] = 'array';
+					$array[$x]['default_setting_value'] = $relative_path.'/'.$file;
+					$array[$x]['default_setting_enabled'] = 'false';
+					$array[$x]['default_setting_description'] = 'Set a relative path or URL within a selected compatible template.';
+					$x++;
+					$array[$x]['default_setting_category'] = 'theme';
+					$array[$x]['default_setting_subcategory'] = 'login_background_image';
+					$array[$x]['default_setting_name'] = 'array';
+					$array[$x]['default_setting_value'] = $relative_path.'/'.$file;
+					$array[$x]['default_setting_enabled'] = 'false';
+					$array[$x]['default_setting_description'] = 'Set a relative path or URL within a selected compatible template.';
+					$x++;
+				}
+				if ($x > 300) { break; };
+			}
+		}
+
+	//define array of settings
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'background_color';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = '#6c89b5';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_order'] = '0';
+		$array[$x]['default_setting_description'] = 'Set a background color.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'background_color';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = '#144794';
+		$array[$x]['default_setting_order'] = '1';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set a secondary background color, for a gradient effect.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'domain_visible';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'true';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the visibility of the name of the domain currently being managed.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'logout_icon_visible';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'false';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the visibility of the logout icon.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'domain_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#69e5ff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text color (and opacity) for domain name.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'footer_background_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'rgba(0,0,0,0.1)';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) for the footer bar.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'footer_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'rgba(255,255,255,0.1)';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text color (and opacity) for the footer bar.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'footer_border_radius';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '0 0 4px 4px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border radius of the footer bar.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'message_default_background_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ccffcc';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the background color for the positive (default) message bar.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'message_default_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#004200';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the text color for the positive (default) message bar text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'message_negative_background_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffcdcd';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the background color for the negative message bar.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'message_negative_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#670000';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the text color for the negative message bar text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'message_alert_background_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffe585';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the background color for the alert message bar.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'message_alert_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#d66721';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the text color for the alert message bar text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'message_opacity';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '0.9';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the opacity of the message bar (decimal).';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'message_delay';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '1.75';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the hide delay of the message bar (seconds).';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'background_image_enabled';
+		$array[$x]['default_setting_name'] = 'boolean';
+		$array[$x]['default_setting_value'] = 'true';
+		$array[$x]['default_setting_enabled'] = 'false';
+		if ($background_image_enabled) { $array[$x]['default_setting_enabled'] = 'true'; }
+		$array[$x]['default_setting_description'] = 'Enable use of background images.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'body_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set then body background color (and opacity) of the content.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'body_shadow_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#000000';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of the body.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'body_border_radius';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '4px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border radius of the body.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'cache';
+		$array[$x]['default_setting_name'] = 'boolean';
+		$array[$x]['default_setting_value'] = 'false';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set whether to cache the theme in the session.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'domain_selector_shadow_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#888888';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the shadow color (and opacity) of the domain selector pane.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'logo_align';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'center';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the alignment of the header logo (Inline menu only)';
+		$x++;
+		/* menu elements */
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_main_background_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ff0000';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set a background color (and opacity) of the main menu bar.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_main_background_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ff0000';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set a background hover color (and opacity) of the main menu items.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_main_icons';
+		$array[$x]['default_setting_name'] = 'boolean';
+		$array[$x]['default_setting_value'] = 'false';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Show icons next to main menu items.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_main_background_image';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '/themes/default/images/background_black.png';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set a background image for the main menu bar.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_main_shadow_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#000000';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the shadow color (and opacity) of the main menu bar.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_main_text_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text color of the main menu items.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_main_text_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#69e5ff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text hover color of the main menu items.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_main_text_font';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'Arial';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the font of the main menu items.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_main_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '10.25pt';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text size of the main menu items.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_main_border_radius';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '0 0 4px 4px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border radius of the main menu.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_main_border_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '1px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border size of the main menu.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_main_border_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border color (and opacity) of the main menu.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_position';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'top';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the position of the main menu (Fixed menu only).';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_style';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'fixed';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the style of the main menu.';
+		$x++;
+		/* sub menu items */
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_sub_background_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of the sub menus.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_sub_background_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the hover background color (and opacity) of the sub menu items.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_sub_icons';
+		$array[$x]['default_setting_name'] = 'boolean';
+		$array[$x]['default_setting_value'] = 'false';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Show indicator icons next to selected sub menu items.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_sub_shadow_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#000000';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the shadow color (and opacity) of sub menus.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_sub_text_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text color (and opacity) of sub menu items.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_sub_text_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#69e5ff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the hover text color (and opacity) of sub menu items.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_sub_text_font';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'Arial';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the font of the sub menu items.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_sub_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '10pt';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text size of the sub menu items.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_sub_border_radius';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '0 0 4px 4px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border radius of the sub menu.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_sub_border_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '1px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border size of the sub menu.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_sub_border_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border color (and opacity) of the sub menu.';
+		$x++;
+		/* body elements */
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'heading_text_font';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'arial';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the font of the page heading text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'heading_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '15px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the size of the page heading text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'heading_text_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#952424';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of the page heading text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'body_text_font';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'arial';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the font of body text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'body_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '12px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the size of the body text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'body_text_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#5f5f5f';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of the body text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'text_link_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#004083';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the link color (and opacity) of text links outside tables.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'text_link_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#5082ca';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the hover color (and opacity) of text links outside tables.';
+		$x++;
+		/* data tables */
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'table_heading_text_font';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'arial';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text font of table header rows.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'table_heading_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '12px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text size of table header rows.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'table_heading_text_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#3164ad';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text color (and opacity) of table header rows.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'table_heading_background_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of table header rows.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'table_heading_border_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#a4aebf';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the bottom border color (and opacity) of table header rows.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'table_row_text_font';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'arial';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text font of table data rows.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'table_row_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '12px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text size of table data rows.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'table_row_text_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#000';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text color (and opacity) of table data rows.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'table_row_background_color_dark';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#e5e9f0';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the darker background color (and opacity) of table data rows.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'table_row_background_color_medium';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#f0f2f6';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the medium background color (and opacity) of table data rows.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'table_row_background_color_light';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#fff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the lighter background color (and opacity) of table data rows.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'table_row_border_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#c5d1e5';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the bottom border (dividing line) color (and opacity) of table data rows.';
+		/* dashboard elements */
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_border_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#dbe0ea';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border color (and opacity) of the Dashboard blocks.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_border_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#cbd3e1';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border hover color (and opacity) of the Dashboard block.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_border_radius';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '5px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border radius of the Dashboard block.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_heading_background_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#8e96a5';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of the Dashboard block heading.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_heading_background_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#969dab';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background hover color (and opacity) of the Dashboard block heading.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_heading_text_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of the Dashboard block heading text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_heading_text_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the hover color (and opacity) of the Dashboard block heading text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_heading_text_font';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the font of the Dashboard block heading text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_heading_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '10.5pt';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the size of the Dashboard block heading text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_heading_text_shadow_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#000000';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the shadow color (and opacity) of the Dashboard block heading text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_heading_text_shadow_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#000000';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the shadow hover color (and opacity) of the Dashboard block heading text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_number_background_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#a4aebf';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of the Dashboard block number.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_number_background_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#aeb7c5';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background hover color (and opacity) of the Dashboard block number.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_number_text_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of the Dashboard block number.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_number_text_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the hover color (and opacity) of the Dashboard block number.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_number_text_font';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the font of the Dashboard block number.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_number_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '60pt';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the size of the Dashboard block number.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_number_text_shadow_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#737983';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the shadow color (and opacity) of the Dashboard block number.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_number_text_shadow_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#737983';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the shadow hover color (and opacity) of the Dashboard block number.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_number_title_text_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of the Dashboard block number title.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_number_title_text_font';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the font of the Dashboard block number title.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_number_title_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '14px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the size of the Dashboard block number title.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_number_title_text_shadow_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#737983';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the shadow color (and opacity) of the Dashboard block number title.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_detail_heading_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '11px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the size of the Dashboard block detail header text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_detail_row_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '11px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the size of the Dashboard block detail row text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_detail_shadow_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#737983';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the shadow color of the Dashboard block detail box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_detail_background_color_center';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#f9fbfe';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the center gradient color of the Dashboard block detail area.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_detail_background_color_edge';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#edf1f7';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the edge gradient color of the Dashboard block detail area.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_footer_background_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#e5e9f0';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of the Dashboard block footer bar.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_footer_background_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ebeef3';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background hover color (and opacity) of the Dashboard block footer bar.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_footer_dots_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#a4aebf';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of the Dashboard block footer bar dots.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'dashboard_footer_dots_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#a4aebf';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the hover color (and opacity) of the Dashboard block footer bar dots.';
+		$x++;
+		/* form table elements */
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_label_padding';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '7px 8px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the padding of the form label cell.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_label_background_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#e5e9f0';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of the form label cell.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_label_border_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the bottom-border color (and opacity) of the form label cell.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_label_border_radius';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '4px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border radius of the form label cell.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_label_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '9pt';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text size of the form label.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_label_text_font';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'Arial';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text font of the form label.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_label_text_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#000000';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text color (and opacity) of the form label.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_label_required_background_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#e5e9f0';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background color of the required form label cell.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_label_required_border_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#cbcfd5';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the right-border color (and opacity) of the required form label cell.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_label_required_text_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#000000';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text color (and opacity) of the required form label.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_label_required_text_weight';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'bold';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the text weight of the required form label.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_field_padding';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '6px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the padding of the form field cell.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_field_background_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of the form field cell.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_field_border_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#e5e9f0';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the bottom-border color (and opacity) of the form field cell.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_field_border_radius';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '0';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border radius of the form label cell.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_field_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '8pt';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the size of text in the form field cell.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_field_text_font';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'Arial';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the font of text in the form field cell.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_field_text_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#666666';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of text in the form field cell.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_heading_padding';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '8px 8px 4px 8px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the padding of form column headings.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_row_padding';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '3px 0';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the padding of form row cells.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'form_table_row_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '9pt';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the size of text in the form rows.';
+		$x++;
+		/* login box */
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_background_color';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = '#6c89b5';
+		$array[$x]['default_setting_order'] = '0';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background color of the login page.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_background_color';
+		$array[$x]['default_setting_name'] = 'array';
+		$array[$x]['default_setting_value'] = '#144794';
+		$array[$x]['default_setting_order'] = '1';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set a secondary background color of the login page, for a gradient effect.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_background_image_enabled';
+		$array[$x]['default_setting_name'] = 'boolean';
+		$array[$x]['default_setting_value'] = 'true';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Enable use of background images on the login page.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_body_background_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'rgba(255,255,255,0.3)';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the background color for the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_body_shadow_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'rgba(140,140,140,0.3)';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the shadow color of the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_body_padding';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '30px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the padding of the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_body_width';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '100%';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the width of the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_body_border_radius';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '4px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border radius of the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_body_border_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '1px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border size of the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_body_border_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border color (and opacity) of the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_link_text_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#004083';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of text links on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_link_text_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#5082ca';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the hover color (and opacity) of text links on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_link_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '11px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the size of text links on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_link_text_font';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'Arial';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the font of text links on the login box.';
+		$x++;
+		/* buttons */
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'button_background_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#4f4f4f';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background main/top color (and opacity) of buttons.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'button_background_color_bottom';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#000000';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background bottom color (and opacity) of buttons.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'button_background_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#000000';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background main/top hover color (and opacity) of buttons.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'button_background_color_bottom_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#000000';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background bottom hover color (and opacity) of buttons.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'button_border_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '1px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border size of buttons.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'button_border_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#242424';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border color (and opacity) of buttons.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'button_border_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#000000';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border hover color (and opacity) of buttons.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'button_border_radius';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '3px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border radius of buttons.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'button_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '11px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the size of button text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'button_text_font';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'Candara, Calibri, Segoe, "Segoe UI", Optima, Arial, sans-serif';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the font of button text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'button_text_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of button text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'button_text_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the hover color (and opacity) of button text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'button_text_weight';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'bold';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the weight of button text.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'button_padding';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '5px 8px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the padding of buttons.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'button_height';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '28px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the height of buttons.';
+		$x++;
+		/* form input fields */
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'input_background_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of text inputs.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'input_border_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#c0c0c0';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border color (and opacity) of text inputs.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'input_border_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#c0c0c0';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border hover color (and opacity) of text inputs.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'input_border_color_focus';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#c0c0c0';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border focus color (and opacity) of text inputs.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'input_border_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '1px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border size of text inputs.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'input_border_radius';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '3px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border radius of text inputs.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'input_shadow_inner_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#cddaf0';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the inner shadow color (and opacity) of text inputs.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'input_shadow_inner_color_focus';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the inner focus shadow color (and opacity) of text inputs.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'input_shadow_outer_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the outer shadow color (and opacity) of text inputs.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'input_shadow_outer_color_focus';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#cddaf0';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the outer focus shadow color (and opacity) of text inputs.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'input_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '12px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the size of text input content.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'input_text_font';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'Arial';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the font of text input content.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'input_text_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#000000';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of text input content.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'input_text_placeholder_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#999999';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of input placeholder text.';
+		$x++;
+		/* login form input fields */
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_input_background_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the background color (and opacity) of text inputs on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_input_border_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#c0c0c0';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border color (and opacity) of text inputs on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_input_border_color_hover';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#c0c0c0';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border hover color (and opacity) of text inputs on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_input_border_color_focus';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#c0c0c0';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border focus color (and opacity) of text inputs on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_input_border_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '1px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border size of text inputs on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_input_border_radius';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '3px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the border radius of text inputs on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_input_shadow_inner_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#cddaf0';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the inner shadow color (and opacity) of text inputs on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_input_shadow_inner_color_focus';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the inner focus shadow color (and opacity) of text inputs on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_input_shadow_outer_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#ffffff';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the outer shadow color (and opacity) of text inputs on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_input_shadow_outer_color_focus';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#cddaf0';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the outer focus shadow color (and opacity) of text inputs on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_input_text_size';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '12px';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the size of text input content on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_input_text_font';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = 'Arial';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the font of text input content on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_input_text_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#000000';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of text input content on the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_input_text_placeholder_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#999999';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the color (and opacity) of input placeholder text on the login box.';
+		$x++;
+
+	//get an array of the default settings
+		$sql = "select * from v_default_settings ";
+		$sql .= "where default_setting_category = 'theme' ";
+		$prep_statement = $db->prepare($sql);
+		$prep_statement->execute();
+		$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+		unset ($prep_statement, $sql);
+
+	//find the missing default settings
+		$i = 0;
+		foreach ($array as $setting) {
+			$found = false;
+			$missing[$i] = $setting;
+			foreach ($default_settings as $row) {
+				if (trim($row['default_setting_subcategory']) == trim($setting['default_setting_subcategory'])) {
+					$found = true;
+					//remove items from the array that were found
+					unset($missing[$i]);
+				}
+			}
+			$i++;
+		}
+
+	//get the missing count
+		$i = 0;
+		foreach ($missing as $row) { $i++; }
+		$missing_count = $i;
+
+	//add the missing default settings
+		$sql = "insert into v_default_settings (";
+		$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 .= ") values \n";
+		$i = 1;
+		foreach ($missing as $row) {
+			$sql .= "(";
+			$sql .= "'".uuid()."', ";
+			$sql .= "'".check_str($row['default_setting_category'])."', ";
+			$sql .= "'".check_str($row['default_setting_subcategory'])."', ";
+			$sql .= "'".check_str($row['default_setting_name'])."', ";
+			$sql .= "'".check_str($row['default_setting_value'])."', ";
+			$sql .= "'".check_str($row['default_setting_enabled'])."', ";
+			$sql .= "'".check_str($row['default_setting_description'])."' ";
+			$sql .= ")";
+			if ($missing_count != $i) { 
+				$sql .= ",\n";
+			}
+			$i++;
+		}
+		$db->exec(check_sql($sql));
+		unset($missing);
+
+	//unset the array variable
+		unset($array);
+}
+
 ?>