--- customerror.module 2007-01-08 16:31:55.000000000 +0100 +++ customerror.module 2008-07-04 16:49:34.000000000 +0200 @@ -60,8 +60,17 @@ function customerror_admin_settings() '#value' => t('Enter the error pages that will be seen by your visitors when they get the respective errors. You can enter any HTML text. You can point the users to the FAQ, inform them that you reorganized the site, ask them to report the error, login or register, ...etc.') ) ); - + $errors = _customerror_enum_errors(); + + // get custom themes. + $themes = system_theme_data(); + ksort($themes); + $options[0] = t('System default'); + foreach ($themes as $theme) { + $options[$theme->name] = $theme->name; + } + foreach($errors as $error_code => $error_desc) { $form['customerror_' . $error_code . '_title'] = array( '#type' => 'textfield', @@ -84,6 +93,15 @@ function customerror_admin_settings() '#default_value' => variable_get('customerror_' . $error_code . '_php', FALSE), '#description' => t('This allows you to include PHP code (enclosed in <?php ?> tags) for the %error_code (%error_desc) message. Note that this can be dangerous in some situations. Make sure that you are aware of the implications.', array('%error_code' => $error_code, '%error_desc' => $error_desc)), ); + + // custom theme for error_page, 403 has the admin_theme as default. + $form['customerror_' . $error_code . '_theme'] = array( + '#type' => 'select', + '#options' => $options, + '#title' => t(' Theme'), + '#description' => t('Choose which theme the dould be used on the error page.'), + '#default_value' => variable_get('customerror_' . $error_code . '_theme', ($error_code == 403 ? variable_get('admin_theme', 0) : 0)), + ); } return system_settings_form($form); @@ -91,7 +109,6 @@ function customerror_admin_settings() function customerror_menu($may_cache) { $items = array(); - if ($may_cache) { $items[] = array( 'path' => 'admin/settings/customerror', @@ -119,7 +136,13 @@ function customerror_menu($may_cache) { function customerror_page() { $error_code = arg(1); - + + // set custom theme for error_page if any has been selected, 0 => default + $theme = variable_get('customerror_' . $error_code . '_theme', ($error_code == 403 ? variable_get('admin_theme', 0) : 0)); + if(!empty($theme)){ + $custom_theme = $theme; + } + switch($error_code) { case 403: case 404: