diff --git a/core/menu/app_languages.php b/core/menu/app_languages.php
new file mode 100644
index 0000000000..e3f24f3441
--- /dev/null
+++ b/core/menu/app_languages.php
@@ -0,0 +1,195 @@
+
\ No newline at end of file
diff --git a/core/menu/menu.php b/core/menu/menu.php
index dad8cbfb57..20f20a0da8 100644
--- a/core/menu/menu.php
+++ b/core/menu/menu.php
@@ -26,14 +26,23 @@
require_once "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
-if (if_group("admin") || if_group("superadmin")) {
+if (permission_exists('menu_add') || permission_exists('menu_edit') || permission_exists('menu_delete')) {
//access granted
}
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-menus'];
+
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 th_order_by('menu_name', 'Name', $order_by, $order);
- echo th_order_by('menu_language', 'Language', $order_by, $order);
- echo th_order_by('menu_description', 'Description', $order_by, $order);
+ echo th_order_by('menu_name', $text['label-name'], $order_by, $order);
+ echo th_order_by('menu_language', $text['label-language'], $order_by, $order);
+ echo th_order_by('menu_description', $text['label-description'], $order_by, $order);
echo "| \n";
- echo " $v_link_label_add\n";
+ echo " $v_link_label_add\n";
echo " | \n";
echo "
\n";
@@ -113,8 +122,8 @@ require_once "includes/paging.php";
echo " | ".$row['menu_language']." | \n";
echo " ".$row['menu_description']." | \n";
echo " \n";
- echo " $v_link_label_edit\n";
- echo " $v_link_label_delete\n";
+ echo " $v_link_label_edit\n";
+ echo " $v_link_label_delete\n";
echo " | \n";
echo "
\n";
if ($c==0) { $c=1; } else { $c=0; }
@@ -129,7 +138,7 @@ require_once "includes/paging.php";
echo " | \n";
echo " $paging_controls | \n";
echo " \n";
- echo " $v_link_label_add\n";
+ echo " $v_link_label_add\n";
echo " | \n";
echo " \n";
echo "
\n";
diff --git a/core/menu/menu_delete.php b/core/menu/menu_delete.php
index 2612db755a..99a355aa25 100644
--- a/core/menu/menu_delete.php
+++ b/core/menu/menu_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"]);
$menu_uuid = check_str($_GET["menu_uuid"]);
@@ -75,7 +81,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/menu/menu_edit.php b/core/menu/menu_edit.php
index c48fcb8f65..35418a8040 100644
--- a/core/menu/menu_edit.php
+++ b/core/menu/menu_edit.php
@@ -26,7 +26,7 @@
require_once "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
-if (if_group("admin") || if_group("superadmin")) {
+if (permission_exists('menu_add') || permission_exists('menu_edit')) {
//access granted
}
else {
@@ -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";
@@ -59,10 +65,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
}
//check for all required data
- //if (strlen($menu_uuid) == 0) { $msg .= "Please provide: Menu UUID
\n"; }
- //if (strlen($menu_name) == 0) { $msg .= "Please provide: Name
\n"; }
- //if (strlen($menu_language) == 0) { $msg .= "Please provide: Language
\n"; }
- //if (strlen($menu_description) == 0) { $msg .= "Please provide: Description
\n"; }
+ //if (strlen($menu_name) == 0) { $msg .= $text['message-required'].$text['label-name']."
\n"; }
+ //if (strlen($menu_language) == 0) { $msg .= $text['message-required'].$text['label-language']."
\n"; }
+ //if (strlen($menu_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";
@@ -111,7 +116,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;
@@ -131,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
@@ -159,6 +164,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//show the header
require_once "includes/header.php";
+ if ($action == "update") {
+ $page["title"] = $text['title-menu-edit'];
+ }
+ if ($action == "add") {
+ $page["title"] = $text['title-menu-add'];
+ }
//show the content
echo "
";
@@ -172,53 +183,59 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "
";
diff --git a/core/menu/menu_item_delete.php b/core/menu/menu_item_delete.php
index 40fe234549..708d9e45f2 100644
--- a/core/menu/menu_item_delete.php
+++ b/core/menu/menu_item_delete.php
@@ -34,6 +34,12 @@ else {
return;
}
+//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) {
//clear the menu session so it will rebuild with the update
$_SESSION["menu"] = "";
@@ -53,7 +59,7 @@ if (count($_GET)>0) {
require_once "includes/header.php";
echo "
\n";
echo "
";
- echo "Delete Completed";
+ echo $text['message-delete'];
echo "
";
require_once "includes/footer.php";
return;
diff --git a/core/menu/menu_item_edit.php b/core/menu/menu_item_edit.php
index 6323b90ef3..e7d6ea040f 100644
--- a/core/menu/menu_item_edit.php
+++ b/core/menu/menu_item_edit.php
@@ -26,7 +26,7 @@
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
-if (permission_exists('menu_add') || permission_exists('menu_edit') || permission_exists('menu_delete')) {
+if (permission_exists('menu_add') || permission_exists('menu_edit')) {
//access granted
}
else {
@@ -34,8 +34,11 @@ else {
return;
}
-//include the header
- require_once "includes/header.php";
+//add multi-lingual support
+ require_once "app_languages.php";
+ foreach($text as $key => $value) {
+ $text[$key] = $value[$_SESSION['domain']['language']['code']];
+ }
//get the menu_uuid
$menu_uuid = check_str($_REQUEST["id"]);
@@ -54,7 +57,7 @@ else {
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;
@@ -100,9 +103,9 @@ else {
//check for all required data
$msg = '';
- if (strlen($menu_item_title) == 0) { $msg .= "Please provide: title
\n"; }
- if (strlen($menu_item_category) == 0) { $msg .= "Please provide: category
\n"; }
- //if (strlen($menu_item_link) == 0) { $msg .= "Please provide: menu_item_link
\n"; }
+ if (strlen($menu_item_title) == 0) { $msg .= $text['message-required'].$text['label-title']."
\n"; }
+ if (strlen($menu_item_category) == 0) { $msg .= $text['message-required'].$text['label-category']."
\n"; }
+ //if (strlen($menu_item_link) == 0) { $msg .= $text['message-required'].$text['label-link']."
\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
require_once "includes/persistformvar.php";
@@ -219,13 +222,13 @@ else {
//redirect the user
require_once "includes/header.php";
- echo "
\n";
+ echo "
\n";
echo "
\n";
if ($action == "add") {
- echo "Add Complete\n";
+ echo $text['message-add']."\n";
}
if ($action == "update") {
- echo "Edit Complete\n";
+ echo $text['message-update']."\n";
}
echo "
\n";
require_once "includes/footer.php";
@@ -262,8 +265,15 @@ else {
}
}
-//show the content
+//include the header
require_once "includes/header.php";
+ if ($action == "update") {
+ $page["title"] = $text['title-menu_item-edit'];
+ }
+ if ($action == "add") {
+ $page["title"] = $text['title-menu_item-add'];
+ }
+
echo "
";
echo "
\n";
echo "\n";
@@ -273,32 +283,39 @@ else {
echo "