Skip to content

Commit

Permalink
Modules can now provide its wiki page name.
Browse files Browse the repository at this point in the history
It's shown on webadmin as a link.
  • Loading branch information
Alexey Sokolov committed Jun 11, 2011
1 parent e6e3331 commit 0c840f9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
3 changes: 1 addition & 2 deletions Modules.cpp
Expand Up @@ -963,8 +963,7 @@ bool CModules::GetModPathInfo(CModInfo& ModInfo, const CString& sModule, const C
return false;

if (Info) {
ModInfo.SetGlobal(Info->IsGlobal());
ModInfo.SetDescription(Info->GetDescription());
ModInfo = *Info;
}
ModInfo.SetName(sModule);
ModInfo.SetPath(sModPath);
Expand Down
3 changes: 3 additions & 0 deletions Modules.h
Expand Up @@ -191,6 +191,7 @@ class CModInfo {
const CString& GetName() const { return m_sName; }
const CString& GetPath() const { return m_sPath; }
const CString& GetDescription() const { return m_sDescription; }
const CString& GetWikiPage() const { return m_sWikiPage; }
bool IsGlobal() const { return m_bGlobal; }
ModLoader GetLoader() const { return m_fLoader; }
GlobalModLoader GetGlobalLoader() const { return m_fGlobalLoader; }
Expand All @@ -200,6 +201,7 @@ class CModInfo {
void SetName(const CString& s) { m_sName = s; }
void SetPath(const CString& s) { m_sPath = s; }
void SetDescription(const CString& s) { m_sDescription = s; }
void SetWikiPage(const CString& s) { m_sWikiPage = s; }
void SetGlobal(bool b) { m_bGlobal = b; }
void SetLoader(ModLoader fLoader) { m_fLoader = fLoader; }
void SetGlobalLoader(GlobalModLoader fGlobalLoader) { m_fGlobalLoader = fGlobalLoader; }
Expand All @@ -210,6 +212,7 @@ class CModInfo {
CString m_sName;
CString m_sPath;
CString m_sDescription;
CString m_sWikiPage;
ModLoader m_fLoader;
GlobalModLoader m_fGlobalLoader;
};
Expand Down
2 changes: 1 addition & 1 deletion modules/data/webadmin/tmpl/add_edit_user.tmpl
Expand Up @@ -136,7 +136,7 @@
<? LOOP ModuleLoop ?>
<tr class="<? IF __EVEN__ ?>evenrow<? ELSE ?>oddrow<? ENDIF ?>">
<td class="mod_name">
<input type="checkbox" name="loadmod" id="lm_<? VAR Name ?>" value="<? VAR Name ?>"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> /><label for="lm_<? VAR Name ?>"> <? VAR Name ?></label>
<input type="checkbox" name="loadmod" id="lm_<? VAR Name ?>" value="<? VAR Name ?>"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> /><label for="lm_<? VAR Name ?>"> <? IF Wiki ?><a href="http://wiki.znc.in/<? VAR Wiki ?>"><? VAR Name ?></a> <? ELSE ?> <? VAR Name ?> <? ENDIF ?></label>
</td>
<td class="mod_args">
<? IF Disabled ?><? VAR Args ?><? ELSE ?><input class="third" type="text" name="modargs_<? VAR Name ?>" value="<? VAR Args ?>" /><? ENDIF ?>
Expand Down
2 changes: 1 addition & 1 deletion modules/data/webadmin/tmpl/settings.tmpl
Expand Up @@ -132,7 +132,7 @@
<tbody>
<? LOOP ModuleLoop ?>
<tr class="<? IF __EVEN__ ?>evenrow<? ELSE ?>oddrow<? ENDIF ?>">
<td class="mod_name"><input type="checkbox" name="loadmod" id="lm_<? VAR Name ?>" value="<? VAR Name ?>"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> /><label for="lm_<? VAR Name ?>"> <? VAR Name ?></label></td>
<td class="mod_name"><input type="checkbox" name="loadmod" id="lm_<? VAR Name ?>" value="<? VAR Name ?>"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> /><label for="lm_<? VAR Name ?>"> <? IF Wiki ?> <a href="http://wiki.znc.in/<? VAR Wiki ?>"><? VAR Name ?></a> <? ELSE ?> <? VAR Name ?> <? ENDIF ?></label></td>
<td class="mod_args"><input type="text" name="modargs_<? VAR Name ?>" value="<? VAR Args ?>" /></td>
<td class="mod_descr"><? VAR Description ?></td>
</tr>
Expand Down
2 changes: 2 additions & 0 deletions modules/webadmin.cpp
Expand Up @@ -745,6 +745,7 @@ class CWebAdminMod : public CGlobalModule {
l["Name"] = Info.GetName();
l["Description"] = Info.GetDescription();
l["Args"] = GetModArgs(pUser, Info.GetName());
l["Wiki"] = Info.GetWikiPage();

if (pUser && pUser->GetModules().FindModule(Info.GetName())) {
l["Checked"] = "true";
Expand Down Expand Up @@ -1039,6 +1040,7 @@ class CWebAdminMod : public CGlobalModule {
l["Name"] = Info.GetName();
l["Description"] = Info.GetDescription();
l["Args"] = GetModArgs(NULL, Info.GetName(), true);
l["Wiki"] = Info.GetWikiPage();
}

return true;
Expand Down

0 comments on commit 0c840f9

Please sign in to comment.