Make WordPress Core

Changeset 9620


Ignore:
Timestamp:
11/11/2008 10:40:16 PM (16 years ago)
Author:
ryan
Message:

Move screen_meta() to admin header. Add all meta boxes before requiring admin-header.

Location:
trunk/wp-admin
Files:
23 edited

Legend:

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

    r9596 r9620  
    106106do_action('admin_notices');
    107107
     108screen_meta($pagenow);
     109
    108110if ( $parent_file == 'options-general.php' ) {
    109111    require(ABSPATH . 'wp-admin/options-head.php');
  • trunk/wp-admin/categories.php

    r9589 r9620  
    131131$messages[5] = __('Category not updated.');
    132132?>
    133 
    134 <?php screen_meta('edit-categories') ?>
    135133
    136134<div class="wrap nosubsub">
  • trunk/wp-admin/edit-comments.php

    r9589 r9620  
    8282$search = attribute_escape( $search_dirty ); ?>
    8383
    84 <?php screen_meta('edit-comments') ?>
    85 
    8684<div class="wrap">
    8785<h2><?php echo wp_specialchars( $title ); ?></h2>
  • trunk/wp-admin/edit-form-advanced.php

    r9613 r9620  
    466466endif;
    467467
    468 ?>
    469 <?php screen_meta('post'); ?>
     468do_action('do_meta_boxes', 'post', 'normal', $post);
     469do_action('do_meta_boxes', 'post', 'advanced', $post);
     470do_action('do_meta_boxes', 'post', 'side', $post);
     471
     472require_once('admin-header.php');
     473
     474?>
    470475
    471476<?php if ( (isset($mode) && 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?>
  • trunk/wp-admin/edit-link-categories.php

    r9589 r9620  
    6060$messages[5] = __('Category not updated.');
    6161$messages[6] = __('Categories deleted.'); ?>
    62 
    63 <?php screen_meta('edit-link-categories') ?>
    6462
    6563<div class="wrap nosubsub">
  • trunk/wp-admin/edit-link-category-form.php

    r9032 r9620  
    1717     * @var string
    1818     */
    19     $heading = '';
     19    $heading = '<h2>' . __('Edit Category') . '</h2>';
    2020    $submit_text = __('Edit Category');
    2121    $form = '<form name="editcat" id="editcat" method="post" action="link-category.php" class="validate">';
  • trunk/wp-admin/edit-link-form.php

    r9557 r9620  
    308308<?php
    309309}
    310 add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'normal', 'core'); ?>
    311 
    312 <?php screen_meta('link') ?>
     310add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'normal', 'core');
     311
     312do_action('do_meta_boxes', 'link', 'normal', $link);
     313do_action('do_meta_boxes', 'link', 'advanced', $link);
     314do_action('do_meta_boxes', 'link', 'side', $link);
     315
     316require_once ('admin-header.php');
     317
     318?>
     319
    313320
    314321<div class="wrap">
    315322<h2><?php echo wp_specialchars( $title ); ?></h2>
     323
     324<?php
     325$link_added = ( isset($_GET['added']) && '' != $_POST['link_name'] ) ?
     326    '<div id="message" class="updated fade"><p>' . __('Link added.') . '</p></div>' : '';
     327?>
     328
     329<?php if ( isset( $_GET['added'] ) && '' != $_POST['link_name']) : ?>
     330<div id="message" class="updated fade"><p><?php _e('Link added.'); ?></p></div>
     331<?php endif; ?>
    316332
    317333<?php
  • trunk/wp-admin/edit-page-form.php

    r9614 r9620  
    370370add_meta_box('revisionsdiv', __('Page Revisions'), 'page_revisions_meta_box', 'page', 'normal', 'core');
    371371endif;
    372 ?>
    373 
    374 <?php screen_meta('page'); ?>
     372
     373do_action('do_meta_boxes', 'page', 'normal', $post);
     374do_action('do_meta_boxes', 'page', 'advanced', $post);
     375do_action('do_meta_boxes', 'page', 'side', $post);
     376
     377require_once('admin-header.php');
     378?>
    375379
    376380<div class="wrap">
  • trunk/wp-admin/edit-pages.php

    r9607 r9620  
    102102require_once('admin-header.php'); ?>
    103103
    104 <?php screen_meta('edit-pages') ?>
    105 
    106104<div class="wrap">
    107105<h2><?php echo wp_specialchars( $title ); ?></h2>
  • trunk/wp-admin/edit-tags.php

    r9596 r9620  
    129129$messages[5] = __('Tag not updated.');
    130130$messages[6] = __('Tags deleted.'); ?>
    131 
    132 <?php screen_meta('edit-tags') ?>
    133131
    134132<div class="wrap nosubsub">
  • trunk/wp-admin/edit.php

    r9607 r9620  
    9191    $mode = attribute_escape($_GET['mode']); ?>
    9292
    93 <?php screen_meta('edit-posts') ?>
    94 
    9593<div class="wrap">
    9694<h2><?php echo wp_specialchars( $title ); ?></h2>
  • trunk/wp-admin/includes/template.php

    r9607 r9620  
    26512651    static $already_sorted = false;
    26522652
    2653     do_action('do_meta_boxes', $page, $context, $object);
     2653    //do_action('do_meta_boxes', $page, $context, $object);
    26542654
    26552655    $hidden = (array) get_user_option( "meta-box-hidden_$page" );
     
    31783178    global $wp_meta_boxes;
    31793179
    3180     $column_screens = array('edit-posts' => 'post', 'edit-pages' => 'page', 'edit-tags' => 'tag', 'edit-categories' => 'category',
    3181         'edit-link-categories' => 'link-category', 'edit-links' => 'link', 'edit-users' => 'user', 'edit-media' => 'media',
     3180    $screen = str_replace('.php', '', $screen);
     3181
     3182    $column_screens = array('edit' => 'post', 'edit-pages' => 'page', 'edit-tags' => 'tag', 'categories' => 'category',
     3183        'edit-link-categories' => 'link-category', 'link-manager' => 'link', 'users' => 'user', 'upload' => 'media',
    31823184        'edit-comments' => 'comment');
    31833185
     3186    $screen = str_replace('-new', '', $screen);
     3187    $screen = str_replace('-add', '', $screen);
     3188    $meta_screens = array('index' => 'dashboard');
     3189
     3190    if ( isset($meta_screens[$screen]) )
     3191        $screen = $meta_screens[$screen];
     3192error_log("screen: $screen");
    31843193    $show_screen = false;
    31853194    if ( !empty($wp_meta_boxes[$screen]) || !empty($column_screens[$screen]) )
  • trunk/wp-admin/index.php

    r9557 r9620  
    2929?>
    3030
    31 <?php screen_meta('dashboard'); ?>
    32 
    3331<div class="wrap">
    3432<h2><?php echo wp_specialchars( $title ); ?></h2>
  • trunk/wp-admin/link-add.php

    r9232 r9620  
    2121wp_enqueue_script('xfn');
    2222
    23 $link_added = ( isset($_GET['added']) && '' != $_POST['link_name'] ) ?
    24     '<div id="message" class="updated fade"><p>' . __('Link added.') . '</p></div>' : '';
    25 
    26 require('admin-header.php');
    27 ?>
    28 
    29 <?php if ( isset( $_GET['added'] ) && '' != $_POST['link_name']) : ?>
    30 <div id="message" class="updated fade"><p><?php _e('Link added.'); ?></p></div>
    31 <?php endif; ?>
    32 
    33 <?php
    3423$link = get_default_link_to_edit();
    3524include('edit-link-form.php');
  • trunk/wp-admin/link-manager.php

    r9563 r9620  
    7474        break;
    7575} ?>
    76 
    77 <?php screen_meta('edit-links') ?>
    7876
    7977<div class="wrap nosubsub">
  • trunk/wp-admin/link.php

    r9506 r9620  
    107107            wp_die(__('Link not found.'));
    108108
    109         include_once ('admin-header.php');
    110109        include ('edit-link-form.php');
    111110        include ('admin-footer.php');
  • trunk/wp-admin/page-new.php

    r9232 r9620  
    2020wp_enqueue_script('word-count');
    2121
    22 require_once('admin-header.php');
    23 ?>
    24 
    25 <?php if ( (isset($_GET['posted']) && $_GET['posted'])  || isset($_GET['saved'])  ) : ?>
    26 <div id="message" class="updated fade"><p><strong><?php _e('Page saved.') ?></strong> <a href="edit-pages.php"><?php _e('Manage pages'); ?></a> | <a href="<?php echo get_page_link( isset($_GET['posted']) ? $_GET['posted'] : $_GET['saved'] ); ?>"><?php _e('View page') ; ?></a></p></div>
    27 <?php endif; ?>
    28 
    29 <?php
    3022if ( current_user_can('edit_pages') ) {
    3123    $action = 'post';
     
    3426    include('edit-page-form.php');
    3527}
     28
     29include('admin-footer.php');
     30
    3631?>
    37 
    38 <?php include('admin-footer.php'); ?>
  • trunk/wp-admin/page.php

    r9596 r9620  
    116116    }
    117117
    118     require_once('admin-header.php');
    119 
    120118    if ( !current_user_can('edit_page', $page_ID) )
    121119        die ( __('You are not allowed to edit this page.') );
  • trunk/wp-admin/post-new.php

    r9221 r9620  
    2020wp_enqueue_script('word-count');
    2121
    22 require_once ('./admin-header.php');
    23 
    24 if ( ! current_user_can('edit_posts') ) { ?>
     22if ( ! current_user_can('edit_posts') ) {
     23    require_once ('./admin-header.php'); ?>
    2524<div class="wrap">
    2625<p><?php printf(__('Since you&#8217;re a newcomer, you&#8217;ll have to wait for an admin to add the <code>edit_posts</code> capability to your user, in order to be authorized to post.<br />
     
    3433}
    3534
    36 if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>
    37 <div id="message" class="updated fade"><p><strong><?php _e('Your post has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post'); ?></a> | <a href="<?php echo get_edit_post_link( $_GET['posted'] ); ?>"><?php _e('Edit post'); ?></a></p></div>
    38 <?php
    39 endif;
    40 ?>
    41 
    42 
    43 <?php
    44 
    4535// Show post form.
    4636$post = get_default_post_to_edit();
  • trunk/wp-admin/post.php

    r9596 r9620  
    159159    $title = __('Edit Post');
    160160
    161     require_once('admin-header.php');
    162 
    163161    if ( !current_user_can('edit_post', $post_ID) )
    164162        die ( __('You are not allowed to edit this post.') );
  • trunk/wp-admin/upload.php

    r9595 r9620  
    145145
    146146require_once('admin-header.php'); ?>
    147 
    148 <?php screen_meta('edit-media') ?>
    149147
    150148<?php
  • trunk/wp-admin/user-new.php

    r9614 r9620  
    4141
    4242require_once ('admin-header.php');
    43 
    44 screen_meta('user');
    4543
    4644?>
  • trunk/wp-admin/users.php

    r9614 r9620  
    221221    endif; ?>
    222222
    223 <?php screen_meta('edit-users') ?>
    224 
    225223<?php if ( isset($errors) && is_wp_error( $errors ) ) : ?>
    226224    <div class="error">
Note: See TracChangeset for help on using the changeset viewer.