diff --git a/WebModules.cpp b/WebModules.cpp index 6c320efc..075d4eef 100644 --- a/WebModules.cpp +++ b/WebModules.cpp @@ -277,9 +277,9 @@ void CWebSock::SetPaths(CModule* pModule, bool bIsTemplate) { // m_Template.AppendPath(GetSkinPath("_default_") + "/mods/" + sModName + "/"); - // 3. ./modules// + // 3. ./modules//tmpl/ // - m_Template.AppendPath(GetModWebPath(pModule)); + m_Template.AppendPath(pModule->GetModDataDir() + "/tmpl/"); // 4. ~/.znc/webskins//mods// // @@ -447,25 +447,6 @@ CWebSock::EPageReqResult CWebSock::PrintTemplate(const CString& sPageName, CStri } } -CString CWebSock::GetModWebPath(const CModule* pModule) const { - // This is: /path/to/module.so - const CString& sModPath = pModule->GetModPath(); - - // Find the last '/' in sModPath... - CString::size_type pos = sModPath.find_last_of('/'); - - // ...and set sModDir to the dir in which sModPath resides - CString sModDir = sModPath.substr(0, pos); - - // Check if module is loaded from ~/.znc/modules or from source or from installed prefix - if (sModDir.Equals(_MODDIR_)) { - // Loaded from installed prefix - return CString(_DATADIR_) + "/www/" + pModule->GetModName(); - } - - return sModDir + "/www/" + pModule->GetModName(); -} - CString CWebSock::GetSkinPath(const CString& sSkinName) const { CString sRet = CZNC::Get().GetZNCPath() + "/webskins/" + sSkinName; @@ -654,7 +635,7 @@ CWebSock::EPageReqResult CWebSock::OnPageRequestInternal(const CString& sURI, CS if (sURI.Left(10) == "/modfiles/") { m_Template.AppendPath(GetSkinPath(GetSkinName()) + "/mods/" + m_sModName + "/files/"); - m_Template.AppendPath(GetModWebPath(pModule) + "/files/"); + m_Template.AppendPath(pModule->GetModDataDir() + "/files/"); if (PrintFile(m_Template.ExpandFile(m_sPage.TrimLeft_n("/")))) { return PAGE_PRINT; diff --git a/WebModules.h b/WebModules.h index a1dd43d4..95eba663 100644 --- a/WebModules.h +++ b/WebModules.h @@ -150,7 +150,6 @@ public: CString GetCSRFCheck(); virtual Csock* GetSockObj(const CString& sHost, unsigned short uPort); - CString GetModWebPath(const CModule* pModule) const; CString GetSkinPath(const CString& sSkinName) const; CModule* GetModule() const { return (CModule*) m_pModule; } size_t GetAvailSkins(vector& vRet); diff --git a/modules/www/lastseen/index.tmpl b/modules/lastseen/tmpl/index.tmpl similarity index 100% rename from modules/www/lastseen/index.tmpl rename to modules/lastseen/tmpl/index.tmpl diff --git a/modules/www/notes/files/trash.gif b/modules/notes/files/trash.gif similarity index 100% rename from modules/www/notes/files/trash.gif rename to modules/notes/files/trash.gif diff --git a/modules/www/notes/index.tmpl b/modules/notes/tmpl/index.tmpl similarity index 100% rename from modules/www/notes/index.tmpl rename to modules/notes/tmpl/index.tmpl diff --git a/modules/www/stickychan/index.tmpl b/modules/stickychan/tmpl/index.tmpl similarity index 100% rename from modules/www/stickychan/index.tmpl rename to modules/stickychan/tmpl/index.tmpl diff --git a/modules/www/webadmin/add_edit_chan.tmpl b/modules/webadmin/tmpl/add_edit_chan.tmpl similarity index 100% rename from modules/www/webadmin/add_edit_chan.tmpl rename to modules/webadmin/tmpl/add_edit_chan.tmpl diff --git a/modules/www/webadmin/add_edit_user.tmpl b/modules/webadmin/tmpl/add_edit_user.tmpl similarity index 100% rename from modules/www/webadmin/add_edit_user.tmpl rename to modules/webadmin/tmpl/add_edit_user.tmpl diff --git a/modules/www/webadmin/del_user.tmpl b/modules/webadmin/tmpl/del_user.tmpl similarity index 100% rename from modules/www/webadmin/del_user.tmpl rename to modules/webadmin/tmpl/del_user.tmpl diff --git a/modules/www/webadmin/index.tmpl b/modules/webadmin/tmpl/index.tmpl similarity index 100% rename from modules/www/webadmin/index.tmpl rename to modules/webadmin/tmpl/index.tmpl diff --git a/modules/www/webadmin/listusers.tmpl b/modules/webadmin/tmpl/listusers.tmpl similarity index 100% rename from modules/www/webadmin/listusers.tmpl rename to modules/webadmin/tmpl/listusers.tmpl diff --git a/modules/www/webadmin/settings.tmpl b/modules/webadmin/tmpl/settings.tmpl similarity index 100% rename from modules/www/webadmin/settings.tmpl rename to modules/webadmin/tmpl/settings.tmpl diff --git a/modules/www/webadmin/traffic.tmpl b/modules/webadmin/tmpl/traffic.tmpl similarity index 100% rename from modules/www/webadmin/traffic.tmpl rename to modules/webadmin/tmpl/traffic.tmpl