sfLightboxPlugin
1.0.5stable
for sf 1.0 MIT
sfLightboxPlugin is a symfony plugin that provides an easy to use wrapper for the Lightbox2 JavaScript library.
Developers
| Name |
Status |
Email |
Vernet Loïc |
lead |
rf]tod[oohay]ta[lioc_frq
|
License
Plugin by Coil & Demental.
Lightbox library is made by Lokesh Dhakar. (http://www.huddletogether.com/projects/lightbox2)
Modalbox modification by Demental (http://demental.info/blog/index.php?post/2007/01/11/75-introducing-modalbox)
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.
Releases for sf 1.4
| Version |
License |
API |
Released |
|
1.0.12stable
|
MIT license |
1.0.12stable
|
09/04/2010 |
Releases for sf 1.3
| Version |
License |
API |
Released |
|
1.0.12stable
|
MIT license |
1.0.12stable
|
09/04/2010 |
Releases for sf 1.2
| Version |
License |
API |
Released |
|
1.0.12stable
|
MIT license |
1.0.12stable
|
09/04/2010 |
|
1.0.11stable
|
MIT license |
1.0.11stable
|
09/05/2009 |
|
1.0.10stable
|
MIT license |
1.0.10stable
|
06/04/2009 |
|
1.0.9stable
|
MIT license |
1.0.9stable
|
04/04/2009 |
Releases for sf 1.1
| Version |
License |
API |
Released |
|
1.0.12stable
|
MIT license |
1.0.12stable
|
09/04/2010 |
|
1.0.11stable
|
MIT license |
1.0.11stable
|
09/05/2009 |
|
1.0.10stable
|
MIT license |
1.0.10stable
|
06/04/2009 |
|
1.0.9stable
|
MIT license |
1.0.9stable
|
04/04/2009 |
|
1.0.8stable
|
MIT license |
1.0.8stable
|
01/10/2008 |
Releases for sf 1.0
| Version |
License |
API |
Released |
|
1.0.12stable
|
MIT license |
1.0.12stable
|
09/04/2010 |
|
1.0.11stable
|
MIT license |
1.0.11stable
|
09/05/2009 |
|
1.0.10stable
|
MIT license |
1.0.10stable
|
06/04/2009 |
|
1.0.9stable
|
MIT license |
1.0.9stable
|
04/04/2009 |
|
1.0.8stable
|
MIT license |
1.0.8stable
|
01/10/2008 |
|
1.0.7stable
|
MIT license |
1.0.7stable
|
22/04/2008 |
|
1.0.6stable
|
MIT license |
1.0.6stable
|
02/03/2008 |
|
1.0.5stable
|
MIT license |
1.0.5stable
|
27/04/2007 |
|
1.0.4stable
|
MIT license |
1.0.4stable
|
24/04/2007 |
|
1.0.3stable
|
MIT license |
1.0.2stable
|
16/04/2007 |
|
1.0.2stable
|
MIT license |
1.0.2stable
|
26/03/2007 |
|
1.0.1stable
|
MIT license |
1.0.0stable
|
21/02/2007 |
|
1.0.0stable
|
MIT license |
1.0.0stable
|
07/02/2007 |
Changelog for release 1.0.5 - 27/04/2007
Not available
Other releases
Release 1.0.12 - 09/04/2010
- Updated and tested plugin for symfony 1.3 and 1.4
- Updated documentation for each major symfony release
Release 1.0.11 - 09/05/2009
- Corrected error in README that prevent plugin to work
Release 1.0.10 - 06/04/2009
- Corrected bug with symfony 1.2 and sfProtoculousPlugin activated
Release 1.0.9 - 04/04/2009
- Tested and uploaded this release for symfony 1.2.x
- Added a route exemple if the symfony default route was deleted from your application
- Converted and updated README in Markdown syntax
- Added more detailed installation inscructions for symfony 1.2.x. :p
- Update modalbox height of demo
Release 1.0.8 - 01/10/2008
- Tested and uploaded this release for symfony 1.1.x
- Updated demo
- Updated name of demo module (sfLightbox)
- Corrected missing builder.js bug for lightbox v2.04
- Added online demo on my sf blog: http://snippets.strangebuzz.com/index.php/sfLightbox
- Fixed images path in SVN
Release 1.0.7 - 22/04/2008
Not available
Release 1.0.6 - 02/03/2008
Not available
Release 1.0.5 - 27/04/2007
Not available
Release 1.0.4 - 24/04/2007
Not available
Release 1.0.3 - 16/04/2007
Not available
Release 1.0.2 - 26/03/2007
Not available
Release 1.0.1 - 21/02/2007
Not available
Release 1.0.0 - 07/02/2007
Not available
sfLightboxPlugin
sfLightboxPlugin is a symfony plugin that provides an easy to use wrapper for the Lightbox2 javascript library.
It add a new helper : LightboxHelper with 3 functions :
* light_image, to display an image
* light_slideshow, to display a slideshow
* light_modalbox, to display a modal popup with any content
Installation
Install the plugin
symfony plugin-install http://plugins.symfony-project.com/sfLightboxPlugin
(or download it at the root of your project and install locally : symfony plugin-install sfLightboxPlugin-x.x.x.tgz)
If you don't want to use the following data structure :
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 - To display one image
'Optional caption.');
echo light_image(
'http://www.huddletogether.com/projects/lightbox2/images/thumb-2.jpg',
'http://www.huddletogether.com/projects/lightbox2/images/image-2.jpg',
$image_options
);
?>
2 - To display a slide show of several images
'http://www.huddletogether.com/projects/lightbox2/images/thumb-3.jpg',
'image' => 'http://www.huddletogether.com/projects/lightbox2/images/image-3.jpg',
'options' => array('title' => 'Roll over and click right side of image to move forward.')
);
$images[] = array(
'thumbnail' => 'http://www.huddletogether.com/projects/lightbox2/images/thumb-4.jpg',
'image' => 'http://www.huddletogether.com/projects/lightbox2/images/image-4.jpg',
'options' => array('title' => 'Alternatively you can press the right arrow key.')
);
$images[] = array(
'thumbnail' => 'http://www.huddletogether.com/projects/lightbox2/images/thumb-5.jpg',
'image' => 'http://www.huddletogether.com/projects/lightbox2/images/image-5.jpg',
'options' => array('title' => 'The script preloads the next image in the set as you\'re viewing.')
);
$images[] = array(
'thumbnail' => 'http://www.huddletogether.com/projects/lightbox2/images/thumb-6.jpg',
'image' => 'http://www.huddletogether.com/projects/lightbox2/images/image-6.jpg',
'options' => array('title' => 'Press Esc to close')
);
$link_options = array(
'title' => 'Lightbox2',
'slidename' => 'lightbox',
);
echo light_slideshow($images, $link_options);
?>
3 - To display a modal box with the content of the result of a symfony action
'sfLightboxPlugin',
'size' => '450x180',
'speed' => '5'
);
// or
//$link_options='title=sfLightboxPlugin size=450x180 speed=5';
//$link_options='title="sfLightboxPlugin" class=resizespeed_5 blocksize_450x180';
echo light_modallink('» Link to test the modal box «
', 'sfLightboxPlugin/modal', $link_options);
?>
Of course here i use external images, but you can put path related to your images directory as you would do with the imag_tag function.
You can change the class or options to adjust the wanted size or speed. Of course you can use a route instead of a 'module/action'. The demo above does exactly the same as the official homepage of the Lightbox2 library, moreover the plugin includes this 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.
That's all, ;)
Versions
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).
1.0.0