diff options
author | Mike Conway <michael.c.conway@gmail.com> | 2011-12-10 02:36:50 (GMT) |
---|---|---|
committer | Mike Conway <michael.c.conway@gmail.com> | 2011-12-10 02:36:50 (GMT) |
commit | f2ec2c74cc7b236b2156373207b38a079d2cee38 (patch) | |
tree | 911275befa7a9edfb9ba0e66b55cebaf5d665223 /idrop-web/grails-app/taglib | |
parent | 1853f4116734735277e5a822ab4735a53cad073d (diff) | |
download | QCG-Data-f2ec2c74cc7b236b2156373207b38a079d2cee38.zip QCG-Data-f2ec2c74cc7b236b2156373207b38a079d2cee38.tar.gz QCG-Data-f2ec2c74cc7b236b2156373207b38a079d2cee38.tar.bz2 |
[#549] gallery/photo view
Diffstat (limited to 'idrop-web/grails-app/taglib')
-rw-r--r-- | idrop-web/grails-app/taglib/org/irods/mydrop/taglib/ImageTagLib.groovy | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/idrop-web/grails-app/taglib/org/irods/mydrop/taglib/ImageTagLib.groovy b/idrop-web/grails-app/taglib/org/irods/mydrop/taglib/ImageTagLib.groovy new file mode 100644 index 0000000..5ea33eb --- /dev/null +++ b/idrop-web/grails-app/taglib/org/irods/mydrop/taglib/ImageTagLib.groovy @@ -0,0 +1,21 @@ +package org.irods.mydrop.taglib + +import org.irods.jargon.datautils.image.MediaHandlingUtils + +/** + * Tag library for handling images and media + * @author Mike Conway - DICE (www.irods.org) + * + */ +class ImageTagLib { + /** + * Renders the enclosed gallery tag if the given <code>CollectionAndDataObjectListingEntry</code> is an + * image. + * @attr entry REQUIRED the {@link CollectionAndDataObjectListingEntry} + */ + def galleryEntryIfImage = { attrs, body -> + if (MediaHandlingUtils.isImageFile(attrs.entry)) { + out << body() + } + } +} |