Location: PHPKode > projects > Jetbox > jetbox/includes/f_general_formelements.inc.php
<?
switch($formelement) {
		case 'dropdown' :
			echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td>";
			general_displaydropdown($value, $cellvalue, $dropdown);
			echo "</td>\n</tr>";
		break;
		case 'string' :
			echo "<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td><input class=\"form_input\" type=\"text\" name=\"" . $value. "\" value=\"".$cellvalue."\" size=\"39\" maxlength=\"255\"></td>\n</tr>";
		break;
		case 'fname' :
			echo "<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td><input class=\"form_input\" type=\"text\" name=\"" . $value. "\" value=\"".$cellvalue."\" size=\"14\" maxlength=\"255\"></td>\n";
		break;
		case 'mname' :
			echo "\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td><input class=\"form_input\" type=\"text\" name=\"" . $value. "\" value=\"".$cellvalue."\" size=\"3\" maxlength=\"255\"></td>\n";
		break;
		case 'lname' :
			echo "\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td><input class=\"form_input\" type=\"text\" name=\"" . $value. "\" value=\"".$cellvalue."\" size=\"14\" maxlength=\"255\"></td>\n</tr>";
		break;
		case 'password' :
		if( $action=='edit' || $action=='reedit'){
			if ($action=='reedit') {
			    $cellvalue= $_POST[passwordold];
			}
			//echo $cellvalue;
			echo "<tr>\n<td>New $display</td><td></td>\n<td width=\"1\"></td>\n<td><input class=\"form_input\" type=\"password\" name=\"" . $value. "\" size=\"39\" maxlength=\"255\"></td>\n</tr>";
			echo "<tr>\n<td>Confirm</td><td></td>\n<td width=\"1\"></td>\n<td><input class=\"form_input\" type=\"password\" name=\"" . $value. "2\" size=\"39\" maxlength=\"255\"></td>\n</tr>";
			echo "\n<input type=\"hidden\" name=\"passwordold\" value=\"$cellvalue\">";
		}
		else{
			echo "<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td><input class=\"form_input\" type=\"password\" name=\"" . $value. "\" size=\"39\" maxlength=\"255\"></td>\n</tr>";
			echo "<tr>\n<td>Confirm</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td><input class=\"form_input\" type=\"password\" name=\"" . $value. "2\" size=\"39\" maxlength=\"255\"></td>\n</tr>";
			echo "\n<input type=\"hidden\" name=\"passwordold\" value=\"$cellvalue\">";
		}
		break;
		case 'blob' :
			echo "\n<tr>\n<td width=120></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\">";
			echo "\n <td width=90%><img src=images/bold.gif width=16 height=16 border=0 align=absbottom>\n [<a href=# onClick=MM_callJS('boldThis(1)')>Vet</a>] ";
			echo "\n <img src=images/italic.gif width=16 height=16 align=absbottom>\n [<a href=# onClick=MM_callJS('italicThis(1)')>Cursief</a>] ";
			echo "\n <img src=images/ahref.gif width=16 height=16 align=absbottom>\n [<a href=# onClick=MM_callJS('ahrefThis()')>Link</a>]</td>";
			echo "\n </tr>";
			echo "\n<tr>\n<td valign=\"top\">$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td><textarea class=\"form_input_textarea\" name=\""  . $value. "\" ROWS=\"25\" COLS=\"81\" wrap=\"virtual\">".$cellvalue."</textarea></td>\n</tr>";
		break;
		case 'richblob' :
			echo "\n<tr>\n<td valign=\"top\">$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td><textarea class=\"form_input_textarea\" name=\""  . $value. "\" ROWS=\"8\" COLS=\"78\" wrap=\"virtual\">".$cellvalue."</textarea><br>
			<a href=\"Javascript:JetstreamRTE('".$value."')\">Edit in richtext</a></td>\n</tr>";
			?>
			<script language=javascript>
			<!--
			function JetstreamRTE(rtevar){
			var url = "editor2/edit.php?val=";
			url += rtevar;
			var hWnd = window.open(url,"HelpWindow","width=780,height=425,resizable=yes,scrollbars=yes,location=no,status=no,adressbar=no");
			if ((document.window != null) && (!hWnd.opener))
				hWnd.opener = document.window;
		}
		//-->
		</script>
		<?
		break;
		case 'hidden' :
			echo "\n<input type=\"hidden\" name=\"$value\" value=\"$cellvalue\">";
			$noruler=='true';
		break;
		case 'novalue' :
			echo "\n<input type=\"hidden\" name=\"$value\" value=\"\">";
			$noruler=='true';
		break;
		case 'date' :
			$splitdate = split('-',$cellvalue,3);
			echo "\n<input type=\"hidden\" name=\"dbadmindatefield[]\" value=\"$value\">";
			echo "\n<tr>\n<td WIDTH=\"15%\" valign=\"top\">" . $display . "</td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td valign=\"top\">".general_dateinput($value."_day",$splitdate[2],$value."_month",$splitdate[1],$value."_year",$splitdate[0])."</td>\n</tr>";
		break;
		case 'checkbox' :
			if ($cellvalue==1) {
				echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td valign=\"top\"><input type=\"checkbox\" checked name=\"$value\" value=\"1\"></td>\n</tr>";
			}
			else {
					echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td valign=\"top\"><input type=\"checkbox\" name=\"$value\" value=\"1\"></td>\n</tr>";
			}
		break;
		case 'radio' :
			if ($cellvalue=='no' || $cellvalue=='' || $cellvalue==0 ||  $cellvalue==false) {
				echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td valign=\"top\"><input type=\"radio\" name=\"$value\" checked value=\"no\">Nee &nbsp; &nbsp; <input type=\"radio\" name=\"$value\" value=\"yes\"> Ja</td>\n</tr>";
			}
			else {
				echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td valign=\"top\"><input type=\"radio\" name=\"$value\" value=\"no\">Nee &nbsp; &nbsp; <input type=\"radio\" name=\"$value\" checked value=\"yes\"> Ja</td>\n</tr>";
			}
		break;
		case 'radioonerezo' :
			if ($cellvalue==0) {
				echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td valign=\"top\"><input type=\"radio\" name=\"$value\" checked value=\"0\">Nee &nbsp; &nbsp; <input type=\"radio\" name=\"$value\" value=\"1\"> Ja</td>\n</tr>";
			}
			else {
				echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td valign=\"top\"><input type=\"radio\" name=\"$value\" value=\"0\">Nee &nbsp; &nbsp; <input type=\"radio\" name=\"$value\" checked value=\"1\"> Ja</td>\n</tr>";
			}
		break;
		case 'radioyesno' :
			if ($cellvalue=='no') {
				echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td valign=\"top\"><input type=\"radio\" name=\"$value\" checked value=\"no\">Nee &nbsp; &nbsp; <input type=\"radio\" name=\"$value\" value=\"yes\"> Ja</td>\n</tr>";
			}
			else {
				echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td valign=\"top\"><input type=\"radio\" name=\"$value\" value=\"no\">Nee &nbsp; &nbsp; <input type=\"radio\" name=\"$value\" checked value=\"yes\"> Ja</td>\n</tr>";
			}
		break;
		case 'radiotruefalse' :
			if ($cellvalue==false) {
				echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td valign=\"top\"><input type=\"radio\" name=\"$value\" checked value=\"false\">Nee &nbsp; &nbsp; <input type=\"radio\" name=\"$value\" value=\"true\"> Ja</td>\n</tr>";
			}
			else {
				echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td valign=\"top\"><input type=\"radio\" name=\"$value\" value=\"false\">Nee &nbsp; &nbsp; <input type=\"radio\" name=\"$value\" checked value=\"true\"> Ja</td>\n</tr>";
			}
		break;
		case 'radioebatesite' :
			if ($cellvalue==0) {
				echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td valign=\"top\"><input type=\"radio\" name=\"$value\" checked value=\"0\">Text &nbsp; &nbsp; <input type=\"radio\" name=\"$value\" value=\"1\"> Lijst</td>\n</tr>";
			}
			else {
				echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td valign=\"top\"><input type=\"radio\" name=\"$value\" value=\"0\">Text &nbsp; &nbsp; <input type=\"radio\" name=\"$value\" checked value=\"1\"> Lijst</td>\n</tr>";
			}
		break;
		case 'ebatediscusradio' :
			$cellvalue=	$formrarray["inforum"];
			if ($cellvalue=="yes" || $cellvalue=="1"){
					echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td><td>Status: Discussie is geopend in het forum </td>\n</tr><input type=\"hidden\" name=\"$value\" value=\"$cellvalue\">";
			}
			elseif ($cellvalue==no || $cellvalue=='') {
				echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td valign=\"top\"><input type=\"radio\" name=\"$value\" checked value=\"no\">Nee &nbsp; &nbsp; <input type=\"radio\" name=\"$value\" value=\"yes\"> Ja</td>\n</tr>";
			}
			else {
				echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td valign=\"top\"><input type=\"radio\" name=\"$value\" value=\"no\">Nee &nbsp; &nbsp; <input type=\"radio\" name=\"$value\" checked value=\"yes\"> Ja</td>\n</tr>";
			}
		break;
		case 'radio2' :
			echo "\n<tr>\n<td>&nbsp;</td>\n<td></td>\n<td>De poll van deze ebate hoort bij dit artikel</td>\n</tr>";
			if ($cellvalue==no || $cellvalue=='') {
				echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td valign=\"top\"><input type=\"radio\" name=\"$value\" checked value=\"no\">Nee &nbsp; &nbsp; <input type=\"radio\" name=\"$value\" value=\"yes\"> Ja</td>\n</tr>";
			}
			else {
				echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td valign=\"top\"><input type=\"radio\" name=\"$value\" value=\"no\">Nee &nbsp; &nbsp; <input type=\"radio\" name=\"$value\" checked value=\"yes\"> Ja</td>\n</tr>";
			}
		break;
		case 'containerradio3' :
			$cellvalue>10 ? ($cellvalue>100 ? $checked[1000]='checked' : $checked[100]='checked') : $checked[10]='checked';
			echo "\n<tr>\n<td valign=base>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\"></td>\n<TD VALIGN=\"TOP\">
			<INPUT TYPE=\"RADIO\" NAME=\"$value\" $checked[10] VALUE=\"10\"> author and higher<br>
			<INPUT TYPE=\"RADIO\" NAME=\"$value\" $checked[100] VALUE=\"100\"> container administrator and higher<br>
			<INPUT TYPE=\"RADIO\" NAME=\"$value\" $checked[1000] VALUE=\"1000\"> system administrator only
			</TD>\n</TR>";
			$checked='';
		break;
		case 'int' :
			if (isdropdown($value)) {
				echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td>";
				displaydropdown($dropmenu,$cellvalue);
				echo "</td>\n</tr>";
			}
			else {
				echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td><input class=\"form_input\" type=\"text\" name=\"" . $value. "\" value=\"".$cellvalue."\" size=\"50\" maxlength=\"255\"></td>\n</tr>";
			}
		break;
		case 'file' :
		echo "<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td><input class=\"form_input\" TYPE=\"file\" NAME=\"userfile\" size=\"50\"></td>\n</tr>";
		echo "\n<input type=\"hidden\" name=\"$value\" value=\"$cellvalue\">";
		break;
		case 'valuefromurl':
			echo "\n<input type=\"hidden\" name=\"$value\" value=\"$_REQUEST[$value]\">";
		break;
		case 'valuefromurlshowlinked' :
			if( $action=='edit' || $action=='reedit'){
				$_REQUEST[$value]=$cellvalue;
			}
			echo "\n<tr>\n<td>$display</td><td></td>\n<td width=\"1\"></td>\n<td>".general_linkedvalue($value, $_REQUEST[$value], $dropdown);
			echo "</td>\n</tr>";
			echo "\n<input type=\"hidden\" name=\"$value\" value=\"$_REQUEST[$value]\">";
		break;
		case 'uname' :
			if( $action=='edit' || $action=='reedit'){
				//$_REQUEST[$value]=$cellvalue;
				echo "\n<tr>\n<td>$display</td><td></td>\n<td width=\"1\"></td>\n<td>".$cellvalue;
				echo "</td>\n</tr>";
				echo "\n<input type=\"hidden\" name=\"$value\" value=\"$cellvalue\">";
			}
			else{
				echo "<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td><input class=\"form_input\" type=\"text\" name=\"" . $value. "\" value=\"".$cellvalue."\" size=\"39\" maxlength=\"255\"></td>\n</tr>";
			}

		break;
		default :
			echo "\n<tr>\n<td>$display</td><td></td>\n<td bgcolor=\"#".$requiredcolor."\" width=\"1\"></td>\n<td><input class=\"form_input\" type=\"text\" name=\"" . $value. "\" value=\"".$cellvalue."\" size=\"50\" maxlength=\"255\"></td>\n</tr>";
		break;
	}
Return current item: Jetbox