From 5561e8652941384955d8d89a4cd46cced7f38941 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sun, 20 Jul 2003 14:37:41 +0000 Subject: [PATCH] This will dump out a DB stored stylesheet, also adds cfg file git-svn-id: file:///svn/phpbb/trunk@4292 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/admin_styles.php | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/phpBB/adm/admin_styles.php b/phpBB/adm/admin_styles.php index 103b182812..205a226ceb 100644 --- a/phpBB/adm/admin_styles.php +++ b/phpBB/adm/admin_styles.php @@ -1845,10 +1845,6 @@ function csspreview() case 'export': - // TODO - // Note, this won't cope with stylesheets stored in the db at present, it'll - // jump dump out the existing version stored on the filesystem - if ($theme_id) { include($phpbb_root_path . 'includes/functions_compress.'.$phpEx); @@ -1864,17 +1860,34 @@ function csspreview() } $db->sql_freeresult($result); - - // Where is the CSS stored? - if ($css_storedb) - { -// $stylesheet = &$css_data; - } + $theme_config = "'; $zip = new archive_zip('w', $phpbb_root_path . 'store/theme_' . $theme_path . '.zip'); - $zip->add_file('styles/themes/' . $theme_path . '/', 'styles/themes/'); + + // If we have the css in the DB we'll use that in preference to the one on the + // filesystem. We will also create an appropriate cfg file + if ($css_storedb) + { + $zip->add_file('styles/themes/' . $theme_path . '/', 'styles/themes/', $theme_path . '.css,theme.cfg'); + $zip->add_data($css_data, $theme_path . '/' . $theme_path . '.css'); + } + else + { + $zip->add_file('styles/themes/' . $theme_path . '/', 'styles/themes/', 'theme.cfg'); + } + $zip->add_data($theme_config, $theme_path . '/theme.cfg'); + $zip->close(); + unset($theme_config); + unset($css_data); + add_log('admin', 'LOG_EXPORT_THEME', $theme_name); trigger_error(sprintf($user->lang['THEME_EXPORTED'], 'store/theme_' . $theme_path . '.zip')); }