Ticket #9508: 9508.3.diff
File 9508.3.diff, 5.0 KB (added by , 16 years ago) |
---|
-
wp-admin/includes/theme-install.php
97 97 * @param string $page 98 98 */ 99 99 function install_theme_search($page) { 100 global $theme_field_defaults; 101 100 102 $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : ''; 101 103 $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : ''; 102 104 … … 398 400 ?> 399 401 <table id="availablethemes" cellspacing="0" cellpadding="0"> 400 402 <?php 401 $in_column = 0;402 403 $rows = ceil(count($themes) / 3); 403 404 $table = array(); 404 $i = 0; 405 for ( $row = 1; $row <= $rows; $row++ ) { 406 for ( $col = 1; $col <= 3; $col++ ) { 407 $table[$row][$col] = $i; 408 $i++; 409 } 410 } 405 $theme_keys = array_keys($themes); 406 for ( $row = 1; $row <= $rows; $row++ ) 407 for ( $col = 1; $col <= 3; $col++ ) 408 $table[$row][$col] = array_shift($theme_keys); 411 409 412 410 foreach ( $table as $row => $cols ) { 413 411 ?> … … 419 417 if ( $col == 1 ) $class[] = 'left'; 420 418 if ( $row == $rows ) $class[] = 'bottom'; 421 419 if ( $col == 3 ) $class[] = 'right'; 422 $theme = $themes[$theme_index];423 420 ?> 424 421 <td class="<?php echo join(' ', $class); ?>"><?php 425 display_theme($theme); 422 if ( isset($themes[$theme_index]) ) 423 display_theme($themes[$theme_index]); 426 424 ?></td> 427 425 <?php } // end foreach $cols ?> 428 426 </tr> … … 467 465 exit; 468 466 } 469 467 470 if ( version_compare($GLOBALS['wp_version'], $api->tested, '>') )468 if ( !empty($api->tested) && version_compare($GLOBALS['wp_version'], $api->tested, '>') ) 471 469 echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This theme has <strong>not been tested</strong> with your current version of WordPress.') . '</p></div>'; 472 else if ( version_compare($GLOBALS['wp_version'], $api->requires, '<') )470 else if ( !empty($api->requires) && version_compare($GLOBALS['wp_version'], $api->requires, '<') ) 473 471 echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This theme has not been marked as <strong>compatible</strong> with your version of WordPress.') . '</p></div>'; 474 472 475 473 // Default to a "new" theme 476 474 $type = 'install'; 477 475 // Check to see if this theme is known to be installed, and has an update awaiting it. 478 476 $update_themes = get_transient('update_themes'); 479 if ( is_object($update_themes) ) {480 foreach ( (array)$update_themes->response as $ file => $theme) {481 if ( $theme ->slug === $api->slug ) {477 if ( is_object($update_themes) && isset($update_themes->response) ) { 478 foreach ( (array)$update_themes->response as $theme_slug => $theme_info ) { 479 if ( $theme_slug === $api->slug ) { 482 480 $type = 'update_available'; 483 $update_file = $ file;481 $update_file = $theme_slug; 484 482 break; 485 483 } 486 484 } -
wp-admin/themes.php
93 93 94 94 if ( isset($themes_update->response[ $stylesheet ]) ) { 95 95 $update = $themes_update->response[ $stylesheet ]; 96 $theme_name = is_object($theme) ? $theme->name : (is_array($theme) ? $theme['Name'] : '') 96 97 $details_url = add_query_arg(array('TB_iframe' => 'true', 'width' => 1024, 'height' => 800), $update['url']); //Theme browser inside WP? replace this, Also, theme preview JS will override this on the available list. 97 98 $update_url = wp_nonce_url('update.php?action=upgrade-theme&theme=' . urlencode($stylesheet), 'upgrade-theme_' . $stylesheet); 98 99 99 100 if ( ! current_user_can('update_themes') ) 100 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>'), $ ct->name, $details_url, $update['new_version']);101 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']); 101 102 else if ( empty($update->package) ) 102 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>'), $ ct->name, $details_url, $update['new_version']);103 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']); 103 104 else 104 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">upgrade automatically</a>.</p>'), $ ct->name, $details_url, $update['new_version'], $update_url );105 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">upgrade automatically</a>.</p>'), $theme_name, $details_url, $update['new_version'], $update_url ); 105 106 } 106 107 } 107 108