? .gotwo.module.swo
? .gotwo.module.swp
Index: gotwo.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/gotwo/gotwo.module,v
retrieving revision 1.5.2.3
diff -u -p -r1.5.2.3 gotwo.module
--- gotwo.module	3 Nov 2007 10:35:09 -0000	1.5.2.3
+++ gotwo.module	3 Nov 2007 17:33:10 -0000
@@ -186,6 +186,12 @@ function __gotwo_filter($args, $text) {
       $args .= $key.'="'.htmlspecialchars($value).'" ';
     }
   }
+  
+  if (variable_get('gotwo_word_wrap',0)) {
+    $char = variable_get('gotwo_break_char'," ");
+    $len = variable_get('gotwo_word_length',25);
+    $text = wordwrap($text, $len, $char, 1);
+  }
   return "<a $args>$text</a>";
 }
 
@@ -326,6 +332,26 @@ function gotwo_admin_settings() {
     '#description' => t('Target labels are the parts after the "go/" part of the shown url. The absolute maximum is 128.'),
     '#default_value' => min(variable_get('gotwo_max_length', 128), 128),
   );
+  
+  $form['gotwo_word_wrap'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Break up url text at specific width'),
+    '#description' => t('Try to ensure long url text is broken up, using the wordwrap() function.'),
+    '#default_value' => variable_get('gotwo_word_wrap', 0),
+   );
+
+  $form['gotwo_word_length'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Maximum width of words if word wrapping is enabled above.'),
+    '#description' => t('Numerical width at which to break url text.'),
+    '#default_value' => variable_get('gotwo_word_length', 25),
+   );
+
+  $form['gotwo_break_char'] = array(
+    '#type' => 'select',
+    '#title' => t('Character to use when breaking up long url text.'),
+    '#options' => array(" " => t('space'), "\n" => t('newline')),
+  );
 
   $form['gotwo_disclaimer_boolean'] = array(
     '#type' => 'checkbox',
