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 "
"; +}