diff --git a/core/databases/app_languages.php b/core/databases/app_languages.php new file mode 100644 index 0000000000..6aeaa1c4b4 --- /dev/null +++ b/core/databases/app_languages.php @@ -0,0 +1,127 @@ + \ No newline at end of file diff --git a/core/databases/database_delete.php b/core/databases/database_delete.php index d1c14d54ea..bce50e8690 100644 --- a/core/databases/database_delete.php +++ b/core/databases/database_delete.php @@ -26,7 +26,7 @@ require_once "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; -if (if_group("superadmin")) { +if (permission_exists('database_delete')) { //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']]; + } + if (count($_GET)>0) { $id = check_str($_GET["id"]); } @@ -50,7 +56,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/databases/database_edit.php b/core/databases/database_edit.php index 7e8c2779cd..32866025e1 100644 --- a/core/databases/database_edit.php +++ b/core/databases/database_edit.php @@ -26,7 +26,7 @@ require_once "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; -if (if_group("superadmin")) { +if (permission_exists('database_add') || permission_exists('database_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"; @@ -75,15 +81,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { } //check for all required data - //if (strlen($database_driver) == 0) { $msg .= "Please provide: Driver
\n"; } - //if (strlen($database_type) == 0) { $msg .= "Please provide: Type
\n"; } - //if (strlen($database_host) == 0) { $msg .= "Please provide: Host
\n"; } - //if (strlen($database_port) == 0) { $msg .= "Please provide: Port
\n"; } - //if (strlen($database_name) == 0) { $msg .= "Please provide: Name
\n"; } - //if (strlen($database_username) == 0) { $msg .= "Please provide: Username
\n"; } - //if (strlen($database_password) == 0) { $msg .= "Please provide: Password
\n"; } - //if (strlen($database_path) == 0) { $msg .= "Please provide: Path
\n"; } - //if (strlen($database_description) == 0) { $msg .= "Please provide: Description
\n"; } + //if (strlen($database_driver) == 0) { $msg .= $text['message-required'].$text['label-driver']."
\n"; } + //if (strlen($database_type) == 0) { $msg .= $text['message-required'].$text['label-type']."
\n"; } + //if (strlen($database_host) == 0) { $msg .= $text['message-required'].$text['label-host']."
\n"; } + //if (strlen($database_port) == 0) { $msg .= $text['message-required'].$text['label-port']."
\n"; } + //if (strlen($database_name) == 0) { $msg .= $text['message-required'].$text['label-name']."
\n"; } + //if (strlen($database_username) == 0) { $msg .= $text['message-required'].$text['label-username']."
\n"; } + //if (strlen($database_password) == 0) { $msg .= $text['message-required'].$text['label-password']."
\n"; } + //if (strlen($database_path) == 0) { $msg .= $text['message-required'].$text['label-path']."
\n"; } + //if (strlen($database_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"; @@ -140,7 +146,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; @@ -170,12 +176,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 @@ -203,6 +209,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //show the header require_once "includes/header.php"; + if ($action == "update") { + $page["title"] = $text['title-database-edit']; + } + if ($action == "add") { + $page["title"] = $text['title-database-add']; + } //show the content echo "
"; @@ -216,167 +228,173 @@ 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"; 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"; @@ -384,7 +402,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update") { echo " \n"; } - echo " \n"; + echo " \n"; echo " \n"; echo " "; echo "
Database Add".$text['header-database-add']."Database Edit".$text['header-database-edit']."
\n"; - echo "Database connection information.

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

\n"; echo "
\n"; - echo " Driver:\n"; + echo " ".$text['label-driver'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Select the database driver.\n"; + echo $text['description-driver']."\n"; echo "
\n"; - echo " Type:\n"; + echo " ".$text['label-type'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Select the database type.\n"; + echo $text['description-type']."\n"; echo "
\n"; - echo " Host:\n"; + echo " ".$text['label-host'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the host name.\n"; + echo $text['description-host']."\n"; echo "
\n"; - echo " Port:\n"; + echo " ".$text['label-port'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the port number.\n"; + echo $text['description-port']."\n"; echo "
\n"; - echo " Name:\n"; + echo " ".$text['label-name'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the database name.\n"; + echo $text['description-name']."\n"; echo "
\n"; - echo " Username:\n"; + echo " ".$text['label-username'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the database username.\n"; + echo $text['description-username']."\n"; echo "
\n"; - echo " Password:\n"; + echo " ".$text['label-password'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the database password.\n"; + echo $text['description-password']."\n"; echo "
\n"; - echo " Path:\n"; + echo " ".$text['label-path'].":\n"; echo "\n"; echo " \n"; echo "
\n"; - echo "Enter the database file path.\n"; + echo $text['description-path']."\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/databases/databases.php b/core/databases/databases.php index cf18432e45..3878137c71 100644 --- a/core/databases/databases.php +++ b/core/databases/databases.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-databases']; + 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 "
Databases".$text['header-databases']." 
\n"; - echo " Database information.

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

\n"; echo "
\n"; @@ -79,8 +88,8 @@ require_once "includes/paging.php"; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } - list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page); - $offset = $rows_per_page * $page; + list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page); + $offset = $rows_per_page * $page; //get the list $sql = "select * from v_databases "; @@ -100,16 +109,16 @@ require_once "includes/paging.php"; echo "\n"; echo "\n"; - echo th_order_by('database_driver', 'Driver', $order_by, $order); - echo th_order_by('database_type', 'Type', $order_by, $order); - echo th_order_by('database_host', 'Host', $order_by, $order); - //echo th_order_by('database_port', 'Port', $order_by, $order); - echo th_order_by('database_name', 'Name', $order_by, $order); - //echo th_order_by('database_username', 'Username', $order_by, $order); - //echo th_order_by('database_path', 'Path', $order_by, $order); - echo th_order_by('database_description', 'Description', $order_by, $order); + echo th_order_by('database_driver', $text['label-driver'], $order_by, $order); + echo th_order_by('database_type', $text['label-type'], $order_by, $order); + echo th_order_by('database_host', $text['label-host'], $order_by, $order); + //echo th_order_by('database_port', $text['label-port'], $order_by, $order); + echo th_order_by('database_name', $text['label-name'], $order_by, $order); + //echo th_order_by('database_username', $text['label-username'], $order_by, $order); + //echo th_order_by('database_path', $text['label-path'], $order_by, $order); + echo th_order_by('database_description', $text['label-description'], $order_by, $order); echo "\n"; echo "\n"; @@ -125,8 +134,8 @@ require_once "includes/paging.php"; //echo " \n"; echo " \n"; echo " \n"; echo "\n"; if ($c==0) { $c=1; } else { $c=0; } @@ -141,7 +150,7 @@ require_once "includes/paging.php"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; echo "
".$row['database_path']." ".$row['database_description']." \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 "
 $paging_controls\n"; - echo " $v_link_label_add\n"; + echo " $v_link_label_add\n"; echo "
\n";