From a446a9aee1f3f574a84166759c1ad12002afdb14 Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Tue, 14 May 2013 05:34:04 +0000 Subject: [PATCH] Mutlilinguified Default Settings and Domain Settings. --- core/default_settings/app_languages.php | 116 +++++++++++++ .../default_setting_delete.php | 8 +- .../default_settings/default_setting_edit.php | 111 +++++++----- core/default_settings/default_settings.php | 37 ++-- core/domain_settings/app_languages.php | 162 ++++++++++++++++++ core/domain_settings/domain_settings.php | 25 +-- .../domain_settings_delete.php | 8 +- core/domain_settings/domain_settings_edit.php | 94 ++++++---- core/domain_settings/domains.php | 32 ++-- core/domain_settings/domains_delete.php | 12 +- core/domain_settings/domains_edit.php | 51 ++++-- 11 files changed, 518 insertions(+), 138 deletions(-) create mode 100644 core/default_settings/app_languages.php create mode 100644 core/domain_settings/app_languages.php diff --git a/core/default_settings/app_languages.php b/core/default_settings/app_languages.php new file mode 100644 index 0000000000..1a8afd7f9e --- /dev/null +++ b/core/default_settings/app_languages.php @@ -0,0 +1,116 @@ + \ No newline at end of file diff --git a/core/default_settings/default_setting_delete.php b/core/default_settings/default_setting_delete.php index e8ef0e5ca5..a917cd9249 100644 --- a/core/default_settings/default_setting_delete.php +++ b/core/default_settings/default_setting_delete.php @@ -34,6 +34,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + if (count($_GET)>0) { $id = check_str($_GET["id"]); } @@ -51,7 +57,7 @@ if (strlen($id)>0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Delete Complete\n"; + echo $text['message-delete']."\n"; echo "
\n"; require_once "includes/footer.php"; return; diff --git a/core/default_settings/default_setting_edit.php b/core/default_settings/default_setting_edit.php index 7f6ef81291..c5775ef6c2 100644 --- a/core/default_settings/default_setting_edit.php +++ b/core/default_settings/default_setting_edit.php @@ -34,6 +34,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + //action add or update if (isset($_REQUEST["id"])) { $action = "update"; @@ -61,12 +67,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { } //check for all required data - //if (strlen($default_setting_category) == 0) { $msg .= "Please provide: Category
\n"; } - //if (strlen($default_setting_subcategory) == 0) { $msg .= "Please provide: Subcategory
\n"; } - //if (strlen($default_setting_name) == 0) { $msg .= "Please provide: Type
\n"; } - //if (strlen($default_setting_value) == 0) { $msg .= "Please provide: Value
\n"; } - //if (strlen($default_setting_enabled) == 0) { $msg .= "Please provide: Enabled
\n"; } - //if (strlen($default_setting_description) == 0) { $msg .= "Please provide: Description
\n"; } + //if (strlen($default_setting_category) == 0) { $msg .= $text['message-required'].$text['label-category']."
\n"; } + //if (strlen($default_setting_subcategory) == 0) { $msg .= $text['message-required'].$text['label-subcategory']."
\n"; } + //if (strlen($default_setting_name) == 0) { $msg .= $text['message-required'].$text['label-type']."
\n"; } + //if (strlen($default_setting_value) == 0) { $msg .= $text['message-required'].$text['label-value']."
\n"; } + //if (strlen($default_setting_enabled) == 0) { $msg .= $text['message-required'].$text['label-enabled']."
\n"; } + //if (strlen($default_setting_description) == 0) { $msg .= $text['message-required'].$text['label-description']."
\n"; } if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; require_once "includes/persistformvar.php"; @@ -109,7 +115,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Add Complete\n"; + echo $text['message-add']."\n"; echo "
\n"; require_once "includes/footer.php"; return; @@ -130,12 +136,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Update Complete\n"; + echo $text['message-update']."\n"; echo "
\n"; require_once "includes/footer.php"; return; } //if ($action == "update") - } //if ($_POST["persistformvar"] != "true") + } //if ($_POST["persistformvar"] != "true") } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) //pre-populate the form @@ -160,6 +166,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //show the header require_once "includes/header.php"; + if ($action == "update") { + $page["title"] = $text['title-default_setting-edit']; + } + else if ($action == "add") { + $page["title"] = $text['title-default_setting-add']; + } //show the content echo "
"; @@ -173,55 +185,60 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; if ($action == "add") { - echo "\n"; + echo "\n"; } if ($action == "update") { - echo "\n"; + echo "\n"; } - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -400,7 +417,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update") { echo " \n"; } - echo " \n"; + echo " \n"; echo " \n"; echo " "; echo "
Default Setting Add".$text['header-default_setting-add']."Default Setting Edit".$text['header-default_setting-edit']."
\n"; - echo "Settings used for all domains.

\n"; + if ($action == "add") { + echo $text['description-default_setting-add']."

\n"; + } + if ($action == "update") { + echo $text['description-default_setting-edit']."

\n"; + } echo "
\n"; - echo " Category:\n"; + echo " ".$text['label-category'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the category.\n"; + echo $text['description-category']."\n"; echo "
\n"; - echo " Subcategory:\n"; + echo " ".$text['label-subcategory'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the subcategory.\n"; + echo $text['description-subcategory']."\n"; echo "
\n"; - echo " Name:\n"; + echo " ".$text['label-type'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the name.\n"; + echo $text['description-type']."\n"; echo "
\n"; - echo " Value:\n"; + echo " ".$text['label-value'].":\n"; echo "\n"; $category = $row['default_setting_category']; @@ -270,39 +287,39 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { } elseif ($category == "email" && $subcategory == "smtp_auth" && $name == "var" ) { echo " \n"; } elseif ($category == "email" && $subcategory == "smtp_secure" && $name == "var" ) { echo " \n"; } elseif ($category == "domain" && $subcategory == "time_zone" && $name == "name" ) { @@ -355,43 +372,43 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; } echo "
\n"; - echo "Enter the value.\n"; + echo $text['description-value']."\n"; echo "
\n"; - echo " Enabled:\n"; + echo " ".$text['label-enabled'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Choose to enable or disable the value.\n"; + echo $text['description-enabled']."\n"; echo "
\n"; - echo " Description:\n"; + echo " ".$text['label-description'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the description.\n"; + echo $text['description-description']."\n"; echo "
"; diff --git a/core/default_settings/default_settings.php b/core/default_settings/default_settings.php index 49610643a3..5c3e31dc39 100644 --- a/core/default_settings/default_settings.php +++ b/core/default_settings/default_settings.php @@ -33,7 +33,16 @@ else { echo "access denied"; exit; } + +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + require_once "includes/header.php"; +$page["title"] = $text['title-default_settings']; + require_once "includes/paging.php"; //get variables used to control the order @@ -49,12 +58,12 @@ require_once "includes/paging.php"; echo "\n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
Default Settings".$text['header-default_settings']." 
\n"; - echo " Settings used for all domains.

\n"; + echo " ".$text['description-default_settings']."

\n"; echo "
\n"; @@ -78,9 +87,9 @@ require_once "includes/paging.php"; $rows_per_page = 100; $param = ""; $page = $_GET['page']; - if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } - list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page); - $offset = $rows_per_page * $page; + if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } + list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page); + $offset = $rows_per_page * $page; //get the list $sql = "select * from v_default_settings "; @@ -112,14 +121,14 @@ require_once "includes/paging.php"; echo "
\n"; echo " ".ucfirst($row['default_setting_category'])." \n"; echo "\n"; - echo th_order_by('default_setting_subcategory', 'Category', $order_by, $order); - echo th_order_by('default_setting_name', 'Type', $order_by, $order); - echo th_order_by('default_setting_value', 'Value', $order_by, $order); - echo th_order_by('default_setting_enabled', 'Enabled', $order_by, $order); - echo th_order_by('default_setting_description', 'Description', $order_by, $order); + echo th_order_by('default_setting_subcategory', $text['label-subcategory'], $order_by, $order); + echo th_order_by('default_setting_name', $text['label-type'], $order_by, $order); + echo th_order_by('default_setting_value', $text['label-value'], $order_by, $order); + echo th_order_by('default_setting_enabled', $text['label-enabled'], $order_by, $order); + echo th_order_by('default_setting_description', $text['label-description'], $order_by, $order); echo "\n"; if (permission_exists('default_setting_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } else { echo "  \n"; @@ -159,10 +168,10 @@ require_once "includes/paging.php"; echo " ".$row['default_setting_description']." \n"; echo " \n"; if (permission_exists('default_setting_edit')) { - echo " $v_link_label_edit\n"; + echo " $v_link_label_edit\n"; } if (permission_exists('default_setting_delete')) { - echo " $v_link_label_delete\n"; + echo " $v_link_label_delete\n"; } echo " \n"; echo "\n"; @@ -180,7 +189,7 @@ require_once "includes/paging.php"; echo " $paging_controls\n"; echo " \n"; if (permission_exists('default_setting_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } else { echo "  \n"; diff --git a/core/domain_settings/app_languages.php b/core/domain_settings/app_languages.php new file mode 100644 index 0000000000..b2aca95076 --- /dev/null +++ b/core/domain_settings/app_languages.php @@ -0,0 +1,162 @@ + \ No newline at end of file diff --git a/core/domain_settings/domain_settings.php b/core/domain_settings/domain_settings.php index 48de3ff550..c6f94701aa 100644 --- a/core/domain_settings/domain_settings.php +++ b/core/domain_settings/domain_settings.php @@ -33,6 +33,7 @@ else { echo "access denied"; exit; } + require_once "includes/header.php"; require_once "includes/paging.php"; @@ -80,9 +81,9 @@ require_once "includes/paging.php"; $rows_per_page = 100; $param = ""; $page = $_GET['page']; - if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } - list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page); - $offset = $rows_per_page * $page; + if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } + list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page); + $offset = $rows_per_page * $page; //get the list $sql = "select * from v_domain_settings "; @@ -111,14 +112,14 @@ require_once "includes/paging.php"; echo "
\n"; echo " ".ucfirst($row['domain_setting_category'])." \n"; echo "\n"; - echo th_order_by('domain_setting_subcategory', 'Category', $order_by, $order); - echo th_order_by('domain_setting_name', 'Type', $order_by, $order); - echo th_order_by('domain_setting_value', 'Value', $order_by, $order); - echo th_order_by('domain_setting_enabled', 'Enabled', $order_by, $order); - echo th_order_by('domain_setting_description', 'Description', $order_by, $order); + echo th_order_by('domain_setting_subcategory', $text['label-category'], $order_by, $order); + echo th_order_by('domain_setting_name', $text['label-type'], $order_by, $order); + echo th_order_by('domain_setting_value', $text['label-value'], $order_by, $order); + echo th_order_by('domain_setting_enabled', $text['label-enabled'], $order_by, $order); + echo th_order_by('domain_setting_description', $text['label-description'], $order_by, $order); echo "\n"; if (permission_exists('domain_setting_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } else { echo "  \n"; @@ -160,10 +161,10 @@ require_once "includes/paging.php"; echo " ".$row['domain_setting_description']." \n"; echo " \n"; if (permission_exists('domain_setting_edit')) { - echo " $v_link_label_edit\n"; + echo " $v_link_label_edit\n"; } if (permission_exists('domain_setting_delete')) { - echo " $v_link_label_delete\n"; + echo " $v_link_label_delete\n"; } echo " \n"; echo "\n"; @@ -181,7 +182,7 @@ require_once "includes/paging.php"; echo " $paging_controls\n"; echo " \n"; if (permission_exists('domain_setting_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } else { echo "  \n"; diff --git a/core/domain_settings/domain_settings_delete.php b/core/domain_settings/domain_settings_delete.php index 82a3d81ac7..b050381eda 100644 --- a/core/domain_settings/domain_settings_delete.php +++ b/core/domain_settings/domain_settings_delete.php @@ -34,6 +34,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + if (count($_GET)>0) { $id = check_str($_GET["id"]); $domain_uuid = check_str($_GET["domain_uuid"]); @@ -53,7 +59,7 @@ if (strlen($id)>0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Delete Complete\n"; + echo $text['message-delete']."\n"; echo "
\n"; require_once "includes/footer.php"; return; diff --git a/core/domain_settings/domain_settings_edit.php b/core/domain_settings/domain_settings_edit.php index aa06198c3c..35d9737c64 100644 --- a/core/domain_settings/domain_settings_edit.php +++ b/core/domain_settings/domain_settings_edit.php @@ -34,6 +34,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + //action add or update if (isset($_REQUEST["id"])) { $action = "update"; @@ -54,7 +60,7 @@ if (strlen($_GET["domain_uuid"]) > 0) { $domain_setting_name = check_str($_POST["domain_setting_name"]); $domain_setting_value = check_str($_POST["domain_setting_value"]); $domain_setting_enabled = check_str($_POST["domain_setting_enabled"]); - $domain_setting_description = check_str($_POST["domain_setting_description"]); + $domain_setting_description = check_str($_POST["domain_setting_description"]); } if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { @@ -65,13 +71,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { } //check for all required data - //if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid
\n"; } - //if (strlen($domain_setting_category) == 0) { $msg .= "Please provide: Category
\n"; } - //if (strlen($domain_setting_subcategory) == 0) { $msg .= "Please provide: Subcategory
\n"; } - //if (strlen($domain_setting_name) == 0) { $msg .= "Please provide: Type
\n"; } - //if (strlen($domain_setting_value) == 0) { $msg .= "Please provide: Value
\n"; } - //if (strlen($domain_setting_enabled) == 0) { $msg .= "Please provide: Enabled
\n"; } - //if (strlen($domain_setting_description) == 0) { $msg .= "Please provide: Description
\n"; } + //if (strlen($domain_setting_category) == 0) { $msg .= $text['message-required'].$text['label-category']."
\n"; } + //if (strlen($domain_setting_subcategory) == 0) { $msg .= $text['message-required'].$text['label-subcategory']."
\n"; } + //if (strlen($domain_setting_name) == 0) { $msg .= $text['message-required'].$text['label-type']."
\n"; } + //if (strlen($domain_setting_value) == 0) { $msg .= $text['message-required'].$text['label-value']."
\n"; } + //if (strlen($domain_setting_enabled) == 0) { $msg .= $text['message-required'].$text['label-enabled']."
\n"; } + //if (strlen($domain_setting_description) == 0) { $msg .= $text['message-required'].$text['label-description']."
\n"; } if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; require_once "includes/persistformvar.php"; @@ -97,7 +102,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "domain_setting_name, "; $sql .= "domain_setting_value, "; $sql .= "domain_setting_enabled, "; - $sql .= "domain_setting_description "; + $sql .= "domain_setting_description "; $sql .= ")"; $sql .= "values "; $sql .= "("; @@ -116,7 +121,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Add Complete\n"; + echo $text['message-add']."\n"; echo "
\n"; require_once "includes/footer.php"; return; @@ -129,7 +134,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "domain_setting_name = '$domain_setting_name', "; $sql .= "domain_setting_value = '$domain_setting_value', "; $sql .= "domain_setting_enabled = '$domain_setting_enabled', "; - $sql .= "domain_setting_description = '$domain_setting_description' "; + $sql .= "domain_setting_description = '$domain_setting_description' "; $sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "and domain_setting_uuid = '$domain_setting_uuid'"; $db->exec(check_sql($sql)); @@ -138,12 +143,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Update Complete\n"; + echo $text['message-update']."\n"; echo "
\n"; require_once "includes/footer.php"; return; } //if ($action == "update") - } //if ($_POST["persistformvar"] != "true") + } //if ($_POST["persistformvar"] != "true") } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) //pre-populate the form @@ -169,6 +174,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //show the header require_once "includes/header.php"; + if ($action == "update") { + $page["title"] = $text['title-domain_setting-edit']; + } + if ($action == "add") { + $page["title"] = $text['title-domain_setting-add']; + } //show the content echo "
"; @@ -181,51 +192,64 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -354,7 +378,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update") { echo " \n"; } - echo " \n"; + echo " \n"; echo " \n"; echo " "; echo "
Domain Setting"; + if ($action == "update") { + echo $text['header-domain_setting-edit']; + } + if ($action == "add") { + echo $text['header-domain_setting-add']; + } + echo "
\n"; - echo "Settings used for each domain.

\n"; + if ($action == "update") { + echo $text['description-domain_setting-edit']; + } + if ($action == "add") { + echo $text['header-domain_setting-add']; + } + echo "

\n"; echo "
\n"; - echo " Category:\n"; + echo " ".$text['label-category'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the category.\n"; + echo $text['description-category']."\n"; echo "
\n"; - echo " Subcategory:\n"; + echo " ".$text['label-subcategory'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the subcategory.\n"; + echo $text['description-subcategory']."\n"; echo "
\n"; - echo " Type:\n"; + echo " ".$text['label-type'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the type.\n"; + echo $text['description-type']."\n"; echo "
\n"; - echo " Value:\n"; + echo " ".$text['label-value'].":\n"; echo "\n"; $category = $row['domain_setting_category']; @@ -308,43 +332,43 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; } echo "
\n"; - echo "Enter the value.\n"; + echo $text['description-value']."\n"; echo "
\n"; - echo " Enabled:\n"; + echo " ".$text['label-enabled'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Choose to enable or disable the value.\n"; + echo $text['description-enabled']."\n"; echo "
\n"; - echo " Description:\n"; + echo " ".$text['label-description'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the description.\n"; + echo $text['description-description']."\n"; echo "
"; diff --git a/core/domain_settings/domains.php b/core/domain_settings/domains.php index a2cba937b2..39094976b9 100644 --- a/core/domain_settings/domains.php +++ b/core/domain_settings/domains.php @@ -34,6 +34,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + //change the domain if (strlen(check_str($_GET["domain_uuid"])) > 0 && check_str($_GET["domain_change"]) == "true") { if (permission_exists('domain_select')) { @@ -79,6 +85,8 @@ else { //includes require_once "includes/header.php"; + $page["title"] = $text['title-domains']; + require_once "includes/paging.php"; //get variables used to control the order @@ -94,12 +102,12 @@ else { echo "\n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
Domains".$text['header-domains']." 
\n"; - echo " Control the list of domains to manage.

\n"; + echo " ".$text['description-domains']."

\n"; echo "
\n"; @@ -123,9 +131,9 @@ else { $rows_per_page = 100; $param = ""; $page = $_GET['page']; - if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } - list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page); - $offset = $rows_per_page * $page; + if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } + list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page); + $offset = $rows_per_page * $page; //get the list $sql = "select * from v_domains "; @@ -133,7 +141,7 @@ else { $sql .= "order by domain_name asc "; } else { - $sql .= "order by $order_by $order "; + $sql .= "order by $order_by $order "; } $sql .= " limit $rows_per_page offset $offset "; $prep_statement = $db->prepare(check_sql($sql)); @@ -149,11 +157,11 @@ else { echo "
\n"; echo "\n"; echo "\n"; - echo th_order_by('domain_name', 'Domain', $order_by, $order); - echo th_order_by('domain_description', 'Description', $order_by, $order); + echo th_order_by('domain_name', $text['label-domain'], $order_by, $order); + echo th_order_by('domain_description', $text['label-description'], $order_by, $order); echo "\n"; echo " \n"; echo "\n"; @@ -188,7 +196,7 @@ else { echo " \n"; echo "
\n"; if (permission_exists('domain_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } else { echo "  \n"; @@ -168,10 +176,10 @@ else { echo " ".$row['domain_description']." \n"; if (permission_exists('domain_edit')) { - echo " $v_link_label_edit\n"; + echo " $v_link_label_edit\n"; } if (permission_exists('domain_delete')) { - echo " $v_link_label_delete\n"; + echo " $v_link_label_delete\n"; } echo "
$paging_controls\n"; if (permission_exists('domain_add')) { - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; } else { echo "  \n"; diff --git a/core/domain_settings/domains_delete.php b/core/domain_settings/domains_delete.php index a09e498776..f77c1777e1 100644 --- a/core/domain_settings/domains_delete.php +++ b/core/domain_settings/domains_delete.php @@ -34,6 +34,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + if (count($_GET)>0) { $id = check_str($_GET["id"]); } @@ -60,7 +66,7 @@ if (strlen($id) > 0) { foreach($result as $row) { $name = $row['domain_setting_name']; $category = $row['domain_setting_category']; - $subcategory = $row['domain_setting_subcategory']; + $subcategory = $row['domain_setting_subcategory']; if (strlen($subcategory) == 0) { //$$category[$name] = $row['domain_setting_value']; $_SESSION[$category][$name] = $row['domain_setting_value']; @@ -112,7 +118,7 @@ if (strlen($id) > 0) { //delete the dialplan public unlink($_SESSION['switch']['dialplan']['dir'].'/public/'.$domain_name.'.xml'); if (strlen($_SESSION['switch']['dialplan']['dir']) > 0) { - system('rm -rf '.$_SESSION['switch']['dialplan']['dir'].'/public/'.$domain_name); + system('rm -rf '.$_SESSION['switch']['dialplan']['dir'].'/public/'.$domain_name); } //delete the extension @@ -187,7 +193,7 @@ if (strlen($id) > 0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "Delete Complete\n"; + echo $text['message-delete']."\n"; echo "
\n"; require_once "includes/footer.php"; return; diff --git a/core/domain_settings/domains_edit.php b/core/domain_settings/domains_edit.php index ce1b3767f7..750ed452c2 100644 --- a/core/domain_settings/domains_edit.php +++ b/core/domain_settings/domains_edit.php @@ -34,6 +34,12 @@ else { exit; } +//add multi-lingual support + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + //action add or update if (isset($_REQUEST["id"])) { $action = "update"; @@ -57,8 +63,8 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { } //check for all required data - //if (strlen($domain_name) == 0) { $msg .= "Please provide: Domain
\n"; } - //if (strlen($domain_description) == 0) { $msg .= "Please provide: Description
\n"; } + //if (strlen($domain_name) == 0) { $msg .= $text['message-required'].$text['label-name']."
\n"; } + //if (strlen($domain_description) == 0) { $msg .= $text['message-required'].$text['label-description']."
\n"; } if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { require_once "includes/header.php"; require_once "includes/persistformvar.php"; @@ -124,10 +130,10 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "
\n"; if ($action == "update") { - echo "Update Complete\n"; + echo $text['message-update']."\n"; } if ($action == "add") { - echo "Add Complete\n"; + echo $text['message-add']."\n"; } echo "
\n"; require_once "includes/footer.php"; @@ -151,6 +157,12 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { //show the header require_once "includes/header.php"; + if ($action == "update") { + $page["title"] = $text['title-domain-edit']; + } + if ($action == "add") { + $page["title"] = $text['title-domain-add']; + } //show the content echo "
"; @@ -163,39 +175,52 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo " \n"; @@ -203,7 +228,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update") { echo " \n"; } - echo " \n"; + echo " \n"; echo " \n"; echo " "; echo "
Domain"; + if ($action == "update") { + echo $text['header-domain-edit']; + } + if ($action == "add") { + echo $text['header-domain-add']; + } + echo "\n"; if (permission_exists('domain_export')) { - echo " \n"; + echo " \n"; } - echo " \n"; + echo " \n"; echo "
\n"; - echo "Control the list of domains to manage.

\n"; + if ($action == "update") { + echo $text['description-domain-edit']; + } + if ($action == "add") { + echo $text['description-domain-add']; + } + echo "

\n"; echo "
\n"; - echo " Domain:\n"; + echo " ".$text['label-name'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the domain name.\n"; + echo $text['description-name']."\n"; echo "
\n"; - echo " Description:\n"; + echo " ".$text['label-description'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the description.\n"; + echo $text['description-description']."\n"; echo "
";