FINAL suepr merge step : added all modules to this super repos

This commit is contained in:
Bachir Soussi Chiadmi
2015-04-19 16:46:59 +02:00
7585 changed files with 1723356 additions and 18 deletions

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,108 @@
Admin 2.x
=========
The admin module provides UI improvements to the standard Drupal admin interface. The 2.x branch focuses on the following goals:
1. Sustainability - avoid excessive overrides of code, markup, and
interface strings to ensure the module keeps the workload overhead
on the maintainers and community to a minimum.
2. Pluggable/extensible architecture - ensure that admin serves as a
starting point for other modules in contrib to implement admin
interfaces.
3. Expose Drupal's strengths and downplay its weaknesses where possible.
An honest approach to the underlying framework and architecture
of Drupal will be less confusing to the user down the road.
Admin is not an original work - many of its decisions have had direct
influences from other work in the community:
- [Administration menu](http://drupal.org/project/admin_menu)
Daniel Kudwien (sun)
- [Navigate](http://drupal.org/project/navigate)
Chris Shattuck (chrisshattuck)
- [d7ux](http://www.d7ux.org)
Mark Boulton & Leisa Reichelt
Installation
============
1. Install & enable the module.
2. Admin makes a permission available that allows only properly
permissioned users to make use of the admin toolbar. Users with the
'use admin toolbar' permission will be able to use the toolbar.
3. You can configure the layout, position, and enabled tools for the
admin toolbar on `admin/config/user-interface/admin`, or by navigating
to `Administration > Configuration > User interface > Administration tools`
Implementing your own Admin "plugins"
=====================================
Admin's "plugins" are simply Drupal blocks. In order to expose one of your
module's blocks as one suitable for use in the admin toolbar you can set the `admin` key in your `hook_block()` to `TRUE`. Note that users can add any blocks to the admin toolbar if they wish at `admin/settings/admin`, though not all will work well in the context of the admin toolbar.
/**
* Implementation of hook_block().
*/
function my_module_block($op = 'list', $delta = 0, $edit = array()) {
switch ($op) {
case 'list':
$blocks = array();
$blocks['example'] = array(
'info' => t('Example block'),
'admin' => TRUE
);
return $blocks;
}
}
Theming your block and other tips
=================================
Your block should provide general rules for either of the admin toolbar
layouts (horizontal or vertical). You can specify CSS rules using the
following selectors:
#admin-toolbar.horizontal {}
#admin-toolbar.vertical {}
Admin provides fairly decent defaults for the following Drupal core
theme functions:
- `theme('item_list')`
- menu output (e.g. `menu_tree_output()`).
- most form elements (with the exception of fieldsets)
- admin panes (see below)
Admin provides an additional FormAPI element type `admin_panes`. Admin
panes allow you to fit multiple elements of content into a togglable
interface. The panes will automatically adjust to the layout to the toolbar
and display as either vertical tabs (horizontal layout) or accordian boxes
(vertical layout).
Here is an example of using admin panes in a form API array:
$form['panes'] = array(
'#tree' => FALSE,
'#type' => 'admin_panes',
'foo' => array(
'#title' => t('Pane 1'),
...
),
'bar' => array(
'#title' => t('Pane 2'),
...
),
);
Note that each child element must have a #title attribute to be labeled
properly.
Contributors
============
- yhahn (Young Hahn)
- ajashton (AJ Ashton)

View File

@@ -0,0 +1,204 @@
<?php
/**
* System settings form for admin toolbar.
*/
function admin_settings_form($form, &$form_state) {
$form['admin_toolbar'] = array(
'#tree' => TRUE,
'#theme' => 'admin_settings_form',
);
$form['admin_toolbar']['layout'] = array(
'#type' => 'select',
'#title' => t('Layout'),
'#description' => t('Choose a layout for the admin toolbar. Vertical works well with large, wide screens. Horizontal works well on screens with limited real estate.'),
'#options' => array(
'horizontal' => t('Horizontal'),
'vertical' => t('Vertical'),
),
'#default_value' => admin_get_settings('layout'),
);
$form['admin_toolbar']['position'] = array(
'#type' => 'select',
'#title' => t('Position'),
'#description' => t('Choose a position for the admin toolbar that will not collide with other elements in your current theme.'),
'#options' => array(
'ne' => t('Top right'),
'nw' => t('Top left'),
'se' => t('Bottom right'),
'sw' => t('Bottom left'),
),
'#default_value' => admin_get_settings('position'),
);
$form['admin_toolbar']['behavior'] = array(
'#type' => 'select',
'#title' => t('State on new pages'),
'#description' => t('Choose toolbar behavior on new page loads.'),
'#options' => array(
'df' => t('Remember from previous page'),
'ah' => t('Collapsed'),
),
'#default_value' => admin_get_settings('behavior'),
);
$block_info = array();
foreach (module_implements('block_info') as $module) {
$module_blocks = module_invoke($module, 'block_info');
if ($module_blocks) {
foreach ($module_blocks as $delta => $info) {
$block_info["{$module}-{$delta}"] = $info;
}
}
}
// Store block info for use in form processing.
$form['#block_info'] = $block_info;
// Get default block options.
$options = array();
$enabled = array_filter(admin_get_settings('blocks')) + admin_get_default_blocks(TRUE);
foreach ($block_info as $bid => $info) {
if (!empty($enabled[$bid])) {
$options[$bid] = $info['info'];
}
}
asort($options);
$form['admin_toolbar']['blocks'] = array(
'#type' => 'checkboxes',
'#options' => $options,
'#default_value' => drupal_map_assoc(array_keys(array_filter(admin_get_settings('blocks')))),
);
// Grab an array of human-readable module names. It hurts that we need to do this.
$result = db_query("SELECT name,type,info FROM {system} WHERE type = :type AND status = :status", array(':type' => 'module', ':status' => 1));
$modules = array();
while ($row = $result->fetchObject()) {
$info = unserialize($row->info);
$modules[$row->name] = isset($info['name']) ? $info['name'] : $row->name;
}
$custom_options = array();
foreach (array_diff_key($block_info, $options) as $bid => $info) {
$block_parts = (explode('-', $bid));
$module = array_shift($block_parts);
$module = isset($modules[$module]) ? $modules[$module] : $module;
$custom_options[$module][$bid] = $info['info'];
}
$custom_options = $custom_options + array(-1 => '<' . t('Choose a block') . '>');
ksort($custom_options);
$form['admin_toolbar']['custom'] = array(
'#type' => 'select',
'#options' => $custom_options,
'#default_value' => -1,
'#element_validate' => array('admin_settings_form_custom_validate'),
'#description' => t('Enable other blocks for use in the admin toolbar.'),
);
$form['admin_toolbar']['add'] = array(
'#type' => 'submit',
'#value' => t('Add block'),
);
$form = system_settings_form($form);
// Add a submit handler for expanding block information.
array_unshift($form['#submit'], 'admin_settings_form_submit');
return $form;
}
/**
* Submit handler for admin_settings_form().
*
* Retrieves cache type for each block and saves that instead of `1` for each
* enabled block.
*/
function admin_settings_form_submit($form, &$form_state) {
if (isset($form['#block_info'], $form_state['values']['admin_toolbar']['blocks'])) {
$blocks = array();
foreach (array_keys(array_filter($form_state['values']['admin_toolbar']['blocks'])) as $bid) {
$blocks[$bid] = isset($form['#block_info'][$bid]['cache']) ? $form['#block_info'][$bid]['cache'] : DRUPAL_NO_CACHE;
}
$form_state['values']['admin_toolbar']['blocks'] = $blocks;
}
}
/**
* Element validator for custom block adder. Moves values within
* $form_state['values'] and prevents additional variables from being saved.
*/
function admin_settings_form_custom_validate($element, &$form_state) {
if ($form_state['values']['admin_toolbar']['custom'] != -1) {
$bid = $form_state['values']['admin_toolbar']['custom'];
$form_state['values']['admin_toolbar']['blocks'][$bid] = $bid;
}
unset($form_state['values']['admin_toolbar']['custom']);
unset($form_state['values']['admin_toolbar']['add']);
}
/**
* Theme function for the admin settings form.
*/
function theme_admin_settings_form($variables) {
$form = $variables['element'];
$rows = array();
// Admin blocks
$header = array(array(
'data' => t('Administrative blocks'),
'colspan' => 2,
));
foreach (array_keys(admin_get_default_blocks(TRUE)) as $block) {
$rows[] = array(array(
'data' => drupal_render($form['blocks'][$block]),
'colspan' => 2,
));
}
// "Custom" blocks
$rows[] = array(array(
'data' => t('Other blocks'),
'colspan' => 2,
'header' => TRUE,
));
foreach (element_children($form['blocks']) as $block) {
if (empty($form['blocks'][$block]['#printed'])) {
$rows[] = array(array(
'data' => drupal_render($form['blocks'][$block]),
'colspan' => 2,
));
}
}
$rows[] = array(drupal_render($form['custom']), drupal_render($form['add']));
$form['blocks']['#children'] = theme('table', array('header' => $header, 'rows' => $rows));
return drupal_render_children($form);
}
/**
* Rebuild form.
*/
function admin_settings_rebuild($form_state) {
$form = array();
$form['rebuild'] = array(
'#type' => 'fieldset',
'#title' => t('Wipe and rebuild'),
'#description' => t('If the administrative menu is not working properly, you may need to wipe and rebuild it from scratch. <strong>This option will reset any customizations made to your administrative menu items.</strong>'),
);
$form['rebuild']['submit'] = array(
'#type' => 'submit',
'#value' => t('Rebuild'),
'#submit' => array('admin_settings_rebuild_submit'),
);
return $form;
}
/**
* Wipe and rebuild the admin menu.
*/
function admin_settings_rebuild_submit($form, &$form_state) {
db_delete('menu_links')
->condition('menu_name', 'management')
->execute();
menu_rebuild();
if (module_exists('block')) {
cache_clear_all('admin', 'cache_block', TRUE);
}
}

View File

@@ -0,0 +1,21 @@
name = Admin
description = UI helpers for Drupal admins and managers.
package = Administration
core = 7.x
configure = admin/config/user-interface/admin
files[] = admin.admin.inc
files[] = admin.install
files[] = admin.module
files[] = includes/admin.devel.inc
files[] = includes/admin.theme.inc
files[] = theme/admin-panes.tpl.php
files[] = theme/admin-toolbar.tpl.php
files[] = theme/theme.inc
; Information added by drupal.org packaging script on 2011-09-30
version = "7.x-2.x-dev"
core = "7.x"
project = "admin"
datestamp = "1317340920"

View File

@@ -0,0 +1,25 @@
<?php
/**
* @file
* Install, update and uninstall functions for the admin module.
*/
/**
* Implements hook_uninstall().
*/
function admin_uninstall() {
variable_del('admin_toolbar');
}
/**
* Implements hook_enable().
*/
function admin_enable() {
// Weight admin to come after other modules -- in particular, admin_theme().
db_update('system')
->fields(array('weight' => 1))
->condition('name', 'admin')
->condition('type', 'module')
->execute();
}

View File

@@ -0,0 +1,450 @@
<?php
/**
* Implements hook_block_info().
*/
function admin_block_info() {
$blocks = array();
$blocks['create'] = array(
'info' => t('Create content'),
'cache' => DRUPAL_NO_CACHE,
'admin' => TRUE,
);
$blocks['theme'] = array(
'info' => t('Theme switcher'),
'cache' => DRUPAL_CACHE_PER_ROLE,
'admin' => TRUE,
);
$blocks['account'] = array(
'info' => t('My Account'),
'cache' => DRUPAL_NO_CACHE,
'admin' => TRUE,
);
if (module_exists('menu')) {
$blocks['menu'] = array(
'info' => t('Administration menu'),
'cache' => DRUPAL_CACHE_PER_ROLE,
'admin' => TRUE,
);
}
if (module_exists('devel')) {
$blocks['devel'] = array(
'info' => t('Devel'),
'cache' => DRUPAL_NO_CACHE,
'admin' => TRUE,
);
}
return $blocks;
}
/**
* Implements hook_block_view().
*/
function admin_block_view($delta) {
switch ($delta) {
case 'create':
$item = menu_get_item('node/add');
$links = system_admin_menu_block($item);
if (!empty($links)) {
$menu = array();
foreach ($links as $key => $link) {
$menu[$key] = array(
'link' => $link + array('in_active_trail' => FALSE),
'below' => FALSE,
);
}
return array(
'subject' => !empty($item['title']) ? $item['title'] : t('Create content'),
'content' => menu_tree_output($menu),
);
}
break;
case 'theme':
if (user_access('select different theme')) {
module_load_include('inc', 'admin', 'includes/admin.theme');
return admin_block_theme();
}
return NULL;
case 'account':
return admin_account_block();
case 'menu':
$item = menu_get_item('admin');
if ($item && $item['access']) {
$tree = menu_tree_all_data('management');
foreach ($tree as $key => $branch) {
if ($branch['link']['link_path'] !== 'admin') {
unset($tree[$key]);
}
}
return array(
'subject' => !empty($item['title']) ? $item['title'] : t('Administer'),
'content' => menu_tree_output($tree),
);
}
break;
case 'devel':
module_load_include('inc', 'admin', 'includes/admin.devel');
return admin_block_devel();
}
}
/**
* Implements hook_element_info().
*/
function admin_element_info() {
return array(
'admin_panes' => array(
'#value' => '',
'#theme_wrappers' => array('admin_panes'),
),
);
}
/**
* Implements hook_menu().
*/
function admin_menu() {
$items = array();
$items['admin/config/user-interface/admin'] =
$items['admin/config/user-interface/admin/settings'] = array(
'title' => 'Administration tools',
'description' => 'Settings for site administration tools.',
'page callback' => 'drupal_get_form',
'page arguments' => array('admin_settings_form'),
'access callback' => 'user_access',
'access arguments' => array('administer site configuration'),
'type' => MENU_NORMAL_ITEM,
'file' => 'admin.admin.inc',
'module' => 'admin',
);
$items['admin/config/user-interface/admin/settings']['title'] = 'Settings';
$items['admin/config/user-interface/admin/settings']['type'] = MENU_DEFAULT_LOCAL_TASK;
$items['admin/config/user-interface/admin/rebuild'] = array(
'title' => 'Rebuild',
'description' => 'Wipe and rebuild the administrative menu.',
'page callback' => 'drupal_get_form',
'page arguments' => array('admin_settings_rebuild'),
'access callback' => 'user_access',
'access arguments' => array('administer site configuration'),
'type' => MENU_LOCAL_TASK,
'file' => 'admin.admin.inc',
'module' => 'admin',
'weight' => 10,
);
return $items;
}
/**
* Implements hook_menu_alter().
*/
function admin_menu_alter(&$items) {
foreach ($items as $path => $item) {
// Smarter access callback for poorly checked landing pages
if (!empty($item['access arguments']) && !empty($item['page callback']) && $item['access arguments'] === array('access administration pages') && in_array($item['page callback'], array('system_admin_menu_block_page', 'system_settings_overview'))) {
$items[$path]['access callback'] = 'admin_landing_page_access';
$items[$path]['access arguments'] = array($path);
}
}
}
/**
* Menu access callback for admin landing pages.
*
* For a given landing page, grant access if the current user has access
* to any of its child menu items.
*/
function admin_landing_page_access($path) {
static $paths;
if (!isset($paths[$path])) {
$paths[$path] = FALSE;
// Retrieve menu item but without menu_get_item()
$item = db_select('menu_links')
->fields('menu_links')
->condition('module', 'system')
->condition('router_path', $path)
->execute()
->fetchAssoc();
if ($item) {
$query = db_select('menu_links', 'ml');
$query->leftJoin('menu_router', 'm', 'm.path = ml.router_path');
$query->fields('ml');
$query->fields('m', array_diff(drupal_schema_fields_sql('menu_router'), array('weight')));
$query->condition('ml.plid', $item['mlid']);
$result = $query->execute();
while ($item = $result->fetchAssoc()) {
_menu_link_translate($item);
if ($item['access']) {
$paths[$path] = TRUE;
break;
}
}
}
}
return $paths[$path];
}
/**
* Implements hook_permission().
*/
function admin_permission() {
return array(
'use admin toolbar' => array(
'title' => t('use admin toolbar'),
'description' => t('Use the admin toolbar'),
),
'select different theme' => array(
'title' => t('select different theme'),
'description' => t("Select different theme for the current user's session."),
),
);
}
/**
* Implements hook_theme().
*/
function admin_theme($cache, $type, $theme, $path) {
$path = drupal_get_path('module', 'admin');
$items['admin_tab'] = array(
'variables' => array(
'tab' => array(),
'class' => '',
),
'path' => $path . '/theme',
'file' => 'theme.inc',
);
$items['admin_toolbar'] = array(
'variables' => array(
'blocks' => array(),
'position' => 'ne',
'layout' => 'horizontal',
'behavior' => 'df',
),
'template' => 'admin-toolbar',
'path' => $path . '/theme',
'file' => 'theme.inc',
);
$items['admin_drilldown_menu_tree_output'] = array(
'variables' => array('menu' => array()),
'path' => $path . '/theme',
'file' => 'theme.inc',
);
$items['admin_drilldown_menu_tree'] = array(
'variables' => array('menu' => array()),
'path' => $path . '/theme',
'file' => 'theme.inc',
);
$items['admin_drilldown_menu_item'] = array(
'variables' => array(
'link' => NULL,
'has_children' => NULL,
'menu' => '',
'in_active_trail' => FALSE,
'extra_class' => NULL,
),
'path' => $path . '/theme',
'file' => 'theme.inc',
);
$items['admin_drilldown_menu_item_link'] = array(
'variables' => array('item' => array()),
'path' => $path . '/theme',
'file' => 'theme.inc',
);
$items['admin_panes'] = array(
'render element' => 'element',
'template' => 'admin-panes',
'path' => $path . '/theme',
'file' => 'theme.inc',
);
$items['admin_settings_form'] = array(
'render element' => 'element',
'path' => $path,
'file' => 'admin.admin.inc',
);
return $items;
}
/**
* Get variable settings or fallback to defaults.
*/
function admin_get_settings($key = NULL) {
static $settings;
if (!isset($settings)) {
// Try to gather what information we can from the cookie.
// Note that this information should not be trusted in any
// way for affecting *anything* but trivial changes to the site.
$cookie = array();
if (isset($_REQUEST['DrupalAdminToolbar'])) {
parse_str($_REQUEST['DrupalAdminToolbar'], $cookie);
}
$settings = variable_get('admin_toolbar', array()) + array(
'layout' => 'vertical',
'position' => 'nw',
'behavior' => 'df',
'blocks' => admin_get_default_blocks(),
'expanded' => isset($cookie['expanded']) ? check_plain($cookie['expanded']) : 0,
'active_tab' => isset($cookie['activeTab']) ? check_plain($cookie['activeTab']) : 0,
);
// Ensure that if behavior is set to autohide the toolbar is collapsed.
if ($settings['behavior'] === 'ah') {
$settings['expanded'] = 0;
}
}
if (isset($key)) {
return isset($settings[$key]) ? $settings[$key] : FALSE;
}
return $settings;
}
/**
* Get all blocks that have declared themselves visible in the admin toolbar by default.
*/
function admin_get_default_blocks($reset = FALSE) {
static $defaults;
if (!isset($defaults) || $reset) {
$cache = cache_get('admin_default_blocks');
if ($cache && !$reset) {
$defaults = $cache->data;
}
else {
$defaults = array();
foreach (module_implements('block_info') as $module) {
$module_blocks = module_invoke($module, 'block_info');
if ($module_blocks) {
foreach ($module_blocks as $delta => $info) {
if (isset($info['admin'])) {
$defaults["{$module}-{$delta}"] = isset($info['cache']) ? $info['cache'] : DRUPAL_NO_CACHE;
}
}
}
}
cache_set('admin_default_blocks', $defaults);
}
}
return $defaults;
}
/**
* Get blocks enabled for the admin toolbar.
*/
function admin_get_admin_blocks() {
$blocks = array();
if (user_access('use admin toolbar') && $enabled_blocks = admin_get_settings('blocks')) {
module_load_include('module', 'block', 'block');
foreach ($enabled_blocks as $bid => $cache) {
$block = NULL;
$split = explode('-', $bid, 2);
if (count($split) === 2) {
list($module, $delta) = $split;
$block = new stdClass();
$block->module = $module;
$block->delta = $delta;
$block->bid = $bid;
$block->title = NULL;
$block->cache = is_numeric($cache) ? $cache : DRUPAL_NO_CACHE;
$block->region = 'admin_toolbar'; // Fake the block region.
$blocks[$bid] = $block;
}
}
$blocks = _block_render_blocks($blocks);
}
return $blocks;
}
/**
* Preprocessor that runs *before* template_preprocess_page().
*/
function admin_page_build(&$page) {
if (user_access('use admin toolbar') && $trail = menu_get_active_trail()) {
do {
$last = array_pop($trail);
} while (count($trail) && !($last['type'] & MENU_VISIBLE_IN_TREE));
if ($last) {
drupal_add_js(array('activePath' => url($last['href'])), array('type' => 'setting', 'scope' => JS_DEFAULT));
}
}
if (!admin_suppress(FALSE) && $blocks = admin_get_admin_blocks()) {
$path = drupal_get_path('module', 'admin');
drupal_add_js("misc/jquery.cookie.js");
drupal_add_js("{$path}/includes/jquery.drilldown.js");
drupal_add_js("{$path}/includes/admin.toolbar.js");
drupal_add_js("{$path}/includes/admin.menu.js");
drupal_add_css("{$path}/includes/admin.toolbar.base.css");
drupal_add_css("{$path}/includes/admin.toolbar.css");
drupal_add_css("{$path}/includes/admin.menu.css");
$position = admin_get_settings('position');
$layout = admin_get_settings('layout');
$behavior = admin_get_settings('behavior');
$class = admin_get_settings('expanded') ? 'admin-expanded' : '';
$page['page_bottom']['admin_toolbar'] = array(
'#type' => 'markup',
'#markup' => theme('admin_toolbar', array('blocks' => $blocks, 'position' => $position, 'layout' => $layout, 'behavior' => $behavior)),
);
}
}
/**
* Implements hook_preprocess_html().
*/
function admin_preprocess_html(&$vars) {
if (!admin_suppress(FALSE) && $blocks = admin_get_admin_blocks()) {
$position = admin_get_settings('position');
$layout = admin_get_settings('layout');
$behavior = admin_get_settings('behavior');
$class = admin_get_settings('expanded') ? 'admin-expanded' : '';
$vars['classes_array'][] = " admin-{$position} admin-{$layout} admin-{$behavior} {$class} ";
}
}
/**
* Implements hook_suppress().
*
* Suppress display of administration toolbar.
*
* This function should be called from within another module's page callback
* preferably using module_invoke_all('suppress') when the menu should not be
* displayed. This is useful for modules that implement popup pages or other
* special pages where the menu would be distracting or break the layout.
*
* @param $set
* Defaults to TRUE. If called before hook_footer(), the menu will not be
* displayed. If FALSE is passed, the suppression state is returned.
*/
function admin_suppress($set = TRUE) {
static $suppress = FALSE;
if (!empty($set) && $suppress === FALSE) {
$suppress = TRUE;
}
return $suppress;
}
/**
* My Account block.
*/
function admin_account_block() {
$block = array(
'subject' => t('My Account'),
'content' => '',
);
global $user;
if ($user->uid > 0) {
$menu = array();
$menu[] = array(
'data' => l(t('View my account'), 'user/' . $user->uid),
'class' => array('leaf'),
);
$menu[] = array(
'data' => l(t('Edit my account'), 'user/' . $user->uid . '/edit'),
'class' => array('leaf'),
);
$menu[] = array(
'data' => l(t('Logout'), 'user/logout'),
'class' => array('leaf'),
);
$block['content'] = theme('item_list', array('items' => $menu, 'attributes' => array('class' => array('menu'))));
}
return $block;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 934 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

View File

@@ -0,0 +1,192 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="40"
height="400"
id="svg2657"
sodipodi:version="0.32"
inkscape:version="0.46"
version="1.0"
sodipodi:docname="bleeds.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape">
<defs
id="defs2659">
<linearGradient
inkscape:collect="always"
id="linearGradient3410">
<stop
style="stop-color:#ffffff;stop-opacity:1"
offset="0"
id="stop3412" />
<stop
style="stop-color:#dddddd;stop-opacity:1"
offset="1"
id="stop3414" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3410"
id="linearGradient2637"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.75,240,-240)"
x1="0"
y1="360"
x2="0"
y2="400" />
<linearGradient
id="linearGradient3418"
inkscape:collect="always">
<stop
id="stop3420"
offset="0"
style="stop-color:#444444;stop-opacity:1" />
<stop
id="stop3422"
offset="1"
style="stop-color:#222222;stop-opacity:1" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3418"
id="linearGradient3416"
gradientUnits="userSpaceOnUse"
x1="0"
y1="360"
x2="0"
y2="400"
gradientTransform="matrix(1,0,0,0.75,240,-270)" />
<linearGradient
inkscape:collect="always"
id="linearGradient3397">
<stop
style="stop-color:#222222;stop-opacity:1"
offset="0"
id="stop3400" />
<stop
style="stop-color:#111111;stop-opacity:1"
offset="1"
id="stop3402" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3397"
id="linearGradient3407"
x1="0"
y1="360"
x2="0"
y2="400"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.75,240,100)" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective2665" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
gridtolerance="10000"
guidetolerance="10"
objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1"
inkscape:cx="-33.318742"
inkscape:cy="141.59317"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false">
<inkscape:grid
type="xygrid"
id="grid2685"
visible="true"
enabled="true" />
</sodipodi:namedview>
<metadata
id="metadata2662">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<g
style="display:inline"
id="g3449"
inkscape:export-filename="/home/yh/Private/www/d6/sites/all/modules/admin/images/bleeds.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
transform="matrix(0.1666667,0,0,1,-40.000016,0)">
<rect
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="/home/yh/d6/sites/all/modules/admin/toolbar/bleeds.png"
y="370"
x="240"
height="30"
width="240"
id="rect2624"
style="opacity:1;fill:url(#linearGradient3407);fill-opacity:1;stroke:none;stroke-width:1.7854991;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<rect
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="/home/yh/d6/sites/all/modules/admin/toolbar/bleeds.png"
style="opacity:1;fill:#222222;fill-opacity:1;stroke:none;stroke-width:1.7854991;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3409"
width="240"
height="1"
x="240"
y="399" />
<rect
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="/home/yh/d6/sites/all/modules/admin/toolbar/bleeds.png"
style="opacity:1;fill:url(#linearGradient3416);fill-opacity:1;stroke:none;stroke-width:1.7854991;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3413"
width="240"
height="30"
x="240"
y="0" />
<rect
y="30"
x="240"
height="30"
width="240"
id="rect2635"
style="opacity:1;fill:url(#linearGradient2637);fill-opacity:1;stroke:none;stroke-width:1.7854991;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
inkscape:export-filename="/home/yh/d6/sites/all/modules/admin/toolbar/bleeds.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<rect
y="-6.8212105e-14"
x="240"
height="1"
width="240"
id="rect2675"
style="opacity:1;fill:#555555;fill-opacity:1;stroke:none;stroke-width:1.7854991;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
inkscape:export-filename="/home/yh/d6/sites/all/modules/admin/toolbar/bleeds.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 55 KiB

View File

@@ -0,0 +1,54 @@
div.dev-query,
div.dev-timer,
div.dev-memory-usage,
div.devel-querylog { display:none; }
.devel-hide { display:none !important; }
/**
* Admin devel block ==================================================
*/
#block-admin-devel div.dev-info strong {
color:#fff;
font-weight:bold;
}
#block-admin-devel input.dev-querylog-show,
#block-admin-devel input.dev-querylog-hide { margin-top:5px; }
#block-admin-devel input.dev-querylog-hide { display:none; }
#block-admin-devel .marker {
color:#f40;
font-weight:bold;
}
/* Override menu styling */
#admin-toolbar #block-admin-devel { padding-bottom:10px; }
/**
* Query list =========================================================
*/
div.devel-querylog {
border-bottom:1px solid #181818;
background:#080808;
color:#999;
font-size:11px;
line-height:15px;
position:relative;
display:none;
}
div.devel-querylog-header {
border:0px;
font-weight:bold;
}
div.devel-querylog .marker {
color:#f40;
font-weight: bold;
}
div.devel-querylog a { color:#fff; }
div.devel-querylog-even { background:#0c0c0c; }
div.devel-querylog-odd { background:#101010; }

View File

@@ -0,0 +1,79 @@
<?php
/**
* Devel admin block.
*/
function admin_block_devel() {
if (module_exists('devel') && (user_access('access devel information') || user_access('switch users') || user_access('execute php code'))) {
drupal_add_css(drupal_get_path('module', 'admin') . '/includes/admin.devel.css');
drupal_add_js(drupal_get_path('module', 'admin') . '/includes/admin.devel.js');
return array('subject' => t('Devel'), 'content' => drupal_get_form('admin_block_devel_form'));
}
}
/**
* Devel admin block form.
*/
function admin_block_devel_form($form, $form_state) {
$panes = array();
if (user_access('access devel information')) {
$panes['performance'] = admin_devel_performance_form();
}
if (user_access('switch users')) {
$panes['switch_user'] = array(
'#title' => t('Switch user'),
'list' => array('#markup' => theme('links', array(
'links' => devel_switch_user_list(),
'attributes' => array('class' => 'links clearfix'),
))),
'user' => devel_switch_user_form(),
);
$panes['switch_user']['user']['#submit'] = array('devel_switch_user_form_submit');
}
if (user_access('execute php code')) {
$panes['execute'] = devel_execute_form() + array('#title' => t('Execute PHP'));
$panes['execute']['op']['#submit'] = array('devel_execute_form_submit');
}
if (user_access('access devel information')) {
$panes['menu'] = menu_tree_output(menu_tree_all_data('devel'));
$panes['menu']['#title'] = t('Other tools');
}
if (!empty($panes)) {
$panes['#type'] = 'admin_panes';
return array('panes' => $panes);
}
return array();
}
/**
* Performance "form". Actually renders placeholders that are populated post-exit via javascript.
*/
function admin_devel_performance_form() {
$items = array();
if (variable_get('dev_timer', 0) && !variable_get('devel_query_display', FALSE)) {
$items[] = array(
'data' => "<div class='dev-info'></div>",
'class' => array('dev-timer'),
);
}
if (variable_get('dev_mem', FALSE) && function_exists('memory_get_usage')) {
$items[] = array(
'data' => "<div class='dev-info'></div>",
'class' => array('dev-memory-usage'),
);
}
if (variable_get('devel_query_display', FALSE)) {
$show = "<input type='button' class='form-submit dev-querylog-show' value='" . t('Show querylog') . "'/>";
$hide = "<input type='button' class='form-submit dev-querylog-hide' value='" . t('Hide querylog') . "'/>";
$items[] = array(
'data' => "<div class='dev-info'></div>{$show}{$hide}",
'class' => array('dev-query'),
);
}
if ($items) {
return array(
'#title' => t('Performance'),
'#markup' => theme('item_list', array('items' => $items)),
);
}
}

View File

@@ -0,0 +1,36 @@
(function($) {
Drupal.behaviors.adminDevel = {};
Drupal.behaviors.adminDevel.attach = function(context) {
$('#block-admin-devel:not(.admin-processed)').each(function() {
var devel = $(this);
devel.addClass('admin-processed');
// Pull logged values from footer output into the block.
$('li', devel).each(function() {
var key = $(this).attr('class').split(' ')[0];
if (key && $('body > .'+key).size() > 0) {
var value = $('body > .'+key).html();
$('div.dev-info', this).html(value);
}
});
// Query list show handler.
$('input.dev-querylog-show', devel).click(function() {
$(this).hide().siblings('input.dev-querylog-hide').show();
$('body > *:not(#admin-toolbar, .region-page-bottom, .devel-querylog)').addClass('devel-hide');
$('body > .devel-querylog').show();
return false;
});
// Query list hide handler.
$('input.dev-querylog-hide').click(function() {
$(this).hide().siblings('input.dev-querylog-show').show();
$('body > *:not(#admin-toolbar, .region-page-bottom, .devel-querylog)').removeClass('devel-hide');
$('body > .devel-querylog').hide();
return false;
});
});
};
})(jQuery);

View File

@@ -0,0 +1,38 @@
/**
* Breadcrumb
*/
div#admin-toolbar div.admin-tab.admin-menu a {
background-image:url(../images/sprite-rtl.png);
background-position:0% -70px;
padding-left:20px;
padding-right:0px;
}
/**
* Tooltips
*/
div#admin-toolbar.horizontal span.menu-description {
left:auto;
right:60%;
padding-left:0;
padding-right:20px;
}
/**
* Menu
*/
#admin-toolbar ul.drilldown-active-menu li {
background-image:url(../images/sprite-rtl.png);
background-position:100% -85px;
}
#admin-toolbar ul.drilldown-active-menu li.leaf { background-position:100% -110px; }
#admin-toolbar ul.menu li a {
margin-left:0;
margin-right:25px;
}
#admin-toolbar.horizontal ul.drilldown-active-menu { float:right; }
#admin-toolbar.horizontal ul.drilldown-active-menu li { float:right; }

View File

@@ -0,0 +1,127 @@
/**
* Breadcrumb
*/
div#admin-toolbar div.admin-tab.admin-menu #admin-tab-admin-menu {
display:block;
height:20px;
overflow:hidden;
position:relative;
}
div#admin-toolbar div.admin-tab a {
background:url(../images/sprite.png) 100% -70px no-repeat;
padding-right:20px;
}
div#admin-toolbar div.admin-tab a:last-child {
background:transparent;
padding:0px;
}
/**
* Tooltips
*/
div#admin-toolbar.vertical div.admin-toolbar-menu-hover div.block-content { bottom:100px; }
div#admin-toolbar span.menu-description { display:none; }
div#admin-toolbar a.menu-hover span.menu-description {
color:#ccc;
display:block;
}
div#admin-toolbar.vertical a.menu-hover span.menu-description {
position:absolute;
overflow:hidden;
left:0px;
right:0px;
bottom:0px;
padding:0px 20px;
height:90px;
}
div#admin-toolbar.horizontal a.menu-hover span.menu-description {
position:absolute;
top:0px;
left:60%;
width:35%;
padding-left:20px;
}
/**
* Menu
*/
#admin-toolbar ul.menu,
#admin-toolbar ul.menu ul,
#admin-toolbar ul.menu li,
#admin-toolbar ul.menu li a {
list-style:none;
background:transparent;
padding:0px;
margin:0px;
border:0px;
}
/* IE7 */
*:first-child+html #admin-toolbar ul.menu,
*:first-child+html #admin-toolbar ul.menu ul,
*:first-child+html #admin-toolbar ul.menu li,
*:first-child+html #admin-toolbar ul.menu li a { overflow:hidden; }
#admin-toolbar.horizontal ul.drilldown-active-menu {
float:left;
width:60%;
}
#admin-toolbar.horizontal div.admin-pane ul.drilldown-active-menu {
float:none;
width:auto;
}
#admin-toolbar.horizontal ul.drilldown-active-menu li {
float:left;
width:49.9%;
}
#admin-toolbar ul.drilldown-active-menu li { background:url(../images/sprite.png) 0% -85px no-repeat; }
#admin-toolbar ul.menu li.leaf,
#admin-toolbar ul.drilldown-active-menu li.leaf { background:url(../images/sprite.png) 0% -110px no-repeat; }
#admin-toolbar ul.menu li a {
-moz-border-radius:5px;
-webkit-border-radius:5px;
display:block;
margin-left:25px;
height:15px;
padding:5px 10px 4px;
border-bottom:1px solid #222;
white-space:nowrap;
overflow:hidden;
}
#admin-toolbar ul.menu li a span.menu-description { white-space:normal; }
/* IE7 requires height to be explicitly set. */
#admin-toolbar ul.menu li.leaf,
#admin-toolbar ul.drilldown-active-menu li { height:25px; }
#admin-toolbar ul.menu li a.active { background:#222; }
#admin-toolbar ul.menu li a:hover {
color:#000;
background:url(../images/bleeds.png) 0px -30px repeat-x;
}
/* Drilldown generic styles */
.drilldown ul.menu li { display:none !important; }
.drilldown ul.menu li a { display:none !important; }
.drilldown ul.menu li.drilldown-active-trail { display:block !important; }
.drilldown ul.drilldown-active-menu li { display:block !important; }
.drilldown ul.drilldown-active-menu li a { display:block !important; }
.drilldown ul.drilldown-active-menu li ul { display:none !important; }
.drilldown ul.drilldown-active-menu li.expanded { cursor:pointer; }
.drilldown ul.drilldown-active-menu ul.menu li a { display:none !important; }

View File

@@ -0,0 +1,65 @@
(function($) {
Drupal.behaviors.adminToolbarMenu = {};
Drupal.behaviors.adminToolbarMenu.attach = function(context) {
if (jQuery().drilldown) {
$('#admin-toolbar div.admin-block:has(ul.menu):not(.admin-toolbar-menu)')
.addClass('admin-toolbar-menu')
.each(function() {
var menu = $(this);
var trail = '#admin-toolbar div.admin-tab.' + $(this).attr('id').split('block-')[1] + ' span';
var rootTitle = $(trail).text();
if ($('a:has(span.menu-description)', menu).size() > 0) {
menu.addClass('admin-toolbar-menu-hover');
$('a:has(span.menu-description)', menu).hover(
function() {
$('<a></a>')
.attr('class', $(this).attr('class'))
.addClass('menu-hover')
.addClass('overlay-exclude')
.append($('span.menu-description', this).clone())
.appendTo(menu)
.show();
},
function() {
$(menu)
.children('a.menu-hover')
.remove();
}
);
}
// Replace the standard trail click handler with one that only
// adjusts menu if the admin tab is active. Otherwise, switch
// to that admin tab.
menu.bind('refresh.drilldown', function() {
$(trail + ' a').unbind('click').click(function() {
if ($(this).parents('div.admin-tab').is('.admin-tab-active')) {
var settings = {'activeLink': $(this).data('original'), 'trail': trail};
// If the clicked link does not reference the current
// active menu, set it to be active.
if (settings.activeLink.siblings('ul.drilldown-active-menu').size() === 0) {
menu.drilldown('setActive', settings);
return false;
}
// Otherwise, pass-through and allow the link to be clicked.
return menu.drilldown('goTo', settings);
}
$(this).parents('div.admin-tab').click();
return false;
});
});
// Init drilldown plugin.
menu.drilldown('init', {
activePath: Drupal.settings.activePath,
trail: trail,
rootTitle: rootTitle
});
});
}
};
})(jQuery);

View File

@@ -0,0 +1,38 @@
<?php
/**
* Theme switcher admin block.
*/
function admin_block_theme() {
$themes = list_themes();
if (count($themes) > 2) {
return array(
'subject' => t('Switch theme'),
'content' => drupal_get_form('admin_block_theme_form', $themes),
);
}
}
/**
* Devel admin block form.
*/
function admin_block_theme_form($form, $form_state, $themes) {
$options = array();
foreach ($themes as $theme) {
if ($theme->status) {
$options[$theme->name] = isset($theme->info['name']) ? check_plain($theme->info['name']) : $theme->name;
}
}
$form = array();
$form['theme_default'] = array(
'#type' => 'radios',
'#options' => $options,
'#default_value' => variable_get('theme_default', 'garland'),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save configuration'),
);
$form['#submit'] = array('system_settings_form_submit');
return $form;
}

View File

@@ -0,0 +1,3 @@
/**
* @TODO: Update RTL support.
*/

View File

@@ -0,0 +1,35 @@
div#admin-toolbar.horizontal div.admin-tab {
float:right;
margin-left:5px;
margin-right:0;
}
div#admin-toolbar div.admin-tab-active {
-moz-border-radius:5px 0px 0px 5px;
}
/**
* Horizontal layout.
*/
#admin-toolbar.horizontal div.admin-panes {
padding-left:0;
padding-right:25%;
}
#admin-toolbar.horizontal div.admin-panes div.admin-pane-tabs {
left:auto;
right:0px;
}
#admin-toolbar.horizontal div.admin-panes div.admin-pane-tabs a {
-moz-border-radius:3px 3px 0px 0px;
-webkit-border-top-right-radius:3px;
-webkit-border-bottom-right-radius:3px;
}
#admin-toolbar.horizontal div.admin-panes div.admin-pane-tabs a.admin-pane-active {
border-width:1px 1px 1px 0px;
margin-left:-1px;
margin-right:0;
}

View File

@@ -0,0 +1,472 @@
/**
* Admin toolbar CSS resets ===========================================
*/
/* Text */
#admin-toolbar,
#admin-toolbar h1,
#admin-toolbar h2,
#admin-toolbar h3,
#admin-toolbar h4,
#admin-toolbar h5,
#admin-toolbar h6,
#admin-toolbar p,
#admin-toolbar blockquote,
#admin-toolbar pre,
#admin-toolbar a,
#admin-toolbar abbr,
#admin-toolbar acronym,
#admin-toolbar address,
#admin-toolbar big,
#admin-toolbar cite,
#admin-toolbar code,
#admin-toolbar del,
#admin-toolbar dfn,
#admin-toolbar em,
#admin-toolbar font,
#admin-toolbar img,
#admin-toolbar ins,
#admin-toolbar kbd,
#admin-toolbar q,
#admin-toolbar s,
#admin-toolbar samp,
#admin-toolbar small,
#admin-toolbar strike,
#admin-toolbar strong,
#admin-toolbar sub,
#admin-toolbar sup,
#admin-toolbar tt,
#admin-toolbar var,
#admin-toolbar b,
#admin-toolbar u,
#admin-toolbar i,
#admin-toolbar center,
/* Common classes */
#admin-toolbar .buttons,
/* Lists */
#admin-toolbar dl,
#admin-toolbar dt,
#admin-toolbar dd,
#admin-toolbar ol,
#admin-toolbar ul,
#admin-toolbar li,
/* Forms */
#admin-toolbar fieldset,
#admin-toolbar form,
#admin-toolbar input,
#admin-toolbar select,
#admin-toolbar textarea,
#admin-toolbar label,
#admin-toolbar legend,
/* Tables */
#admin-toolbar table,
#admin-toolbar caption,
#admin-toolbar tbody,
#admin-toolbar tfoot,
#admin-toolbar thead,
#admin-toolbar tr,
#admin-toolbar th,
#admin-toolbar td,
/* Drupal: system.css */
#admin-toolbar tr.even,
#admin-toolbar tr.odd,
#admin-toolbar tr.drag,
#admin-toolbar tbody,
#admin-toolbar tbody th,
#admin-toolbar thead th,
#admin-toolbar .breadcrumb,
#admin-toolbar .error,
#admin-toolbar div.error,
#admin-toolbar tr.error,
#admin-toolbar .warning,
#admin-toolbar div.warning,
#admin-toolbar tr.warning,
#admin-toolbar .ok,
#admin-toolbar div.ok,
#admin-toolbar tr.ok,
#admin-toolbar .item-list,
#admin-toolbar .item-list .icon,
#admin-toolbar .item-list .title,
#admin-toolbar .item-list ul,
#admin-toolbar .item-list ul li,
#admin-toolbar ol.task-list li.active,
#admin-toolbar .form-item,
#admin-toolbar tr.odd .form-item,
#admin-toolbar tr.even .form-item,
#admin-toolbar tr.merge-down,
#admin-toolbar tr.merge-up,
#admin-toolbar .form-item .description,
#admin-toolbar .form-item label,
#admin-toolbar .form-item label.option,
#admin-toolbar .form-checkboxes,
#admin-toolbar .form-radios,
#admin-toolbar .form-checkboxes .form-item,
#admin-toolbar .form-radios .form-item,
#admin-toolbar .marker,
#admin-toolbar .form-required,
#admin-toolbar .more-link,
#admin-toolbar .more-help-link,
#admin-toolbar .item-list .pager,
#admin-toolbar .item-list .pager li,
#admin-toolbar .pager-current,
#admin-toolbar .tips,
#admin-toolbar html.js fieldset.collapsible legend a,
#admin-toolbar html.js fieldset.collapsed legend a,
#admin-toolbar .resizable-textarea {
margin:0px;
padding:0px;
border:0px;
outline:0px;
font-size:100%;
vertical-align:baseline;
background:transparent;
line-height:inherit;
position:static;
-moz-box-shadow:none;
-webkit-box-shadow:none;
-moz-border-radius:none;
-webkit-border-radius:none;
}
/**
* Base styles ========================================================
*/
div#admin-toolbar {
z-index:100;
position:fixed;
}
html.overlay-open div#admin-toolbar { z-index:600; }
/**
* Toggling ===========================================================
*/
div#admin-toolbar div.admin-blocks {
overflow:hidden;
display:none;
}
body.admin-expanded div#admin-toolbar div.admin-blocks { display:block; }
div#admin-toolbar.ne,
div#admin-toolbar.nw { top:0px; }
div#admin-toolbar.se,
div#admin-toolbar.sw { bottom:0px; }
div#admin-toolbar.nw,
div#admin-toolbar.sw,
div#admin-toolbar.nw span.admin-toggle,
div#admin-toolbar.sw span.admin-toggle { left:0px; }
div#admin-toolbar.ne,
div#admin-toolbar.se,
div#admin-toolbar.ne span.admin-toggle,
div#admin-toolbar.se span.admin-toggle { right:0px; }
/**
* Vertical =========================================================
*/
div#admin-toolbar.vertical {
position:fixed;
bottom:0px;
top:0px;
}
div#admin-toolbar.vertical div.admin-blocks { width:0px; }
body.admin-expanded div#admin-toolbar.vertical div.admin-blocks { width:260px; }
div#admin-toolbar.vertical div.admin-block { width:240px; }
div#admin-toolbar.vertical div.admin-tabs { width:215px; }
body div#admin-toolbar.vertical div.admin-blocks { position:absolute; top:0px; bottom:0px; }
body.admin-expanded div#admin-toolbar.vertical.ne div.admin-blocks,
body.admin-expanded div#admin-toolbar.vertical.se div.admin-blocks { right:0px; }
body.admin-expanded div#admin-toolbar.vertical.nw div.admin-blocks,
body.admin-expanded div#admin-toolbar.vertical.sw div.admin-blocks { left:0px; }
body.admin-expanded.admin-vertical.admin-ne,
body.admin-expanded.admin-vertical.admin-se { margin-right:260px; }
body.admin-expanded.admin-vertical.admin-nw,
body.admin-expanded.admin-vertical.admin-sw { margin-left:260px; }
/**
* Horizontal =======================================================
*/
div#admin-toolbar.horizontal { left:0px; right:0px; }
body.admin-expanded div#admin-toolbar.horizontal div.admin-blocks { height:260px; }
body.admin-expanded.admin-horizontal.admin-ne,
body.admin-expanded.admin-horizontal.admin-nw { margin-top:260px; }
body.admin-expanded.admin-horizontal.admin-sw,
body.admin-expanded.admin-horizontal.admin-se { margin-bottom:260px; }
/**
* Toggler ============================================================
*/
div#admin-toolbar span.admin-toggle {
display:block;
width:35px;
height:35px;
cursor:pointer;
overflow:hidden;
text-indent:-999px;
position:absolute;
top:0px;
z-index:1000;
}
div#admin-toolbar.se span.admin-toggle,
div#admin-toolbar.sw span.admin-toggle {
position:fixed;
bottom:0px;
top:auto;
}
body.admin-expanded div#admin-toolbar span.admin-toggle {
position:absolute;
top:0px;
}
/**
* Admin tabs =========================================================
*/
div#admin-toolbar.horizontal div.admin-tabs {
height:30px;
padding:5px 10px 0px;
overflow:hidden;
}
div#admin-toolbar.vertical div.admin-tabs {
position:relative;
padding:5px 10px 25px;
}
div#admin-toolbar.ne div.admin-tabs,
div#admin-toolbar.se div.admin-tabs { padding-right:35px !important; }
div#admin-toolbar.nw div.admin-tabs,
div#admin-toolbar.sw div.admin-tabs { padding-left:35px !important; }
div#admin-toolbar div.admin-tab,
div#admin-toolbar div.admin-tab span,
div#admin-toolbar div.admin-tab a {
list-style:none;
background:transparent;
padding:0px;
margin:0px;
}
div#admin-toolbar div.admin-tab {
cursor:pointer;
padding:4px 19px;
height:15px;
border-width:1px;
border-style:solid;
}
div#admin-toolbar.vertical div.admin-tab {
overflow:hidden;
white-space:nowrap;
margin-bottom:5px;
padding-left:9px;
padding-right:9px;
width:195px;
}
div#admin-toolbar.horizontal div.admin-tab {
float:left;
margin-right:5px;
}
div#admin-toolbar div.admin-tab-active {
border-width:1px 1px 0px;
padding-bottom:10px;
}
div#admin-toolbar.vertical div.admin-tab-active {
padding-bottom:5px;
position:absolute;
bottom:0px;
margin:0px;
}
/**
* Admin blocks =======================================================
*/
div#admin-toolbar div.admin-block {
position:relative;
padding:10px;
display:none;
}
div#admin-toolbar div.block-content {
overflow-x:hidden;
overflow-y:auto;
position:absolute;
top:10px;
left:10px;
right:10px;
bottom:10px;
}
div#admin-toolbar div.admin-active { display:block; }
/**
* Horizontal =======================================================
*/
div#admin-toolbar.horizontal div.block-content { height:200px; }
/**
* Vertical =========================================================
*/
div#admin-toolbar.vertical div.admin-block { position:absolute; bottom:0px; left:0px; right:0px; }
div#admin-toolbar.vertical div.admin-blocks-1 div.admin-block { top:30px; }
div#admin-toolbar.vertical div.admin-blocks-2 div.admin-block { top:60px; }
div#admin-toolbar.vertical div.admin-blocks-3 div.admin-block { top:90px; }
div#admin-toolbar.vertical div.admin-blocks-4 div.admin-block { top:120px; }
div#admin-toolbar.vertical div.admin-blocks-5 div.admin-block { top:150px; }
div#admin-toolbar.vertical div.admin-blocks-6 div.admin-block { top:180px; }
div#admin-toolbar.vertical div.admin-blocks-7 div.admin-block { top:210px; }
div#admin-toolbar.vertical div.admin-blocks-8 div.admin-block { top:240px; }
div#admin-toolbar.vertical div.admin-blocks-9 div.admin-block { top:270px; }
div#admin-toolbar.vertical div.admin-blocks-10 div.admin-block { top:300px; }
/**
* Lists ==============================================================
*/
#admin-toolbar div.item-list li {
padding:5px 0px 4px;
border-style:solid;
border-width:0px 0px 1px;
}
/**
* Reasonable inline links
*/
#admin-toolbar ul.links {
-moz-border-radius:5px;
-webkit-border-radius:5px;
padding:5px;
}
#admin-toolbar ul.links li a { padding:2px 10px; }
/**
* Form elements ======================================================
*/
#admin-toolbar input.form-autocomplete,
#admin-toolbar input.form-text,
#admin-toolbar textarea.form-textarea,
#admin-toolbar select.form-select {
padding:2px;
border-width:2px;
border-style:solid;
width:90%;
}
#admin-toolbar input.form-submit {
cursor:pointer;
padding:2px 5px;
text-align:center;
font-weight:normal;
border-width:1px;
border-style:solid;
}
#admin-toolbar.vertical div.admin-panes div.admin-pane,
#admin-toolbar div.admin-panes div.admin-pane-active,
#admin-toolbar div.fieldset,
#admin-toolbar div.form-item {
position:relative;
margin:0px 0px 5px;
border-width:1px;
border-style:solid;
}
#admin-toolbar div.form-item { padding:4px; }
#admin-toolbar div.form-item label {
margin:0px;
padding:0px;
font-weight:bold;
font-size:10px;
text-transform:uppercase;
}
#admin-toolbar div.form-item label.option {
text-transform:none;
font-size:11px;
}
#admin-toolbar div.form-item label.option input { vertical-align:middle; }
#admin-toolbar.vertical div.form-item div.description { font-size:10px; }
/**
* Admin panes ========================================================
*/
#admin-toolbar div.admin-panes h2.admin-pane-title a {
display:block;
padding:4px;
}
#admin-toolbar div.admin-panes div.admin-pane-content {
padding:4px;
display:none;
}
#admin-toolbar div.admin-panes div.admin-pane-active div.admin-pane-content { display:block; }
#admin-toolbar div.admin-pane div.form-item {
border:0px;
-moz-border-radius:0px;
-webkit-border-radius:0px;
padding:5px 0px;
margin:0px;
background:transparent;
}
/**
* Horizontal layout.
*/
#admin-toolbar.horizontal div.admin-panes {
position:relative;
padding-left:200px;
}
#admin-toolbar.horizontal div.admin-panes div.admin-pane {
-moz-border-radius:0px;
-webkit-border-radius:0px;
}
#admin-toolbar.horizontal div.admin-panes div.admin-pane-content { padding:4px 9px; }
#admin-toolbar.horizontal div.admin-panes div.admin-pane-tabs {
z-index:500;
position:absolute;
left:0px;
width:200px;
}
#admin-toolbar.horizontal div.admin-panes div.admin-pane-tabs a { padding:5px; }
#admin-toolbar.horizontal div.admin-panes div.admin-pane-tabs a.admin-pane-active {
padding:4px;
border-width:1px 0px 1px 1px;
border-style:solid;
margin-right:-1px;
}
body.toolbar.admin-nw #admin-toolbar,
body.toolbar.admin-ne #admin-toolbar {
margin-top: 65px;
}

View File

@@ -0,0 +1,188 @@
/**
* Base styles ========================================================
*/
div#admin-toolbar,
div#admin-toolbar * {
font:normal 11px/15px "Lucida Grande",Tahoma,Verdana,sans-serif;
color:#ccc;
}
div#admin-toolbar a {
text-decoration:none;
color:#fff;
font-weight:normal;
}
/**
* Toolbar background =================================================
*/
div#admin-toolbar div.admin-blocks { background:url(../images/black.png) 0px 35px repeat-x; }
div#admin-toolbar.vertical div.admin-blocks { background-color:#000; }
/**
* Toggle =============================================================
*/
div#admin-toolbar span.admin-toggle { background:url(../images/sprite.png) 0px 0px no-repeat; }
/* Positions */
div#admin-toolbar.nw span.admin-toggle { background-position:0px 0px; }
div#admin-toolbar.ne span.admin-toggle { background-position:-35px 0px; }
div#admin-toolbar.se span.admin-toggle { background-position:-70px 0px; }
div#admin-toolbar.sw span.admin-toggle { background-position:-105px 0px; }
/* Expanded */
body.admin-expanded div#admin-toolbar span.admin-toggle { background-position:0px -35px; }
/**
* Tabs ===============================================================
*/
div#admin-toolbar div.admin-tabs { background:#222 url(../images/bleeds.png) 0px 100% repeat-x; }
div#admin-toolbar div.admin-tab {
-moz-border-radius:5px;
-moz-box-shadow: #333 0px 1px 0px;
-webkit-border-radius:5px;
-webkit-box-shadow: #333 0px 1px 0px;
text-shadow: #222 0px 1px 0px;
background:url(../images/bleeds.png) 0px 0px repeat-x;
cursor:pointer;
border-color:#111;
}
div#admin-toolbar div.admin-tab,
div#admin-toolbar div.admin-tab a { color:#999; }
div#admin-toolbar div.admin-tab-active {
-moz-border-radius:5px 5px 0px 0px;
-moz-box-shadow: none;
-webkit-border-radius:0px;
-webkit-border-top-left-radius:5px;
-webkit-border-top-right-radius:5px;
-webkit-box-shadow: none;
background:#000;
border-color:#555 #333;
}
div#admin-toolbar div.admin-tab:hover,
div#admin-toolbar div.admin-tab-active,
div#admin-toolbar div.admin-tab-active a { color:#fff; }
/**
* Drupal elements ====================================================
*/
/* Lists */
#admin-toolbar div.item-list li { border-color:#222; }
/* Links */
#admin-toolbar ul.links { background:#111; }
#admin-toolbar ul.links li a {
-moz-border-radius:3px;
-webkit-border-radius:3px;
background:#333;
}
#admin-toolbar ul.links li a:hover {
background:#eee;
color:#333;
}
/**
* Form elements ======================================================
*/
#admin-toolbar input.form-autocomplete,
#admin-toolbar input.form-text,
#admin-toolbar textarea.form-textarea,
#admin-toolbar select.form-select {
border-color:#000;
background:#000;
color:#999;
}
#admin-toolbar input.form-autocomplete:hover,
#admin-toolbar input.form-text:hover,
#admin-toolbar textarea.form-textarea:hover,
#admin-toolbar select.form-select:hover,
#admin-toolbar div.form-item:hover input.form-autocomplete,
#admin-toolbar div.form-item:hover input.form-text,
#admin-toolbar div.form-item:hover textarea.form-textarea,
#admin-toolbar div.form-item:hover select.form-select,
#admin-toolbar input.form-autocomplete:focus,
#admin-toolbar input.form-text:focus,
#admin-toolbar textarea.form-textarea:focus,
#admin-toolbar select.form-select:focus {
color:#fff;
border-color:#333;
}
#admin-toolbar input.form-submit {
color:#999;
border-color:#555 #444 #333;
background:#222 url(../images/bleeds.png) 0px 100% repeat-x;
-moz-border-radius:3px;
-webkit-border-radius:3px;
}
#admin-toolbar input.form-submit:hover {
border-color:#aaa #888 #666;
background:#444 url(../images/bleeds.png) 0px 0px repeat-x;
color:#fff;
}
#admin-toolbar input.form-submit:active {
border-color:#333;
background:#111;
color:#fff;
}
#admin-toolbar.vertical div.admin-panes div.admin-pane,
#admin-toolbar div.admin-panes div.admin-pane-active,
#admin-toolbar div.fieldset,
#admin-toolbar div.form-item {
background:#111;
border-color:#222;
-moz-border-radius:3px;
-webkit-border-radius:3px;
}
#admin-toolbar div.form-item { padding:4px; }
#admin-toolbar div.form-item div.description,
#admin-toolbar div.form-item label { color:#999; }
/**
* Admin panes ========================================================
*/
#admin-toolbar div.admin-panes div.admin-pane:hover,
#admin-toolbar div.admin-panes div.admin-pane-active,
#admin-toolbar.vertical div.admin-panes div.admin-pane-active {
background:#222;
border-color:#333;
}
#admin-toolbar div.admin-panes h2.admin-pane-title a { color:#666; }
#admin-toolbar div.admin-panes h2.admin-pane-title a:hover,
#admin-toolbar div.admin-panes h2.admin-pane-title a.admin-pane-active { color:#fff; }
#admin-toolbar div.admin-pane div.item-list li { border-color:#333; }
/* Horizontal */
#admin-toolbar.horizontal div.admin-panes div.admin-pane-tabs a {
-moz-border-radius:3px 0px 0px 3px;
-webkit-border-top-left-radius:3px;
-webkit-border-bottom-left-radius:3px;
}
#admin-toolbar.horizontal div.admin-panes div.admin-pane-tabs a.admin-pane-active {
background:#222;
border-color:#333;
}
body.toolbar #admin-toolbar.vertical {
margin-top: 65px;
}

View File

@@ -0,0 +1,257 @@
(function($) {
Drupal.behaviors.adminToolbar = {};
Drupal.behaviors.adminToolbar.attach = function(context) {
$('#admin-toolbar:not(.processed)').each(function() {
var toolbar = $(this);
toolbar.addClass('processed');
// Set initial toolbar state.
Drupal.adminToolbar.init(toolbar);
// Admin toggle.
$('.admin-toggle', this).click(function() { Drupal.adminToolbar.toggle(toolbar); });
// Admin tabs.
$('div.admin-tab', this).click(function() { Drupal.adminToolbar.tab(toolbar, $(this), true); });
$(document).bind('drupalOverlayLoad', {adminToolbar: Drupal.adminToolbar, toolbar: toolbar}, function(event) {
var body = $(document.body);
var adminToolbar = event.data.adminToolbar;
var expand = parseInt(adminToolbar.getState('expanded'));
if (!expand) {
return;
}
var toolbar = event.data.toolbar;
var size = adminToolbar.SIZE + 'px';
adminToolbar.setOverlayState(toolbar, toolbar.is('.vertical'), expand);
});
});
$('div.admin-panes:not(.processed)').each(function() {
var panes = $(this);
panes.addClass('processed');
$('h2.admin-pane-title a').click(function() {
var target = $(this).attr('href').split('#')[1];
var panes = $(this).parents('div.admin-panes')[0];
$('.admin-pane-active', panes).removeClass('admin-pane-active');
$('div.admin-pane.' + target, panes).addClass('admin-pane-active');
$(this).addClass('admin-pane-active');
return false;
});
});
};
/**
* Admin toolbar methods.
*/
Drupal.adminToolbar = {};
/**
* The width or height of the toolbar, depending on orientation.
*/
Drupal.adminToolbar.SIZE = 260;
/**
* Set the initial state of the toolbar.
*/
Drupal.adminToolbar.init = function (toolbar) {
// Set expanded state.
var expanded = this.getState('expanded');
if (!$(document.body).hasClass('admin-ah')) {
if (expanded == 1) {
$(document.body).addClass('admin-expanded');
}
}
// Set default tab state.
var target = this.getState('activeTab');
if (target) {
if ($('div.admin-tab.'+target).size() > 0) {
var tab = $('div.admin-tab.'+target);
this.tab(toolbar, tab, false);
}
}
// Add layout class to body.
var classes = toolbar.attr('class').split(' ');
if (classes[0] === 'nw' || classes[0] === 'ne' || classes[0] === 'se' || classes[0] === 'sw' ) {
$(document.body).addClass('admin-'+classes[0]);
}
if (classes[1] === 'horizontal' || classes[1] === 'vertical') {
$(document.body).addClass('admin-'+classes[1]);
}
if (classes[2] === 'df' || classes[2] === 'ah') {
$(document.body).addClass('admin-'+classes[2]);
}
var vertical = true;
if(classes[1] === 'horizontal') {
vertical = false;
}
};
/**
* Set the active tab.
*/
Drupal.adminToolbar.tab = function(toolbar, tab, animate) {
if (!tab.is('.admin-tab-active')) {
var target = $('span', tab).attr('id').split('admin-tab-')[1];
// Vertical
// Use animations to make the vertical tab transition a bit smoother.
if (toolbar.is('.vertical') && animate) {
$('.admin-tab-active', toolbar).fadeOut('fast');
$(tab).fadeOut('fast', function() {
$('.admin-tab-active', toolbar).fadeIn('fast').removeClass('admin-tab-active');
$(tab).slideDown('fast').addClass('admin-tab-active');
Drupal.adminToolbar.setState('activeTab', target);
});
}
// Horizontal
// Tabs don't need animation assistance.
else {
$('div.admin-tab', toolbar).removeClass('admin-tab-active');
$(tab, toolbar).addClass('admin-tab-active');
Drupal.adminToolbar.setState('activeTab', target);
}
// Blocks
$('div.admin-block.admin-active', toolbar).removeClass('admin-active');
$('#block-'+target, toolbar).addClass('admin-active');
}
return false;
};
/**
* Set the width/height of the of the overlay body based on the state admin toolbar.
*
* @param vertical
* A boolean indicating if the toolbar is vertical.
* @param expanded
* A boolean indicating if the toolbar is expanded.
*/
Drupal.adminToolbar.setOverlayState = function(toolbar, vertical, expanded) {
var margin,
size = this.SIZE + 65;
if (!expanded) {
size = 0;
}
margin = {marginLeft: size+'px'};
if (vertical) {
if (toolbar.is('.ne') || toolbar.is('.se')) {
margin = {marginRight: size+'px'}
}
}
else {
if (toolbar.is('.ne') || toolbar.is('.nw')) {
margin = {marginTop: size+'px'};
}
else {
margin = {marginBottom: size+'px'};
}
}
$('iframe.overlay-element').contents().find('body').animate(margin, 'fast');
};
/**
* Toggle the toolbar open or closed.
*/
Drupal.adminToolbar.toggle = function (toolbar) {
var size = '0px';
if ($(document.body).is('.admin-expanded')) {
if ($(toolbar).is('.vertical')) {
$('div.admin-blocks', toolbar).animate({width:size}, 'fast');
if ($(toolbar).is('.nw') || $(toolbar).is('.sw')) {
$(document.body).animate({marginLeft:size}, 'fast', function() { $(this).toggleClass('admin-expanded'); });
}
else {
$(document.body).animate({marginRight:size}, 'fast', function() { $(this).toggleClass('admin-expanded'); });
}
this.setOverlayState(toolbar, true, false);
}
else {
$('div.admin-blocks', toolbar).animate({height:size}, 'fast');
if ($(toolbar).is('.nw') || $(toolbar).is('.ne')) {
$(document.body).animate({marginTop:size}, 'fast', function() { $(this).toggleClass('admin-expanded'); });
}
else {
$(document.body).animate({marginBottom:size}, 'fast', function() { $(this).toggleClass('admin-expanded'); });
}
this.setOverlayState(toolbar, false, false);
}
this.setState('expanded', 0);
}
else {
size = this.SIZE + 'px';
if ($(toolbar).is('.vertical')) {
$('div.admin-blocks', toolbar).animate({width:size}, 'fast');
if ($(toolbar).is('.nw') || $(toolbar).is('.sw')) {
$(document.body).animate({marginLeft:size}, 'fast', function() { $(this).toggleClass('admin-expanded'); });
}
else {
$(document.body).animate({marginRight:size}, 'fast', function() { $(this).toggleClass('admin-expanded'); });
}
this.setOverlayState(toolbar, true, true);
}
else {
$('div.admin-blocks', toolbar).animate({height:size}, 'fast');
if ($(toolbar).is('.nw') || $(toolbar).is('.ne')) {
$(document.body).animate({marginTop:size}, 'fast', function() { $(this).toggleClass('admin-expanded'); });
}
else {
$(document.body).animate({marginBottom:size}, 'fast', function() { $(this).toggleClass('admin-expanded'); });
}
this.setOverlayState(toolbar, false, true);
}
if ($(document.body).hasClass('admin-ah')) {
this.setState('expanded', 0);
}
else {
this.setState('expanded', 1);
}
}
};
/**
* Get the value of a cookie variable.
*/
Drupal.adminToolbar.getState = function(key) {
if (!Drupal.adminToolbar.state) {
Drupal.adminToolbar.state = {};
var cookie = $.cookie('DrupalAdminToolbar');
var query = cookie ? cookie.split('&') : [];
if (query) {
for (var i in query) {
// Extra check to avoid js errors in Chrome, IE and Safari when
// combined with JS like twitter's widget.js.
// See http://drupal.org/node/798764.
if (typeof(query[i]) == 'string' && query[i].indexOf('=') != -1) {
var values = query[i].split('=');
if (values.length === 2) {
Drupal.adminToolbar.state[values[0]] = values[1];
}
}
}
}
}
return Drupal.adminToolbar.state[key] ? Drupal.adminToolbar.state[key] : false;
};
/**
* Set the value of a cookie variable.
*/
Drupal.adminToolbar.setState = function(key, value) {
var existing = Drupal.adminToolbar.getState(key);
if (existing != value) {
Drupal.adminToolbar.state[key] = value;
var query = [];
for (var i in Drupal.adminToolbar.state) {
query.push(i + '=' + Drupal.adminToolbar.state[i]);
}
$.cookie('DrupalAdminToolbar', query.join('&'), {expires: 7, path: '/'});
}
};
})(jQuery);

View File

@@ -0,0 +1,165 @@
/**
* Generic menu drilldown plugin for standard Drupal menu tree markup.
* The plugin should be inited against a DOM element that *contains*
* a Drupal ul.menu tree. Example:
*
* $('div.block-menu').drilldown('init', params);
*
* You must provide the following parameters as settings:
*
* var params = {
* activePath : A drupal menu path that is currently active including the basePath e.g. "/mysite/node"
* trail : A jquery selector to the DOM element that should act as the trail container, e.g. "div.my-menu-breadcrumb-trail"
* rootTitle : The title to use for the root menu item if the menu does not already possess one. Optional.
* }
*
*/
(function($) {
$.fn.drilldown = function(method, settings) {
var menu = this;
var activePath;
var rootTitle = settings.rootTitle || 'Home';
switch (method) {
case 'goTo':
// If the passed link refers to the current page, don't follow through
// the link.
if (this.activePath && this.activePath === $(settings.activeLink).attr('href')) {
return false;
}
return true;
case 'setActive':
var breadcrumb = [];
var activeMenu;
$(settings.activeLink).each(function() {
// Traverse backwards through menu parents and build breadcrumb array.
$(this).parents('ul.menu').each(function() {
if ($(this).parents('ul.menu').size() > 0) {
$(this).siblings('a').each(function() {
breadcrumb.unshift($(this));
});
}
// If this is a root menu with no root link to accompany it,
// generate one such that the breadcrumb may reference it.
else if ($(this).children('li').size() > 1) {
var root;
if ($(this).siblings('a.drilldown-root').size() > 0) {
root = $(this).siblings('a.drilldown-root');
}
else {
root = $('<a href="#" class="drilldown-root" style="display:none">'+rootTitle+'</a>');
$(this).before(root);
}
breadcrumb.unshift(root);
}
});
// If we have a child menu (actually a sibling in the DOM), use it
// as the active menu. Otherwise treat our direct parent as the
// active menu.
if ($(this).next().is('ul.menu')) {
activeMenu = $(this).next();
breadcrumb.push($(this));
}
else {
activeMenu = $(this).parents('ul.menu').eq(0);
}
if (activeMenu) {
$('.drilldown-active-trail', menu).removeClass('drilldown-active-trail');
$('ul.menu', menu).removeClass('drilldown-active-menu').removeClass('clearfix');
$(activeMenu)
.addClass('drilldown-active-menu').addClass('clearfix')
.parents('li').addClass('drilldown-active-trail').show();
}
});
// Render the breadcrumb to the target DOM object
if (breadcrumb.length > 0) {
var trail = $(settings.trail);
trail.empty();
for (var key in breadcrumb) {
if (breadcrumb[key]) {
// We don't use the $().clone() method here because of an
// IE & jQuery 1.2 bug.
var clone = $('<a></a>')
.attr('href', $(breadcrumb[key]).attr('href'))
.attr('class', $(breadcrumb[key]).attr('class'))
.html($(breadcrumb[key]).html())
.addClass('depth-'+key)
.appendTo(trail);
// We add a reference to the original link and a click handler
// that traces back to that instance to set as the active link.
$('a.depth-'+key, trail)
.data('original', $(breadcrumb[key]))
.click(function() {
settings.activeLink = $(this).data('original');
// If the clicked link does not reference the current
// active menu, set it to be active.
if (settings.activeLink.siblings('ul.drilldown-active-menu').size() === 0) {
menu.drilldown('setActive', settings);
return false;
}
// Otherwise, pass-through and allow the link to be clicked.
return menu.drilldown('goTo', settings);
});
}
}
}
// Event in case others need to update themselves when a new active
// link is set.
$(menu).trigger('refresh.drilldown');
break;
case 'init':
if ($('ul.menu ul.menu', menu).size() > 0) {
$(menu).addClass('drilldown');
$(settings.trail).addClass('drilldown-trail');
// Set initial active menu state.
var activeLink;
$('ul.menu a', menu).removeClass('active');
if (settings.activePath && $('ul.menu a[href="'+settings.activePath+'"]', menu).size() > 0) {
this.activePath = settings.activePath;
activeLink = $('ul.menu a[href="'+settings.activePath+'"]', menu).addClass('active');
}
if (!activeLink) {
activeLink = $('ul.menu a.active', menu).size() ? $('ul.menu a.active', menu) : $('ul.menu > li > a', menu);
}
if (activeLink) {
menu.drilldown('setActive', {
activeLink: $(activeLink[0]),
trail: settings.trail,
rootTitle: rootTitle
});
}
// Attach click handlers to menu items
$('ul.menu li:has(ul.menu)', this).click(function() {
if ($(this).parent().is('.drilldown-active-menu')) {
if (menu.data('disableMenu')) {
return true;
}
else {
var url = $(this).children('a').attr('href');
var activeLink = $('ul.menu a[href="'+url+'"]', menu);
menu.drilldown('setActive', {
activeLink: activeLink,
trail: settings.trail,
rootTitle: rootTitle
});
return false;
}
}
});
$('ul.menu li:has(ul.menu) a', menu).click(function() {
menu.data('disableMenu', true);
});
}
break;
}
return this;
};
})(jQuery);

View File

@@ -0,0 +1,30 @@
<div class='admin-panes clearfix '>
<?php if ($layout == 'vertical'): ?>
<?php foreach ($panels as $key => $panel): ?>
<div class='admin-pane <?php if (!isset($first)) print 'admin-pane-active' ?> admin-pane-<?php print $key ?>'>
<h2 class='admin-pane-title'><?php print $labels[$key] ?></h2>
<div class='admin-pane-content clearfix'><?php print render($panel) ?></div>
</div>
<?php $first = TRUE ?>
<?php endforeach; ?>
<?php else: ?>
<div class='admin-pane-tabs'>
<?php foreach ($panels as $key => $panel): ?>
<h2 class='admin-pane-title'><?php print $labels[$key] ?></h2>
<?php endforeach; ?>
</div>
<?php foreach ($panels as $key => $panel): ?>
<div class='admin-pane <?php if (!isset($first)) print 'admin-pane-active' ?> admin-pane-<?php print $key ?>'>
<div class='admin-pane-content clearfix'><?php print render($panel) ?></div>
</div>
<?php $first = TRUE ?>
<?php endforeach; ?>
<?php endif; ?>
<?php print render($others) ?>
</div>

View File

@@ -0,0 +1,18 @@
<div id='admin-toolbar' class='<?php print $position ?> <?php print $layout ?> <?php print $behavior ?>'>
<span class='admin-toggle'><?php print t('Admin') ?></span>
<div class='admin-blocks admin-blocks-<?php print count($blocks) ?>'>
<div class='admin-tabs clearfix'>
<?php foreach ($tabs as $bid => $tab): ?>
<?php print theme('admin_tab', array('tab' => $tab, 'class' => $bid)); ?>
<?php endforeach; ?>
</div>
<?php foreach ($blocks as $block): ?>
<div class='admin-block <?php if (isset($block->class)) print $block->class ?>' id='block-<?php print $block->bid ?>'>
<div class='block-content clearfix'><?php print render($block->content) ?></div>
</div>
<?php endforeach; ?>
</div>
</div>

View File

@@ -0,0 +1,144 @@
<?php
/**
* Preprocessor for theme('admin_toolbar').
*/
function template_preprocess_admin_toolbar(&$vars) {
// Set the active block.
$active = admin_get_settings('active_tab') ? admin_get_settings('active_tab') : key($vars['blocks']);
if (!empty($vars['blocks'])) {
$blocks = $vars['blocks'];
$vars['tabs'] = array();
$vars['blocks'] = array();
foreach ($blocks as $block) {
$bid = $block->bid;
$vars['tabs'][$bid] = array(
'title' => $block->subject,
'attributes' => array('id' => 'admin-tab-' . $bid),
);
$vars['blocks'][$bid] = $block;
// Mark active tab, block.
if ($bid == $active) {
$vars['blocks'][$bid]->class = 'admin-active';
$vars['tabs'][$bid]['active'] = TRUE;
}
}
}
}
/**
* Theme function for form API element '#type' => 'admin_panes'.
*/
function template_preprocess_admin_panes(&$vars) {
drupal_add_js(drupal_get_path('module', 'admin') . '/includes/admin.toolbar.js');
$vars['layout'] = admin_get_settings('layout');
$vars['labels'] = $vars['panels'] = $vars['others'] = array();
$first = TRUE;
foreach (element_children($vars['element']) as $key) {
if (!isset($vars['element'][$key]['#access']) || $vars['element'][$key]['#access']) {
if (!empty($vars['element'][$key]['#title'])) {
$vars['labels'][$key] = l($vars['element'][$key]['#title'], $_GET['q'], array(
'fragment' => 'admin-pane-' . $key,
'attributes' => array(
'class' => array($first ? 'admin-pane-active' : '')
)
));
$vars['panels'][$key] = $vars['element'][$key];
$first = FALSE;
}
else {
$vars['others'][] = $vars['element'][$key];
}
}
}
}
/**
* Generate markup for an admin tab.
*/
function theme_admin_tab($variables) {
$tab = $variables['tab'];
$class = $variables['class'];
$attr = isset($tab['attributes']) ? drupal_attributes($tab['attributes']) : '';
$class .= !empty($tab['active']) ? ' admin-tab-active' : '';
$title = filter_xss_admin($tab['title']);
return "<div class='admin-tab {$class}'><span {$attr}>{$title}</span></div>";
}
/**
* Alternative to menu_tree_output() which uses admin implementations of the
* core menu theme functions.
*/
function theme_admin_drilldown_menu_tree_output($variables) {
$tree = $variables['menu'];
$output = '';
$items = array();
// Pull out just the menu items we are going to render so that we
// get an accurate count for the first/last classes.
foreach ($tree as $data) {
if (!$data['link']['hidden']) {
$items[] = $data;
}
}
$num_items = count($items);
foreach ($items as $i => $data) {
$extra_class = NULL;
if ($i == 0) {
$extra_class = 'first';
}
if ($i == $num_items - 1) {
$extra_class = 'last';
}
$link = theme('admin_drilldown_menu_item_link', array('item' => $data['link']));
$in_active_trail = isset($data['link']['in_active_trail']) ? $data['link']['in_active_trail'] : FALSE;
if ($data['below']) {
$output .= theme('admin_drilldown_menu_item', array('link' => $link, 'has_children' => $data['link']['has_children'], 'menu' => theme('admin_drilldown_menu_tree_output', array('menu' => $data['below'])), 'in_active_trail' => $in_active_trail, 'extra_class' => $extra_class));
}
else {
$output .= theme('admin_drilldown_menu_item', array('link' => $link, 'has_children' => $data['link']['has_children'], 'menu' => '', 'in_active_trail' => $in_active_trail, 'extra_class' => $extra_class));
}
}
return $output ? theme('admin_drilldown_menu_tree', array('menu' => $output)) : '';
}
/**
* Alternative to theme_menu_tree().
* Ensures custom theme-level overrides of theme_menu_tree() do not break
* markup expected by admin.
*/
function theme_admin_drilldown_menu_tree($variables) {
$tree = $variables['menu'];
return theme_menu_tree($tree);
}
/**
* Alternative to theme_menu_item().
* Ensures custom theme-level overrides of theme_menu_item() do not break
* markup expected by admin.
*/
function theme_admin_drilldown_menu_item($variables) {
$link = $variables['link'];
$has_children = $variables['has_children'];
$menu = $variables['menu'];
$in_active_trail = $variables['in_active_trail'];
$extra_class = $variables['extra_class'];
return theme_menu_item($link, $has_children, $menu, $in_active_trail, $extra_class);
}
/**
* Alternative to theme_menu_item_link().
*/
function theme_admin_drilldown_menu_item_link($variables) {
$link = $variables['item'];
$link['localized_options'] = empty($link['localized_options']) ? array() : $link['localized_options'];
$link['localized_options']['html'] = TRUE;
$link['localized_options']['purl'] = array('disabled' => TRUE);
$link['description'] = check_plain(truncate_utf8(strip_tags($link['description']), 150, TRUE, TRUE));
$link['title'] .= !empty($link['description']) ? "<span class='menu-description'>{$link['description']}</span>" : '';
$link['title'] = filter_xss_admin($link['title']);
return l($link['title'], $link['href'], $link['localized_options']);
}