Ticket #33646: 33646.5.patch
File 33646.5.patch, 11.1 KB (added by , 10 years ago) |
---|
-
src/wp-admin/css/common.css
1570 1570 background-position: bottom left; 1571 1571 } 1572 1572 1573 #screen-options-wrap h5, 1573 #screen-options-wrap h5, /* Back-compat for old plugins */ 1574 #screen-options-wrap legend, 1574 1575 #contextual-help-wrap h5 { 1575 margin: 8px 0; 1576 font-size: 13px; 1576 margin: 0; 1577 padding: 8px 0; 1578 font-size: 13px; 1579 font-weight: 600; 1577 1580 } 1578 1581 1579 1582 .metabox-prefs label { … … 1582 1585 line-height: 30px; 1583 1586 } 1584 1587 1585 .metabox-prefs label input[type=checkbox] { 1586 margin-top: -4px; 1588 #number-of-columns { 1589 display: inline-block; 1590 vertical-align: middle; 1591 line-height: 30px; 1592 } 1593 1594 .metabox-prefs input[type=checkbox] { 1595 margin-top: 0; 1587 1596 margin-right: 6px; 1588 1597 } 1589 1598 1590 .metabox-prefs label input { 1591 margin: 0 5px 0 2px; 1599 .metabox-prefs label input, 1600 .metabox-prefs label input[type=checkbox] { 1601 margin: -4px 5px 0 0; 1592 1602 } 1593 1603 1594 1604 .metabox-prefs .columns-prefs label input { 1595 margin: 0 2px;1605 margin: -1px 2px 0 0; 1596 1606 } 1597 1607 1598 1608 .metabox-prefs label a { … … 1599 1609 display: none; 1600 1610 } 1601 1611 1602 .metabox-prefs .screen-options {1603 padding-top: 10px;1604 }1605 1606 1612 .metabox-prefs .screen-options input, 1607 1613 .metabox-prefs .screen-options label { 1608 1614 margin-top: 0; … … 1619 1625 padding-right: 0; 1620 1626 } 1621 1627 1628 .screen-options + .screen-options { 1629 margin-top: 10px; 1630 } 1631 1622 1632 /*------------------------------------------------------------------------------ 1623 1633 6.2 - Help Menu 1624 1634 ------------------------------------------------------------------------------*/ … … 1900 1910 } 1901 1911 1902 1912 .columns-prefs label { 1903 padding: 0 5px;1913 padding: 0 10px 0 0; 1904 1914 } 1905 1915 1906 1916 /* @todo: what is this doing here */ -
src/wp-admin/css/customize-nav-menus.css
349 349 display: none; 350 350 background: #fff; 351 351 border-top: 1px solid #ddd; 352 padding: 4px 15px 0;352 padding: 4px 15px 15px; 353 353 } 354 354 355 355 .wp-customizer .metabox-prefs label { -
src/wp-admin/includes/class-wp-screen.php
918 918 $this->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n"; 919 919 break; 920 920 case 'post' : 921 $expand = '< div class="editor-expand hidden"><label for="editor-expand-toggle">';921 $expand = '<fieldset class="editor-expand hidden"><legend>' . __( 'Additional settings' ) . '</legend><label for="editor-expand-toggle">'; 922 922 $expand .= '<input type="checkbox" id="editor-expand-toggle"' . checked( get_user_setting( 'editor_expand', 'on' ), 'on', false ) . ' />'; 923 $expand .= __( 'Enable full-height editor and distraction-free functionality.' ) . '</label></ div>';923 $expand .= __( 'Enable full-height editor and distraction-free functionality.' ) . '</label></fieldset>'; 924 924 $this->_screen_settings = $expand; 925 925 break; 926 926 default: … … 969 969 */ 970 970 public function render_screen_options( $options = array() ) { 971 971 global $wp_meta_boxes; 972 972 973 $options = wp_parse_args( $options, array( 973 974 'wrap' => true, 974 975 ) ); 975 976 976 $columns = get_column_headers( $this ); 977 $hidden = get_hidden_columns( $this ); 977 $wrapper_start = $wrapper_end = $form_start = $form_end = ''; 978 978 979 ?> 980 <?php if ( $options['wrap'] ) : ?> 981 <div id="screen-options-wrap" class="hidden" tabindex="-1" aria-label="<?php esc_attr_e('Screen Options Tab'); ?>"> 982 <?php endif; ?> 983 <form id="adv-settings" method="post"> 984 <?php if ( isset( $wp_meta_boxes[ $this->id ] ) || $this->get_option( 'per_page' ) || ( $columns && empty( $columns['_title'] ) ) ) : ?> 985 <h5><?php _e( 'Show on screen' ); ?></h5> 986 <?php 987 endif; 979 // Output optional wrapper. 980 if ( $options['wrap'] ) { 981 $wrapper_start = '<div id="screen-options-wrap" class="hidden" tabindex="-1" aria-label="' . esc_attr__( 'Screen Options Tab' ) . '">'; 982 $wrapper_end = '</div>'; 983 } 988 984 985 // Don't output the form and nonce for the widgets accessibility mode links. 986 if ( 'widgets' !== $this->base ) { 987 $form_start = "\n<form id='adv-settings' method='post'>\n"; 988 $form_end = "\n" . wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false, false ) . "\n</form>\n"; 989 } 990 991 echo $wrapper_start . $form_start; 992 993 $this->render_meta_boxes_preferences(); 994 $this->render_list_table_columns_preferences(); 995 $this->render_screen_layout(); 996 $this->render_per_page_options(); 997 echo $this->_screen_settings; 998 999 echo $form_end . $wrapper_end; 1000 } 1001 1002 /** 1003 * Render the meta boxes preferences. 1004 * 1005 * @since 4.4.0 1006 */ 1007 public function render_meta_boxes_preferences() { 1008 global $wp_meta_boxes; 1009 989 1010 if ( isset( $wp_meta_boxes[ $this->id ] ) ) : ?> 990 <div class="metabox-prefs"> 991 <?php 992 meta_box_prefs( $this ); 1011 <fieldset class="metabox-prefs"> 1012 <legend><?php _e( 'Boxes to show on screen' ); ?></legend> 1013 <?php 1014 meta_box_prefs( $this ); 993 1015 994 if ( 'dashboard' === $this->id && has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) { 995 if ( isset( $_GET['welcome'] ) ) { 996 $welcome_checked = empty( $_GET['welcome'] ) ? 0 : 1; 997 update_user_meta( get_current_user_id(), 'show_welcome_panel', $welcome_checked ); 998 } else { 999 $welcome_checked = get_user_meta( get_current_user_id(), 'show_welcome_panel', true ); 1000 if ( 2 == $welcome_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) ) 1001 $welcome_checked = false; 1002 } 1003 echo '<label for="wp_welcome_panel-hide">'; 1004 echo '<input type="checkbox" id="wp_welcome_panel-hide"' . checked( (bool) $welcome_checked, true, false ) . ' />'; 1005 echo _x( 'Welcome', 'Welcome panel' ) . "</label>\n"; 1016 if ( 'dashboard' === $this->id && has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) { 1017 if ( isset( $_GET['welcome'] ) ) { 1018 $welcome_checked = empty( $_GET['welcome'] ) ? 0 : 1; 1019 update_user_meta( get_current_user_id(), 'show_welcome_panel', $welcome_checked ); 1020 } else { 1021 $welcome_checked = get_user_meta( get_current_user_id(), 'show_welcome_panel', true ); 1022 if ( 2 == $welcome_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) ) 1023 $welcome_checked = false; 1006 1024 } 1007 ?> 1008 <br class="clear" /> 1009 </div> 1010 <?php endif; 1011 if ( $columns ) : 1012 if ( ! empty( $columns['_title'] ) ) : ?> 1013 <h5><?php echo $columns['_title']; ?></h5> 1014 <?php endif; ?> 1015 <div class="metabox-prefs"> 1016 <?php 1017 $special = array('_title', 'cb', 'comment', 'media', 'name', 'title', 'username', 'blogname'); 1025 echo '<label for="wp_welcome_panel-hide">'; 1026 echo '<input type="checkbox" id="wp_welcome_panel-hide"' . checked( (bool) $welcome_checked, true, false ) . ' />'; 1027 echo _x( 'Welcome', 'Welcome panel' ) . "</label>\n"; 1028 } 1029 ?> 1030 </fieldset> 1031 <?php endif; 1032 } 1018 1033 1019 foreach ( $columns as $column => $title ) { 1020 // Can't hide these for they are special 1021 if ( in_array( $column, $special ) ) 1034 /** 1035 * Render the list table columns preferences. 1036 * 1037 * @since 4.4.0 1038 */ 1039 public function render_list_table_columns_preferences() { 1040 1041 $columns = get_column_headers( $this ); 1042 $hidden = get_hidden_columns( $this ); 1043 1044 if ( $columns ) { 1045 $legend = ! empty( $columns['_title'] ) ? $columns['_title'] : __( 'Display columns' ); 1046 ?> 1047 <fieldset class="metabox-prefs"> 1048 <legend><?php echo $legend; ?></legend> 1049 <?php 1050 $special = array( '_title', 'cb', 'comment', 'media', 'name', 'title', 'username', 'blogname' ); 1051 1052 foreach ( $columns as $column => $title ) { 1053 // Can't hide these for they are special 1054 if ( in_array( $column, $special ) ) { 1022 1055 continue; 1023 if ( empty( $title ) ) 1056 } 1057 1058 if ( empty( $title ) ) { 1024 1059 continue; 1060 } 1025 1061 1026 if ( 'comments' == $column )1062 if ( 'comments' == $column ) { 1027 1063 $title = __( 'Comments' ); 1028 $id = "$column-hide";1029 echo '<label for="' . $id . '">';1030 echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( !in_array($column, $hidden), true, false ) . ' />';1031 echo "$title</label>\n";1032 1064 } 1033 ?>1034 <br class="clear" />1035 </div>1036 <?php endif;1037 1065 1038 $this->render_screen_layout(); 1039 $this->render_per_page_options(); 1040 echo $this->_screen_settings; 1041 1042 ?> 1043 <div><?php wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); ?></div> 1044 </form> 1045 <?php if ( $options['wrap'] ) : ?> 1046 </div> 1047 <?php endif; 1066 $id = "$column-hide"; 1067 echo '<label>'; 1068 echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" value="' . $column . '"' . checked( ! in_array( $column, $hidden ), true, false ) . ' />'; 1069 echo "$title</label>\n"; 1070 } 1071 ?> 1072 </fieldset> 1073 <?php 1074 } 1048 1075 } 1049 1076 1050 1077 /** … … 1053 1080 * @since 3.3.0 1054 1081 */ 1055 1082 public function render_screen_layout() { 1056 if ( ! $this->get_option( 'layout_columns') )1083 if ( ! $this->get_option( 'layout_columns' ) ) { 1057 1084 return; 1085 } 1058 1086 1059 1087 $screen_layout_columns = $this->get_columns(); 1060 1088 $num = $this->get_option( 'layout_columns', 'max' ); 1061 1089 1062 1090 ?> 1063 <h5 class="screen-layout"><?php _e('Screen Layout'); ?></h5> 1064 <div class='columns-prefs'><?php 1065 _e('Number of Columns:'); 1091 <fieldset class='columns-prefs'> 1092 <legend class="screen-layout"><?php _e( 'Layout columns' ); ?></legend><?php 1066 1093 for ( $i = 1; $i <= $num; ++$i ): 1067 1094 ?> 1068 1095 <label class="columns-prefs-<?php echo $i; ?>"> 1069 1096 <input type='radio' name='screen_columns' value='<?php echo esc_attr( $i ); ?>' 1070 1097 <?php checked( $screen_layout_columns, $i ); ?> /> 1071 <?php echo esc_html( $i); ?>1098 <?php printf( _n( '%s column', '%s columns', $i ), number_format_i18n( $i ) ); ?> 1072 1099 </label> 1073 1100 <?php 1074 1101 endfor; ?> 1075 </ div>1102 </fieldset> 1076 1103 <?php 1077 1104 } 1078 1105 … … 1119 1146 1120 1147 // Back compat 1121 1148 if ( isset( $this->post_type ) ) { 1122 /** This filter is documented in wp-admin/includes/ class-wp-posts-list-table.php */1149 /** This filter is documented in wp-admin/includes/post.php */ 1123 1150 $per_page = apply_filters( 'edit_posts_per_page', $per_page, $this->post_type ); 1124 1151 } 1125 1152 1126 1153 ?> 1127 <div class="screen-options"> 1154 <fieldset class="screen-options"> 1155 <legend><?php _e( 'Pagination settings' ); ?></legend> 1128 1156 <?php if ( $per_page_label ) : ?> 1129 1157 <label for="<?php echo esc_attr( $option ); ?>"><?php echo $per_page_label; ?></label> 1130 1158 <input type="number" step="1" min="1" max="999" class="screen-per-page" name="wp_screen_options[value]" … … 1134 1162 1135 1163 echo get_submit_button( __( 'Apply' ), 'button', 'screen-options-apply', false ); ?> 1136 1164 <input type="hidden" name="wp_screen_options[option]" value="<?php echo esc_attr( $option ); ?>" /> 1137 </ div>1165 </fieldset> 1138 1166 <?php 1139 1167 } 1140 1168