New two-stage post process.Some HTML cleanup and general tweaking. Split edit form into several files.
git-svn-id: http://svn.automattic.com/wordpress/trunk@658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5f8094aeba
commit
31d01ac0bd
|
@ -0,0 +1,172 @@
|
|||
|
||||
<div class="wrap">
|
||||
<?php
|
||||
|
||||
$allowed_users = explode(" ", trim($fileupload_allowedusers));
|
||||
|
||||
function selected($selected, $current) {
|
||||
if ($selected == $current) echo ' selected="selected"';
|
||||
}
|
||||
|
||||
function checked($checked, $current) {
|
||||
if ($checked == $current) echo ' checked="checked"';
|
||||
}
|
||||
|
||||
|
||||
$submitbutton_text = 'Save';
|
||||
$toprow_title = 'Editing Post #' . $postdata['ID'];
|
||||
$form_action = 'editpost';
|
||||
$form_extra = "' />\n<input type='hidden' name='post_ID' value='$post->ID";
|
||||
$colspan = 2;
|
||||
$form_pingback = '<input type="hidden" name="post_pingback" value="0" />';
|
||||
$form_prevstatus = '<input type="hidden" name="prev_status" value="'.$post_status.'" />';
|
||||
if ($use_trackback) {
|
||||
$form_trackback = '<p><label for="trackback"><a href="http://wordpress.org/docs/reference/post/#trackback" title="Help on trackbacks"><strong>TrackBack</strong> an <acronym title="Uniform Resource Locator">URL</acronym></a></label>
|
||||
(Separate multiple <acronym title="Uniform Resource Locator">URL</acronym>s with spaces.)<br />
|
||||
<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. str_replace("\n", ' ', $to_ping) .'" /></p>';
|
||||
if ('' != $pinged) {
|
||||
$form_trackback .= '<p>Already pinged:</p><ul>';
|
||||
$already_pinged = explode("\n", trim($pinged));
|
||||
foreach ($already_pinged as $pinged_url) {
|
||||
$form_trackback .= "\n\t<li>$pinged_url</li>";
|
||||
}
|
||||
$form_trackback .= '</ul>';
|
||||
}
|
||||
} else {
|
||||
$form_trackback = '';
|
||||
}
|
||||
$saveasdraft = '<input name="save" type="submit" id="save" tabindex="6" value="Save and Continue Editing" />';
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<form name="post" action="post.php" method="post" id="post">
|
||||
<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>
|
||||
|
||||
<div id="poststuff">
|
||||
<fieldset id="titlediv">
|
||||
<legend><a href="http://wordpress.org/docs/reference/post/#title" title="Help on titles">Title</a></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><a href="http://wordpress.org/docs/reference/post/#category" title="Help on categories">Categories</a></legend>
|
||||
<div><?php dropdown_categories($default_post_cat); ?></div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="poststatusdiv">
|
||||
<legend><a href="http://wordpress.org/docs/reference/post/#post_status" title="Help on post status">Post Status</a></legend>
|
||||
<div><label for="post_status_publish" class="selectit"><input id="post_status_publish" name="post_status" type="radio" value="publish" <?php checked($post_status, 'publish'); ?> /> Publish</label>
|
||||
<label for="post_status_draft" class="selectit"><input id="post_status_draft" name="post_status" type="radio" value="draft" <?php checked($post_status, 'draft'); ?> /> Draft</label>
|
||||
<label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="radio" value="private" <?php checked($post_status, 'private'); ?> /> Private</label></div>
|
||||
</fieldset>
|
||||
<fieldset id="commentstatusdiv">
|
||||
<legend><a href="http://wordpress.org/docs/reference/post/#comments" title="Help on comment status">Comments</a></legend>
|
||||
<div><label for="comment_status_open" class="selectit"><input id="comment_status_open" name="comment_status" type="radio" value="open" <?php checked($comment_status, 'open'); ?> /> Open</label>
|
||||
<label for="comment_status_closed" class="selectit"><input id="comment_status_closed" name="comment_status" type="radio" value="closed" <?php checked($comment_status, 'closed'); ?> /> Closed</label></div>
|
||||
</fieldset>
|
||||
<fieldset id="pingstatusdiv">
|
||||
<legend><a href="http://wordpress.org/docs/reference/post/#pings" title="Help on ping status">Pings</a></legend>
|
||||
<div><label for="ping_status_open" class="selectit"><input id="ping_status_open" name="ping_status" type="radio" value="open" <?php checked($ping_status, 'open'); ?> /> Open</label>
|
||||
<label for="ping_status_closed" class="selectit"><input id="ping_status_closed" name="ping_status" type="radio" value="closed" <?php checked($ping_status, 'closed'); ?> /> Closed</label></div>
|
||||
</fieldset>
|
||||
<fieldset id="postpassworddiv">
|
||||
<legend><a href="http://wordpress.org/docs/reference/post/#post_password" title="Help on post password">Post Password</a></legend>
|
||||
<div><input name="post_password" type="text" size="18" id="post_password" value="<?php echo $post_password ?>" /></div>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
<fieldset style="clear:both">
|
||||
<legend><a href="http://wordpress.org/docs/reference/post/#excerpt" title="Help with excerpts">Excerpt</a></legend>
|
||||
<div><textarea rows="2" cols="40" name="excerpt" tabindex="4" id="excerpt"><?php echo $excerpt ?></textarea></div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><a href="http://wordpress.org/docs/reference/post/#post" title="Help with post field">Post</a></legend>
|
||||
<div id="quicktags">
|
||||
<?php
|
||||
if ($use_quicktags) {
|
||||
echo '<a href="http://wordpress.org/docs/reference/post/#quicktags" title="Help with quicktags">Quicktags</a>: ';
|
||||
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="40" name="content" tabindex="5" id="content"><?php echo $content ?></textarea></div>
|
||||
</fieldset>
|
||||
|
||||
<?php
|
||||
if ($use_quicktags) {
|
||||
?>
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
edCanvas = document.getElementById('content');
|
||||
//-->
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
if ($action != 'editcomment') {
|
||||
if (get_settings('use_geo_positions')) {
|
||||
if (empty($edited_lat)) {
|
||||
if (get_settings('use_default_geourl')) {
|
||||
$edited_lat = get_settings('default_geourl_lat');
|
||||
$edited_lon = get_settings('default_geourl_lon');
|
||||
}
|
||||
}
|
||||
?>
|
||||
<label for="post_latf">Latitude:</label><input size="8" type="text" value="<?php echo $edited_lat; ?>" name="post_latf">
|
||||
<label for="post_lonf">Longitude:</label><input size="8" type="text" value="<?php echo $edited_lon; ?>" name="post_lonf"> <a href="http://www.geourl.org/resources.html" rel="external" >click for Geo Info</a>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php echo $form_pingback ?>
|
||||
<?php echo $form_prevstatus ?>
|
||||
|
||||
<p><?php echo $saveasdraft; ?> <input type="submit" name="submit" value="Save" style="font-weight: bold;" tabindex="6" />
|
||||
<input name="publish" type="submit" id="publish" tabindex="10" value="Publish" />
|
||||
<input name="referredby" type="hidden" id="referredby" value="<?php echo $HTTP_SERVER_VARS['HTTP_REFERER']; ?>" />
|
||||
</p>
|
||||
|
||||
|
||||
<?php
|
||||
if ($action != 'editcomment') {
|
||||
if ( ($use_fileupload) && ($user_level >= $fileupload_minlevel)
|
||||
&& (in_array($user_login, $allowed_users) || (trim($fileupload_allowedusers)=="")) ) { ?>
|
||||
<input type="button" value="upload a file/image" onclick="launchupload();" class="search" tabindex="10" />
|
||||
<?php }
|
||||
}
|
||||
|
||||
echo $form_trackback;
|
||||
|
||||
// if the level is 5+, allow user to edit the timestamp - not on 'new post' screen though
|
||||
// if (($user_level > 4) && ($action != "post"))
|
||||
if ($user_level > 4) {
|
||||
touch_time(($action == 'edit'));
|
||||
}
|
||||
if ('edit' == $action) echo "
|
||||
<p><a href='post.php?action=delete&post=$post->ID' onclick=\"return confirm('You are about to delete this post \'".addslashes($edited_post_title)."\'\\n \'Cancel\' to stop, \'OK\' to delete.')\">Delete this post</a></p>";
|
||||
?>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
|
@ -0,0 +1,104 @@
|
|||
|
||||
<div class="wrap">
|
||||
<?php
|
||||
|
||||
$allowed_users = explode(" ", trim($fileupload_allowedusers));
|
||||
|
||||
function selected($selected, $current) {
|
||||
if ($selected == $current) echo ' selected="selected"';
|
||||
}
|
||||
|
||||
function checked($checked, $current) {
|
||||
if ($checked == $current) echo ' checked="checked"';
|
||||
}
|
||||
|
||||
|
||||
$submitbutton_text = 'Edit this!';
|
||||
$toprow_title = 'Editing Comment # '.$commentdata['comment_ID'];
|
||||
$form_action = 'editedcomment';
|
||||
$form_extra = "' />\n<input type='hidden' name='comment_ID' value='$comment' />\n<input type='hidden' name='comment_post_ID' value='".$commentdata["comment_post_ID"];
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<form name="post" action="post.php" method="post" id="post">
|
||||
<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.name.focus();
|
||||
}
|
||||
window.onload = focusit;
|
||||
</script>
|
||||
<fieldset id="namediv">
|
||||
<legend>Name:</legend>
|
||||
<div>
|
||||
<input type="text" name="newcomment_author" size="22" value="<?php echo format_to_edit($commentdata['comment_author']) ?>" tabindex="1" id="name" />
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset id="emaildiv">
|
||||
<legend>E-mail:</legend>
|
||||
<div>
|
||||
<input type="text" name="newcomment_author_email" size="30" value="<?php echo format_to_edit($commentdata['comment_author_email']) ?>" tabindex="2" id="email" />
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset id="uridiv">
|
||||
<legend>URI:</legend>
|
||||
<div>
|
||||
<input type="text" name="newcomment_author_url" size="35" value="<?php echo format_to_edit($commentdata['comment_author_url']) ?>" tabindex="3" id="URL" />
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset style="clear: both;">
|
||||
<legend>Comment</legend>
|
||||
<div id="quicktags">
|
||||
<?php
|
||||
if ($use_quicktags) {
|
||||
echo '<a href="http://wordpress.org/docs/reference/post/#quicktags" title="Help with quicktags">Quicktags</a>: ';
|
||||
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="40" name="content" tabindex="4" id="content" style="width: 99%"><?php echo $content ?></textarea></div>
|
||||
</fieldset>
|
||||
|
||||
<?php
|
||||
if ($use_quicktags) {
|
||||
?>
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
edCanvas = document.getElementById('content');
|
||||
//-->
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<p><?php echo $saveasdraft; ?> <input type="submit" name="submit" value="<?php echo $submitbutton_text ?>" style="font-weight: bold;" tabindex="6" />
|
||||
<input name="referredby" type="hidden" id="referredby" value="<?php echo $HTTP_SERVER_VARS['HTTP_REFERER']; ?>" />
|
||||
</p>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
// if the level is 5+, allow user to edit the timestamp - not on 'new post' screen though
|
||||
// if (($user_level > 4) && ($action != "post"))
|
||||
if ($user_level > 4) {
|
||||
touch_time(($action == 'edit'));
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
|
@ -12,71 +12,34 @@ function checked($checked, $current) {
|
|||
if ($checked == $current) echo ' checked="checked"';
|
||||
}
|
||||
|
||||
switch($action) {
|
||||
case 'post':
|
||||
$submitbutton_text = 'Blog this!';
|
||||
$toprow_title = 'New Post';
|
||||
$form_action = 'post';
|
||||
$form_extra = '';
|
||||
if ($use_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" /> <label for="pingback"><strong>PingBack</strong> the <acronym title="Uniform Resource Locators">URL</acronym>s in this post</label> <a href="http://wordpress.org/docs/reference/post/#pingback" title="Help on Pingbacks">?</a><br />';
|
||||
} else {
|
||||
$form_pingback = '';
|
||||
}
|
||||
if ($use_trackback) {
|
||||
$form_trackback = '<p><label for="trackback"><a href="http://wordpress.org/docs/reference/post/#trackback" title="Help on trackbacks"><strong>TrackBack</strong> an <acronym title="Uniform Resource Locator">URL</acronym></a>:</label> (Separate multiple <acronym title="Uniform Resource Locator">URL</acronym>s with spaces.)<br />
|
||||
<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" /></p>';
|
||||
if ('' != $pinged) {
|
||||
$form_trackback .= '<p>Already pinged:</p><ul>';
|
||||
$already_pinged = explode("\n", trim($pinged));
|
||||
foreach ($already_pinged as $pinged_url) {
|
||||
$form_trackback .= "\n\t<li>$pinged_url</li>";
|
||||
}
|
||||
$form_trackback .= '</ul>';
|
||||
}
|
||||
} else {
|
||||
$form_trackback = '';
|
||||
}
|
||||
$colspan = 3;
|
||||
$saveasdraft = '<input name="save" type="submit" id="save" tabindex="6" value="Save and Continue Editing" />';
|
||||
break;
|
||||
case "edit":
|
||||
$submitbutton_text = 'Edit this!';
|
||||
$toprow_title = 'Editing Post #' . $postdata['ID'];
|
||||
$form_action = 'editpost';
|
||||
$form_extra = "' />\n<input type='hidden' name='post_ID' value='$post->ID";
|
||||
$colspan = 2;
|
||||
$form_pingback = '<input type="hidden" name="post_pingback" value="0" />';
|
||||
$form_prevstatus = '<input type="hidden" name="prev_status" value="'.$post_status.'" />';
|
||||
if ($use_trackback) {
|
||||
$form_trackback = '<p><label for="trackback"><a href="http://wordpress.org/docs/reference/post/#trackback" title="Help on trackbacks"><strong>TrackBack</strong> an <acronym title="Uniform Resource Locator">URL</acronym></a></label>
|
||||
(Separate multiple <acronym title="Uniform Resource Locator">URL</acronym>s with spaces.)<br />
|
||||
<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. str_replace("\n", ' ', $to_ping) .'" /></p>';
|
||||
if ('' != $pinged) {
|
||||
$form_trackback .= '<p>Already pinged:</p><ul>';
|
||||
$already_pinged = explode("\n", trim($pinged));
|
||||
foreach ($already_pinged as $pinged_url) {
|
||||
$form_trackback .= "\n\t<li>$pinged_url</li>";
|
||||
}
|
||||
$form_trackback .= '</ul>';
|
||||
}
|
||||
} else {
|
||||
$form_trackback = '';
|
||||
}
|
||||
$saveasdraft = '<input name="save" type="submit" id="save" tabindex="6" value="Save and Continue Editing" />';
|
||||
break;
|
||||
case "editcomment":
|
||||
$submitbutton_text = 'Edit this!';
|
||||
$toprow_title = 'Editing Comment # '.$commentdata['comment_ID'];
|
||||
$form_action = 'editedcomment';
|
||||
$form_extra = "' />\n<input type='hidden' name='comment_ID' value='$comment' />\n<input type='hidden' name='comment_post_ID' value='".$commentdata["comment_post_ID"];
|
||||
$colspan = 3;
|
||||
$form_pingback = '<input type="hidden" name="post_pingback" value="0" />';
|
||||
$form_trackback = '';
|
||||
break;
|
||||
$submitbutton_text = 'Blog this!';
|
||||
$toprow_title = 'New Post';
|
||||
$form_action = 'post';
|
||||
$form_extra = '';
|
||||
if ($use_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" /> <label for="pingback"><strong>PingBack</strong> the <acronym title="Uniform Resource Locators">URL</acronym>s in this post</label> <a href="http://wordpress.org/docs/reference/post/#pingback" title="Help on Pingbacks">?</a><br />';
|
||||
} else {
|
||||
$form_pingback = '';
|
||||
}
|
||||
if ($use_trackback) {
|
||||
$form_trackback = '<p><label for="trackback"><a href="http://wordpress.org/docs/reference/post/#trackback" title="Help on trackbacks"><strong>TrackBack</strong> an <acronym title="Uniform Resource Locator">URL</acronym></a>:</label> (Separate multiple <acronym title="Uniform Resource Locator">URL</acronym>s with spaces.)<br />
|
||||
<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" /></p>';
|
||||
if ('' != $pinged) {
|
||||
$form_trackback .= '<p>Already pinged:</p><ul>';
|
||||
$already_pinged = explode("\n", trim($pinged));
|
||||
foreach ($already_pinged as $pinged_url) {
|
||||
$form_trackback .= "\n\t<li>$pinged_url</li>";
|
||||
}
|
||||
$form_trackback .= '</ul>';
|
||||
}
|
||||
} else {
|
||||
$form_trackback = '';
|
||||
}
|
||||
$colspan = 3;
|
||||
$saveasdraft = '';
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
@ -84,9 +47,6 @@ switch($action) {
|
|||
<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
|
||||
<input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' />
|
||||
|
||||
<?php if ($action != 'editcomment') {
|
||||
// this is for everything but comment editing
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
function focusit() {
|
||||
|
@ -96,7 +56,11 @@ function focusit() {
|
|||
window.onload = focusit;
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<style media="screen" type="text/css">
|
||||
#titlediv, #postpassworddiv {
|
||||
height: 3.5em;
|
||||
}
|
||||
</style>
|
||||
<div id="poststuff">
|
||||
<fieldset id="titlediv">
|
||||
<legend><a href="http://wordpress.org/docs/reference/post/#title" title="Help on titles">Title</a></legend>
|
||||
|
@ -107,80 +71,14 @@ window.onload = focusit;
|
|||
<legend><a href="http://wordpress.org/docs/reference/post/#category" title="Help on categories">Categories</a></legend>
|
||||
<div><?php dropdown_categories($default_post_cat); ?></div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="poststatusdiv">
|
||||
<legend><a href="http://wordpress.org/docs/reference/post/#post_status" title="Help on post status">Post Status</a></legend>
|
||||
<div><label for="post_status_publish" class="selectit"><input id="post_status_publish" name="post_status" type="radio" value="publish" <?php checked($post_status, 'publish'); ?> /> Publish</label>
|
||||
<label for="post_status_draft" class="selectit"><input id="post_status_draft" name="post_status" type="radio" value="draft" <?php checked($post_status, 'draft'); ?> /> Draft</label>
|
||||
<label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="radio" value="private" <?php checked($post_status, 'private'); ?> /> Private</label></div>
|
||||
</fieldset>
|
||||
<fieldset id="commentstatusdiv">
|
||||
<legend><a href="http://wordpress.org/docs/reference/post/#comments" title="Help on comment status">Comments</a></legend>
|
||||
<div><label for="comment_status_open" class="selectit"><input id="comment_status_open" name="comment_status" type="radio" value="open" <?php checked($comment_status, 'open'); ?> /> Open</label>
|
||||
<label for="comment_status_closed" class="selectit"><input id="comment_status_closed" name="comment_status" type="radio" value="closed" <?php checked($comment_status, 'closed'); ?> /> Closed</label></div>
|
||||
</fieldset>
|
||||
<fieldset id="pingstatusdiv">
|
||||
<legend><a href="http://wordpress.org/docs/reference/post/#pings" title="Help on ping status">Pings</a></legend>
|
||||
<div><label for="ping_status_open" class="selectit"><input id="ping_status_open" name="ping_status" type="radio" value="open" <?php checked($ping_status, 'open'); ?> /> Open</label>
|
||||
<label for="ping_status_closed" class="selectit"><input id="ping_status_closed" name="ping_status" type="radio" value="closed" <?php checked($ping_status, 'closed'); ?> /> Closed</label></div>
|
||||
</fieldset>
|
||||
<fieldset id="postpassworddiv">
|
||||
<legend><a href="http://wordpress.org/docs/reference/post/#post_password" title="Help on post password">Post Password</a></legend>
|
||||
<div><input name="post_password" type="text" size="18" id="post_password" value="<?php echo $post_password ?>" /></div>
|
||||
<div><input name="post_password" type="text" size="18" tabindex="3" id="post_password" value="<?php echo $post_password ?>" /></div>
|
||||
</fieldset>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
|
||||
// this is for comment editing
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function focusit() {
|
||||
// focus on first input field
|
||||
document.post.name.focus();
|
||||
}
|
||||
window.onload = focusit;
|
||||
</script>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="name">Name:</label><br />
|
||||
<input type="text" name="newcomment_author" size="22" value="<?php echo format_to_edit($commentdata['comment_author']) ?>" tabindex="1" id="name" /></td>
|
||||
<td>
|
||||
<label for="email">E-mail:</label><br />
|
||||
<input type="text" name="newcomment_author_email" size="30" value="<?php echo format_to_edit($commentdata['comment_author_email']) ?>" tabindex="2" id="email" />
|
||||
</td>
|
||||
<td>
|
||||
<label for="URL">URL:</label><br />
|
||||
<input type="text" name="newcomment_author_url" size="35" value="<?php echo format_to_edit($commentdata['comment_author_url']) ?>" tabindex="3" id="URL" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
|
||||
} // end else comment editing
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
if ($action != 'editcomment') {
|
||||
?>
|
||||
<br />
|
||||
<fieldset style="clear:both">
|
||||
<legend><a href="http://wordpress.org/docs/reference/post/#excerpt" title="Help with excerpts">Excerpt</a></legend>
|
||||
<div><textarea rows="2" cols="40" name="excerpt" tabindex="4" id="excerpt"><?php echo $excerpt ?></textarea></div>
|
||||
</fieldset>
|
||||
<?php
|
||||
} // if not a comment
|
||||
?>
|
||||
<fieldset>
|
||||
<?php
|
||||
if ($action != 'editcomment') {
|
||||
echo '<legend><a href="http://wordpress.org/docs/reference/post/#post" title="Help with post field">Post</a></legend>';
|
||||
} else {
|
||||
echo '<legend>Comment</legend>';
|
||||
}
|
||||
?>
|
||||
<legend><a href="http://wordpress.org/docs/reference/post/#post" title="Help with post field">Post</a></legend>
|
||||
<div id="quicktags">
|
||||
<?php
|
||||
if ($use_quicktags) {
|
||||
|
@ -206,50 +104,22 @@ if ($use_quicktags) {
|
|||
edCanvas = document.getElementById('content');
|
||||
//-->
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
if ($action != 'editcomment') {
|
||||
if (get_settings('use_geo_positions')) {
|
||||
if (empty($edited_lat)) {
|
||||
if (get_settings('use_default_geourl')) {
|
||||
$edited_lat = get_settings('default_geourl_lat');
|
||||
$edited_lon = get_settings('default_geourl_lon');
|
||||
}
|
||||
}
|
||||
?>
|
||||
<label for="post_latf">Latitude:</label><input size="8" type="text" value="<?php echo $edited_lat; ?>" name="post_latf">
|
||||
<label for="post_lonf">Longitude:</label><input size="8" type="text" value="<?php echo $edited_lon; ?>" name="post_lonf"> <a href="http://www.geourl.org/resources.html" rel="external" >click for Geo Info</a>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
<?php echo $form_pingback ?>
|
||||
<?php echo $form_prevstatus ?>
|
||||
|
||||
<p><?php echo $saveasdraft; ?> <input type="submit" name="submit" value="<?php echo $submitbutton_text ?>" style="font-weight: bold;" tabindex="6" />
|
||||
<p><input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="Save as Draft" />
|
||||
<input name="saveasprivate" type="submit" id="saveasprivate" tabindex="10" value="Save as Private" />
|
||||
<input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="Publish" />
|
||||
<input name="advanced" type="submit" id="advancededit" tabindex="7" value="Advanced Editing »" />
|
||||
<input name="referredby" type="hidden" id="referredby" value="<?php echo $HTTP_SERVER_VARS['HTTP_REFERER']; ?>" />
|
||||
</p>
|
||||
|
||||
|
||||
<?php
|
||||
if ($action != 'editcomment') {
|
||||
if ( ($use_fileupload) && ($user_level >= $fileupload_minlevel)
|
||||
&& (in_array($user_login, $allowed_users) || (trim($fileupload_allowedusers)=="")) ) { ?>
|
||||
<input type="button" value="upload a file/image" onclick="launchupload();" class="search" tabindex="10" />
|
||||
<?php }
|
||||
}
|
||||
|
||||
echo $form_trackback;
|
||||
|
||||
// if the level is 5+, allow user to edit the timestamp - not on 'new post' screen though
|
||||
// if (($user_level > 4) && ($action != "post"))
|
||||
if ($user_level > 4) {
|
||||
touch_time(($action == 'edit'));
|
||||
}
|
||||
if ('edit' == $action) echo "
|
||||
<p><a href='post.php?action=delete&post=$post->ID' onclick=\"return confirm('You are about to delete this post \'".addslashes($edited_post_title)."\'\\n \'Cancel\' to stop, \'OK\' to delete.')\">Delete this post</a></p>";
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -340,7 +340,7 @@ th { text-align: right; }
|
|||
for ($r = 0; $r < 10; $r++) {
|
||||
echo(' <option value="'.$r.'" ');
|
||||
if ($link_rating == $r)
|
||||
echo('selected');
|
||||
echo 'selected="selected"';
|
||||
echo('>'.$r.'</option>');
|
||||
}
|
||||
?>
|
||||
|
@ -468,7 +468,7 @@ function checkAll(form)
|
|||
<li class="last"><a href="link-import.php">Import Blogroll</a></li>
|
||||
</ul>
|
||||
<div class="wrap">
|
||||
<form name="cats" method="post">
|
||||
<form name="cats" method="post" action="">
|
||||
<table width="75%" cellpadding="3" cellspacing="3">
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -486,12 +486,12 @@ function checkAll(form)
|
|||
echo " <select name=\"cat_id\">\n";
|
||||
echo " <option value=\"All\"";
|
||||
if ($cat_id == 'All')
|
||||
echo " selected";
|
||||
echo " selected='selected'";
|
||||
echo "> All</option>\n";
|
||||
foreach ($results as $row) {
|
||||
echo " <option value=\"".$row->cat_id."\"";
|
||||
if ($row->cat_id == $cat_id)
|
||||
echo " selected";
|
||||
echo " selected='selected'";
|
||||
echo ">".$row->cat_id.": ".$row->cat_name;
|
||||
if ($row->auto_toggle == 'Y')
|
||||
echo ' (auto toggle)';
|
||||
|
@ -502,12 +502,12 @@ function checkAll(form)
|
|||
</td>
|
||||
<td>
|
||||
<select name="order_by">
|
||||
<option value="order_id" <?php if ($order_by == 'order_id') echo " selected";?>>Id</option>
|
||||
<option value="order_name" <?php if ($order_by == 'order_name') echo " selected";?>>Name</option>
|
||||
<option value="order_url" <?php if ($order_by == 'order_url') echo " selected";?>>URL</option>
|
||||
<option value="order_desc" <?php if ($order_by == 'order_desc') echo " selected";?>>Description</option>
|
||||
<option value="order_owner" <?php if ($order_by == 'order_owner') echo " selected";?>>Owner</option>
|
||||
<option value="order_rating" <?php if ($order_by == 'order_rating') echo " selected";?>>Rating</option>
|
||||
<option value="order_id" <?php if ($order_by == 'order_id') echo " selected='selected'";?>>Link ID</option>
|
||||
<option value="order_name" <?php if ($order_by == 'order_name') echo " selected='selected'";?>>Name</option>
|
||||
<option value="order_url" <?php if ($order_by == 'order_url') echo " selected='selected'";?>>URI</option>
|
||||
<option value="order_desc" <?php if ($order_by == 'order_desc') echo " selected='selected'";?>>Description</option>
|
||||
<option value="order_owner" <?php if ($order_by == 'order_owner') echo " selected='selected'";?>>Owner</option>
|
||||
<option value="order_rating" <?php if ($order_by == 'order_rating') echo " selected='selected'";?>>Rating</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
|
@ -521,7 +521,7 @@ function checkAll(form)
|
|||
|
||||
<div class="wrap">
|
||||
|
||||
<form name="links" id="links" method="post">
|
||||
<form name="links" id="links" method="post" action="">
|
||||
<input type="hidden" name="link_id" value="" />
|
||||
<input type="hidden" name="action" value="" />
|
||||
<input type="hidden" name="order_by" value="<?php echo $order_by ?>" />
|
||||
|
@ -591,7 +591,7 @@ LINKS;
|
|||
echo <<<LINKS
|
||||
<td><a href="link-manager.php?link_id=$link->link_id&action=linkedit" class="edit">Edit</a></td>
|
||||
<td><a href="link-manager.php?link_id=$link->link_id&action=Delete" onclick="return confirm('You are about to delete this link.\\n \'Cancel\' to stop, \'OK\' to delete.');" class="delete">Delete</a></td>
|
||||
<td><input type="checkbox" name="linkcheck[]" value="$link->link_id" /><td>
|
||||
<td><input type="checkbox" name="linkcheck[]" value="$link->link_id" /></td>
|
||||
LINKS;
|
||||
} else {
|
||||
echo "<td> </td><td> </td><td> </td>\n";
|
||||
|
@ -634,10 +634,11 @@ LINKS;
|
|||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
} // end if !popup
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -84,8 +84,29 @@ switch($action) {
|
|||
} else {
|
||||
$now = date('Y-m-d H:i:s', (time() + ($time_difference * 3600)));
|
||||
}
|
||||
|
||||
if ('' != $HTTP_POST_VARS['save']) $post_status = 'draft';
|
||||
|
||||
if (!empty($HTTP_POST_VARS['mode'])) {
|
||||
switch($HTTP_POST_VARS['mode']) {
|
||||
case 'bookmarklet':
|
||||
$location = 'bookmarklet.php?a=b';
|
||||
break;
|
||||
case 'sidebar':
|
||||
$location = 'sidebar.php?a=b';
|
||||
break;
|
||||
default:
|
||||
$location = 'post.php';
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$location = 'post.php';
|
||||
}
|
||||
|
||||
// What to do based on which button they pressed
|
||||
if ('' != $HTTP_POST_VARS['saveasdraft']) $post_status = 'draft';
|
||||
if ('' != $HTTP_POST_VARS['saveasprivate']) $post_status = 'private';
|
||||
if ('' != $HTTP_POST_VARS['publish']) $post_status = 'publish';
|
||||
if ('' != $HTTP_POST_VARS['advanced']) $post_status = 'draft';
|
||||
|
||||
|
||||
if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) {
|
||||
$postquery ="INSERT INTO $tableposts
|
||||
|
@ -105,6 +126,10 @@ switch($action) {
|
|||
|
||||
$post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1");
|
||||
|
||||
if ('' != $HTTP_POST_VARS['advanced'])
|
||||
$location = "post.php?action=edit&post=$post_ID";
|
||||
|
||||
|
||||
// Insert categories
|
||||
// Check to make sure there is a category, if not just set it to some default
|
||||
if (!$post_categories) $post_categories = $wpdb->get_var("SELECT cat_ID FROM $tablecategories LIMIT 1");
|
||||
|
@ -126,23 +151,6 @@ switch($action) {
|
|||
sleep($sleep_after_edit);
|
||||
}
|
||||
|
||||
if (!empty($HTTP_POST_VARS['mode'])) {
|
||||
switch($HTTP_POST_VARS['mode']) {
|
||||
case 'bookmarklet':
|
||||
$location = 'bookmarklet.php?a=b';
|
||||
break;
|
||||
case 'sidebar':
|
||||
$location = 'sidebar.php?a=b';
|
||||
break;
|
||||
default:
|
||||
$location = 'post.php';
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$location = 'post.php';
|
||||
}
|
||||
|
||||
if ('' != $HTTP_POST_VARS['save']) $location = "post.php?action=edit&post=$post_ID";
|
||||
|
||||
header("Location: $location");
|
||||
|
||||
|
@ -209,7 +217,7 @@ switch($action) {
|
|||
$to_ping = $postdata['to_ping'];
|
||||
$pinged = $postdata['pinged'];
|
||||
|
||||
include('edit-form.php');
|
||||
include('edit-form-advanced.php');
|
||||
} else {
|
||||
?>
|
||||
<p>Since you’re a newcomer, you’ll have to wait for an admin to raise your level to 1,
|
||||
|
@ -261,6 +269,8 @@ switch($action) {
|
|||
$trackback = $HTTP_POST_VARS['trackback_url'];
|
||||
// Format trackbacks
|
||||
$trackback = preg_replace('|\s+|', '\n', $trackback);
|
||||
|
||||
if ('' != $HTTP_POST_VARS['publish']) $post_status = 'publish';
|
||||
|
||||
if (($user_level > 4) && (!empty($HTTP_POST_VARS['edit_date']))) {
|
||||
$aa = $HTTP_POST_VARS['aa'];
|
||||
|
@ -407,7 +417,7 @@ switch($action) {
|
|||
$content = $commentdata['comment_content'];
|
||||
$content = format_to_edit($content);
|
||||
|
||||
include('edit-form.php');
|
||||
include('edit-form-comment.php');
|
||||
|
||||
break;
|
||||
|
||||
|
|
|
@ -301,7 +301,7 @@ textarea, input, select {
|
|||
text-align: right;
|
||||
}
|
||||
|
||||
#titlediv, #poststatusdiv, #commentstatusdiv, #pingstatusdiv, #postpassworddiv {
|
||||
#titlediv, #poststatusdiv, #commentstatusdiv, #pingstatusdiv, #postpassworddiv, #namediv, #uridiv, #emaildiv {
|
||||
float: left;
|
||||
height: 6em;
|
||||
margin-right: 5px;
|
||||
|
|
Loading…
Reference in New Issue