Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support wiki pages names for perl modules.

  • Loading branch information...
commit 79e78608b3b12ca039472b535fed618b2f5faa79 1 parent 2622167
Alexey Sokolov authored
6 modules/modperl.cpp
View
@@ -147,11 +147,12 @@ class CModPerl: public CGlobalModule {
break;
case Perl_Loaded:
result = HALT;
- if (3 == ret) {
+ if (4 == ret) {
ModInfo.SetGlobal(false);
ModInfo.SetDescription(PString(ST(2)));
ModInfo.SetName(sModule);
ModInfo.SetPath(PString(ST(1)));
+ ModInfo.SetWikiPage(PString(ST(3)));
bSuccess = true;
} else {
bSuccess = false;
@@ -201,11 +202,12 @@ class CModPerl: public CGlobalModule {
PUSH_STR(sPath);
PUSH_STR(sName);
PCALL("ZNC::Core::ModInfoByPath");
- if (!SvTRUE(ERRSV) && ret == 1) {
+ if (!SvTRUE(ERRSV) && ret == 2) {
ModInfo.SetGlobal(false);
ModInfo.SetDescription(PString(ST(0)));
ModInfo.SetName(sName);
ModInfo.SetPath(sPath);
+ ModInfo.SetWikiPage(PString(ST(1)));
ssMods.insert(ModInfo);
}
PEND;
8 modules/modperl/startup.pl
View
@@ -154,7 +154,7 @@ sub GetModInfo {
return ($ZNC::Perl_LoadError, "Incorrect perl module.") unless IsModule $modpath, $modname;
require $modpath;
my $pmod = bless {}, $modname;
- return ($ZNC::Perl_Loaded, $modpath, $pmod->description)
+ return ($ZNC::Perl_Loaded, $modpath, $pmod->description, $pmod->wiki_page)
}
sub ModInfoByPath {
@@ -162,7 +162,7 @@ sub ModInfoByPath {
die "Incorrect perl module." unless IsModule $modpath, $modname;
require $modpath;
my $pmod = bless {}, $modname;
- return ($pmod->description)
+ return ($pmod->description, $pmod->wiki_page)
}
sub CallModFunc {
@@ -279,6 +279,10 @@ sub description {
"< Placeholder for a description >"
}
+sub wiki_page {
+ ''
+}
+
# Default implementations for module hooks. They can be overriden in derived modules.
sub OnLoad {1}
sub OnBoot {}
4 modules/perleval.pm
View
@@ -8,6 +8,10 @@ sub description {
'Evaluates perl code'
}
+sub wiki_page {
+ 'perleval'
+}
+
sub OnLoad {
my $self = shift;
if (!$self->GetUser->IsAdmin) {
Please sign in to comment.
Something went wrong with that request. Please try again.