Use CSS instead of JavaScript for menu items

This commit is contained in:
Alexander Nicolaysen Sørnes
2008-01-17 23:13:04 +01:00
committed by Chris Morgan
parent 0f41ee390c
commit 6808c187eb
2 changed files with 9 additions and 23 deletions

View File

@@ -63,8 +63,9 @@ p.indent { padding-left: 1em; padding-right: 1em;}
.menuTitle { font-size: 12px; color: #ffffff; font-weight: bold; text-decoration: none; }
.menuTitle:visited { font-size: 12px; color: #ffffff; font-weight: bold; text-decoration: none; }
.menuTitle:hover { font-size: 12px; color: #ffffff; font-weight: bold; text-decoration: none; }
.menuLink { font-size: 11px; color: #ffffff; font-weight: bold; }
.menuItem { font-size: 11px; color: #000000; }
.menuLink { padding-left: 4px; padding-top: 5px; padding-bottom: 5px; background-color: #ffffff; font-size: 11px; width: 140px; display: block; }
.menulink:hover { background-color: #e0e6ff; }
.menuItem { padding-left: 4px; padding-top: 5px; padding-bottom: 5px; background-color: #ffffff; font-size: 11px; width: 140px; display: block; }
.menuItem:visited { font-size: 11px; color: #000000; }
.menuItem:hover { font-size: 11px; color: #A50D0D; }

View File

@@ -31,7 +31,7 @@ class htmlmenu {
<td>
<table width="155" border="0" cellspacing="0" cellpadding="1">
<tr class="topMenu"><td>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<table width="100%" border="0" cellspacing="0" cellpadding="5"><tr><td class="sidemenu">
';
}
@@ -43,38 +43,23 @@ class htmlmenu {
if($shUrl)
{
$oTableCell = new TableCell("<span class=MenuItem>&nbsp;<u>".
"<a href=\"$shUrl\">$sName</a></u></span>");
$oHighlightColor = new Color(0xe0, 0xe6, 0xff);
$oInactiveColor = new Color(0xff, 0xff, 0xff);
$oTableRowHighlight = new TableRowHighlight($oHighlightColor, $oInactiveColor);
$oTableRowClick = new TableRowClick($shUrl);
$oTableRowClick->SetHighlight($oTableRowHighlight);
$oTableRow->SetRowClick($oTableRowClick);
echo "<a href=\"$shUrl\" class=\"menuLink\">$sName</a>";
} else
{
$oTableCell = new TableCell("<span class=menuItem>&nbsp;$sName</span></td></tr>");
echo "<div class=\"menuItem\">$sName</div>";
}
$oTableCell->SetAlign($sAlign);
$oTableCell->SetWidth("100%");
$oTableRow->SetClass("sidemenu");
$oTableRow->AddCell($oTableCell);
echo $oTableRow->GetString();
}
function addmisc($sStuff, $sAlign = "left")
{
echo " <tr class=sideMenu><td width='100%' align=$sAlign><span class=menuItem>&nbsp;$sStuff</span></td></tr>\n";
echo "<div align=\"$sAlign\" class=\"menuItem\">$sStuff</div>\n";
}
function done($form = null)
{
echo '
</td>
</tr>
</table>
</td></tr>
</table>