Aggregates into the supplied chain, the HTML nessesary to display the navbar Returns: None
| Return Type | Function name | Arguments |
|---|---|---|
| void | hdsNavbar::Generate | (hzChain&,hzHttpEvent*,uint32_t&,) |
Declared in file: hzDissemino.h
Defined in file : hdsGenerate.cpp
Function Logic:
Function body:
void hdsNavbar::Generate (hzChain& Z)hzHttpEvent* pE, uint32_t& nLine,
{
// Aggregates into the supplied chain, the HTML nessesary to display the navbar
//
// Arguments: 1) Z The HTML output chain
// 2) pE The HTTP event being responded to
// 3) nLine Line number tracker (controls NL printing)
//
// Returns: None
_hzfunc("hdsNavbar::Generate") ;
hzList<hzString>::Iter si ; // Subjects iterator
hzPair p ; // NV pair representing page url and page title
hdsInfo* pInfo = 0; // Session
// hdsSubject* pSubj ; // Subject
hzString subject ; // Subject
hdsResource* pPage ; // Page within subject
uint32_t x ; // Subhect iterator
uint32_t y ; // Page iterator (within subject)
uint32_t nLo ; // First page of a given subject
uint32_t nHi ; // Last page of a given subject
if (pE)
pInfo = (hdsInfo*) pE->Session() ;
if (m_JS)
{
Z << "<script language=\"javascript\" src=\"/jsc/navbarItems.js\"></script>\n" ;
Z << "<script language=\"javascript\" src=\"/jsc/navbarMenu.js\"></script>\n" ;
return ;
}
Z <<
"\n<table cellspacing='0' cellpadding='0' width='90%' background-color='#000000' border='0'>\n<tr>\n\t<td width='1'> </td><td height='20' valign='center'>\n"
;
// Prepare headings
for (si = m_pApp->m_lstPgSubjects, x = 0; si.Valid() && x < m_pApp->m_lstPgSubjects.Count() ; si++, x++)
{
subject = si.Element() ;
if (m_pApp->m_lstPgSubjects.Count() == 1)
Z.Printf("\t<span id='Pdm%d' class='measure'><a href='%s' onmouseover='hideLast()' class='top'>", x, *subject) ;
else
Z.Printf("\t<span id='Pdm%d' class='measure'><a href=\"#\" class='top' onmouseover='doSub(%d)' onclick='return false'>", x, x) ;
Z.Printf("%s </a></span>\n", *subject) ;
}
Z <<
"\t</td>\n</tr>\n</table>\n"
;
// Prepare lists (sub-menus)
for (si = m_pApp->m_lstPgSubjects, x = 0; si.Valid() && x < m_pApp->m_lstPgSubjects.Count() ; si++, x++)
{
subject = si.Element() ;
Z.Printf("<div id='Sub%d' style='visibility:hidden;position:absolute;width:relative;' onmouseover='IEBum(0,%d)' onmouseout='IEBum(1,%d)'>\n",
x, x, x) ;
Z << "\t<table border='0' background-color='#000000' cellspacing=0 cellpadding=0 width='200'>\n" ;
nLo = m_pApp->m_mapSubj2Res.First(subject) ;
if (nLo < 0)
continue ;
nHi = m_pApp->m_mapSubj2Res.Last(subject) ;
for (y = nLo ; y <&eq; nHi ; y++)
{
pPage = m_pApp->m_mapSubj2Res.GetObj(y) ;
if (pPage->m_resAccess == ACCESS_PUBLIC
|| (pPage->m_resAccess == ACCESS_NOBODY && (!pInfo || !(pInfo->m_Access & ACCESS_MASK)))
|| (pInfo && (pInfo->m_Access & ACCESS_ADMIN || (pInfo->m_Access & ACCESS_MASK) == pPage->m_resAccess)))
Z.Printf("\t<tr><td height='13' valign='center'> <a href='%s' id='link' class='top' onmouseover='IEBum(0,%d)'>%s</a></td></tr>\n",
*pPage->m_Url, x, *pPage->m_Title) ;
}
Z << "\t</table>\n</div>\n" ;
}
}