From fcd0c11ef9ed3d1387c031cfe0c356b4eb5a8b8e Mon Sep 17 00:00:00 2001 From: iliajie Date: Wed, 28 Sep 2022 22:46:08 +0300 Subject: [PATCH] Add support to modify help text using `help_pre_load` sub --- help.cgi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/help.cgi b/help.cgi index d4bcb1dfb..4e9ac9706 100755 --- a/help.cgi +++ b/help.cgi @@ -23,6 +23,14 @@ $help = &read_help_file($module, $file); $help || &helperror(&text('help_efile3', &html_escape($file), &html_escape($module))); +# Modify help file based on module +if (&foreign_exists($module) && + &foreign_require($module) && + &foreign_func_exists($module, 'help_pre_load')) { + $help = + &foreign_call($module, "help_pre_load", $help); + } + # find and replace the
section if ($help =~ s/
([^<]+)<\/header>//i) { &popup_header($1);