function w3tc_extensions_activate()
 {
     $config = Dispatcher::config();
     $extension = Util_Request::get_string('w3tc_extensions_activate');
     $ext = Extensions_Util::get_extension($config, $extension);
     if (!is_null($ext)) {
         if (Extensions_Util::activate_extension($extension, $config)) {
             Util_Admin::redirect_with_custom_messages2(array('notes' => array(sprintf(__('Extension <strong>%s</strong> has been successfully activated.', 'w3-total-cache'), $ext['name']))));
             return;
         }
     }
     Util_Admin::redirect(array());
 }
 /**
  * Alters the active state of an extension
  */
 public function change_extension_status()
 {
     $action = Util_Request::get_string('action');
     if (in_array($action, array('activate', 'deactivate'))) {
         $extension = Util_Request::get_string('extension');
         if ('activate' == $action) {
             Extensions_Util::activate_extension($extension, $this->_config);
             wp_redirect(Util_Ui::admin_url(sprintf('admin.php?page=w3tc_extensions&activated=%s', $extension)));
         } elseif ('deactivate' == $action) {
             Extensions_Util::deactivate_extension($extension, $this->_config);
             wp_redirect(Util_Ui::admin_url(sprintf('admin.php?page=w3tc_extensions&deactivated=%s', $extension)));
         }
     }
 }