Index: codefilter.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/codefilter/codefilter.module,v
retrieving revision 1.21.2.5
diff -u -F^f -r1.21.2.5 codefilter.module
--- codefilter.module	28 Dec 2006 22:49:07 -0000	1.21.2.5
+++ codefilter.module	28 Apr 2007 15:01:01 -0000
@@ -35,6 +35,11 @@ function codefilter_process_php($text) {
   $text = trim($text, "\r\n");
   // Highlight as PHP
   $text = '<div class="codeblock">'. highlight_string("<?php\n$text\n?>", 1) .'</div>';
+  // strip out opening/closing tags
+  if (!variable_get('codefilter_tags', 1)) {
+    $text = str_replace("&lt;?php<br />", "", $text);
+    $text = str_replace("?&gt;", "", $text);
+  }
   // Remove newlines to avoid clashing with the linebreak filter
   $text = str_replace("\n", '', $text);
   return codefilter_fix_spaces($text);
@@ -94,6 +99,21 @@ function codefilter_filter($op, $delta =
 
     case 'description':
       return t('Allows users to post code verbatim using &lt;code&gt; and &lt;?php ?&gt; tags.');
+      
+    case 'settings':
+      $form['codefilter'] = array(
+        '#type' => 'fieldset',
+        '#title' => t('Codefilter'),
+        '#collapsible' => TRUE,
+        '#collapsed' => FALSE,
+      );
+      $form['codefilter']['codefilter_tags'] = array(
+        '#type' => 'checkbox',
+        '#title' => t("Include opening/closing PHP tags"),
+        '#description' => t("Show <em>&lt;?php</em> and <em>?&gt;</em> in PHP-only blocks."),
+        '#default_value' => variable_get('codefilter_tags', 1),
+      );
+      return $form;
 
     case 'prepare':
       // Note: we use the bytes 0xFE and 0xFF to replace < > during the filtering process.
