Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Release 1.0.0 - 07/02/2007

sfLightboxPlugin

It adds a new helper file : LightboxHelper with 6 new functions:
* light_image, to display an image (with lightbox) on an image link
* light_image_text, to display an image with a text link
* light_slideshow, to display a slideshow with an image set
* light_slide_image, to display a slideshow with an image link
* light_slide_text, to display a slideshow with a text link
* light_modallink, to display a modal popup with any content

Installation

(or download it at the root of your project and install locally : symfony plugin-install sfLightboxPlugin-x.x.x.tgz)

(or check out from the svn repository: http://svn.symfony-project.com/plugins/sfLightboxPlugin/)

If you don't want to use the following data structure :

/sfLightboxPlugin/js/

/sfLightboxPlugin/css/

/sfLightboxPlugin/javascript/

You will have to modifiy the path in 'lightbox.css', 'lightbox.js', 'modalbox.js' and the 'config.php' of the plugin (or make your own in your application by creating a sfLightboxPlugin module) You also have a french picture for the close button in '/web/images/fr/', you will also have to change the path if you want to use it for now.

Clear you cache

symfony cc

Usage

1 - Declare the helper

2 - To display a lightbox link to one image (check the _single_images.php template inside the plugin module)

Of course here i use external images, but you can put path related to your images directory as you would do with the standard symfony image_tag function.

You can change the class or options to adjust the wanted size or speed. You can use a route instead of a 'module/action'. Check [the official homepage of the Lightbox2 library], moreover the plugin includes a demo as a module, just enable the sfLightboxPlugin module in your settings.yml file then call the demo in your application http://www.domain.com/sfLightboxPlugin. You can also check the live demo on my http://snippets.coilblog.com/plugins/sfLightbox symfony blog

TODO

Versions

1.0.6

1.0.5

Added a demo as a symfony module that does the excalty the same as the official demo page of the library

Change options handling for light_modallink to allow 3 different syntaxes

1.0.4

LightboxHelper.php :
When creating a slideshow the caption of the images are now taken from the title attribute of each images if it exists whereas it is taken from the title attribute of the link if not (before it was always taken from the title link attribute)

1.0.3

modalbox.js
now allows to call initModalbox several times (in case a modal link is created dynamically, after page load). Don't forget to call initModalbox() again when you create a new modal link.

config.php :
corrected wrong paths stored in config

1.0.2

Helpers enhancements
options are now parsed so they can be scalar or array, just like the link_to helper
light_modallink : added 'speed' and 'size' options (using regular classes is still allowed to keep BC)

modalbox.js fixes :
removed some unused, unitialized variables that could cause JS errors in IE6 in some cases.

File structure changes :
Removed the 'lightbox' folder in web/css, web/js and web/images
Prepared for next release in web/images, as closelabel.gif will be culture-dependent

1.0.1

Some bug fixes in modalbox.js and also modalbox.css which affected IE6/7 and Opera.

Renaiming of some html identifiers in modalbox to allow use of modalbox and lightbox in the same document. (more info in modalbox.js file)

Modified default close image from 'closelabel.gif' which was culture dependent to 'close.gif' (only a close cross).