Changeset 16697


Ignore:
Timestamp:
07/13/12 20:42:34 (7 years ago)
Author:
mistic100
Message:

-button on admin page to purge download list
-confirmation is properly updated on UserCollection page

Location:
extensions/BatchDownloader
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • extensions/BatchDownloader/admin/sets.php

    r16689 r16697  
    1717  $BatchDownloader->deleteLastArchive(); 
    1818  $BatchDownloader->clearImages(); 
     19} 
     20if (isset($_POST['delete_done'])) 
     21{ 
     22  $query = ' 
     23DELETE s, i 
     24  FROM '.BATCH_DOWNLOAD_TSETS.' AS s 
     25    LEFT JOIN '.BATCH_DOWNLOAD_TIMAGES.' AS i 
     26    ON i.set_id = s.id 
     27  WHERE 
     28    status = "done" AND 
     29    date_creation < DATE_SUB(NOW(), INTERVAL 1 HOUR) 
     30;'; 
     31  pwg_query($query); 
    1932} 
    2033 
     
    6275{ 
    6376  $set = new BatchDownloader($set_id); 
     77   
    6478  $template->append('sets', array_merge( 
    6579    $set->getSetInfo(), 
  • extensions/BatchDownloader/admin/template/config.tpl

    r16689 r16697  
    9090      <label> 
    9191        <span class="property">{'Maximum number of photos per download set'|@translate}</span> 
    92         <div id="max_elements""></div> 
     92        <div id="max_elements"></div> 
    9393        <input type="text" name="max_elements" value="{$batch_download.max_elements}" size="5"> 
    9494      </label> 
  • extensions/BatchDownloader/admin/template/sets.tpl

    r16400 r16697  
    6464    <td>{$set.NB_ARCHIVES}</td> 
    6565    <td> 
    66       {$set.STATUS} 
    67       {if $set.STATUS == 'download'}({$set.LAST_ZIP}/{$set.NB_ARCHIVES}){/if} 
     66      {$set.STATUS|@translate} 
     67      {if $set.STATUS == 'download'}<i style="font-size:0.8em;">({$set.LAST_ZIP}/{$set.NB_ARCHIVES})</i>{/if} 
    6868    </td> 
    6969    <td style="padding-left:25px;"> 
     
    8080  {/if} 
    8181</table> 
     82 
     83<form action="{$F_FILTER_ACTION}" method="post"> 
     84<p><label><input type="checkbox" name="delete_done" value="1"> {'Remove all finished downloads'|@translate}</label> 
     85<input type="submit" value="{'Submit'|@translate}"></p> 
     86</form> 
  • extensions/BatchDownloader/admin/template/style.css

    r16626 r16697  
    4444} 
    4545.table2 .status { 
    46   width:80px; 
     46  width:120px; 
    4747} 
    4848 
  • extensions/BatchDownloader/include/BatchDownloader.class.php

    r16695 r16697  
    607607        try 
    608608        { 
     609          if (!class_exists('UserCollection')) throw new Exception(); 
    609610          $UserCollection = new UserCollection($this->data['type_id']); 
    610611          $set['NAME'] = l10n('Collection').': <a href="'.USER_COLLEC_PUBLIC.'view/'.$UserCollection->getParam('id').'">'.$UserCollection->getParam('name').'</a>'; 
  • extensions/BatchDownloader/include/events.inc.php

    r16689 r16697  
    106106   
    107107  // toolbar button 
    108   $button = '<li><a href="'. $url .'&amp;action=advdown_set" title="'.l10n('Download all pictures of this selection').'" class="pwg-state-default pwg-button" rel="nofollow" 
    109     onClick="return confirm(\''.sprintf(l10n('Confirm the download of %d pictures?'), count($page['items'])).'\');"> 
     108  $button = '<script type="text/javascript">var batchdown_count = '.count($page['items']).'; var batchdown_string = "'.l10n('Confirm the download of %d pictures?').'";</script> 
     109    <li><a href="'. $url .'&amp;action=advdown_set" title="'.l10n('Download all pictures of this selection').'" class="pwg-state-default pwg-button" rel="nofollow" 
     110    onClick="return confirm(batchdown_string.replace(\'%d\', batchdown_count));"> 
    110111                        <span class="pwg-icon batch-downloader-icon" style="background:url(\'' . BATCH_DOWNLOAD_PATH . 'template/zip.png\') center center no-repeat;">&nbsp;</span><span class="pwg-button-text">'.l10n('Batch Downloader').'</span> 
    111112                </a></li>'; 
  • extensions/BatchDownloader/language/en_UK/plugin.lang.php

    r16689 r16697  
    4343$lang['Remove from download set'] = 'Remove from download set'; 
    4444$lang['Confirm the download of %d pictures?'] = 'Confirm the download of %d pictures?'; 
     45$lang['Remove all finished downloads'] = 'Remove all finished downloads'; 
     46$lang['hours'] = 'hours'; 
    4547 
    4648?> 
  • extensions/BatchDownloader/language/fr_FR/plugin.lang.php

    r16689 r16697  
    2323$lang['Archives'] = 'Archives'; 
    2424$lang['Maximum photo size'] = 'Taille maximale des photo'; 
    25 $lang['Delete unterminated downloads after'] = 'Supprimer les téléchargements après'; 
     25$lang['Delete downloads after'] = 'Supprimer les téléchargements après'; 
    2626$lang['Maximum number of photos per download set'] = 'Nombre maximal de photos par lot'; 
    2727$lang['Maximum size of each archive (in Megabytes)'] = 'Taille maximale de chaque archive (en Megaoctets)'; 
     
    4343$lang['Remove from download set'] = 'Supprimer du lot'; 
    4444$lang['Confirm the download of %d pictures?'] = 'Confirmer le téléchargementde %d photos ?'; 
     45$lang['Remove all finished downloads'] = 'Supprimer tous les téléchargements terminés'; 
     46$lang['hours'] = 'heures'; 
    4547 
    4648?> 
Note: See TracChangeset for help on using the changeset viewer.