Add support to modify help text using help_pre_load sub

This commit is contained in:
iliajie
2022-09-28 22:46:08 +03:00
parent 8fef42775b
commit fcd0c11ef9

View File

@@ -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 <header> section
if ($help =~ s/<header>([^<]+)<\/header>//i) {
&popup_header($1);