From 294569795ba3715cdaac628b18874665931d13fa Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sun, 29 Jul 2001 23:26:40 +0000 Subject: [PATCH] Languagified ... like that word? ... and updated a little git-svn-id: file:///svn/phpbb/trunk@763 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/admin_db_utilities.php | 128 +++++++++--------- phpBB/language/lang_english.php | 18 +++ .../PSO/admin/db_utils_backup_body.tpl | 38 +++++- .../PSO/admin/db_utils_restore_body.tpl | 9 +- 4 files changed, 119 insertions(+), 74 deletions(-) diff --git a/phpBB/admin/admin_db_utilities.php b/phpBB/admin/admin_db_utilities.php index 5004377487..c598426450 100644 --- a/phpBB/admin/admin_db_utilities.php +++ b/phpBB/admin/admin_db_utilities.php @@ -155,8 +155,8 @@ function get_table_def_postgres($table, $crlf) if(!$result) { - $error = $db->sql_error(); - message_die(GENERAL_ERROR, 'Failed in get_table_def (show fields) : ' . $error['message']); + include('page_header_admin.'.$phpEx); + message_die(GENERAL_ERROR, "Failed in get_table_def (show fields)", "", __LINE__, __FILE__, $field_query); } // end if.. if ($drop == 1) @@ -235,6 +235,7 @@ function get_table_def_postgres($table, $crlf) if(!$result) { + include('page_header_admin.'.$phpEx); message_die(GENERAL_ERROR, "Failed in get_table_def (show fields)", "", __LINE__, __FILE__, $sql_pri_keys); } @@ -296,6 +297,7 @@ function get_table_def_postgres($table, $crlf) if (!$result) { + include('page_header_admin.'.$phpEx); message_die(GENERAL_ERROR, "Failed in get_table_def (show fields)", "", __LINE__, __FILE__, $sql_checks); } @@ -346,6 +348,7 @@ function get_table_def_mysql($table, $crlf) $result = $db->sql_query($field_query); if(!result) { + include('page_header_admin.'.$phpEx); message_die(GENERAL_ERROR, "Failed in get_table_def (show fields)", "", __LINE__, __FILE__, $field_query); } @@ -381,6 +384,7 @@ function get_table_def_mysql($table, $crlf) $result = $db->sql_query($key_query); if(!$result) { + include('page_header_admin.'.$phpEx); message_die(GENERAL_ERROR, "FAILED IN get_table_def (show keys)", "", __LINE__, __FILE__, $key_query); } @@ -454,6 +458,7 @@ function get_table_content_postgres($table, $handler) if (!$result) { + include('page_header_admin.'.$phpEx); message_die(GENERAL_ERROR, "Faild in get_table_content (select *)", "", __LINE__, __FILE__, "SELECT * FROM $table"); } @@ -532,6 +537,7 @@ function get_table_content_mysql($table, $handler) if (!$result) { + include('page_header_admin.'.$phpEx); message_die(GENERAL_ERROR, "Faild in get_table_content (select *)", "", __LINE__, __FILE__, "SELECT * FROM $table"); } @@ -685,14 +691,9 @@ if( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) switch($perform) { case 'backup': + if( SQL_LAYER == 'oracle' || SQL_LAYER == 'odbc' || SQL_LAYER == 'mssql' ) { - // - // Page header - // - $template_header = "admin/page_header.tpl"; - include('page_header_admin.'.$phpEx); - switch(SQL_LAYER) { case 'oracle': @@ -706,12 +707,20 @@ if( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) break; } - $db_message = "

Database backups are not currently supported for your Database system (" . $db_type . ")

\n"; + // + // Page header + // + include('page_header_admin.'.$phpEx); + + $template->set_filenames(array( + "body" => "admin/admin_message_body.tpl") + ); $template->assign_vars(array( - "U_DB_MESSAGE" => $db_message, - "U_DB_LINKS" => $db_links) + "MESSAGE_TITLE" => $lang['Information'], + "MESSAGE_TEXT" => $lang['Backups_not_supported']) ); + $template->pparse("body"); break; @@ -745,25 +754,26 @@ if( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) // // Page header // - $template_header = "admin/page_header.tpl"; include('page_header_admin.'.$phpEx); - $db_message = "

This will perform a backup of all phpBB2 related tables.


\n"; - $db_message .= "

If you have any additional custom tables in the same database with phpBB that you would like to back up as well please enter their names seperated by commas in the Additional Tables textbox below.
\n"; - $db_message .= "Otherwise just select the form of backup you want to perform and click the Start Backup button below.


\n\n"; - $db_links = "
\n"; - $db_links .= "\n"; - $db_links .= "\n"; - $db_links .= "\n"; - $db_links .= "\n"; - $db_links .= "\n"; - $db_links .= "
Additional Tables:
Full Backup:
Table Structure Only:
Table Data Only:
\n"; - $db_links .= ""; - $db_links .= "

\n"; + $template->set_filenames(array( + "body" => "admin/db_utils_backup_body.tpl") + ); + + $s_hidden_fields = ""; $template->assign_vars(array( - "U_DB_MESSAGE" => $db_message, - "U_DB_LINKS" => $db_links) + "L_DATABASE_BACKUP" => $lang['Database_Utilities'] . " : " . $lang['Backup'], + "L_BACKUP_EXPLAIN" => $lang['Backup_explain'], + "L_FULL_BACKUP" => $lang['Full_backup'], + "L_STRUCTURE_BACKUP" => $lang['Structure_backup'], + "L_DATA_BACKUP" => $lang['Data_backup'], + "L_ADDITIONAL_TABLES" => $lang['Additional_tables'], + "L_START_BACKUP" => $lang['Start_backup'], + "L_BACKUP_OPTIONS" => $lang['Backup_options'], + + "S_HIDDEN_FIELDS" => $s_hidden_fields, + "S_DBUTILS_ACTION" => append_sid("admin_db_utilities.$phpEx")) ); $template->pparse("body"); @@ -772,23 +782,23 @@ if( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) } else if( !isset($HTTP_POST_VARS['startdownload']) && !isset($HTTP_GET_VARS['startdownload']) ) { + + $template->set_filenames(array( + "body" => "admin/admin_message_body.tpl") + ); + + $template->assign_vars(array( + "META" => "", + + "MESSAGE_TITLE" => $lang['Database_Utilities'] . " : " . $lang['Backup'], + "MESSAGE_TEXT" => $lang['Backup_download']) + ); + // // Page header // - $template->assign_vars(array( - "META" => "") - ); - - $template_header = "admin/page_header.tpl"; include('page_header_admin.'.$phpEx); - $db_message = "

Your backup file will start downloading soon


\n"; - - $template->assign_vars(array( - "U_DB_MESSAGE" => $db_message, - "U_DB_LINKS" => $db_links) - ); - $template->pparse("body"); include('page_footer_admin.'.$phpEx); @@ -853,13 +863,17 @@ if( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) // // Page header // - $template_header = "admin/page_header.tpl"; include('page_header_admin.'.$phpEx); - $s_hidden_fields = ""; + $s_hidden_fields = ""; $template->assign_vars(array( - "S_DBRESTORE_ACTION" => append_sid("admin_db_utilities.$phpEx"), + "L_DATABASE_RESTORE" => $lang['Database_Utilities'] . " : " . $lang['Restore'], + "L_RESTORE_EXPLAIN" => $lang['Restore_explain'], + "L_SELECT_FILE" => $lang['Select_file'], + "L_START_RESTORE" => $lang['Start_Restore'], + + "S_DBUTILS_ACTION" => append_sid("admin_db_utilities.$phpEx"), "S_HIDDEN_FIELDS" => $s_hidden_fields) ); $template->pparse("body"); @@ -872,6 +886,7 @@ if( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) // Handle the file upload .... if($backup_file == "none") { + include('page_header_admin.'.$phpEx); message_die(GENERAL_ERROR, "Backup file upload failed"); } @@ -882,6 +897,7 @@ if( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) } else { + include('page_header_admin.'.$phpEx); message_die(GENERAL_ERROR, "Trouble Accessing uploaded file"); } @@ -908,6 +924,7 @@ if( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) if(!$result && ( !(SQL_LAYER == 'postgres' && eregi("drop table", $sql) ) ) ) { + include('page_header_admin.'.$phpEx); message_die(GENERAL_ERROR, "Error importing backup file", "", __LINE__, __FILE__, $sql); } } @@ -917,15 +934,17 @@ if( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) // // Page header // - $template_header = "admin/page_header.tpl"; include('page_header_admin.'.$phpEx); - $db_message = "

The Database has been successfully restored..

\n"; - $db_message .= "


Your board should be back to the state it was when the backup was made.

\n"; + $template->set_filenames(array( + "body" => "admin/admin_message_body.tpl") + ); + $message = $lang['Restore_success']; + $template->assign_vars(array( - "U_DB_MESSAGE" => $db_message, - "U_DB_LINKS" => $db_links) + "MESSAGE_TITLE" => $lang['Database_Utilities'] . " : " . $lang['Restore'], + "MESSAGE_TEXT" => $message) ); $template->pparse("body"); @@ -934,23 +953,6 @@ if( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) break; } } -else -{ - // - // Page header - // - $template_header = "admin/page_header.tpl"; - include('page_header_admin.'.$phpEx); - - $db_message = "

These Utilties will help you to backup or restore your phpBB database


\n"; - - $template->assign_vars(array( - "U_DB_MESSAGE" => $db_message, - "U_DB_LINKS" => $db_links) - ); - - $template->pparse("body"); -} include('page_footer_admin.'.$phpEx); diff --git a/phpBB/language/lang_english.php b/phpBB/language/lang_english.php index fae6a1896f..5e3c0ebda4 100755 --- a/phpBB/language/lang_english.php +++ b/phpBB/language/lang_english.php @@ -656,6 +656,24 @@ $lang['Avatar_dir_size'] = "Avatar directory size"; $lang['Database_size'] = "Database size"; $lang['Not_available'] = "Not available"; +// DB Utils +$lang['Database_Utilities'] = "Database Utilities"; +$lang['Restore'] = "Restore"; +$lang['Backup'] = "Backup"; +$lang['Restore_explain'] = "This will perform a full restore of all phpBB tables from a saved file. WARNING This will overwrite any existing data."; +$lang['Backup_explain'] = "Here you can backup all your phpBB related data. If you have any additional custom tables in the same database with phpBB that you would like to back up as well please enter their names seperated by commas in the Additional Tables textbox below."; +$lang['Backup_options'] = "Backup options"; +$lang['Start_backup'] = "Start Backup"; +$lang['Full_backup'] = "Full backup"; +$lang['Structure_backup'] = "Structure Only backup"; +$lang['Data_backup'] = "Data only backup"; +$lang['Additional_tables'] = "Additional tables"; +$lang['Select_file'] = "Select a file"; +$lang['Start_Restore'] = "Start Restore"; +$lang['Restore_success'] = "The Database has been successfully restored.

Your board should be back to the state it was when the backup was made."; +$lang['Backup_download'] = "Your download will start shortly please wait till it begins"; +$lang['Backups_not_supported'] = "Sorry but database backups are not currently supported for your database system"; + // Auth pages $lang['Administrator'] = "Administrator"; $lang['User'] = "User"; diff --git a/phpBB/templates/PSO/admin/db_utils_backup_body.tpl b/phpBB/templates/PSO/admin/db_utils_backup_body.tpl index c48c151960..73a65ad016 100644 --- a/phpBB/templates/PSO/admin/db_utils_backup_body.tpl +++ b/phpBB/templates/PSO/admin/db_utils_backup_body.tpl @@ -1,9 +1,33 @@ -
- -

Database Utilities : Backup

- -
{U_DB_MESSAGE} - -{U_DB_LINKS}
+ +
+ +

{L_DATABASE_BACKUP}

+ +

{L_BACKUP_EXPLAIN}

+ + + + + + + + + + + + + + + + + + + + + + + + +
{L_BACKUP_OPTIONS}
{L_FULL_BACKUP}
{L_STRUCTURE_BACKUP}
{L_DATA_BACKUP}
{L_ADDITIONAL_TABLES}
{S_HIDDEN_FIELDS}

diff --git a/phpBB/templates/PSO/admin/db_utils_restore_body.tpl b/phpBB/templates/PSO/admin/db_utils_restore_body.tpl index f3bdafc038..23d8e6a3e6 100644 --- a/phpBB/templates/PSO/admin/db_utils_restore_body.tpl +++ b/phpBB/templates/PSO/admin/db_utils_restore_body.tpl @@ -1,15 +1,16 @@ +
-

Database Utilities : Restore

+

{L_DATABASE_RESTORE}

-

This will perform a full restore of all phpBB tables from a saved file. WARNING This will overwrite any existing data

+

{L_RESTORE_EXPLAIN}

- + - +
Select a File{L_SELECT_FILE}
       {S_HIDDEN_FIELDS}