re staged lightbox2 to git tree
339
sites/all/modules/lightbox2/LICENSE.txt
Normal file
@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
259
sites/all/modules/lightbox2/README.txt
Normal file
@ -0,0 +1,259 @@
|
||||
CONTENTS OF THIS FILE
|
||||
----------------------
|
||||
|
||||
* Introduction
|
||||
* Installation
|
||||
* Adding Lightbox Functionality to your Images
|
||||
- No Grouping
|
||||
- With Grouping
|
||||
- Slideshow
|
||||
- Video
|
||||
- HTML Content Support
|
||||
- Inline Content Support
|
||||
- Turning the Image Caption into a Link
|
||||
* Keyboard Shortcuts
|
||||
* Translation of Configured Strings
|
||||
* Known Issues
|
||||
- Keyboard Shortcuts in Opera
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
Maintainers:
|
||||
Stella Power (http://drupal.org/user/66894)
|
||||
Daniel F. Kudwien (http://drupal.org/user/54136)
|
||||
Mark Ashmead (http://drupal.org/user/52392)
|
||||
Fernando Correa da Conceição (http://drupal.org/user/889254)
|
||||
|
||||
Documentation: http://drupal.org/node/144469
|
||||
|
||||
Licensed under the GNU/GPL License
|
||||
Based on Lightbox v2.03.3 by Lokesh Dhakar
|
||||
<http://www.huddletogether.com/projects/lightbox2/>
|
||||
|
||||
Originally written to make use of the Prototype framework, and Script.acalo.us,
|
||||
now altered to use jQuery.
|
||||
|
||||
Permission has been granted to Mark Ashmead & other Drupal Lightbox2 module
|
||||
maintainers to distribute the original lightbox.js via Drupal.org under this
|
||||
license scheme. This file has been subsequently modified to make use of jQuery
|
||||
instead of prototype / script.acalo.us.
|
||||
|
||||
This module enables the use of lightbox2 which places images above your
|
||||
current page, not within. This frees you from the constraints of the layout,
|
||||
particularly column widths.
|
||||
|
||||
This module will include the lightbox CSS and JS files in your Drupal
|
||||
Installation without the need to edit the theme. 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.
|
||||
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
1. Copy lightbox2 folder to modules directory.
|
||||
2. At admin/build/modules enable the lightbox2 module.
|
||||
3. Enable permissions at admin/user/permissions.
|
||||
4. Configure the module at admin/settings/lightbox2.
|
||||
5. Modify your image links to open in a lightbox where necessary, see "Adding
|
||||
Lightbox Functionality to your Images' section below.
|
||||
6. If you need to play flv files, then you may need to install a FLV player.
|
||||
There are a number of freely available ones on the Internet, including
|
||||
http://www.jeroenwijering.com/
|
||||
|
||||
|
||||
ADDING LIGHTBOX FUNCTIONALITY TO YOUR IMAGES
|
||||
--------------------------------------------
|
||||
No Grouping
|
||||
===========
|
||||
Add rel="lightbox" attribute to any link tag to activate the lightbox.
|
||||
For example:
|
||||
<a href="images/image-1.jpg" rel="lightbox">image #1</a>
|
||||
<a href="images/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.
|
||||
|
||||
With Grouping
|
||||
==============
|
||||
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. Go nuts!
|
||||
|
||||
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]" 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
|
||||
=====
|
||||
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][caption 1]">Grouped example 1</a>
|
||||
<a href="http://video.google.com/videoplay?docid=1811233136844420765"
|
||||
rel="lightvideo[group][caption 2]">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 Support
|
||||
====================
|
||||
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 content, (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:100px;][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</a>
|
||||
|
||||
Basic example with caption:
|
||||
<a href="http://www.google.com" rel="lightframe[][my caption]">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]">Search google</a>
|
||||
<a href="http://www.yahoo.com" rel="lightframe[search|width:400px; height:300px;]">Search yahoo</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>
|
||||
|
||||
|
||||
|
||||
Turning the Image Caption into a Link
|
||||
=====================================
|
||||
If you wish to turn the caption into a link, format your caption in the
|
||||
following way:
|
||||
|
||||
<a href="images/image-1.jpg" rel="lightbox[][<a href=\"http://www.yourlink.com\">Clicky Visit Link</a>'>image #1</a>
|
||||
|
||||
Note, the < and > characters have been changed to their HTML entities, and the "
|
||||
have been escaped.
|
||||
|
||||
|
||||
KEYBOARD SHORTCUTS
|
||||
------------------
|
||||
Not all of the default 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.
|
||||
|
||||
The default keyboard shortcuts are listed below. You can override these on
|
||||
admin/settings/lightbox2.
|
||||
|
||||
Close : x, o, c, ESC
|
||||
Previous Image : p, Left Arrow
|
||||
Next Image : n, Right Arrow
|
||||
Toggle Zoom : z (not available in slideshow)
|
||||
Toggle Play / Pause : Spacebar (slideshow only)
|
||||
|
||||
|
||||
TRANSLATION OF CONFIGURED STRINGS
|
||||
----------------------------------
|
||||
In order to translate the lightbox2 configuration strings, such as the text for
|
||||
the "View Image Details" link and the image count, please install the i18n:
|
||||
internationalization module and follow the instructions at
|
||||
http://drupal.org/node/134002.
|
||||
|
||||
|
||||
KNOWN ISSUES
|
||||
------------
|
||||
|
||||
Keyboard Shortcuts in Opera
|
||||
---------------------------
|
||||
Not all of the default 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.
|
22
sites/all/modules/lightbox2/TODO.txt
Normal file
@ -0,0 +1,22 @@
|
||||
Drupal 7 port
|
||||
|
||||
Works
|
||||
* Add a image with rel="lightbox"
|
||||
* Add a image group with rel="lightbox[group]"
|
||||
* Slideshow using rel="lightshow[group]"
|
||||
* HTML content using rel="lightframe"
|
||||
* Modal with rel="lightmodal", and with settings, show a blank screen if
|
||||
the url address is invalid(404 error)
|
||||
|
||||
Integration with external modules
|
||||
* acidvideo - There is not a drupal 7 version
|
||||
|
||||
Not tested
|
||||
* Video using rel=lightshow
|
||||
|
||||
To do
|
||||
* Add a description in hook_permission
|
||||
* This is many filters without any action, look if this is really necessaary,
|
||||
if not, remove the ones without action
|
||||
|
||||
|
62
sites/all/modules/lightbox2/css/lightbox-rtl.css
Normal file
@ -0,0 +1,62 @@
|
||||
/* $Id: lightbox-rtl.css,v 1.1.2.18 2010/06/07 14:43:02 snpower Exp $ */
|
||||
|
||||
#imageData #imageDetails {
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* Image location mod */
|
||||
#bottomNavClose {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#bottomNavZoom,
|
||||
#bottomNavZoomOut {
|
||||
left: -30px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#lightshowPlay,
|
||||
#lightshowPause {
|
||||
float: left;
|
||||
margin-right: 0px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
#prevLink, #nextLink {
|
||||
width: 49%;
|
||||
height: 100%;
|
||||
background: transparent url(../images/blank.gif) no-repeat; /* Trick IE into showing hover */
|
||||
display: block;
|
||||
}
|
||||
|
||||
#prevLink, #framePrevLink {
|
||||
left: auto;
|
||||
right: 0;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#nextLink, #frameNextLink {
|
||||
right: auto;
|
||||
left: 0;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#prevLink:hover, #prevLink:visited:hover, #prevLink.force_show_nav, #framePrevLink {
|
||||
background: url(../images/next.gif) right 15% no-repeat;
|
||||
}
|
||||
|
||||
#nextLink:hover, #nextLink:visited:hover, #nextLink.force_show_nav, #frameNextLink {
|
||||
background: url(../images/prev.gif) left 15% no-repeat;
|
||||
}
|
||||
|
||||
#prevLink:hover.force_show_nav, #prevLink:visited:hover.force_show_nav,
|
||||
#framePrevLink:hover, #framePrevLink:visited:hover {
|
||||
background: url(../images/next_hover.gif) right 15% no-repeat;
|
||||
}
|
||||
|
||||
#nextLink:hover.force_show_nav, #nextLink:visited:hover.force_show_nav,
|
||||
#frameNextLink:hover, #frameNextLink:visited:hover {
|
||||
background: url(../images/prev_hover.gif) left 15% no-repeat;
|
||||
}
|
||||
|
284
sites/all/modules/lightbox2/css/lightbox.css
Normal file
@ -0,0 +1,284 @@
|
||||
/* $Id: lightbox.css,v 1.1.4.28 2010/09/22 10:47:15 snpower Exp $ */
|
||||
#lightbox {
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 100;
|
||||
text-align: center;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
#lightbox a img {
|
||||
border: none;
|
||||
}
|
||||
|
||||
#outerImageContainer {
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
width: 250px;
|
||||
height: 250px;
|
||||
margin: 0 auto;
|
||||
min-width: 240px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#imageContainer, #frameContainer, #modalContainer {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#modalContainer {
|
||||
line-height: 1em;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#loading {
|
||||
height: 25%;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
line-height: 0;
|
||||
position: absolute;
|
||||
top: 40%;
|
||||
left: 45%;
|
||||
/* left: 0%; */
|
||||
}
|
||||
|
||||
#hoverNav {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
#imageContainer>#hoverNav {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
#frameHoverNav {
|
||||
z-index: 10;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 20%;
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
height: 45px;
|
||||
}
|
||||
|
||||
#imageData>#frameHoverNav {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
#hoverNav a, #frameHoverNav a {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#prevLink, #nextLink {
|
||||
width: 49%;
|
||||
height: 100%;
|
||||
background: transparent url(../images/blank.gif) no-repeat; /* Trick IE into showing hover */
|
||||
display: block;
|
||||
}
|
||||
|
||||
#prevLink, #framePrevLink {
|
||||
left: 0;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#nextLink, #frameNextLink {
|
||||
right: 0;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#prevLink:hover, #prevLink:visited:hover, #prevLink.force_show_nav, #framePrevLink {
|
||||
background: url(../images/prev.gif) left 15% no-repeat;
|
||||
}
|
||||
|
||||
#nextLink:hover, #nextLink:visited:hover, #nextLink.force_show_nav, #frameNextLink {
|
||||
background: url(../images/next.gif) right 15% no-repeat;
|
||||
}
|
||||
|
||||
#prevLink:hover.force_show_nav, #prevLink:visited:hover.force_show_nav,
|
||||
#framePrevLink:hover, #framePrevLink:visited:hover {
|
||||
background: url(../images/prev_hover.gif) left 15% no-repeat;
|
||||
}
|
||||
|
||||
#nextLink:hover.force_show_nav, #nextLink:visited:hover.force_show_nav,
|
||||
#frameNextLink:hover, #frameNextLink:visited:hover {
|
||||
background: url(../images/next_hover.gif) right 15% no-repeat;
|
||||
}
|
||||
|
||||
#framePrevLink, #frameNextLink {
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
}
|
||||
|
||||
#imageDataContainer {
|
||||
font: 10px Verdana, Helvetica, sans-serif;
|
||||
background-color: #fff;
|
||||
margin: 0 auto;
|
||||
line-height: 1.4em;
|
||||
min-width: 240px;
|
||||
}
|
||||
|
||||
#imageData {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
#imageData #imageDetails {
|
||||
width: 70%;
|
||||
float: left;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#imageData #caption {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#imageData #numberDisplay {
|
||||
display: block;
|
||||
clear: left;
|
||||
padding-bottom: 1.0em;
|
||||
}
|
||||
|
||||
#imageData #lightbox2-node-link-text {
|
||||
display: block;
|
||||
padding-bottom: 1.0em;
|
||||
}
|
||||
|
||||
#imageData #bottomNav {
|
||||
height: 66px;
|
||||
}
|
||||
.lightbox2-alt-layout #imageData #bottomNav,
|
||||
.lightbox2-alt-layout-data #bottomNav {
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
|
||||
#lightbox2-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 90;
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
#overlay_default {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
#overlay_macff2 {
|
||||
background: transparent url(../images/overlay.png) repeat;
|
||||
}
|
||||
|
||||
.clearfix:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
height: 0;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
* html>body .clearfix {
|
||||
display: inline;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
* html .clearfix {
|
||||
/* Hides from IE-mac \*/
|
||||
height: 1%;
|
||||
/* End hide from IE-mac */
|
||||
}
|
||||
|
||||
|
||||
/* Image location mod */
|
||||
#bottomNavClose {
|
||||
display: block;
|
||||
background: url(../images/close.gif) left no-repeat;
|
||||
margin-top: 33px;
|
||||
float: right;
|
||||
padding-top: 0.7em;
|
||||
height: 26px;
|
||||
width: 26px;
|
||||
}
|
||||
|
||||
#bottomNavClose:hover {
|
||||
background-position: right;
|
||||
}
|
||||
|
||||
#loadingLink {
|
||||
display: block;
|
||||
background: url(../images/loading.gif) no-repeat;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
#bottomNavZoom {
|
||||
display: none;
|
||||
background: url(../images/expand.gif) no-repeat;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
position: relative;
|
||||
left: 30px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#bottomNavZoomOut {
|
||||
display: none;
|
||||
background: url(../images/contract.gif) no-repeat;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
position: relative;
|
||||
left: 30px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#lightshowPlay {
|
||||
margin-top: 42px;
|
||||
float: right;
|
||||
margin-right: 5px;
|
||||
margin-bottom: 1px;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
background: url(../images/play.png) no-repeat;
|
||||
}
|
||||
|
||||
#lightshowPause {
|
||||
margin-top: 42px;
|
||||
float: right;
|
||||
margin-right: 5px;
|
||||
margin-bottom: 1px;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
background: url(../images/pause.png) no-repeat;
|
||||
}
|
||||
|
||||
.lightbox2-alt-layout-data #bottomNavClose,
|
||||
.lightbox2-alt-layout #bottomNavClose {
|
||||
margin-top: 93px;
|
||||
}
|
||||
.lightbox2-alt-layout-data #bottomNavZoom,
|
||||
.lightbox2-alt-layout-data #bottomNavZoomOut,
|
||||
.lightbox2-alt-layout #bottomNavZoom,
|
||||
.lightbox2-alt-layout #bottomNavZoomOut {
|
||||
margin-top: 93px;
|
||||
}
|
||||
.lightbox2-alt-layout-data #lightshowPlay,
|
||||
.lightbox2-alt-layout-data #lightshowPause,
|
||||
.lightbox2-alt-layout #lightshowPlay,
|
||||
.lightbox2-alt-layout #lightshowPause {
|
||||
margin-top: 102px;
|
||||
}
|
||||
|
||||
.lightbox_hide_image {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#lightboxImage {
|
||||
-ms-interpolation-mode: bicubic;
|
||||
}
|
230
sites/all/modules/lightbox2/css/lightbox_alt.css
Normal file
@ -0,0 +1,230 @@
|
||||
/* $Id: lightbox_alt.css,v 1.1.4.22 2010/09/22 10:47:15 snpower Exp $ */
|
||||
/**
|
||||
* Based on a design created by Nicolas Borda:
|
||||
* http://www.ipwa.net/assets/myslimbox/
|
||||
*/
|
||||
|
||||
#lightbox {
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 100;
|
||||
text-align: center;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
#lightbox a img {
|
||||
border: none;
|
||||
}
|
||||
|
||||
#outerImageContainer {
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
width: 250px;
|
||||
height: 250px;
|
||||
margin: 0 auto;
|
||||
min-width: 240px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#imageContainer, #frameContainer, #modalContainer {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#modalContainer {
|
||||
line-height: 1em;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#loading {
|
||||
height: 25%;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
line-height: 0;
|
||||
position: absolute;
|
||||
top: 40%;
|
||||
left: 45%;
|
||||
*left: 0%;
|
||||
}
|
||||
|
||||
#hoverNav {
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
#imageData>#hoverNav {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
#hoverNav a {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#prevLink, #nextLink {
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#prevLink {
|
||||
left: 0;
|
||||
float: left;
|
||||
background: url(../images/prev_alt.gif) left 15% no-repeat;
|
||||
}
|
||||
|
||||
#nextLink {
|
||||
right: 0;
|
||||
float: right;
|
||||
background: url(../images/next_alt.gif) right 15% no-repeat;
|
||||
}
|
||||
|
||||
#prevLink:hover, #prevLink:visited:hover {
|
||||
background-position: right 15%;
|
||||
}
|
||||
|
||||
#nextLink:hover, #nextLink:visited:hover {
|
||||
background-position: left 15%;
|
||||
}
|
||||
|
||||
#imageDataContainer {
|
||||
font: 10px Verdana, Helvetica, sans-serif;
|
||||
background-color: #fff;
|
||||
margin: 0 auto;
|
||||
line-height: 1.4em;
|
||||
min-width: 240px;
|
||||
}
|
||||
|
||||
#imageData {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
#imageData #imageDetails {
|
||||
width: 70%;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#imageData #caption {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#imageData #numberDisplay {
|
||||
display: block;
|
||||
padding-bottom: 1.0em;
|
||||
}
|
||||
|
||||
#imageData #lightbox2-node-link-text {
|
||||
display: block;
|
||||
padding-bottom: 1.0em;
|
||||
}
|
||||
|
||||
#lightbox2-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 90;
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
#overlay_default {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
#overlay_macff2 {
|
||||
background: transparent url(../images/overlay.png) repeat;
|
||||
}
|
||||
|
||||
|
||||
.clearfix:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
height: 0;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
* html>body .clearfix {
|
||||
display: inline;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
* html .clearfix {
|
||||
/* Hides from IE-mac \*/
|
||||
height: 1%;
|
||||
/* End hide from IE-mac */
|
||||
}
|
||||
|
||||
|
||||
/* Image location mod */
|
||||
#bottomNavClose {
|
||||
display: block;
|
||||
z-index: 200;
|
||||
background: url(../images/close.gif) left no-repeat;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
height: 26px;
|
||||
width: 26px;
|
||||
}
|
||||
|
||||
#bottomNavClose:hover {
|
||||
background-position: right;
|
||||
}
|
||||
|
||||
#loadingLink {
|
||||
display: block;
|
||||
background: url(../images/loading.gif) no-repeat;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
#bottomNavZoom {
|
||||
display: block;
|
||||
background: url(../images/expand.gif) no-repeat;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
position: absolute;
|
||||
bottom: 25px;
|
||||
right: 5px;
|
||||
}
|
||||
|
||||
#bottomNavZoomOut {
|
||||
display: block;
|
||||
background: url(../images/contract.gif) no-repeat;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
position: absolute;
|
||||
bottom: 25px;
|
||||
right: 5px;
|
||||
}
|
||||
|
||||
#lightshowPlay {
|
||||
background: url(../images/play.png) no-repeat;
|
||||
display: block;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
margin-bottom: 5px;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
#lightshowPause {
|
||||
background: url(../images/pause.png) no-repeat;
|
||||
display: block;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
margin-bottom: 5px;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.lightbox_hide_image {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#lightboxImage {
|
||||
-ms-interpolation-mode: bicubic;
|
||||
}
|
60
sites/all/modules/lightbox2/css/lightbox_lite-rtl.css
Normal file
@ -0,0 +1,60 @@
|
||||
/* $Id: lightbox_lite-rtl.css,v 1.1.2.6 2010/06/07 14:54:30 snpower Exp $ */
|
||||
#lightbox {
|
||||
background-color: #eee;
|
||||
padding: 10px;
|
||||
border-bottom: 2px solid #666;
|
||||
border-right: 2px solid #666;
|
||||
min-width: 240px;
|
||||
}
|
||||
|
||||
#lightboxDetails {
|
||||
font-size: 1.2em;
|
||||
padding-top: 0.6em;
|
||||
min-width: 240px;
|
||||
}
|
||||
|
||||
#lightboxCaption {
|
||||
float: right;
|
||||
font: 0.9em black;
|
||||
}
|
||||
|
||||
#keyboardMsg {
|
||||
float: left;
|
||||
font: 0.9em black;
|
||||
}
|
||||
|
||||
#closeButton {
|
||||
top: 5px;
|
||||
right: 5px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
z-index: 200;
|
||||
background: url(../images/close_lite.gif) no-repeat;
|
||||
}
|
||||
|
||||
#loadingImage {
|
||||
position: absolute;
|
||||
top: 30%;
|
||||
left: 45%;
|
||||
height: 25%;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
line-height: 0;
|
||||
background: url(../images/loading_lite.gif) no-repeat;
|
||||
width: 126px;
|
||||
height: 22px;
|
||||
z-index: 150;
|
||||
}
|
||||
|
||||
#lightbox img {
|
||||
border: none;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#lightbox2-overlay {
|
||||
background-color: #333;
|
||||
opacity: 0.6;
|
||||
filter:alpha(opacity=60);
|
||||
}
|
||||
|
60
sites/all/modules/lightbox2/css/lightbox_lite.css
Normal file
@ -0,0 +1,60 @@
|
||||
/* $Id: lightbox_lite.css,v 1.1.4.11 2010/06/07 14:54:30 snpower Exp $ */
|
||||
#lightbox {
|
||||
background-color: #eee;
|
||||
padding: 10px;
|
||||
border-bottom: 2px solid #666;
|
||||
border-right: 2px solid #666;
|
||||
min-width: 240px;
|
||||
}
|
||||
|
||||
#lightboxDetails {
|
||||
font-size: 1.2em;
|
||||
padding-top: 0.6em;
|
||||
min-width: 240px;
|
||||
}
|
||||
|
||||
#lightboxCaption {
|
||||
float: left;
|
||||
font: 0.9em black;
|
||||
}
|
||||
|
||||
#keyboardMsg {
|
||||
float: right;
|
||||
font: 0.9em black;
|
||||
}
|
||||
|
||||
#closeButton {
|
||||
top: 5px;
|
||||
right: 5px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
z-index: 200;
|
||||
background: url(../images/close_lite.gif) no-repeat;
|
||||
}
|
||||
|
||||
#loadingImage {
|
||||
position: absolute;
|
||||
top: 30%;
|
||||
left: 45%;
|
||||
height: 25%;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
line-height: 0;
|
||||
background: url(../images/loading_lite.gif) no-repeat;
|
||||
width: 126px;
|
||||
height: 22px;
|
||||
z-index: 150;
|
||||
}
|
||||
|
||||
#lightbox img {
|
||||
border: none;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#lightbox2-overlay {
|
||||
background-color: #333;
|
||||
opacity: 0.6;
|
||||
filter:alpha(opacity=60);
|
||||
}
|
||||
|
BIN
sites/all/modules/lightbox2/images/blank.gif
Normal file
After Width: | Height: | Size: 43 B |
BIN
sites/all/modules/lightbox2/images/brokenimage.jpg
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
sites/all/modules/lightbox2/images/close.gif
Normal file
After Width: | Height: | Size: 388 B |
BIN
sites/all/modules/lightbox2/images/close_hover.gif
Normal file
After Width: | Height: | Size: 308 B |
BIN
sites/all/modules/lightbox2/images/close_lite.gif
Normal file
After Width: | Height: | Size: 109 B |
BIN
sites/all/modules/lightbox2/images/closelabel.gif
Normal file
After Width: | Height: | Size: 979 B |
BIN
sites/all/modules/lightbox2/images/contract.gif
Normal file
After Width: | Height: | Size: 213 B |
BIN
sites/all/modules/lightbox2/images/expand.gif
Normal file
After Width: | Height: | Size: 209 B |
BIN
sites/all/modules/lightbox2/images/loading.gif
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
sites/all/modules/lightbox2/images/loading_lite.gif
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
sites/all/modules/lightbox2/images/next.gif
Normal file
After Width: | Height: | Size: 305 B |
BIN
sites/all/modules/lightbox2/images/next_alt.gif
Normal file
After Width: | Height: | Size: 297 B |
BIN
sites/all/modules/lightbox2/images/next_hover.gif
Normal file
After Width: | Height: | Size: 322 B |
BIN
sites/all/modules/lightbox2/images/nextlabel.gif
Normal file
After Width: | Height: | Size: 354 B |
BIN
sites/all/modules/lightbox2/images/overlay.png
Normal file
After Width: | Height: | Size: 279 B |
BIN
sites/all/modules/lightbox2/images/pause.png
Normal file
After Width: | Height: | Size: 364 B |
BIN
sites/all/modules/lightbox2/images/play.png
Normal file
After Width: | Height: | Size: 645 B |
BIN
sites/all/modules/lightbox2/images/prev.gif
Normal file
After Width: | Height: | Size: 307 B |
BIN
sites/all/modules/lightbox2/images/prev_alt.gif
Normal file
After Width: | Height: | Size: 265 B |
BIN
sites/all/modules/lightbox2/images/prev_hover.gif
Normal file
After Width: | Height: | Size: 277 B |
BIN
sites/all/modules/lightbox2/images/prevlabel.gif
Normal file
After Width: | Height: | Size: 371 B |
226
sites/all/modules/lightbox2/js/auto_image_handling.js
Normal file
@ -0,0 +1,226 @@
|
||||
// Image Node Auto-Format with Auto Image Grouping.
|
||||
// Original version by Steve McKenzie.
|
||||
// Altered by Stella Power for jQuery version.
|
||||
|
||||
(function ($) {
|
||||
|
||||
function parse_url(url, param) {
|
||||
param = param.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
|
||||
url = url.replace(/&/, "&");
|
||||
var regexS = "[\\?&]"+param+"=([^&#]*)";
|
||||
var regex = new RegExp(regexS);
|
||||
var results = regex.exec(url);
|
||||
if (results === null) {
|
||||
return "";
|
||||
}
|
||||
else {
|
||||
return results[1];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function lightbox2_init_triggers(classes, rel_type, custom_class) {
|
||||
if (classes == '' || rel_type == 0) {
|
||||
return;
|
||||
}
|
||||
var settings = Drupal.settings.lightbox2;
|
||||
|
||||
var link_target = "";
|
||||
if (settings.node_link_target !== 0) {
|
||||
link_target = 'target="'+ settings.node_link_target +'"';
|
||||
}
|
||||
|
||||
$("a:has("+classes+")").each(function(i) {
|
||||
if ((!settings.disable_for_gallery_lists && !settings.disable_for_acidfree_gallery_lists) || (!$(this).parents("td.giAlbumCell").attr("class") && !$(this).parents(".galleries").length && !$(this).parents(".acidfree-folder").length && !$(this).parents(".acidfree-list").length) || ($(this).parents(".galleries").length && !settings.disable_for_gallery_lists) || (($(this).parents(".acidfree-folder").length || $(this).parents(".acidfree-list").length) && !settings.disable_for_acidfree_gallery_lists)) {
|
||||
var child = $(this).find(classes);
|
||||
// Ensure the child has a class attribute we can work with.
|
||||
if ($(child).attr("class")) {
|
||||
// Set the alt text.
|
||||
var alt = $(child).attr("alt");
|
||||
if (!alt) {
|
||||
alt = "";
|
||||
}
|
||||
|
||||
// Set the image node link text.
|
||||
var link_text = settings.node_link_text;
|
||||
var download_link_text = settings.download_link_text;
|
||||
var rewrite = 1;
|
||||
|
||||
// Set the rel attribute.
|
||||
var rel = "lightbox";
|
||||
var lightframe = false;
|
||||
if (rel_type == "lightframe_ungrouped") {
|
||||
rel = "lightframe[]";
|
||||
lightframe = true;
|
||||
}
|
||||
else if (rel_type == "lightframe") {
|
||||
lightframe = true;
|
||||
}
|
||||
else if (rel_type == "lightbox_ungrouped") {
|
||||
rel = "lightbox[]";
|
||||
}
|
||||
if (rel_type != "lightbox_ungrouped" && rel_type != "lightframe_ungrouped") {
|
||||
rel = rel_type + "[" + $(child).attr("class") + "]";
|
||||
}
|
||||
|
||||
// Set the basic href attribute - need to ensure there's no language
|
||||
// string (e.g. /en) prepended to the URL.
|
||||
var id = null;
|
||||
var href = $(child).attr("src");
|
||||
var download = null;
|
||||
var orig_href = $(this).attr("href");
|
||||
var pattern = new RegExp(settings.file_path);
|
||||
if (orig_href.match(pattern)) {
|
||||
var lang_pattern = new RegExp(Drupal.settings.basePath + "\\w\\w\\/");
|
||||
orig_href = orig_href.replace(lang_pattern, Drupal.settings.basePath);
|
||||
}
|
||||
var frame_href = orig_href;
|
||||
// Handle flickr images.
|
||||
if ($(child).attr("class").match("flickr-photo-img") ||
|
||||
$(child).attr("class").match("flickr-photoset-img")) {
|
||||
href = $(child).attr("src").replace("_s.", ".").replace("_t.", ".").replace("_m.", ".").replace("_b.", ".");
|
||||
if (rel_type != "lightbox_ungrouped" && rel_type != "lightframe_ungrouped") {
|
||||
rel = rel_type + "[flickr]";
|
||||
if ($(child).parents("div.block-flickr").attr("class")) {
|
||||
id = $(child).parents("div.block-flickr").attr("id");
|
||||
rel = rel_type + "["+ id +"]";
|
||||
}
|
||||
}
|
||||
download = href;
|
||||
}
|
||||
|
||||
// Handle "image-img_assist_custom" images.
|
||||
else if ($(child).filter("img[class*=img_assist_custom]").size()) {
|
||||
// Image assist uses "+" signs for spaces which doesn't work for
|
||||
// normal links.
|
||||
if (settings.display_image_size != "original") {
|
||||
orig_href = orig_href.replace(/\+/, " ");
|
||||
href = $(child).attr("src").replace(new RegExp("\\.img_assist_custom-[0-9]+x[0-9]+"), ((settings.display_image_size === "")?settings.display_image_size:"."+ settings.display_image_size));
|
||||
if (rel_type != "lightbox_ungrouped" && rel_type != "lightframe_ungrouped") {
|
||||
rel = rel_type + "[node_images]";
|
||||
}
|
||||
if (lightframe) {
|
||||
frame_href = orig_href + "/lightbox2";
|
||||
}
|
||||
}
|
||||
else {
|
||||
rewrite = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle "inline" images.
|
||||
else if ($(child).attr("class").match("inline")) {
|
||||
href = orig_href;
|
||||
}
|
||||
|
||||
// Handle gallery2 block images.
|
||||
else if ($(child).attr("class").match("ImageFrame_image") || $(child).attr("class").match("ImageFrame_none")) {
|
||||
var thumb_id = parse_url(href, "g2_itemId");
|
||||
var new_id = parse_url(orig_href, "g2_itemId");
|
||||
if (new_id && thumb_id) {
|
||||
var g2pattern = new RegExp("g2_itemId="+thumb_id);
|
||||
var replacement = "g2_itemId="+ new_id;
|
||||
href = href.replace(g2pattern, replacement);
|
||||
}
|
||||
rel = rel_type + "[gallery2]";
|
||||
if ($(child).parents("div.block-gallery").attr("class")) {
|
||||
id = $(child).parents("div.block-gallery").attr("id");
|
||||
rel = rel_type + "["+ id +"]";
|
||||
}
|
||||
download = href;
|
||||
}
|
||||
|
||||
|
||||
// Set the href attribute.
|
||||
else if (settings.image_node_sizes != '()' && !custom_class) {
|
||||
if (settings.display_image_size != "original") {
|
||||
href = $(child).attr("src").replace(new RegExp(settings.image_node_sizes), ((settings.display_image_size === "")?settings.display_image_size:"."+ settings.display_image_size)).replace(/(image\/view\/\d+)(\/[\w\-]*)/, ((settings.display_image_size === "")?"$1/_original":"$1/"+ settings.display_image_size));
|
||||
if (rel_type != "lightbox_ungrouped" && rel_type != "lightframe_ungrouped") {
|
||||
rel = rel_type + "[node_images]";
|
||||
if ($(child).parents("div.block-multiblock,div.block-image").attr("class")) {
|
||||
id = $(child).parents("div.block-multiblock,div.block-image").attr("id");
|
||||
rel = rel_type + "["+ id +"]";
|
||||
}
|
||||
}
|
||||
download = $(child).attr("src").replace(new RegExp(settings.image_node_sizes), "").replace(/(image\/view\/\d+)(\/[\w\-]*)/, "$1/_original");
|
||||
if (lightframe) {
|
||||
frame_href = orig_href + "/lightbox2";
|
||||
}
|
||||
}
|
||||
else {
|
||||
rewrite = 0;
|
||||
}
|
||||
}
|
||||
// Modify the image url.
|
||||
var img_title = $(child).attr("title");
|
||||
if (!img_title) {
|
||||
img_title = $(this).attr("title");
|
||||
if (!img_title) {
|
||||
img_title = $(child).attr("alt");
|
||||
}
|
||||
$(child).attr({title: img_title});
|
||||
}
|
||||
if (lightframe) {
|
||||
href = frame_href;
|
||||
}
|
||||
if (rewrite) {
|
||||
if (!custom_class) {
|
||||
var title_link = "";
|
||||
if (link_text.length) {
|
||||
title_link = "<br /><br /><a href=\"" + orig_href + "\" id=\"lightbox2-node-link-text\" "+ link_target +" >"+ link_text + "</a>";
|
||||
}
|
||||
if (download_link_text.length && download) {
|
||||
title_link = title_link + " - <a href=\"" + download + "\" id=\"lightbox2-download-link-text\" target=\"_blank\">" + download_link_text + "</a>";
|
||||
}
|
||||
rel = rel + "[" + img_title + title_link + "]";
|
||||
$(this).attr({
|
||||
rel: rel,
|
||||
href: href
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (rel_type != "lightbox_ungrouped" && rel_type != "lightframe_ungrouped") {
|
||||
rel = rel_type + "[" + $(child).attr("class") + "]";
|
||||
if ($(child).parents("div.block-image").attr("class")) {
|
||||
id = $(child).parents("div.block-image").attr("id");
|
||||
rel = rel_type + "["+ id +"]";
|
||||
}
|
||||
}
|
||||
rel = rel + "[" + img_title + "]";
|
||||
$(this).attr({
|
||||
rel: rel,
|
||||
href: orig_href
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function lightbox2_image_nodes() {
|
||||
var settings = Drupal.settings.lightbox2;
|
||||
|
||||
// Don't do it on the image assist popup selection screen.
|
||||
var img_assist = document.getElementById("img_assist_thumbs");
|
||||
if (!img_assist) {
|
||||
|
||||
// Select the enabled image types.
|
||||
lightbox2_init_triggers(settings.trigger_lightbox_classes, "lightbox_ungrouped");
|
||||
lightbox2_init_triggers(settings.custom_trigger_classes, settings.custom_class_handler, true);
|
||||
lightbox2_init_triggers(settings.trigger_lightbox_group_classes, "lightbox");
|
||||
lightbox2_init_triggers(settings.trigger_slideshow_classes, "lightshow");
|
||||
lightbox2_init_triggers(settings.trigger_lightframe_classes, "lightframe_ungrouped");
|
||||
lightbox2_init_triggers(settings.trigger_lightframe_group_classes, "lightframe");
|
||||
}
|
||||
}
|
||||
|
||||
Drupal.behaviors.initAutoLightbox = {
|
||||
attach: function(context, settings) {
|
||||
lightbox2_image_nodes();
|
||||
}
|
||||
};
|
||||
|
||||
//End jQuery block
|
||||
}(jQuery));
|
136
sites/all/modules/lightbox2/js/builder.js
Normal file
@ -0,0 +1,136 @@
|
||||
// script.aculo.us builder.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
|
||||
|
||||
// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||
//
|
||||
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
||||
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
||||
|
||||
var Builder = {
|
||||
NODEMAP: {
|
||||
AREA: 'map',
|
||||
CAPTION: 'table',
|
||||
COL: 'table',
|
||||
COLGROUP: 'table',
|
||||
LEGEND: 'fieldset',
|
||||
OPTGROUP: 'select',
|
||||
OPTION: 'select',
|
||||
PARAM: 'object',
|
||||
TBODY: 'table',
|
||||
TD: 'table',
|
||||
TFOOT: 'table',
|
||||
TH: 'table',
|
||||
THEAD: 'table',
|
||||
TR: 'table'
|
||||
},
|
||||
// note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken,
|
||||
// due to a Firefox bug
|
||||
node: function(elementName) {
|
||||
elementName = elementName.toUpperCase();
|
||||
|
||||
// try innerHTML approach
|
||||
var parentTag = this.NODEMAP[elementName] || 'div';
|
||||
var parentElement = document.createElement(parentTag);
|
||||
try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
|
||||
parentElement.innerHTML = "<" + elementName + "></" + elementName + ">";
|
||||
} catch(e) {}
|
||||
var element = parentElement.firstChild || null;
|
||||
|
||||
// see if browser added wrapping tags
|
||||
if(element && (element.tagName.toUpperCase() != elementName))
|
||||
element = element.getElementsByTagName(elementName)[0];
|
||||
|
||||
// fallback to createElement approach
|
||||
if(!element) element = document.createElement(elementName);
|
||||
|
||||
// abort if nothing could be created
|
||||
if(!element) return;
|
||||
|
||||
// attributes (or text)
|
||||
if(arguments[1])
|
||||
if(this._isStringOrNumber(arguments[1]) ||
|
||||
(arguments[1] instanceof Array) ||
|
||||
arguments[1].tagName) {
|
||||
this._children(element, arguments[1]);
|
||||
} else {
|
||||
var attrs = this._attributes(arguments[1]);
|
||||
if(attrs.length) {
|
||||
try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
|
||||
parentElement.innerHTML = "<" +elementName + " " +
|
||||
attrs + "></" + elementName + ">";
|
||||
} catch(e) {}
|
||||
element = parentElement.firstChild || null;
|
||||
// workaround firefox 1.0.X bug
|
||||
if(!element) {
|
||||
element = document.createElement(elementName);
|
||||
for(attr in arguments[1])
|
||||
element[attr == 'class' ? 'className' : attr] = arguments[1][attr];
|
||||
}
|
||||
if(element.tagName.toUpperCase() != elementName)
|
||||
element = parentElement.getElementsByTagName(elementName)[0];
|
||||
}
|
||||
}
|
||||
|
||||
// text, or array of children
|
||||
if(arguments[2])
|
||||
this._children(element, arguments[2]);
|
||||
|
||||
return element;
|
||||
},
|
||||
_text: function(text) {
|
||||
return document.createTextNode(text);
|
||||
},
|
||||
|
||||
ATTR_MAP: {
|
||||
'className': 'class',
|
||||
'htmlFor': 'for'
|
||||
},
|
||||
|
||||
_attributes: function(attributes) {
|
||||
var attrs = [];
|
||||
for(attribute in attributes)
|
||||
attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) +
|
||||
'="' + attributes[attribute].toString().escapeHTML().gsub(/"/,'"') + '"');
|
||||
return attrs.join(" ");
|
||||
},
|
||||
_children: function(element, children) {
|
||||
if(children.tagName) {
|
||||
element.appendChild(children);
|
||||
return;
|
||||
}
|
||||
if(typeof children=='object') { // array can hold nodes and text
|
||||
children.flatten().each( function(e) {
|
||||
if(typeof e=='object')
|
||||
element.appendChild(e)
|
||||
else
|
||||
if(Builder._isStringOrNumber(e))
|
||||
element.appendChild(Builder._text(e));
|
||||
});
|
||||
} else
|
||||
if(Builder._isStringOrNumber(children))
|
||||
element.appendChild(Builder._text(children));
|
||||
},
|
||||
_isStringOrNumber: function(param) {
|
||||
return(typeof param=='string' || typeof param=='number');
|
||||
},
|
||||
build: function(html) {
|
||||
var element = this.node('div');
|
||||
$(element).update(html.strip());
|
||||
return element.down();
|
||||
},
|
||||
dump: function(scope) {
|
||||
if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope
|
||||
|
||||
var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " +
|
||||
"BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " +
|
||||
"FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+
|
||||
"KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+
|
||||
"PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+
|
||||
"TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);
|
||||
|
||||
tags.each( function(tag){
|
||||
scope[tag] = function() {
|
||||
return Builder.node.apply(Builder, [tag].concat($A(arguments)));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
1122
sites/all/modules/lightbox2/js/effects.js
vendored
Normal file
1195
sites/all/modules/lightbox2/js/lightbox.js
Normal file
192
sites/all/modules/lightbox2/js/lightbox2.js
Normal file
@ -0,0 +1,192 @@
|
||||
/* $Id: lightbox2.js,v 1.1.4.39 2010/06/07 15:24:24 snpower Exp $ */
|
||||
|
||||
// start jQuery block
|
||||
(function ($) {
|
||||
|
||||
function alt_layout_handler(event) {
|
||||
if ($("input[name=lightbox2_lite]:checked").val() != 1) {
|
||||
if ($("input[name=lightbox2_use_alt_layout]:checked").val() == 1) {
|
||||
$("input[name=lightbox2_force_show_nav]").attr("disabled", "disabled");
|
||||
}
|
||||
else {
|
||||
$("input[name=lightbox2_force_show_nav]").removeAttr("disabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function zoom_handler(event) {
|
||||
if ($("input[name=lightbox2_disable_resize]:checked").val() == 1) {
|
||||
$("input[name=lightbox2_disable_zoom]").attr("disabled", "disabled");
|
||||
}
|
||||
else {
|
||||
$("input[name=lightbox2_disable_zoom]").removeAttr("disabled");
|
||||
}
|
||||
}
|
||||
|
||||
function lightbox2_lite_general_handler(event) {
|
||||
// Enable / disable the non-lightbox2-lite options.
|
||||
if ($("input[name=lightbox2_lite]:checked").val() == 1) {
|
||||
$("input[name=lightbox2_use_alt_layout]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_force_show_nav]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_loop_items]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_disable_resize]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_disable_zoom]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_enable_video]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_enable_login]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_enable_contact]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_node_link_text]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_download_link_text]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_node_link_target]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_image_count_str]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_video_count_str]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_page_count_str]").attr("disabled", "disabled");
|
||||
$("select[name=lightbox2_display_image_size]").attr("disabled", "disabled");
|
||||
$("select[name='lightbox2_trigger_image_size[]']").attr("disabled", "disabled");
|
||||
$("select[name=lightbox2_image_ncck_group_node_id]").attr("disabled", "disabled");
|
||||
$("select[name=lightbox2_imagefield_group_node_id]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_imagefield_use_node_title]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_disable_close_click]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_border_size]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_box_color]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_font_color]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_top_position]").attr("disabled", "disabled");
|
||||
$("select[name=lightbox2_resize_sequence]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_resize_speed]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_fadein_speed]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_slidedown_speed]").attr("disabled", "disabled");
|
||||
}
|
||||
else {
|
||||
$("input[name=lightbox2_use_alt_layout]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_force_show_nav]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_loop_items]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_disable_resize]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_disable_zoom]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_node_link_text]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_download_link_text]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_node_link_target]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_enable_video]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_enable_login]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_enable_contact]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_image_count_str]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_video_count_str]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_page_count_str]").removeAttr("disabled");
|
||||
$("select[name=lightbox2_display_image_size]").removeAttr("disabled");
|
||||
$("select[name='lightbox2_trigger_image_size[]']").removeAttr("disabled");
|
||||
$("select[name=lightbox2_image_ncck_group_node_id]").removeAttr("disabled");
|
||||
$("select[name=lightbox2_imagefield_group_node_id]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_imagefield_use_node_title]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_disable_close_click]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_border_size]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_box_color]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_font_color]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_top_position]").removeAttr("disabled");
|
||||
$("select[name=lightbox2_resize_sequence]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_resize_speed]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_fadein_speed]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_slidedown_speed]").removeAttr("disabled");
|
||||
alt_layout_handler();
|
||||
zoom_handler();
|
||||
}
|
||||
}
|
||||
|
||||
function image_node_handler(event) {
|
||||
// Image node, flickr, gallery2, inline and custom images stuff.
|
||||
if ($("input[name=lightbox2_lite]").val() != 1) {
|
||||
// Image node only stuff.
|
||||
if ($("select[name=lightbox2_image_node]").val() !== 0) {
|
||||
$("input[name=lightbox2_disable_nested_galleries]").removeAttr("disabled");
|
||||
$("select[name=lightbox2_display_image_size]").removeAttr("disabled");
|
||||
$("select[name='lightbox2_trigger_image_size[]']").removeAttr("disabled");
|
||||
}
|
||||
else {
|
||||
$("input[name=lightbox2_disable_nested_galleries]").attr("disabled", "disabled");
|
||||
$("select[name=lightbox2_display_image_size]").attr("disabled", "disabled");
|
||||
$("select[name='lightbox2_trigger_image_size[]']").attr("disabled", "disabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function lightbox2_lite_auto_handler(event) {
|
||||
// Enable / disable the image node options.
|
||||
if ($("input[name=lightbox2_lite]").val() == 1) {
|
||||
// Disable iframe options.
|
||||
$("input[name=lightbox2_default_frame_width]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_default_frame_height]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_frame_border]").attr("disabled", "disabled");
|
||||
|
||||
// Disable slideshow options.
|
||||
$("input[name=lightbox2_slideshow_interval]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_slideshow_automatic_start]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_slideshow_automatic_exit]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_slideshow_show_play_pause]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_slideshow_pause_on_next_click]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_slideshow_pause_on_previous_click]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_loop_slides]").attr("disabled", "disabled");
|
||||
|
||||
// Disable automatic image handling options.
|
||||
$("select[name=lightbox2_image_node]").attr("disabled", "disabled");
|
||||
$("select[name=lightbox2_display_image_size]").attr("disabled", "disabled");
|
||||
$("select[name='lightbox2_trigger_image_size[]']").attr("disabled", "disabled");
|
||||
$("select[name=lightbox2_flickr]").attr("disabled", "disabled");
|
||||
$("select[name=lightbox2_gallery2_blocks]").attr("disabled", "disabled");
|
||||
$("select[name=lightbox2_image_assist_custom]").attr("disabled", "disabled");
|
||||
$("select[name=lightbox2_inline]").attr("disabled", "disabled");
|
||||
$("select[name=lightbox2_custom_class_handler]").attr("disabled", "disabled");
|
||||
$("textarea[name=lightbox2_custom_trigger_classes]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_disable_nested_galleries]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_disable_nested_acidfree_galleries]").attr("disabled", "disabled");
|
||||
$("input[name=lightbox2_enable_acidfree_videos]").attr("disabled", "disabled");
|
||||
}
|
||||
else {
|
||||
// Enable iframe options.
|
||||
$("input[name=lightbox2_default_frame_width]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_default_frame_height]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_frame_border]").removeAttr("disabled");
|
||||
|
||||
// Enable slideshow options.
|
||||
$("input[name=lightbox2_slideshow_interval]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_slideshow_automatic_start]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_slideshow_automatic_exit]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_slideshow_show_play_pause]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_slideshow_pause_on_next_click]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_slideshow_pause_on_previous_click]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_loop_slides]").removeAttr("disabled");
|
||||
|
||||
// Enable automatic image handling options.
|
||||
$("select[name=lightbox2_image_node]").removeAttr("disabled");
|
||||
$("select[name=lightbox2_flickr]").removeAttr("disabled");
|
||||
$("select[name=lightbox2_gallery2_blocks]").removeAttr("disabled");
|
||||
$("select[name=lightbox2_image_assist_custom]").removeAttr("disabled");
|
||||
$("select[name=lightbox2_inline]").removeAttr("disabled");
|
||||
$("select[name=lightbox2_custom_class_handler]").removeAttr("disabled");
|
||||
$("textarea[name=lightbox2_custom_trigger_classes]").removeAttr("disabled");
|
||||
$("select[name=lightbox2_display_image_size]").removeAttr("disabled");
|
||||
$("select[name='lightbox2_trigger_image_size[]']").removeAttr("disabled");
|
||||
$("input[name=lightbox2_disable_nested_galleries]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_disable_nested_acidfree_galleries]").removeAttr("disabled");
|
||||
$("input[name=lightbox2_enable_acidfree_videos]").removeAttr("disabled");
|
||||
image_node_handler();
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
// Handle lightbox2_settings_form.
|
||||
lightbox2_lite_general_handler();
|
||||
lightbox2_lite_auto_handler();
|
||||
image_node_handler();
|
||||
$("input[name=lightbox2_lite]").bind("click", lightbox2_lite_general_handler);
|
||||
$("input[name=lightbox2_use_alt_layout]").bind("click", alt_layout_handler);
|
||||
$("input[name=lightbox2_disable_resize]").bind("click", zoom_handler);
|
||||
$("select[name=lightbox2_image_node]").bind("click", image_node_handler);
|
||||
$("select[name=lightbox2_flickr]").bind("click", image_node_handler);
|
||||
$("select[name=lightbox2_gallery2_blocks]").bind("click", image_node_handler);
|
||||
$("select[name=lightbox2_image_assist_custom]").bind("click", image_node_handler);
|
||||
$("select[name=lightbox2_inline]").bind("click", image_node_handler);
|
||||
$("select[name=lightbox2_custom_class_handler]").bind("change", image_node_handler);
|
||||
$("textarea[name=lightbox2_custom_trigger_classes]").bind("change", image_node_handler);
|
||||
});
|
||||
|
||||
//End jQuery block
|
||||
}(jQuery));
|
||||
|
||||
|
394
sites/all/modules/lightbox2/js/lightbox_lite.js
Normal file
@ -0,0 +1,394 @@
|
||||
/* $Id: lightbox_lite.js,v 1.1.2.2.2.19 2010/06/07 14:54:30 snpower Exp $ */
|
||||
|
||||
/**
|
||||
* Lightbox JS: Fullsize Image Overlays
|
||||
* by Lokesh Dhakar - http://www.huddletogether.com
|
||||
*
|
||||
* For more information on this script, visit:
|
||||
* http://huddletogether.com/projects/lightbox/
|
||||
*
|
||||
* This script is distributed via Drupal.org with permission from Lokesh Dhakar.
|
||||
* Under GPL license.
|
||||
* Mailto: bugzie@gmail.com
|
||||
*/
|
||||
|
||||
// start jQuery block
|
||||
(function ($) {
|
||||
//
|
||||
// getPageScroll()
|
||||
// Returns array with x,y page scroll values.
|
||||
// Core code from - quirksmode.org
|
||||
//
|
||||
function getPageScroll() {
|
||||
|
||||
var xScroll, yScroll;
|
||||
|
||||
if (self.pageYOffset) {
|
||||
yScroll = self.pageYOffset;
|
||||
xScroll = self.pageXOffset;
|
||||
|
||||
// Explorer 6 Strict
|
||||
}
|
||||
else if (document.documentElement && document.documentElement.scrollTop) {
|
||||
yScroll = document.documentElement.scrollTop;
|
||||
xScroll = document.documentElement.scrollLeft;
|
||||
}
|
||||
else if (document.body) {// all other Explorers
|
||||
yScroll = document.body.scrollTop;
|
||||
xScroll = document.body.scrollLeft;
|
||||
}
|
||||
|
||||
arrayPageScroll = [xScroll, yScroll];
|
||||
return arrayPageScroll;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// getPageSize()
|
||||
// Returns array with page width, height and window width, height
|
||||
// Core code from - quirksmode.org
|
||||
// Edit for Firefox by pHaez
|
||||
function getPageSize() {
|
||||
|
||||
var xScroll, yScroll;
|
||||
|
||||
if (window.innerHeight && window.scrollMaxY) {
|
||||
xScroll = window.innerWidth + window.scrollMaxX;
|
||||
yScroll = window.innerHeight + window.scrollMaxY;
|
||||
// all but Explorer Mac
|
||||
}
|
||||
else if (document.body.scrollHeight > document.body.offsetHeight) {
|
||||
xScroll = document.body.scrollWidth;
|
||||
yScroll = document.body.scrollHeight;
|
||||
// Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
|
||||
}
|
||||
else {
|
||||
xScroll = document.body.offsetWidth;
|
||||
yScroll = document.body.offsetHeight;
|
||||
}
|
||||
|
||||
var windowWidth, windowHeight;
|
||||
if (self.innerHeight) { // all except Explorer
|
||||
if (document.documentElement.clientHeight) {
|
||||
windowWidth = document.documentElement.clientWidth;
|
||||
}
|
||||
else {
|
||||
windowWidth = self.innerWidth;
|
||||
}
|
||||
windowHeight = self.innerHeight;
|
||||
}
|
||||
else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
|
||||
windowWidth = document.documentElement.clientWidth;
|
||||
windowHeight = document.documentElement.clientHeight;
|
||||
}
|
||||
else if (document.body) { // other Explorers
|
||||
windowWidth = document.body.clientWidth;
|
||||
windowHeight = document.body.clientHeight;
|
||||
}
|
||||
|
||||
// for small pages with total height less then height of the viewport
|
||||
if (yScroll < windowHeight) {
|
||||
pageHeight = windowHeight;
|
||||
}
|
||||
else {
|
||||
pageHeight = yScroll;
|
||||
}
|
||||
|
||||
// for small pages with total width less then width of the viewport
|
||||
if (xScroll < windowWidth) {
|
||||
pageWidth = xScroll;
|
||||
}
|
||||
else {
|
||||
pageWidth = windowWidth;
|
||||
}
|
||||
|
||||
|
||||
arrayPageSize = [pageWidth, pageHeight, windowWidth, windowHeight];
|
||||
return arrayPageSize;
|
||||
}
|
||||
|
||||
|
||||
// pause(numberMillis)
|
||||
function pause(ms) {
|
||||
var date = new Date();
|
||||
var curDate = null;
|
||||
do { curDate = new Date(); }
|
||||
while (curDate - date < ms);
|
||||
}
|
||||
|
||||
// hideLightbox()
|
||||
function hideLightbox() {
|
||||
// get objects
|
||||
objOverlay = document.getElementById('lightbox2-overlay');
|
||||
objLightbox = document.getElementById('lightbox');
|
||||
|
||||
// hide lightbox and overlay
|
||||
objOverlay.style.display = 'none';
|
||||
objLightbox.style.display = 'none';
|
||||
|
||||
// make select boxes visible
|
||||
selects = document.getElementsByTagName("select");
|
||||
for (i = 0; i != selects.length; i++) {
|
||||
if (selects[i].style.display != "none") {
|
||||
selects[i].style.visibility = "visible";
|
||||
}
|
||||
}
|
||||
|
||||
// make flash objects visible
|
||||
embed = document.getElementsByTagName("embed");
|
||||
for (i = 0; i != embed.length; i++) {
|
||||
if (embed[i].style.display != "none") {
|
||||
embed[i].style.visibility = "visible";
|
||||
}
|
||||
}
|
||||
objects = document.getElementsByTagName("object");
|
||||
for (i = 0; i != objects.length; i++) {
|
||||
if (objects[i].style.display != "none") {
|
||||
objects[i].style.visibility = "visible";
|
||||
}
|
||||
}
|
||||
|
||||
// disable keydown listener
|
||||
document.onkeydown = '';
|
||||
}
|
||||
|
||||
|
||||
// getKey(key)
|
||||
// Gets keycode. If 'x' is pressed then it hides the lightbox.
|
||||
function getKey(e) {
|
||||
if (e === null) { // ie
|
||||
keycode = event.keyCode;
|
||||
escapeKey = 27;
|
||||
}
|
||||
else { // mozilla
|
||||
keycode = e.keyCode;
|
||||
escapeKey = e.DOM_VK_ESCAPE;
|
||||
}
|
||||
key = String.fromCharCode(keycode).toLowerCase();
|
||||
|
||||
if (key == 'x' || key == 'c' || keycode == escapeKey) { hideLightbox(); }
|
||||
}
|
||||
|
||||
|
||||
// listenKey()
|
||||
function listenKey () { document.onkeydown = getKey; }
|
||||
|
||||
|
||||
function imgLoadingError(image, objImage, objLink) {
|
||||
var settings = Drupal.settings.lightbox2;
|
||||
image.src = settings.default_image;
|
||||
objImage.src = settings.default_image;
|
||||
objLink.href = settings.default_image;
|
||||
}
|
||||
|
||||
|
||||
// showLightbox()
|
||||
// Preloads images. Pleaces new image in lightbox then centers and displays.
|
||||
function showLightbox(objLink) {
|
||||
var settings = Drupal.settings.lightbox2;
|
||||
// prep objects
|
||||
var objOverlay = document.getElementById('lightbox2-overlay');
|
||||
var objLightbox = document.getElementById('lightbox');
|
||||
var objCaption = document.getElementById('lightboxCaption');
|
||||
var objImage = document.getElementById('lightboxImage');
|
||||
var objLoadingImage = document.getElementById('loadingImage');
|
||||
var objLightboxDetails = document.getElementById('lightboxDetails');
|
||||
|
||||
var arrayPageSize = getPageSize();
|
||||
var arrayPageScroll = getPageScroll();
|
||||
|
||||
// set height of Overlay to take up whole page and show
|
||||
objOverlay.style.height = (arrayPageSize[1] + 'px');
|
||||
objOverlay.style.display = 'block';
|
||||
objOverlay.style.opacity = settings.overlay_opacity;
|
||||
objOverlay.style.backgroundColor = '#' + settings.overlay_color;
|
||||
|
||||
// preload image
|
||||
imgPreload = new Image();
|
||||
imgPreload.onerror = function() { imgLoadingError(this, objImage, objLink); };
|
||||
|
||||
imgPreload.onload = function() {
|
||||
objImage.src = objLink.href;
|
||||
|
||||
// center lightbox and make sure that the top and left values are not
|
||||
// negative and the image placed outside the viewport
|
||||
var lightboxTop = arrayPageScroll[1] + ((arrayPageSize[3] - 35 - imgPreload.height) / 2);
|
||||
var lightboxLeft = ((arrayPageSize[0] - 20 - imgPreload.width) / 2);
|
||||
|
||||
objLightbox.style.top = (lightboxTop < 0) ? "0px" : lightboxTop + "px";
|
||||
objLightbox.style.left = (lightboxLeft < 0) ? "0px" : lightboxLeft + "px";
|
||||
|
||||
|
||||
//objLightboxDetails.style.width = imgPreload.width + 'px';
|
||||
objLightbox.style.width = imgPreload.width + 'px';
|
||||
|
||||
if (objLink.getAttribute('title')) {
|
||||
objCaption.style.display = 'block';
|
||||
//objCaption.style.width = imgPreload.width + 'px';
|
||||
objCaption.innerHTML = objLink.getAttribute('title');
|
||||
}
|
||||
else {
|
||||
objCaption.style.display = 'none';
|
||||
}
|
||||
|
||||
// A small pause between the image loading and displaying is required with
|
||||
// IE, this prevents the previous image displaying for a short burst
|
||||
// causing flicker.
|
||||
if (navigator.appVersion.indexOf("MSIE") != -1) {
|
||||
pause(250);
|
||||
}
|
||||
|
||||
if (objLoadingImage) { objLoadingImage.style.display = 'none'; }
|
||||
|
||||
// Hide select boxes as they will 'peek' through the image in IE
|
||||
selects = document.getElementsByTagName("select");
|
||||
for (i = 0; i != selects.length; i++) {
|
||||
if (selects[i].style.display != "none") {
|
||||
selects[i].style.visibility = "hidden";
|
||||
}
|
||||
}
|
||||
|
||||
// Hide flash objects as they will 'peek' through the image in IE
|
||||
embed = document.getElementsByTagName("embed");
|
||||
for (i = 0; i != embed.length; i++) {
|
||||
if (embed[i].style.display != "none") {
|
||||
embed[i].style.visibility = "hidden";
|
||||
}
|
||||
}
|
||||
objects = document.getElementsByTagName("object");
|
||||
for (i = 0; i != objects.length; i++) {
|
||||
if (objects[i].style.display != "none") {
|
||||
objects[i].style.visibility = "hidden";
|
||||
}
|
||||
}
|
||||
|
||||
objLightbox.style.display = 'block';
|
||||
|
||||
// After image is loaded, update the overlay height as the new image might
|
||||
// have increased the overall page height.
|
||||
arrayPageSize = getPageSize();
|
||||
objOverlay.style.height = (arrayPageSize[1] + 'px');
|
||||
|
||||
// Check for 'x' keydown
|
||||
listenKey();
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
imgPreload.src = objLink.href;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// initLightbox()
|
||||
// Function runs on window load, going through link tags looking for
|
||||
// rel="lightbox". These links receive onclick events that enable the lightbox
|
||||
// display for their targets. The function also inserts html markup at the top
|
||||
// of the page which will be used as a container for the overlay pattern and
|
||||
// the inline image.
|
||||
function initLightbox() {
|
||||
|
||||
if (!document.getElementsByTagName) { return; }
|
||||
var anchors = document.getElementsByTagName("a");
|
||||
|
||||
// loop through all anchor tags
|
||||
for (var i = 0; i < anchors.length; i++) {
|
||||
var anchor = anchors[i];
|
||||
var relAttribute = String(anchor.getAttribute("rel"));
|
||||
|
||||
if (anchor.getAttribute("href") && relAttribute.toLowerCase().match("lightbox")) {
|
||||
$(anchor).click(function(e) { showLightbox(this); if (e.preventDefault) { e.preventDefault(); } return false; });
|
||||
}
|
||||
}
|
||||
|
||||
// the rest of this code inserts html at the top of the page that looks like
|
||||
// this:
|
||||
// <div id="lightbox2-overlay">
|
||||
// <a href="#" onclick="hideLightbox(); return false;"><img id="loadingImage" /></a>
|
||||
// </div>
|
||||
// <div id="lightbox">
|
||||
// <a href="#" onclick="hideLightbox(); return false;" title="Click anywhere to close image">
|
||||
// <img id="closeButton" />
|
||||
// <img id="lightboxImage" />
|
||||
// </a>
|
||||
// <div id="lightboxDetails">
|
||||
// <div id="lightboxCaption"></div>
|
||||
// <div id="keyboardMsg"></div>
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
var objBody = document.getElementsByTagName("body").item(0);
|
||||
|
||||
// create overlay div and hardcode some functional styles (aesthetic styles are in CSS file)
|
||||
var objOverlay = document.createElement("div");
|
||||
objOverlay.setAttribute('id', 'lightbox2-overlay');
|
||||
objOverlay.onclick = function () { hideLightbox(); return false; };
|
||||
objOverlay.style.display = 'none';
|
||||
objOverlay.style.position = 'absolute';
|
||||
objOverlay.style.top = '0';
|
||||
objOverlay.style.left = '0';
|
||||
objOverlay.style.zIndex = '90';
|
||||
objOverlay.style.width = '100%';
|
||||
objBody.insertBefore(objOverlay, objBody.firstChild);
|
||||
|
||||
var arrayPageSize = getPageSize();
|
||||
var arrayPageScroll = getPageScroll();
|
||||
|
||||
// create loader image
|
||||
var objLoadingImage = document.createElement("span");
|
||||
objLoadingImage.setAttribute('id', 'loadingImage');
|
||||
objOverlay.appendChild(objLoadingImage);
|
||||
|
||||
// create lightbox div, same note about styles as above
|
||||
var objLightbox = document.createElement("div");
|
||||
objLightbox.setAttribute('id', 'lightbox');
|
||||
objLightbox.style.display = 'none';
|
||||
objLightbox.style.position = 'absolute';
|
||||
objLightbox.style.zIndex = '100';
|
||||
objBody.insertBefore(objLightbox, objOverlay.nextSibling);
|
||||
|
||||
// create link
|
||||
var objLink = document.createElement("a");
|
||||
objLink.setAttribute('href', '#');
|
||||
objLink.setAttribute('title', 'Click to close');
|
||||
objLink.onclick = function () { hideLightbox(); return false; };
|
||||
objLightbox.appendChild(objLink);
|
||||
|
||||
// create close button image
|
||||
var objCloseButton = document.createElement("span");
|
||||
objCloseButton.setAttribute('id', 'closeButton');
|
||||
objLink.appendChild(objCloseButton);
|
||||
|
||||
// create image
|
||||
var objImage = document.createElement("img");
|
||||
objImage.setAttribute('id', 'lightboxImage');
|
||||
objLink.appendChild(objImage);
|
||||
|
||||
// create details div, a container for the caption and keyboard message
|
||||
var objLightboxDetails = document.createElement("div");
|
||||
objLightboxDetails.setAttribute('id', 'lightboxDetails');
|
||||
objLightbox.appendChild(objLightboxDetails);
|
||||
|
||||
// create caption
|
||||
var objCaption = document.createElement("div");
|
||||
objCaption.setAttribute('id', 'lightboxCaption');
|
||||
objCaption.style.display = 'none';
|
||||
objLightboxDetails.appendChild(objCaption);
|
||||
|
||||
// create keyboard message
|
||||
var settings = Drupal.settings.lightbox2;
|
||||
var objKeyboardMsg = document.createElement("div");
|
||||
objKeyboardMsg.setAttribute('id', 'keyboardMsg');
|
||||
objKeyboardMsg.innerHTML = settings.lite_press_x_close;
|
||||
objLightboxDetails.appendChild(objKeyboardMsg);
|
||||
}
|
||||
|
||||
Drupal.behaviors.initLightbox2 = {
|
||||
attach: function(context) {
|
||||
initLightbox();
|
||||
}
|
||||
};
|
||||
|
||||
//End jQuery block
|
||||
}(jQuery));
|
37
sites/all/modules/lightbox2/js/lightbox_modal.js
Normal file
@ -0,0 +1,37 @@
|
||||
(function ($) {
|
||||
|
||||
function lightbox2_login() {
|
||||
|
||||
$("a[href*='/user/login'], a[href*='?q=user/login']").each(function() {
|
||||
$(this).attr({
|
||||
href: this.href.replace(/user\/login?/,"user/login/lightbox2"),
|
||||
rel: 'lightmodal[|width:250px; height:210px;]'
|
||||
});
|
||||
$(this).addClass('lightmodal-login');
|
||||
});
|
||||
}
|
||||
|
||||
function lightbox2_contact() {
|
||||
$("a[href$='/contact'], a[href$='?q=contact']").each(function() {
|
||||
if (!this.href.match('admin/build/contact')) {
|
||||
$(this).attr({
|
||||
href: this.href.replace(/contact?/,"contact/lightbox2"),
|
||||
rel: 'lightmodal[|width:450px; height:450px;]'
|
||||
});
|
||||
$(this).addClass('lightmodal-contact');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Drupal.behaviors.initLightboxModal = {
|
||||
attach: function(context, settings) {
|
||||
if (settings.lightbox2.enable_login) {
|
||||
lightbox2_login();
|
||||
}
|
||||
if (settings.lightbox2.enable_contact) {
|
||||
lightbox2_contact();
|
||||
}
|
||||
}
|
||||
};
|
||||
//End jQuery block
|
||||
}(jQuery));
|
213
sites/all/modules/lightbox2/js/lightbox_video.js
Normal file
@ -0,0 +1,213 @@
|
||||
/* $Id: lightbox_video.js,v 1.1.4.20 2010/09/21 17:57:22 snpower Exp $ */
|
||||
|
||||
/**
|
||||
* Lightbox video
|
||||
* @author
|
||||
* Stella Power, <http://drupal.org/user/66894>
|
||||
*/
|
||||
var Lightvideo;
|
||||
|
||||
// start jQuery block
|
||||
(function ($) {
|
||||
|
||||
Lightvideo = {
|
||||
|
||||
// startVideo()
|
||||
startVideo: function (href) {
|
||||
if (Lightvideo.checkKnownVideos(href)) {
|
||||
return;
|
||||
}
|
||||
else if (href.match(/\.mov$/i)) {
|
||||
if (navigator.plugins && navigator.plugins.length) {
|
||||
Lightbox.modalHTML ='<object id="qtboxMovie" type="video/quicktime" codebase="http://www.apple.com/qtactivex/qtplugin.cab" data="'+href+'" width="'+Lightbox.modalWidth+'" height="'+Lightbox.modalHeight+'"><param name="allowFullScreen" value="true"></param><param name="src" value="'+href+'" /><param name="scale" value="aspect" /><param name="controller" value="true" /><param name="autoplay" value="true" /><param name="bgcolor" value="#000000" /><param name="enablejavascript" value="true" /></object>';
|
||||
} else {
|
||||
Lightbox.modalHTML = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="'+Lightbox.modalWidth+'" height="'+Lightbox.modalHeight+'" id="qtboxMovie"><param name="allowFullScreen" value="true"></param><param name="src" value="'+href+'" /><param name="scale" value="aspect" /><param name="controller" value="true" /><param name="autoplay" value="true" /><param name="bgcolor" value="#000000" /><param name="enablejavascript" value="true" /></object>';
|
||||
}
|
||||
}
|
||||
else if (href.match(/\.wmv$/i) || href.match(/\.asx$/i)) {
|
||||
Lightbox.modalHTML = '<object NAME="Player" WIDTH="'+Lightbox.modalWidth+'" HEIGHT="'+Lightbox.modalHeight+'" align="left" hspace="0" type="application/x-oleobject" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"><param name="allowFullScreen" value="true"></param><param NAME="URL" VALUE="'+href+'"></param><param NAME="AUTOSTART" VALUE="true"></param><param name="showControls" value="true"></param><embed WIDTH="'+Lightbox.modalWidth+'" HEIGHT="'+Lightbox.modalHeight+'" align="left" hspace="0" SRC="'+href+'" TYPE="application/x-oleobject" AUTOSTART="false"></embed></object>';
|
||||
}
|
||||
else {
|
||||
Lightbox.videoId = href;
|
||||
variables = '';
|
||||
if (!href.match(/\.swf$/i)) {
|
||||
href = Lightbox.flvPlayer + '?file=' + href;
|
||||
if (Lightbox.flvFlashvars.length) {
|
||||
variables = Lightbox.flvFlashvars;
|
||||
}
|
||||
}
|
||||
|
||||
Lightvideo.createEmbed(href, "flvplayer", "#ffffff", variables);
|
||||
}
|
||||
},
|
||||
|
||||
// createEmbed()
|
||||
createEmbed: function(href, id, color, variables) {
|
||||
var bgcolor = 'bgcolor="' + color + '"';
|
||||
var flashvars = '';
|
||||
if (variables) {
|
||||
flashvars = 'flashvars="' + variables + '"';
|
||||
|
||||
}
|
||||
Lightbox.modalHTML = '<embed type="application/x-shockwave-flash" ' +
|
||||
'src="' + href + '" ' +
|
||||
'id="' + id + '" name="' + id + '" ' + bgcolor + ' ' +
|
||||
'quality="high" wmode="transparent" ' + flashvars + ' ' +
|
||||
'height="' + Lightbox.modalHeight + '" ' +
|
||||
'width="' + Lightbox.modalWidth + '" ' +
|
||||
'allowfullscreen="true" ' +
|
||||
'></embed>';
|
||||
},
|
||||
|
||||
|
||||
// checkKnownVideos()
|
||||
checkKnownVideos: function(href) {
|
||||
if (Lightvideo.checkYouTubeVideo(href) || Lightvideo.checkGoogleVideo(href) ||
|
||||
Lightvideo.checkMySpaceVideo(href) || Lightvideo.checkLiveVideo(href) ||
|
||||
Lightvideo.checkMetacafeVideo(href) ||
|
||||
Lightvideo.checkIFilmSpikeVideo(href)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
|
||||
// checkYouTubeVideo()
|
||||
checkYouTubeVideo: function(href) {
|
||||
var patterns = [
|
||||
'youtube.com/v/([^"&]+)',
|
||||
'youtube.com/watch\\?v=([^"&]+)',
|
||||
'youtube.com/\\?v=([^"&]+)'
|
||||
];
|
||||
|
||||
for (var i = 0; i < patterns.length; i++) {
|
||||
var pattern = new RegExp(patterns[i], "i");
|
||||
var results = pattern.exec(href);
|
||||
if (results !== null) {
|
||||
Lightbox.videoId = results[1];
|
||||
var href = "http://www.youtube.com/v/"+Lightbox.videoId;
|
||||
var variables = 'fs=1';
|
||||
if (Lightbox.flvFlashvars.length) {
|
||||
variables = variables + '&' + Lightbox.flvFlashvars;
|
||||
href = href + '&' + variables;
|
||||
}
|
||||
Lightvideo.createEmbed(href, "flvvideo", "#ffffff", variables);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
// checkGoogleVideo()
|
||||
checkGoogleVideo: function(href) {
|
||||
var patterns = [
|
||||
'http://video.google.[a-z]{2,4}/googleplayer.swf\\?docId=(-?\\d*)',
|
||||
'http://video.google.[a-z]{2,4}/videoplay\\?docid=([^&]*)&',
|
||||
'http://video.google.[a-z]{2,4}/videoplay\\?docid=(.*)'
|
||||
];
|
||||
|
||||
for (var i = 0; i < patterns.length; i++) {
|
||||
var pattern = new RegExp(patterns[i], "i");
|
||||
var results = pattern.exec(href);
|
||||
if (results !== null) {
|
||||
Lightbox.videoId = results[1];
|
||||
var href = "http://video.google.com/googleplayer.swf?docId="+Lightbox.videoId+"&hl=en";
|
||||
var variables = 'fs=true';
|
||||
if (Lightbox.flvFlashvars.length) {
|
||||
variables = variables + '&' + Lightbox.flvFlashvars;
|
||||
href = href + '&' + variables;
|
||||
}
|
||||
Lightvideo.createEmbed(href, "flvvideo", "#ffffff", variables);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
// checkMetacafeVideo()
|
||||
checkMetacafeVideo: function(href) {
|
||||
var patterns = [
|
||||
'metacafe.com/watch/(\.[^/]*)/(\.[^/]*)/',
|
||||
'metacafe.com/watch/(\.[^/]*)/(\.*)',
|
||||
'metacafe.com/fplayer/(\.[^/]*)/(\.[^.]*).'
|
||||
];
|
||||
|
||||
for (var i = 0; i < patterns.length; i++) {
|
||||
var pattern = new RegExp(patterns[i], "i");
|
||||
var results = pattern.exec(href);
|
||||
if (results !== null) {
|
||||
Lightbox.videoId = results[1];
|
||||
Lightvideo.createEmbed("http://www.metacafe.com/fplayer/"+Lightbox.videoId+"/.swf", "flvvideo", "#ffffff");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
// checkIFilmSpikeVideo()
|
||||
checkIFilmSpikeVideo: function(href) {
|
||||
var patterns = [
|
||||
'spike.com/video/[^/&"]*?/(\\d+)',
|
||||
'ifilm.com/video/[^/&"]*?/(\\d+)',
|
||||
'spike.com/video/([^/&"]*)',
|
||||
'ifilm.com/video/([^/&"]*)'
|
||||
];
|
||||
|
||||
for (var i = 0; i < patterns.length; i++) {
|
||||
var pattern = new RegExp(patterns[i], "i");
|
||||
var results = pattern.exec(href);
|
||||
if (results !== null) {
|
||||
Lightbox.videoId = results[1];
|
||||
Lightvideo.createEmbed("http://www.spike.com/efp", "flvvideo", "#000", "flvbaseclip="+Lightbox.videoId+"&");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
// checkMySpaceVideo()
|
||||
checkMySpaceVideo: function(href) {
|
||||
var patterns = [
|
||||
'src="myspace.com/index.cfm\\?fuseaction=vids.individual&videoid=([^&"]+)',
|
||||
'myspace.com/index.cfm\\?fuseaction=vids.individual&videoid=([^&"]+)',
|
||||
'src="myspacetv.com/index.cfm\\?fuseaction=vids.individual&videoid=([^&"]+)"',
|
||||
'myspacetv.com/index.cfm\\?fuseaction=vids.individual&videoid=([^&"]+)'
|
||||
];
|
||||
|
||||
for (var i = 0; i < patterns.length; i++) {
|
||||
var pattern = new RegExp(patterns[i], "i");
|
||||
var results = pattern.exec(href);
|
||||
if (results !== null) {
|
||||
Lightbox.videoId = results[1];
|
||||
Lightvideo.createEmbed("http://lads.myspace.com/videos/vplayer.swf", "flvvideo", "#ffffff", "m="+Lightbox.videoId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
// checkLiveVideo()
|
||||
checkLiveVideo: function(href) {
|
||||
var patterns = [
|
||||
'livevideo.com/flvplayer/embed/([^"]*)"',
|
||||
'livevideo.com/video/[^/]*?/([^/]*)/',
|
||||
'livevideo.com/video/([^/]*)/'
|
||||
];
|
||||
|
||||
for (var i = 0; i < patterns.length; i++) {
|
||||
var pattern = new RegExp(patterns[i], "i");
|
||||
var results = pattern.exec(href);
|
||||
if (results !== null) {
|
||||
Lightbox.videoId = results[1];
|
||||
Lightvideo.createEmbed("http://www.livevideo.com/flvplayer/embed/"+Lightbox.videoId, "flvvideo", "#ffffff");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
//End jQuery block
|
||||
}(jQuery));
|
4221
sites/all/modules/lightbox2/js/prototype.js
vendored
Normal file
58
sites/all/modules/lightbox2/js/scriptaculous.js
Normal file
@ -0,0 +1,58 @@
|
||||
// script.aculo.us scriptaculous.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
|
||||
|
||||
// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
||||
|
||||
var Scriptaculous = {
|
||||
Version: '1.8.1',
|
||||
require: function(libraryName) {
|
||||
// inserting via DOM fails in Safari 2.0, so brute force approach
|
||||
document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');
|
||||
},
|
||||
REQUIRED_PROTOTYPE: '1.6.0',
|
||||
load: function() {
|
||||
function convertVersionString(versionString){
|
||||
var r = versionString.split('.');
|
||||
return parseInt(r[0])*100000 + parseInt(r[1])*1000 + parseInt(r[2]);
|
||||
}
|
||||
|
||||
if((typeof Prototype=='undefined') ||
|
||||
(typeof Element == 'undefined') ||
|
||||
(typeof Element.Methods=='undefined') ||
|
||||
(convertVersionString(Prototype.Version) <
|
||||
convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE)))
|
||||
throw("script.aculo.us requires the Prototype JavaScript framework >= " +
|
||||
Scriptaculous.REQUIRED_PROTOTYPE);
|
||||
|
||||
$A(document.getElementsByTagName("script")).findAll( function(s) {
|
||||
return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/))
|
||||
}).each( function(s) {
|
||||
var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,'');
|
||||
var includes = s.src.match(/\?.*load=([a-z,]*)/);
|
||||
(includes ? includes[1] : 'builder,effects').split(',').each(
|
||||
function(include) { Scriptaculous.require(path+include+'.js') });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Scriptaculous.load();
|
27
sites/all/modules/lightbox2/lightbox2-insert-image.tpl.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
// $Id: lightbox2-insert-image.tpl.php,v 1.1.2.2 2010/09/22 10:16:30 snpower Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Template file for Lightbox2 content inserted via the Insert module.
|
||||
*
|
||||
* Available variables:
|
||||
* - $item: The complete item being inserted.
|
||||
* - $url: The URL to the image.
|
||||
* - $linkurl: The URL to the image being linked to.
|
||||
* - $class: A set of classes assigned to this image (if any).
|
||||
* - $image_preset_name: The ImageCache preset being used for the image.
|
||||
* - $link_preset_name: The ImageCache preset being used for the linked to image.
|
||||
* - $download_link: The download original link.
|
||||
*
|
||||
* Note that ALT and Title fields should not be filled in here, instead they
|
||||
* should use placeholders that will be updated through JavaScript when the
|
||||
* image is inserted.
|
||||
*
|
||||
* Available placeholders:
|
||||
* - __alt__: The ALT text, intended for use in the <img> tag.
|
||||
* - __title__: The Title text, intended for use in the <img> tag.
|
||||
* - __description__: A description of the image, sometimes used as a caption.
|
||||
*/
|
||||
?>
|
||||
<a rel="lightbox[group1][__description__<?php print $download_link ?>]" href="<?php print $linkurl ?>"><img src="<?php print $url ?>" alt="__alt__" title="__title__" class="imagecache-<?php print $image_preset_name ?><?php print $class ? ' ' . $class : '' ?>" /></a>
|
943
sites/all/modules/lightbox2/lightbox2.admin.inc
Normal file
@ -0,0 +1,943 @@
|
||||
<?php
|
||||
// $Id: lightbox2.admin.inc,v 1.1.2.38 2010/09/24 08:41:02 snpower Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Administrative page callbacks for the lightbox2 module.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The default lightbox2 settings page.
|
||||
*/
|
||||
function lightbox2_settings_page($op = NULL) {
|
||||
$output = drupal_get_form('lightbox2_general_settings_form');
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* General configuration form for controlling the lightbox behaviour.
|
||||
*/
|
||||
function lightbox2_general_settings_form() {
|
||||
|
||||
// Add the javascript which disables / enables form elements.
|
||||
drupal_add_js(drupal_get_path('module', 'lightbox2') . '/js/lightbox2.js', 'module');
|
||||
|
||||
// Enable translation of default strings for potx.
|
||||
$default_strings = array(t('View Image Details'), t('Image !current of !total'), t('Page !current of !total'), t('Video !current of !total'), t('Download Original'));
|
||||
|
||||
// Define Lightbox2 layout fieldset.
|
||||
/* --------------------------------- */
|
||||
$form['layout_fieldset'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Layout settings'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => FALSE,
|
||||
);
|
||||
|
||||
// Define Lightbox2 Lite fieldset.
|
||||
/* ------------------------------- */
|
||||
$use_lite = variable_get('lightbox2_lite', FALSE);
|
||||
$form['layout_fieldset']['lightbox2_lite_options'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Lightbox2 lite'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => !$use_lite,
|
||||
);
|
||||
|
||||
// Add checkbox for Lightbox2 Lite.
|
||||
$form['layout_fieldset']['lightbox2_lite_options']['lightbox2_lite'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Use lightbox2 lite'),
|
||||
'#description' => t('Checking this box will enable Lightbox2 Lite and will disable all of the automatic image URL re-formatting features. It also disables all grouping features.'),
|
||||
'#default_value' => $use_lite,
|
||||
);
|
||||
|
||||
|
||||
// Add checkbox for alternative layout.
|
||||
$form['layout_fieldset']['lightbox2_use_alt_layout'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Use alternative layout'),
|
||||
'#description' => t('Enabling this option alters the layout of the lightbox elements. In the alternative layout the navigational links appear under the image with the caption text, instead of being overlayed on the image itself. This doesn\'t apply when using Lightbox Lite.'),
|
||||
'#default_value' => variable_get('lightbox2_use_alt_layout', FALSE),
|
||||
);
|
||||
|
||||
// Add checkbox for force navigation display.
|
||||
$form['layout_fieldset']['lightbox2_force_show_nav'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Force visibility of navigation links'),
|
||||
'#description' => t('When viewing grouped images, the navigational links to the next and previous images are only displayed when you hover over the image. Checking this box forces these links to be displayed all the time.'),
|
||||
'#default_value' => variable_get('lightbox2_force_show_nav', FALSE),
|
||||
);
|
||||
|
||||
// Show caption
|
||||
$form['layout_fieldset']['lightbox2_show_caption'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Show image caption'),
|
||||
'#description' => t('Unset this to always hide the image caption (usually the title).'),
|
||||
'#default_value' => variable_get('lightbox2_show_caption', TRUE),
|
||||
);
|
||||
|
||||
// Add checkbox for "looping through images'.
|
||||
$form['layout_fieldset']['lightbox2_loop_items'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Continuous galleries'),
|
||||
'#description' => t('When viewing grouped images, the Next button on the last image will display the first image, while the Previous button on the first image will display the last image.'),
|
||||
'#default_value' => variable_get('lightbox2_loop_items', FALSE),
|
||||
);
|
||||
|
||||
// Add checkbox for node link target.
|
||||
$form['layout_fieldset']['lightbox2_node_link_target'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Open image page in new window'),
|
||||
'#description' => t('This controls whether the link to the image page underneath the image is opened in a new window or the current window.'),
|
||||
'#default_value' => variable_get('lightbox2_node_link_target', FALSE),
|
||||
'#return_value' => '_blank',
|
||||
);
|
||||
|
||||
// Define Lightbox2 text settings.
|
||||
/* ------------------------------- */
|
||||
$form['lightbox2_text_settings'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Text settings'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
|
||||
// Add text box for link text to node.
|
||||
$form['lightbox2_text_settings']['lightbox2_node_link_text'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Text for image page link'),
|
||||
'#description' => t('This is the text that will appear as the link to the image page underneath the image in the lightbox. Leave this blank for the link not to appear.'),
|
||||
'#default_value' => variable_get('lightbox2_node_link_text', 'View Image Details'),
|
||||
);
|
||||
|
||||
// Add text box for link text to node.
|
||||
$form['lightbox2_text_settings']['lightbox2_download_link_text'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Text for image original link'),
|
||||
'#description' => t('This is the text that will appear as the link to the original file underneath the image in the lightbox. Leave this blank for the link not to appear. It will only appear for images uploaded via the "image" or "imagefield" modules. Users will need the "download original image" permission, but also the "view original images" permission if using the "image" module.'),
|
||||
'#default_value' => variable_get('lightbox2_download_link_text', 'Download Original'),
|
||||
);
|
||||
|
||||
// Add text box for image count for grouping.
|
||||
$form['lightbox2_text_settings']['lightbox2_image_count_str'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Image count text'),
|
||||
'#description' => t('This text is used to display the image count underneath the image in the lightbox when image grouping is enabled. Use !current as a placeholder for the number of the current image and !total for the total number of images in the group. For example, "Image !current of !total". Leave blank for text not to appear.'),
|
||||
'#default_value' => variable_get('lightbox2_image_count_str', 'Image !current of !total'),
|
||||
);
|
||||
|
||||
// Add text box for page count for grouping.
|
||||
$form['lightbox2_text_settings']['lightbox2_page_count_str'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Page count text'),
|
||||
'#description' => t('This text is used to display the page count underneath HTML content displayed in the lightbox when using groups. Use !current as a placeholder for the number of the current page and !total for the total number of pages in the group. For example, "Page !current of !total". Leave blank for text not to appear.'),
|
||||
'#default_value' => variable_get('lightbox2_page_count_str', 'Page !current of !total'),
|
||||
);
|
||||
|
||||
// Add text box for video count for grouping.
|
||||
$form['lightbox2_text_settings']['lightbox2_video_count_str'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Video count text'),
|
||||
'#description' => t('This text is used to display the count underneath video content displayed in the lightbox when using groups. Use !current as a placeholder for the number of the current video and !total for the total number of videos in the group. For example, "Video !current of !total". Leave blank for text not to appear.'),
|
||||
'#default_value' => variable_get('lightbox2_video_count_str', 'Video !current of !total'),
|
||||
);
|
||||
|
||||
// Add text box for video count for grouping.
|
||||
$form['lightbox2_text_settings']['lightbox2_filter_xss_allowed_tags'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Allowed HTML tags'),
|
||||
'#description' => t('A list of comma separated HTML tags which are allowed to be used in the caption text area.'),
|
||||
'#default_value' => variable_get('lightbox2_filter_xss_allowed_tags', 'p, br, a, em, strong, cite, code, ul, ol, li, dl, dt, dd'),
|
||||
);
|
||||
|
||||
|
||||
// Define Lightbox2 zoom fieldset.
|
||||
/* -------------------------------- */
|
||||
$form['zoom_fieldset'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Image resize settings'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
|
||||
// Add checkbox for resize image.
|
||||
$form['zoom_fieldset']['lightbox2_disable_resize'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Disable resizing feature'),
|
||||
'#description' => t('By default, when the image being displayed in the lightbox is larger than the browser window, it is resized to fit within the window and a zoom button is provided for users who wish to view the image in its original size. Checking this box will disable this feature and all images will be displayed without any resizing.'),
|
||||
'#default_value' => variable_get('lightbox2_disable_resize', FALSE),
|
||||
);
|
||||
|
||||
// Add checkbox for zoom image.
|
||||
$form['zoom_fieldset']['lightbox2_disable_zoom'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Disable zoom in / out feature'),
|
||||
'#description' => t('When the image being displayed in the lightbox is resized to fit in the browser window, a "zoom in" button is shown. This allows the user to zoom in to see the original full size image. They will then see a "zoom out" button which will allow them to see the smaller resized version. Checking this box will prevent these buttons from appearing.'),
|
||||
'#default_value' => variable_get('lightbox2_disable_zoom', FALSE),
|
||||
);
|
||||
|
||||
// Define Lightbox2 modal form fieldset.
|
||||
/* -------------------------------------- */
|
||||
$form['modal_form_fieldset'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Modal form settings'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
|
||||
// Add checkbox for login support.
|
||||
$form['modal_form_fieldset']['lightbox2_enable_login'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Enable login support'),
|
||||
'#description' => t('Enabling this option will modify all login links so that the login form appears in a lightbox.'),
|
||||
'#default_value' => variable_get('lightbox2_enable_login', FALSE),
|
||||
);
|
||||
|
||||
// Add checkbox for contact form support.
|
||||
$form['modal_form_fieldset']['lightbox2_enable_contact'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Enable contact form support'),
|
||||
'#description' => t('Enabling this option will modify all contact links so that the contact form appears in a lightbox.'),
|
||||
'#default_value' => variable_get('lightbox2_enable_contact', FALSE),
|
||||
);
|
||||
|
||||
// Define Lightbox2 video fieldset.
|
||||
/* -------------------------------- */
|
||||
$form['video_fieldset'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Video settings'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
|
||||
// Add checkbox for video support.
|
||||
$form['video_fieldset']['lightbox2_enable_video'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Enable video support'),
|
||||
'#description' => t('By default, video support is disabled in order to reduce the amount of javascript needed. Checking this box will enable it.'),
|
||||
'#default_value' => variable_get('lightbox2_enable_video', FALSE),
|
||||
);
|
||||
|
||||
// Add textfield for FLV Player path.
|
||||
$form['video_fieldset']['lightbox2_flv_player_path'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Path to FLV Player'),
|
||||
'#description' => t('The path to the FLV player, relative to Drupal root directory. No leading slashes.'),
|
||||
'#default_value' => variable_get('lightbox2_flv_player_path', 'flvplayer.swf'),
|
||||
);
|
||||
|
||||
// Add textfield for FLV Player flashvars.
|
||||
$form['video_fieldset']['lightbox2_flv_player_flashvars'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('FLV Player flashvars'),
|
||||
'#description' => t('Flashvars for the FLV Player where supported, e.g. "autoplay=1&playerMode=normal".'),
|
||||
'#default_value' => variable_get('lightbox2_flv_player_flashvars', ''),
|
||||
);
|
||||
|
||||
// Define Lightbox2 page specific settings fieldset.
|
||||
/* ------------------------------------------------ */
|
||||
$form['lightbox2_page_init'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Page specific lightbox2 settings'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
// Add radio buttons for the actions to take for the listed pages, i.e.
|
||||
// disable or enable the lightbox functionality.
|
||||
$page_options = array(
|
||||
'page_enable' => t('Load only on the listed pages.'),
|
||||
'page_disable' => t('Load on every page except the listed pages.'),
|
||||
);
|
||||
$form['lightbox2_page_init']['lightbox2_page_init_action'] = array(
|
||||
'#type' => 'radios',
|
||||
'#options' => $page_options,
|
||||
'#title' => t('Enable lightbox2 on specific pages'),
|
||||
'#default_value' => variable_get('lightbox2_page_init_action', 'page_disable'),
|
||||
);
|
||||
// Add text input for list of pages to take specific action on.
|
||||
$form['lightbox2_page_init']['lightbox2_page_list'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Pages'),
|
||||
'#description' => t('List one page per line as Drupal paths. The * character is a wildcard. Example paths are "node/add/page" and "node/add/*". Use <front> to match the front page.'),
|
||||
'#default_value' => variable_get('lightbox2_page_list', ''),
|
||||
);
|
||||
|
||||
// Define grouping settings fieldset.
|
||||
/* ------------------------------------ */
|
||||
$form['group_options'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Group display settings'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
|
||||
$group_options = array(
|
||||
0 => t('No grouping'),
|
||||
1 => t('Group by field name'),
|
||||
2 => t('Group by node id'),
|
||||
3 => t('Group by field name and node id'),
|
||||
4 => t('Group all nodes and fields'),
|
||||
);
|
||||
|
||||
$form['group_options']['lightbox2_image_group_node_id'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Select Imagefield grouping in Views'),
|
||||
'#description' => t('By default, imagefields in views are grouped by the field name they appear in the view in. You can override that grouping here.'),
|
||||
'#options' => $group_options,
|
||||
'#default_value' => variable_get('lightbox2_image_group_node_id', 1),
|
||||
);
|
||||
|
||||
|
||||
// Define advanced settings fieldset.
|
||||
/* ---------------------------------- */
|
||||
$form['advanced_options'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Advanced settings'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
|
||||
// Allow users to decide where javascript should be loaded - header or footer.
|
||||
// Header is recommended so user can click on images before page has finished
|
||||
// loading, but footer is needed for sites in IE which use SWFObject.
|
||||
$form['advanced_options']['lightbox2_js_location'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Location of javscript'),
|
||||
'#options' => array('header' => t('Header'), 'footer' => t('Footer')),
|
||||
'#description' => t('By default, the lightbox javascript files are loaded in the HTML header. However, for sites using SWFObject to load their Flash content, the footer setting is recommended to prevent "Operation Aborted" errors in IE. If using the footer setting, please note that not all themes correctly implement the footer region and may require a small change.'),
|
||||
'#default_value' => variable_get('lightbox2_js_location', 'header'),
|
||||
);
|
||||
|
||||
$form['advanced_options']['lightbox2_disable_close_click'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Click on overlay or lightbox to close it'),
|
||||
'#description' => t('Enable user to close lightbox by clicking on the lightbox itself or the overlay background.'),
|
||||
'#default_value' => variable_get('lightbox2_disable_close_click', TRUE),
|
||||
);
|
||||
|
||||
// Define keyboard shortcuts fieldset.
|
||||
/* ---------------------------------- */
|
||||
$form['advanced_options']['keyboard_shortcuts'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Keyboard shortcuts'),
|
||||
'#description' => t('Configure the keyboard shortcuts for controlling the lightbox. These options do not apply to the Lightbox2 Lite version, which uses the default "Close keys" (c, x and esc) to close the lightbox.'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
|
||||
$form['advanced_options']['keyboard_shortcuts']['lightbox2_keys_close'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Close keys'),
|
||||
'#description' => t("A list of keys (or key codes) that a user may use to close the lightbox. Values should be separated by a space. Defaults to 'c x 27' (c, x, or esc)."),
|
||||
'#default_value' => variable_get('lightbox2_keys_close', 'c x 27'),
|
||||
);
|
||||
|
||||
$form['advanced_options']['keyboard_shortcuts']['lightbox2_keys_previous'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Previous keys'),
|
||||
'#description' => t("A list of keys (or key codes) that a user may use to navigate to the previous item in the lightbox. Values should be separated by a space. Defaults to 'p 37' (p or left arrow)."),
|
||||
'#default_value' => variable_get('lightbox2_keys_previous', 'p 37'),
|
||||
);
|
||||
|
||||
$form['advanced_options']['keyboard_shortcuts']['lightbox2_keys_next'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Next keys'),
|
||||
'#description' => t("A list of keys (or key codes) that a user may use to navigate to the next item in the lightbox. Values should be separated by a space. Defaults to 'n 39' (n or right arrow)."),
|
||||
'#default_value' => variable_get('lightbox2_keys_next', 'n 39'),
|
||||
);
|
||||
|
||||
$form['advanced_options']['keyboard_shortcuts']['lightbox2_keys_zoom'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Zoom keys'),
|
||||
'#description' => t("A list of keys (or key codes) that a user may use to zoom in / out of images in the lightbox. Values should be separated by a space. Defaults to 'z'."),
|
||||
'#default_value' => variable_get('lightbox2_keys_zoom', 'z'),
|
||||
);
|
||||
|
||||
$form['advanced_options']['keyboard_shortcuts']['lightbox2_keys_play_pause'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Pause / play keys'),
|
||||
'#description' => t("A list of keys (or key codes) that a user may use to pause / play the lightbox. Values should be separated by a space. Defaults to '32' (spacebar)."),
|
||||
'#default_value' => variable_get('lightbox2_keys_play_pause', '32'),
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
// Define border settings fieldset.
|
||||
/* ---------------------------------- */
|
||||
$form['advanced_options']['skin_settings'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Skin settings'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
|
||||
$form['advanced_options']['skin_settings']['lightbox2_border_size'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Border size'),
|
||||
'#size' => 6,
|
||||
'#maxlength' => 6,
|
||||
'#description' => t('Enter the size of the border in pixels to display around the image.'),
|
||||
'#default_value' => variable_get('lightbox2_border_size', 10),
|
||||
);
|
||||
|
||||
$form['advanced_options']['skin_settings']['lightbox2_box_color'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Lightbox color'),
|
||||
'#field_prefix' => '#',
|
||||
'#size' => 6,
|
||||
'#maxlength' => 6,
|
||||
'#description' => t('Enter a hexadecimal color value for the border. For example <code>fff</code> or <code>ffffff</code> for white).'),
|
||||
'#default_value' => variable_get('lightbox2_box_color', 'fff'),
|
||||
);
|
||||
|
||||
$form['advanced_options']['skin_settings']['lightbox2_font_color'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Font color'),
|
||||
'#field_prefix' => '#',
|
||||
'#size' => 6,
|
||||
'#maxlength' => 6,
|
||||
'#description' => t('Enter a hexadecimal color value for the font. For example <code>000</code> or <code>000000</code> for black).'),
|
||||
'#default_value' => variable_get('lightbox2_font_color', '000'),
|
||||
);
|
||||
|
||||
$form['advanced_options']['skin_settings']['lightbox2_top_position'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Distance from top'),
|
||||
'#size' => 6,
|
||||
'#maxlength' => 6,
|
||||
'#description' => t('Enter the position of the top of the lightbox in pixels. Leave blank for automatic calculation.'),
|
||||
'#default_value' => variable_get('lightbox2_top_position', ''),
|
||||
);
|
||||
|
||||
|
||||
|
||||
// Define overlay settings fieldset.
|
||||
/* ---------------------------------- */
|
||||
$form['advanced_options']['overlay_settings'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Overlay settings'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
// Add checkbox for overlay opacity.
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
$opacity_options["0.$i"] = "0.$i";
|
||||
}
|
||||
$opacity_options["1.0"] = "1.0";
|
||||
$form['advanced_options']['overlay_settings']['lightbox2_overlay_opacity'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Overlay opacity'),
|
||||
'#options' => $opacity_options,
|
||||
'#description' => t('The overlay opacity setting determines how visible the background page is behind the lightbox. The opacity value can range from 0.0 to 1.0 where 0.0 is 100% transparent and 1.0 is 100% opaque.'),
|
||||
'#default_value' => variable_get('lightbox2_overlay_opacity', 0.8),
|
||||
);
|
||||
|
||||
$form['advanced_options']['overlay_settings']['lightbox2_overlay_color'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Overlay color'),
|
||||
'#field_prefix' => '#',
|
||||
'#size' => 6,
|
||||
'#maxlength' => 6,
|
||||
'#description' => t('Enter a hexadecimal color value for the overlay. For example <code>000</code> or <code>000000</code> for black).'),
|
||||
'#default_value' => variable_get('lightbox2_overlay_color', '000'),
|
||||
);
|
||||
|
||||
|
||||
// Define animation settings fieldset.
|
||||
/* ----------------------------------- */
|
||||
$form['advanced_options']['animation_settings'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Animation settings'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
// Set animation help text.
|
||||
$form['advanced_options']['animation_settings']['animation_options_help'] = array(
|
||||
'#value' => '<p>' . t("These options aren't available when using Lightbox2 Lite.") . '</p>',
|
||||
);
|
||||
$resize_sequence_options = array(
|
||||
t('Simultaneous'),
|
||||
t('Width then height'),
|
||||
t('Height then width'),
|
||||
);
|
||||
$form['advanced_options']['animation_settings']['lightbox2_resize_sequence'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Resize sequence'),
|
||||
'#options' => $resize_sequence_options,
|
||||
'#description' => t('The sequence to use for the resizing animation.'),
|
||||
'#default_value' => variable_get('lightbox2_resize_sequence', 0),
|
||||
);
|
||||
$form['advanced_options']['animation_settings']['lightbox2_resize_speed'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Resize duration'),
|
||||
'#size' => 5,
|
||||
'#maxlength' => 5,
|
||||
'#description' => t('The duration (in seconds) of the resizing animation. Enter a value between 0 and 10.'),
|
||||
'#default_value' => variable_get('lightbox2_resize_speed', 0.4),
|
||||
);
|
||||
$form['advanced_options']['animation_settings']['lightbox2_fadein_speed'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Appearance duration'),
|
||||
'#size' => 5,
|
||||
'#maxlength' => 5,
|
||||
'#description' => t('The duration (in seconds) of the lightbox appearance animation. Enter a positive number less than 10.'),
|
||||
'#default_value' => variable_get('lightbox2_fadein_speed', 0.4),
|
||||
);
|
||||
|
||||
|
||||
$form['advanced_options']['animation_settings']['lightbox2_slidedown_speed'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Caption slide down duration'),
|
||||
'#size' => 5,
|
||||
'#maxlength' => 5,
|
||||
'#description' => t('The duration (in seconds) of the caption sliding-down animation. Enter a value between 0 and 10.'),
|
||||
'#default_value' => variable_get('lightbox2_slidedown_speed', 0.6),
|
||||
);
|
||||
|
||||
return system_settings_form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validation function for the general configuration form.
|
||||
*
|
||||
* Ensure that the hex color value submitted is valid and that the speeds are
|
||||
* numeric.
|
||||
*/
|
||||
function lightbox2_general_settings_form_validate($form, &$form_state) {
|
||||
if ($form_state['values']['op'] == t('Save configuration')) {
|
||||
$border_size = $form_state['values']['lightbox2_border_size'];
|
||||
$box_hex_colour = $form_state['values']['lightbox2_box_color'];
|
||||
$font_hex_colour = $form_state['values']['lightbox2_font_color'];
|
||||
$top_position = $form_state['values']['lightbox2_top_position'];
|
||||
$overlay_hex_colour = $form_state['values']['lightbox2_overlay_color'];
|
||||
$resize_speed = $form_state['values']['lightbox2_resize_speed'];
|
||||
$fadein_speed = $form_state['values']['lightbox2_fadein_speed'];
|
||||
$slide_down_speed = $form_state['values']['lightbox2_slidedown_speed'];
|
||||
$flv_player_path = $form_state['values']['lightbox2_flv_player_path'];
|
||||
|
||||
if (!empty($flv_player_path) && $form_state['values']['lightbox2_enable_video']) {
|
||||
if (strpos($flv_player_path, base_path()) === 0) {
|
||||
$flv_player_path = drupal_substr($flv_player_path, drupal_strlen(base_path()));
|
||||
}
|
||||
if (!file_exists($flv_player_path)) {
|
||||
form_set_error('lightbox2_flv_player_path', t("FLV player path doesn't exist."));
|
||||
}
|
||||
}
|
||||
|
||||
if (!_lightbox2_validate_hex_color($overlay_hex_colour)) {
|
||||
form_set_error('lightbox2_overlay_color', t('You must enter a properly formed hex value.'));
|
||||
}
|
||||
|
||||
if (!$form_state['values']['lightbox2_lite']) {
|
||||
if (!is_numeric($border_size) || $border_size < 0) {
|
||||
form_set_error('lightbox2_border_size', t('You must enter a size greater than 0 pixels.'));
|
||||
}
|
||||
|
||||
if (!_lightbox2_validate_hex_color($box_hex_colour)) {
|
||||
form_set_error('lightbox2_box_color', t('You must enter a properly formed hex value.'));
|
||||
}
|
||||
|
||||
if (!_lightbox2_validate_hex_color($font_hex_colour)) {
|
||||
form_set_error('lightbox2_font_color', t('You must enter a properly formed hex value.'));
|
||||
}
|
||||
|
||||
if (!empty($top_position) && (!is_numeric($top_position) || $top_position < 0)) {
|
||||
form_set_error('lightbox2_top_position', t('You must enter a size greater than 0 pixels. Leave blank for default positioning.'));
|
||||
}
|
||||
|
||||
if (!is_numeric($resize_speed) || $resize_speed <= 0 || $resize_speed >= 10) {
|
||||
form_set_error('lightbox2_resize_speed', t('You must enter a duration between 0 and 10 seconds.'));
|
||||
}
|
||||
|
||||
if (!is_numeric($fadein_speed) || $fadein_speed < 0 || $fadein_speed >= 10) {
|
||||
form_set_error('lightbox2_fadein_speed', t('You must enter a duration between 0 and 10 seconds.'));
|
||||
}
|
||||
|
||||
if (!is_numeric($slide_down_speed) || $slide_down_speed <= 0 || $slide_down_speed >= 10) {
|
||||
form_set_error('lightbox2_slidedown_speed', t('You must enter a duration between 0 and 10 seconds.'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit function for the general configuration form.
|
||||
*/
|
||||
function lightbox2_general_settings_form_submit($form, &$form_state) {
|
||||
cache_clear_all();
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration form for controlling the slideshow behaviour.
|
||||
*/
|
||||
function lightbox2_slideshow_settings_form() {
|
||||
|
||||
// Add the javascript which disables / enables form elements.
|
||||
drupal_add_js(drupal_get_path('module', 'lightbox2') . '/js/lightbox2.js', 'module');
|
||||
|
||||
// Set up a hidden variable.
|
||||
$form['lightbox2_lite'] = array(
|
||||
'#type' => 'hidden',
|
||||
'#value' => variable_get('lightbox2_lite', FALSE),
|
||||
);
|
||||
|
||||
|
||||
// Add text box for slideshow interval.
|
||||
$form['lightbox2_slideshow_interval'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Interval seconds'),
|
||||
'#description' => t('The slideshow interval is the length of time in seconds an image is visible before the slideshow shows the next image.'),
|
||||
'#default_value' => variable_get('lightbox2_slideshow_interval', 5),
|
||||
'#size' => 20,
|
||||
);
|
||||
|
||||
// Add checkbox for slideshow automatic start.
|
||||
$form['lightbox2_slideshow_automatic_start'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Automatically start slideshow'),
|
||||
'#description' => t('When enabled the slideshow will automatically start.'),
|
||||
'#default_value' => variable_get('lightbox2_slideshow_automatic_start', TRUE),
|
||||
);
|
||||
|
||||
// Add checkbox for slideshow automatic exit.
|
||||
$form['lightbox2_slideshow_automatic_exit'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Automatically exit slideshow'),
|
||||
'#description' => t('When enabled the lightbox will automatically close after displaying the last image.'),
|
||||
'#default_value' => variable_get('lightbox2_slideshow_automatic_exit', TRUE),
|
||||
);
|
||||
|
||||
// Add checkbox for showing hte play / pause button.
|
||||
$form['lightbox2_slideshow_show_play_pause'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Show play / pause button'),
|
||||
'#description' => t('When enabled, a play / pause button will be shown in the slideshow allowing the user more control over their viewing experience.'),
|
||||
'#default_value' => variable_get('lightbox2_slideshow_show_play_pause', TRUE),
|
||||
);
|
||||
|
||||
// Add checkbox for "pausing on next click".
|
||||
$form['lightbox2_slideshow_pause_on_next_click'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Pause slideshow on "Next Image" click'),
|
||||
'#description' => t('When enabled the slideshow is automatically paused, and the following image shown, when the "Next" button is clicked.'),
|
||||
'#default_value' => variable_get('lightbox2_slideshow_pause_on_next_click', FALSE),
|
||||
);
|
||||
|
||||
// Add checkbox for "pausing on prev click".
|
||||
$form['lightbox2_slideshow_pause_on_previous_click'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Pause slideshow on "Previous Image" click'),
|
||||
'#description' => t('When enabled the slideshow is automatically paused, and the previous image shown, when the "Previous" button is clicked.'),
|
||||
'#default_value' => variable_get('lightbox2_slideshow_pause_on_previous_click', TRUE),
|
||||
);
|
||||
|
||||
// Add checkbox for "looping through slides'.
|
||||
$form['lightbox2_loop_slides'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Continuous loop'),
|
||||
'#description' => t('When enabled the slideshow will automatically start over after displaying the last slide. This prevents the slideshow from automatically exiting when enabled.'),
|
||||
'#default_value' => variable_get('lightbox2_loop_slides', FALSE),
|
||||
);
|
||||
|
||||
return system_settings_form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validation function for the slideshow configuration form.
|
||||
*
|
||||
* Ensure that the slideshow interval submitted is numeric.
|
||||
*/
|
||||
function lightbox2_slideshow_settings_form_validate($form, &$form_state) {
|
||||
if (!is_numeric($form_state['values']['lightbox2_slideshow_interval'])) {
|
||||
form_set_error('lightbox2_slideshow_interval', t('The "interval seconds" value must be numeric.'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration form for controlling the iframe behaviour.
|
||||
*/
|
||||
function lightbox2_iframe_settings_form() {
|
||||
|
||||
// Add the javascript which disables / enables form elements.
|
||||
drupal_add_js(drupal_get_path('module', 'lightbox2') . '/js/lightbox2.js', 'module');
|
||||
|
||||
// Set up a hidden variable.
|
||||
$form['lightbox2_lite'] = array(
|
||||
'#type' => 'hidden',
|
||||
'#value' => variable_get('lightbox2_lite', FALSE),
|
||||
);
|
||||
|
||||
|
||||
// Add text box for iframe width.
|
||||
$form['lightbox2_default_frame_width'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Default width'),
|
||||
'#description' => t('The default width of the iframe in pixels.'),
|
||||
'#default_value' => variable_get('lightbox2_default_frame_width', 600),
|
||||
'#size' => 20,
|
||||
);
|
||||
|
||||
// Add text box for iframe height.
|
||||
$form['lightbox2_default_frame_height'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Default height'),
|
||||
'#description' => t('The default height of the iframe in pixels.'),
|
||||
'#default_value' => variable_get('lightbox2_default_frame_height', 400),
|
||||
'#size' => 20,
|
||||
);
|
||||
|
||||
// Add option for iframe border.
|
||||
$form['lightbox2_frame_border'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Enable border'),
|
||||
'#description' => t('Enable iframe border. You can modify the border style in your theme\'s css file using the iframe\'s id "lightboxFrame".'),
|
||||
'#default_value' => variable_get('lightbox2_frame_border', 1),
|
||||
);
|
||||
|
||||
return system_settings_form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validation function for the iframe configuration form.
|
||||
*
|
||||
* Ensure that the iframe width and height submitted are numeric.
|
||||
*/
|
||||
function lightbox2_iframe_settings_form_validate($form, &$form_state) {
|
||||
if (!is_numeric($form_state['values']['lightbox2_default_frame_width'])) {
|
||||
form_set_error('lightbox2_slideshow_interval', t('The "default width" value must be numeric.'));
|
||||
}
|
||||
if (!is_numeric($form_state['values']['lightbox2_default_frame_height'])) {
|
||||
form_set_error('lightbox2_slideshow_interval', t('The "default height" value must be numeric.'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Configuration form the automatic image handling functionality.
|
||||
*/
|
||||
function lightbox2_auto_image_handling_settings_form() {
|
||||
|
||||
// Add the javascript which disables / enables form elements.
|
||||
drupal_add_js(drupal_get_path('module', 'lightbox2') . '/js/lightbox2.js', 'module');
|
||||
|
||||
// Set up a hidden variable.
|
||||
$form['lightbox2_lite'] = array(
|
||||
'#type' => 'hidden',
|
||||
'#value' => variable_get('lightbox2_lite', FALSE),
|
||||
);
|
||||
|
||||
$automatic_options = array(
|
||||
0 => t('Disabled'),
|
||||
1 => t('Lightbox'),
|
||||
2 => t('Lightbox grouped'),
|
||||
3 => t('Slideshow'),
|
||||
4 => t('HTML content'),
|
||||
5 => t('HTML content grouped'),
|
||||
);
|
||||
|
||||
// Set image node options help text.
|
||||
$form['image_node_options'] = array(
|
||||
'#value' => t('These options allow automatic URL re-formatting of images. This removes the need for you to add \'rel="lightbox"\' to each image link throughout your site. You can select which image sizes will trigger the lightbox and configure a list of image CSS classes which should also have their URLs automatically re-formatted. This feature is not available when using Lightbox2 Lite.'),
|
||||
);
|
||||
|
||||
// Define handler settings fieldset.
|
||||
/* --------------------------------- */
|
||||
$form['handler_options'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Automatic handlers'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => FALSE,
|
||||
);
|
||||
|
||||
// Define image nodes settings fieldset.
|
||||
/* ------------------------------------- */
|
||||
$form['handler_options']['image_node_options'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Image node settings'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
|
||||
// Add checkbox for image nodes.
|
||||
$form['handler_options']['image_node_options']['lightbox2_image_node'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Automatic handler for image nodes'),
|
||||
'#options' => $automatic_options,
|
||||
'#description' => t('Choose how URLs for image nodes will be automatically handled.'),
|
||||
'#default_value' => variable_get('lightbox2_image_node', 0),
|
||||
);
|
||||
|
||||
/*
|
||||
// Add drop-down for list of available image sizes.
|
||||
if (module_exists('image')) {
|
||||
$sizes = image_get_sizes();
|
||||
foreach ($sizes as $size_key => $size) {
|
||||
if ($size_key == 'original' or $size_key == '_original') {
|
||||
$size_key = 'original';
|
||||
}
|
||||
$size_options[$size_key] = $size['label'];
|
||||
}
|
||||
$form['handler_options']['image_node_options']['lightbox2_display_image_size'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Lightbox image display size'),
|
||||
'#options' => $size_options,
|
||||
'#default_value' => variable_get('lightbox2_display_image_size', 'original'),
|
||||
'#description' => t('Select which image size will be loaded in the lightbox. This only applies to images uploaded with the Image module.'),
|
||||
);
|
||||
|
||||
$form['handler_options']['image_node_options']['lightbox2_trigger_image_size'] = array(
|
||||
'#type' => 'select',
|
||||
'#multiple' => TRUE,
|
||||
'#title' => t('Image trigger size'),
|
||||
'#options' => $size_options,
|
||||
'#default_value' => variable_get('lightbox2_trigger_image_size', array('thumbnail')),
|
||||
'#description' => t('Select which image size, when clicked on, will automatically trigger the lightbox. This only applies to images uploaded with the Image module.'),
|
||||
);
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
// Add checkbox for disabling lightbox for gallery lists.
|
||||
$form['handler_options']['image_node_options']['lightbox2_disable_nested_galleries'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Disable lightbox for gallery lists'),
|
||||
'#description' => t('Checking this box will disable the lightbox for images in gallery lists. This means it is possible to open a gallery by clicking on the teaser image, but the lightbox will still appear when viewing images within the gallery. This only applies to image galleries created with the "image gallery" module.'),
|
||||
'#default_value' => variable_get('lightbox2_disable_nested_galleries', TRUE),
|
||||
);
|
||||
|
||||
// Define flickr fieldset.
|
||||
/* ----------------------- */
|
||||
$form['handler_options']['flickr_options'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Flickr images'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
// Add checkbox for flickr image support.
|
||||
$form['handler_options']['flickr_options']['lightbox2_flickr'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Automatic handler for Flickr images'),
|
||||
'#options' => $automatic_options,
|
||||
'#description' => t('Choose how URLs for Flickr images will be automatically handled.'),
|
||||
'#default_value' => variable_get('lightbox2_flickr', 0),
|
||||
);
|
||||
|
||||
// Define gallery2 fieldset.
|
||||
/* ------------------------- */
|
||||
$form['handler_options']['gallery2_options'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Gallery2 images'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
// Add checkbox for gallery2 block image support.
|
||||
$form['handler_options']['gallery2_options']['lightbox2_gallery2_blocks'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Automatic handler for Gallery2 block images'),
|
||||
'#options' => $automatic_options,
|
||||
'#description' => t('Choose how URLs for images, contained within Gallery2 image blocks, will be automatically handled.'),
|
||||
'#default_value' => variable_get('lightbox2_gallery2_blocks', 0),
|
||||
);
|
||||
|
||||
// Define inline fieldset.
|
||||
/* ----------------------- */
|
||||
$form['handler_options']['inline_options'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Inline module images'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
// Add checkbox for inline image support.
|
||||
$form['handler_options']['inline_options']['lightbox2_inline'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Automatic handler for Inline module images'),
|
||||
'#options' => $automatic_options,
|
||||
'#description' => t('Choose how URLs for Inline module images will be automatically handled.'),
|
||||
'#default_value' => variable_get('lightbox2_inline', 0),
|
||||
);
|
||||
|
||||
// Define image assist fieldset.
|
||||
/* ----------------------------- */
|
||||
$form['handler_options']['img_assist_options'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Image Assist images'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
// Add checkbox for image assist custom size images.
|
||||
$form['handler_options']['img_assist_options']['lightbox2_image_assist_custom'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Automatic handler for Image Assist custom size images'),
|
||||
'#options' => $automatic_options,
|
||||
'#description' => t('Choose how URLs for custom size images, displayed by the Image Assist module, will be automatically handled.'),
|
||||
'#default_value' => variable_get('lightbox2_image_assist_custom', 0),
|
||||
);
|
||||
|
||||
// Define custom fieldset.
|
||||
/* ----------------------- */
|
||||
$form['handler_options']['custom_options'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Custom class images'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
// Add checkbox for custom class image support.
|
||||
$form['handler_options']['custom_options']['lightbox2_custom_class_handler'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Automatic handler for custom class images'),
|
||||
'#options' => $automatic_options,
|
||||
'#description' => t('Choose how URLs for custom class images will be automatically handled.'),
|
||||
'#default_value' => variable_get('lightbox2_custom_class_handler', 0),
|
||||
);
|
||||
// Add text box for custom trigger classes.
|
||||
$form['handler_options']['custom_options']['lightbox2_custom_trigger_classes'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Custom image trigger classes'),
|
||||
'#description' => t('List the image classes which should trigger the lightbox when clicked on. Put each class on a separate line.'),
|
||||
'#default_value' => variable_get('lightbox2_custom_trigger_classes', ''),
|
||||
);
|
||||
|
||||
// Add checkbox for disabling lightbox for acidfree gallery lists.
|
||||
if (module_exists("acidfree")) {
|
||||
// Define acidfree settings fieldset.
|
||||
/* ---------------------------------- */
|
||||
$form['handler_options']['lightbox2_acidfree_options'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Acidfree settings'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
$form['handler_options']['lightbox2_acidfree_options']['lightbox2_disable_nested_acidfree_galleries'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Disable lightbox for Acidfree gallery lists'),
|
||||
'#description' => t('Checking this box will disable the lightbox for images in gallery lists. This means it is possible to open a gallery by clicking on the teaser image, but the lightbox will still appear when viewing images within the gallery. This only applies to image galleries created with the "acidfree" module.'),
|
||||
'#default_value' => variable_get('lightbox2_disable_nested_acidfree_galleries', TRUE),
|
||||
);
|
||||
// Add checkbox for enabling lightbox for acidfree videos.
|
||||
if (module_exists("video")) {
|
||||
$form['handler_options']['lightbox2_acidfree_options']['lightbox2_enable_acidfree_videos'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Enable lightbox for Acidfree videos'),
|
||||
'#description' => t('Checking this box will enable the display of acidfree videos in a lightbox. This only applies to videos created by the "video" module and which appear in an acidfree gallery.'),
|
||||
'#default_value' => variable_get('lightbox2_enable_acidfree_videos', FALSE),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return system_settings_form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a hex color value.
|
||||
*
|
||||
* @param $hex
|
||||
* The hex color string to validate.
|
||||
* @return
|
||||
* TRUE if $hex is a valid hex color value.
|
||||
*/
|
||||
function _lightbox2_validate_hex_color($hex) {
|
||||
return preg_match('!^[a-f0-9]{3}([a-f0-9]{3})?$!i', $hex);
|
||||
}
|
||||
|
632
sites/all/modules/lightbox2/lightbox2.formatter.inc
Normal file
@ -0,0 +1,632 @@
|
||||
<?php
|
||||
// $Id: lightbox2.formatter.inc,v 1.1.2.30 2010/09/22 10:47:15 snpower Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Lightbox2 formatter hooks and callbacks.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Theme function for displaying the lightbox2 trigger image in an imagefield.
|
||||
*
|
||||
* @param $path
|
||||
* The path to the image to be displayed.
|
||||
* @param $alt
|
||||
* The image alternative text.
|
||||
* @param $title
|
||||
* The image title.
|
||||
* @param $attributes
|
||||
* An array of image attributes, e.g. class name.
|
||||
* @return
|
||||
* HTML output for displaying the image.
|
||||
*/
|
||||
function theme_lightbox2_image($variables) {
|
||||
$path = $variables['path'];
|
||||
$item = $variables['item'];
|
||||
$image_style = $variables['image_style'];
|
||||
$node_id = $variables['node_id'];
|
||||
$field_name = $variables['field_name'];
|
||||
|
||||
if (!$variables["lightbox_style"]) {
|
||||
$path['path'] = file_create_url($item['uri']);
|
||||
}
|
||||
else {
|
||||
$path['path'] = image_style_url($variables["lightbox_style"], $item['uri']);
|
||||
}
|
||||
|
||||
// Lightbox type
|
||||
$rel = $variables['lightbox_type'];
|
||||
|
||||
// Grouping
|
||||
$rel .= '[';
|
||||
$group = variable_get('lightbox2_image_group_node_id', 1);
|
||||
|
||||
switch ($group) {
|
||||
// No groups
|
||||
case '0':
|
||||
break;
|
||||
// Group by field name
|
||||
case '1':
|
||||
$rel .= $field_name;
|
||||
break;
|
||||
// Group by node id
|
||||
case '2':
|
||||
$rel .= $node_id;
|
||||
break;
|
||||
// Group by field name and node id
|
||||
case '3':
|
||||
$rel .= $field_name . '_' . $node_id;
|
||||
break;
|
||||
// All nodes and fields in same group
|
||||
case '4':
|
||||
$rel .= 'group';
|
||||
break;
|
||||
}
|
||||
$rel .= ']';
|
||||
|
||||
// Title Start
|
||||
$rel .= '[' . $item['title'];
|
||||
|
||||
// Download Link
|
||||
if (user_access('download original image')) {
|
||||
$rel .= '<p><a href="' . file_create_url($item['uri']) . '">' . variable_get('lightbox2_download_link_text', 'Download Original') . '</a></p>';
|
||||
}
|
||||
|
||||
// Title End
|
||||
$rel .= ']';
|
||||
|
||||
$path['options']['attributes']['rel'] = $rel;
|
||||
$path['options']['attributes']['title'] = $item['title'];
|
||||
|
||||
return theme('image_formatter', array( 'item' => $item, 'path' => $path, 'image_style' => $image_style ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Handler for Lightbox2 display of imagecache + imagefield CCK fields.
|
||||
*
|
||||
* The compact view shows only the first image in a multiple imagefield but
|
||||
* shows all images in the lightbox.
|
||||
*
|
||||
* @param $element
|
||||
* The CCK field element.
|
||||
* @return
|
||||
* HTML output for displaying the image and link.
|
||||
*/
|
||||
/*function theme_lightbox2_formatter_imagefield($variables) {
|
||||
$element = $variables['element'];
|
||||
if (!module_exists("image")) {
|
||||
return;
|
||||
}
|
||||
|
||||
$field_name = $element['#field_name'];
|
||||
$item = $element['#item'];
|
||||
$formatter = $element['#formatter'];
|
||||
$node = node_load($element['#item']['nid']);
|
||||
|
||||
if (strpos($formatter, '__lightbox2__') !== FALSE || strpos($formatter, '__lightshow2__') !== FALSE || strpos($formatter, '__lightframe2__') !== FALSE
|
||||
|| strpos($formatter, '__lightbox2_compact__') !== FALSE || strpos($formatter, '__lightshow2_compact__') !== FALSE || strpos($formatter, '__lightframe2_compact__') !== FALSE) {
|
||||
list($tmp, $lightbox_type, $view_preset, $lightbox_preset) = explode('__', $formatter, 4);
|
||||
return lightbox2_imagefield_image_imagecache($field_name, $item, $formatter, $node, $view_preset, $lightbox_preset);
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Function to set up the data needed for
|
||||
* theme_imagefield_image_imagecache_lightbox2().
|
||||
*
|
||||
* @param $field_name
|
||||
* The field name the action is being performed on.
|
||||
* @param $item
|
||||
* An array, keyed by column, of the data stored for this item in this field.
|
||||
* @param $formatter
|
||||
* The formatter to use for the field.
|
||||
* @param $node
|
||||
* The node object.
|
||||
* @param $view_preset
|
||||
* The imagecache preset to be displayed on the node or in the view.
|
||||
* @param $lightbox_preset
|
||||
* The imagecache preset to be displayed in the lightbox.
|
||||
* @return
|
||||
* The themed imagefield + imagecache image and link.
|
||||
*/
|
||||
/*function lightbox2_imagefield_image_imagecache($variables) {
|
||||
$field_name = $variables['field_name'];
|
||||
$item = $variables['item'];
|
||||
$formatter = $variables['formatter'];
|
||||
$node = $variables['node'];
|
||||
$view_preset = $variables['view_preset'];
|
||||
$lightbox_preset = $variables['lightbox_preset'];
|
||||
// Load file data if missing
|
||||
if (!isset($item['filepath']) && !empty($item['fid'])) {
|
||||
$file = field_file_load($item['fid']);
|
||||
$item = array_merge($item, (array)$file);
|
||||
}
|
||||
elseif (!isset($item['filepath'])) {
|
||||
// No file in field, return.
|
||||
return '';
|
||||
}
|
||||
|
||||
$args['lightbox_preset'] = $lightbox_preset;
|
||||
|
||||
// Check view_preset for existence.
|
||||
$rules = array();
|
||||
if (function_exists('imagecache_presets')) {
|
||||
$presets = imagecache_presets();
|
||||
foreach ($presets as $preset_id => $preset_info) {
|
||||
$rules[$preset_id] = $preset_info['presetname'];
|
||||
}
|
||||
}
|
||||
else {
|
||||
$rules = _imagecache_get_presets();
|
||||
}
|
||||
if ($view_preset == 'link' || $view_preset == 'original' || in_array($view_preset, (array) $rules)) {
|
||||
$rel = 'lightbox';
|
||||
if (strpos($formatter, '__lightshow2__') !== FALSE) {
|
||||
$rel = 'lightshow';
|
||||
}
|
||||
elseif (strpos($formatter, '__lightshow2_compact__') !== FALSE) {
|
||||
$rel = 'lightshow';
|
||||
$args['compact'] = TRUE;
|
||||
}
|
||||
elseif (strpos($formatter, '__lightframe2__') !== FALSE) {
|
||||
$rel = 'lightframe';
|
||||
}
|
||||
|
||||
// Check if this is a compact display.
|
||||
list($tmp, $lightbox_type, $tmp) = explode('__', $formatter, 3);
|
||||
if ($lightbox_type == 'lightbox2_compact') {
|
||||
$args['compact'] = TRUE;
|
||||
}
|
||||
return theme('imagefield_image_imagecache_lightbox2', array( 'view_preset' => $view_preset, 'field_name' => $field_name, 'item' => $item, 'node' => $node, 'rel' => $rel, 'args' => $args ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the HTML output for imagefield + imagecache images so they can be
|
||||
* opened in a lightbox by clicking on the image on the node page or in a view.
|
||||
*
|
||||
* This actually also handles filefields + imagecache images too.
|
||||
*
|
||||
* @param $view_preset
|
||||
* The imagecache preset to be displayed on the node or in the view.
|
||||
* @param $field_name
|
||||
* The field name the action is being performed on.
|
||||
* @param $item
|
||||
* An array, keyed by column, of the data stored for this item in this field.
|
||||
* @param $node
|
||||
* The node object.
|
||||
* @param $rel
|
||||
* The type of lightbox to open: lightbox, lightshow or lightframe.
|
||||
* @param $args
|
||||
* Args may override internal processes: caption, rel_grouping.
|
||||
* @return
|
||||
* The themed imagefield + imagecache image and link.
|
||||
*/
|
||||
/*function theme_imagefield_image_imagecache_lightbox2($variables) {
|
||||
$view_preset = $variables['view_preset'];
|
||||
$field_name = $variables['field_name'];
|
||||
$item = $variables['item'];
|
||||
$node = $variables['node'];
|
||||
$rel = $variables['rel'];
|
||||
$args = $variables['args'];
|
||||
if (!isset($args['lightbox_preset'])) {
|
||||
$args['lightbox_preset'] = 'original';
|
||||
}
|
||||
// Can't show current node page in a lightframe on the node page.
|
||||
// Switch instead to show it in a lightbox.
|
||||
$on_image_node = (arg(0) == 'node') && (arg(1) == $node->nid);
|
||||
if ($rel == 'lightframe' && $on_image_node) {
|
||||
$rel = 'lightbox';
|
||||
}
|
||||
$orig_rel = $rel;
|
||||
|
||||
// Unserialize into original - if sourced by views.
|
||||
$item_data = $item['data'];
|
||||
if (is_string($item['data'])) {
|
||||
$item_data = unserialize($item['data']);
|
||||
}
|
||||
|
||||
// Set up the title.
|
||||
$image_title = $item_data['description'];
|
||||
$image_title = (!empty($image_title) ? $image_title : $item_data['title']);
|
||||
$image_title = (!empty($image_title) ? $image_title : $item_data['alt']);
|
||||
if (empty($image_title) || variable_get('lightbox2_imagefield_use_node_title', FALSE)) {
|
||||
$node = node_load($node->nid);
|
||||
$image_title = $node->title;
|
||||
}
|
||||
|
||||
$image_tag_title = '';
|
||||
if (!empty($item_data['title'])) {
|
||||
$image_tag_title = $item_data['title'];
|
||||
}
|
||||
|
||||
|
||||
// Enforce image alt.
|
||||
$image_tag_alt = '';
|
||||
if (!empty($item_data['alt'])) {
|
||||
$image_tag_alt = $item_data['alt'];
|
||||
}
|
||||
elseif (!empty($image_title)) {
|
||||
$image_tag_alt = $image_title;
|
||||
}
|
||||
|
||||
// Set up the caption.
|
||||
$node_links = array();
|
||||
if (!empty($item['nid'])) {
|
||||
$attributes = array();
|
||||
$attributes['id'] = 'lightbox2-node-link-text';
|
||||
$target = variable_get('lightbox2_node_link_target', FALSE);
|
||||
if (!empty($target)) {
|
||||
$attributes['target'] = $target;
|
||||
}
|
||||
$node_link_text = variable_get('lightbox2_node_link_text', 'View Image Details');
|
||||
if (!$on_image_node && !empty($node_link_text)) {
|
||||
$node_links[] = l($node_link_text, 'node/'. $item['nid'], array('attributes' => $attributes));
|
||||
}
|
||||
$download_link_text = check_plain(variable_get('lightbox2_download_link_text', 'Download Original'));
|
||||
if (!empty($download_link_text) && user_access('download original image')) {
|
||||
$node_links[] = l($download_link_text, file_create_url($item['filepath']), array('attributes' => array('target' => '_blank', 'id' => 'lightbox2-download-link-text')));
|
||||
}
|
||||
}
|
||||
|
||||
$caption = $image_title;
|
||||
if (count($node_links)) {
|
||||
$caption .= '<br /><br />'. implode(" - ", $node_links);
|
||||
}
|
||||
if (isset($args['caption'])) {
|
||||
$caption = $args['caption']; // Override caption.
|
||||
}
|
||||
|
||||
if ($orig_rel == 'lightframe') {
|
||||
$frame_width = variable_get('lightbox2_default_frame_width', 600);
|
||||
$frame_height = variable_get('lightbox2_default_frame_height', 400);
|
||||
$frame_size = 'width:'. $frame_width .'px; height:'. $frame_height .'px;';
|
||||
$rel = preg_replace('/\]$/', "|$frame_size]", $rel);
|
||||
}
|
||||
|
||||
// Set up the rel attribute.
|
||||
$full_rel = '';
|
||||
$imagefield_grouping = variable_get('lightbox2_imagefield_group_node_id', 1);
|
||||
if (isset($args['rel_grouping'])) {
|
||||
$full_rel = $rel .'['. $args['rel_grouping'] .']['. $caption .']';
|
||||
}
|
||||
elseif ($imagefield_grouping == 1) {
|
||||
$full_rel = $rel .'['. $field_name .']['. $caption .']';
|
||||
}
|
||||
elseif ($imagefield_grouping == 2 && !empty($item['nid'])) {
|
||||
$full_rel = $rel .'['. $item['nid'] .']['. $caption .']';
|
||||
}
|
||||
elseif ($imagefield_grouping == 3 && !empty($item['nid'])) {
|
||||
$full_rel = $rel .'['. $field_name .'_'. $item['nid'] .']['. $caption .']';
|
||||
}
|
||||
elseif ($imagefield_grouping == 4 ) {
|
||||
$full_rel = $rel .'[allnodes]['. $caption .']';
|
||||
}
|
||||
else {
|
||||
$full_rel = $rel .'[]['. $caption .']';
|
||||
}
|
||||
$class = '';
|
||||
if ($view_preset != 'original') {
|
||||
$class = 'imagecache imagecache-' . $field_name . ' imagecache-' . $view_preset . ' imagecache-' . $field_name . '-' . $view_preset;
|
||||
}
|
||||
$link_attributes = array(
|
||||
'rel' => $full_rel,
|
||||
'class' => 'imagefield imagefield-lightbox2 imagefield-lightbox2-' . $view_preset . ' imagefield-' . $field_name . ' ' . $class,
|
||||
);
|
||||
|
||||
$attributes = array();
|
||||
if (isset($args['compact']) && $item['#delta']) {
|
||||
$image = '';
|
||||
}
|
||||
elseif ($view_preset == 'original') {
|
||||
$image = theme('lightbox2_image', array( 'path' => $item['filepath'], 'alt' => $image_tag_alt, 'title' => $image_tag_title, 'attributes' => $attributes ) );
|
||||
}
|
||||
elseif ($view_preset == 'link') {
|
||||
// Not actually an image, just a text link.
|
||||
$image = variable_get('lightbox2_view_image_text', 'View image');
|
||||
}
|
||||
else {
|
||||
$image = theme('imagecache', array( 'style_name' => $view_preset, 'path' => $item['filepath'], 'alt' => $image_tag_alt, 'title' => $image_tag_title, 'attributes' => $attributes ) );
|
||||
}
|
||||
|
||||
if ($args['lightbox_preset'] == 'node') {
|
||||
$output = l($image, 'node/'. $node->nid .'/lightbox2', array('attributes' => $link_attributes, 'html' => TRUE));
|
||||
}
|
||||
elseif ($args['lightbox_preset'] == 'original') {
|
||||
$output = l($image, file_create_url($item['filepath']), array('attributes' => $link_attributes, 'html' => TRUE));
|
||||
}
|
||||
else {
|
||||
$output = l($image, imagecache_create_url($args['lightbox_preset'], $item['filepath']), array('attributes' => $link_attributes, 'html' => TRUE));
|
||||
}
|
||||
return $output;
|
||||
}*/
|
||||
|
||||
|
||||
/**
|
||||
* Theme function for the lightbox iframe filefield formatter.
|
||||
*
|
||||
* @param $element
|
||||
* The CCK field element.
|
||||
* @return
|
||||
* The themed link to the file, with lightframe support.
|
||||
*/
|
||||
/*function theme_lightbox2_formatter_filefield_lightframe($variables) {
|
||||
$element = $variables['element'];
|
||||
$file = $element['#item'];
|
||||
$field = content_fields($element['#field_name']);
|
||||
if (!filefield_view_access($field['field_name']) || empty($file['list'])) {
|
||||
return '';
|
||||
}
|
||||
if (empty($file['fid']) || !is_file($file['filepath'])) {
|
||||
return '';
|
||||
}
|
||||
$file = (object)$file;
|
||||
if (!lightbox2_check_filefield_extension($file, $field)) {
|
||||
return '';
|
||||
}
|
||||
drupal_add_css(drupal_get_path('module', 'filefield') .'/filefield.css');
|
||||
return '<div class="filefield-item">'. theme('lightbox2_file_formatter_lightbox2_iframe', array( 'file' => $file, 'field' => $field, 'file_formatter_settings' => NULL ) ) .'</div>';
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Theme function for the lightbox iframe filefield formatter.
|
||||
*
|
||||
* @param $file
|
||||
* Filefield file object.
|
||||
* @param $field
|
||||
* The CCK field the action is being performed on.
|
||||
* @param $file_formatter_settings
|
||||
* File formatter settings; ignored.
|
||||
* @return
|
||||
* Themed link to filefield.
|
||||
*/
|
||||
/*function theme_lightbox2_file_formatter_lightbox2_iframe($variables) {
|
||||
$file = $variables['file'];
|
||||
$field = $varbiables['field'];
|
||||
$file_formatter_settings = $variables['file_formatter_settings'];
|
||||
$path = $file->filepath;
|
||||
$url = file_create_url($path);
|
||||
$icon = theme('file_icon', array( 'file' => $file ) );
|
||||
$file_data = $file->data;
|
||||
if (is_string($file_data)) {
|
||||
$file_data = unserialize($file->data);
|
||||
}
|
||||
$description = $file_data['description'];
|
||||
if (empty($description)) {
|
||||
$description = $file->filename;
|
||||
}
|
||||
$attributes = array();
|
||||
$attributes['id'] = 'lightbox2-node-link-text';
|
||||
$target = variable_get('lightbox2_node_link_target', FALSE);
|
||||
if (!empty($target)) {
|
||||
$attributes['target'] = $target;
|
||||
}
|
||||
$node_link = '';
|
||||
$node_link_text = check_plain(variable_get('lightbox2_node_link_text', 'View Image Details'));
|
||||
if (!empty($node_link_text)) {
|
||||
$node_link .= '<br /><br />'. l($node_link_text, $url, array('attributes' => $attributes));
|
||||
}
|
||||
|
||||
// Only files with supported extensions make it this far, so no need to check here.
|
||||
$link_attributes = array('rel' => 'lightframe[]['. $description . $node_link .']');
|
||||
|
||||
return '<div class="filefield-formatter-lightbox2-iframe">'. $icon . l($description, $url, array('attributes' => $link_attributes)) .'</div>';
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Generate the HTML output to open embedded cck images in a lightbox.
|
||||
*
|
||||
* @param $element
|
||||
* The CCK field element.
|
||||
* @return
|
||||
* The themed link to the embedded image.
|
||||
*/
|
||||
/*function theme_lightbox2_formatter_emimage($variables) {
|
||||
$element = $variables['element'];
|
||||
$field = content_fields($element['#field_name'], $element['#type_name']);
|
||||
$item = $element['#item'];
|
||||
$formatter = $element['#formatter'];
|
||||
$node = node_load($element['#node']->nid);
|
||||
|
||||
list($tmp, $lightbox_type) = explode('_', $formatter, 2);
|
||||
$field['lightbox_type'] = $lightbox_type;
|
||||
$formatter = "emimage";
|
||||
|
||||
return module_invoke('emfield', 'emfield_field_formatter', $field, $item, $formatter, $node, 'lightbox2');
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Generate the HTML output to open embedded cck images in a lightbox.
|
||||
*
|
||||
* @param $field
|
||||
* The CCK field the action is being performed on.
|
||||
* @param $item
|
||||
* An array, keyed by column, of the data stored for this item in this field.
|
||||
* @param $formatter
|
||||
* The formatter to use for the field.
|
||||
* @param $node
|
||||
* The node object.
|
||||
* @param $args
|
||||
* Args may override internal processes: caption, rel_grouping.
|
||||
* @return
|
||||
* Themed embedded media field image and link.
|
||||
*/
|
||||
/*function theme_lightbox2_emimage($variables) {
|
||||
$field = $variables['field'];
|
||||
$item = $variables['item'];
|
||||
$formatter = $variables['formatter'];
|
||||
$node = $variables['node'];
|
||||
$args = $variables['args'];
|
||||
|
||||
$lightbox_type = $field['lightbox_type'];
|
||||
|
||||
if ($item['value'] && $item['provider']) {
|
||||
$rel = 'lightbox';
|
||||
if ($lightbox_type == 'lightshow2') {
|
||||
$rel = 'lightshow';
|
||||
}
|
||||
elseif ($lightbox_type == 'lightframe2') {
|
||||
$rel = 'lightframe';
|
||||
}
|
||||
if ($rel == 'lightframe' && arg(0) == 'node' && arg(1) == $node->nid) {
|
||||
$rel = 'lightbox';
|
||||
}
|
||||
$orig_rel = $rel;
|
||||
|
||||
$code = $item['value'];
|
||||
$width = $field['widget']['thumbnail_width'] == '' ? variable_get('emimage_default_full_width', EMIMAGE_DEFAULT_FULL_WIDTH) : $field['widget']['thumbnail_width'];
|
||||
$height = $field['widget']['thumbnail_height'] == '' ? variable_get('emimage_default_full_height', EMIMAGE_DEFAULT_FULL_HEIGHT) : $field['widget']['thumbnail_height'];
|
||||
$link = $field['widget']['thumbnail_link'] ? $field['widget']['thumbnail_link'] : variable_get('emimage_default_thumbnail_link', EMIMAGE_DEFAULT_THUMBNAIL_LINK);
|
||||
if ($link == EMIMAGE_LINK_CONTENT) {
|
||||
$link = 'node/'. $node->nid;
|
||||
}
|
||||
elseif ($link == EMIMAGE_LINK_PROVIDER) {
|
||||
$link = module_invoke('emfield', 'include_invoke', 'emimage', $item['provider'], 'embedded_link', $code, $item['data']);
|
||||
}
|
||||
else {
|
||||
$link = NULL;
|
||||
}
|
||||
$attributes = array();
|
||||
$attributes['id'] = 'lightbox2-node-link-text';
|
||||
if ($width) {
|
||||
$attributes['width'] = $width;
|
||||
}
|
||||
if ($height) {
|
||||
$attributes['height'] = $height;
|
||||
}
|
||||
$target = variable_get('lightbox2_node_link_target', FALSE);
|
||||
if (!empty($target)) {
|
||||
$attributes['target'] = $target;
|
||||
}
|
||||
|
||||
// Set up the title.
|
||||
$title = module_invoke('emfield', 'include_invoke', 'emimage', $item['provider'], 'image_title', $code, $item['data']);
|
||||
|
||||
// Set up the caption.
|
||||
$node_link = '';
|
||||
$node_link_text = variable_get('lightbox2_node_link_text', 'View Image Details');
|
||||
if (!empty($node_link_text) && !empty($link)) {
|
||||
$node_link = '<br /><br />'. l($node_link_text, $link, array('attributes' => $attributes));
|
||||
}
|
||||
// @TODO original download link possible with emfield?
|
||||
|
||||
$caption = $title . $node_link;
|
||||
if (isset($args['caption'])) {
|
||||
$caption = $args['caption']; // Override caption.
|
||||
}
|
||||
|
||||
// Set up url and image.
|
||||
$url = module_invoke('emfield', 'include_invoke', 'emimage', $item['provider'], 'image_url', $code, $width, $height, "emimage", $field, $item, $node);
|
||||
$image = theme('image', array( 'path' => $url, 'alt' => $title, 'title' => $title, 'attributes' => $attributes, 'getsize' => FALSE ) );
|
||||
|
||||
// Set up full rel attribute.
|
||||
$image_grouping = variable_get('lightbox2_emimage_group_node_id', 1);
|
||||
if ($image_grouping == 1) {
|
||||
$full_rel = $rel .'['. $field['field_name'] .']['. $caption .']';
|
||||
}
|
||||
elseif ($image_grouping == 2 && !empty($node->nid)) {
|
||||
$full_rel = $rel .'['. $node->nid .']['. $caption .']';
|
||||
}
|
||||
elseif ($image_grouping == 3 && !empty($node->nid)) {
|
||||
$full_rel = $rel .'['. $field['field_name'] .'_'. $node->nid .']['. $caption .']';
|
||||
}
|
||||
elseif (isset($args['rel_grouping'])) {
|
||||
$full_rel = $rel .'['. $args['rel_grouping'] .']['. $caption .']';
|
||||
}
|
||||
else {
|
||||
$rel = $full_rel .'[]['. $caption .']';
|
||||
}
|
||||
|
||||
if ($orig_rel != 'lightframe') {
|
||||
$link_attributes = array('rel' => $full_rel);
|
||||
$full_width = $field['widget']['full_width'] == '' ? variable_get('emimage_default_full_width', EMIMAGE_DEFAULT_FULL_WIDTH) : $field['widget']['full_width'];
|
||||
$full_height = $field['widget']['full_height'] == '' ? variable_get('emimage_default_full_height', EMIMAGE_DEFAULT_FULL_HEIGHT) : $field['widget']['full_height'];
|
||||
$full_image_url = module_invoke('emfield', 'include_invoke', 'emimage', $item['provider'], 'image_url', $code, $full_width, $full_height, "emimage", $field, $item, $node);
|
||||
$output = l($image, $full_image_url, array('attributes' => $link_attributes, 'html' => TRUE));
|
||||
}
|
||||
else {
|
||||
$frame_width = variable_get('lightbox2_default_frame_width', 600);
|
||||
$frame_height = variable_get('lightbox2_default_frame_height', 400);
|
||||
$frame_size = 'width:'. $frame_width .'px; height:'. $frame_height .'px;';
|
||||
$full_rel = preg_replace('/\]\[/', "|$frame_size][", $full_rel);
|
||||
$link_attributes = array('rel' => $full_rel);
|
||||
$output = l($image, $link .'/lightbox2', array('attributes' => $link_attributes, 'html' => TRUE));
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Generate the HTML output to open embedded cck videos in a lightbox.
|
||||
*
|
||||
* @param $element
|
||||
* The CCK field element.
|
||||
* @return
|
||||
* HTML output for displaying the video and link.
|
||||
*/
|
||||
/*function theme_lightbox2_formatter_emvideo_lightvideo($variables) {
|
||||
$element = $variables['element'];
|
||||
if (!variable_get('lightbox2_enable_video', FALSE)) {
|
||||
return;
|
||||
}
|
||||
$field = content_fields($element['#field_name'], $element['#type_name']);
|
||||
$item = $element['#item'];
|
||||
$formatter = "emvideo";
|
||||
$node = node_load($element['#node']->nid);
|
||||
|
||||
return module_invoke('emfield', 'emfield_field_formatter', $field, $item, $formatter, $node, 'lightbox2');
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Generate the HTML output to open embedded cck videos in a lightbox.
|
||||
*
|
||||
* @param $field
|
||||
* The CCK field the action is being performed on.
|
||||
* @param $item
|
||||
* An array, keyed by column, of the data stored for this item in this field.
|
||||
* @param $formatter
|
||||
* The formatter to use for the field.
|
||||
* @param $node
|
||||
* The node object.
|
||||
* @param $options
|
||||
* Options array.
|
||||
* @return
|
||||
* Themed link to the embedded media field video.
|
||||
*/
|
||||
/*function theme_lightbox2_emvideo($variables) {
|
||||
$field = $variables['field'];
|
||||
$item = $variables['item'];
|
||||
$formatter = $variables['formatter'];
|
||||
$node = $variables['node'];
|
||||
$thumbnail = isset($options['thumbnail']) ? $options['thumbnail'] : theme('emvideo_video_thumbnail', $field, $item, 'video_thumbnail', $node, TRUE, $options);
|
||||
// if options title set use that, otherwise use video title if set in node,
|
||||
// otherwise try node title, then widget thumbnail setting and fallback to
|
||||
// default string.
|
||||
$title = isset($options['title']) ? $options['title'] : (isset($item['data']['emthumb']['emthumb_title']) ? $item['data']['emthumb']['emthumb_title'] : (isset($node->title) ? $node->title : (isset($field['widget']['thumbnail_link_title']) ? $field['widget']['thumbnail_link_title'] : variable_get('emvideo_default_thumbnail_link_title', t('See video')))));
|
||||
|
||||
$destination = 'video-cck/lightbox2/'. $node->nid .'/'. $field['widget']['video_width'] .'/'. $field['widget']['video_height'] .'/'. $field['field_name'] .'/'. $item['provider'] .'/'. $item['value'];
|
||||
$width = $field['widget']['video_width'] + 20;
|
||||
$height = $field['widget']['video_height'] + 20;
|
||||
if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE)) {
|
||||
$width = $field['widget']['video_width'] + 40;
|
||||
$height = $field['widget']['video_height'] + 40;
|
||||
}
|
||||
$rel_full = 'lightframe['. $field['type_name'] . '|width:'. $width .'px; height:'. $height .'px; overflow:visible;]';
|
||||
|
||||
$attributes = array(
|
||||
'attributes' => array(
|
||||
'title' => $title,
|
||||
'class' => $field['type_name'],
|
||||
'rel' => $rel_full,
|
||||
),
|
||||
'query' => NULL,
|
||||
'fragment' => NULL,
|
||||
'absolute' => FALSE,
|
||||
'html' => TRUE,
|
||||
);
|
||||
|
||||
$output = l($thumbnail, $destination, $attributes);
|
||||
return $output;
|
||||
}*/
|
26
sites/all/modules/lightbox2/lightbox2.info
Normal file
@ -0,0 +1,26 @@
|
||||
; $Id: lightbox2.info,v 1. 2011/01/17 11:51:34 snpower Exp $
|
||||
name = Lightbox2
|
||||
description = Enables Lightbox2 for Drupal
|
||||
core = 7.x
|
||||
package = User interface
|
||||
|
||||
files[] = lightbox2.install
|
||||
files[] = lightbox2.module
|
||||
files[] = lightbox2.formatter.inc
|
||||
files[] = lightbox2.admin.inc
|
||||
|
||||
configure = admin/config/user-interface/lightbox2
|
||||
|
||||
; Information added by drupal.org packaging script on 2010-09-24
|
||||
version = "7.x-dev"
|
||||
core = "7.x"
|
||||
project = "lightbox2"
|
||||
|
||||
|
||||
|
||||
; Information added by drupal.org packaging script on 2011-10-17
|
||||
version = "7.x-1.0-beta1"
|
||||
core = "7.x"
|
||||
project = "lightbox2"
|
||||
datestamp = "1318819001"
|
||||
|
68
sites/all/modules/lightbox2/lightbox2.insert.inc
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
// $Id: lightbox2.insert.inc,v 1.1.2.6 2010/09/22 10:47:15 snpower Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Lightbox2 support for Insert module.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implementation of hook_insert_styles().
|
||||
*/
|
||||
function lightbox2_insert_styles() {
|
||||
$cck_formatters = lightbox2_field_formatter_info();
|
||||
$insert_styles = array();
|
||||
// Reformat CCK formatter ids as Insert style ids.
|
||||
foreach ($cck_formatters as $formatter_id => $formatter_info) {
|
||||
// Currently only the "imagefield--lightbox2" formatters are implemented as styles.
|
||||
if (preg_match('/^imagefield__lightbox2__((?:_(?!_)|[^_])+)__((?:_(?!_)|[^_])+)$/', $formatter_id, $matches)) {
|
||||
$style_id = 'lightbox2--' . $matches[1] . '--' . $matches[2];
|
||||
$insert_styles[$style_id] = $formatter_info;
|
||||
}
|
||||
}
|
||||
return $insert_styles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of hook_insert_content().
|
||||
*/
|
||||
function lightbox2_insert_content($item, $style, $widget) {
|
||||
if (preg_match('/^lightbox2--((?:-(?!-)|[^-])+)--((?:-(?!-)|[^-])+)$/', $style['name'], $matches)) {
|
||||
$image_preset_name = $matches[1];
|
||||
$link_preset_name = $matches[2];
|
||||
return theme('lightbox2_insert_image', $item, $widget, 'view', $image_preset_name, $link_preset_name);
|
||||
}
|
||||
else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Theme the content that will be inserted for Lightbox2 presets.
|
||||
*/
|
||||
function template_preprocess_lightbox2_insert_image(&$vars) {
|
||||
if ($vars['image_preset_name'] != 'original') {
|
||||
$filepath = imagecache_create_path($vars['image_preset_name'], $vars['item']['filepath']);
|
||||
}
|
||||
else {
|
||||
$filepath = $vars['item']['filepath'];
|
||||
}
|
||||
$vars['url'] = insert_create_url($filepath);
|
||||
|
||||
if ($vars['link_preset_name'] != 'original') {
|
||||
$linkpath = imagecache_create_path($vars['link_preset_name'], $vars['item']['filepath']);
|
||||
}
|
||||
else {
|
||||
$linkpath = $vars['item']['filepath'];
|
||||
}
|
||||
$vars['linkurl'] = insert_create_url($linkpath);
|
||||
|
||||
$vars['download_link'] = '';
|
||||
$download_link_text = check_plain(variable_get('lightbox2_download_link_text', 'Download Original'));
|
||||
if (!empty($download_link_text) && user_access('download original image')) {
|
||||
$vars['download_link'] = '<br /><br />' . l($download_link_text, $vars['linkurl'], array('attributes' => array('target' => '_blank', 'id' => 'lightbox2-download-link-text')));
|
||||
}
|
||||
|
||||
$vars['class'] = !empty($vars['widget']['insert_class']) ? $vars['widget']['insert_class'] : '';
|
||||
}
|
||||
|
202
sites/all/modules/lightbox2/lightbox2.install
Normal file
@ -0,0 +1,202 @@
|
||||
<?php
|
||||
// $Id: lightbox2.install,v 1.1.4.4.2.49 2010/09/22 17:26:19 snpower Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Installation functions for Lightbox2.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implementation of hook_install().
|
||||
*/
|
||||
function lightbox2_install() {
|
||||
module_invoke('content', 'clear_type_cache');
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of hook_uninstall().
|
||||
*/
|
||||
function lightbox2_uninstall() {
|
||||
// Delete the variables we created.
|
||||
variable_del('lightbox2_plus');
|
||||
variable_del('lightbox2G2_filter');
|
||||
|
||||
// Remove the general settings.
|
||||
variable_del('lightbox2_lite');
|
||||
variable_del('lightbox2_use_alt_layout');
|
||||
variable_del('lightbox2_force_show_nav');
|
||||
variable_del('lightbox2_loop_items');
|
||||
variable_del('lightbox2_image_count_str');
|
||||
variable_del('lightbox2_page_count_str');
|
||||
variable_del('lightbox2_video_count_str');
|
||||
variable_del('lightbox2_disable_resize');
|
||||
variable_del('lightbox2_disable_zoom');
|
||||
variable_del('lightbox2_enable_login');
|
||||
variable_del('lightbox2_enable_contact');
|
||||
variable_del('lightbox2_enable_video');
|
||||
variable_del('lightbox2_flv_player_path');
|
||||
variable_del('lightbox2_flv_player_flashvars');
|
||||
variable_del('lightbox2_page_init_action');
|
||||
variable_del('lightbox2_page_list');
|
||||
variable_del('lightbox2_disable_these_urls');
|
||||
variable_del('lightbox2_imagefield_group_node_id');
|
||||
variable_del('lightbox2_imagefield_use_node_title');
|
||||
variable_del('lightbox2_view_image_text');
|
||||
variable_del('lightbox2_image_ncck_group_node_id');
|
||||
variable_del('lightbox2_show_caption');
|
||||
// Advanced settings.
|
||||
variable_del('lightbox2_js_location');
|
||||
variable_del('lightbox2_keys_close');
|
||||
variable_del('lightbox2_keys_previous');
|
||||
variable_del('lightbox2_keys_next');
|
||||
variable_del('lightbox2_keys_zoom');
|
||||
variable_del('lightbox2_keys_play_pause');
|
||||
variable_del('lightbox2_top_position');
|
||||
variable_del('lightbox2_border_size');
|
||||
variable_del('lightbox2_box_color');
|
||||
variable_del('lightbox2_font_color');
|
||||
variable_del('lightbox2_overlay_opacity');
|
||||
variable_del('lightbox2_overlay_color');
|
||||
variable_del('lightbox2_disable_close_click');
|
||||
variable_del('lightbox2_resize_sequence');
|
||||
variable_del('lightbox2_resize_speed');
|
||||
variable_del('lightbox2_fadein_speed');
|
||||
variable_del('lightbox2_slidedown_speed');
|
||||
|
||||
// Remove iframe settings.
|
||||
variable_del('lightbox2_default_frame_width');
|
||||
variable_del('lightbox2_default_frame_height');
|
||||
variable_del('lightbox2_frame_border');
|
||||
|
||||
// Remove slideshow settings.
|
||||
variable_del('lightbox2_slideshow_interval');
|
||||
variable_del('lightbox2_slideshow_automatic_start');
|
||||
variable_del('lightbox2_slideshow_automatic_exit');
|
||||
variable_del('lightbox2_slideshow_show_play_pause');
|
||||
variable_del('lightbox2_slideshow_pause_on_next_click');
|
||||
variable_del('lightbox2_slideshow_pause_on_previous_click');
|
||||
variable_del('lightbox2_loop_slides');
|
||||
|
||||
// Remove the automatic image handling settings.
|
||||
variable_del('lightbox2_image_node');
|
||||
variable_del('lightbox2_display_image_size');
|
||||
variable_del('lightbox2_trigger_image_size');
|
||||
variable_del('lightbox2_disable_nested_galleries');
|
||||
variable_del('lightbox2_flickr');
|
||||
variable_del('lightbox2_gallery2_blocks');
|
||||
variable_del('lightbox2_inline');
|
||||
variable_del('lightbox2_image_assist_custom');
|
||||
variable_del('lightbox2_custom_class_handler');
|
||||
variable_del('lightbox2_custom_trigger_classes');
|
||||
variable_del('lightbox2_node_link_text');
|
||||
variable_del('lightbox2_download_link_text');
|
||||
variable_del('lightbox2_node_link_target');
|
||||
variable_del('lightbox2_show_caption');
|
||||
variable_del('lightbox2_image_group');
|
||||
variable_del('lightbox2_disable_nested_acidfree_galleries');
|
||||
variable_del('lightbox2_acidfree_video');
|
||||
}
|
||||
|
||||
/**
|
||||
* One of the variables was renamed from 'lightbox2_plus' to 'lightbox2_lite'.
|
||||
*
|
||||
* Should have been created with lightbox2_update_600x() naming convention, but
|
||||
* too late now.
|
||||
*/
|
||||
function lightbox2_update_1() {
|
||||
$ret = array();
|
||||
$ret[] = update_sql('UPDATE {variable} SET name="lightbox2_lite"
|
||||
WHERE name="lightbox2_plus";');
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 'lightbox2_image_group' variable has been removed and others need to be
|
||||
* updated accordingly.
|
||||
*
|
||||
* Should have been created with lightbox2_update_600x() naming convention, but
|
||||
* too late now.
|
||||
*/
|
||||
function lightbox2_update_2() {
|
||||
$image_group = variable_get('lightbox2_image_group', TRUE);
|
||||
$image_node = variable_get('lightbox2_image_node', TRUE);
|
||||
$flickr = variable_get('lightbox2_flickr', TRUE);
|
||||
$gallery2 = variable_get('lightbox2_gallery2_blocks', TRUE);
|
||||
$inline = variable_get('lightbox2_inline', TRUE);
|
||||
$image_assist = variable_get('lightbox2_image_assist_custom', TRUE);
|
||||
|
||||
if ($image_group) {
|
||||
if ($image_node) {
|
||||
variable_set('lightbox2_image_node', 2);
|
||||
}
|
||||
if ($flickr) {
|
||||
variable_set('lightbox2_flickr', 2);
|
||||
}
|
||||
if ($gallery2) {
|
||||
variable_set('lightbox2_gallery2_blocks', 2);
|
||||
}
|
||||
if ($inline) {
|
||||
variable_set('lightbox2_inline', 2);
|
||||
}
|
||||
if ($image_assist) {
|
||||
variable_set('lightbox2_image_assist_custom', 2);
|
||||
}
|
||||
}
|
||||
variable_del('lightbox2_image_group');
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* 'lightbox2_disable_these_urls' was renamed to 'lightbox2_page_list'.
|
||||
* 'lightbox2_page_init_action' was also added which determines whether the
|
||||
* lightbox functionality should be enabled or disabled for the page list.
|
||||
* 'lightbox2_disable_zoom' has been replaced by 'lightbox2_disable_resize'.
|
||||
* 'lightbox2_disable_zoom' still exists but has a different meaning.
|
||||
*
|
||||
* Should have been created with lightbox2_update_600x() naming convention, but
|
||||
* too late now.
|
||||
*/
|
||||
function lightbox2_update_3() {
|
||||
$disabled_urls = variable_get('lightbox2_disable_these_urls', '');
|
||||
variable_set('lightbox2_page_init_action', 'page_disable');
|
||||
variable_set('lightbox2_page_list', $disabled_urls);
|
||||
variable_del('lightbox2_disable_these_urls');
|
||||
|
||||
$disable_zoom = variable_get('lightbox2_disable_zoom', FALSE);
|
||||
variable_set('lightbox2_disable_resize', $disable_zoom);
|
||||
variable_set('lightbox2_disable_zoom', FALSE);
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
function lightbox2_update_6001() {
|
||||
$size = variable_get('lightbox2_display_image_size', 'original');
|
||||
if ($size == '') {
|
||||
variable_set('lightbox2_display_image_size', 'original');
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* 'lightbox2_slideshow_pause_on_previous_click' was mis-named as
|
||||
* 'lightbox2_slideshow_pause_on_prev_click'.
|
||||
*/
|
||||
function lightbox2_update_6002() {
|
||||
$vars = variable_init();
|
||||
if (array_key_exists('lightbox2_slideshow_pause_on_prev_click', $vars)) {
|
||||
$value = $vars['lightbox2_slideshow_pause_on_prev_click'];
|
||||
variable_set('lightbox2_slideshow_pause_on_previous_click', $value);
|
||||
variable_del('lightbox2_slideshow_pause_on_prev_click');
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Menu paths changed.
|
||||
*/
|
||||
function lightbox2_update_6003() {
|
||||
return array();
|
||||
}
|
||||
|
1561
sites/all/modules/lightbox2/lightbox2.module
Normal file
47
sites/all/modules/lightbox2/lightbox2.views.inc
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
// $Id: lightbox2.views.inc,v 1.1.2.1 2009/09/05 09:52:26 snpower Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* lightbox2.views.inc
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implementation of hook_views_data()
|
||||
*/
|
||||
function lightbox2_views_data() {
|
||||
|
||||
$data['lightbox2']['table']['group'] = t('Lightbox');
|
||||
|
||||
$data['lightbox2']['table']['join'] = array(
|
||||
'#global' => array(),
|
||||
);
|
||||
|
||||
$data['lightbox2']['lightbox2'] = array(
|
||||
'group' => t('Lightbox'),
|
||||
'field' => array(
|
||||
'title' => t('Lightbox trigger'),
|
||||
'help' => t('Provide custom text or link.'),
|
||||
'handler' => 'lightbox2_handler_field_lightbox2',
|
||||
),
|
||||
);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of hook_views_handlers() to register all of the basic handlers
|
||||
* views uses.
|
||||
*/
|
||||
function lightbox2_views_handlers() {
|
||||
return array(
|
||||
'info' => array(
|
||||
'path' => drupal_get_path('module', 'lightbox2'),
|
||||
),
|
||||
'handlers' => array(
|
||||
'lightbox2_handler_field_lightbox2' => array(
|
||||
'parent' => 'views_handler_field',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
@ -0,0 +1,152 @@
|
||||
<?php
|
||||
/**
|
||||
* @file
|
||||
* Contain the integration with views
|
||||
* A handler to provide a field that is completely custom by the administrator.
|
||||
*
|
||||
* @ingroup views_field_handlers
|
||||
*/
|
||||
class lightbox2_handler_field_lightbox2 extends views_handler_field {
|
||||
function query() {
|
||||
// Do nothing, as this handler does not need to do anything to the query itself.
|
||||
}
|
||||
|
||||
function option_definition() {
|
||||
$options = parent::option_definition();
|
||||
|
||||
$options['trigger_field'] = array('default' => '');
|
||||
$options['popup'] = array('default' => '');
|
||||
$options['caption'] = array('default' => '');
|
||||
$options['rel_group'] = array('default' => TRUE);
|
||||
$options['custom_group'] = array('default' => '');
|
||||
$options['height'] = array('default' => '400px');
|
||||
$options['width'] = array('default' => '600px');
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
function options_form(&$form, &$form_state) {
|
||||
parent::options_form($form, $form_state);
|
||||
|
||||
$fields = array('trigger_field' => t('<None>'));
|
||||
foreach ($this->view->display_handler->get_handlers('field') as $field => $handler) {
|
||||
// We only use fields up to this one. Obviously we can't use this handler
|
||||
// as the trigger handler.
|
||||
if ($field == $this->options['id']) {
|
||||
break;
|
||||
}
|
||||
|
||||
$fields[$field] = $handler->definition['title'];
|
||||
}
|
||||
|
||||
$form['trigger_field'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Trigger field'),
|
||||
'#description' => t('Select the field that should be turned into the trigger for the lightbox. Only fields that appear before this one in the field list may be used.'),
|
||||
'#options' => $fields,
|
||||
'#default_value' => $this->options['trigger_field'],
|
||||
'#weight' => -12,
|
||||
);
|
||||
|
||||
$form['popup'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Popup'),
|
||||
'#description' => t('Combine tokens from the "Replacement patterns" below and html to create what the lightbox popup will become.'),
|
||||
'#default_value' => $this->options['popup'],
|
||||
'#weight' => -11,
|
||||
);
|
||||
|
||||
$form['caption'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Caption'),
|
||||
'#description' => t('Combine tokens from the "Replacement patterns" below and html to create the caption shown under the lightbox. Leave empty for no caption.'),
|
||||
'#default_value' => $this->options['caption'],
|
||||
'#weight' => -10,
|
||||
);
|
||||
|
||||
$form['rel_group'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Automatic generated Lightbox group'),
|
||||
'#description' => t('Enable Lightbox grouping using a generated group name for this view.'),
|
||||
'#default_value' => $this->options['rel_group'],
|
||||
'#weight' => -9,
|
||||
);
|
||||
|
||||
$form['custom_group'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Custom Lightbox group'),
|
||||
'#description' => t('Enable Lightbox grouping with a given string as group. Overrides the automatically generated group name above.'),
|
||||
'#default_value' => $this->options['custom_group'],
|
||||
'#weight' => -8,
|
||||
);
|
||||
|
||||
$form['height'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Height'),
|
||||
'#description' => t('Specify the height of the lightbox2 popup window. Because the content is dynamic, we cannot detect this value automatically.'),
|
||||
'#default_value' => $this->options['height'],
|
||||
'#weight' => -7,
|
||||
);
|
||||
|
||||
$form['width'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Width'),
|
||||
'#description' => t('Specify the width of the lightbox2 popup window. Because the content is dynamic, we cannot detect this value automatically.'),
|
||||
'#default_value' => $this->options['width'],
|
||||
'#weight' => -6,
|
||||
);
|
||||
|
||||
|
||||
|
||||
// Remove the checkboxs and other irrelevant controls.
|
||||
unset($form['alter']['alter_text']);
|
||||
unset($form['alter']['make_link']);
|
||||
unset($form['alter']['text']);
|
||||
unset($form['alter']['path']);
|
||||
unset($form['alter']['alt']);
|
||||
unset($form['alter']['prefix']);
|
||||
unset($form['alter']['suffix']);
|
||||
unset($form['alter']['text']['#dependency']);
|
||||
unset($form['alter']['text']['#process']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the trigger field and its linked popup information.
|
||||
*/
|
||||
function render($values) {
|
||||
// We need to have multiple unique IDs, one for each record.
|
||||
static $i = 0;
|
||||
|
||||
static $link;
|
||||
|
||||
if (!empty($this->options['trigger_field'])) {
|
||||
|
||||
// We don't actually use the link, but we need it there for lightbox to function.
|
||||
if (empty($link)) {
|
||||
// Get the path name.
|
||||
$path = isset($_GET['q']) ? $_GET['q'] : '<front>';
|
||||
$link = url($path, array('absolute' => TRUE));
|
||||
}
|
||||
|
||||
// Get the token information and generate the value for the popup and the
|
||||
// caption.
|
||||
$tokens = $this->get_render_tokens($this->options['alter']);
|
||||
$popup = filter_xss_admin($this->options['popup']);
|
||||
$caption = filter_xss_admin($this->options['caption']);
|
||||
$popup = strtr($popup, $tokens);
|
||||
$caption = strtr($caption, $tokens);
|
||||
|
||||
$i++;
|
||||
|
||||
// The outside div is there to hide all of the divs because if the specific lightbox
|
||||
// div is hidden it won't show up as a lightbox. We also specify a group
|
||||
// in the rel attribute in order to link the whole View together for paging.
|
||||
$group_name = !empty($this->options['custom_group']) ? $this->options['custom_group'] : ($this->options['rel_group'] ? 'lightbox-popup-' . $this->view->name . '-' . implode('/', $this->view->args) : '');
|
||||
return "<a href='$link #lightbox-popup-{$i}' rel='lightmodal[{$group_name}|width:" . ($this->options['width'] ? $this->options['width'] : '600px') . ';height:' . ($this->options['height'] ? $this->options['height'] : '600px') . "][" . $caption . "]'>" . $tokens["[{$this->options['trigger_field']}]"] . "</a>
|
||||
<div style='display: none;'><div id='lightbox-popup-{$i}' class='lightbox-popup'>$popup</div></div>";
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
57
sites/all/modules/lightbox2/page--node--lightbox2.tpl.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
// $Id: page-node-lightbox2.tpl.php,v 1.1.2.2 2008/06/11 22:16:38 snpower Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Template file for displaying the node content, associated with an image, in
|
||||
* the lightbox. It displays it without any sidebars, etc.
|
||||
*/
|
||||
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
|
||||
<head>
|
||||
<title><?php print $head_title ?></title>
|
||||
<?php print $head ?>
|
||||
<?php print $styles ?>
|
||||
<?php print $scripts ?>
|
||||
<!--[if lt IE 7]>
|
||||
<?php print phptemplate_get_ie_styles(); ?>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Layout -->
|
||||
|
||||
<div id="wrapper">
|
||||
<div id="container" class="clear-block">
|
||||
|
||||
|
||||
<div id="center"><div id="squeeze"><div class="right-corner"><div class="left-corner">
|
||||
<?php phptemplate_comment_wrapper(NULL, $node->type); ?>
|
||||
|
||||
<?php if ($page == 0): ?>
|
||||
<h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php print $content ?>
|
||||
|
||||
<div class="clear-block clear">
|
||||
<div class="meta">
|
||||
<?php if ($taxonomy): ?>
|
||||
<div class="terms"><?php print $terms ?></div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
<?php if ($links): ?>
|
||||
<div class="links"><?php print $links; ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- close container -->
|
||||
</div> <!-- close wrapper -->
|
||||
</body>
|
||||
</html>
|