Permalink
Browse files

fixes #85

  • Loading branch information...
1 parent b87c5bf commit f6334bc1f332717b68f9d0380bf31d587c4700b1 @thomasgriffin thomasgriffin committed Jan 8, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 tgm-plugin-activation/class-tgm-plugin-activation.php
@@ -1256,11 +1256,15 @@ public function column_cb( $item ) {
* Sets default message within the plugins table if no plugins
* are left for interaction.
*
+ * Hides the menu item to prevent the user from clicking and
+ * getting a permissions error.
+ *
* @since 2.2.0
*/
public function no_items() {
printf( __( 'No plugins to install or activate. <a href="%1$s" title="Return to the Dashboard">Return to the Dashboard</a>', TGM_Plugin_Activation::$instance->domain ), admin_url() );
+ echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
}
@@ -2034,9 +2038,11 @@ public function bulk_footer() {
/** Filter out any empty entries */
$complete = array_filter( $complete );
- /** All plugins are active, so we display the complete string */
- if ( empty( $complete ) )
+ /** All plugins are active, so we display the complete string and hide the menu to protect users */
+ if ( empty( $complete ) ) {
echo '<p>' . sprintf( TGM_Plugin_Activation::$instance->strings['complete'], '<a href="' . admin_url() . '" title="' . __( 'Return to the Dashboard', TGM_Plugin_Activation::$instance->domain ) . '">' . __( 'Return to the Dashboard', TGM_Plugin_Activation::$instance->domain ) . '</a>' ) . '</p>';
+ echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
+ }
}

0 comments on commit f6334bc

Please sign in to comment.