16/01/2013, 13:24:05
Citation :#~~~~~ DEBUT BLOC A NE PAS SUPPRIMER ~~~~~
#~ Version du CMS: !1.7/8/9/10/11
#~ Url du site :
#~ Hébergeur / Soft : Ovh
#~ Informations Système :
#~ ----------------------------------------------
#~ Cms Version: 1.11.1
#~ Installed Modules:
#~ CMSMailer: 5.2.1
#~ CMSPrinting: 1.0.3
#~ FileManager: 1.4.0
#~ MenuManager: 1.8.3
#~ MicroTiny: 1.2.3
#~ ModuleManager: 1.5.5
#~ News: 2.12.8
#~ Search: 1.7.7
#~ ThemeManager: 1.1.7
#~ FormBuilder: 0.7.3
#~ Showtime: 3.2
#~ SiteMapMadeSimple: 1.2.6
#~ Gallery: 1.6
#~ CGJobMgr: 1.2.11
#~ TinyMCE: 2.9.12
#~ CGExtensions: 1.31.1
#~ JQueryTools: 1.1.1
#~ jQuery: 1.2.0
#~ CGSimpleSmarty: 1.5.2
#~ Cataloger: 0.11.2
#~ NMS: 2.6.5
#~ CGGoogleMaps: 2.4.3
#~ Uploads: 1.14.3
#~ #~ ----------------------------------------------
#~~~~~ FIN BLOC A NE PAS SUPPRIMER ~~~~~
Bonjour,
je voudrais savoir s'il est possible de télécharger plusieurs fichiers en même temps en les sélectionnant
par une checkbox et de mettre un bouton "Télécharger les éléments sélectionnés".
ci-dessous mon code la checkbox saffiche bien mais pas le téléchargement
Merci d'avance
Code :
{literal}
<script language="javascript">
function makeFrame( url )
{
ifrm = document.createElement( "IFRAME" );
ifrm.setAttribute( "style", "display:none;" ) ;
ifrm.setAttribute( "src", url ) ;
ifrm.style.width = 0+"px";
ifrm.style.height = 0+"px";
document.body.appendChild( ifrm ) ;
}
function downloadChecked( )
{
for( i = 0 ; i < document.downloadform.elements.length ; i++ )
{
foo = document.downloadform.elements[ i ] ;
if( foo.type == "checkbox" && foo.checked == true )
{
makeFrame('somefile.do?command=download&fileid=' + foo.name );
}
}
}</script>
{/literal}
<!-- Start Upload Summary Template -->
<form name="downloadform">
{if isset($input_filter) }
{$startform}
{$prompt_filter}{$input_filter}{$hidden_params}{$input_submit}
{$endform}
<br/>
{if isset($matches)}
{$matches} {$matchestext}
{/if}
{/if}
<div>
{if isset($prevpage_url)}
<a href="{$firstpage_url}" title="{$firstpage}">{$firstpage_arrow}</a>00
<a href="{$prevpage_url}" title="{$prevpage}">{$prevpage_arrow}</a>
{/if}
{if $numpages > 1}
{$pagetext} {$pagenum} {$oftext} {$numpages}
{/if}
{if isset($nextpage_url)}
<a href="{$nextpage_url}" title="{$nextpage}">{$nextpage_arrow}</a>01
<a href="{$lastpage_url}" title="{$lastpage}">{$lastpage_arrow}</a>
{/if}
</div>
{foreach from=$items item='entry' name='uploads'}
{if ($smarty.foreach.uploads.index == 0) or ($smarty.foreach.uploads.index % 3 == 0)}
<div class="row" style="width: 100%; padding-bottom: 10px;">
{/if}
<div class="upload" id="upload">
<table width="100%" border="0" cellspacing="5" cellpadding="5">
<tr>
<td><div id="imgFicher" class="imgFichier">
<a href="{$entry->download_url}" title="{$entry->upload_name}">
{if isset($entry->thumbnail_url)}
<img src="{$entry->thumbnail_url}" alt="">
{else}
<img src="{$entry->iconurl}" alt="">
{/if} </a>
</div></td>
<td><div id="nomFicher" class="nomFicher">{$entry->upload_name}{$entry->upload_id}</div></td>
<td><input type="checkbox" name="file" id="file1" value="{$entry->download_url}" /></td>
</tr>
</table>
</div>
{if ($smarty.foreach.uploads.index == 0) or ($smarty.foreach.uploads.index % 3 == 0)}
</div>
<p>{/if}
{foreach name=fields from=$entry->fields key='fldname' item='field'}
{$field.name}: {$field.value}<br/>
{/foreach}
{/foreach}
<!-- End Upload Summary Template -->
</p>
<p><input type="button" value="Télécharger les documents" onClick="downloadChecked();" /></p>
</form>