Can you share a multiple file selector example?

Permalink
Does anyone have a basic framework or example of a block where you can select multiple files or images? An example would be the slideshow block that comes with the core - you select multiple images (which adds each image to any array). I'm having a hard time dissecting everything in this block.

I need something basic to start from. I hope this isn't asking for too much. Thanks for any help though!

1 Attachment

jizzle
 
Tony replied on at Permalink Reply
Tony
not sure if this will make much sense, but i've done something like this before for getting a list of fIDs:

<a onclick="ccm_alLaunchSelectorFileManager('lastAttachment'); return false" href="#"><?=t('Add File') ?></a>

<script>
function ccm_chooseAsset(data){ addAttachment(data); }

function addAttachment(data){
if(!parseInt(data.fID)) return false;
var html = '<div class="fileAttachmentRow" id="fileAttachmentRow'+data.fID+'">';
html = html+'<input name="fileAttachmentFIDs[]" type="checkbox" checked="checked" value="'+data.fID+'" />';
html = html+'<a class="fileAttachmentTitle" href="'+data.filePathDirect+'" target="_blank">'+data.title+'</a>';
html = html+'</div>';
$('#attachedFilesList').append(html);
}
</script>
jizzle replied on at Permalink Reply
jizzle
Haven't had any time to test this. Stupid job puts a stick in any fun!
okp replied on at Permalink Reply
okp
Sorry undigging this old topic, don't even know if this solution is not really outdated.
If this is a still valid and good way, i'd like to know what's the next step to save entry to db.

I guess a loop shall be donne to save fID s one by one ?

what whould be the db.xml syntax, and the edit/view ?

Sorry for my poor poor php/c5 knowledge...

Thanks again