Make WordPress Core


Ignore:
Timestamp:
08/10/2004 05:35:59 AM (22 years ago)
Author:
rboren
Message:

Static pages. Take 1.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/post.php

    r1512 r1527  
    108108        if ('' != $_POST['publish']) $post_status = 'publish';
    109109        if ('' != $_POST['advanced']) $post_status = 'draft';
    110 
     110        if ('' != $_POST['savepage']) $post_status = 'static';
    111111
    112112        if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) {
    … …  
    143143        if ( '' != $_POST['advanced'] || isset($_POST['save']) )
    144144                $location = "post.php?action=edit&post=$post_ID";
     145
     146        if ( '' != $_POST['savepage'] )
     147                $location = "post.php?action=createpage";
    145148
    146149        header("Location: $location"); // Send user on their way while we keep working
    … …  
    234237                $post_name = $postdata->post_name;
    235238
    236                 include('edit-form-advanced.php');
     239        if ($post_status == 'static') {
     240            include('edit-page-form.php');
     241        } else {
     242            include('edit-form-advanced.php');
     243        }
    237244
    238245                $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = '$post_ID'");
    … …  
    712719        do_action('edit_comment', $comment_ID);
    713720        break;
     721
     722 case 'createpage':
     723        $standalone = 0;
     724        $title = __('Create New Page');
     725        require_once ('./admin-header.php');
     726
     727        if ($user_level > 0) {
     728                $action = 'post';
     729                get_currentuserinfo();
     730                //set defaults
     731                $post_status = 'static';
     732                $comment_status = get_settings('default_comment_status');
     733                $ping_status = get_settings('default_ping_status');
     734                $post_pingback = get_settings('default_pingback_flag');
     735                $default_post_cat = get_settings('default_post_category');
     736
     737        include('edit-page-form.php');
     738        } else {
     739?>
     740<div class="wrap">
     741                <p><?php printf(__('Since you&#8217;re a newcomer, you&#8217;ll have to wait for an admin to raise your level to 1, in order to be authorized to post.<br />
     742You can also <a href="mailto:%s?subject=Promotion?">e-mail the admin</a> to ask for a promotion.<br />
     743When you&#8217;re promoted, just reload this page and you&#8217;ll be able to blog. :)'), get_settings('admin_email')); ?>
     744                </p>
     745</div>
     746<?php
     747
     748        }
     749
     750     break;
    714751
    715752default:
Note: See TracChangeset for help on using the changeset viewer.