Main Page Menus

3 posts by 2 authors in: Forums > CMS Builder
Last Post: January 17, 2008   (RSS)

Re: [grauchut] Main Page Menus

By Dave - January 17, 2008

The software doesn't have any features that let you do that, but if you don't mind modifying some PHP code it may be possible.

The code that shows the menus in the header is in this file: lib/menus/header.php

If you search for $maxMenus that controls how many menus are shown before they start getting added to the pulldown.

Now, if you wanted to add it to the home menu (the first menu you see when you login, or when you click the CMS logo) that's possible. But not for the faint of heart! :) You'd want to update this file: lib/menus/home.php

You could start with something like this:

<?php
require_once "lib/menus/header_functions.php";
foreach (getMenuList() as $row) {
$hasMenuAccess = preg_match("/\b(all|{$row['tableName']})\b/i", @$CURRENT_USER['tableAccessList']);
$isHomeMenu = $row['tableName'] == 'home';
$selectedMenu = getFirstDefinedValue(@$APP['selectedMenu'], @$FORM['menu'], 'home');
$isSelected = ($selectedMenu == $row['tableName']);
if (!$CURRENT_USER) { continue; } // don't display menus until user logs in
if (!$hasMenuAccess && !$isHomeMenu) { continue; } // don't display if user doesn't have access

if ($isSelected) {
print "<b><a href='?menu={$row['tableName']}'>" . htmlspecialchars($row['menuName']) ."</a></b><br/>\n";
}
else {
print "<a href='?menu={$row['tableName']}'>" . htmlspecialchars($row['menuName']) ."</a><br/>\n";
}
}
?>


Also, another (perhaps simpler) approach would be to just hardcode links into the home.php or header.php files.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Main Page Menus

once again thanks Dave I will give it a try.

[:)]
Glenn Rauchut (Owner) Emergency Designz