aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_styles.php18
-rw-r--r--phpBB/includes/constants.php2
-rw-r--r--phpBB/includes/functions.php11
3 files changed, 27 insertions, 4 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;
}
/**
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index 2ade1ac95e..3a798fc1ce 100644
--- a/phpBB/includes/constants.php
+++ b/phpBB/includes/constants.php
@@ -25,7 +25,7 @@ if (!defined('IN_PHPBB'))
*/
// phpBB Version
-define('PHPBB_VERSION', '3.0.10-RC2');
+define('PHPBB_VERSION', '3.0.10-RC3');
// QA-related
// define('PHPBB_QA', 1);
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 7ce83b871a..01b3ca92a9 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -4378,7 +4378,7 @@ function phpbb_http_login($param)
*/
function page_header($page_title = '', $display_online_list = true, $item_id = 0, $item = 'forum')
{
- global $db, $config, $template, $SID, $_SID, $user, $auth, $phpEx, $phpbb_root_path;
+ global $db, $config, $template, $SID, $_SID, $_EXTRA_URL, $user, $auth, $phpEx, $phpbb_root_path;
if (defined('HEADER_INC'))
{
@@ -4531,6 +4531,15 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
$s_search_hidden_fields['sid'] = $_SID;
}
+ if (!empty($_EXTRA_URL))
+ {
+ foreach ($_EXTRA_URL as $url_param)
+ {
+ $url_param = explode('=', $url_param, 2);
+ $s_hidden_fields[$url_param[0]] = $url_param[1];
+ }
+ }
+
// The following assigns all _common_ variables that may be used at any point in a template.
$template->assign_vars(array(
'SITENAME' => $config['sitename'],