I though i had posted an HTML Framework already but can't find it.
Anyway, here is my current one.
I will use this for little tools that need an simple GUI.
Example use: >>
http://www.xyplorer.com/xyfc/viewtopic. ... 856#p49856
Explanation:
If you need an list you can use $TextAreaDefault.
Fill it with something or the clipboard content:
Code: Select all
$TextAreaDefault = "my textareacontent";
//$TextAreaDefault = "<clipboard>";
In the Description secition you can type in an description for the options.
Type your descriptions behind
Code: Select all
<TR><TD>Option5:</TD> <TD> </TD></TR>
The user can check one of the radio buttons
and can fill in some text into the Options-fields.
Or he edit or paste in something into the TextArea.
For your script you get back this var:
Content of the textarea in var $TextArea
Option 1 or 2 or3 or 4 into var $myOption
Option5 in var $Option5
Option6 in var $Option6
Option7 in var $Option7
Option8 in var $Option8
Now you can start working with this vars.
Code: Select all
//Example Framework for the XYplorer-script HTML() function
$TextAreaDefault = "my textareacontent (delete this)";
//$TextAreaDefault = "<clipboard>";
$GETResult = utf8decode(html('<HTML>
<BODY bgcolor="antiquewhite">
<FORM method="GET" action="xys:">
<TABLE width="99%" border="1" bgcolor="aquamarine">
<TR><TD width="15%"><B>Description</B></TD><TD> </TD></TR>
<TR><TD>TextArea:</TD> <TD> </TD></TR>
<TR><TD>option 1-4:</TD> <TD>1: 2: 3: 4: </TD></TR>
<TR><TD>Option5:</TD> <TD> </TD></TR>
<TR><TD>Option6:</TD> <TD> </TD></TR>
<TR><TD>Option7:</TD> <TD> </TD></TR>
<TR><TD>Option8:</TD> <TD> </TD></TR>
<TR><TD>Do it:</TD> <TD> </TD></TR></TABLE>
<TEXTAREA name="FormResult" rows=6 cols=75>' . $TextAreaDefault . '</TEXTAREA><BR>
<INPUT type="radio" name="myOption" value="Option1" checked> Option 1
<INPUT type="radio" name="myOption" value="Option2" > Option 2
<INPUT type="radio" name="myOption" value="Option3" > Option 3
<INPUT type="radio" name="myOption" value="Option4" > Option 4 <BR>
Option5: <input type="text" name="Option5" size="80" Value="FIVE (delete this)"> <BR>
Option6: <input type="text" name="Option6" size="80" Value="SIX (delete this)"> <BR>
Option7: <input type="text" name="Option7" size="80" Value="SEVEN (delete this)"> <BR>
Option8: <input type="text" name="Option8" size="80" Value="EIGHT (delete this)"> <BR>
<P align="right"><INPUT type="submit" name="Submit" value="Do it"> </P>
</FORM>
</BODY>
</HTML>',"700", "630", "myWindowsTitle"));
//get the results:
// IF you press the [Close]-button of the dialog
// instead of the [Submit]-button of the form or on an link,
// then the result of HTML() is empty/nothing:
IF ("$GETResult"=="") {sub "_Cancel";}
// remove leading '?' from $GETResult content
substr $GETResult, $GETResult, 1;
//split the result into parts:
// split $GETResult into parts at the '&' sign and give me part N0. 1
// for example 'FormResult=textareacontent&myOption=Opt2&fname=J'...etc.
// becomes 'FormResult=textareacontent'
$FormResult = gettoken($GETResult, "1", "&");
// Then:
// split $FormResult into parts at the '=' sign and give me part N0. 2
// for example 'FormResult=textareacontent'
// becomes 'textareacontent'
$TextArea = urldecode(gettoken($FormResult, 2, "="));
//now do the same for all other parts:
$myOption = gettoken($GETResult, "2", "&");
$myOption = urldecode(gettoken($myOption, 2, "="));
//----
$Option5 = gettoken($GETResult, "3", "&");
$Option5 = urldecode(gettoken($Option5, 2, "="));
//----
$Option6 = gettoken($GETResult, "4", "&");
$Option6 = urldecode(gettoken($Option6, 2, "="));
//----
$Option7 = gettoken($GETResult, "5", "&");
$Option7 = urldecode(gettoken($Option7, 2, "="));
//----
$Option8 = gettoken($GETResult, "6", "&");
$Option8 = urldecode(gettoken($Option8, 2, "="));
//
//now do what you want with this results:
Text "Content of the textarea is: $TextArea <crlf>
Option 1-4 is: $myOption <crlf>
Option5: $Option5 <crlf>
Option6: $Option6 <crlf>
Option7: $Option7 <crlf>
Option8: $Option8 <crlf>";
// YOUR script goes here:
////////////////////////////////////////////////////////////////
"_Cancel"
msg "Cancled by user";
sub "_EOF";
"_EOF"
END 1==1;
//EOF