Ignore:
Timestamp:
Jul 6, 2012, 1:03:39 PM (12 years ago)
Author:
mistic100
Message:
  • stylish download page
  • if there is only one archive, the file is downloaded directly
  • improve configuration page + add sliders (needs Piwigo 2.4.2)
File:
1 edited

Legend:

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

    r16379 r16392  
    1515    $BatchDownloader = new BatchDownloader($_GET['set_id']);
    1616   
    17     if ($BatchDownloader->getParam('status') != 'done')
     17    if ( isset($_GET['cancel']) )
    1818    {
    19       if (isset($_GET['zip']))
    20       {
    21         $BatchDownloader->deleteLastArchive();
    22         $next_file = $BatchDownloader->createNextArchive();
    23       }
    24       else
    25       {
    26         $BatchDownloader->getEstimatedArchiveNumber();
    27       }
     19      $BatchDownloader->deleteLastArchive();
     20      $BatchDownloader->clear();
     21      pwg_query('DELETE FROM '.BATCH_DOWNLOAD_TSETS.' WHERE id = '.$_GET['set_id'].';');
     22      $_SESSION['page_infos'][] = l10n('Download set deleted');
     23      redirect('index.php');
     24    }
     25   
     26    if ( isset($_GET['zip']) and $BatchDownloader->getParam('status') != 'done' and $_GET['zip'] > $BatchDownloader->getParam('last_zip') )
     27    {
     28      $BatchDownloader->deleteLastArchive();
     29      $next_file = $BatchDownloader->createNextArchive();
    2830    }
    2931
     
    3335    {
    3436      $set['U_DOWNLOAD'] = BATCH_DOWNLOAD_PATH . 'download.php?set_id='.$_GET['set_id'].'&zip='.$_GET['zip'];
    35       array_push($page['infos'], sprintf(l10n('Archive #%d is downloading, if the download doesn\'t start automatically please <a href="%s">click here</a>'), $_GET['zip'], $set['U_DOWNLOAD']));
     37      array_push($page['infos'], sprintf(l10n('The archive is downloading, if the download doesn\'t start automatically please <a href="%s">click here</a>'), $set['U_DOWNLOAD']));
    3638    }
    3739   
    3840    if ($BatchDownloader->getParam('nb_images') > $conf['batch_download']['max_elements'])
    3941    {
    40       array_push($page['errors'], sprintf(
     42      $template->assign('elements_error', sprintf(
    4143        l10n('You choose to download %d pictures, but the system is limited to %d. You can edit the set, or the last %d pictures will not be downloaded.'),
    4244        $BatchDownloader->getParam('nb_images'),
     
    4446        $BatchDownloader->getParam('nb_images') - $conf['batch_download']['max_elements']
    4547        ));
     48    }
     49   
     50    if ($BatchDownloader->getParam('status') == 'new')
     51    {
     52      $set['U_CANCEL'] = BATCH_DOWNLOAD_PUBLIC . 'init_zip&amp;set_id='.$_GET['set_id'].'&amp;cancel';
    4653    }
    4754   
     
    102109}
    103110
     111$template->assign('BATCH_DOWNLOAD_PATH', BATCH_DOWNLOAD_PATH);
     112
    104113
    105114function batch_download_thumbnails_list_prefilter($content, &$smarty)
Note: See TracChangeset for help on using the changeset viewer.