Index: title.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/title/title.module,v
retrieving revision 1.17
diff -u -F^f -r1.17 title.module
--- title.module	27 Sep 2004 16:27:24 -0000	1.17
+++ title.module	27 Sep 2004 17:36:37 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: title.module,v 1.17 2004/09/27 16:27:24 philippe Exp $
+// $Id: title.module,v 1.16 2004/09/20 19:31:45 dries Exp $
 
 /**
  * Implementation of hook_help().
@@ -89,7 +89,13 @@ function title_filter($op, $delta = 0, $
  * Filter [Node title|Description] links. '|Description' is optional.
  */
 function _title_filter_process($text) {
-  $pattern = '\[([^\|\]\n]+)(?>\|?)([^\]\n]*)\]';
+  $begin_tag=variable_get("title_begin_tag_$format","\["); 
+  $end_tag=variable_get("title_end_tag_$format","\[");
+
+  
+  $pattern = $begin_tag;
+  $pattern .= '([^\|\]\n]+)(?>\|?)([^\]\n]*)';
+  $pattern .= $end_tag;
   // $1 == title: matches at least 1 char up to the first '|' or ']'.
   // $2 == text: matches all after a following '|' (if there is) up to the next ']'.
   //   May include '|'s.
@@ -97,6 +103,20 @@ function _title_filter_process($text) {
   return preg_replace("/$pattern/e", $replacement, $text);
 }
 
+function _title_filter_settings($format) {
+  $group = form_textfield(t('begin tag'),
+			  "title_begin_tag_$format", 
+			  variable_get("title_begin_tag_$format","["), 
+			  5,32);
+  $group .= form_textfield(t('end tag'),
+			   "title_end_tag_$format", 
+			   variable_get("title_end_tag_$format","]"), 
+			   5,32,
+			   t('Set the begin tag and end tag to delimit the way users mark their titles. Note that changing these values may break existing pages on your site.'));
+
+  $output .= form_group(t('Title filter'), $group);
+  return $output;
+}
 function title_filter_tips($delta, $format, $long = false) {
   if ($long){
     return t('Wiki-like [node title|text] links are enabled. These shortcuts generate a link labeled "text" to the node with the title "node title". If you omit "|text", the label becomes "node title". You may use a substring of a node title if desired. When multiple matching titles are found, a list of matching nodes will be displayed. If no matching titles are found, a full-text search is returned.');
