News:

Wondering if this will always be free?  See why free is better.

Main Menu

SMF 2 RC4 - Admin sub-menu

Started by Bagheera, April 01, 2011, 08:22:43 AM

Previous topic - Next topic

Bagheera

Hey guys,
I have annoying problem I can't figure out. I want to remove (hide) the admin sub-menu. I cant find where is the admin menu template located to do adjustments.
If you look at the picture I attached you can see what part I do not want to show.
Thanks for looking and any help :)

Illori

on the right side of any admin page click the << arrow this will move the whole menu to the left side and there will be no drop down menus anymore.

Bagheera

I know that  ;) That's not what I was asking for. I need to find where the template for admin menu is in what file so i can make my changes.
Thanks  :)

Illori


Bagheera

Doh  O:) I new it's going to be simple  :laugh:

Thank you exactly what I need  :D

Arantor

Admin.php will let you edit the menu, the physical template is GenericMenu.template.php (which shouldn't be altered)

Oh, and the modification to remove the subitems in the menu will prevent you uninstalling the mod and it may also affect whether it works properly depending on how the menu is created.

Bagheera

Thanks Arantor, I think I will be fine. The modification I need to do is for my mobile theme not the main one. So I will be able to do everything on my computer.

And GenericMenu.template.php is what I was looking for.  :D

Thank for the help guys.

Arantor

Except that that menu controls how the profile menu and the admin menu and a couple of other menus are displayed... which need to have submenus in places...

Bagheera

Only thing I did is to take out the subsections code out, so the sub-menu doesn't show in my drop menu in my mobile theme. I didn't lost any functionality of the forum even in the mobile theme. I use the horizontal menu view for the theme.

GenericMenu.template.php (admin menu part)
<div id="admin_menu">
<ul class="dropmenu" id="dropdown_menu_', $context['cur_menu_id'], '">';

// Main areas first.
foreach ($menu_context['sections'] as $section)
{
if ($section['id'] == $menu_context['current_section'])
{
echo '
<li><a class="active firstlevel" href="#"><span class="firstlevel">', $section['title'] , '</span></a>
<ul>';
}
else
echo '
<li><a class="firstlevel" href="#"><span class="firstlevel">', $section['title'] , '</span></a>
<ul>';

// For every area of this section show a link to that area (bold if it's currently selected.)
$additional_items = 0;
foreach ($section['areas'] as $i => $area)
{
// Not supposed to be printed?
if (empty($area['label']))
continue;

echo '
<li', (++$additional_items > 6) ? ' class="additional_items"' : '' ,'>';

// Is this the current area, or just some area?
if ($i == $menu_context['current_area'])
{
echo '
<a class="chosen" href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '"><span>', $area['icon'], $area['label'], !empty($area['subsections']) ? '...' : '', '</span></a>';

if (empty($context['tabs']))
$context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array();
}
else
echo '
<a href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '"><span>', $area['icon'], $area['label'], !empty($area['subsections']) ? '...' : '', '</span></a>';


echo '
</li>';
}
echo '
</ul>
</li>';
}

echo '
</ul>
</div>';



The original:
<div id="admin_menu">
<ul class="dropmenu" id="dropdown_menu_', $context['cur_menu_id'], '">';

// Main areas first.
foreach ($menu_context['sections'] as $section)
{
if ($section['id'] == $menu_context['current_section'])
{
echo '
<li><a class="active firstlevel" href="#"><span class="firstlevel">', $section['title'] , '</span></a>
<ul>';
}
else
echo '
<li><a class="firstlevel" href="#"><span class="firstlevel">', $section['title'] , '</span></a>
<ul>';

// For every area of this section show a link to that area (bold if it's currently selected.)
$additional_items = 0;
foreach ($section['areas'] as $i => $area)
{
// Not supposed to be printed?
if (empty($area['label']))
continue;

echo '
<li', (++$additional_items > 6) ? ' class="additional_items"' : '' ,'>';

// Is this the current area, or just some area?
if ($i == $menu_context['current_area'])
{
echo '
<a class="chosen" href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '"><span>', $area['icon'], $area['label'], !empty($area['subsections']) ? '...' : '', '</span></a>';

if (empty($context['tabs']))
$context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array();
}
else
echo '
<a href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '"><span>', $area['icon'], $area['label'], !empty($area['subsections']) ? '...' : '', '</span></a>';

// Is there any subsections?
$additional_items_sub = 0;
if (!empty($area['subsections']))
{
echo '
<ul class="showsubmenunone">';

foreach ($area['subsections'] as $sa => $sub)
{
if (!empty($sub['disabled']))
continue;

$url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa;

echo '
<li class="showsubmenunone"', (++$additional_items_sub > 6) ? ' class="additional_items"' : '' ,'>
<a ', !empty($sub['selected']) ? 'class="active" ' : '', 'href="', $url, $menu_context['extra_parameters'], '"><span>', $sub['label'], '</span></a>
</li>';
}

echo '
</ul>';
}

echo '
</li>';
}
echo '
</ul>
</li>';
}

echo '
</ul>
</div>';

Advertisement: