WordPress.org

Make WordPress Core

Changeset 7979


Ignore:
Timestamp:
05/22/2008 12:06:41 AM (10 years ago)
Author:
ryan
Message:

wp_admin_css() improvements. Props mdawaffe. see #7011

Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r7974 r7979  
    127127<title><?php bloginfo('name') ?> &rsaquo; <?php _e('Uploads'); ?> &#8212; <?php _e('WordPress'); ?></title>
    128128<?php
    129 wp_admin_css( 'css/global' );
     129wp_admin_css( 'global' );
    130130wp_admin_css();
    131 wp_admin_css( 'css/colors' );
     131wp_admin_css( 'colors' );
     132if ( 0 === strpos( $content_func, 'media' ) )
     133    wp_admin_css( 'media' );
     134
    132135?>
    133136<script type="text/javascript">
     
    138141<?php
    139142do_action('admin_print_scripts');
     143do_action('admin_print_styles');
    140144do_action('admin_head');
    141145if ( is_string($content_func) )
     
    182186add_action( 'admin_print_scripts-page-new.php', 'add_thickbox' );
    183187add_action( 'admin_print_scripts-page.php', 'add_thickbox' );
    184 
    185 function media_admin_css() {
    186     wp_admin_css('css/media');
    187 }
    188188
    189189add_action('media_upload_media', 'media_upload_handler');
     
    12061206add_action('media_upload_video', 'media_upload_video');
    12071207add_action('media_upload_file', 'media_upload_file');
    1208 add_action('admin_head_media_upload_type_form', 'media_admin_css');
    12091208
    12101209add_filter('media_upload_gallery', 'media_upload_gallery');
    1211 add_action('admin_head_media_upload_gallery_form', 'media_admin_css');
    12121210
    12131211add_filter('media_upload_library', 'media_upload_library');
    1214 add_action('admin_head_media_upload_library_form', 'media_admin_css');
    12151212
    12161213?>
  • trunk/wp-admin/includes/widgets.php

    r7964 r7979  
    286286    return trim( wp_specialchars( strip_tags( $string ) ) );
    287287}
    288 
    289 function widget_css() {
    290     wp_admin_css( 'css/widgets' );
    291 }
    292 
    293 add_action( 'admin_head', 'widget_css' );
    294 
    295 ?>
  • trunk/wp-admin/index.php

    r7951 r7979  
    2727add_action( 'admin_head', 'index_js' );
    2828
    29 function index_css() {
    30     wp_admin_css( 'css/dashboard' );
    31 }
    32 add_action( 'admin_head', 'index_css' );
    33 
    3429wp_enqueue_script( 'jquery' );
     30wp_admin_css( 'dashboard' );
    3531
    3632$title = __('Dashboard');
  • trunk/wp-admin/install.php

    r7971 r7979  
    1717    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    1818    <title><?php _e('WordPress &rsaquo; Installation'); ?></title>
    19     <?php wp_admin_css( 'css/install' ); ?>
     19    <?php wp_admin_css( 'install', true ); ?>
    2020</head>
    2121<body>
  • trunk/wp-admin/media.php

    r7889 r7979  
    6161
    6262    wp_enqueue_script( 'wp-ajax-response' );
    63     add_action('admin_head', 'media_admin_css');
     63    wp_admin_css( 'media' );
     64
    6465
    6566    require( 'admin-header.php' );
  • trunk/wp-admin/plugin-editor.php

    r7525 r7979  
    77wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file'));
    88
    9 add_action( 'admin_head', 'theme_editor_css' );
    10 function theme_editor_css(){
    11     wp_admin_css( 'css/theme-editor' );
    12 }
     9wp_admin_css( 'theme-editor' );
    1310
    1411$plugins = get_plugins();
  • trunk/wp-admin/press-this.php

    r7966 r7979  
    196196    wp_enqueue_script('jquery-ui-tabs');
    197197    add_thickbox();
     198    wp_admin_css('press-this');
     199    wp_admin_css( 'colors' );
    198200    wp_enqueue_script('post');
     201
    199202    do_action('admin_print_scripts');
     203    do_action('admin_print_styles');
    200204    do_action('admin_head');
    201     wp_admin_css('css/press-this');
    202     wp_admin_css( 'css/colors' );
    203205?>
    204206    <script type="text/javascript">
  • trunk/wp-admin/sidebar.php

    r7883 r7979  
    1515<title><?php _e('WordPress &#8250; Posted'); ?></title>
    1616<?php
    17 wp_admin_css( 'css/global' );
    18 wp_admin_css();
     17wp_admin_css( 'global', true );
     18wp_admin_css( 'wp-admin', true );
     19wp_admin_css( 'colors', true );
    1920?>
    2021</head>
     
    3334<title><?php _e('WordPress &#8250; Sidebar'); ?></title>
    3435<?php
    35 wp_admin_css( 'css/global' );
    36 wp_admin_css();
     36wp_admin_css( 'global', true );
     37wp_admin_css( 'wp-admin', true );
     38wp_admin_css( 'colors', true );
    3739?>
    3840<style type="text/css" media="screen">
  • trunk/wp-admin/theme-editor.php

    r7883 r7979  
    77wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file', 'theme'));
    88
    9 add_action( 'admin_head', 'theme_editor_css' );
    10 function theme_editor_css(){
    11     wp_admin_css( 'css/theme-editor' );
    12 }
     9wp_admin_css( 'theme-editor' );
    1310
    1411$themes = get_themes();
  • trunk/wp-admin/update.php

    r7949 r7979  
    44
    55if ( !current_user_can('edit_plugins') )
    6                 wp_die('<p>'.__('You do not have sufficient permissions to update plugins for this blog.').'</p>');
     6    wp_die('<p>'.__('You do not have sufficient permissions to update plugins for this blog.').'</p>');
    77
    88function request_filesystem_credentials($form_post, $type = '', $error = false) {
     
    152152<title><?php bloginfo('name') ?> &rsaquo; <?php _e('Plugin Reactivation'); ?> &#8212; <?php _e('WordPress'); ?></title>
    153153<?php
    154 wp_admin_css( 'css/global' );
    155 wp_admin_css( 'css/colors' );
     154wp_admin_css( 'global', true );
     155wp_admin_css( 'colors', true );
    156156?>
    157157</head>
  • trunk/wp-admin/upgrade.php

    r7971 r7979  
    1717    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
    1818    <title><?php _e('WordPress &rsaquo; Upgrade'); ?></title>
    19     <?php wp_admin_css( 'css/install' ); ?>
     19    <?php wp_admin_css( 'install', true ); ?>
    2020</head>
    2121<body>
  • trunk/wp-admin/widgets.php

    r7883 r7979  
    88
    99wp_enqueue_script( array( 'wp-lists', 'admin-widgets' ) );
     10wp_admin_css( 'widgets' );
    1011
    1112do_action( 'sidebar_admin_setup' );
  • trunk/wp-includes/general-template.php

    r7976 r7979  
    11391139}
    11401140
    1141 function wp_admin_css( $file = 'wp-admin' ) {
     1141function wp_admin_css( $file = 'wp-admin', $force_echo = false ) {
    11421142    global $wp_styles;
    11431143    if ( !is_a($wp_styles, 'WP_Styles') )
     
    11471147
    11481148    if ( $wp_styles->query( $handle ) ) {
    1149         if ( did_action( 'wp_print_styles' ) ) // we already printed the style queue.  Print this one immediately
     1149        if ( $force_echo || did_action( 'wp_print_styles' ) ) // we already printed the style queue.  Print this one immediately
    11501150            wp_print_styles( $handle );
    11511151        else // Add to style queue
  • trunk/wp-includes/js/tinymce/wp-mce-help.php

    r7971 r7979  
    99<script type="text/javascript" src="tiny_mce_popup.js"></script>
    1010<?php
    11 wp_admin_css( 'css/global' );
    12 wp_admin_css();
     11wp_admin_css( 'global', true );
     12wp_admin_css( 'wp-admin', true );
    1313?>
    1414<style type="text/css">
  • trunk/wp-includes/script-loader.php

    r7976 r7979  
    218218
    219219    $styles->add( 'colors', true ); // Register "meta" stylesheet for admin colors
     220    $styles->add( 'colors-fresh', '/wp-admin/css/colors-fresh.css' ); // for login.php.  Is there a better way?
     221    $styles->add_data( 'colors-fresh', 'rtl', true );
    220222
    221223    $styles->add( 'global', '/wp-admin/css/global.css' );
  • trunk/wp-login.php

    r7971 r7979  
    1515    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    1616    <?php
    17     wp_admin_css( 'css/login' );
    18     wp_admin_css( 'css/colors-fresh' );
     17    wp_admin_css( 'login', true );
     18    wp_admin_css( 'colors-fresh', true );
    1919    ?>
    2020    <script type="text/javascript">
Note: See TracChangeset for help on using the changeset viewer.