Improvements to page handling. Move form to own page, put under "Write", ambiguiate language, and fix redirect.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-11-16 19:29:51 +00:00
parent 6f80cf6b6a
commit 1c1c71b436
5 changed files with 41 additions and 23 deletions

View File

@ -1,6 +1,6 @@
<div class="wrap">
<h2><?php _e('New Page'); ?></h2>
<h2><?php _e('Write Page'); ?></h2>
<?php
if (0 == $post_ID) {
$form_action = 'post';

View File

@ -54,23 +54,9 @@ $class = ('alternate' == $class) ? '' : 'alternate';
<?php
} // end if ($posts)
?>
<p><?php _e('Pages are like posts except they live outside of the normal blog chronology. You can use pages to organize and manage any amount of content.'); ?></p>
<h3><a href="page-new.php"><?php _e('Create New Page'); ?> &raquo;</a></h3>
</div>
<?php
if ($user_level > 0) {
$action = 'post';
get_currentuserinfo();
//set defaults
$post_status = 'static';
$comment_status = get_settings('default_comment_status');
$ping_status = get_settings('default_ping_status');
$post_pingback = get_settings('default_pingback_flag');
$post_parent = 0;
$page_template = 'default';
include('edit-page-form.php');
}
?>
<?php include('admin-footer.php'); ?>

View File

@ -15,6 +15,9 @@ $menu[40] = array(__('Presentation'), 8, 'themes.php');
$menu[45] = array(__('Upload'), get_settings('fileupload_minlevel'), 'upload.php');
ksort($menu); // So other files can plugin
$submenu['post.php'][5] = array('Write Post', 1, 'post.php');
$submenu['post.php'][10] = array('Write Page', 5, 'page-new.php');
$submenu['edit.php'][5] = array(__('Posts'), 1, 'edit.php');
$submenu['edit.php'][10] = array(__('Pages'), 5, 'edit-pages.php');
$submenu['edit.php'][15] = array(__('Categories'), 1, 'categories.php');

30
wp-admin/page-new.php Normal file
View File

@ -0,0 +1,30 @@
<?php
require_once('admin.php');
$title = __('New Page');
$parent_file = 'post.php';
require_once('admin-header.php');
get_currentuserinfo();
?>
<?php if ( isset($_GET['saved']) ) : ?>
<div class="updated"><p><strong><?php _e('Page saved.') ?> <a href="edit-pages.php"><?php _e('Manage pages'); ?> &raquo;</a></strong></p></div>
<?php endif; ?>
<?php
if ($user_level > 0) {
$action = 'post';
get_currentuserinfo();
//set defaults
$post_status = 'static';
$comment_status = get_settings('default_comment_status');
$ping_status = get_settings('default_ping_status');
$post_pingback = get_settings('default_pingback_flag');
$post_parent = 0;
$page_template = 'default';
include('edit-page-form.php');
}
?>
<?php include('admin-footer.php'); ?>

View File

@ -1,7 +1,7 @@
<?php
require_once('admin.php');
$wpvarstoreset = array('action', 'safe_mode', 'withcomments', 'posts', 'poststart', 'postend', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder', 'enclosure_url' );
$wpvarstoreset = array('action', 'safe_mode', 'withcomments', 'posts', 'poststart', 'postend', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder' );
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
$wpvar = $wpvarstoreset[$i];
@ -21,9 +21,8 @@ for ($i=0; $i<count($wpvarstoreset); $i += 1) {
switch($action) {
case 'post':
if (!user_can_create_draft($user_ID)) {
if ( !user_can_create_draft($user_ID) )
die('You are not allowed to create posts or drafts on this blog.');
}
$post_pingback = intval($_POST['post_pingback']);
$content = apply_filters('content_save_pre', $_POST['content']);
@ -114,12 +113,12 @@ case 'post':
$location = 'post.php?posted=true';
}
if ( 'static' == $_POST['post_status'] )
$location = "page-new.php?saved=true";
if ( '' != $_POST['advanced'] || isset($_POST['save']) )
$location = "post.php?action=edit&post=$post_ID";
if ( '' != $_POST['savepage'] )
$location = "post.php?action=createpage";
header("Location: $location"); // Send user on their way while we keep working
// Insert categories