Index: branches/5.0.x/core/install.php =================================================================== diff -u -N -r12734 -r12808 --- branches/5.0.x/core/install.php (.../install.php) (revision 12734) +++ branches/5.0.x/core/install.php (.../install.php) (revision 12808) @@ -1,6 +1,6 @@ toolkit->getThemes(true)) == 1) { - // only one theme -> set it as primary - $sql = 'UPDATE ' . $this->Application->getUnitOption('theme', 'TableName') . ' - SET Enabled = 1, PrimaryTheme = 1 - LIMIT 1'; - $this->Conn->Query($sql); - - $this->toolkit->rebuildThemes(); // rescan theme to create structure after theme is enabled !!! - - $this->currentStep = $this->GetNextStep(); - } + // put available theme list in database + $this->toolkit->rebuildThemes(); break; case 'upgrade_modules': @@ -842,6 +833,22 @@ $this->Conn->Query($sql); } } + + // install theme dependent demo data + if ($this->Application->GetVar('install_demo_data')) { + $sql = 'SELECT Name + FROM ' . $theme_table . ' + WHERE ' . $theme_idfield . ' = ' . $theme_id; + $theme_name = $this->Conn->GetOne($sql); + + foreach ($this->Application->ModuleInfo as $module_name => $module_info) { + if ($module_name == 'In-Portal') { + continue; + } + + $this->toolkit->RunSQL('/themes' . '/' . $theme_name . '/' . $module_info['TemplatePath'] . '_install/install_data.sql'); + } + } break; case 'upgrade_modules': @@ -961,7 +968,7 @@ } foreach ($versions as $version) { - $upgrade_method = 'Upgrade_'.str_replace('.', '_', $version); + $upgrade_method = 'Upgrade_'.str_replace(Array ('.', '-'), '_', $version); if (method_exists($upgrade_object, $upgrade_method)) { $upgrade_object->$upgrade_method($mode); }