#116317, disable simplemenu on a per theme basis, patch by jjeff
This commit is contained in:
parent
659a21255a
commit
cd38617398
@ -29,9 +29,18 @@ function simplemenu_menu($may_cache) {
|
|||||||
'access' => user_access('administer simplemenu')
|
'access' => user_access('administer simplemenu')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We put this in !$may_cache so it's only added once per request
|
return $items;
|
||||||
elseif (user_access('view simplemenu')) {
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementation of hook_footer()
|
||||||
|
*/
|
||||||
|
function simplemenu_footer() {
|
||||||
|
global $theme;
|
||||||
|
$exclusions = variable_get('simplemenu_exclusions', array());
|
||||||
|
if (user_access('view simplemenu') && !$exclusions[$theme]) {
|
||||||
|
global $theme, $custom_theme;
|
||||||
$path = drupal_get_path('module', 'simplemenu');
|
$path = drupal_get_path('module', 'simplemenu');
|
||||||
drupal_add_css($path .'/simplemenu.css');
|
drupal_add_css($path .'/simplemenu.css');
|
||||||
|
|
||||||
@ -46,8 +55,6 @@ function simplemenu_menu($may_cache) {
|
|||||||
drupal_add_js(array('simplemenu' => $settings), 'setting');
|
drupal_add_js(array('simplemenu' => $settings), 'setting');
|
||||||
drupal_add_js($path .'/simplemenu.js');
|
drupal_add_js($path .'/simplemenu.js');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $items;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -100,6 +107,14 @@ function simplemenu_admin_settings() {
|
|||||||
'#required' => TRUE
|
'#required' => TRUE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$form['default_menu']['advanced']['simplemenu_exclusions'] = array(
|
||||||
|
'#type' => 'checkboxes',
|
||||||
|
'#title' => 'Theme exclusions',
|
||||||
|
'#options' => drupal_map_assoc(array_keys(list_themes())),
|
||||||
|
'#default_value' => variable_get('simplemenu_exclusions', array()),
|
||||||
|
'#description' => t('Select which themes to <strong>not</strong> display the menu. Use this when you have a theme that displays its own admin navigation.'),
|
||||||
|
);
|
||||||
|
|
||||||
return system_settings_form($form);
|
return system_settings_form($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user