Ignore:
Timestamp:
Jun 18, 2013, 3:26:17 PM (11 years ago)
Author:
mistic100
Message:

move remove_image.php code to a trigger on init

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/BatchDownloader/include/events.inc.php

    r23321 r23323  
    279279}
    280280
     281/* ajax request to remove an image */
     282function batch_downloader_remove_image()
     283{
     284  if (!isset($_POST['action']) || $_POST['action']!='bd_remove_image') return;
     285 
     286  check_status(ACCESS_CLASSIC);
     287
     288  if (isset($_POST['set_id']) and isset($_POST['toggle_id']))
     289  {
     290    try
     291    {
     292      $BatchDownloader = new BatchDownloader($_POST['set_id']);
     293      $BatchDownloader->removeImages(array($_POST['toggle_id']));
     294      echo 'ok';
     295    }
     296    catch (Exception $e)
     297    {
     298      echo 'error';
     299    }
     300  }
     301  else
     302  {
     303    echo 'error';
     304  }
     305 
     306  exit(0);
     307}
     308
    281309?>
Note: See TracChangeset for help on using the changeset viewer.