more module updates

This commit is contained in:
Bachir Soussi Chiadmi
2015-04-20 18:02:17 +02:00
parent 37fbabab56
commit 7c85261e56
100 changed files with 6518 additions and 913 deletions

View File

@@ -20,7 +20,7 @@ None.
-- INSTALLATION --
* Install as usual, see http://drupal.org/node/70151 for further information.
* Install as usual, see http://drupal.org/node/895232 for further information.
* You likely want to disable Toolbar module, since its output clashes with
Administration menu.

View File

@@ -4,9 +4,9 @@ package = Administration
core = 7.x
scripts[] = admin_devel.js
; Information added by drupal.org packaging script on 2013-01-31
version = "7.x-3.0-rc4"
; Information added by Drupal.org packaging script on 2014-12-19
version = "7.x-3.0-rc5"
core = "7.x"
project = "admin_menu"
datestamp = "1359651687"
datestamp = "1419029284"

View File

@@ -32,8 +32,7 @@
#admin-menu li li.expandable {
background-color: #b93f3f;
}
#admin-menu li li:hover,
#admin-menu li li.iehover {
#admin-menu li li:hover {
background-color: #690f0f;
}
#admin-menu li li.expandable:hover a,

View File

@@ -98,6 +98,7 @@ body.admin-menu {
#admin-menu .dropdown li li {
background: #202020;
filter: Alpha(opacity=88);
float: none;
opacity: 0.88;
width: 160px; /* Required for Opera */
}
@@ -126,11 +127,7 @@ body.admin-menu {
#admin-menu .dropdown li:hover ul ul,
#admin-menu .dropdown li:hover ul ul ul,
#admin-menu .dropdown li:hover ul ul ul ul,
#admin-menu .dropdown li:hover ul ul ul ul ul,
#admin-menu .dropdown li.iehover ul ul,
#admin-menu .dropdown li.iehover ul ul ul,
#admin-menu .dropdown li.iehover ul ul ul ul,
#admin-menu .dropdown li.iehover ul ul ul ul ul {
#admin-menu .dropdown li:hover ul ul ul ul ul {
display: none;
left: -999em; /* LTR */
}
@@ -140,12 +137,7 @@ body.admin-menu {
#admin-menu .dropdown li li:hover ul,
#admin-menu .dropdown li li li:hover ul,
#admin-menu .dropdown li li li li:hover ul,
#admin-menu .dropdown li li li li li:hover ul,
#admin-menu .dropdown li.iehover ul,
#admin-menu .dropdown li li.iehover ul,
#admin-menu .dropdown li li li.iehover ul,
#admin-menu .dropdown li li li li.iehover ul,
#admin-menu .dropdown li li li li li.iehover ul {
#admin-menu .dropdown li li li li li:hover ul {
display: block;
left: auto; /* LTR */
}
@@ -157,8 +149,7 @@ body.admin-menu {
#admin-menu .dropdown li li.expandable {
background: #45454A url(images/arrow.png) no-repeat 145px 6px;
}
#admin-menu .dropdown li li:hover,
#admin-menu .dropdown li li.iehover {
#admin-menu .dropdown li li:hover {
background-color: #111;
}
#admin-menu .dropdown li li:hover a,
@@ -175,17 +166,9 @@ body.admin-menu {
#admin-menu .dropdown li li.expandable:hover li.expandable:hover li a {
border-color: #323232;
}
#admin-menu .dropdown li li:hover li a,
#admin-menu .dropdown li li.iehover li a,
#admin-menu .dropdown li li.iehover li.iehover li a {
#admin-menu .dropdown li li:hover li a {
color: #EEE;
}
#admin-menu .dropdown li li.iehover a,
#admin-menu .dropdown li li.iehover li.iehover a,
#admin-menu .dropdown li li.iehover li.iehover li.iehover a {
color: #FFF;
width: 90%; /* IE */
}
/* Search form */
#admin-menu .admin-menu-search .form-item {

View File

@@ -497,18 +497,6 @@ function admin_menu_links_icon() {
);
}
// Add link to toggle developer modules (performance).
$saved_state = variable_get('admin_menu_devel_modules_enabled', NULL);
$links['icon']['toggle-modules'] = array(
'#title' => isset($saved_state) ? t('Enable developer modules') : t('Disable developer modules'),
'#weight' => 88,
'#access' => user_access('administer modules'),
'#href' => 'admin_menu/toggle-modules',
'#options' => array(
'query' => $destination + array('token' => drupal_get_token('admin_menu/toggle-modules')),
),
);
// Add Devel module menu links.
if (module_exists('devel')) {
$devel_tree = menu_build_tree('devel');
@@ -697,29 +685,6 @@ function admin_menu_theme_settings() {
'#title' => t('Cache menu in client-side browser'),
'#default_value' => variable_get('admin_menu_cache_client', 1),
);
// Fetch all available modules manually, since module_list() only returns
// currently enabled modules, which makes this setting pointless if developer
// modules are currently disabled.
$all_modules = array();
$result = db_query("SELECT name, filename, info FROM {system} WHERE type = 'module' ORDER BY name ASC");
foreach ($result as $module) {
if (file_exists($module->filename)) {
$info = unserialize($module->info);
$all_modules[$module->name] = $info['name'];
}
}
$devel_modules = variable_get('admin_menu_devel_modules', _admin_menu_developer_modules());
$devel_modules = array_intersect_key($all_modules, array_flip($devel_modules));
$form['performance']['admin_menu_devel_modules_skip'] = array(
'#type' => 'checkboxes',
'#title' => t('Developer modules to keep enabled'),
'#default_value' => variable_get('admin_menu_devel_modules_skip', array()),
'#options' => $devel_modules,
'#access' => !empty($devel_modules),
'#description' => t('The selected modules will not be disabled when the link %disable-developer-modules below the icon in the menu is invoked.', array(
'%disable-developer-modules' => t('Disable developer modules'),
)),
);
return system_settings_form($form);
}
@@ -783,94 +748,6 @@ function _admin_menu_form_devel_admin_settings_alter(&$form, $form_state) {
);
}
/**
* Menu callback; Enable/disable developer modules.
*
* This can save up to 150ms on each uncached page request.
*/
function admin_menu_toggle_modules() {
if (!isset($_GET['token']) || !drupal_valid_token($_GET['token'], current_path())) {
return MENU_ACCESS_DENIED;
}
$rebuild = FALSE;
$saved_state = variable_get('admin_menu_devel_modules_enabled', NULL);
if (isset($saved_state)) {
// Re-enable modules that were enabled before.
module_enable($saved_state);
variable_del('admin_menu_devel_modules_enabled');
drupal_set_message(t('Enabled these modules: !module-list.', array('!module-list' => implode(', ', $saved_state))));
$rebuild = TRUE;
}
else {
// Allow site admins to override this variable via settings.php.
$devel_modules = variable_get('admin_menu_devel_modules', _admin_menu_developer_modules());
// Store currently enabled modules in a variable.
$devel_modules = array_intersect(module_list(FALSE, FALSE), $devel_modules);
$devel_modules = array_diff($devel_modules, variable_get('admin_menu_devel_modules_skip', array()));
if (!empty($devel_modules)) {
variable_set('admin_menu_devel_modules_enabled', $devel_modules);
// Disable developer modules.
module_disable($devel_modules);
drupal_set_message(t('Disabled these modules: !module-list.', array('!module-list' => implode(', ', $devel_modules))));
$rebuild = TRUE;
}
else {
drupal_set_message(t('No developer modules are enabled.'));
}
}
if ($rebuild) {
// Make sure everything is rebuilt, basically a combination of the calls
// from system_modules() and system_modules_submit().
drupal_theme_rebuild();
menu_rebuild();
cache_clear_all('schema', 'cache');
cache_clear_all();
drupal_clear_css_cache();
drupal_clear_js_cache();
// Synchronize to catch any actions that were added or removed.
actions_synchronize();
// Finally, flush admin_menu's cache.
admin_menu_flush_caches();
}
drupal_goto();
}
/**
* Helper function to return a default list of developer modules.
*/
function _admin_menu_developer_modules() {
return array(
'admin_devel',
'cache_disable',
'coder',
'content_copy',
'context_ui',
'debug',
'delete_all',
'demo',
'devel',
'devel_node_access',
'devel_themer',
'field_ui',
'fontyourface_ui',
'form_controller',
'imagecache_ui',
'journal',
'l10n_client',
'l10n_update',
'macro',
'rules_admin',
'stringoverrides',
'trace',
'upgrade_status',
'user_display_ui',
'util',
'views_ui',
'views_theme_wizard',
);
}
/**
* Flush all caches or a specific one.
*

View File

@@ -8,9 +8,9 @@ configure = admin/config/administration/admin_menu
dependencies[] = system (>7.10)
files[] = tests/admin_menu.test
; Information added by drupal.org packaging script on 2013-01-31
version = "7.x-3.0-rc4"
; Information added by Drupal.org packaging script on 2014-12-19
version = "7.x-3.0-rc5"
core = "7.x"
project = "admin_menu"
datestamp = "1359651687"
datestamp = "1419029284"

View File

@@ -33,9 +33,6 @@ function admin_menu_install() {
function admin_menu_uninstall() {
// Delete variables.
variable_del('admin_menu_components');
variable_del('admin_menu_devel_modules');
variable_del('admin_menu_devel_modules_enabled');
variable_del('admin_menu_devel_modules_skip');
variable_del('admin_menu_margin_top');
variable_del('admin_menu_position_fixed');
variable_del('admin_menu_tweak_modules');
@@ -44,6 +41,10 @@ function admin_menu_uninstall() {
variable_del('admin_menu_display');
variable_del('admin_menu_cache_server');
variable_del('admin_menu_cache_client');
// Unused variables still should be deleted.
variable_del('admin_menu_devel_modules');
variable_del('admin_menu_devel_modules_enabled');
variable_del('admin_menu_devel_modules_skip');
}
/**

View File

@@ -219,18 +219,6 @@ Drupal.admin.behaviors.destination = function (context, settings, $adminMenu) {
* it will not run last.
*/
Drupal.admin.behaviors.hover = function (context, settings, $adminMenu) {
// Hover emulation for IE 6.
if ($.browser.msie && parseInt(jQuery.browser.version) == 6) {
$('li', $adminMenu).hover(
function () {
$(this).addClass('iehover');
},
function () {
$(this).removeClass('iehover');
}
);
}
// Delayed mouseout.
$('li.expandable', $adminMenu).hover(
function () {

View File

@@ -58,68 +58,52 @@ function node_admin_menu_map() {
/**
* Implements hook_admin_menu_map() on behalf of Field UI module.
*
* @todo Figure out how to fix the comment entity bundle mappings.
*/
function field_ui_admin_menu_map() {
$map = array();
foreach (entity_get_info() as $obj_type => $info) {
foreach ($info['bundles'] as $bundle_name => $bundle_info) {
if (isset($bundle_info['admin'])) {
$arguments = array();
switch ($obj_type) {
case 'comment':
$fields = array();
foreach (field_info_instances($obj_type, $bundle_name) as $field) {
$fields[] = $field['field_name'];
}
// @todo Make Comment module expose the original node type bundle,
// pretty please.
if (drupal_substr($bundle_name, 0, 13) == 'comment_node_') {
$bundle_name = drupal_substr($bundle_name, 13);
}
// @todo Doesn't work yet. Why?
$arguments = array(
'%comment_node_type' => array($bundle_name),
'%field_ui_menu' => $fields,
);
break;
case 'node':
$fields = array();
foreach (field_info_instances($obj_type, $bundle_name) as $field) {
$fields[] = $field['field_name'];
}
$arguments = array(
'%node_type' => array($bundle_name),
'%field_ui_menu' => $fields,
);
break;
foreach (entity_get_info() as $entity_type => $entity_info) {
if (!$entity_info['fieldable']) {
continue;
}
case 'taxonomy_term':
$fields = array();
foreach (field_info_instances($obj_type, $bundle_name) as $field) {
$fields[] = $field['field_name'];
}
// Map machine_name to vid.
$arguments = array(
'%taxonomy_vocabulary_machine_name' => array($bundle_name),
'%field_ui_menu' => $fields,
);
break;
foreach ($entity_info['bundles'] as $bundle => $bundle_info) {
// @see field_ui_menu()
if (!isset($bundle_info['admin'])) {
continue;
}
case 'user':
$arguments = array(
'%field_ui_menu' => array_keys(field_info_fields('user')),
);
break;
// Check access to this bundle.
$bundle_info['admin'] += array(
'access callback' => 'user_access',
'access arguments' => array('administer site configuration'),
);
if (!call_user_func_array($bundle_info['admin']['access callback'], $bundle_info['admin']['access arguments'])) {
continue;
}
if ($fields = field_info_instances($entity_type, $bundle)) {
$path = $bundle_info['admin']['path'];
$argument = array();
if (isset($bundle_info['admin']['bundle argument'])) {
$bundle_arg = arg($bundle_info['admin']['bundle argument'], $path);
$argument[$bundle_arg] = array($bundle);
}
if (!empty($arguments)) {
$path = $bundle_info['admin']['path'];
$map["$path/fields/%field_ui_menu"]['parent'] = "$path/fields";
$map["$path/fields/%field_ui_menu"]['arguments'][] = $arguments;
$argument['%field_ui_menu'] = array_keys($fields);
if (!isset($map["$path/fields/%field_ui_menu"])) {
$map["$path/fields/%field_ui_menu"] = array(
'parent' => "$path/fields",
'arguments' => array(),
);
}
$map["$path/fields/%field_ui_menu"]['arguments'][] = $argument;
}
}
}
return $map;
}
@@ -161,4 +145,3 @@ function views_ui_admin_menu_map() {
);
return $map;
}

View File

@@ -87,12 +87,6 @@ function admin_menu_menu() {
'file' => 'admin_menu.inc',
);
// Menu link callbacks.
$items['admin_menu/toggle-modules'] = array(
'page callback' => 'admin_menu_toggle_modules',
'access arguments' => array('administer modules'),
'type' => MENU_CALLBACK,
'file' => 'admin_menu.inc',
);
$items['admin_menu/flush-cache'] = array(
'page callback' => 'admin_menu_flush_cache',
'access arguments' => array('flush caches'),

View File

@@ -4,9 +4,9 @@ package = Administration
core = 7.x
dependencies[] = admin_menu
; Information added by drupal.org packaging script on 2013-01-31
version = "7.x-3.0-rc4"
; Information added by Drupal.org packaging script on 2014-12-19
version = "7.x-3.0-rc5"
core = "7.x"
project = "admin_menu"
datestamp = "1359651687"
datestamp = "1419029284"

View File

@@ -70,7 +70,7 @@ function admin_menu_toolbar_admin_menu_output_build(&$content) {
'#title' => t('Show shortcuts'),
'#href' => '',
'#options' => array(
'attributes' => array('class' => 'shortcut-toggle'),
'attributes' => array('class' => array('shortcut-toggle')),
),
);