Mod Name:Menu without limit level
http://custom.simplemachines.org/mods/index.php?mod=2454Type:Feature Enhancement
To create this menu, similar to the image
Menu multi-level
Submenu 1 - level 1
Submenu 1.1 - level 2
Submenu 1.1.1 - level 3
Submenu 1.1.2 - level 3
Submenu 1.2 - level 2
Submenu 1.2.1 - level 3
Submenu 1.2.2 - level 3
Submenu 1.3 - level 2
Submenu 2 - level 1
Submenu 2.1 - level 2
Submenu 2.1 - level 2
can modify the file Sources/Subs.php
'm0' => array(
'title' => 'Menu multi-level',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm1' => array(
'title' => 'Submenu 1 - level 1',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm11' => array(
'title' => 'Submenu 1.1 - level 2',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm111' => array(
'title' => 'Submenu 1.1.1 - level 3',
'href' => '',
'show' => true,
),
'm112' => array(
'title' => 'Submenu 1.1.2 - level 3',
'href' => '',
'show' => true,
),
),
),
'm12' => array(
'title' => 'Submenu 1.2 - level 2',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm121' => array(
'title' => 'Submenu 1.2.1 - level 3',
'href' => '',
'show' => true,
),
'm122' => array(
'title' => 'Submenu 1.2.2 - level 3',
'href' => '',
'show' => true,
),
),
),
'm13' => array(
'title' => 'Submenu 1.3 - level 2',
'href' => '',
'show' => true,
),
),
),
'm2' => array(
'title' => 'Submenu 2 - level 1',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm21' => array(
'title' => 'Submenu 2.1 - level 2',
'href' => '',
'show' => true,
),
'm22' => array(
'title' => 'Submenu 2.2 - level 2',
'href' => '',
'show' => true,
),
),
),
),
),
or use integration hooks
1. Create the file Sources/Subs-MenuMultiLevel.php with content
<?php
if (!defined('SMF'))
die('Hacking attempt...');
function menu_multi_level($buttons)
{
$buttons2 = $buttons;
$buttons = array();
foreach ($buttons2 as $i => $b)
{
$buttons[$i] = $b;
if ('home' == $i)
{
'm0' => array(
'title' => 'Menu multi-level',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm1' => array(
'title' => 'Submenu 1 - level 1',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm11' => array(
'title' => 'Submenu 1.1 - level 2',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm111' => array(
'title' => 'Submenu 1.1.1 - level 3',
'href' => '',
'show' => true,
),
'm112' => array(
'title' => 'Submenu 1.1.2 - level 3',
'href' => '',
'show' => true,
),
),
),
'm12' => array(
'title' => 'Submenu 1.2 - level 2',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm121' => array(
'title' => 'Submenu 1.2.1 - level 3',
'href' => '',
'show' => true,
),
'm122' => array(
'title' => 'Submenu 1.2.2 - level 3',
'href' => '',
'show' => true,
),
),
),
'm13' => array(
'title' => 'Submenu 1.3 - level 2',
'href' => '',
'show' => true,
),
),
),
'm2' => array(
'title' => 'Submenu 2 - level 1',
'href' => '',
'show' => true,
'sub_buttons' => array(
'm21' => array(
'title' => 'Submenu 2.1 - level 2',
'href' => '',
'show' => true,
),
'm22' => array(
'title' => 'Submenu 2.2 - level 2',
'href' => '',
'show' => true,
),
),
),
),
);
}
}
}
?>
2. In file Sources/Load.php, find
// Integration is cool.
if (defined('SMF_INTEGRATION_SETTINGS'))
{
$integration_settings = unserialize(SMF_INTEGRATION_SETTINGS);
foreach ($integration_settings as $hook => $function)
add_integration_function($hook, $function, false);
}
and add after
add_integration_function('integrate_menu_buttons', 'menu_multi_level', false);
add_integration_function('integrate_pre_include', '$boarddir/Sources/Subs-MenuMultiLevel.php', false);