Fix logo link in wp_die(). Props Sewar. fixes #3138

git-svn-id: http://svn.automattic.com/wordpress/trunk@4194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-09-18 23:40:19 +00:00
parent 510c17a977
commit 5dc154c1e2
5 changed files with 50 additions and 1 deletions

View File

@ -18,6 +18,9 @@ get_admin_page_title();
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
<title><?php bloginfo('name') ?> &rsaquo; <?php echo $title; ?> &#8212; WordPress</title>
<link rel="stylesheet" href="<?php echo get_option('siteurl') ?>/wp-admin/wp-admin.css?version=<?php bloginfo('version'); ?>" type="text/css" />
<?php if ( ('rtl' == $wp_locale->text_direction) ) : ?>
<link rel="stylesheet" href="<?php echo get_option('siteurl') ?>/wp-admin/rtl.css?version=<?php bloginfo('version'); ?>" type="text/css" />
<?php endif; ?>
<script type="text/javascript">
//<![CDATA[
function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}else{ var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}

View File

@ -144,6 +144,7 @@ add_filter('option_blog_charset', 'wp_specialchars');
// Actions
add_action('wp_head', 'rsd_link');
add_action('wp_head', 'locale_stylesheet');
add_action('publish_future_post', 'wp_publish_post', 10, 1);
add_action('wp_head', 'noindex', 1);
add_action('wp_head', 'wp_print_scripts');

View File

@ -1111,6 +1111,12 @@ function wp_die($message, $title = '') {
if ( empty($title) )
$title = __('WordPress &rsaquo; Error');
if ( strstr($_SERVER['PHP_SELF'], 'wp-admin') )
$logo_src = 'images/wordpress-logo.png';
else
$logo_src = 'wp-admin/images/wordpress-logo.png';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
@ -1156,7 +1162,7 @@ function wp_die($message, $title = '') {
</style>
</head>
<body>
<h1 id="logo"><img alt="WordPress" src="<?php echo get_option('siteurl'); ?>/wp-admin/images/wordpress-logo.png" /></h1>
<h1 id="logo"><img alt="WordPress" src="<?php echo $logo_src; ?>" /></h1>
<p><?php echo $message; ?></p>
</body>
</html>

View File

@ -12,6 +12,9 @@ class WP_Locale {
var $meridiem;
var $text_direction = '';
var $locale_vars = array('text_direction');
function init() {
// The Weekdays
$this->weekday[0] = __('Sunday');
@ -83,6 +86,21 @@ class WP_Locale {
$this->meridiem['pm'] = __('pm');
$this->meridiem['AM'] = __('AM');
$this->meridiem['PM'] = __('PM');
$this->_load_locale_data();
}
function _load_locale_data() {
$locale = get_locale();
$locale_file = ABSPATH . "wp-includes/languages/$locale.php";
if ( !file_exists($locale_file) )
return;
include($locale_file);
foreach ( $this->locale_vars as $var ) {
$this->$var = $$var;
}
}
function get_weekday($weekday_number) {

View File

@ -25,6 +25,20 @@ function get_stylesheet_uri() {
return apply_filters('stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri);
}
function get_locale_stylesheet_uri() {
global $wp_locale;
$stylesheet_dir_uri = get_stylesheet_directory_uri();
$dir = get_stylesheet_directory();
$locale = get_locale();
if ( file_exists("$dir/$locale.css") )
$stylesheet_uri = "$stylesheet_dir_uri/$locale.css";
else if ( !empty($wp_locale->text_direction) && file_exists("$dir/{$wp_locale->text_direction}.css") )
$stylesheet_uri = "$stylesheet_dir_uri/{$wp_locale->text_direction}.css";
else
$stylesheet_uri = '';
return apply_filters('locale_stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri);
}
function get_template() {
return apply_filters('template', get_option('template'));
}
@ -369,6 +383,13 @@ function load_template($file) {
require_once($file);
}
function locale_stylesheet() {
$stylesheet = get_locale_stylesheet_uri();
if ( empty($stylesheet) )
return;
echo '<link rel="stylesheet" href="' . $stylesheet . '" type="text/css" media="screen" />';
}
function validate_current_theme() {
// Don't validate during an install/upgrade.
if ( defined('WP_INSTALLING') )