
<div class="wrap">
<?php

$allowed_users = explode(" ", trim(get_settings('fileupload_allowedusers')));

$submitbutton_text = 'Blog this!';
$toprow_title = 'New Post';
$form_action = 'post';
$form_extra = '';
if (get_settings('use_pingback')) {
	$form_pingback = sprintf(_LANG_EF_PING_FORM, gethelp_link(_LANG_DOC_POST_EDIT, '#pingback'));
	$form_pingback .= '<input type="checkbox" class="checkbox" name="post_pingback" value="1" ';
	if ($post_pingback) $form_pingback .= 'checked="checked" ';
	$form_pingback .= 'tabindex="7" id="pingback" />';
} else {
	$form_pingback = '';
}
if (get_settings('use_trackback')) {
	$form_trackback = '<p><label for="trackback">' . sprintf(_LANG_EF_TRACK_FORM, gethelp_link(_LANG_DOC_POST_EDIT, '#trackback')) . '<input type="text" name="trackback_url" style="width: 360px" id="trackback" tabindex="7" /></p>';
} else {
	$form_trackback = '';
}
$colspan = 3;
$saveasdraft = '';


?>

<form name="post" action="post.php" method="post" id="post">

<?php
if (isset($mode) && 'bookmarklet' == $mode) {
    echo '<input type="hidden" name="mode" value="bookmarklet" />';
}
?>
<input type="hidden" name="user_id" value="<?php echo $user_id ?>" />
<input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' />

<script type="text/javascript">
<!--
function focusit() {
	// focus on first input field
	document.post.title.focus();
}
window.onload = focusit;
//-->
</script>
<style media="screen" type="text/css">
#titlediv, #postpassworddiv {
	height: 3.5em;
}
</style>
<div id="poststuff">
    <fieldset id="titlediv">
      <legend><?php printf(_LANG_EF_AD_POSTTITLE, gethelp_link(_LANG_DOC_POST_EDIT, '#title')); ?></legend> 
	  <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $edited_post_title; ?>" id="title" /></div>
    </fieldset>

    <fieldset id="categorydiv">
      <legend><?php printf(_LANG_EF_AD_CATETITLE, gethelp_link(_LANG_DOC_POST_EDIT, '#category')); ?></legend> 
	  <div><?php dropdown_categories($default_post_cat); ?></div>
    </fieldset>

<br />
<fieldset id="postdiv">
    <legend><?php printf(_LANG_EF_AD_POSTAREA, gethelp_link(_LANG_DOC_POST_EDIT, '#post')); ?></legend>
		<div id="quicktags">
<?php
if ('bookmarklet' != $mode) {
	printf(_LANG_EF_AD_POSTQUICK, gethelp_link(_LANG_DOC_POST_EDIT, '#quicktags'));
	include('quicktags.php');
}
?>
</div>
<?php
 $rows = get_settings('default_post_edit_rows');
 if (($rows < 3) || ($rows > 100)) {
     $rows = 10;
 }
?>
<div><textarea rows="<?php echo $rows; ?>" cols="30" name="content" tabindex="4" id="content"><?php echo $content ?></textarea></div>
</fieldset>


<script type="text/javascript" language="JavaScript">
<!--
edCanvas = document.getElementById('content');
//-->
</script>

<?php echo $form_pingback ?>
<?php echo $form_trackback; ?>
<p><input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="<?php echo _LANG_EF_AD_DRAFT; ?>" /> 
  <input name="saveasprivate" type="submit" id="saveasprivate" tabindex="10" value="<?php echo _LANG_EF_AD_PRIVATE; ?>" /> 
  <input name="publish" type="submit" id="publish" tabindex="6" value="<?php echo _LANG_EF_AD_PUBLISH; ?>" /> 
  <?php if ('bookmarklet' != $mode) {
      echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="' . _LANG_EF_AD_EDITING . '" />';
  } ?>
  <input name="referredby" type="hidden" id="referredby" value="<?php if (isset($_SERVER['HTTP_REFERER'])) echo $_SERVER['HTTP_REFERER']; ?>" />
</p>

</div>
</form>

</div>
