diff options
| author | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-07-20 14:37:41 +0000 |
|---|---|---|
| committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-07-20 14:37:41 +0000 |
| commit | 5561e8652941384955d8d89a4cd46cced7f38941 (patch) | |
| tree | 4d5eebc960511f5267d8eda8ffeb63d4ffed15e4 /phpBB/adm/admin_styles.php | |
| parent | e0c436070532f8dead72a3068393188380028d7c (diff) | |
| download | forums-5561e8652941384955d8d89a4cd46cced7f38941.tar forums-5561e8652941384955d8d89a4cd46cced7f38941.tar.gz forums-5561e8652941384955d8d89a4cd46cced7f38941.tar.bz2 forums-5561e8652941384955d8d89a4cd46cced7f38941.tar.xz forums-5561e8652941384955d8d89a4cd46cced7f38941.zip | |
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
Diffstat (limited to 'phpBB/adm/admin_styles.php')
| -rw-r--r-- | phpBB/adm/admin_styles.php | 29 |
1 files changed, 21 insertions, 8 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); + $theme_config = "<?php\n"; + $theme_config .= "//phpBB 2.2 auto-generated theme config file for $theme_name\n"; + $theme_config .= "// Do not change anything in this file!\n"; + $theme_config .= "\$themecfg['name'] = '" . addslashes($theme_name) . "';\n"; + $theme_config .= "\$themecfg['copyright'] = '" . addslashes($theme_copyright) . "';\n"; + $theme_config .= "\$themecfg['phpbbversion'] = '" . addslashes($config['version']) . "';\n"; + $theme_config .= '?>'; - // Where is the CSS stored? + $zip = new archive_zip('w', $phpbb_root_path . 'store/theme_' . $theme_path . '.zip'); + + // 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) { -// $stylesheet = &$css_data; + $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 = new archive_zip('w', $phpbb_root_path . 'store/theme_' . $theme_path . '.zip'); - $zip->add_file('styles/themes/' . $theme_path . '/', 'styles/themes/'); $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')); } |
