first import

This commit is contained in:
Bachir Soussi Chiadmi
2015-04-08 11:40:19 +02:00
commit 1bc61b12ad
8435 changed files with 1582817 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
=== DRUPAL 6.x-2.x ===
6.x-2.1-RC1
- BUG #834120: Fixed non-parent items displaying an arrow.
- BUG #924324: Fixed PHP notices.
- BUG #824916: Test depth before setting menuparent class.
6.x-2.1-Beta3
- TASK #323784: Move JS and CSS to theme function and remove hook_init().
6.x-2.1-Beta2
- BUG #800324: Take hidden menu items into account when applying first/last classes.
- BUG #781856: Fixed Superfish animation speed.
- FEATURE #762032: Changed ie-over class to generic over.
- BUG #798500: jQuery JS compatibility.
6.x-2.1-Beta1
- BUG #730348: Fixed Superfish animation on first load.
- BUG #363366: Moved menu-$mlid from a CSS ID to a class to prevent invalid HTML.
6.x-2.1-Alpha2
- FEATURE #301247: Add first, last, even, odd classes to menu items.
- BUG #621544: Get global setting to play nice with admin menu.
- BUG #507642: Moved CSS comment with HTML to the README so that it doesn't break CSS aggregation.
- FEATURE #457692: Add hoverIntent plugin.
6.x-2.1-Alpha1
- FEATURE #300628: Add support for i18n module menu translations.
- FEATURE #322962: Add configurable JS with Superfish.
- FEATURE #135771: Choose starting and ending menu depth.
- FEATURE #219804: Set active menu trail CSS selectors.
- FEATURE #340105: Added theme function for secondary links menu.
- TASK #340103: Renamed theme functions to module name.
- FEATURE #181446: Added RTL language support.

View 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.

View File

@@ -0,0 +1,119 @@
NICE MENUS MODULE
-----------------
Currently maintained by: Addison Berry (add1sun)
Orginally created by: Jake Gordon (jakeg) http://drupal.org/user/15674/contact and http://www.jakeg.co.uk/
This module makes it easy to add dropdown and flyout menus, using the Superfish jQuery plugin (http://users.tpg.com.au/j_birch/plugins/superfish), and falling back to CSS-only functionality when JS is disabled.
Please report any bugs, feature requests, etc. at: http://drupal.org/project/issues/nice_menus.
Installation
------------
1. Copy nice_modules folder to your sites/all/modules directory.
2. At Administer -> Site building -> Modules (admin/build/modules) enable the module.
3. Configure the module settings at Administer -> Site configuration -> Nice Menus (admin/settings/nice_menus).
4. Configure the Nice Menus block(s) at Administer -> Site building -> Blocks (admin/build/block), setting the source menu and menu style, etc.
5. Return to the blocks page and enable the Nice menus block(s), e.g. 'Nice Menu 1 (Nice Menu)' by putting it in a region.
6. See below sections on Customization and Advanced Theming as well as the handbook page (http://drupal.org/node/185543) for more tips.
Upgrading
---------
For upgrades between versions, read the UPGRADE.txt file included with the module.
Issues
------
You can track known issues at http://drupal.org/project/issues/nice_menus.
Customization
-------------
The module includes a default CSS layout file (nice_menus_default.css) which is loaded for all pages. If you don't like the default layout, it is suggested that you create a separate customized CSS file, and replace the default CSS file at Administer -> Themes -> Configure -> Global settings -> "Path to custom nice menus CSS file". This ensures smooth future upgrades as no editing of the module files is necessary. NOTE: you should not edit the regular nice_menus.css file since this contains the "logic" that makes Nice menus work.
To help understand the CSS, the HTML looks like this, where
x is a number;
TYPE is down/left/right;
PATH is the menu path such as node/343;
MID is the menu id such as 33:
<ul id='nice-menu-x' class='nice-menu nice-menu-TYPE'>
<li id='menu-MID' class='menu-path-PATH'><a href='#'>This is a menu item</a></li>
<li class='menuparent menu-path-PATH'><a href='#'>A submenu</a>
<ul...><li...>...</li>
</ul>
</li>
...
</ul>
If you have more than one nice-menu and want to target a particular one,
use its id (e.g. ul#nice-menu-2).
A good starting point for your custom file is to make a copy of the default file, then edit it to taste. Here are some common customization examples for your own stylesheet:
Make hovered links white with a black background:
ul.nice-menu li a:hover {
color: white;
background: black;
}
Make the link to the current page that you're on black with yellow text:
ul.nice-menu li a.active {
color: yellow;
background: black;
}
Get rid of all borders:
ul.nice-menu,
ul.nice-menu ul,
ul.nice-menu li {
border: 0;
}
Get rid of the borders and background colour for all top-level menu items:
ul.nice-menu,
ul.nice-menu ul,
ul.nice-menu li {
border: 0;
background: none;
}
ul.nice-menu-right li.menuparent,
ul.nice-menu-right li li.menuparent {
background: url('arrow-right.png') right center no-repeat;
}
li.menuparent li, li.menuparent ul {
background: #eee;
}
Have a nice menu stick right at the top of the page e.g. for an admin menu:
#block-nice_menus-1 {
position: absolute;
top: 0;
left: 0;
}
In Firefox, as above but where the menu doesn't move as you scroll down the page:
#block-nice_menus-1 {
position: fixed;
top: 0;
left: 0;
}
That should get you started. Really this is just about knowing your CSS and styling it the way you want it.
Advanced theming
----------------
If you're creating or modifying your own theme, you can integrate Nice menus more deeply by making use of these functions:
theme_nice_menus() -- themes any menu tree as a Nice menu.
theme_nice_menus_main_menu() -- themes your main menu as a Nice menu.
theme_nice_menus_secondary_menu() -- themes your secondary menu as a Nice menu.
If you really know what you're doing, you can probably even customize the menu tree in creative ways, as those functions allow you to pass in a custom menu tree.

View File

@@ -0,0 +1,62 @@
NICE MENUS UPGRADES
===================
5.x, 6.x-1.x ---> 6.x-2.x
-------------------------
There is an update hook and you should run update.php to get things moved
around properly. Aside from the minor database changes, there are a number of
things you should be aware of, especially in light of any customizations you
may have made.
THEME FUNCTIONS:
The theme functions have all been RENAMED to be more in line with Drupal
standards, so if you are overwriting the functions in your theme's
template.php or calling the functions anywhere in your theme, you should
update the function names. The old functions were called theme_nice_menu_* and
the new ones are theme_nice_menus_*, with an "s" to match the module name.
NEW JAVASCRIPT:
The old JS has been completely removed and replaced with JS that uses the
Superfish jQuery plugin. It now fires for ALL browsers by default, unless you
turn the JS off in your settings at Administer > Site configuration > Nice
menus (admin/build/nice_menus). If you had "Enable IE support" checked under
older versions of NM, then the new JS will be on by default. If it was
unchecked in your older version, then the update will turn JS off for you by
default. If you turn JS off on the site (or a visitor comes without JS
enabled), IE6 will no longer get the dropdown effect, but all other browsers
will fall back to CSS-only dropdowns.
CSS IDs and CLASSES:
The menu-$menuid ID has been changed to a CLASS to avoid invalid HTML when
displaying the multiple menus which use the same menu ID. If you have custom
CSS that depends on the menu ID then you need to change it to a class. For
example:
#menu-3 {color: #ff0};
would need to be changed to
.menu-3 {color: #ff0};
IE-Specific Class removed
The legacy "ie-over" class which was added for IE compatibility in the past
has been replaced with a generic, non-browser-specific, "over" class since
this is used by Superfish and should be general.
5.x ---> 6.x
------------
Due to the menu system changes from 5 to 6, when you upgrade Nice Menus, your
blocks will "forget" what menu they were set to. So take note of the blocks
and menu settings prior to upgrade, then reset them after the upgrade. See the
issue at http://drupal.org/node/524688 for more information.
4.7 ---> 5.x
------------
The CSS class has changed to change the underscore (_) to a dash (-)
The 4.7 version of class="nice_menu" is now class="nice-menu" in version 5.
You will need to adjust any Custom CSS you have added to account for this.
The default CSS that comes with nice_menus uses this new convention already.
Also note that the layout CSS for the module has been broken out into a
separate CSS file (nice_menus_default.css). You have the option of replacing
this file by creating a separate customized CSS file, and overriding the
default CSS file at Administer -> Themes -> Configure -> Global settings ->
"Path to custom nice menus CSS file".

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

View File

@@ -0,0 +1,126 @@
/*
This file contains the basic logic for nice menus, and should not be
edited. To customize the menus, it's recommended to create a custom CSS
file using nice_menus_default.css as a template, then configure the module
to use your custom CSS file (this is done in the global settings tab of
the theme administration.)
*/
/* Below should fix menu being a few pixels away in some themes, and menus disappearing behind other stuff. */
.block-nice-menus {
line-height: normal;
z-index: 10;
}
ul.nice-menu,
ul.nice-menu ul {
z-index: 5;
position: relative;
}
ul.nice-menu li {
position: relative;
}
ul.nice-menu a {
display: block;
/*Default to Blue, but override as necessary*/
color: #027AC6;
}
ul.nice-menu ul,
/* For Garland header. */
#header-region ul.nice-menu ul {
position: absolute;
visibility: hidden;
}
ul.nice-menu li.over ul {
visibility: visible;
}
ul.nice-menu ul li {
display: block;
}
ul.nice-menu:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
/* Show submenus when over their parents. */
ul.nice-menu li:hover ul,
ul.nice-menu li.menuparent li:hover ul,
ul.nice-menu li.menuparent li.menuparent li:hover ul,
ul.nice-menu li.menuparent li.menuparent li.menuparent li:hover ul,
ul.nice-menu li.over ul,
ul.nice-menu li.menuparent li.over ul,
ul.nice-menu li.menuparent li.menuparent li.over ul,
ul.nice-menu li.menuparent li.menuparent li.menuparent li.over ul,
/* Repeat all this stuff just for Garland headers. */
#header-region ul.nice-menu li:hover ul,
#header-region ul.nice-menu li.menuparent li:hover ul,
#header-region ul.nice-menu li.menuparent li.menuparent li:hover ul,
#header-region ul.nice-menu li.over ul,
#header-region ul.nice-menu li.menuparent li.over ul,
#header-region ul.nice-menu li.menuparent li.menuparent li.over ul {
visibility: visible;
}
/* Hide sub-menus initially. */
ul.nice-menu li:hover ul ul,
ul.nice-menu li:hover ul ul ul,
ul.nice-menu li:hover li:hover ul ul,
ul.nice-menu li:hover li:hover ul ul ul,
ul.nice-menu li:hover li:hover li:hover ul ul,
ul.nice-menu li:hover li:hover li:hover ul ul ul,
ul.nice-menu li.over ul ul,
ul.nice-menu li.over ul ul ul,
ul.nice-menu li.over li.over ul ul,
ul.nice-menu li.over li.over ul ul ul,
ul.nice-menu li.over li.over li.over ul ul,
ul.nice-menu li.over li.over li.over ul ul ul,
/* Repeat all this stuff just for Garland headers. */
#header-region ul.nice-menu li:hover ul ul,
#header-region ul.nice-menu li:hover ul ul ul,
#header-region ul.nice-menu li:hover li:hover ul ul,
#header-region ul.nice-menu li:hover li:hover ul ul ul,
#header-region ul.nice-menu li:hover li:hover li:hover ul ul,
#header-region ul.nice-menu li:hover li:hover li:hover ul ul ul,
#header-region ul.nice-menu li.over ul ul,
#header-region ul.nice-menu li.over ul ul ul,
#header-region ul.nice-menu li.over li.over ul ul,
#header-region ul.nice-menu li.over li.over ul ul ul,
#header-region ul.nice-menu li.over li.over li.over ul ul,
#header-region ul.nice-menu li.over li.over li.over ul ul ul {
visibility: hidden;
}
/***************
IE 6 Fixes
***************/
/* Iframe to fix z-index bug when menu hovers over <select> fields. */
ul.nice-menu li.menuparent ul,
/* For Garland header. */
#header-region ul.nice-menu li.menuparent ul {
overflow: visible !important;
/* overflow: hidden; */
}
ul.nice-menu li.menuparent ul iframe,
/* For Garland header. */
#header-region ul.nice-menu li.menuparent ul iframe {
display: none;
display/**/: block;
position: absolute;
top: 0;
left: 0;
z-index: -1;
filter: mask();
width: 20px;
height: 20px;
}

View File

@@ -0,0 +1,15 @@
name = Nice Menus
description = CSS/jQuery drop-down, drop-right and drop-left menus to be placed in blocks
dependencies[] = menu
core = 7.x
configure = admin/config/user-interface/nice_menus
files[] = nice_menus.install
files[] = nice_menus.module
; Information added by drupal.org packaging script on 2012-02-23
version = "7.x-2.1"
core = "7.x"
project = "nice_menus"
datestamp = "1329972942"

View File

@@ -0,0 +1,34 @@
<?php
/**
* @file
* Update functions for Nice menus.
*/
/**
* Implements hook_update_N().
*/
function nice_menus_update_6000() {
// Existing blocks need to be set to no caching.
$ret = array();
// TODO update_sql has been removed. Use the database API for any schema or data changes.
$ret[] = array() /* update_sql("UPDATE {block} SET cache = -1 WHERE module = 'nice_menus'") */;
// hook_update_N() no longer returns a $ret array. Instead, return
// nothing or a translated string indicating the update ran successfully.
// See http://drupal.org/node/224333#update_sql.
return t('TODO Add a descriptive string here to show in the UI.') /* $ret */;
}
/**
* Implements hook_update_N().
*/
function nice_menus_update_6001() {
// Switch the JS toggle variable name.
$old_setting = variable_get('nice_menus_ie', 1);
variable_set('nice_menus_js', $old_setting);
variable_del('nice_menus_ie');
// hook_update_N() no longer returns a $ret array. Instead, return
// nothing or a translated string indicating the update ran successfully.
// See http://drupal.org/node/224333#update_sql.
return t('TODO Add a descriptive string here to show in the UI.') /* array() */;
}

View File

@@ -0,0 +1,24 @@
// This uses Superfish 1.4.8
// (http://users.tpg.com.au/j_birch/plugins/superfish)
// Add Superfish to all Nice menus with some basic options.
(function ($) {
$(document).ready(function() {
$('ul.nice-menu').superfish({
// Apply a generic hover class.
hoverClass: 'over',
// Disable generation of arrow mark-up.
autoArrows: false,
// Disable drop shadows.
dropShadows: false,
// Mouse delay.
delay: Drupal.settings.nice_menus_options.delay,
// Animation speed.
speed: Drupal.settings.nice_menus_options.speed
// Add in Brandon Aarons bgIframe plugin for IE select issues.
// http://plugins.jquery.com/node/46/release
}).find('ul').bgIframe({opacity:false});
$('ul.nice-menu ul').css('display', 'none');
});
})(jQuery);

View File

@@ -0,0 +1,570 @@
<?php
/**
* @file
* Module to enable CSS dropdown and flyout menus.
*
* Maintainer: Addison Berry (add1sun)
* Originally written by Jake Gordon (jakeg)
*/
/**
* Implements hook_help().
*/
function nice_menus_help($path, $arg) {
$output = '';
switch ($path) {
case 'admin/config/modules#description':
$output .= t('Make drop down/flyout CSS menus for site and admin menus.');
break;
case 'admin/config/nice_menus':
$output .= t('<p>This is a simple module that enables the site to have drop down/flyout CSS menus for site and admin navigation.</p><p>Remember to activate and configure the menu blocks in !link</p>', array('!link' => l('admin/structure/block', 'admin/structure/block')));
break;
}
return $output;
}
/**
* Implements hook_form_alter().
*/
function nice_menus_form_alter(&$form, $form_state, $form_id) {
switch ($form_id) {
case 'system_theme_settings':
// This is a global setting, so only insert the field
// on the global settings page.
if (arg(4) && arg(4) != 'global') {
return;
}
// Have to add a custom submit handler since this form doesn't use
// the standard system submit handler.
$form['#submit'][] = 'nice_menus_system_theme_settings_submit';
// Add global theme setting for a custom CSS file.
$form['nice_menus_custom_css'] = array(
'#type' => 'textfield',
'#title' => t('Path to custom Nice menus CSS file'),
'#description' => t('To override the default Nice menus CSS layout, enter the path to your custom CSS file. It should be a relative path from the root of your Drupal install (e.g. sites/all/themes/example/mymenu.css).'),
'#default_value' => variable_get('nice_menus_custom_css', ''),
// Field appears below submit buttons without this -- yucky.
'#weight' => 0,
);
break;
}
}
/**
* Records the Nice menu custom CSS file per theme.
*/
function nice_menus_system_theme_settings_submit($form, &$form_state) {
variable_set('nice_menus_custom_css', $form_state['values']['nice_menus_custom_css']);
}
/**
* Implements hook_menu().
*/
function nice_menus_menu() {
$items['admin/config/user-interface/nice_menus'] = array(
'title' => 'Nice menus',
'description' => 'Configure Nice menus.',
'page callback' => 'drupal_get_form',
'page arguments' => array('nice_menus_admin_settings'),
'access arguments' => array('administer site configuration'),
'type' => MENU_NORMAL_ITEM,
);
return $items;
}
/**
* Settings form as implemented by hook_menu
*/
function nice_menus_admin_settings($form, &$form_state) {
$form['nice_menus_number'] = array(
'#type' => 'textfield',
'#description' => t('The total number of independent Nice menus blocks you want. Enter a number between 0 and 99. If you set this to 0, you will have no blocks created but you can still use the Nice menus theme functions directly in your theme.'),
'#default_value' => variable_get('nice_menus_number', '2'),
'#size' => 2,
);
$form['nice_menus_js'] = array(
'#type' => 'checkbox',
'#title' => t('Use JavaScript'),
'#description' => t('This will add Superfish Jquery to Nice menus. This is required for Nice menus to work properly in Internet Explorer.'),
'#default_value' => variable_get('nice_menus_js', 1),
);
$form['nice_menus_sf_options'] = array(
'#type' => 'fieldset',
'#title' => t('Advanced: Superfish options'),
'#description' => t('You can change the default Superfish options by filling out the desired values here. These only take effect if the Use JavaScript box above is checked.'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['nice_menus_sf_options']['nice_menus_sf_delay'] = array(
'#type' => 'textfield',
'#title' => t('Mouse delay'),
'#description' => t('The delay in milliseconds that the mouse can remain outside a submenu without it closing.'),
'#default_value' => variable_get('nice_menus_sf_delay', 800),
'#size' => 5,
);
$form['nice_menus_sf_options']['nice_menus_sf_speed'] = array(
'#type' => 'select',
'#title' => t('Animation speed'),
'#multiple' => FALSE,
'#description' => t('Speed of the menu open/close animation.'),
'#options' => array(
'slow' => t('slow'),
'normal' => t('normal'),
'fast' => t('fast'),
),
'#default_value' => variable_get('nice_menus_sf_speed', 1),
);
// Custom validation to make sure the user is entering numbers.
$form['#validate'][] = 'nice_menus_settings_validate';
return system_settings_form($form);
}
/**
* Custom validation for the settings form.
*/
function nice_menus_settings_validate($form, &$form_state) {
$number = $form_state['values']['nice_menus_number'];
// Check to make sure it is a number and that is a maximum of 2 digits.
if (!is_numeric($number) || strlen($number) > 2) {
form_set_error('nice_menus_number', t('You must enter a number from 0 to 99.'));
}
}
/**
* Implements hook_init().
*
* We are adding the JavaScript and CSS here rather than theme_nice_menu
* because when block caching is enabled none of it would get fired
* and the menus are unstyled.
*/
function nice_menus_init() {
// Add Superfish JavaScript, if enabled.
if (variable_get('nice_menus_js', 1) == 1) {
// The script, from http://users.tpg.com.au/j_birch/plugins/superfish.
drupal_add_js(drupal_get_path('module', 'nice_menus') . '/superfish/js/superfish.js');
// Add the Superfish options variables.
drupal_add_js(array(
'nice_menus_options' => array(
'delay' => variable_get('nice_menus_sf_delay', 800),
'speed' => variable_get('nice_menus_sf_speed', 1),
),
), array('type' => 'setting', 'scope' => JS_DEFAULT));
// Add the bgIframe plugin.
drupal_add_js(drupal_get_path('module', 'nice_menus') . '/superfish/js/jquery.bgiframe.min.js');
// Add the HoverIntent plugin.
drupal_add_js(drupal_get_path('module', 'nice_menus') . '/superfish/js/jquery.hoverIntent.minified.js');
// The Nice menus implementation.
drupal_add_js(drupal_get_path('module', 'nice_menus') . '/nice_menus.js');
}
// Add main CSS functionality.
drupal_add_css(drupal_get_path('module', 'nice_menus') . '/nice_menus.css', array('group' => CSS_DEFAULT, 'basename' => 'nice_menus.css'));
// Add custom CSS layout if specified.
if ($custom = variable_get('nice_menus_custom_css', '')) {
drupal_add_css($custom, array('group' => CSS_DEFAULT, 'basename' => 'nice_menus_custom.css'));
}
// Fall back to default layout.
else {
drupal_add_css(drupal_get_path('module', 'nice_menus') . '/nice_menus_default.css', array('group' => CSS_DEFAULT, 'basename' => 'nice_menus_default.css'));
}
}
/**
* Implements hook_block_info().
*/
function nice_menus_block_info() {
$blocks = array();
for ($i = 1; $i <= variable_get('nice_menus_number', '2'); $i++) {
$blocks[$i]['info'] = variable_get('nice_menus_name_' . $i, 'Nice menu ' . $i) . ' (Nice menu)';
// We have too many things changing per user, per page to cache.
$blocks[$i]['cache'] = DRUPAL_NO_CACHE;
}
return $blocks;
}
/**
* Implements hook_block_configure().
*/
function nice_menus_block_configure($delta) {
$form['nice_menus_name_' . $delta] = array(
'#type' => 'textfield',
'#title' => t('Menu Name'),
'#default_value' => variable_get('nice_menus_name_' . $delta, 'Nice menu ' . $delta),
);
$form['nice_menus_menu_' . $delta] = array(
'#type' => 'select',
'#title' => t('Menu Parent'),
'#description' => t('The menu parent from which to show a Nice menu.'),
'#default_value' => variable_get('nice_menus_menu_' . $delta, 'navigation:0'),
'#options' => menu_get_menus(),
);
$form['nice_menus_depth_' . $delta] = array(
'#type' => 'select',
'#title' => t('Menu Depth'),
'#description' => t('The depth of the menu, i.e. the number of child levels starting with the parent selected above. Leave set to -1 to display all children and use 0 to display no children.'),
'#default_value' => variable_get('nice_menus_depth_' . $delta, -1),
'#options' => drupal_map_assoc(range(-1, 5)),
);
$form['nice_menus_type_' . $delta] = array(
'#type' => 'select',
'#title' => t('Menu Style'),
'#description' => t('right: menu items are listed on top of each other and expand to the right') . '<br />' . t('left: menu items are listed on top of each other and expand to the left') . '<br />' . t('down: menu items are listed side by side and expand down'),
'#default_value' => variable_get('nice_menus_type_' . $delta, 'right'),
'#options' => drupal_map_assoc(array('right', 'left', 'down')),
);
return $form;
}
/**
* Implements hook_block_save().
*/
function nice_menus_block_save($delta, $edit) {
variable_set('nice_menus_name_' . $delta, $edit['nice_menus_name_' . $delta]);
variable_set('nice_menus_menu_' . $delta, $edit['nice_menus_menu_' . $delta]);
variable_set('nice_menus_depth_' . $delta, $edit['nice_menus_depth_' . $delta]);
variable_set('nice_menus_type_' . $delta, $edit['nice_menus_type_' . $delta]);
}
/**
* Implements hook_block_view().
*/
function nice_menus_block_view($delta) {
// Build the Nice menu for the block.
list($menu_name) = explode(':', variable_get('nice_menus_menu_' . $delta, 'navigation:0'));
$direction = variable_get('nice_menus_type_' . $delta, 'right');
$depth = variable_get('nice_menus_depth_' . $delta, '-1');
if ($output = theme('nice_menus', array('id' => $delta, 'menu_name' => $menu_name, 'direction' => $direction, 'depth' => $depth))) {
$block['content'] = $output['content'];
if (variable_get('nice_menus_type_' . $delta, 'right') == 'down') {
$class = 'nice-menu-hide-title';
}
else {
$class = 'nice-menu-show-title';
}
// If we're building the navigation block
// use the same block title logic as menu module.
global $user;
if ($output['subject'] == t('navigation') && $user->uid) {
$subject = $user->name;
}
else {
$subject = $output['subject'];
}
$block['subject'] = '<span class="' . $class . '">' . check_plain($subject) . '</span>';
}
else {
$block['content'] = FALSE;
}
return $block;
}
/**
* Implements hook_theme().
*/
function nice_menus_theme() {
return array(
'nice_menus_tree' => array(
'variables' => array('menu_name' => NULL, 'mlid' => NULL, 'depth' => -1, 'menu' => NULL),
),
'nice_menus_build' => array(
'variables' => array('menu' => NULL, 'depth' => -1, 'trail' => NULL),
),
'nice_menus' => array(
'variables' => array('id' => NULL, 'menu_name' => NULL, 'mlid' => NULL, 'direction' => 'right', 'depth' => -1, 'menu' => NULL),
),
'nice_menus_main_menu' => array(
'variables' => array('direction' => 'down', 'depth' => -1),
),
'nice_menus_secondary_menu' => array(
'variables' => array('direction' => 'down', 'depth' => -1),
),
);
}
/**
* Builds the active trail from the page's menu data.
*
* @param $page_menu
* The menu data for a page.
*
* @return
* An array of parent menu item ids.
*/
function nice_menus_build_page_trail($page_menu) {
$trail = array();
foreach ($page_menu as $item) {
if ($item['link']['in_active_trail']) {
$trail[] = $item['link']['mlid'];
}
if ($item['below']) {
$trail = array_merge($trail, nice_menus_build_page_trail($item['below']));
}
}
return $trail;
}
/**
* Builds the final Nice menu.
*
* @param $menu_name
* The top-level menu name that contains the menu to use (e.g. navigation
* or main-menu) for Drupal menus. For custom $menus this is just the
* name for menu display.
* @param $mlid
* The menu ID from which to start building the items, i.e. the parent
* of the displayed menu.
* @param $depth
* The number of children levels to display. Use -1 to display all children
* and use 0 to display no children.
* @param $menu
* Optional. A custom menu array to use for theming -- it should have
* the same structure as that returned by menu_tree_all_data().
*
* @return
* An HTML string of properly nested Nice menu lists.
*/
function theme_nice_menus_tree($variables) {
$menu_name = $variables['menu_name'];
$mlid = $variables['mlid'];
$depth = $variables['depth'];
$menu = $variables['menu'];
// Load the full menu array.
$menu = isset($menu) ? $menu : menu_tree_all_data($menu_name);
if (isset($menu)) {
$page_menu = menu_tree_page_data($menu_name);
$trail = nice_menus_build_page_trail($page_menu);
unset($page_menu);
}
// Allow i18n module to translate strings where available.
if (module_exists('i18n_menu')) {
$menu = i18n_menu_localize_tree($menu);
}
// Assume depth == 0 by default, overriden if mlid is specified.
$parent_depth = 0;
// For custom $menus and menus built all the way from the top-level we
// don't need to "create" the specific sub-menu and we need to get the title
// from the $menu_name since there is no "parent item" array.
// Create the specific menu if we have a mlid.
if (!empty($mlid)) {
// Load the parent menu item.
$item = menu_link_load($mlid);
$title = check_plain($item['title']);
// The depth for our parent item, if it exists.
$parent_depth = ($item['depth']) ? $item['depth'] : 0;
// Narrow down the full menu to the specific sub-tree we need.
for ($p = 1; $p < 10; $p++) {
if ($sub_mlid = $item["p$p"]) {
$subitem = menu_link_load($sub_mlid);
// Menu sets these ghetto-ass keys in _menu_tree_check_access().
$menu = $menu[(50000 + $subitem['weight']) . ' ' . $subitem['title'] . ' ' . $subitem['mlid']]['below'];
}
}
}
// Otherwise just set a title and move on.
else {
// Get the title from the DB since we don't have it in the $menu.
$result = db_query("SELECT title FROM {menu_custom} WHERE menu_name = :menu_name", array(':menu_name' => $menu_name))->fetchField();
$title = check_plain($result);
}
$output['content'] = '';
$output['subject'] = $title;
if ($menu) {
// Set the total menu depth counting from this parent if we need it.
$depth = ($depth > 0) ? ($parent_depth + $depth) : $depth;
$output['content'] .= theme('nice_menus_build', array('menu' => $menu, 'depth' => $depth, 'trail' => $trail));
}
return $output;
}
/**
* Helper function that builds the nested lists of a Nice menu.
*
* @param $menu
* Menu array from which to build the nested lists.
* @param $depth
* The number of children levels to display. Use -1 to display all children
* and use 0 to display no children.
* @param $trail
* An array of parent menu items.
*/
function theme_nice_menus_build($variables) {
$menu = $variables['menu'];
$depth = $variables['depth'];
$trail = $variables['trail'];
$output = '';
// Prepare to count the links so we can mark first, last, odd and even.
$index = 0;
$count = 0;
foreach ($menu as $menu_count) {
if ($menu_count['link']['hidden'] == 0) {
$count++;
}
}
// Get to building the menu.
foreach ($menu as $menu_item) {
$mlid = $menu_item['link']['mlid'];
// Check to see if it is a visible menu item.
if (!isset($menu_item['link']['hidden']) || $menu_item['link']['hidden'] == 0) {
// Check our count and build first, last, odd/even classes.
$index++;
$first_class = $index == 1 ? ' first ' : '';
$oddeven_class = $index % 2 == 0 ? ' even ' : ' odd ';
$last_class = $index == $count ? ' last ' : '';
// Build class name based on menu path
// e.g. to give each menu item individual style.
// Strip funny symbols.
$clean_path = str_replace(array('http://', 'www', '<', '>', '&', '=', '?', ':', '.'), '', $menu_item['link']['href']);
// Convert slashes to dashes.
$clean_path = str_replace('/', '-', $clean_path);
$class = 'menu-path-' . $clean_path;
if ($trail && in_array($mlid, $trail)) {
$class .= ' active-trail';
}
// If it has children build a nice little tree under it.
if ((!empty($menu_item['link']['has_children'])) && (!empty($menu_item['below'])) && $depth != 0) {
// Keep passing children into the function 'til we get them all.
if ($menu_item['link']['depth'] <= $depth || $depth == -1) {
$children = array(
'#theme' => 'nice_menus_build',
'#prefix' => '<ul>',
'#suffix' => '</ul>',
'#menu' => $menu_item['below'],
'#depth' => $depth,
'#trail' => $trail,
);
}
else {
$children = '';
}
// Set the class to parent only of children are displayed.
$parent_class = ($children && ($menu_item['link']['depth'] <= $depth || $depth == -1)) ? 'menuparent ' : '';
$element = array(
'#below' => $children,
'#title' => $menu_item['link']['link_title'],
'#href' => $menu_item['link']['href'],
'#localized_options' => $menu_item['link']['localized_options'],
'#attributes' => array(
'class' => array('menu-' . $mlid, $parent_class, $class, $first_class, $oddeven_class, $last_class),
),
);
$variables['element'] = $element;
$output .= theme('menu_link', $variables);
}
else {
$element = array(
'#below' => '',
'#title' => $menu_item['link']['link_title'],
'#href' => $menu_item['link']['href'],
'#localized_options' => $menu_item['link']['localized_options'],
'#attributes' => array(
'class' => array('menu-' . $mlid, $class, $first_class, $oddeven_class, $last_class),
),
);
$variables['element'] = $element;
$output .= theme('menu_link', $variables);
}
}
}
return $output;
}
/**
* Theme function to allow any menu tree to be themed as a Nice menu.
*
* @param $id
* The Nice menu ID.
* @param $menu_name
* The top parent menu name from which to build the full menu.
* @param $mlid
* The menu ID from which to build the displayed menu.
* @param $direction
* Optional. The direction the menu expands. Default is 'right'.
* @param $depth
* The number of children levels to display. Use -1 to display all children
* and use 0 to display no children.
* @param $menu
* Optional. A custom menu array to use for theming --
* it should have the same structure as that returned
* by menu_tree_all_data(). Default is the standard menu tree.
*
* @return
* An HTML string of Nice menu links.
*/
function theme_nice_menus($variables) {
$output = array(
'content' => '',
'subject' => '',
);
$id = $variables['id'];
$menu_name = $variables['menu_name'];
$mlid = $variables['mlid'];
$direction = $variables['direction'];
$depth = $variables['depth'];
$menu = $variables['menu'];
if ($menu_tree = theme('nice_menus_tree', array('menu_name' => $menu_name, 'mlid' => $mlid, 'depth' => $depth, 'menu' => $menu))) {
if ($menu_tree['content']) {
$output['content'] = '<ul class="nice-menu nice-menu-' . $direction . '" id="nice-menu-' . $id . '">' . $menu_tree['content'] . '</ul>' . "\n";
$output['subject'] = $menu_tree['subject'];
}
}
return $output;
}
/**
* Theme the main menu as a Nice menu.
*
* @param $direction
* Optional. The direction the menu expands. Default is 'down'.
* @param $depth
* The number of children levels to display. Use -1 to display all children
* and use 0 to display no children.
*
* @return
* An HTML string of Nice main menu links.
*/
function theme_nice_menus_main_menu($variables) {
$direction = $variables['direction'];
$depth = $variables['depth'];
$menu_name = variable_get('menu_main_links_source', 'main-menu');
$output = theme('nice_menus', array('id' => 0, 'menu_name' => $menu_name, 'mlid' => 0, 'direction' => $direction, 'depth' => $depth));
return $output['content'];
}
/**
* Theme the secondary menu as a Nice menu.
*
* @param $direction
* Optional. The direction the menu expands. Default is 'down'.
* @param $depth
* The number of children levels to display. Use -1 to display all children
* and use 0 to display no children.
*
* @return
* An HTML string of Nice secondary menu links.
*/
function theme_nice_menus_secondary_menu($variables) {
$direction = $variables['direction'];
$depth = $variables['depth'];
$menu_name = variable_get('menu_secondary_links_source', 'user-menu');
$output = theme('nice_menus', array('id' => 0, 'menu_name' => $menu_name, 'mlid' => 0, 'direction' => $direction, 'depth' => $depth));
return $output['content'];
}

View File

@@ -0,0 +1,204 @@
ul.nice-menu,ul.nice-menu ul
{
border-top: 1px solid #ccc;
list-style: none;
margin: 0;
padding: 0;
}
ul.nice-menu li
{
background-color: #eee;
border: 1px solid #ccc;
border-top: 0;
float: right;
}
ul.nice-menu a
{
padding: 0.3em 5px 0.3em 5px;
}
ul.nice-menu ul
{
border: 0;
border-top: 1px solid #ccc;
margin-left: 0;
right: -1px;
top: 1.8em;
}
ul.nice-menu ul li
{
width: 12.5em;
}
ul.nice-menu-right,ul.nice-menu-left,ul.nice-menu-right li,ul.nice-menu-left li
{
width: 12.5em;
}
ul.nice-menu-right ul
{
right: 12.5em;
top: -1px;
width: 12.5em;
}
ul.nice-menu-right ul ul
{
right: 12.5em;
top: -1px;
width: 12.5em;
}
ul.nice-menu-right li.menuparent,ul.nice-menu-right li li.menuparent
{
background: #eee url(arrow-right.png) right center no-repeat;
}
ul.nice-menu-right li.menuparent:hover,ul.nice-menu-right li li.menuparent:hover
{
background: #ccc url(arrow-right.png) right center no-repeat;
}
ul.nice-menu-left li ul
{
right: 12.60em;
top: -1px;
width: 12.5em;
}
ul.nice-menu-left li ul li ul
{
right: 12.60em;
top: -1px;
width: 12.5em;
}
ul.nice-menu-left li.menuparent,ul.nice-menu-left li li.menuparent
{
background: #eee url(arrow-left.png) left center no-repeat;
}
ul.nice-menu-left li.menuparent:hover,ul.nice-menu-left li li.menuparent:hover
{
background: #ccc url(arrow-left.png) left center no-repeat;
}
ul.nice-menu-left a,ul.nice-menu-left ul a
{
padding-right: 14px;
}
ul.nice-menu-down
{
border: 0;
float: right;
}
ul.nice-menu-down li
{
border-top: 1px solid #ccc;
}
ul.nice-menu-down li li
{
border-top: 0;
}
ul.nice-menu-down ul
{
right: 0;
}
ul.nice-menu-down ul li
{
clear: both;
}
ul.nice-menu-down li ul li ul
{
right: 12.5em;
top: -1px;
}
ul.nice-menu-down .menuparent a
{
padding-left: 15px;
}
ul.nice-menu-down li.menuparent
{
background: #eee url(arrow-down.png) right center no-repeat;
}
ul.nice-menu-down li.menuparent:hover
{
background: #ccc url(arrow-down.png) right center no-repeat;
}
ul.nice-menu-down li li.menuparent
{
background: #eee url(arrow-right.png) right center no-repeat;
}
ul.nice-menu-down li li.menuparent:hover
{
background: #ccc url(arrow-right.png) right center no-repeat;
}
ul.nice-menu li
{
background-image: none;
margin: 0;
padding-right: 0;
}
#header-region ul.nice-menu li
{
background: #eee;
margin: 0;
padding-bottom: 0.1em;
padding-top: 0.1em;
}
#header-region ul.nice-menu ul
{
border: 0;
border-top: 1px solid #ccc;
margin-left: 0;
right: -1px;
top: 1.8em;
}
#header-region ul.nice-menu ul
{
top: 1.7em;
}
#header-region ul.nice-menu-down li ul li ul
{
right: 12.5em;
top: -1px;
}
#header-region ul.nice-menu-down li.menuparent
{
background: #eee url(arrow-down.png) right center no-repeat;
}
#header-region ul.nice-menu-down li.menuparent:hover
{
background: #ccc url(arrow-down.png) right center no-repeat;
}
#header-region ul.nice-menu-down li li.menuparent
{
background: #eee url(arrow-right.png) right center no-repeat;
}
#header-region ul.nice-menu-down li li.menuparent:hover
{
background: #ccc url(arrow-right.png) right center no-repeat;
}

View File

@@ -0,0 +1,212 @@
/*
This is the default layout template for nice menus, and will provide
a starting point for the look of your menus. To customize, it's
recommended to create a custom CSS file using this file as a template,
then configure the module to use your custom CSS file
(this is done in the global settings tab of the theme administration.)
See README.txt and the handbook page (http://drupal.org/node/185543)
for more information on using the CSS.
*/
/******************************
Global CSS for ALL menu types
******************************/
ul.nice-menu,
ul.nice-menu ul {
list-style: none;
padding: 0;
margin: 0;
border-top: 1px solid #ccc;
}
ul.nice-menu li {
border: 1px solid #ccc;
border-top: 0;
float: left; /* LTR */
background-color: #eee;
}
ul.nice-menu a {
padding: 0.3em 5px 0.3em 5px;
}
ul.nice-menu ul {
top: 1.8em;
left: -1px; /* LTR */
border: 0;
border-top: 1px solid #ccc;
margin-right: 0; /* LTR */
}
ul.nice-menu ul li {
width: 12.5em;
}
/******************************
VERTICAL (left/right) menus
******************************/
/* This is the default width of all vertical menus. */
ul.nice-menu-right, ul.nice-menu-left,
ul.nice-menu-right li, ul.nice-menu-left li {
width: 12.5em;
}
/* VERTICAL menus where submenus pop RIGHT (default). */
ul.nice-menu-right ul {
width: 12.5em;
left: 12.5em;
top: -1px;
}
ul.nice-menu-right ul ul {
width: 12.5em;
left: 12.5em;
top: -1px;
}
ul.nice-menu-right li.menuparent,
ul.nice-menu-right li li.menuparent {
background: #eee url(arrow-right.png) right center no-repeat;
}
ul.nice-menu-right li.menuparent:hover,
ul.nice-menu-right li li.menuparent:hover {
background: #ccc url(arrow-right.png) right center no-repeat;
}
/* VERTICAL menus where submenus pop LEFT. */
ul.nice-menu-left li ul {
width: 12.5em;
left: -12.65em;
top: -1px;
}
ul.nice-menu-left li ul li ul {
width: 12.5em;
left: -12.65em;
top: -1px;
}
ul.nice-menu-left li.menuparent,
ul.nice-menu-left li li.menuparent {
background: #eee url(arrow-left.png) left center no-repeat;
}
ul.nice-menu-left li.menuparent:hover,
ul.nice-menu-left li li.menuparent:hover {
background: #ccc url(arrow-left.png) left center no-repeat;
}
ul.nice-menu-left a, ul.nice-menu-left ul a {
padding-left: 14px;
}
/******************************
HORIZONTAL (down) menus
******************************/
ul.nice-menu-down {
float: left; /* LTR */
border: 0;
}
ul.nice-menu-down li {
border-top: 1px solid #ccc;
}
ul.nice-menu-down li li {
border-top: 0;
}
ul.nice-menu-down ul {
left: 0; /* LTR */
}
ul.nice-menu-down ul li {
clear: both;
}
ul.nice-menu-down li ul li ul {
left: 12.5em; /* LTR */
top: -1px;
}
ul.nice-menu-down .menuparent a {
padding-right: 15px; /* LTR */
}
ul.nice-menu-down li.menuparent {
background: #eee url(arrow-down.png) right center no-repeat; /* LTR */
}
ul.nice-menu-down li.menuparent:hover {
background: #ccc url(arrow-down.png) right center no-repeat; /* LTR */
}
ul.nice-menu-down li li.menuparent {
background: #eee url(arrow-right.png) right center no-repeat; /* LTR */
}
ul.nice-menu-down li li.menuparent:hover {
background: #ccc url(arrow-right.png) right center no-repeat; /* LTR */
}
/******************************
Garland-specific CSS
******************************/
/**
* Global CSS for ALL menu types
*/
ul.nice-menu li {
margin: 0;
padding-left: 0; /* LTR */
background-image: none;
}
#header-region ul.nice-menu li {
margin: 0;
/* Padding rules are needed to deal with Garland's header line-height. */
padding-top: 0.1em;
padding-bottom: 0.1em;
background: #eee;
}
#header-region ul.nice-menu ul {
top: 1.8em;
left: -1px; /* LTR */
border: 0;
border-top: 1px solid #ccc;
margin-right: 0; /* LTR */
}
#header-region ul.nice-menu ul {
top: 1.7em;
}
/**
* HORIZONTAL (down) menus
*/
#header-region ul.nice-menu-down li ul li ul {
left: 12.5em; /* LTR */
top: -1px;
}
#header-region ul.nice-menu-down li.menuparent {
background: #eee url(arrow-down.png) right center no-repeat; /* LTR */
}
#header-region ul.nice-menu-down li.menuparent:hover {
background: #ccc url(arrow-down.png) right center no-repeat; /* LTR */
}
#header-region ul.nice-menu-down li li.menuparent {
background: #eee url(arrow-right.png) right center no-repeat; /* LTR */
}
#header-region ul.nice-menu-down li li.menuparent:hover {
background: #ccc url(arrow-right.png) right center no-repeat; /* LTR */
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -0,0 +1,10 @@
/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*
* $LastChangedDate: 2007-06-19 20:25:28 -0500 (Tue, 19 Jun 2007) $
* $Rev: 2111 $
*
* Version 2.1
*/
(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&parseInt($.browser.version)<=6){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};if(!$.browser.version)$.browser.version=navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)[1];})(jQuery);

View File

@@ -0,0 +1,9 @@
/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
*
* @param f onMouseOver function || An object with configuration options
* @param g onMouseOut function || Nothing (use configuration options object)
* @author Brian Cherne <brian@cherne.net>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);

View File

@@ -0,0 +1,121 @@
/*
* Superfish v1.4.8 - jQuery menu widget
* Copyright (c) 2008 Joel Birch
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
*/
;(function($){
$.fn.superfish = function(op){
var sf = $.fn.superfish,
c = sf.c,
$arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
over = function(){
var $$ = $(this), menu = getMenu($$);
clearTimeout(menu.sfTimer);
$$.showSuperfishUl().siblings().hideSuperfishUl();
},
out = function(){
var $$ = $(this), menu = getMenu($$), o = sf.op;
clearTimeout(menu.sfTimer);
menu.sfTimer=setTimeout(function(){
o.retainPath=($.inArray($$[0],o.$path)>-1);
$$.hideSuperfishUl();
if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
},o.delay);
},
getMenu = function($menu){
var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
sf.op = sf.o[menu.serial];
return menu;
},
addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
return this.each(function() {
var s = this.serial = sf.o.length;
var o = $.extend({},sf.defaults,op);
o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
$(this).addClass([o.hoverClass,c.bcClass].join(' '))
.filter('li:has(ul)').removeClass(o.pathClass);
});
sf.o[s] = sf.op = o;
$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
if (o.autoArrows) addArrow( $('>a:first-child',this) );
})
.not('.'+c.bcClass)
.hideSuperfishUl();
var $a = $('a',this);
$a.each(function(i){
var $li = $a.eq(i).parents('li');
$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
});
o.onInit.call(this);
}).each(function() {
var menuClasses = [c.menuClass];
if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
$(this).addClass(menuClasses.join(' '));
});
};
var sf = $.fn.superfish;
sf.o = [];
sf.op = {};
sf.IE7fix = function(){
var o = sf.op;
if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
this.toggleClass(sf.c.shadowClass+'-off');
};
sf.c = {
bcClass : 'sf-breadcrumb',
menuClass : 'sf-js-enabled',
anchorClass : 'sf-with-ul',
arrowClass : 'sf-sub-indicator',
shadowClass : 'sf-shadow'
};
sf.defaults = {
hoverClass : 'sfHover',
pathClass : 'overideThisToUse',
pathLevels : 1,
delay : 800,
animation : {opacity:'show'},
speed : 'normal',
autoArrows : true,
dropShadows : true,
disableHI : false, // true disables hoverIntent detection
onInit : function(){}, // callback functions
onBeforeShow: function(){},
onShow : function(){},
onHide : function(){}
};
$.fn.extend({
hideSuperfishUl : function(){
var o = sf.op,
not = (o.retainPath===true) ? o.$path : '';
o.retainPath = false;
var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
.find('>ul').hide().css('visibility','hidden');
o.onHide.call($ul);
return this;
},
showSuperfishUl : function(){
var o = sf.op,
sh = sf.c.shadowClass+'-off',
$ul = this.addClass(o.hoverClass)
.find('>ul:hidden').css('visibility','visible');
sf.IE7fix.call($ul);
o.onBeforeShow.call($ul);
$ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
return this;
}
});
})(jQuery);