? changes.diff
? geshi
? geshifilter.info
Index: INSTALL.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/geshifilter/INSTALL.txt,v
retrieving revision 1.3
diff -u -b -r1.3 INSTALL.txt
--- INSTALL.txt	8 Jun 2006 17:51:37 -0000	1.3
+++ INSTALL.txt	18 Feb 2007 15:26:19 -0000
@@ -1,9 +1,9 @@
-GeShiFilter Module
+GeSHiFilter Module
 
 ********************************************************************
                      D R U P A L    M O D U L E
 ********************************************************************
-Name: GeShiFilter module
+Name: GeSHiFilter module
 
 Maintainers:  Damien Pitard <dpdev00 AT gmail DOT com>
 
@@ -19,8 +19,10 @@
       http://qbnz.com/highlighter/.
 
 
-1. Place the entire geshifilter directory into your Drupal modules/
-   directory.
+1. Place the entire geshifilter directory into your Drupal 
+   "sites/site-name/modules" directory, where "site-name" is the name of the 
+   site for which you wish to install GeSHiFilter, or "all" if you would like
+   it to be available for all of your sites.
 
    
 2. Download GeSHi latest release from
@@ -28,12 +30,12 @@
      http://qbnz.com/highlighter/
 
    Remember to uncompress the file and make sure the folder is named
-   'geshi'.
+   "geshi".
 
    
-3. Place the entire 'geshi' engine folder (where geshi.php resides)
-inside your modules/geshifilter directory. So the Geshi engine will live
-in modules/geshifilter/geshi
+3. Place the entire "geshi" engine folder (where geshi.php resides)
+   inside your "sites/site-name/modules/geshifilter" directory, so the Geshi 
+   engine is in "sites/site-name/modules/geshifilter/geshi".
 
    
 4. Enable this module by navigating to:
Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/geshifilter/README.txt,v
retrieving revision 1.3
diff -u -b -r1.3 README.txt
--- README.txt	7 Jun 2006 20:49:58 -0000	1.3
+++ README.txt	18 Feb 2007 15:26:19 -0000
@@ -1,6 +1,6 @@
 GeSHi Filter Module
 Authors:  Vincent Filby <vfilby at gmail dot com>
-          Michael Hutchinson (http://compsoc.dur.ac.uk/~mjh/contact)
+          Michael Hutchinson (http://mjhutchinson.com/contact)
           Damien Pitard <dpdev00 at gmail dot com>
 
 GeSHi - Generic Syntax Highlighter
Index: geshi.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/geshifilter/geshi.css,v
retrieving revision 1.3
diff -u -b -r1.3 geshi.css
--- geshi.css	7 Jun 2006 20:26:33 -0000	1.3
+++ geshi.css	18 Feb 2007 15:26:19 -0000
@@ -13,3 +13,79 @@
 .me1 {color: #006600;}
 .li1 {}
 .li2 {font-weight: bold;}
\ No newline at end of file
+
+/*PHP*/
+.php .de1, .php .de2 {color: #000060; font-weight: normal;}.php .imp {font-weight: bold; color: red;}
+.php li {font-family: 'Courier New', Courier, monospace; color: #000060; background-color: #e0e0e0; padding-bottom: 2px;}
+.php li.li2 {font-weight: bold; color: #000090; line-height: 90%}
+.php .kw1 {color: #b1b100;}
+.php .kw2 {color: #000000; font-weight: bold;}
+.php .kw3 {color: #000066;}
+.php .co1 {color: #808080; font-style: italic;font-style: normal;}
+.php .co2 {color: #808080; font-style: italic;}
+.php .coMULTI {color: #808080; font-style: italic;font-style: normal;}
+.php .es0 {color: #000099; font-weight: bold;font-weight: normal;}
+.php .br0 {color: #66cc66;}
+.php .st0 {color: #ff0000;}
+.php .nu0 {color: #cc66cc;}
+.php .me1 {color: #006600;}
+.php .me2 {color: #006600;}
+.php .me {1}
+.php .re0 {color: #0000ff;}
+
+
+/*CSharp*/
+.csharp .de1, .csharp .de2 {color: #000060; font-weight: normal;}.csharp .imp {font-weight: bold; color: red;}
+.csharp li {font-family: 'Courier New', Courier, monospace; color: #000060; background-color: #e0e0e0; padding-bottom: 2px;}
+.csharp li.li2 {font-weight: bold; color: #000090; line-height: 90%}
+.csharp .kw1 {color: #0600FF;}
+.csharp .kw2 {color: #FF8000; font-weight: bold;}
+.csharp .kw3 {color: #008000;}
+.csharp .kw4 {color: #FF0000;}
+.csharp .kw5 {color: #000000;}
+.csharp .co1 {color: #008080; font-style: italic;font-style: normal;}
+.csharp .co2 {color: #008080;}
+.csharp .coMULTI {color: #008080; font-style: italic;font-style: normal;}
+.csharp .es0 {color: #008080; font-weight: bold;font-weight: normal;}
+.csharp .br0 {color: #008000;}
+.csharp .st0 {color: #808080;}
+.csharp .nu0 {color: #FF0000;}
+.csharp .me1 {color: #0000FF;}
+.csharp .me2 {color: #0000FF;}
+.csharp .me {1}
+
+/* bash */
+.bash .de1, .bash .de2 {color: #000060; font-weight: normal;}
+.bash .imp {font-weight: bold; color: red;}
+.bash li {font-family: 'Courier New', Courier, monospace; color: #000060; background-color: #e0e0e0; padding-bottom: 2px;}
+.bash .kw1 {color: #b1b100;}
+.bash .kw3 {color: #000066;}
+.bash .es0 {color: #000099; font-weight: bold;font-weight: normal;}
+.bash .br0 {color: #66cc66;}
+.bash .st0 {color: #ff0000;}
+.bash .nu0 {color: #cc66cc;}
+.bash .me {1}
+.bash .re0 {color: #0000ff;}
+.bash .re1 {color: #0000ff;}
+.bash .re2 {color: #0000ff;}
+.bash .re3 {color: #808080; font-style: italic;}
+.bash .re4 {color: #0000ff;}
+
+/* diff */
+.diff .de1, .diff .de2 {color: #000060; font-weight: normal;}
+.diff .imp {font-weight: bold; color: red;}
+.diff li {font-family: 'Courier New', Courier, monospace; color: #000060; background-color: #e0e0e0; padding-bottom: 2px;}
+.diff .kw1 {color: #aaaaaa; font-style: italic;}
+.diff .kw2 {color: #dd6611;}
+.diff .es0 {font-weight: normal;}
+.diff .me {1}
+.diff .re0 {color: #440088;}
+.diff .re1 {color: #991111;}
+.diff .re2 {color: #00b000;}
+.diff .re3 {color: #888822;}
+.diff .re4 {color: #888822;}
+.diff .re5 {color: #0011dd;}
+.diff .re6 {color: #440088;}
+.diff .re7 {color: #991111;}
+.diff .re8 {color: #00b000;}
+.diff .re9 {color: #888822;}
Index: geshifilter.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/geshifilter/geshifilter.css,v
retrieving revision 1.2
diff -u -b -r1.2 geshifilter.css
--- geshifilter.css	7 Jun 2006 20:49:58 -0000	1.2
+++ geshifilter.css	18 Feb 2007 15:26:19 -0000
@@ -1,19 +1,28 @@
-pre.geshifilter {
-	display:block;
-	padding:0.5em;
-	margin:0.5em;
+pre.geshifilter, div.geshifilter {
+  font-family: 'Courier New', Courier, monospace;
+  font-size: 103%;
+  background-color: #f0f0f0;
+  margin: 0.3em;
+  line-height: 107%;
+  color: #0000bb;
+  padding: 0.3em;
   border: 1px solid #CCC;
-  background-color: #FFFFFF;
+  width: 98%;
+  overflow: auto;
+  overflow-y : hidden;
+  height: auto;
 }
 
-div.geshifilter {
-	display:block;
-	padding:0.5em;
-	margin:0.5em;
-  border: 1px solid #CCC;
-  background-color: #FFFFFF;
+.geshifilter {
+  white-space: pre;
 }
 
+.geshifilter a:hover {background-color: #d6d6e6;}
+.geshifilter a:link {color: #006;}
+.geshifilter .head {font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;}
+.geshifilter .foot {font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-top: 1px solid #d0d0d0; padding: 2px;}
+
+
 code.geshifilter {
 	display:inline;
 	padding:0;
Index: geshifilter.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/geshifilter/geshifilter.module,v
retrieving revision 1.3
diff -u -b -r1.3 geshifilter.module
--- geshifilter.module	26 Jun 2006 23:43:50 -0000	1.3
+++ geshifilter.module	18 Feb 2007 15:26:20 -0000
@@ -1,8 +1,24 @@
 <?php // $Id: geshifilter.module,v 1.3 2006/06/26 23:43:50 dpdev Exp $ //
 
 require_once(variable_get('geshifilter_geshi_dir', drupal_get_path('module', 'geshifilter').'/geshi').'/geshi.php');
-theme_add_style(drupal_get_path('module', 'geshifilter') . '/geshifilter.css');
-theme_add_style(drupal_get_path('module', 'geshifilter') . '/geshi.css');
+drupal_add_css(drupal_get_path('module', 'geshifilter') .'/geshifilter.css');
+drupal_add_css(drupal_get_path('module', 'geshifilter') .'/geshi.css');
+
+/**
+ * Implementation of hook_menu()
+ */
+function geshifilter_menu($may_cache) {
+  $items[] = array(
+    'path' => 'admin/settings/geshifilter',
+    'title' => t('GeSHi Filter'),
+    'description' => t('Syntax highlighting options.'),
+    'callback' => 'drupal_get_form',
+    'callback arguments' => array('geshifilter_admin_settings'),
+    'access' => user_access('administer site configuration'),
+    'type' => MENU_NORMAL_ITEM,
+  );
+  return $items;
+}
 
 
 
@@ -11,8 +27,6 @@
  */
 function geshifilter_help($section) {
   switch ($section) {
-    case 'admin/modules#description':
-      return t("Provides tags for syntax-highlighting code automatically.");
   }
 }
 
@@ -20,7 +34,6 @@
  * Implementation of hook_filter_tips()
  */
 function geshifilter_filter_tips($delta, $format, $long = false) {
-
 	$default_type = variable_get('geshifilter_default_type_'.$format, 0);
 	$types = variable_get('geshifilter_types_'.$format, array());
 	$start_param = variable_get('geshifilter_start_param', FALSE);
@@ -28,7 +41,6 @@
 	$inline_code=variable_get('geshifilter_inline_code_'.$format, FALSE);
 	
   if ($long) {
-		
 		$text=t('<h3>Code:</h3>');
 		
 		//some language are allowed, type param is supported
@@ -37,7 +49,6 @@
 			$text .= t('<p>To post highlighted code, surround it code with &lt;blockcode &#91;type=&quot;<em>language</em>&quot;&#93;&gt;...&lt;/blockcode&gt tags.</p>
 <p>E.g. actionscript block code:
 <pre>&lt;blockcode type=&quot;<em>actionscript</em>&quot;&gt;<br />...<br />&lt;/blockcode&gt;</pre></p>');
-			
 			if ($inline_code) {
 				$text .= t('<p>You may also post highlighted inline code surrounding it with &lt;code &#91;type=&quot;<em>language</em>&quot;&#93;&gt;...&lt;/code&gt tags.</p>
 <p>E.g. highlight actionscript inline code:
@@ -46,13 +57,11 @@
 
 			if ($default_type) {
 				$text .= t('<p>If you don\'t use <em>type=&quot;language&quot;</em> param or specify an unsupported language, the code will be highlighted as %default-code code.</p>', array('%default-code' => theme('placeholder', $default_type)));
-			}
-			else {
+      } else {
 			$text .= t('<p>If you don\'t use <em>type=&quot;language&quot;</em> param or specify an unsupported language, the code will not be highlighted.</p>');
 			} 
 			
 			$supported_types = array_keys($types, TRUE);
-			
 			$text .= t('<p>The following languages are supported for highlight:<br />%type_list.</p>', array('%type_list' => theme('item_list', $supported_types)));
 		
 		}
@@ -62,7 +71,6 @@
 			$text.= t('<p>To post code, surround it with &lt;blockcode&gt;...&lt;/blockcode&gt tags.</p>
 <p>E.g. :
 <pre>&lt;blockcode&gt;<br />...<br />&lt;/blockcode&gt;</pre></p>');
-			
 			if ($inline_code) {
 				$text.= t('<p>You may also post inline code surrounding it with &lt;code&gt;...&lt;/code&gt tags.</p>
 <p>E.g. :
@@ -118,7 +126,7 @@
 /**
  * Admin page linked from menu
  */
-function geshifilter_settings() {
+function geshifilter_admin_settings() {
 
 	$form = array();
 
@@ -248,13 +256,13 @@
 		'#default_value' => variable_get('geshifilter_debug', FALSE),
 		'#description' => t('Enable the verbose mode for debugging.'));		
 		
-  return $form;
+  return system_settings_form($form);
 }
 
 /*
  * Validate the settings form
  */
-function geshifilter_settings_form_validate($form_id, $form_values) {
+function geshifilter_admin_settings_validate($form_id, $form_values) {
 
 	$form_values['geshifilter_geshi_dir'] = rtrim($form_values['geshifilter_geshi_dir'], '/\\');
 	$form_values['geshifilter_lang_dir'] = rtrim($form_values['geshifilter_lang_dir'], '/\\');
@@ -380,7 +388,8 @@
   $debug = variable_get('geshifilter_debug', FALSE);
   
   $tags='blockcode'.($inline_code?'|code':'');
-	if (preg_match_all('/<('.$tags.')((?:\s(?:.|\s|\z)*?)*)\s*>((?:.|\s|\z)*?)<\/\1\s*>/i', $text, $match)) {
+  if (preg_match_all('/<('.$tags.')((?:\s(?:.|\s|\z)*?)*)\s*>\s*((?:.|\s|\z)*?)\s*<\/\1\s*>\s*/i', $text, $match)) {
+  
 		// $match[0][xx] .... fully matched string <blockcode type="language">...</blockcode>
 		// $match[1][xx] .... tag
 		// $match[2][xx] .... full params string type="language"...
@@ -476,6 +485,10 @@
 		}	
 	}
 	
+  //FIXME: removing extra whitespace from start of <pre> rag, or it we gat a blank line
+  //it's a quick hack: there must be a better way to do this in the regex
+  $text = str_replace('"geshifilter">&nbsp;', '"geshifilter">', $text);
+  
 	return $text;
 }
 
