aboutsummaryrefslogtreecommitdiffstats
path: root/upgrade.php
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2008-11-03 19:55:35 +0000
committerpatdenice <patdenice@piwigo.org>2008-11-03 19:55:35 +0000
commit78af3df65b04929447517efccad6b7c79ff269d3 (patch)
treed22a0b2e57dd8ac751bb981c31b1a41797712c11 /upgrade.php
parent2ddd90f3c3ed80dac3cc00455da9a462d769b5b5 (diff)
merge -c2819 from trunk to branch 2.0
- Add roma theme to upgrade page. - Upgrade translation. git-svn-id: http://piwigo.org/svn/branches/2.0@2820 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--upgrade.php61
1 files changed, 41 insertions, 20 deletions
diff --git a/upgrade.php b/upgrade.php
index cb1d7337e..83d1f12a0 100644
--- a/upgrade.php
+++ b/upgrade.php
@@ -148,13 +148,48 @@ function print_time($message)
// }
// +-----------------------------------------------------------------------+
+// | language |
+// +-----------------------------------------------------------------------+
+if (isset($_GET['language']))
+{
+ $language = strip_tags($_GET['language']);
+}
+else
+{
+ $language = 'en_UK';
+ // Try to get browser language
+ foreach (get_languages('utf-8') as $language_code => $language_name)
+ {
+ if (substr($language_code,0,2) == @substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2))
+ {
+ $language = $language_code;
+ break;
+ }
+ }
+}
+
+load_language( 'common.lang', '', array('language'=>$language, 'target_charset'=>'utf-8') );
+load_language( 'admin.lang', '', array('language'=>$language, 'target_charset'=>'utf-8') );
+load_language( 'upgrade.lang', '', array('language'=>$language, 'target_charset'=>'utf-8') );
+
+// +-----------------------------------------------------------------------+
// | template initialization |
// +-----------------------------------------------------------------------+
-$template = new Template(PHPWG_ROOT_PATH.'admin/template/goto');
+$template = new Template(PHPWG_ROOT_PATH.'admin/template/goto', 'roma');
$template->set_filenames(array('upgrade'=>'upgrade.tpl'));
$template->assign('RELEASE', PHPWG_VERSION);
+foreach (get_languages('utf-8') as $language_code => $language_name)
+{
+ if ($language == $language_code)
+ {
+ $template->assign('language_selection', $language_code);
+ }
+ $languages_options[$language_code] = $language_name;
+}
+$template->assign('language_options', $languages_options);
+
// +-----------------------------------------------------------------------+
// | upgrade choice |
// +-----------------------------------------------------------------------+
@@ -210,7 +245,7 @@ if (!isset($_GET['version']))
array(
'CURRENT_RELEASE' => $current_release,
'RUN_UPGRADE_URL' =>
- PHPWG_ROOT_PATH.'upgrade.php?version='.$current_release,
+ PHPWG_ROOT_PATH.'upgrade.php?version='.$current_release.'&amp;language='.$language,
)
);
}
@@ -263,24 +298,10 @@ else
)
);
- array_push(
- $page['infos'],
- '[security] delete files "upgrade.php", "upgrade_feed.php", "install.php" and "install"
-directory'
- );
-
- array_push(
- $page['infos'],
- 'in include/mysql.inc.php, remove
-<pre style="background-color:lightgray">
-define(\'PHPWG_IN_UPGRADE\', true);
-</pre>'
- );
-
- array_push(
- $page['infos'],
- 'Perform a maintenance check in [Administration>General>Maintenance]
-if you encounter any problem.'
+ array_push($page['infos'],
+ l10n('delete upgrade files'),
+ l10n('remove line from mysql.inc.php') . '<pre>define(\'PHPWG_IN_UPGRADE\', true);</pre>',
+ l10n('perform a maintenance check')
);
$template->assign('infos', $page['infos']);