Added in missing post status, comment status, post password fields to allow posts to be made correctly from sidebar and bookmarklet.

git-svn-id: http://svn.automattic.com/wordpress/trunk@199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
mikelittle 2003-06-10 22:31:01 +00:00
parent 69c2ef5a35
commit 2d6891fca9
2 changed files with 114 additions and 64 deletions

View File

@ -1,6 +1,10 @@
<?php
/* <Bookmarklet> */
function selected($selected, $current) {
if ($selected == $current) echo ' selected="selected"';
}
$mode = 'bookmarklet';
$standalone = 1;
@ -40,8 +44,6 @@ function launchupload() {
<style type="text/css">
<!--
body {
background-image: url('../b2-img/bgbookmarklet3.gif');
background-repeat: no-repeat;
}
textarea,input,select {
@ -105,81 +107,117 @@ if (($is_gecko) && (!isset($Gecko_bookmarklet_fix))) {
?>
<table width="100%" cellpadding="8" cellspacing="0" width="415">
<tr>
<td width="40">&nbsp;</td>
<td align="left" width="415">
<table cellspacing="0" cellpadding="0">
<td height="50" width="250" align="left" valign="bottom"><label>Title<br />
<input type="text" name="post_title" size="20" tabindex="1" style="width: 215px;" value="<?php echo stripslashes($popuptitle) ?>" /></label></td>
<td width="165" align="left" valign="bottom"><b>Category</b><br /><?php dropdown_categories(); ?></td>
</table>
</td>
</tr>
<tr height="40">
<td width="40">&nbsp;</td>
<td width="415" align="left" height="40">
<table width="415" cellpadding="0" cellspacing="0">
<td align="left" valign="bottom"><b>Post</b></td>
<td align="right" valign="bottom"><?php if ($use_quicktags) include("b2quicktags.php"); ?></td>
</table>
<tr>
<td width="40">&nbsp;</td>
<td align="left" width="415">
<table cellspacing="0" cellpadding="0">
<td height="50" width="250" align="left" valign="bottom"><label>Title<br />
<input type="text" name="post_title" size="20" tabindex="1" style="width: 215px;" value="<?php echo stripslashes($popuptitle) ?>" /></label></td>
<td width="165" align="left" valign="bottom"><b>Category</b><br /><?php dropdown_categories(); ?></td>
</table>
</td>
</tr>
<tr height="40">
<td width="40">&nbsp;</td>
<td align="left" width="415">
<table cellspacing="0" cellpadding="0">
<td height="50" width="150" align="left" valign="bottom">
<label for="post_status">Post Status:</label>&nbsp;<br />
<select name="post_status" id="post_status">
<option value="publish"<?php selected($post_status, 'publish'); ?>>Publish</option>
<option value="draft"<?php selected($post_status, 'draft'); ?>>Draft</option>
<option value="private"<?php selected($post_status, 'private'); ?>>Private</option>
</select>
</td>
<td height="50" width="250" align="left" valign="bottom">
<label for="comment_status">Comments:</label>&nbsp;<br />
<select name="comment_status" id="comment_status">
<option value="open"<?php selected($comment_status, 'open'); ?>>Open</option>
<option value="closed"<?php selected($comment_status, 'closed'); ?>>Closed</option>
</select>
</td>
</table>
</td>
</tr>
<tr height="40">
<td width="40">&nbsp;</td>
<td align="left" width="415">
<table cellspacing="0" cellpadding="0">
<td height="50" width="100" align="left" valign="bottom">
<label for="ping_status">Pings:</label><br />
<select name="ping_status" id="ping_status">
<option value="open"<?php selected($ping_status, 'open'); ?>>Open</option>
<option value="closed"<?php selected($ping_status, 'open'); ?>>Closed</option>
</select>
</td>
<td height="50" width="250" align="left" valign="bottom">
<label for="post_password">Post Password:</label><br />
<input name="post_password" type="text" id="post_password" value="<?php echo $post_password ?>" />
</td>
</table>
</td>
</tr>
<tr height="40">
<td width="40">&nbsp;</td>
<td width="415" align="left" height="40">
<table width="415" cellpadding="0" cellspacing="0">
<td align="left" valign="bottom"><b>Post</b></td>
<td align="right" valign="bottom"><?php if ($use_quicktags) include("b2quicktags.php"); ?></td>
</table>
<?php
if ((preg_match("/Nav/",$HTTP_USER_AGENT)) || (preg_match("/Mozilla\/4\.7/",$HTTP_USER_AGENT))) {
$rows="6";
} else {
$rows="8";
} ?>
<?php
// stuff to fix textism.com's WEIRD characters conflict with javascript on IE5Mac
// stuff to fix textism.com's WEIRD characters conflict with javascript on IE5Mac
preg_match("/\%u[1-9A-F][1-9A-F][1-9A-F][1-9A-F]/is", $text, $stufftofix);
// ... and so on. currently coding the fix
?>
<textarea rows="<?php echo $rows ?>" cols="48" style="width:415px;" name="content" tabindex="2" class="postform"><?php echo "<a href=\"$popupurl\">$popuptitle</a>\n$text" ?></textarea><br />
<table cellpadding="0" cellspacing="0">
<td align="left" width="90">
</td>
<textarea rows="<?php echo $rows ?>" cols="48" style="width:415px;" name="content" tabindex="2" class="postform"><?php echo "<a href=\"$popupurl\">$popuptitle</a>\n$text" ?></textarea><br />
<table cellpadding="0" cellspacing="0">
<td align="left" width="90"></td>
<?php if ($pingback) { ?>
<td align="left">
<input type="checkbox" class="checkbox" name="post_pingback" value="1" checked="checked" tabindex="7" id="pingback" /><label for="pingback"> PingBack</label>
</td>
<td align="left">
<input type="checkbox" class="checkbox" name="post_pingback" value="1" checked="checked" tabindex="7" id="pingback" /><label for="pingback"> PingBack</label>
</td>
<?php } ?>
</table>
</table>
<?php if (0 /*$use_preview*/) { ?>
<input type="button" value="preview" onClick="preview(this.form);" class="search" tabindex="8" />
<input type="button" value="preview" onClick="preview(this.form);" class="search" tabindex="8" />
<?php } ?>
<input type="submit" name="submit" value="Blog this !" class="search" tabindex="3" />
<input type="submit" name="submit" value="Blog this !" class="search" tabindex="3" />
<?php if ( ($use_fileupload) && ($user_level >= $fileupload_minlevel) && ((ereg(" ".$user_login." ", $fileupload_allowedusers)) || (trim($fileupload_allowedusers)=="")) ) { ?>
<input type="button" value="upload a file" onClick="launchupload();" class="search" />
<input type="button" value="upload a file" onClick="launchupload();" class="search" />
<?php } ?>
<script language="JavaScript" type="text/javascript">
<!--
window.focus();
// document.blog.post_content.focus();
//-->
</script>
</td>
</tr>
<script language="JavaScript" type="text/javascript">
<!--
window.focus();
//document.blog.post_content.focus();
//-->
</script>
</td>
</tr>
<?php if ($trackback) { ?>
<tr>
<td width="40">&nbsp;</td>
<td width="415" align="left" height="40">
<label for="trackback"><strong>TrackBack</strong> an <acronym title="Uniform Resource Locator">URL</acronym>:</label> (Seperate multiple URLs with commas.)<br />
<input type="text" name="trackback" style="width: 415px" />
</td>
</tr>
<tr>
<td width="40">&nbsp;</td>
<td width="415" align="left" height="40">
<label for="trackback"><strong>TrackBack</strong> an <acronym title="Uniform Resource Locator">URL</acronym>:</label> (Seperate multiple URLs with commas.)<br />
<input type="text" name="trackback" style="width: 415px" />
</td>
</tr>
<?php } ?>
</table>
</div>
</form>
@ -189,4 +227,4 @@ window.focus();
</body>
</html><?php
}
?>
?>

View File

@ -1,5 +1,8 @@
<?php
/* <Sidebar> */
function selected($selected, $current) {
if ($selected == $current) echo ' selected="selected"';
}
$mode = "sidebar";
@ -52,21 +55,12 @@ if ($a=="b") {
<style type="text/css">
<!--
body {
background-image: url('../b2-img/wpminilogo.png');
background-repeat: no-repeat;
background-position: 50px 90px;
padding: 3px;
}
textarea,input,select {
font-family: arial,helvetica,sans serif;
font-size: 12px;
background-color: transparent;
<?php if ($is_gecko || $is_macIE) { ?>
background-image: url('../b2-img/bgbookmarklet3.gif');
<?php } elseif ($is_winIE) { ?>
background-color: #dddddd;
filter: alpha(opacity:80);
<?php } ?>
border-width: 1px;
border-color: #cccccc;
border-style: solid;
@ -93,6 +87,24 @@ textarea,input,select {
<input type="text" name="post_title" size="20" tabindex="1" style="width: 100%;" value="Title" onFocus="if (this.value=='Title') { this.value='';}" onBlur="if (this.value=='') {this.value='Title';}" />
<?php dropdown_categories(); ?>
<label for="post_status">Status:</label>
<select name="post_status" id="post_status">
<option value="publish"<?php selected($post_status, 'publish'); ?>>Publish</option>
<option value="draft"<?php selected($post_status, 'draft'); ?>>Draft</option>
<option value="private"<?php selected($post_status, 'private'); ?>>Private</option>
</select><br />
<label for="comment_status">Comments:</label>
<select name="comment_status" id="comment_status">
<option value="open"<?php selected($comment_status, 'open'); ?>>Open</option>
<option value="closed"<?php selected($comment_status, 'closed'); ?>>Closed</option>
</select><br />
<label for="ping_status">Pings:</label>
<select name="ping_status" id="ping_status">
<option value="open"<?php selected($ping_status, 'open'); ?>>Open</option>
<option value="closed"<?php selected($ping_status, 'open'); ?>>Closed</option>
</select><br />
<label for="post_password">Post Password:</label>
<input name="post_password" type="text" id="post_password" value="<?php echo $post_password ?>" /><br />
<textarea rows="8" cols="12" style="width: 100%" name="content" tabindex="2" class="postform" wrap="virtual" onFocus="if (this.value=='Post') { this.value='';}" onBlur="if (this.value=='') {this.value='Post';}">Post</textarea>
@ -100,7 +112,7 @@ textarea,input,select {
<input type="checkbox" class="checkbox" name="post_pingback" value="1" checked="checked" tabindex="5" id="pingback" /><label for="pingback"> PingBack</label>
<?php } ?>
<input type="submit" name="submit" value="Blog this !" class="search" tabindex="3" />
<input type="submit" name="submit" value="Blog this !" class="search" tabindex="3" />
<?php
if ($use_trackback) { ?>