diff --git a/modules/modperl.cpp b/modules/modperl.cpp index 1c3aa2ed..2fdf7800 100644 --- a/modules/modperl.cpp +++ b/modules/modperl.cpp @@ -147,11 +147,12 @@ public: 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 @@ public: 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; diff --git a/modules/modperl/startup.pl b/modules/modperl/startup.pl index 501ad4d3..0e8cee5d 100644 --- a/modules/modperl/startup.pl +++ b/modules/modperl/startup.pl @@ -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 {} diff --git a/modules/perleval.pm b/modules/perleval.pm index ffba9ad8..4ec2139a 100644 --- a/modules/perleval.pm +++ b/modules/perleval.pm @@ -8,6 +8,10 @@ sub description { 'Evaluates perl code' } +sub wiki_page { + 'perleval' +} + sub OnLoad { my $self = shift; if (!$self->GetUser->IsAdmin) {