Skip to content
Snippets Groups Projects
Commit c0256aff authored by Gisle Hannemyr's avatar Gisle Hannemyr
Browse files

by gisle: Fixed disabled themes showing up as eligible.

parent cb3a4895
Branches
Tags 6.x-1.4
No related merge requests found
......@@ -86,6 +86,18 @@ Note that customerror keeps track of what page the user is trying to
access, so after logging in, the user will be redirected to that page.
Theme to be used on the error page
----------------------------------
If you've set an administration theme, the default is to use this on
all pages where the path is "admin", including 403 and 404 error
pages. You can overide this by specifying a theme for custom error
different from "System default".
This setting has no effect if the administration theme is set to
"<System default>".
Custom redirects for 404 errors
-------------------------------
......
......@@ -74,7 +74,9 @@ function customerror_admin_settings() {
ksort($themes);
$theme_options[0] = t('System default');
foreach ($themes as $theme) {
$theme_options[$theme->name] = $theme->name;
if ($theme->status) {
$theme_options[$theme->name] = $theme->name;
}
}
$errors = _customerror_enum_errors();
......@@ -116,8 +118,8 @@ function customerror_admin_settings() {
'#type' => 'select',
'#options' => $theme_options,
'#title' => t('Theme'),
'#description' => t('Theme to be used on the error page.'),
'#default_value' => customerror_get_theme($code),
'#description' => t('Theme to be used on the error page below the admin path.'),
'#default_value' => variable_get('customerror_' . $code . '_theme', 0),
);
$form[$group]['customerror_' . $code . '_php'] = array(
'#type' => 'checkbox',
......@@ -129,7 +131,7 @@ function customerror_admin_settings() {
$form['redirects'] = array(
'#type' => 'fieldset',
'#title' => t('Redirects'),
'#title' => t('404 Redirects'),
'#collapsed' => TRUE,
'#collapsible' => TRUE,
);
......@@ -279,10 +281,11 @@ function customerror_check_redirect() {
return;
}
$redirect_list = explode("\n", variable_get('customerror_redirect', ''));
if (empty($redirect_list)) {
$redirects = trim(variable_get('customerror_redirect', ''));
if (empty($redirects)) {
return;
}
$redirect_list = explode("\n", $redirects);
foreach ($redirect_list as $item) {
list($src, $dst) = explode(' ', $item);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment