}
-my $t = $cgi->param("img");
-if(($t =~ /[\"\$\(\)\/]/ || !(-e "store/$room/$t")) && ($t =~ /.png$/i || $t =~ /.jpg$/i)) {
- print "Invalid selection";
- return 1;
+my $s = $cgi->param("img");
+my @r = split('%',$s);
+
+foreach my $t (@r) {
+ if(($t =~ /[\"\$\(\)\/]/ || !(-e "store/$room/$t")) && ($t =~ /.png$/i || $t =~ /.jpg$/i)) {
+ print "Invalid selection $t";
+ #return 1;
+ }
+ else {
+ system("rm store/$room/$t store/$room/thumb/$t");
}
-
-system("rm store/$room/$t store/$room/thumb/$t");
-
+ }
print <<REDOC;
<!DOCTYPE html>
}
function deletePic(f) {
- if(f != "") {
- getData("deletePic.pl?img="+f+"&room="+currentRoom);
+
+ g = '';
+ x = document.getElementById('filelist');
+ for (var i = 0; i < x.options.length; i++) {
+ if(x.options[i].selected){
+ g= g + '%' + x.options[i].value;
+ }
+ }
+ if(g != "") {
+ if(confirm('Really delete selected files?'))
+ getData("deletePic.pl?img="+g+"&room="+currentRoom);
}
else {
- alert("Select a file to show!");
+ alert("Select a file to delete!");
}
}
}
+function togglemulti() {
+ document.getElementById("filelist").setAttribute('multiple','multiple');
+ }
+
+
+
setTimeout('updatefiles();',500);
setTimeout('updatepresentation(" ");',200);
<div id="files"> </div>
<button type="button" onClick="window.open('store/$room/'+document.getElementById('filelist').value)">Show 2 Me</button>
<button type="button" onClick="present(document.getElementById('filelist').value)">Show 2 All</button>
-<button type="button" onClick="deletePic(document.getElementById('filelist').value)">Delete</button>
-<div id="current"></div><div id="preview"></div>
+<br><button type="button" onClick="deletePic(document.getElementById('filelist').value)">Delete</button>
+<button type="button" onClick="togglemulti()" title='Enable selecting several files for deletion'>MS</button>
+<div id="current"></div><div id="preview"></div>You can use arrow keys to change slides!</div>
</body></html>
HDOC