Changeset 2839 for trunk/wp-admin/themes.php
- Timestamp:
- 09/05/2005 11:33:10 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/themes.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/themes.php
r2763 r2839 4 4 if ( isset($_GET['action']) ) { 5 5 check_admin_referer(); 6 6 7 7 if ('activate' == $_GET['action']) { 8 if (isset($_GET['template'])) { 9 update_option('template', $_GET['template']); 10 } 11 12 if (isset($_GET['stylesheet'])) { 13 update_option('stylesheet', $_GET['stylesheet']); 14 } 15 8 if ( isset($_GET['template']) ) 9 update_option('template', $_GET['template']); 10 11 if ( isset($_GET['stylesheet']) ) 12 update_option('stylesheet', $_GET['stylesheet']); 13 16 14 do_action('switch_theme', get_current_theme()); 17 18 header('Location: themes.php?activated=true'); 15 16 header('Location: themes.php?activated=true'); 17 exit; 19 18 } 20 }19 } 21 20 22 21 $title = __('Manage Themes'); … … 24 23 require_once('admin-header.php'); 25 24 ?> 25 26 26 <?php if ( ! validate_current_theme() ) : ?> 27 27 <div id="message1" class="updated fade"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div> 28 <?php elseif ( isset($ activated) ) : ?>28 <?php elseif ( isset($_GET['activated']) ) : ?> 29 29 <div id="message2" class="updated fade"><p><?php printf(__('New theme activated. <a href="%s">View site »</a>'), get_bloginfo('home')); ?></p></div> 30 30 <?php endif; ?> … … 32 32 <?php 33 33 $themes = get_themes(); 34 $current_theme = get_current_theme(); 35 $current_title = $themes[$current_theme]['Title']; 36 $current_version = $themes[$current_theme]['Version']; 37 $current_parent_theme = $themes[$current_theme]['Parent Theme']; 38 $current_template_dir = $themes[$current_theme]['Template Dir']; 39 $current_stylesheet_dir = $themes[$current_theme]['Stylesheet Dir']; 40 $current_template = $themes[$current_theme]['Template']; 41 $current_stylesheet = $themes[$current_theme]['Stylesheet']; 42 $current_screenshot = $themes[$current_theme]['Screenshot']; 34 $ct = current_theme_info(); 43 35 ?> 44 36 … … 46 38 <h2><?php _e('Current Theme'); ?></h2> 47 39 <div id="currenttheme"> 48 <?php if ( $c urrent_screenshot ) : ?>49 <img src="<?php echo get_option('siteurl') . '/' . $c urrent_stylesheet_dir . '/' . $current_screenshot; ?>" alt="Current theme preview" />40 <?php if ( $ct->screenshot ) : ?> 41 <img src="<?php echo get_option('siteurl') . '/' . $ct->stylesheet_dir . '/' . $ct->screenshot; ?>" alt="<?php _e('Current theme preview'); ?>" /> 50 42 <?php endif; ?> 51 <h3><?php printf(__('%1$s %2$s by %3$s'), $c urrent_title, $current_version, $themes[$current_theme]['Author']) ; ?></h3>52 <p><?php echo $ themes[$current_theme]['Description']; ?></p>53 <?php if ($c urrent_parent_theme) { ?>54 <p><?php printf(__('The template files are located in <code>%2$s</code>. The stylesheet files are located in <code>%3$s</code>. <strong>%4$s</strong> uses templates from <strong>%5$s</strong>. Changes made to the templates will affect both themes.'), $c urrent_theme, $current_template_dir, $current_stylesheet_dir, $current_theme, $current_parent_theme); ?></p>43 <h3><?php printf(__('%1$s %2$s by %3$s'), $ct->title, $ct->version, $ct->author) ; ?></h3> 44 <p><?php echo $ct->description; ?></p> 45 <?php if ($ct->parent_theme) { ?> 46 <p><?php printf(__('The template files are located in <code>%2$s</code>. The stylesheet files are located in <code>%3$s</code>. <strong>%4$s</strong> uses templates from <strong>%5$s</strong>. Changes made to the templates will affect both themes.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir, $ct->title, $ct->parent_theme); ?></p> 55 47 <?php } else { ?> 56 <p><?php printf(__('All of this theme’s files are located in <code>%2$s</code>.'), $c urrent_theme, $current_template_dir, $current_stylesheet_dir); ?></p>48 <p><?php printf(__('All of this theme’s files are located in <code>%2$s</code>.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir); ?></p> 57 49 <?php } ?> 58 50 </div> … … 78 70 $screenshot = $themes[$theme_name]['Screenshot']; 79 71 $stylesheet_dir = $themes[$theme_name]['Stylesheet Dir']; 72 $activate_link = "themes.php?action=activate&template=$template&stylesheet=$stylesheet"; 80 73 ?> 81 74 <div class="available-theme"> 82 <h3><a href="<?php echo "themes.php?action=activate&template=$template&stylesheet=$stylesheet"; ?>"><?php echo "$title $version"; ?> 83 <span> 75 <h3><a href="<?php echo $activate_link; ?>"><?php echo "$title $version"; ?></a></h3> 76 77 <a href="<?php echo $activate_link; ?>" class="screenshot"> 84 78 <?php if ( $screenshot ) : ?> 85 79 <img src="<?php echo get_option('siteurl') . '/' . $stylesheet_dir . '/' . $screenshot; ?>" alt="" /> 86 80 <?php endif; ?> 87 </ span>88 </a></h3> 81 </a> 82 89 83 <p><?php echo $description; ?></p> 90 84 </div> 91 <?php 92 /* 93 if ($template == $current_template && $stylesheet == $current_stylesheet) { 94 $action = '<strong>' . __('Active Theme') . '</strong>'; 95 $current = true; 96 } else { 97 $action = "<a href='' title='" . __('Select this theme') . "' class='edit'>" . __('Select') . '</a>'; 98 $current = false; 99 } 85 <?php } // end foreach theme_names ?> 100 86 101 $style = ('class="alternate"' == $style|| 'class="alternate active"' == $style) ? '' : 'alternate'; 102 if ($current) $style .= $style == 'alternate' ? ' active' : 'active'; 103 if ($style != '') $style = 'class="' . $style . '"'; 104 105 echo " 106 <tr $style>"; 107 if ( $current ) 108 echo "<td><strong>$title $version</strong></td>"; 109 else 110 echo "<td></td>"; 111 echo " 112 <td class=\"auth\">$author</td> 113 <td class=\"desc\">$description</td> 114 <td class=\"togl\">$action</td> 115 </tr>"; 116 */ 117 } 118 119 ?> 120 121 <?php 122 } 123 ?> 87 <?php } ?> 124 88 125 89 <?php 126 90 // List broken themes, if any. 127 91 $broken_themes = get_broken_themes(); 128 if ( count($broken_themes)) {92 if ( count($broken_themes) ) { 129 93 ?> 130 94 … … 161 125 162 126 <h2><?php _e('Get More Themes'); ?></h2> 163 <p><?php _e('You can find additional themes for your site in the <a href="http://wordpress.org/extend/themes/">WordPress theme directory</a>. To install a theme you generally just need to upload the theme folder into your <code>wp-content/themes</code> directory. Once a theme is uploaded, you may activate it on this page.'); ?></p>127 <p><?php _e('You can find additional themes for your site in the <a href="http://wordpress.org/extend/themes/">WordPress theme directory</a>. To install a theme you generally just need to upload the theme folder into your <code>wp-content/themes</code> directory. Once a theme is uploaded, you should see it on this page.'); ?></p> 164 128 165 129 </div> 166 130 167 <?php 168 include('admin-footer.php'); 169 ?> 131 <?php require('admin-footer.php'); ?>
Note: See TracChangeset
for help on using the changeset viewer.