Changeset 10823 for trunk/wp-admin/includes/theme-install.php
- Timestamp:
- 03/20/2009 12:14:57 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/theme-install.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/theme-install.php
r10810 r10823 141 141 function install_themes_dashboard() { 142 142 ?> 143 <p ><?php _e('Search for themes by keyword, author, or tag.') ?></p>143 <p class="install-help"><?php _e('Search for themes by keyword, author, or tag.') ?></p> 144 144 145 145 <?php install_theme_search_form(); ?> 146 146 147 <h4><?php _e('Advanced Search') ?></h4>148 <p><?php _e('Tag filter goes here') ?></p>149 150 147 <h4><?php _e('Popular tags') ?></h4> 151 <p ><?php _e('You may also browse based on the most popular tags in the Theme Directory:') ?></p>148 <p class="install-help"><?php _e('You may also browse based on the most popular tags in the Theme Directory:') ?></p> 152 149 <?php 153 150 … … 184 181 <option value="author" <?php selected('author', $type) ?>><?php _e('Author') ?></option> 185 182 <option value="tag" <?php selected('tag', $type) ?>><?php _e('Tag') ?></option> 186 </select> <input type="text" name="s" id="search-field"183 </select> <input type="text" name="s" class="search-input" 187 184 value="<?php echo attribute_escape($term) ?>" /> <input type="submit" 188 185 name="search" value="<?php echo attribute_escape(__('Search')) ?>" … … 259 256 ?> 260 257 <h4><?php _e('Install a theme in .zip format') ?></h4> 261 <p ><?php _e('If you have a theme in a .zip format, you may install it by uploading it here.') ?></p>258 <p class="install-help"><?php _e('If you have a theme in a .zip format, you may install it by uploading it here.') ?></p> 262 259 <form method="post" enctype="multipart/form-data" 263 260 action="<?php echo admin_url('theme-install.php?tab=do_upload') ?>"><?php wp_nonce_field( 'theme-upload') ?> … … 280 277 281 278 $preview_link = $theme->preview_url . '?TB_iframe=true&width=600&height=400'; 282 if ( empty($actions) ) {279 if ( !is_array($actions) ) { 283 280 $actions = array(); 284 281 $actions[] = '<a href="' . admin_url('theme-install.php?tab=theme-information&theme=' . $theme->slug . 285 '&TB_iframe=true& width=600&height=800') . '" class="thickboxonclick" title="' . attribute_escape(sprintf(__('Install "%s"'), $name)) . '">' . __('Install') . '</a>';282 '&TB_iframe=true&tbWidth=500&tbHeight=350') . '" class="thickbox thickbox-preview onclick" title="' . attribute_escape(sprintf(__('Install "%s"'), $name)) . '">' . __('Install') . '</a>'; 286 283 $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview onclick previewlink" title="' . attribute_escape(sprintf(__('Preview "%s"'), $name)) . '">' . __('Preview') . '</a>'; 287 284 $actions = apply_filters('theme_install_action_links', $actions, $theme); … … 291 288 ?> 292 289 <a class='thickbox thickbox-preview screenshot' 293 href='<? echo clean_url($preview_link) ?>'294 title='<?php attribute_escape(sprintf(__('Preview "%s"'), $name))?>'>295 <img src='<?php echo clean_url($theme->screenshot_url) ?>' width='150' />290 href='<? echo clean_url($preview_link); ?>' 291 title='<?php echo attribute_escape(sprintf(__('Preview "%s"'), $name)); ?>'> 292 <img src='<?php echo clean_url($theme->screenshot_url); ?>' width='150' /> 296 293 </a> 297 294 <h3><?php echo $name ?></h3> … … 432 429 function install_theme_information() { 433 430 //TODO: This function needs a LOT of UI work :) 434 global $tab, $themes_allowedtags; ;431 global $tab, $themes_allowedtags; 435 432 436 433 $api = themes_api('theme_information', array('slug' => stripslashes( $_REQUEST['theme'] ) )); … … 445 442 $api->$key = wp_kses($api->$key, $themes_allowedtags); 446 443 447 $section = isset($_REQUEST['section']) ? stripslashes( $_REQUEST['section'] ) : 'description'; //Default to the Description tab, Do not translate, API returns English.448 if ( empty($section) || ! isset($api->sections[ $section ]) )449 $section = array_shift( $section_titles = array_keys((array)$api->sections) );450 451 444 iframe_header( __('Theme Install') ); 445 446 if ( empty($api->download_link) ) { 447 echo '<div id="message" class="error"><p>' . __('<strong>Error:</strong> This theme is currently not available. Please try again later.') . '</p></div>'; 448 iframe_footer(); 449 exit; 450 } 452 451 453 452 if ( version_compare($GLOBALS['wp_version'], $api->tested, '>') ) … … 456 455 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>'; 457 456 458 if ( empty($api->download_link) ) {459 // No go460 }461 ?>462 463 <p class="action-button"><?php464 457 // Default to a "new" theme 465 458 $type = 'install'; 466 459 // Check to see if this theme is known to be installed, and has an update awaiting it. 467 $update_themes = get_option('update_themes'); 468 foreach ( (array)$update_themes->response as $file => $theme ) { 469 if ( $theme->slug === $api->slug ) { 470 $type = 'update_available'; 471 $update_file = $file; 472 break; 473 } 474 } 475 476 $action = ''; 460 $update_themes = get_transient('update_themes'); 461 if ( is_object($update_themes) ) { 462 foreach ( (array)$update_themes->response as $file => $theme ) { 463 if ( $theme->slug === $api->slug ) { 464 $type = 'update_available'; 465 $update_file = $file; 466 break; 467 } 468 } 469 } 470 471 $themes = get_themes(); 472 foreach ( $themes as $this_theme ) { 473 if ( is_array($this_theme) && $this_theme['Stylesheet'] == $api->slug ) { 474 if ( $this_theme['Version'] == $api->version ) { 475 $type = 'latest_installed'; 476 } elseif ( $this_theme['Version'] > $api->version ) { 477 $type = 'newer_installed'; 478 $newer_version = $this_theme['Version']; 479 } 480 break; 481 } 482 } 483 ?> 484 485 <div class='available-theme'> 486 <img src='<?php echo clean_url($api->screenshot_url) ?>' width='300' class="theme-preview-img" /> 487 <h3><?php echo $api->name; ?></h3> 488 <p><?php printf(__('by %s'), $api->author); ?></p> 489 <p><?php printf(__('Version: %s'), $api->version); ?></p> 490 491 <?php 492 $buttons = '<a class="button" id="cancel" href="#" onclick="tb_close();return false;">' . __('Cancel') . '</a> '; 493 477 494 switch ( $type ) { 478 default:479 case 'install':480 if ( current_user_can('install_themes') ) :481 $action = '<a class="button" href="' . wp_nonce_url(admin_url('theme-install.php?tab=install&theme=' . $api->slug), 'install-theme_' . $api->slug) . '" target="_parent">' . __('Install Now') . '</a>';495 default: 496 case 'install': 497 if ( current_user_can('install_themes') ) : 498 $buttons .= '<a class="button-primary" id="install" href="' . wp_nonce_url(admin_url('theme-install.php?tab=install&theme=' . $api->slug), 'install-theme_' . $api->slug) . '" target="_parent">' . __('Install Now') . '</a>'; 482 499 endif; 483 500 break; 484 501 case 'update_available': 485 502 if ( current_user_can('update_themes') ) : 486 ?><a class="button" 487 href="<?php echo wp_nonce_url(admin_url('update.php?action=upgrade-theme&theme=' . $update_file), 'upgrade-theme_' . $update_file) ?>" 488 target="_parent"><?php _e('Install Update Now') ?></a><?php 503 $buttons .= '<a class="button-primary" id="install" href="' . wp_nonce_url(admin_url('update.php?action=upgrade-theme&theme=' . $update_file), 'upgrade-theme_' . $update_file) . '" target="_parent">' . __('Install Update Now') . '</a>'; 489 504 endif; 490 505 break; 491 506 case 'newer_installed': 492 507 if ( current_user_can('install_themes') || current_user_can('update_themes') ) : 493 ?>< a><?php printf(__('Newer Version (%s) Installed'), $newer_version) ?></a><?php508 ?><p><?php printf(__('Newer version (%s) is installed.'), $newer_version); ?></p><?php 494 509 endif; 495 510 break; 496 511 case 'latest_installed': 497 512 if ( current_user_can('install_themes') || current_user_can('update_themes') ) : 498 ?>< a><?php _e('Latest Version Installed') ?></a><?php513 ?><p><?php _e('This version is already installed.'); ?></p><?php 499 514 endif; 500 515 break; 501 } ?></p> 502 <div class='available-theme'> 516 } ?> 517 <br class="clear" /> 518 </div> 519 520 <p class="action-button"> 521 <?php echo $buttons; ?> 522 <br class="clear" /> 523 </p> 524 503 525 <?php 504 display_theme($api, array($action), false);505 ?>506 </div>507 <?php508 526 iframe_footer(); 509 527 exit;
Note: See TracChangeset
for help on using the changeset viewer.