Add methods to CModule to get the web path

Add these values to the template and use them when linking to any module
This commit is contained in:
Kyle Fuller
2012-02-09 16:55:58 +00:00
parent b1593238d5
commit b1ed9c9b74
14 changed files with 46 additions and 21 deletions

View File

@@ -342,6 +342,7 @@ bool CWebSock::AddModLoop(const CString& sLoopName, CModule& Module) {
CTemplate& Row = m_Template.AddRow(sLoopName);
Row["ModName"] = Module.GetModName();
Row["ModPath"] = Module.GetWebPath();
Row["Title"] = sTitle;
if (m_sModName == Module.GetModName()) {
@@ -367,6 +368,7 @@ bool CWebSock::AddModLoop(const CString& sLoopName, CModule& Module) {
CTemplate& SubRow = Row.AddRow("SubPageLoop");
SubRow["ModName"] = Module.GetModName();
SubRow["ModPath"] = Module.GetWebPath();
SubRow["PageName"] = SubPage->GetName();
SubRow["Title"] = SubPage->GetTitle().empty() ? SubPage->GetName() : SubPage->GetTitle();
@@ -667,6 +669,9 @@ CWebSock::EPageReqResult CWebSock::OnPageRequestInternal(const CString& sURI, CS
break;
}
m_Template["ModPath"] = pModule->GetWebPath();
m_Template["ModFilesPath"] = pModule->GetWebFilesPath();
if (!pModule) {
return PAGE_NOTFOUND;
} else if (pModule->WebRequiresLogin() && !ForceLogin()) {