Changeset 11525
- Timestamp:
- 06/06/2009 08:14:41 AM (15 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-upgrader.php
r11506 r11525 392 392 $current = get_transient( 'update_plugins' ); 393 393 if ( !isset( $current->response[ $plugin ] ) ) { 394 $this->skin->set_result(false); 394 395 $this->skin->error('up_to_date'); 396 $this->skin->after(); 395 397 return false; 396 //return new WP_Error('up_to_date', $this->strings['up_to_date']);397 398 } 398 399 … … 554 555 // Is an update available? 555 556 $current = get_transient( 'update_themes' ); 556 if ( !isset( $current->response[ $theme ] ) ) 557 return new WP_Error('up_to_date', $this->strings['up_to_date']); 558 557 if ( !isset( $current->response[ $theme ] ) ) { 558 $this->skin->set_result(false); 559 $this->skin->error('up_to_date'); 560 $this->skin->after(); 561 return false; 562 } 563 559 564 $r = $current->response[ $theme ]; 560 565 … … 985 990 function after() { 986 991 987 if ( empty($this->upgrader->result['destination_name']) )988 return;989 990 $theme_info = $this->upgrader->theme_info(); 991 if ( empty($theme_info) )992 return;993 $name = $theme_info['Name'];994 $stylesheet = $this->upgrader->result['destination_name'];995 $template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet;996 997 $preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true' ), trailingslashit(esc_url(get_option('home'))) ) );998 $activate_link = wp_nonce_url("themes.php?action=activate&template=" . urlencode($template) . "&stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);999 1000 $update_actions = array(1001 'preview' => '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview “%s”'), $name)) . '">' . __('Preview') . '</a>',1002 'activate' => '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr( sprintf( __('Activate “%s”'), $name ) ) . '">' . __('Activate') . '</a>',1003 'themes_page' => '<a href="' . admin_url('themes.php') . '" title="' . esc_attr__('Return to Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>',1004 );1005 if ( ( ! $this->result || is_wp_error($this->result) ) || $stylesheet == get_stylesheet() ) 1006 unset($update_actions['preview'], $update_actions['activate']);992 if ( !empty($this->upgrader->result['destination_name']) && 993 ($theme_info = $this->upgrader->theme_info()) && 994 !empty($theme_info) ) { 995 996 $name = $theme_info['Name']; 997 $stylesheet = $this->upgrader->result['destination_name']; 998 $template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet; 999 1000 $preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true' ), trailingslashit(esc_url(get_option('home'))) ) ); 1001 $activate_link = wp_nonce_url("themes.php?action=activate&template=" . urlencode($template) . "&stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template); 1002 1003 $update_actions = array( 1004 'preview' => '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview “%s”'), $name)) . '">' . __('Preview') . '</a>', 1005 'activate' => '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr( sprintf( __('Activate “%s”'), $name ) ) . '">' . __('Activate') . '</a>', 1006 ); 1007 if ( ( ! $this->result || is_wp_error($this->result) ) || $stylesheet == get_stylesheet() ) 1008 unset($update_actions['preview'], $update_actions['activate']); 1009 } 1010 1011 $update_actions['themes_page'] = '<a href="' . admin_url('themes.php') . '" title="' . esc_attr__('Return to Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>'; 1007 1012 1008 1013 $update_actions = apply_filters('update_theme_complete_actions', $update_actions, $this->theme); -
trunk/wp-admin/themes.php
r11505 r11525 113 113 114 114 if ( ! current_user_can('update_themes') ) 115 printf( '<p> ' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s Details</a>.') . '</p>', $theme_name, $details_url, $update['new_version']);115 printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s Details</a>.') . '</strong></p>', $theme_name, $details_url, $update['new_version']); 116 116 else if ( empty($update->package) ) 117 printf( '<p> ' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s Details</a> <em>automatic upgrade unavailable for this theme</em>.') . '</p>', $theme_name, $details_url, $update['new_version']);117 printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s Details</a> <em>automatic upgrade unavailable for this theme</em>.') . '</strong></p>', $theme_name, $details_url, $update['new_version']); 118 118 else 119 printf( '<p> ' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s Details</a> or <a href="%4$s" %5$s >upgrade automatically</a>.') . '</p>', $theme_name, $details_url, $update['new_version'], $update_url, $update_onclick );119 printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s Details</a> or <a href="%4$s" %5$s >upgrade automatically</a>.') . '</strong></p>', $theme_name, $details_url, $update['new_version'], $update_url, $update_onclick ); 120 120 } 121 121 } -
trunk/wp-admin/wp-admin.css
r11523 r11525 816 816 } 817 817 818 #update-nag a,819 .plugin-update a {820 font-size: 1.1em;821 }822 823 818 #pass-strength-result { 824 819 border-style: solid;
Note: See TracChangeset
for help on using the changeset viewer.