Ticket #28673: 28673.4.diff
| File 28673.4.diff, 4.5 KB (added by , 12 years ago) |
|---|
-
src/wp-admin/includes/class-wp-plugin-install-list-table.php
26 26 27 27 // These are the tabs which are shown on the page 28 28 $tabs = array(); 29 $tabs['dashboard'] = __( 'Search' ); 29 30 30 if ( 'search' == $tab ) 31 31 $tabs['search'] = __( 'Search Results' ); 32 $tabs['upload'] = __( 'Upload' );33 32 $tabs['featured'] = _x( 'Featured', 'Plugin Installer' ); 34 33 $tabs['popular'] = _x( 'Popular', 'Plugin Installer' ); 35 34 $tabs['new'] = _x( 'Newest', 'Plugin Installer' ); … … 38 37 $tabs['beta'] = _x( 'Beta Testing', 'Plugin Installer' ); 39 38 } 40 39 41 $nonmenu_tabs = array( ' plugin-information' ); //Valid actions to perform which do not have a Menu item.40 $nonmenu_tabs = array( 'upload', 'plugin-information' ); //Valid actions to perform which do not have a Menu item. 42 41 43 42 /** 44 43 * Filter the tabs shown on the Plugin Install screen. … … 146 145 147 146 $display_tabs = array(); 148 147 foreach ( (array) $tabs as $action => $text ) { 149 $class = ( $action == $tab ) ? ' class="current"' : ''; 148 $class = 'wp-filter-link'; 149 $class .= ( $action == $tab ) ? ' current' : ''; 150 150 $href = self_admin_url('plugin-install.php?tab=' . $action); 151 $display_tabs['plugin-install-'.$action] = "<a href='$href' $class>$text</a>";151 $display_tabs['plugin-install-'.$action] = "<a href='$href' class='$class'>$text</a>"; 152 152 } 153 153 154 154 return $display_tabs; 155 155 } 156 156 157 157 /** 158 * Override parent views so we can use the filter bar display. 159 */ 160 public function views() { 161 $views = $this->get_views(); 162 163 /** This filter is documented in wp-admin/inclues/class-wp-list-table.php */ 164 $views = apply_filters( "views_{$this->screen->id}", $views ); 165 166 ?> 167 <div class="wp-filter"> 168 <ul class="wp-filter-links"> 169 <?php 170 if ( ! empty( $views ) ) { 171 foreach ( $views as $class => $view ) { 172 $views[ $class ] = "\t<li class='$class'>$view"; 173 } 174 echo implode( " </li>\n", $views ) . "</li>\n"; 175 } 176 ?> 177 </ul> 178 179 <?php install_search_form( false ); ?> 180 </div> 181 <?php 182 } 183 184 /** 158 185 * Override the parent display() so we can provide a different container. 159 186 */ 160 187 public function display() { -
src/wp-admin/includes/plugin-install.php
163 163 function install_search_form( $type_selector = true ) { 164 164 $type = isset($_REQUEST['type']) ? wp_unslash( $_REQUEST['type'] ) : 'term'; 165 165 $term = isset($_REQUEST['s']) ? wp_unslash( $_REQUEST['s'] ) : ''; 166 $input_attrs = ''; 167 $button_type = 'button'; 166 168 169 // assume no $type_selector means it's a simplified search form 170 if ( ! $type_selector ) { 171 $input_attrs = 'class="wp-filter-search" placeholder="' . esc_attr__( 'Search Plugins' ) . '" '; 172 $button_type .= ' screen-reader-text'; 173 } 174 167 175 ?><form id="search-plugins" method="get" action=""> 168 176 <input type="hidden" name="tab" value="search" /> 169 177 <?php if ( $type_selector ) : ?> … … 173 181 <option value="tag"<?php selected('tag', $type) ?>><?php _ex('Tag', 'Plugin Installer'); ?></option> 174 182 </select> 175 183 <?php endif; ?> 176 <input type="search" name="s" id="plugin-search-input" value="<?php echo esc_attr($term) ?>" autofocus="autofocus"/>184 <input type="search" name="s" id="plugin-search-input" value="<?php echo esc_attr($term) ?>" <?php echo $input_attrs; ?>/> 177 185 <label class="screen-reader-text" for="plugin-search-input"><?php _e('Search Plugins'); ?></label> 178 <?php submit_button( __( 'Search Plugins' ), 'button', false, false, array( 'id' => 'search-submit' ) ); ?>186 <?php submit_button( __( 'Search Plugins' ), $button_type, false, false, array( 'id' => 'search-submit' ) ); ?> 179 187 </form><?php 180 188 } 181 189 -
src/wp-admin/plugin-install.php
73 73 include(ABSPATH . 'wp-admin/admin-header.php'); 74 74 ?> 75 75 <div class="wrap"> 76 <h2><?php echo esc_html( $title ); ?></h2> 76 <h2> 77 <?php 78 echo esc_html( $title ); 79 $href = self_admin_url( 'plugin-install.php?tab=upload' ); 80 ?> 81 <a href="<?php echo $href; ?>" class="upload add-new-h2"><?php _e( 'Upload Plugin' ); ?></a> 82 </h2> 77 83 78 84 <?php $wp_list_table->views(); ?> 79 85