remove dependency on menu module
This commit is contained in:
parent
67bf2e51ad
commit
5c6bec1d8a
@ -30,7 +30,7 @@ jQuery Superfish: http://users.tpg.com.au/j_birch/plugins/superfish/
|
|||||||
|
|
||||||
--- CHANGELOG --------------------------------------------------------
|
--- CHANGELOG --------------------------------------------------------
|
||||||
|
|
||||||
4.0, 2007-Nov-21
|
4.0, 2007-Nov-22
|
||||||
----------------------
|
----------------------
|
||||||
- new CHANGELOG to keep track of changes
|
- new CHANGELOG to keep track of changes
|
||||||
- #156256 upgrade to SuperFish 1.3
|
- #156256 upgrade to SuperFish 1.3
|
||||||
@ -40,4 +40,6 @@ jQuery Superfish: http://users.tpg.com.au/j_birch/plugins/superfish/
|
|||||||
- new option to select which theme to style SimpleMenu with, or provide a custom one
|
- new option to select which theme to style SimpleMenu with, or provide a custom one
|
||||||
- #184051 - don't hardcode CSS, add class to body
|
- #184051 - don't hardcode CSS, add class to body
|
||||||
- #180106 - fix missing translatable strings"
|
- #180106 - fix missing translatable strings"
|
||||||
- #144742 - don't show annoying A titles
|
- #144742 - don't show annoying A titles
|
||||||
|
- remove dependency on menu module, now works with menu module off
|
||||||
|
-
|
@ -67,20 +67,24 @@ function simplemenu_perm() {
|
|||||||
* SimpleMenu settings page.
|
* SimpleMenu settings page.
|
||||||
*/
|
*/
|
||||||
function simplemenu_admin_settings() {
|
function simplemenu_admin_settings() {
|
||||||
$form['default_menu']['simplemenu_menu'] = array(
|
if (module_exists('menu')) {
|
||||||
'#type' => 'select',
|
$form['default_menu']['simplemenu_menu'] = array(
|
||||||
'#title' => t('Menu'),
|
'#type' => 'select',
|
||||||
'#options' => menu_parent_options(0),
|
'#title' => t('Menu'),
|
||||||
'#default_value' => variable_get('simplemenu_menu', 1),
|
'#options' => menu_parent_options(0),
|
||||||
'#description' => t('Select the menu to display.')
|
'#default_value' => variable_get('simplemenu_menu', 1),
|
||||||
);
|
'#description' => t('Select the menu to display.')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$form['default_menu']['simplemenu_devel'] = array(
|
if (module_exists('devel')) {
|
||||||
'#type' => 'checkbox',
|
$form['default_menu']['simplemenu_devel'] = array(
|
||||||
'#title' => t('Add devel module links'),
|
'#type' => 'checkbox',
|
||||||
'#default_value' => variable_get('simplemenu_devel', 0),
|
'#title' => t('Add devel module links'),
|
||||||
'#description' => t('Add devel module links for those users that can access the devel module.')
|
'#default_value' => variable_get('simplemenu_devel', 0),
|
||||||
);
|
'#description' => t('Add devel module links for those users that can access the devel module.')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$form['default_menu']['simplemenu_theme'] = array(
|
$form['default_menu']['simplemenu_theme'] = array(
|
||||||
'#type' => 'select',
|
'#type' => 'select',
|
||||||
@ -131,7 +135,14 @@ function simplemenu_admin_settings() {
|
|||||||
function simplemenu_get_menu() {
|
function simplemenu_get_menu() {
|
||||||
$output = '';
|
$output = '';
|
||||||
|
|
||||||
$menu = simplemenu_menu_tree(variable_get('simplemenu_menu', 1));
|
// if a user turned off menu module but SimpleMenu was previously set
|
||||||
|
// reset variable so a menu appears
|
||||||
|
if (module_exists('menu')) {
|
||||||
|
$menu = simplemenu_menu_tree(variable_get('simplemenu_menu', 1));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$menu = simplemenu_menu_tree(1);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$menu) {
|
if (!$menu) {
|
||||||
$menu = '<li><a href="'. url('admin/settings/simplemenu') .'">'. t('No menu items found. Try a different menu as the default.') .'</a></li>';
|
$menu = '<li><a href="'. url('admin/settings/simplemenu') .'">'. t('No menu items found. Try a different menu as the default.') .'</a></li>';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user