work.ajax.php 679 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Responses to AJAX calls
  5. */
  6. require_once '../global.inc.php';
  7. require_once api_get_path(SYS_CODE_PATH).'work/work.lib.php';
  8. $action = isset($_REQUEST['a']) ? $_REQUEST['a'] : null;
  9. $isAllowedToEdit = api_is_allowed_to_edit();
  10. switch ($action) {
  11. case 'delete_work':
  12. if ($isAllowedToEdit) {
  13. if (empty($_REQUEST['id'])) {
  14. return false;
  15. }
  16. $workList = explode(',', $_REQUEST['id']);
  17. foreach ($workList as $workId) {
  18. deleteDirWork($workId);
  19. }
  20. }
  21. break;
  22. default:
  23. echo '';
  24. break;
  25. }
  26. exit;