diff --git a/lightbox2.module b/lightbox2.module index 2fd65aca502c479327143c6e4a77d467ebdcc88e..21785c04a548c3b49f0d8b2fe83064cfd522b736 100644 --- a/lightbox2.module +++ b/lightbox2.module @@ -22,178 +22,121 @@ function lightbox2_help($path, $arg) { switch ($path) { case 'admin/modules#description': - return t('Enables Lightbox2 for Drupal'); + $output = t('Enables Lightbox2 for Drupal'); + break; case 'admin/help#lightbox2': - return t('

Overview

-

Lightbox2 JS is a simple, unobtrusive script used to overlay images on the current page. It\'s a snap to setup and works on all modern browsers. The module comes with a Lightbox2 Lite option which does not use the JQuery libraries; it is therefore less likely to conflict with anything else.

-

Places images above your current page, not within. This frees you from the constraints of the layout, particularly column widths. Keeps users on the same page. Clicking to view an image and then having to click the back button to return to your site is bad for continuity (and no fun!).

-

Features

-The version 2 module has several benefits over the plain Lightbox module. Note, not all of these features are available when the "Lightbox2 Lite" option is enabled. - -

Usage

-
Adding a Basic Lightbox
-

Add rel="lightbox" attribute to any link tag to activate the lightbox. For example:

-

<a href="image-1.jpg" rel="lightbox">image #1</a>

-

<a href="image-1.jpg" rel="lightbox[][my caption]">image #1</a>

-

Optional: To show a caption either use the title attribute or put in the second set of [] of the rel attribute.

-
Grouping Images
-

If you have a set of related images that you would like to group, follow - step one but additionally include a group name between square brackets in the - rel attribute. For example:

<a href="images/image-1.jpg" - rel="lightbox[roadtrip]">image #1</a>
-<a href="images/image-2.jpg" rel="lightbox[roadtrip][caption 2]">image -#2</a>
-<a href="images/image-3.jpg" rel="lightbox[roadtrip][caption 3]">image -#3</a>

-

No limits to the number of image sets per page or how many images are allowed -in each set.

- -

If you have a set of images that you would like to group together in a lightbox, but only wish for one of these images to be visible on your page, you can assign the "lightbox_hide_image" class to hide the additional images. For example:

- -

<a href="images/image-1.jpg" rel="lightbox[roadtrip]">image #1</a>
-<a href="images/image-2.jpg" rel="lightbox[roadtrip]" class="lightbox_hide_image">image #2</a>
-<a href="images/image-3.jpg" rel="lightbox[roadtrip][caption 3]" class="lightbox_hide_image">image #3</a>

- -
Slideshow
-

This is very similar to the grouping functionality described above. The only difference is that "rel" attribute should be set to "lightshow" instead of "lightbox". Using the same example as above, we could launch the images in a slideshow by doing:

- -

<a href="images/image-1.jpg" rel="lightshow[roadtrip]">image #1</a>
-<a href="images/image-2.jpg" rel="lightshow[roadtrip][caption 2]">image #2</a>
-<a href="images/image-3.jpg" rel="lightshow[roadtrip][caption 3]">image #3</a>

- -
Video Content
-

-It\'s possible to show video content in the lightbox. In this case the "rel" attribute should be set to lightvideo. It\'s possible to group videos and to control the size of the lightbox by setting the \'width\' and \'height\' properties. The properties can be configured like lightvideo[group|width:300px; height: 200px;] and lightvideo[|width:300px; height: 200px;][my caption]. The properties should all be of the format "property: value;" - note the closing semi-colon. If no properties are set, then the default width and height of 400px will be used. See below for more detailed examples.

- -

Basic example:
- -<a href="http://video.google.com/videoplay?docid=1811233136844420765" rel="lightvideo">Google video example - default size</a>
-

- -

Basic example with caption:
- -<a href="http://video.google.com/videoplay?docid=1811233136844420765" rel="lightvideo[][my caption]">Google video example - default size</a>
-

- -

Grouped example:
- -<a href="http://video.google.com/videoplay?docid=29023498723974239479" rel="lightvideo[group][my caption]">Grouped example 1</a>
-<a href="http://video.google.com/videoplay?docid=1811233136844420765" rel="lightvideo[group][my caption]">Grouped example 2</a>
-

- -

Controlling lightbox size example:
- -<a href="http://video.google.com/videoplay?docid=1811233136844420765" rel="lightvideo[|width:400px; height:300px;][my caption]">Google video example - custom size</a>
-

- -

Supported Video Formats
-asx, wmv, mov and swf videos should all be supported. A number of video providers are also supported, for example YouTube and Google Video. For full details on how to integrate these with lightbox, please see the online documentation.

- -
HTML Content
-

It\'s possible to show webpage content in the lightbox, using iframes. In this case the "rel" attribute should be set to lightframe. Again it\'s possible to group the items, (e.g. lightframe[search]) but in addition to that, it\'s possible to control some of the iframe properties. It\'s possible to set the \'width\', \'height\' and \'scrolling\' properties of the iframe. The properties are separated from the group name by a |, for example lightframe[search|width:100px;] and lightframe[search|width:120px][my caption]. If no grouping is being used, then the | is still used and the format would be lightframe[|width:100px;]. The properties should all be of the format "property: value;" - note the closing semi-colon. If no iframe properties are set, then the default width and height of 400px will be used. See below for more detailed examples.

- -

Basic example:
- -<a href="http://www.google.com" rel="lightframe[][Search Google]">Search google</a> -

- -

Grouped example:
- -<a href="http://www.google.com" rel="lightframe[search]">Search google</a>
-<a href="http://www.yahoo.com" rel="lightframe[search][Search Yahoo]">Search yahoo</a> -

- -

Controlling iframe property example:
- -<a href="http://www.google.com" rel="lightframe[|width:400px; height:300px; scrolling: auto;]">Search google</a> -

- -

Controlling iframe property when grouped example:
- -<a href="http://www.google.com" rel="lightframe[search|width:400px; height:300px; scrolling: auto;]">Search google</a>
-<a href="http://www.yahoo.com" rel="lightframe[search|width:400px; height:300px;][Search Yahoo]">Search yahoo</a> -

- -
Inline Content Support
-

It\'s possible to show HTML snippets in the lightbox, that is on the same domain. In this case the "rel" attribute should be set to lightmodal. Again it\'s possible to group the content, (e.g. lightmodal[search]) but in addition to that, it\'s possible to control some of the inline / modal properties. It\'s possible to set the \'width\', \'height\' and \'scrolling\' properties of the inline content. The properties are separated from the group name by a |, for example lightmodal[search|width:100px;] and lightmodal[search|width:100px;][my caption]. If no grouping is being used, then the | is still used and the format would be lightmodal[|width:100px;]. The properties should all be of the format "property: value;" - note the closing semi-colon. If no properties are set, then the default width and height of 400px will be used. See below for more detailed examples.

- -

Basic example:
- -<a href="search.php" rel="lightmodal">Search</a> -

- -

Basic example with caption:
- -<a href="search.php" rel="lightmodal[][my caption]">Search</a> -

- -

Grouped example:
- -<a href="search.php" rel="lightmodal[search]">Search</a>
-<a href="search.php?status=1" rel="lightmodal[search][published]">Search published content</a> -

- -

Controlling modal property example:
- -<a href="search.php" rel="lightmodal[|width:400px; height:300px; scrolling: auto;]">Search</a> -

- -

Controlling modal property when grouped example:
- -<a href="search.php" rel="lightmodal[search|width:400px; height:300px; scrolling: auto;]">Search</a>
-<a href="search.php?status=1" rel="lightmodal[search|width:400px; height:300px;][Search published]">Search published content</a>
-<a href="search.php?status=0" rel="lightmodal[search|width:400px; height:300px;][Search Unpublished]">Search unpublished content</a> -

- - -

Keyboard Shortcuts

-

The default keyboard shortcuts are listed below. You can override these on the admin page. - - - - - - - - - - - - - - - - -
Close Lightboxx
o
c
ESC
Previous Imagep
Left Arrow
Next Imagen
Right Arrow
Toggle Zoomz (not available in slideshow)
Toggle Play / PauseSpacebar (slideshow only)
- -

Not all of the keyboard shortcuts work in the Opera browser, for example "z" for toggling the zoom and "spacebar" for toggling play / pause in slideshows. This can be overcome by updating your shortcut settings in the Opera preferences editor.

-'); + $output = '

'. t('Overview') .'

'; + $output .= '

'. t('Lightbox2 JS is a simple, unobtrusive script used to overlay images on the current page. It\'s a snap to setup and works on all modern browsers. The module comes with a Lightbox2 Lite option which does not use the JQuery libraries; it is therefore less likely to conflict with anything else.') .'

'; + $output .= '

'. t('Places images above your current page, not within. This frees you from the constraints of the layout, particularly column widths. Keeps users on the same page. Clicking to view an image and then having to click the back button to return to your site is bad for continuity (and no fun!).') .'

'; + // Features + $output .= '

'. t('Features') .'

'; + $output .= '

'. t('The version 2 module has several benefits over the plain Lightbox module. Note, not all of these features are available when the "Lightbox2 Lite" option is enabled.') .'

'; + $output .= ''; + // Usage + $output .= '

'. t('Usage') .'

'; + $output .= '
'. t('Adding a Basic Lightbox') .'
'; + $output .= '

'. t('Add rel="lightbox" attribute to any link tag to activate the lightbox. For example:') .'

'; + $output .= ''. t('<a href="image-1.jpg" rel="lightbox">image #1</a>
+ <a href="image-1.jpg" rel="lightbox[][my caption]">image #1</a>') .'
'; + $output .= '

'. t('Optional: To show a caption either use the title attribute or put in the second set of [] of the rel attribute.') .'

'; + // Grouping Images + $output .= '
'. t('Grouping Images') .'
'; + $output .= '

'. t('If you have a set of related images that you would like to group, follow step one but additionally include a group name between square brackets in the rel attribute. For example:') .'

'; + $output .= ''. t('<a href="images/image-1.jpg" rel="lightbox[roadtrip]">image #1</a>
+ <a href="images/image-2.jpg" rel="lightbox[roadtrip][caption 2]">image#2</a>
+ <a href="images/image-3.jpg" rel="lightbox[roadtrip][caption 3]">image#3</a>') .'
'; + $output .= '

'. t('No limits to the number of image sets per page or how many images are allowed in each set.') .'

'; + $output .= '

'. t('If you have a set of images that you would like to group together in a lightbox, but only wish for one of these images to be visible on your page, you can assign the "lightbox_hide_image" class to hide the additional images. For example:') .'

'; + $output .= '

'. t('<a href="images/image-1.jpg" rel="lightbox[roadtrip]">image #1</a>
+ <a href="images/image-2.jpg" rel="lightbox[roadtrip]" class="lightbox_hide_image">image #2</a>
+ <a href="images/image-3.jpg" rel="lightbox[roadtrip][caption 3]" class="lightbox_hide_image">image #3</a>') .'

'; + // Slideshow + $output .= '
'. t('Slideshow') .'
'; + $output .= '

'. t('This is very similar to the grouping functionality described above. The only difference is that "rel" attribute should be set to "lightshow" instead of "lightbox". Using the same example as above, we could launch the images in a slideshow by doing:') .'

'; + $output .= '

'. t('<a href="images/image-1.jpg" rel="lightshow[roadtrip]">image #1</a>
+ <a href="images/image-2.jpg" rel="lightshow[roadtrip][caption 2]">image #2</a>
+ <a href="images/image-3.jpg" rel="lightshow[roadtrip][caption 3]">image #3</a>') .'

'; + // Video Content + $output .= '
'. t('Video Content') .'
'; + $output .= '

'. t('It\'s possible to show video content in the lightbox. In this case the "rel" attribute should be set to lightvideo. It\'s possible to group videos and to control the size of the lightbox by setting the \'width\' and \'height\' properties. The properties can be configured like lightvideo[group|width:300px; height: 200px;] and lightvideo[|width:300px; height: 200px;][my caption]. The properties should all be of the format "property: value;" - note the closing semi-colon. If no properties are set, then the default width and height of 400px will be used. See below for more detailed examples.') .'

'; + $output .= '

'. t('Basic example:') .'
'; + $output .= ''. t('<a href="http://video.google.com/videoplay?docid=1811233136844420765" rel="lightvideo">Google video example - default size</a>') .'

'; + $output .= '

'. t('Basic example with caption:') .'
'; + $output .= ''. t('<a href="http://video.google.com/videoplay?docid=1811233136844420765" rel="lightvideo[][my caption]">Google video example - default size</a>') .'

'; + $output .= '

'. t('Grouped example:') .'
'; + $output .= ''. t('<a href="http://video.google.com/videoplay?docid=29023498723974239479" rel="lightvideo[group][my caption]">Grouped example 1</a>
+ <a href="http://video.google.com/videoplay?docid=1811233136844420765" rel="lightvideo[group][my caption]">Grouped example 2</a>') .'

'; + $output .= '

'. t('Controlling lightbox size example:') .'
'; + $output .= ''. t('<a href="http://video.google.com/videoplay?docid=1811233136844420765" rel="lightvideo[|width:400px; height:300px;][my caption]">Google video example - custom size</a>') .'

'; + $output .= '

'. t('Supported Video Formats:') .'
'; + $output .= t('asx, wmv, mov and swf videos should all be supported. A number of video providers are also supported, for example YouTube and Google Video. For full details on how to integrate these with lightbox, please see the online documentation.') .'

'; + // HTML Content + $output .= '
'. t('HTML Content') .'
'; + $output .= '

'. t('It\'s possible to show webpage content in the lightbox, using iframes. In this case the "rel" attribute should be set to lightframe. Again it\'s possible to group the items, (e.g. lightframe[search]) but in addition to that, it\'s possible to control some of the iframe properties. It\'s possible to set the \'width\', \'height\' and \'scrolling\' properties of the iframe. The properties are separated from the group name by a |, for example lightframe[search|width:100px;] and lightframe[search|width:120px][my caption]. If no grouping is being used, then the | is still used and the format would be lightframe[|width:100px;]. The properties should all be of the format "property: value;" - note the closing semi-colon. If no iframe properties are set, then the default width and height of 400px will be used. See below for more detailed examples.') .'

'; + $output .= '

'. t('Basic example:') .'
'; + $output .= ''. t('<a href="http://www.google.com" rel="lightframe[][Search Google]">Search google</a>') .'

'; + $output .= '

'. t('Grouped example:') .'
'; + $output .= ''. t('<a href="http://www.google.com" rel="lightframe[search]">Search google</a>
+ <a href="http://www.yahoo.com" rel="lightframe[search][Search Yahoo]">Search yahoo</a>') .'

'; + $output .= '

'. t('Controlling iframe property example:') .'
'; + $output .= ''. t('<a href="http://www.google.com" rel="lightframe[|width:400px; height:300px; scrolling: auto;]">Search google</a>') .'

'; + $output .= '

'. t('Controlling iframe property when grouped example:') .'
'; + $output .= ''. t('<a href="http://www.google.com" rel="lightframe[search|width:400px; height:300px; scrolling: auto;]">Search google</a>
+ <a href="http://www.yahoo.com" rel="lightframe[search|width:400px; height:300px;][Search Yahoo]">Search yahoo</a>') .'

'; + // Inline Content Support + $output .= '
'. t('Inline Content Support') .'
'; + $output .= '

'. t('It\'s possible to show HTML snippets in the lightbox, that is on the same domain. In this case the "rel" attribute should be set to lightmodal. Again it\'s possible to group the content, (e.g. lightmodal[search]) but in addition to that, it\'s possible to control some of the inline / modal properties. It\'s possible to set the \'width\', \'height\' and \'scrolling\' properties of the inline content. The properties are separated from the group name by a |, for example lightmodal[search|width:100px;] and lightmodal[search|width:100px;][my caption]. If no grouping is being used, then the | is still used and the format would be lightmodal[|width:100px;]. The properties should all be of the format "property: value;" - note the closing semi-colon. If no properties are set, then the default width and height of 400px will be used. See below for more detailed examples.') .'

'; + $output .= '

'. t('Basic example:') .'
'; + $output .= ''. t('<a href="search.php" rel="lightmodal">Search</a>') .'

'; + $output .= '

'. t('Basic example with caption:') .'
'; + $output .= ''. t('<a href="search.php" rel="lightmodal[][my caption]">Search</a>') .'

'; + $output .= '

'. t('Grouped example:') .'
'; + $output .= ''. t('<a href="search.php" rel="lightmodal[search]">Search</a>
+ <a href="search.php?status=1" rel="lightmodal[search][published]">Search published content</a>') .'

'; + $output .= '

'. t('Controlling modal property example:') .'
'; + $output .= ''. t('<a href="search.php" rel="lightmodal[|width:400px; height:300px; scrolling: auto;]">Search</a>') .'

'; + $output .= '

'. t('Controlling modal property when grouped example:') .'
'; + $output .= ''. t('<a href="search.php" rel="lightmodal[search|width:400px; height:300px; scrolling: auto;]">Search</a>
+ <a href="search.php?status=1" rel="lightmodal[search|width:400px; height:300px;][Search published]">Search published content</a>
+ <a href="search.php?status=0" rel="lightmodal[search|width:400px; height:300px;][Search Unpublished]">Search unpublished content</a>') .'

'; + // Keyboard Shortcuts + $output .= '

'. t('Keyboard Shortcuts') .'

'; + $output .= '

'. t('The default keyboard shortcuts are listed below. You can override these on the admin page.') .'

'; + $output .= ''; + $output .= ''; + $output .= ' + + '; + $output .= ''; + $output .= ''; + $output .= ''; + $output .= ''; + $output .= ''; + $output .= ''; + $output .= '
'. t('Close Lightbox') .'x
o
c
ESC
'. t('Previous Image') .'p
'. t('Left Arrow') .'
'. t('Next Image') .'n
'. t('Right Arrow') .'
'. t('Toggle Zoom') .''. t('z (not available in slideshow)') .'
'. t('Toggle Play / Pause') .''. t('Spacebar (slideshow only)'). '
'; + $output .= '

'. t('Not all of the keyboard shortcuts work in the Opera browser, for example "z" for toggling the zoom and "spacebar" for toggling play / pause in slideshows. This can be overcome by updating your shortcut settings in the Opera preferences editor.') .'

'; + break; } + return !empty($output) ? $output : ''; } /**