mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
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
This commit is contained in:
parent
6c8531befe
commit
252d56ec36
1 changed files with 26 additions and 0 deletions
|
@ -1850,6 +1850,23 @@ function csspreview()
|
||||||
|
|
||||||
if ($theme_id)
|
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 *
|
$sql = 'SELECT *
|
||||||
FROM ' . STYLES_CSS_TABLE . "
|
FROM ' . STYLES_CSS_TABLE . "
|
||||||
WHERE theme_id = $theme_id";
|
WHERE theme_id = $theme_id";
|
||||||
|
@ -1867,6 +1884,11 @@ function csspreview()
|
||||||
WHERE theme_id = ' . $theme_id;
|
WHERE theme_id = ' . $theme_id;
|
||||||
$db->sql_query($sql);
|
$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;
|
$onfs = 0;
|
||||||
if (!empty($_POST['deletefs']) && is_writeable("{$phpbb_root_path}styles/themes/$theme_path"))
|
if (!empty($_POST['deletefs']) && is_writeable("{$phpbb_root_path}styles/themes/$theme_path"))
|
||||||
{
|
{
|
||||||
|
@ -1930,6 +1952,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>
|
<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>
|
<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>
|
</tr>
|
||||||
|
|
Loading…
Add table
Reference in a new issue