web/wp-admin/includes/class-wp-plugin-install-list-table.php
changeset 204 09a1c134465b
parent 194 32102edaa81b
equal deleted inserted replaced
203:f507feede89a 204:09a1c134465b
    27 		// These are the tabs which are shown on the page
    27 		// These are the tabs which are shown on the page
    28 		$tabs = array();
    28 		$tabs = array();
    29 		$tabs['dashboard'] = __( 'Search' );
    29 		$tabs['dashboard'] = __( 'Search' );
    30 		if ( 'search' == $tab )
    30 		if ( 'search' == $tab )
    31 			$tabs['search']	= __( 'Search Results' );
    31 			$tabs['search']	= __( 'Search Results' );
    32 		$tabs['upload'] = __( 'Upload' );
    32 		$tabs['upload']    = __( 'Upload' );
    33 		$tabs['featured'] = _x( 'Featured','Plugin Installer' );
    33 		$tabs['featured']  = _x( 'Featured', 'Plugin Installer' );
    34 		$tabs['popular']  = _x( 'Popular','Plugin Installer' );
    34 		$tabs['popular']   = _x( 'Popular', 'Plugin Installer' );
    35 		$tabs['new']      = _x( 'Newest','Plugin Installer' );
    35 		$tabs['new']       = _x( 'Newest', 'Plugin Installer' );
       
    36 		$tabs['favorites'] = _x( 'Favorites', 'Plugin Installer' );
    36 
    37 
    37 		$nonmenu_tabs = array( 'plugin-information' ); //Valid actions to perform which do not have a Menu item.
    38 		$nonmenu_tabs = array( 'plugin-information' ); //Valid actions to perform which do not have a Menu item.
    38 
    39 
    39 		$tabs = apply_filters( 'install_plugins_tabs', $tabs );
    40 		$tabs = apply_filters( 'install_plugins_tabs', $tabs );
    40 		$nonmenu_tabs = apply_filters( 'install_plugins_nonmenu_tabs', $nonmenu_tabs );
    41 		$nonmenu_tabs = apply_filters( 'install_plugins_nonmenu_tabs', $nonmenu_tabs );
    67 
    68 
    68 			case 'featured':
    69 			case 'featured':
    69 			case 'popular':
    70 			case 'popular':
    70 			case 'new':
    71 			case 'new':
    71 				$args['browse'] = $tab;
    72 				$args['browse'] = $tab;
       
    73 				break;
       
    74 
       
    75 			case 'favorites':
       
    76 				$user = isset( $_GET['user'] ) ? stripslashes( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
       
    77 				update_user_meta( get_current_user_id(), 'wporg_favorites', $user );
       
    78 				if ( $user )
       
    79 					$args['user'] = $user;
       
    80 				else
       
    81 					$args = false;
       
    82 
       
    83 				add_action( 'install_plugins_favorites', 'install_plugins_favorites_form', 9, 0 );
    72 				break;
    84 				break;
    73 
    85 
    74 			default:
    86 			default:
    75 				$args = false;
    87 				$args = false;
    76 		}
    88 		}
   113 			<div class="tablenav top">
   125 			<div class="tablenav top">
   114 				<div class="alignleft actions">
   126 				<div class="alignleft actions">
   115 					<?php do_action( 'install_plugins_table_header' ); ?>
   127 					<?php do_action( 'install_plugins_table_header' ); ?>
   116 				</div>
   128 				</div>
   117 				<?php $this->pagination( $which ); ?>
   129 				<?php $this->pagination( $which ); ?>
   118 				<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" />
       
   119 				<br class="clear" />
   130 				<br class="clear" />
   120 			</div>
   131 			</div>
   121 		<?php } else { ?>
   132 		<?php } else { ?>
   122 			<div class="tablenav bottom">
   133 			<div class="tablenav bottom">
   123 				<?php $this->pagination( $which ); ?>
   134 				<?php $this->pagination( $which ); ?>
   124 				<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" />
       
   125 				<br class="clear" />
   135 				<br class="clear" />
   126 			</div>
   136 			</div>
   127 		<?php
   137 		<?php
   128 		}
   138 		}
   129 	}
   139 	}