bulk_delete.php 587 B

123456789101112131415161718192021222324252627
  1. <?php
  2. $group_guids = get_input("group_guids");
  3. if (empty($group_guids)) {
  4. register_error(elgg_echo("group_tools:action:error:input"));
  5. forward(REFERER);
  6. }
  7. // this could take a while
  8. set_time_limit(0);
  9. $options = array(
  10. "type" => "group",
  11. "guids" => $group_guids,
  12. "limit" => false
  13. );
  14. $batch = new ElggBatch("elgg_get_entities", $options, "elgg_batch_delete_callback", 25, false);
  15. if ($batch->callbackResult) {
  16. system_message(elgg_echo("group_tools:action:bulk_delete:success"));
  17. } else {
  18. register_error(elgg_echo("group_tools:action:bulk_delete:error"));
  19. }
  20. forward(REFERER);