Index: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG	(revision 755)
+++ trunk/CHANGELOG	(revision 756)
@@ -13,6 +13,7 @@
 ------------------------------------- 2.7.0 -------------------------------------
 15-Mar-2008 Thomas Hornik
 #	menulink: link can be menulink or subpage of menulink, too
+#	call_captcha: added parameter 'style', fixed some issue with parameter 'image' and text-style captchas
 13-Mar-2008 Christian Sommer
 ! 	adjusted error/warning templates to the updated backend layout
 13-Mar-2008 Matthias Gallas
Index: trunk/wb/include/captcha/captcha.php
===================================================================
--- trunk/wb/include/captcha/captcha.php	(revision 755)
+++ trunk/wb/include/captcha/captcha.php	(revision 756)
@@ -79,7 +79,7 @@
 }
 
 if(!function_exists('call_captcha')) {
-	function call_captcha($action='all') {
+	function call_captcha($action='all', $style='') {
 		global $MOD_CAPTCHA;
 		$t = time();
 		$_SESSION['captcha_time'] = $t;
@@ -90,7 +90,7 @@
 				case 'text': // text-captcha
 					?><table class="captcha_table"><tr>
 					<td class="text_captcha"><?php include(WB_PATH.'/include/captcha/captchas/'.CAPTCHA_TYPE.'.php'); ?></td>
-					<td><input type="text" name="captcha" maxlength="50"  style="width:150px" /></td>
+					<td><input type="text" name="captcha" maxlength="50"  style="width:150px;" /></td>
 					<td class="captcha_expl"><?php echo $MOD_CAPTCHA['VERIFICATION_INFO_QUEST']; ?></td>
 					</tr></table><?php
 					break;
@@ -98,7 +98,7 @@
 				case 'calc_text': // calculation as text
 					?><table class="captcha_table"><tr>
 					<td class="text_captcha"><?php include(WB_PATH.'/include/captcha/captchas/'.CAPTCHA_TYPE.'.php'); ?>&nbsp;=&nbsp;</td>
-					<td><input type="text" name="captcha" maxlength="10"  style="width:20px" /></td>
+					<td><input type="text" name="captcha" maxlength="10"  style="width:20px;" /></td>
 					<td class="captcha_expl"><?php echo $MOD_CAPTCHA['VERIFICATION_INFO_RES']; ?></td>
 					</tr></table><?php
 					break;
@@ -106,7 +106,7 @@
 				case 'calc_ttf_image': // calculation with varying background and ttf-font
 					?><table class="captcha_table"><tr>
 					<td class="image_captcha"><img src="<?php echo WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t"; ?>" alt="Captcha" /></td><td>&nbsp;=&nbsp;</td>
-					<td><input type="text" name="captcha" maxlength="10" style="width:20px" /></td>
+					<td><input type="text" name="captcha" maxlength="10" style="width:20px;" /></td>
 					<td class="captcha_expl"><?php echo $MOD_CAPTCHA['VERIFICATION_INFO_RES']; ?></td>
 					</tr></table><?php
 					break;
@@ -115,7 +115,7 @@
 				case 'old_image': // old captcha
 					?><table class="captcha_table"><tr>
 					<td class="image_captcha"><img src="<?php echo WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t"; ?>" alt="Captcha" /></td>
-					<td><input type="text" name="captcha" maxlength="10" style="width:50px" /></td>
+					<td><input type="text" name="captcha" maxlength="10" style="width:50px;" /></td>
 					<td class="captcha_expl"><?php echo $MOD_CAPTCHA['VERIFICATION_INFO_TEXT']; ?></td>
 					</tr></table><?php
 					break;
@@ -124,53 +124,49 @@
 			switch(CAPTCHA_TYPE) {
 				case 'text': // text-captcha
 				case 'calc_text': // calculation as text
+					echo ($style?"<span $style>":'');
 					include(WB_PATH.'/include/captcha/captchas/'.CAPTCHA_TYPE.'.php');
+					echo ($style?'</span>':'');
 					break;
 				case 'calc_image': // calculation with image (old captcha)
 				case 'calc_ttf_image': // calculation with varying background and ttf-font
 				case 'ttf_image': // captcha with varying background and ttf-font
 				case 'old_image': // old captcha
-					echo WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t";
+					echo "<img $style src=\"".WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t\" />";
 					break;
 			}
 		} elseif($action=='input') {
 			switch(CAPTCHA_TYPE) {
 				case 'text': // text-captcha
-					?><input type="text" name="captcha" maxlength="50"  style="width:150px" /><?php
+					echo '<input type="text" name="captcha" '.($style?$style:'style="width:150px;" maxlength="50"').' />';
 					break;
 				case 'calc_text': // calculation as text
-					?><input type="text" name="captcha" maxlength="10"  style="width:20px" /><?php
-					break;
 				case 'calc_image': // calculation with image (old captcha)
 				case 'calc_ttf_image': // calculation with varying background and ttf-font
-					?><input type="text" name="captcha" maxlength="10" style="width:20px" /><?php
+					echo '<input type="text" name="captcha" '.($style?$style:'style="width:20px;" maxlength="10"').' />';
 					break;
-				// normal images
 				case 'ttf_image': // captcha with varying background and ttf-font
 				case 'old_image': // old captcha
-					?><input type="text" name="captcha" maxlength="10" style="width:50px" /><?php
+					echo '<input type="text" name="captcha" '.($style?$style:'style="width:50px;" maxlength="10"').' />';
 					break;
 			}
 		} elseif($action=='text') {
+			echo ($style?"<span $style>":'');
 			switch(CAPTCHA_TYPE) {
-				// one special case
 				case 'text': // text-captcha
 					echo $MOD_CAPTCHA['VERIFICATION_INFO_QUEST'];
 					break;
-				// two special cases
 				case 'calc_text': // calculation as text
-					echo $MOD_CAPTCHA['VERIFICATION_INFO_RES'];
-					break;
 				case 'calc_image': // calculation with image (old captcha)
 				case 'calc_ttf_image': // calculation with varying background and ttf-font
 					echo $MOD_CAPTCHA['VERIFICATION_INFO_RES'];
 					break;
-				// normal images
 				case 'ttf_image': // captcha with varying background and ttf-font
 				case 'old_image': // old captcha
 					echo $MOD_CAPTCHA['VERIFICATION_INFO_TEXT'];
 					break;
 			}
+			echo ($style?'</span>':'');
 		}
 	}
 }
Index: trunk/wb/include/captcha/readme.txt
===================================================================
--- trunk/wb/include/captcha/readme.txt	(revision 755)
+++ trunk/wb/include/captcha/readme.txt	(revision 756)
@@ -20,27 +20,59 @@
 
 
 
-
-One can improve CAPTCHA-type "CAPTCHA with varying fonts and backgrounds"
+One can improve all CAPTCHA-types with varying fonts and backgrounds
 - by adding backgrounds (PNG-images, 140x40 pixels) to backgrounds/
 - and by adding TrueType-fonts to fonts/
 
 
 How to use:
-use 
-	require_once(WB_PATH.'/include/captcha/captcha.php'); // will output a table with 3 columns: |CAPTCHA|Input|Text|. The calc_image captcha have 4 columns |CAPTCHA|=|Input|Text|.
-and put 
-	<?php call_captcha(); ?>
-into your form.
 
+1.)
+put 
+  require_once(WB_PATH.'/include/captcha/captcha.php');
+in your file.
 
-The CAPTCHA-code is allways stored in $_SESSION['captcha']
-The user-input is in $_POST['captcha'] (or $_GET['captcha']).
 
-
-call_captcha() will output code like this
+2a.)
+put 
+  <?php call_captcha(); ?>
+into your form.
+This will output a table with varying columns (3 or 4) like this example:
 <table class="captcha_table"><tr>
-  <td><img src="<?php echo WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t"; ?>" alt="Captcha" /></td>
+  <td><img src="http://www.example.org/include/captcha/captchas/ttf.php?t=64241454" alt="Captcha" /></td>
   <td><input type="text" name="captcha" maxlength="5" style="width:50px" /></td>
-  <td class="captcha_expl"><?php echo $MOD_CAPTCHA['VERIFICATION_INFO_TEXT']; ?></td>
+  <td class="captcha_expl">Fill in the result</td>
 </tr></table>
+
+
+2b.)
+If you want to use your own layout, use additional parameters to call_captcha():
+call_captcha('all') will output the whole table as above.
+
+call_captcha('image', $style); will output the <img>-tag for the image only (or the text for an text-style captcha):
+Examples:
+  call_captcha('image', 'style="...; title="captcha"');
+    <img style="...; title="captcha" src="http://www.example.org/include/captcha/captchas/captcha.php?t=46784246" />
+    or
+    <span style="...; title="captcha">4 add 6</span>
+	call_captcha('image');
+    <img src="http://www.example.org/include/captcha/captchas/captcha.php?t=46784246" />
+    or
+    4 add 6
+
+call_captcha('input', $style); will output the input-field:
+  call_captcha('input', 'style"...;"');
+    <input type="text" name="captcha" style="...;" />
+  call_captcha('input');
+    <input type="text" name="captcha" style="width:50px;" maxlength="10" />
+
+call_captcha('text', $style); will output a short "what to do"-text
+  call_captcha('text', 'style="...;"');
+	  <span style="...;">Fill in the result</span>
+  call_captcha('text');
+	  Fill in the result
+
+
+
+The CAPTCHA-code is allways stored in $_SESSION['captcha'] for verification with user-input.
+The user-input is in $_POST['captcha'] (or maybe $_GET['captcha']).
