diff --git a/phpBB/adm/admin_styles.php b/phpBB/adm/admin_styles.php index e7f707a5fc..d7798d950f 100644 --- a/phpBB/adm/admin_styles.php +++ b/phpBB/adm/admin_styles.php @@ -1768,6 +1768,8 @@ function viewsource(url) case 'details': case 'install': + $l_prefix = ($action == 'add') ? 'ADD' : (($action == 'details') ? 'EDIT_DETAILS' : 'INSTALL'); + // Do we want to edit an existing theme or are we creating a new theme // or submitting an existing one? if ($theme_id && empty($_POST['update'])) @@ -1885,22 +1887,36 @@ function viewsource(url) $css_data = ''; if ($action == 'install') { - if (!is_writeable("{$phpbb_root_path}styles/themes/$theme_path/$theme_path.css")) + if (!is_writeable("{$phpbb_root_path}styles/$theme_path/theme/stylesheet.css")) { - $css_data = implode('', file("{$phpbb_root_path}styles/themes/$theme_path/$theme_path.css")); + $css_data = implode('', file("{$phpbb_root_path}styles/$theme_path/theme/stylesheet.css")); } else { $css_storedb = 0; } } - else if (!$safe_mode && is_writeable("{$phpbb_root_path}styles/themes") && $action == 'add') + else if (!$safe_mode && is_writeable("{$phpbb_root_path}styles") && $action == 'add') { - umask(0); - if (@mkdir("{$phpbb_root_path}styles/themes/$theme_path", 0777)) + if (!empty($_FILES['upload_file'])) { - $css_storedb = 0; - @chmod("{$phpbb_root_path}styles/themes/$theme_path", 0777); + } + else if (!empty($_POST['import_file'])) + { + } + else + { + umask(0); + if (@mkdir("{$phpbb_root_path}styles/$theme_path", 0777)) + { + @chmod("{$phpbb_root_path}styles/$theme_path", 0777); + } + + if (@mkdir("{$phpbb_root_path}styles/$theme_path/theme/", 0777)) + { + $css_storedb = 0; + @chmod("{$phpbb_root_path}styles/themes/$theme_path", 0777); + } } if (!empty($_POST['theme_basis']) && !$css_storedb) @@ -1914,30 +1930,30 @@ function viewsource(url) { $css_data = ($row['css_storedb']) ? $row['css_data'] : implode('', file($phpbb_root_path . 'styles/themes/' . $row['theme_path'] . '/' . $row['theme_path'] . '.css')); - if (!$css_storedb && ($fp = @fopen("{$phpbb_root_path}styles/themes/$theme_path/$theme_path.css", 'wb'))) + if (!$css_storedb && ($fp = @fopen("{$phpbb_root_path}styles/$theme_path/theme/stylesheet.css", 'wb'))) { $css_storedb = (fwrite($fp, $css_data)) ? 0 : 1; if (!$css_storedb) { // Get a list of all files and folders in the basis themes folder - $filelist = filelist($phpbb_root_path . 'styles/themes/' . $row['theme_path'], '', '*'); + $filelist = filelist($phpbb_root_path . 'styles/' . $row['theme_path'] . '/themes', '', '*'); // Copy every file bar the original stylesheet foreach ($filelist as $path => $file_ary) { foreach ($file_ary as $file) { - if ($file == $row['theme_path'] . '.css') + if ($file == 'stylesheet.css') { continue; } - if (!file_exists("{$phpbb_root_path}styles/themes/$theme_path/$path")) + if (!file_exists("{$phpbb_root_path}styles/$theme_path/theme/$path")) { - @mkdir("{$phpbb_root_path}styles/themes/$theme_path/$path"); + @mkdir("{$phpbb_root_path}styles/$theme_path/theme/$path"); } - @copy("{$phpbb_root_path}styles/themes/" . $row['theme_path'] . "/$path/$file", "{$phpbb_root_path}styles/themes/$theme_path/$path/$file"); + @copy("{$phpbb_root_path}styles/" . $row['theme_path'] . "/theme/$path/$file", "{$phpbb_root_path}styles/$theme_path/theme/$path/$file"); } } unset($filelist); @@ -1983,18 +1999,17 @@ function viewsource(url) // Output the page - adm_page_header($user->lang['EDIT_THEME']); + adm_page_header($user->lang[$l_prefix . '_THEME']); ?> -
lang['EDIT_THEME_EXPLAIN']; ?>
+lang[$l_prefix . '_THEME_EXPLAIN']; ?>
-