--- customerror.module-old	2005-08-10 12:31:25.332414544 +1200
+++ customerror.module	2005-08-11 10:31:03.892443800 +1200
@@ -57,17 +57,30 @@
  */
 function customerror_settings()
 {
-  $output .= t('<p>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.</p>');
+  $output .= t('<p>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.</p><br />');
 
   foreach(_customerror_enum_errors() as $error_code => $error_desc) {
-    $output .= form_textfield(t('Title for ') . $error_code,
+    $group = '';
+    $group .= form_textfield(t('Title'),
       'customerror_' . $error_code . '_title',
       variable_get('customerror_' . $error_code . '_title', $error_desc), 70, 70,
       t('Title of ' . $error_code . ' error page'));
 
-    $output .= form_textarea(t('Description for ') . $error_code, 'customerror_' . $error_code,
+    $group .= form_textarea(t('Body'), 'customerror_' . $error_code,
       variable_get('customerror_' . $error_code, $error_desc), 70, 7,
       t('This text will be displayed if a ' . $error_code . '('. $error_desc . ') error occurs.'));
+      
+    $group .= form_select(t('Select whether you want to use a THEMED or FULL error page'),
+      'customerror_' . $error_code . '_page_type', variable_get('customerror_' . $error_code . '_page_type', 'themed'),
+       drupal_map_assoc(array('themed', 'full')),
+       t('A THEMED page is one surrounded by your current Drupal theme. A FULL page allows you to enter a completely custom page.<br>'));
+
+    $group .= form_checkbox(t('Allow embedded PHP code in error page'), 'customerror_' . $error_code . '_php', 1,
+      variable_get('customerror_' . $error_code . '_php',0),
+      t('If this option is enabled, the body text can have embedded &lt;?php...?&gt; tags with PHP code inside.'));      
+      
+    $output .= form_group(t('Settings for ') . $error_code . t(' error pages'),$group); 
+    
   }
 
   return $output;
@@ -107,7 +120,17 @@
       $body = _customerror_fetch_error($error);
       break;
   }
-  print theme('page', $body);
+  
+  if (variable_get('customerror_' . $error . '_php', 0)) {
+    $body = drupal_eval($body);
+  }
+  
+  if (variable_get('customerror_' . $error . '_page_type', 'themed') == 'themed') {
+    print theme('page', $body);
+  }
+  else {
+    print $body;
+  }
 }
 
 
