<?php
// $Id: messageform.inc.php,v 1.1 2004/07/11 10:28:09 Farsus Exp $
// -------------------------------------------------------------------------//
//			                 RUNCMS                                         //
//                                                                          //
//	 reliable - Unique - Nocost &  Simplicity & ease off use                //
//                       < http://www.runcms.org >                          //
// -------------------------------------------------------------------------//
include_once(XOOPS_ROOT_PATH.'/class/xoopsform/formdhtmltextarea.php');
?>

<form action="pmlite.php" method="POST"><br />
<table width="100%" align="center"><tr>
<td class="bg3" nowrap><b><?php echo _PM_TO;?><b></td>

<?php
if ( ($to_userid) || ($reply == 1) || ($HTTP_POST_VARS['op'] == 'preview') ) {
	echo "<td class='bg1'><input type='hidden' name='to_userid' value='".$pm->getVar("to_userid")."' />".$pm_uname."</td>";
	} else {
		echo "<td class='bg1'><select class='select' name='to_userid'>";
		$result = $db->query("SELECT uid, uname FROM ".$db->prefix("users")." WHERE level > 0 ORDER BY uname");
		while ( list($ftouid, $ftouname) = $db->fetch_row($result) ) {
			echo "<option value='".$ftouid."'>".$myts->makeTboxData4Show($ftouname)."</option>";
		}
		echo '</select></td>';
	}

	?>
	</tr><tr align="left">
	<td class="bg3" nowrap><b><?php echo _PM_SUBJECTC;?><b></td>
	<td class="bg1"><input type="text" class="text" name="subject" value="<?php echo $subject;?>" size="30" maxlength="60" /></td>
	</tr><tr align="left" valign="top">
	<td class="bg3" nowrap><b><?php echo _PM_MESSAGEC;?></b></td>
	<td class="bg1">
	<?php

	$desc  = new XoopsFormDhtmlTextArea('', 'message', $message, 10, 50);
	echo $desc->render();

	echo "
	&nbsp; &nbsp; <input type='reset' class='button' value='"._RESET."' /></td>
	</tr><tr><td colspan='2'><br />";

	if ( !empty($xoopsConfig['allow_html']) ) {
		echo _ALLOWEDHTML.'<br />';
		echo get_allowed_html();
		if ($HTTP_POST_VARS['allow_html'] == '0') {
			$option0 = ' selected';
			} elseif ($HTTP_POST_VARS['allow_html'] == '2') {
				$option2 = ' selected';
				} else {
					$option1 = ' selected';
				}
		echo "
		<br /><br />
		<select class='select' name='allow_html'>
		<option value='0'$option0>"._HTMLOFF."</option>
		<option value='1'$option1>"._HTMLAUTOWRAP."</option>
		<option value='2'$option2>"._HTMLNOAUTOWRAP."</option>
		</select><br />";
		} else {
			echo "<input type='hidden' name='allow_html' value='0'>";
		}

	echo "<input type='checkbox' class='checkbox' name='allow_smileys' value='1'";
	if (!isPost() || $HTTP_POST_VARS['allow_smileys'] == 1) {
		echo " checked='checked'";
		}
	echo ' /> '._ENABLESMILEY.'<br />';

	// Enable bbcode?
	echo "<input type='checkbox' class='checkbox' name='allow_bbcode' value='1'";
	if (!isPost() || $HTTP_POST_VARS['allow_bbcode'] == 1) {
		echo " checked='checked'";
	}
	echo ' />&nbsp;'._ENABLEBBCODE.'<br />';
?>

</td></tr><tr>
<td class="bg1" colspan="2" align="center">
<select class="select" name="op">
<option value="preview"><?php echo _PREVIEW;?></option>
<option value="submit"><?php echo _SUBMIT;?></option>
</select>
<input type="submit" class="button" name="submit" value="<?php echo _GO;?>" />
<input type="button" class="button" name="cancel" value="<?php echo _CANCEL;?>" onclick="javascript:history.go(-1);" />
</td></tr></table></form>

