Hi,
Refers to PHPMaker 11.0
Add this Function to Server events -> Global -> All Pages -> Menu_Renedering.
Change the Sql Query to whatever you want to show from your User Table. My Table is called employee in this sample and I select the Field Firstname to Show in the Menu. The User can click on this Menu Link and the Home page will loaded. You can add any other Page which you like or an hover function to show an image.
function Menu_Rendering(&$Menu) {
if ($Menu->IsRoot) { // Root menu
if (CurrentUserName() == "Administrator") {
$showname = "Scheiserle";
} else {
//$showname = ew_ExecuteScalar("SELECT CONCAT(FirstName, ' ', LastName) FROM employee WHERE UserLogin = '" . ew_AdjustSql(CurrentUserName()) . "'");
$showname = ew_ExecuteScalar("SELECT FirstName FROM employee WHERE UserLogin = '" . ew_AdjustSql(CurrentUserName()) . "'");
}
$Menu->AddMenuItem(10000, "mi_username", "Welcome: ".$showname, ".", -1, "", IsLoggedIn());
$Menu->MoveItem("mi_username", $Menu->Count() - 1); // Move to last
}
}
If you like to show different colors for the User permitted Menu's like Logout, Change Password etc. add following ID's to the Style Editor (after Beginn User Styles:
#mi_logout a,
#mmi_logout a,
#mi_changepwd a,
#mmi_changepwd a {
color: #265A88;
}
#mi_username a,
#mmi_username a {
color: #00CC66;
}
To make different colors for other Menu Items than use an additinal class.
.mas
{
color: #265A88;
}
Now you can change in the PHPMaker Menu Edtior your Menu items with <span class="mas">Your Menu Iteme Title</span>
This trick works for Captions too.
cheers
Alexander