manualpages: Add path and file extension to the configuration

This allows to correctly assign an URL to a file without relying
on unique base names.
A custom read function is required because General::readhash()
doesn't allow paths as hash keys. Modifying the existing functions
could affect other CGIs and was therefore dismissed.

Fixes: #12806

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
This commit is contained in:
Leo-Andres Hofmann
2022-04-25 21:12:45 +02:00
committed by Peter Müller
parent 5f8a1acfe9
commit 64db1faf67
4 changed files with 110 additions and 88 deletions

View File

@@ -100,8 +100,6 @@ sub openpage {
my $boh = shift;
my $extrahead = shift;
my $suppressMenu = shift // 0;
my @tmp = split(/\./, basename($0));
my $scriptName = @tmp[0];
my $headline = "IPFire";
if (($settings{'WINDOWWITHHOSTNAME'} eq 'on') || ($settings{'WINDOWWITHHOSTNAME'} eq '')) {
@@ -172,7 +170,7 @@ END
;
# Print user manual link
my $manual_url = &Header::get_manualpage_url($scriptName);
my $manual_url = &Header::get_manualpage_url();
if($manual_url) {
print <<END
<span><a href="$manual_url" title="$Lang::tr{'online help en'}" target="_blank"><img src="/images/help-browser.png" alt="$Lang::tr{'online help en'}"></a></span>