diff --git a/app/settings/setting_edit.php b/app/settings/setting_edit.php
index d3818d392f..1550e22cb1 100644
--- a/app/settings/setting_edit.php
+++ b/app/settings/setting_edit.php
@@ -36,10 +36,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//get the number of rows in v_extensions
$sql = " select count(*) as num_rows from v_settings ";
diff --git a/app/sip_profiles/sip_profile_copy.php b/app/sip_profiles/sip_profile_copy.php
index 167194444c..f317ddd977 100644
--- a/app/sip_profiles/sip_profile_copy.php
+++ b/app/sip_profiles/sip_profile_copy.php
@@ -39,10 +39,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//set the http get/post variable(s) to a php variable
if (isset($_REQUEST["id"])) {
diff --git a/app/sip_profiles/sip_profile_delete.php b/app/sip_profiles/sip_profile_delete.php
index 547d8537e9..70f2eb89f7 100644
--- a/app/sip_profiles/sip_profile_delete.php
+++ b/app/sip_profiles/sip_profile_delete.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
diff --git a/app/sip_profiles/sip_profile_edit.php b/app/sip_profiles/sip_profile_edit.php
index 700fc2eb79..a9eaf3b0b2 100644
--- a/app/sip_profiles/sip_profile_edit.php
+++ b/app/sip_profiles/sip_profile_edit.php
@@ -36,10 +36,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//action add or update
if (isset($_REQUEST["id"])) {
diff --git a/app/sip_profiles/sip_profile_setting_delete.php b/app/sip_profiles/sip_profile_setting_delete.php
index 1751045aad..2a660cfca0 100644
--- a/app/sip_profiles/sip_profile_setting_delete.php
+++ b/app/sip_profiles/sip_profile_setting_delete.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
diff --git a/app/sip_profiles/sip_profile_setting_edit.php b/app/sip_profiles/sip_profile_setting_edit.php
index 87c32dd0cf..d478eac390 100644
--- a/app/sip_profiles/sip_profile_setting_edit.php
+++ b/app/sip_profiles/sip_profile_setting_edit.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//action add or update
if (isset($_REQUEST["id"])) {
diff --git a/app/sip_profiles/sip_profiles.php b/app/sip_profiles/sip_profiles.php
index 7ddcddd8f7..81c3cb4a17 100644
--- a/app/sip_profiles/sip_profiles.php
+++ b/app/sip_profiles/sip_profiles.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
require_once "resources/header.php";
$document['title'] = $text['title-sip_profiles'];
diff --git a/app/sip_status/sip_status.php b/app/sip_status/sip_status.php
index 13e6ec584f..96e3fd13ec 100644
--- a/app/sip_status/sip_status.php
+++ b/app/sip_status/sip_status.php
@@ -38,10 +38,8 @@ else {
exit;
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//define variables
$c = 0;
diff --git a/app/sql_query/sql_backup.php b/app/sql_query/sql_backup.php
index 8f1640f44f..d213c8f91d 100644
--- a/app/sql_query/sql_backup.php
+++ b/app/sql_query/sql_backup.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//pdo database connection
if (strlen($_REQUEST['id']) > 0) {
@@ -81,7 +79,7 @@ else {
}
return $result;
}
-
+
//set the headers
header('Content-type: application/octet-binary');
header('Content-Disposition: attachment; filename=database_backup.sql');
diff --git a/app/sql_query/sql_db_conversion.php b/app/sql_query/sql_db_conversion.php
index d76c2b0a91..6863d78f53 100644
--- a/app/sql_query/sql_db_conversion.php
+++ b/app/sql_query/sql_db_conversion.php
@@ -37,10 +37,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//show errors
ini_set('display_errors', '1');
diff --git a/app/sql_query/sql_query.php b/app/sql_query/sql_query.php
index ec4ee53148..45f08dd28f 100644
--- a/app/sql_query/sql_query.php
+++ b/app/sql_query/sql_query.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//show the header
require_once "resources/header.php";
diff --git a/app/sql_query/sql_query_db.php b/app/sql_query/sql_query_db.php
index 17b2300c26..3cf284e4de 100644
--- a/app/sql_query/sql_query_db.php
+++ b/app/sql_query/sql_query_db.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
require_once "resources/header.php";
$document['title'] = $text['title-databases'];
diff --git a/app/sql_query/sql_query_result.php b/app/sql_query/sql_query_result.php
index 46e62605df..a7dfbc9ee9 100644
--- a/app/sql_query/sql_query_result.php
+++ b/app/sql_query/sql_query_result.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//pdo database connection
if (strlen($_REQUEST['id']) > 0) {
diff --git a/app/system/system.php b/app/system/system.php
index 8e4f3ea0ea..960b37c07d 100644
--- a/app/system/system.php
+++ b/app/system/system.php
@@ -39,10 +39,9 @@ else {
exit;
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
+
require_once "resources/header.php";
echo "
";
diff --git a/app/time_conditions/time_condition_add.php b/app/time_conditions/time_condition_add.php
index 8aed56b671..27dd0cb8df 100644
--- a/app/time_conditions/time_condition_add.php
+++ b/app/time_conditions/time_condition_add.php
@@ -37,10 +37,8 @@ require_once "resources/header.php";
require_once "resources/paging.php";
//add multi-lingual support
-require_once "app_languages.php";
-foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
-}
+ $language = new text;
+ $text = $language->get();
//set the variables
$order_by = check_str($_GET["order_by"]);
diff --git a/app/traffic_graph/status_graph.php b/app/traffic_graph/status_graph.php
index 403b6edf29..ac9daf5847 100644
--- a/app/traffic_graph/status_graph.php
+++ b/app/traffic_graph/status_graph.php
@@ -44,10 +44,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
if ($_REQUEST['interface']) {
$interface = $_REQUEST['interface'];
diff --git a/app/vars/var_delete.php b/app/vars/var_delete.php
index e47c76bfb8..0cf585f2da 100644
--- a/app/vars/var_delete.php
+++ b/app/vars/var_delete.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//get the id
if (count($_GET) > 0) {
diff --git a/app/vars/var_edit.php b/app/vars/var_edit.php
index 95b341a552..9f72343b5a 100644
--- a/app/vars/var_edit.php
+++ b/app/vars/var_edit.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//set the action as an add or an update
if (isset($_REQUEST["id"])) {
diff --git a/app/vars/vars.php b/app/vars/vars.php
index 764680f92e..b6eef31c0f 100644
--- a/app/vars/vars.php
+++ b/app/vars/vars.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//include the header
require_once "resources/header.php";
diff --git a/app/vars/vars_textarea.php b/app/vars/vars_textarea.php
index cc849aa95a..872b595155 100644
--- a/app/vars/vars_textarea.php
+++ b/app/vars/vars_textarea.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//include the header
require_once "resources/header.php";
diff --git a/app/voicemail_greetings/voicemail_greeting_delete.php b/app/voicemail_greetings/voicemail_greeting_delete.php
index e33827604a..20e206f5e8 100644
--- a/app/voicemail_greetings/voicemail_greeting_delete.php
+++ b/app/voicemail_greetings/voicemail_greeting_delete.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
diff --git a/app/voicemail_greetings/voicemail_greeting_edit.php b/app/voicemail_greetings/voicemail_greeting_edit.php
index 3d3b3f60ec..1e476e1a09 100644
--- a/app/voicemail_greetings/voicemail_greeting_edit.php
+++ b/app/voicemail_greetings/voicemail_greeting_edit.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//set the action as an add or an update
if (isset($_REQUEST["id"])) {
diff --git a/app/voicemail_greetings/voicemail_greetings.php b/app/voicemail_greetings/voicemail_greetings.php
index 2a19b52bd8..2b5f5b4915 100644
--- a/app/voicemail_greetings/voicemail_greetings.php
+++ b/app/voicemail_greetings/voicemail_greetings.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//additional includes
require_once "resources/paging.php";
diff --git a/app/voicemails/voicemail_delete.php b/app/voicemails/voicemail_delete.php
index 3f9917b843..96d0e61857 100644
--- a/app/voicemails/voicemail_delete.php
+++ b/app/voicemails/voicemail_delete.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//get the id
if (count($_GET)>0) {
diff --git a/app/voicemails/voicemail_edit.php b/app/voicemails/voicemail_edit.php
index 65162dd20f..4246b4c13d 100644
--- a/app/voicemails/voicemail_edit.php
+++ b/app/voicemails/voicemail_edit.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//action add or update
if (isset($_REQUEST["id"])) {
@@ -90,7 +88,7 @@ else {
$voicemail_uuid_copy = check_str($_REQUEST["voicemail_uuid_copy"]);
//assign the user to the extension
$sqli = "
- insert into
+ insert into
v_voicemail_destinations
(
domain_uuid,
diff --git a/app/voicemails/voicemail_message_delete.php b/app/voicemails/voicemail_message_delete.php
index 682822902a..31e063704d 100644
--- a/app/voicemails/voicemail_message_delete.php
+++ b/app/voicemails/voicemail_message_delete.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//get the HTTP values and set them as variables
if (count($_GET)>0) {
diff --git a/app/voicemails/voicemail_message_edit.php b/app/voicemails/voicemail_message_edit.php
index a1b0adf2d5..7679efba26 100644
--- a/app/voicemails/voicemail_message_edit.php
+++ b/app/voicemails/voicemail_message_edit.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//action add or update
if (isset($_REQUEST["id"])) {
diff --git a/app/voicemails/voicemail_messages.php b/app/voicemails/voicemail_messages.php
index 91f937f278..a534c5c0fa 100644
--- a/app/voicemails/voicemail_messages.php
+++ b/app/voicemails/voicemail_messages.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//set the voicemail_uuid
if (strlen($_REQUEST["id"]) > 0) {
diff --git a/app/voicemails/voicemails.php b/app/voicemails/voicemails.php
index 472ab72da1..c8f165c4cb 100644
--- a/app/voicemails/voicemails.php
+++ b/app/voicemails/voicemails.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//set the voicemail_id array
foreach ($_SESSION['user']['extension'] as $row) {
diff --git a/app/xml_cdr/xml_cdr.php b/app/xml_cdr/xml_cdr.php
index 9e24feed90..31e6496841 100644
--- a/app/xml_cdr/xml_cdr.php
+++ b/app/xml_cdr/xml_cdr.php
@@ -37,10 +37,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//import xml_cdr files
require_once "v_xml_cdr_import.php";
diff --git a/app/xml_cdr/xml_cdr_details.php b/app/xml_cdr/xml_cdr_details.php
index 0c916443c8..0822ca128d 100644
--- a/app/xml_cdr/xml_cdr_details.php
+++ b/app/xml_cdr/xml_cdr_details.php
@@ -36,10 +36,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//get the http values and set them to a variable
if (strlen($_REQUEST["uuid"]) > 0) {
diff --git a/app/xml_cdr/xml_cdr_export.php b/app/xml_cdr/xml_cdr_export.php
index 2b854345cd..e8b23e088c 100644
--- a/app/xml_cdr/xml_cdr_export.php
+++ b/app/xml_cdr/xml_cdr_export.php
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//additional includes
$rows_per_page = 0;
diff --git a/app/xml_cdr/xml_cdr_extension_summary.php b/app/xml_cdr/xml_cdr_extension_summary.php
index 84563568b2..2d384c2de3 100644
--- a/app/xml_cdr/xml_cdr_extension_summary.php
+++ b/app/xml_cdr/xml_cdr_extension_summary.php
@@ -117,7 +117,7 @@ require_once "resources/require.php";
}
if ($row['hangup_cause'] == "NO_ANSWER") {
$summary[$row['destination_number']]['no_answer']++;
- }
+ }
if ($row['hangup_cause'] == "USER_BUSY") {
$summary[$row['destination_number']]['busy']++;
}
@@ -126,10 +126,8 @@ require_once "resources/require.php";
unset ($sql, $prep_statement, $result, $row_count);
//add multi-lingual support
- require_once "app_languages.php";
- foreach($text as $key => $value) {
- $text[$key] = $value[$_SESSION['domain']['language']['code']];
- }
+ $language = new text;
+ $text = $language->get();
//additional includes
require_once "resources/header.php";
@@ -228,7 +226,7 @@ require_once "resources/require.php";
echo "