[wp-cvs] wordpress/wp-admin page-new.php, NONE, 1.1 edit-page-form.php, 1.8, 1.9 edit-pages.php, 1.6, 1.7 menu.php, 1.30, 1.31 post.php, 1.107, 1.108

Matthew Mullenweg saxmatt at users.sourceforge.net
Tue Nov 16 19:29:54 UTC 2004


Update of /cvsroot/cafelog/wordpress/wp-admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9013/wp-admin

Modified Files:
	edit-page-form.php edit-pages.php menu.php post.php 
Added Files:
	page-new.php 
Log Message:
Improvements to page handling. Move form to own page, put under "Write", ambiguiate language, and fix redirect.

Index: edit-pages.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/edit-pages.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** edit-pages.php	19 Oct 2004 03:03:03 -0000	1.6
--- edit-pages.php	16 Nov 2004 19:29:51 -0000	1.7
***************
*** 55,76 ****
  } // end if ($posts)
  ?> 
! 
  </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'); ?> 
\ No newline at end of file
--- 55,62 ----
  } // 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 include('admin-footer.php'); ?> 
\ No newline at end of file

Index: edit-page-form.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/edit-page-form.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** edit-page-form.php	28 Oct 2004 04:01:51 -0000	1.8
--- edit-page-form.php	16 Nov 2004 19:29:51 -0000	1.9
***************
*** 1,5 ****
  
  <div class="wrap">
! <h2><?php _e('New Page'); ?></h2>
  <?php
  if (0 == $post_ID) {
--- 1,5 ----
  
  <div class="wrap">
! <h2><?php _e('Write Page'); ?></h2>
  <?php
  if (0 == $post_ID) {

--- NEW FILE: page-new.php ---
<?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'); ?> 
Index: menu.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/menu.php,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** menu.php	19 Oct 2004 03:03:04 -0000	1.30
--- menu.php	16 Nov 2004 19:29:51 -0000	1.31
***************
*** 16,19 ****
--- 16,22 ----
  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');

Index: post.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/post.php,v
retrieving revision 1.107
retrieving revision 1.108
diff -C2 -d -r1.107 -r1.108
*** post.php	29 Oct 2004 15:29:36 -0000	1.107
--- post.php	16 Nov 2004 19:29:51 -0000	1.108
***************
*** 2,6 ****
  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' );
  
  for ($i=0; $i<count($wpvarstoreset); $i += 1) {
--- 2,6 ----
  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' );
  
  for ($i=0; $i<count($wpvarstoreset); $i += 1) {
***************
*** 22,28 ****
  case 'post':
  
! 	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']);
--- 22,27 ----
  case 'post':
  
! 	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']);
***************
*** 115,124 ****
  	}
  
  	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
  
--- 114,123 ----
  	}
  
+ 	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";
  
  	header("Location: $location"); // Send user on their way while we keep working
  




More information about the cvs mailing list