I need to show images thumbnails inside the report and show fulls ize images when click on it (just like a little gallery)... What I did so far is this: I have replaced (in beta3) line 515 (function _webform_report_format_data) looks so:
$link = '<a class="showup" href="' . base_path() . $tmp['filepath'] . '">' . $tmp['filename']. ' (' .(int) ($tmp['filesize']/1024).' KB'. '</a>';
I replaced with this:
$lnk=base_path() . $tmp['filepath'];
$link = '<a class="fancybox_class" href="'.$lnk.'"><img width="40" src="'.$lnk.'"><br>('. (int) ($tmp['filesize'] / 1024).' KB'.'</a>';
considering that I have fancybox installed and working. Russian reference is here http://digger3d.com/index.php/page/drupal-webform-report-fancybox-image/...
My question is:
Am I opening a security hole?
Is it any way to make it without the patching the original webform_report files? Am I inventing a bicycle?
Comments
Comment #1
jimbullington commentedI'm not sure - Drupal has several articles on filtering text input, but I'm not sure about uploaded images.
At this time, it is not possible to do this without patching.
I'm not sure what you mean by this...
Comment #2
digger3d commentedI'm not sure what you mean by this...
I mean am I doing something that someone else did before, when is much easier take that what was done already...
Comment #3
jimbullington commentedOK - stupid me - I should have figured that out.
To my knowledge, this has not been done before in webform reports. I am not sure this would be appropriate for the module, due to security concerns in displaying uploaded images from anonymous (untrusted) users.
Or am I being overly cautious? It may be possible to add code that would check file extensions for file uploads and wrap the download link around an image tag for image file types - as you have done.
Comment #4
digger3d commentedThe only thing that I want to have is to have a gallery inside there, not just one image.... Any ideas?
Comment #5
jimbullington commentedDo you mean format the report more like a grid instead of a list?
If you created a report with one column - the image component - could you insert something like this into _webform_report_pager()?
I have not tested this...
Comment #6
digger3d commentedno, it is like i have to add many photos int one weform... like a gallery inside one field... I will test what you sent
Comment #7
digger3d commentedit joined 1st cell of 3 submissions into one cell, besides it wasn't a photo cell....
Comment #8
digger3d commentedi have a regular webform, about 25 cells and one cell is for images... I need to put a gallery into this cell... let user upload up to 7 images into a small gallery....
Comment #9
jimbullington commentedI'm sorry - I just do not see how you can do what you are describing with webform and webform_reports.
Maybe use CCK and make a new node type with a several imagefields?
Comment #10
jimbullington commented