diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-07-20 17:46:06 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-07-20 17:46:06 +0000 |
commit | 252d56ec36c049712302370036bbcf254698c240 (patch) | |
tree | 26c29969db0e94d5aa9c8cee210dce322923aa20 /phpBB/adm/admin_styles.php | |
parent | 6c8531befe2c31c49d89d9b1326d293f2773e2e9 (diff) | |
download | forums-252d56ec36c049712302370036bbcf254698c240.tar forums-252d56ec36c049712302370036bbcf254698c240.tar.gz forums-252d56ec36c049712302370036bbcf254698c240.tar.bz2 forums-252d56ec36c049712302370036bbcf254698c240.tar.xz forums-252d56ec36c049712302370036bbcf254698c240.zip |
Cannot delete if only theme left, select new theme for use by styles that use this
git-svn-id: file:///svn/phpbb/trunk@4298 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/adm/admin_styles.php')
-rw-r--r-- | phpBB/adm/admin_styles.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/phpBB/adm/admin_styles.php b/phpBB/adm/admin_styles.php index 95397c8928..fc3cf10226 100644 --- a/phpBB/adm/admin_styles.php +++ b/phpBB/adm/admin_styles.php @@ -1850,6 +1850,23 @@ function csspreview() if ($theme_id) { + $sql = 'SELECT theme_id, theme_name + FROM ' . STYLES_CSS_TABLE . ' + WHERE theme_id <> ' . $theme_id . ' + ORDER BY theme_id'; + $result = $db->sql_query($sql); + + $theme_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $theme_options .= '<option value="' . $row['theme_id'] . '">' . $row['theme_name'] . '</option>'; + } + + if ($theme_options == '') + { + trigger_error($user->lang['ONLY_THEME']); + } + $sql = 'SELECT * FROM ' . STYLES_CSS_TABLE . " WHERE theme_id = $theme_id"; @@ -1867,6 +1884,11 @@ function csspreview() WHERE theme_id = ' . $theme_id; $db->sql_query($sql); + $sql = 'UPDATE ' . STYLES_TABLE . ' + SET theme_id = ' . intval($_POST['newtheme']) . ' + WHERE theme_id = ' . $theme_id; + $db->sql_query($sql); + $onfs = 0; if (!empty($_POST['deletefs']) && is_writeable("{$phpbb_root_path}styles/themes/$theme_path")) { @@ -1931,6 +1953,10 @@ function csspreview() ?> <tr> + <td class="row1" width="40%"><b>Update styles to:</b><br /><span class="gensmall">Select theme to replace this one if used by styles.</span></td> + <td class="row2"><select name="newtheme"><?php echo $theme_options; ?></select></td> + </tr> + <tr> <td class="cat" colspan="2" align="center"><input class="btnmain" type="submit" name="update" value="<?php echo $user->lang['DELETE']; ?>"; /> <input class="btnlite" type="submit" name="cancel" value="<?php echo $user->lang['CANCEL']; ?>"; /></td> </tr> </table></form> |