Ticket #7091: 7091.4.diff
File 7091.4.diff, 4.8 KB (added by , 16 years ago) |
---|
-
wp-admin/plugins.php
2 2 require_once('admin.php'); 3 3 4 4 $action = ''; 5 foreach( array('activate-selected', 'deactivate-selected', 'delete-selected' ) as $action_key ) {5 foreach( array('activate-selected', 'deactivate-selected', 'delete-selected', 'clear-recent-list') as $action_key ) { 6 6 if( isset($_POST[$action_key]) ) { 7 7 $action = $action_key; 8 8 break; … … 149 149 <?php 150 150 require_once('admin-footer.php'); 151 151 exit; 152 } 152 } //Endif verify-delete 153 153 $delete_result = delete_plugins($plugins); 154 154 155 155 wp_cache_delete('plugins', 'plugins'); 156 157 156 break; 157 case 'clear-recent-list': 158 update_option('recently_activated', array()); 159 break; 158 160 } 159 161 } 160 162 … … 197 199 <p><?php _e('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.'); ?></p> 198 200 <?php 199 201 202 $all_plugins = get_plugins(); 200 203 $active_plugins = array(); 201 $ available_plugins = array();204 $inactive_plugins = array(); 202 205 $recent_plugins = array(); 203 206 $recently_activated = (array)get_option('recently_activated'); 204 207 … … 209 212 if( $recently_activated != get_option('recently_activated') ) //If array changed, update it. 210 213 update_option('recently_activated', $recently_activated); 211 214 212 $all_plugins = get_plugins();213 214 215 $plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array()); 215 216 216 217 foreach( (array)$all_plugins as $plugin_file => $plugin_data) { … … 223 224 if( ! empty($plugin_data['Author']) ) 224 225 $plugin_data['Description'] .= ' <cite>' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.</cite>'; 225 226 227 //Filter into individual sections 226 228 if ( is_plugin_active($plugin_file) ) { 227 229 $active_plugins[ $plugin_file ] = $plugin_data; 228 230 } else { 229 231 if ( isset( $recently_activated[ $plugin_file ] ) ) //Was the plugin recently activated? 230 232 $recent_plugins[ $plugin_file ] = $plugin_data; 231 233 else 232 $ available_plugins[ $plugin_file ] = $plugin_data;234 $inactive_plugins[ $plugin_file ] = $plugin_data; 233 235 } 234 236 } 235 237 … … 289 291 } //End print_plugins_table() 290 292 ?> 291 293 294 <?php if ( ! empty($active_plugins) ) : ?> 292 295 <h3 id="currently-active"><?php _e('Currently Active Plugins') ?></h3> 293 296 <form method="post" action="<?php echo admin_url('plugins.php') ?>"> 294 297 <?php wp_nonce_field('bulk-manage-plugins') ?> … … 303 306 </form> 304 307 305 308 <p><?php printf(__('If something goes wrong with a plugin and you can’t use WordPress, delete or rename that file in the <code>%s</code> directory and it will be automatically deactivated.'), WP_PLUGIN_DIR); ?></p> 309 <?php endif; ?> 306 310 307 311 <?php if ( ! empty($recent_plugins) ) : ?> 308 312 <h3 id="recent-plugins"><?php _e('Recently Active Plugins') ?></h3> 313 <p><?php _e('The following plugins were recently active, After a plugin has been inactive for >7 days, it will be moved to the Inactive plugin list.') ?></p> 309 314 <form method="post" action="<?php echo admin_url('plugins.php') ?>"> 310 315 <?php wp_nonce_field('bulk-manage-plugins') ?> 311 316 … … 315 320 <?php if( current_user_can('delete_plugins') ) : ?> 316 321 <input type="submit" name="delete-selected" value="<?php _e('Delete') ?>" class="button-secondary" /> 317 322 <?php endif; ?> 323 <input type="submit" name="clear-recent-list" value="<?php _e('Clear List') ?>" class="button-secondary" /> 318 324 </div> 319 325 </div> 320 326 <br class="clear" /> … … 322 328 </form> 323 329 <?php endif; ?> 324 330 325 <h3 id="available-plugins"><?php _e('Available Plugins') ?></h3> 331 <?php if ( ! empty($inactive_plugins) ) : ?> 332 <h3 id="inactive-plugins"><?php _e('Inactive Plugins') ?></h3> 326 333 <form method="post" action="<?php echo admin_url('plugins.php') ?>"> 327 334 <?php wp_nonce_field('bulk-manage-plugins') ?> 328 335 329 <?php if ( ! empty($available_plugins) ) : ?>330 336 <div class="tablenav"> 331 337 <div class="alignleft"> 332 338 <input type="submit" name="activate-selected" value="<?php _e('Activate') ?>" class="button-secondary" /> … … 336 342 </div> 337 343 </div> 338 344 <br class="clear" /> 339 <?php print_plugins_table($ available_plugins, 'available') ?>345 <?php print_plugins_table($inactive_plugins, 'inactive') ?> 340 346 </form> 341 347 <?php endif; ?> 342 348 349 <?php if ( empty($all_plugins) ) : ?> 350 <p><?php _e('You do not appear to have any plugins available at this time.') ?></p> 351 <?php endif; ?> 352 343 353 <h2><?php _e('Get More Plugins'); ?></h2> 344 354 <p><?php _e('You can find additional plugins for your site in the <a href="http://wordpress.org/extend/plugins/">WordPress plugin directory</a>.'); ?></p> 345 355 <p><?php printf(__('To install a plugin you generally just need to upload the plugin file into your <code>%s</code> directory. Once a plugin is uploaded, you may activate it here.'), WP_PLUGIN_DIR); ?></p>