Extension:EditPageMultipleInputTextAreas

New extension to get multiple input fields within the Editpage This extension is in 'progress', started from 19-9-2007.

Progress report / current status:
 * New version 0.2 (20-09-2007)
 * Working
 * CSS Customizable possible
 * Auto expansion script

To do:
 * improve page last minute display, now all articles are covered with chosen structure
 * implement multiple structure options

Please improve the script where possible. If so, include the changes in a change log somewhere in this article.



 'EditTextAreas', 'author' => 'Boudewijn Vahrmeijer', 'url' => 'http://www.leerwiki.nl',        //See for updates on new MW versions: www.leerwiki.nl 'version' => '1.11,1.10.1/1.9.3/1.9.2/1.8.2', );

//####### Choose parameters ############## $BoxNames=array('Intro','Core','Conclusion','More'); 	//choose names, minimum is ONE $Separator='.//.'; //Choose dummy separator for combining text input

//####### Used Hooks ###################### $wgHooks['EditPage::showEditForm:fields'][] = 'TextareaDisplay'; $wgHooks['EditPage::attemptSave'][] = 'CombineBeforeSave'; $wgHooks['EditPage::showEditForm:initial'][] = 'OptionSetting'; $wgHooks['OutputPageBeforeHTML'][] = 'LastMinuteStyleChange';

//####### Formula preparation ############## $TotalTB=count($BoxNames);

//######## Start Formulas ################# function TextareaDisplay(&$q,&$out) { global $TotalTB,$BoxNames,$Separator; if(TotalTB>1) return true; for($i=0;$i<$TotalTB-1;$i++){ $AllText=$q->textbox1; $ArrayTextTemp=explode($Separator,$AllText);		//cut imported text in pieces $out->addHTML(<<= t.cols) b+= Math.floor(a[x].length/t.cols); }	 b+= a.length; if (b > t.rows && nua.indexOf('opera') == -1) t.rows = b;	 } textarea {	width: 550px;	padding: .1em;	}' END .$BoxNames[$i]." " .$ArrayTextTemp[$i+1]." ");			}			$out->addHTML( $BoxNames[$TotalTB-1]." ");			$q->textbox1=$ArrayTextTemp[$TotalTB];	return true; }

function CombineBeforeSave(&$q) { global	$wgRequest, $TotalTB,$BoxNames,$Separator; $request=$wgRequest; for($i=0;$i<$TotalTB-1;$i++){ $temp=$BoxNames[$i]; $allextraTB.= $Separator.$q->safeUnicodeInput( $request, $temp ); }	   $q->textbox1 = $allextraTB.$Separator.$q->textbox1; return true; }

function OptionSetting(&$q) { global $wgUser; $wgUser->setOption('rows',10); $wgUser->setOption('showtoolbar',0); return true; }

function LastMinuteStyleChange(&$q,&$b) { global $Separator,$BoxNames, $wgTitle; $title=$wgTitle;

if ($_GET['action'] != "") return true; $k=explode($Separator,$b); for($i=1;$i