Changeset 948
- Timestamp:
- 03/29/07 09:59:41 (2 years ago)
- Files:
-
- trunk/wp-admin/admin-db.php (modified) (1 diff)
- trunk/wp-admin/themes.php (modified) (1 diff)
- trunk/wp-admin/wpmu-themes.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/admin-db.php
r936 r948 660 660 } 661 661 662 function get_site_allowed_themes() { 663 $themes = get_themes(); 664 $allowed_themes = get_site_option( 'allowedthemes' ); 665 if( !is_array( $allowed_themes ) || empty( $allowed_themes ) ) { 666 $allowed_themes = get_site_option( "allowed_themes" ); // convert old allowed_themes format 667 if( !is_array( $allowed_themes ) ) { 668 $allowed_themes = array(); 669 continue; 670 } 671 foreach( $themes as $key => $theme ) { 672 $theme_key = wp_specialchars( $theme[ 'Stylesheet' ] ); 673 if( isset( $allowed_themes[ $key ] ) == true ) { 674 $allowedthemes[ $theme_key ] = 1; 675 } 676 } 677 $allowed_themes = $allowedthemes; 678 } 679 680 return $allowed_themes; 681 } 682 662 683 ?> trunk/wp-admin/themes.php
r936 r948 4 4 $themes = get_themes(); 5 5 $ct = current_theme_info(); 6 $allowed_themes = get_site_ option( "allowedthemes");6 $allowed_themes = get_site_allowed_themes(); 7 7 if( $allowed_themes == false ) 8 8 $allowed_themes = array(); trunk/wp-admin/wpmu-themes.php
r688 r948 11 11 ?><div id="message" class="updated fade"><p><?php _e('Options saved.') ?></p></div><?php 12 12 } 13 print '<div class="wrap">';14 13 $themes = get_themes(); 15 $allowed_themes = get_site_ option( "allowed_themes");14 $allowed_themes = get_site_allowed_themes(); 16 15 ?> 16 <div class="wrap"> 17 17 18 18 <form action='wpmu-edit.php?action=updatethemes' method='POST'> … … 22 22 <tr><th width="100"><?php _e('Active') ?></th><th><?php _e('Theme') ?></th><th><?php _e('Description') ?></th></tr> 23 23 <?php 24 while( list( $key, $val ) = each( $themes ) ) { 24 foreach( $themes as $key => $theme ) { 25 $theme_key = wp_specialchars( $theme[ 'Stylesheet' ] ); 25 26 $i++; 26 27 $enabled = ''; 27 28 $disabled = ''; 28 if( isset( $allowed_themes[ $ key ] ) == true ) {29 if( isset( $allowed_themes[ $theme_key ] ) == true ) { 29 30 $enabled = 'checked '; 30 31 } else { … … 35 36 <tr valign="top" style="<?php if ($i%2) echo 'background: #eee'; ?>"> 36 37 <td> 37 <label><input name="theme[<?php echo $ key ?>]" type="radio" id="<?php echo $key ?>" value="disabled" <?php echo $disabled ?>/><?php _e('No') ?></label>38 <label><input name="theme[<?php echo $theme_key ?>]" type="radio" id="<?php echo $theme_key ?>" value="disabled" <?php echo $disabled ?>/><?php _e('No') ?></label> 38 39 39 <label><input name="theme[<?php echo $ key ?>]" type="radio" id="<?php echo $key ?>" value="enabled" <?php echo $enabled ?>/><?php _e('Yes') ?></label>40 <label><input name="theme[<?php echo $theme_key ?>]" type="radio" id="<?php echo $theme_key ?>" value="enabled" <?php echo $enabled ?>/><?php _e('Yes') ?></label> 40 41 </td> 41 42 <th scope="row" align="left"><?php echo $key ?></th> 42 <td><?php echo $ val[ 'Description' ] ?></td>43 <td><?php echo $theme[ 'Description' ] ?></td> 43 44 </tr> 44 45 <?php
