From a3f7758510ab4d183e679d3d10cfbc7ce832a28f Mon Sep 17 00:00:00 2001 From: Vincent Li Date: Fri, 4 Jul 2025 17:10:17 +0000 Subject: [PATCH] functions.pl: add missing sub routine for wireguard.cgi wireguard.cgi calls errorbox and opensection/closesection, but they are missing from header.pl. ipfire had functons.pl removed and moved subroutines to header.pl and added errorbox in header.pl. to keep the change minimum so not affect other features, add errorbox and opensection/closesection in functions.pl Signed-off-by: Vincent Li --- html/html/themes/ipfire/include/functions.pl | 38 ++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl index b7d9f7979..485955825 100644 --- a/html/html/themes/ipfire/include/functions.pl +++ b/html/html/themes/ipfire/include/functions.pl @@ -265,3 +265,41 @@ sub openbox { sub closebox { print ""; } + +sub errorbox($) { + my @errors = grep { $_ ne "" } @_; + + # Do nothing if there are no errors + return unless (@errors); + + # Open a new box + &openbox('100%', 'left', "Oops something went wrong"); + + # Print all error messages + print "\n"; + + # Close the box again + &closebox(); +} + +# Sections + +sub opensection($) { + my $title = shift; + + # Open the section + print "
"; + + # Show the title if set + if ($title) { + print "

${title}

\n"; + } +} + +sub closesection() { + print "
"; +}