diff options
author | Andreas Fischer <bantu@phpbb.com> | 2012-01-02 18:53:55 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2012-01-02 18:53:55 +0100 |
commit | 2345be38b682a58f9b5e5429c76db97a0564093d (patch) | |
tree | fe39c5f348f86c23f3c9af9011d6d0c1b0c0baf5 /phpBB/includes/acp/acp_styles.php | |
parent | c8da5ad9f42d8ced1aead79a42cc5caee5c5a2ff (diff) | |
parent | e14c3f3b77ab07ce97f357a15db5db5101df06c1 (diff) | |
download | forums-2345be38b682a58f9b5e5429c76db97a0564093d.tar forums-2345be38b682a58f9b5e5429c76db97a0564093d.tar.gz forums-2345be38b682a58f9b5e5429c76db97a0564093d.tar.bz2 forums-2345be38b682a58f9b5e5429c76db97a0564093d.tar.xz forums-2345be38b682a58f9b5e5429c76db97a0564093d.zip |
Merge branch 'prep-release-3.0.10'
* prep-release-3.0.10: (221 commits)
[prep-release-3.0.10] Bumping version number for 3.0.10 final.
[prep-release-3.0.10] Update Changelog for 3.0.10-RC3 release.
[ticket/10531] Disallow deleting of the last style
[ticket/8996] Revert initial fix to keep old behaviour on empty selection Part2
[ticket/8996] Revert initial fix to keep old behaviour on empty selection
[ticket/10319] Missing hidden fields in search form
[ticket/10504] Revert the changes for widescreen optimisation PHPBB3-6632
[ticket/10504] Revert the changes for widescreen optimisation PHPBB3-10408
[ticket/10504] Revert the changes for widescreen optimisation PHPBB3-10485
[prep-release-3.0.10] Bumping version number for 3.0.10-RC3.
[ticket/10480] Add a build target for changelog building.
[ticket/10480] Add a build script for exporting the changelog from tracker.
[ticket/10502] Fix typo in changelog. 'red' should have been 'read'.
[prep-release-3.0.10] Remove duplicate ticket PHPBB3-10490 from changelog.
[ticket/10501] Fix description of table prefixes
[ticket/10503] Debug error "Invalid arguments" when previewing edits
[prep-release-3.0.10] Update Changelog for 3.0.10-RC2 release.
[ticket/10497] Fix SQL error when guest visits forum with unread topic
[prep-release-3.0.10] Bumping version number for 3.0.10-RC2.
[ticket/10461] Add a comment explaining the logic here.
...
Diffstat (limited to 'phpBB/includes/acp/acp_styles.php')
-rw-r--r-- | phpBB/includes/acp/acp_styles.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 3bc8c86500..5300265686 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -1634,6 +1634,13 @@ parse_css_file = {PARSE_CSS_FILE} trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING); } + $s_only_component = $this->display_component_options($mode, $style_row[$mode . '_id'], $style_row); + + if ($s_only_component) + { + trigger_error($user->lang['ONLY_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING); + } + if ($update) { if ($mode == 'style') @@ -1678,8 +1685,6 @@ parse_css_file = {PARSE_CSS_FILE} trigger_error($user->lang[$message] . adm_back_link($this->u_action)); } - $this->display_component_options($mode, $style_row[$mode . '_id'], $style_row); - $this->page_title = 'DELETE_' . $l_prefix; $template->assign_vars(array( @@ -1765,11 +1770,14 @@ parse_css_file = {PARSE_CSS_FILE} /** * Display the options which can be used to replace a style/template/theme/imageset + * + * @return boolean Returns true if the component is the only component and can not be deleted. */ function display_component_options($component, $component_id, $style_row = false, $style_id = false) { global $db, $template, $user; + $is_only_component = true; $component_in_use = array(); if ($component != 'style') { @@ -1801,6 +1809,9 @@ parse_css_file = {PARSE_CSS_FILE} $s_options = ''; if (($component != 'style') && empty($component_in_use)) { + // If it is not in use, there must be another component + $is_only_component = false; + $sql = "SELECT {$component}_id, {$component}_name FROM $sql_from WHERE {$component}_id = {$component_id}"; @@ -1824,6 +1835,7 @@ parse_css_file = {PARSE_CSS_FILE} { if ($row[$component . '_id'] != $component_id) { + $is_only_component = false; $s_options .= '<option value="' . $row[$component . '_id'] . '">' . sprintf($user->lang['REPLACE_WITH_OPTION'], $row[$component . '_name']) . '</option>'; } else if ($component != 'style') @@ -1851,6 +1863,8 @@ parse_css_file = {PARSE_CSS_FILE} } } } + + return $is_only_component; } /** |