Changeset 25931
- Timestamp:
- Dec 12, 2013, 2:12:13 PM (10 years ago)
- Location:
- extensions/BatchDownloader
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/BatchDownloader/admin/config.php
r23383 r25931 11 11 'what' => isset($_POST['what']) ? array_keys($_POST['what']) : array(), 12 12 'photo_size' => $_POST['photo_size'], 13 'multisize' => $_POST['multisize'] == 'true', 13 14 'archive_prefix' => trim($_POST['archive_prefix']), 14 15 'archive_timeout' => intval($_POST['archive_timeout']), -
extensions/BatchDownloader/admin/template/config.tpl
r23383 r25931 31 31 } 32 32 }); 33 {literal} 33 34 34 $("input[name='max_elements']").change(function() { 35 35 $("#max_elements").slider("value", $(this).val()); … … 48 48 $(".advanced").slideDown(); 49 49 }); 50 {/literal}{/footer_script} 50 51 $('input[name="multisize"]').on('change', function() { 52 if ($(this).val() == 'true') { 53 $('#multisize_title').text('{'Maximum photo size'|@translate|escape:javascript}'); 54 } 55 else { 56 $('#multisize_title').text('{'Photo size'|@translate|escape:javascript}'); 57 } 58 }) 59 .filter(':checked').trigger('change'); 60 {/footer_script} 61 51 62 52 63 <div class="titrePage"> … … 59 70 60 71 <ul> 72 <li> 73 <i>{'Warning: Only registered users can use Batch Downloader.'|@translate}</i> 74 </li> 61 75 <li> 62 76 <label> … … 80 94 </li> 81 95 <li> 82 <i>{'Warning: Only registered users can use Batch Downloader.'|@translate}</i>83 </li>84 <li>85 96 <b>{'What can be downloaded?'|@translate}</b> 86 97 <label><input type="checkbox" name="what[categories]" {if in_array('categories',$batch_download.what)}checked="checked"{/if}/> {'Albums'|@translate}</label> 87 98 {if $USER_COLLEC_LOADED}<label><input type="checkbox" name="what[collections]" {if in_array('collections',$batch_download.what)}checked="checked"{/if}/> {'Collections'|@translate}</label>{/if} 88 99 <label><input type="checkbox" name="what[specials]" {if in_array('specials',$batch_download.what)}checked="checked"{/if}/> {'Specials'|@translate}</label> 89 <a class="showInfo" title="{'Most visited'|@translate}, {'Random photos'|@translate}, {'Best rated'|@translate}...">i</a> 90 </li> 91 <li> 92 <label> 93 <b>{'Maximum photo size'|@translate}</b> 100 <a class="icon-info-circled-1 showInfo" title="{'Most visited'|@translate}, {'Random photos'|@translate}, {'Best rated'|@translate}..."></a> 101 </li> 102 <li> 103 <b>{'Photo size choices'|translate}</b> 104 <label><input type="radio" name="multisize" value="true" {if $batch_download.multisize}checked{/if}> {'Any size'|translate}</label> 105 <label><input type="radio" name="multisize" value="false" {if !$batch_download.multisize}checked{/if}> {'One size'|translate}</label> 106 107 <label> 108 <b id="multisize_title">{'Maximum photo size'|@translate}</b> 94 109 <select name="photo_size"> 95 110 {html_options options=$sizes_options selected=$batch_download.photo_size} … … 135 150 <b>{'Delete previous archive when starting to download another one'|@translate}</b> 136 151 </label> 137 <a class=" showInfo" title="{'It saves space on the server but doesn\'t allow to restart failed downloads.'|@translate}">i</a>152 <a class="icon-info-circled-1 showInfo" title="{'It saves space on the server but doesn\'t allow to restart failed downloads.'|@translate}"></a> 138 153 </li> 139 154 <li> … … 142 157 <b>{'Force the usage of PclZip instead of ZipArchive as ZIP library'|@translate}</b> 143 158 </label> 144 <a class=" showInfo" title="{'Only check if you are experiencing corrupted archives with ZipArchive.'|@translate}">i</a>159 <a class="icon-info-circled-1 showInfo" title="{'Only check if you are experiencing corrupted archives with ZipArchive.'|@translate}"></a> 145 160 </li> 146 161 <li> … … 149 164 <b>{'Don\'t download archives through PHP'|@translate}</b> 150 165 </label> 151 <a class=" showInfo" title="{'Only check if your host complains about high PHP usage.'|@translate}">i</a>166 <a class="icon-info-circled-1 showInfo" title="{'Only check if your host complains about high PHP usage.'|@translate}"></a> 152 167 </li> 153 168 {if $use_ziparchive} -
extensions/BatchDownloader/admin/template/style.css
r23383 r25931 47 47 } 48 48 49 .showInfo {50 position:static;51 display:inline-block;52 padding:1px 6px;53 width:4px;54 height:14px;55 line-height:14px;56 font-size:0.8em;57 }58 59 49 .advanced span { 60 50 font-family: 'Courrier New',monospace; -
extensions/BatchDownloader/include/events.inc.php
r23771 r25931 145 145 )); 146 146 147 foreach (ImageStdParams::get_defined_type_map() as $params) 148 { 149 $template->append( 150 'BATCH_DOWNLOAD_SIZES', 151 array( 152 'TYPE' => $params->type, 153 'DISPLAY' => l10n($params->type), 154 'SIZE' => $params->sizing->ideal_size[0].' x '.$params->sizing->ideal_size[1], 155 ) 156 ); 157 if ($params->type == $conf['batch_download']['photo_size']) break; 158 } 159 if ($conf['batch_download']['photo_size'] == 'original') 160 { 161 $template->append( 162 'BATCH_DOWNLOAD_SIZES', 163 array( 164 'TYPE' => 'original', 165 'DISPLAY' => l10n('Original'), 166 'SIZE' => null, 167 ) 168 ); 147 if ($conf['batch_download']['multisize']) 148 { 149 foreach (ImageStdParams::get_defined_type_map() as $params) 150 { 151 $template->append( 152 'BATCH_DWN_SIZES', 153 array( 154 'TYPE' => $params->type, 155 'DISPLAY' => l10n($params->type), 156 'SIZE' => $params->sizing->ideal_size[0].' x '.$params->sizing->ideal_size[1], 157 ) 158 ); 159 if ($params->type == $conf['batch_download']['photo_size']) break; 160 } 161 if ($conf['batch_download']['photo_size'] == 'original') 162 { 163 $template->append( 164 'BATCH_DWN_SIZES', 165 array( 166 'TYPE' => 'original', 167 'DISPLAY' => l10n('Original'), 168 'SIZE' => null, 169 ) 170 ); 171 } 172 } 173 else 174 { 175 $template->assign('BATCH_DWN_SIZE', $conf['batch_download']['photo_size']); 169 176 } 170 177 -
extensions/BatchDownloader/include/functions.inc.php
r23804 r25931 8 8 function get_set_info_from_page() 9 9 { 10 global $page ;10 global $page, $conf; 11 11 12 12 switch ($page['section']) … … 70 70 ); 71 71 72 return trigger_event('batchdownload_get_set_info', $set); 72 // check size 73 if (!$conf['batch_download']['multisize']) 74 { 75 $set['size'] = $conf['batch_download']['photo_size']; 76 } 77 else 78 { 79 $avail_sizes = array(); 80 foreach (ImageStdParams::get_defined_type_map() as $params) 81 { 82 $avail_sizes[] = $params->type; 83 if ($params->type == $conf['batch_download']['photo_size']) break; 84 } 85 if ($conf['batch_download']['photo_size'] == 'original') 86 { 87 $avail_sizes[] = 'original'; 88 } 89 90 if (!in_array($set['size'], $avail_sizes)) 91 { 92 $set['size'] = $conf['batch_download']['photo_size']; 93 } 94 } 95 96 return trigger_change('batchdownload_get_set_info', $set); 73 97 } 74 98 -
extensions/BatchDownloader/include/install.inc.php
r23383 r25931 14 14 'what' => array('categories','specials','collections'), 15 15 'photo_size' => 'original', 16 'multisize' => true, 16 17 'archive_prefix' => 'piwigo', 17 18 'archive_timeout' => 48, /* hours */ … … 43 44 $new_conf['force_pclzip'] = isset($conf['batch_download_force_pclzip']) && $conf['batch_download_force_pclzip']; 44 45 $new_conf['direct'] = isset($conf['batch_download_direct']) && $conf['batch_download_direct']; 46 } 47 if (!isset($new_conf['multisize'])) 48 { 49 $new_conf['multisize'] = true; 45 50 } 46 51 -
extensions/BatchDownloader/language/en_UK/plugin.lang.php
r23383 r25931 63 63 $lang['Don\'t download archives through PHP'] = 'Don\'t download archives through PHP'; 64 64 $lang['Only check if your host complains about high PHP usage.'] = 'Only check if your host complains about high PHP usage.'; 65 $lang['Any size'] = 'Any size'; 66 $lang['One size'] = 'One size'; 67 $lang['Photo size choices'] = 'Photo size choices'; 68 $lang['Photo size'] = 'Photo size'; 65 69 66 70 ?> -
extensions/BatchDownloader/language/fr_FR/plugin.lang.php
r23383 r25931 42 42 $lang['Unable to find ZipArchive PHP extension, Batch Downloader will use PclZip instead, but with degraded performance.'] = 'Impossible de trouver l\'extension PHP ZipArchive, Batch Downloader va utiliser PclZip à la place, mais avec des performances dégradées.'; 43 43 $lang['Remove from download set'] = 'Supprimer du lot'; 44 $lang['Confirm the download of %d pictures?'] = 'Confirmer le téléchargement de %d photos ?';44 $lang['Confirm the download of %d pictures?'] = 'Confirmer le téléchargement de %d photos ?'; 45 45 $lang['Remove all finished downloads'] = 'Supprimer tous les téléchargements terminés'; 46 46 $lang['hours'] = 'heures'; … … 63 63 $lang['Don\'t download archives through PHP'] = 'Ne pas télécharger les archives via PHP'; 64 64 $lang['Only check if your host complains about high PHP usage.'] = 'Ne cochez uniquement que si votre hébergeur se plaint d\'une activité abusive de PHP.'; 65 $lang['Any size'] = 'N\'importe quelle taille'; 66 $lang['One size'] = 'Une seule taille'; 67 $lang['Photo size choices'] = 'Choix de la taille des photos'; 68 $lang['Photo size'] = 'Taille des photos'; 65 69 66 70 ?> -
extensions/BatchDownloader/template/download_button.tpl
r23359 r25931 1 {footer_script require='jquery'} 2 var batchdown_count = {$BATCH_DWN_COUNT}; 3 var batchdown_string = "{'Confirm the download of %d pictures?'|@translate}"; 4 {literal} 5 jQuery().ready(function() { 6 jQuery("#batchDownloadLink").click(function() { 7 var elt = jQuery("#batchDownloadBox"); 1 <a href="{$BATCH_DWN_URL}{$BATCH_DWN_SIZE}" id="batchDownloadLink" title="{'Download all pictures of this selection'|@translate}" class="pwg-state-default pwg-button" rel="nofollow"> 2 <span class="pwg-icon batch-downloader-icon" style="background:url('{$ROOT_URL}{$BATCH_DOWNLOAD_PATH}template/images/zip.png') center center no-repeat;"> </span><span class="pwg-button-text">{'Download'|@translate}</span> 3 </a> 8 4 9 elt.css("left", Math.min( jQuery(this).offset().left, jQuery(window).width() - elt.outerWidth(true) - 5)) 10 .css("top", jQuery(this).offset().top + jQuery(this).outerHeight(true)) 11 .toggle(); 12 13 return false; 14 }); 15 16 jQuery("#batchDownloadBox").on("mouseleave click", function() { 17 jQuery(this).hide(); 18 }); 19 20 jQuery("#batchDownloadBox a").click(function() { 21 return confirm(batchdown_string.replace('%d', batchdown_count)); 22 }); 23 }); 24 {/literal}{/footer_script} 25 26 {html_style}{literal} 27 .downloadSizeDetails {font-style:italic; font-size:80%;} 28 {/literal}{/html_style} 29 30 <li><a href="{$BATCH_DWN_URL}" id="batchDownloadLink" title="{'Download all pictures of this selection'|@translate}" class="pwg-state-default pwg-button" rel="nofollow"> 31 <span class="pwg-icon batch-downloader-icon" style="background:url('{$ROOT_URL}{$BATCH_DOWNLOAD_PATH}template/images/zip.png') center center no-repeat;"> </span><span class="pwg-button-text">{'Download'|@translate}</span> 32 </a></li> 5 {if isset($BATCH_DWN_SIZES)} 6 {combine_script id='core.switchbox' load='async' require='jquery' path='themes/default/js/switchbox.js'} 33 7 34 8 <div id="batchDownloadBox" class="switchBox" style="display:none"> 35 9 <div class="switchBoxTitle">{'Download'|@translate} - {'Photo sizes'|@translate}</div> 36 {foreach from=$BATCH_D OWNLOAD_SIZES item=size name=loop}{if !$smarty.foreach.loop.first}<br>{/if}10 {foreach from=$BATCH_DWN_SIZES item=size name=loop}{if !$smarty.foreach.loop.first}<br>{/if} 37 11 <a href="{$BATCH_DWN_URL}{$size.TYPE}" rel="nofollow"> 38 12 {$size.DISPLAY} {if $size.SIZE}<span class="downloadSizeDetails">({$size.SIZE})</span>{/if} … … 40 14 {/foreach} 41 15 </div> 16 {/if} 17 18 {footer_script require='jquery'} 19 var batchdown_count = {$BATCH_DWN_COUNT}; 20 var batchdown_string = "{'Confirm the download of %d pictures?'|@translate}"; 21 22 {if isset($BATCH_DWN_SIZES)} 23 (SwitchBox=window.SwitchBox||[]).push("#batchDownloadLink", "#batchDownloadBox"); 24 25 jQuery("#batchDownloadBox a").click(function() { 26 return confirm(batchdown_string.replace('%d', batchdown_count)); 27 }); 28 {else} 29 jQuery("#batchDownloadLink").click(function() { 30 return confirm(batchdown_string.replace('%d', batchdown_count)); 31 }); 32 {/if} 33 {/footer_script} 34 35 {html_style}{literal} 36 .downloadSizeDetails {font-style:italic; font-size:80%;} 37 {/literal}{/html_style}
Note: See TracChangeset
for help on using the changeset viewer.