deactivate_all.php 932 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Disable all specified installed plugins.
  4. *
  5. * Specified plugins in the mod/ directory are disabled and the views cache and simplecache
  6. * are reset.
  7. *
  8. * @package Elgg.Core
  9. * @subpackage Administration.Plugins
  10. */
  11. $guids = get_input('guids');
  12. $guids = explode(',', $guids);
  13. foreach ($guids as $guid) {
  14. $plugin = get_entity($guid);
  15. if ($plugin->isActive()) {
  16. if ($plugin->deactivate()) {
  17. //system_message(elgg_echo('admin:plugins:activate:yes', array($plugin->getManifest()->getName())));
  18. } else {
  19. $msg = $plugin->getError();
  20. $string = ($msg) ? 'admin:plugins:deactivate:no_with_msg' : 'admin:plugins:deactivate:no';
  21. register_error(elgg_echo($string, array($plugin->getFriendlyName(), $plugin->getError())));
  22. }
  23. }
  24. }
  25. // don't regenerate the simplecache because the plugin won't be
  26. // loaded until next run. Just invalidate and let it regnerate as needed
  27. elgg_flush_caches();
  28. forward(REFERER);