Support network-wide plugin re-activation in upgrades and edits. props PeteMall, fixes #13216

git-svn-id: https://develop.svn.wordpress.org/trunk@14348 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-05-02 22:57:44 +00:00
parent 7fcda10d46
commit 63fa3e7f3f
3 changed files with 10 additions and 6 deletions

View File

@@ -986,6 +986,7 @@ class WP_Upgrader_Skin {
class Plugin_Upgrader_Skin extends WP_Upgrader_Skin {
var $plugin = '';
var $plugin_active = false;
var $plugin_network_active = false;
function Plugin_Upgrader_Skin($args = array()) {
return $this->__construct($args);
@@ -997,7 +998,8 @@ class Plugin_Upgrader_Skin extends WP_Upgrader_Skin {
$this->plugin = $args['plugin'];
$this->plugin_active = is_plugin_active($this->plugin);
$this->plugin_active = is_plugin_active( $this->plugin );
$this->plugin_network_active = is_plugin_active_for_network( $this->plugin );
parent::__construct($args);
}
@@ -1006,7 +1008,7 @@ class Plugin_Upgrader_Skin extends WP_Upgrader_Skin {
$this->plugin = $this->upgrader->plugin_info();
if ( !empty($this->plugin) && !is_wp_error($this->result) && $this->plugin_active ){
show_message(__('Reactivating the plugin…'));
echo '<iframe style="border:0;overflow:hidden" width="100%" height="170px" src="' . wp_nonce_url('update.php?action=activate-plugin&plugin=' . $this->plugin, 'activate-plugin_' . $this->plugin) .'"></iframe>';
echo '<iframe style="border:0;overflow:hidden" width="100%" height="170px" src="' . wp_nonce_url('update.php?action=activate-plugin&networkwide=' . $this->plugin_network_active . '&plugin=' . $this->plugin, 'activate-plugin_' . $this->plugin) .'"></iframe>';
}
$update_actions = array(
@@ -1390,4 +1392,4 @@ class File_Upload_Upgrader {
$this->package = $uploads['basedir'] . '/' . $this->filename;
}
}
}
}