mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
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:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user