using more UTF-8, optimized the initial froxlor.sql statements, refs #1117

Signed-off-by: Arnold Bechtoldt <mail@arnoldbechtoldt.com>
This commit is contained in:
Arnold Bechtoldt
2012-08-17 15:47:27 +02:00
parent f575e94ddb
commit 68308c4fca
14 changed files with 350 additions and 541 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1923,3 +1923,31 @@ if(isFroxlorVersion('0.9.28-svn2')) {
updateToVersion('0.9.28-svn3');
}
if(isFroxlorVersion('0.9.28-svn3'))
{
showUpdateStep("Updating from 0.9.28-svn3 to 0.9.28-svn4", true);
lastStepStatus(0);
$update_default_theme = isset($_POST['update_default_theme']) ? $_POST['update_default_theme'] : 'Froxlor';
showUpdateStep('Setting default panel theme \'' . $update_default_theme . '\'', true);
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '".$db->escape($update_default_theme)."' WHERE varname = 'default_theme';");
lastStepStatus(0);
showUpdateStep('Altering Froxlor database and tables to use UTF-8. This may take a while..', true);
$db->query('ALTER DATABASE ' . $db->getDbName() . ' CHARACTER SET utf8 COLLATE utf8_general_ci');
$handle = $db->query('SHOW TABLES');
while ($row = $db->fetch_array($handle))
{
foreach ($row as $table)
{
$db->query('ALTER TABLE ' . $table . ' CHARACTER SET utf8 COLLATE utf8_general_ci;');
}
}
lastStepStatus(0);
updateToVersion('0.9.28-svn4');
}

View File

@@ -417,16 +417,38 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
}
if(versionInUpdate($current_version, '0.9.18-svn2'))
{
{
$has_preconfig = true;
$description = 'As you can (obviously) see, Froxlor now comes with a new theme. You also have the possibility to switch back to "Classic" if you want to.';
$question = '<strong>Select default panel theme:</strong>&nbsp;';
$question.= '<select name="update_default_theme">';
$themes = getThemes();
foreach($themes as $theme) {
$question.= makeoption($theme, $theme, 'Froxlor');
foreach($themes as $cur_theme) // $theme is already in use
{
$question.= makeoption($cur_theme, $cur_theme, 'Froxlor');
}
$question.= '</select>';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.28-svn4'))
{
$has_preconfig = true;
$description = 'This version introduces a lot of profound changes:';
$description .= '<br /><ul><li>Improving the whole template system</li><li>Full UTF-8 support</li><li><strong>Removing support for the former default theme \'Classic\'</strong></li></ul>';
$description .= '<br /><br />Notice: This update will <strong>alter your Froxlor database to use UTF-8</strong> as default charset. ';
$description .= 'Even though this is already tested, we <span style="color:#ff0000;font-weight:bold;">strongly recommend</span> to ';
$description .= 'test this update in a testing environment using your existing database.<br /><br />';
$question = '<strong>Select your default panel theme:</strong>&nbsp;';
$question.= '<select name="update_default_theme">';
$themes = getThemes();
foreach($themes as $cur_theme)
{
$question.= makeoption($cur_theme, $cur_theme, 'Froxlor');
}
$question.= '</select>';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}