From 7388172140324e50203cfd105e5b5298465bc34e Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 22 Jul 2008 05:55:12 +0000 Subject: Say hello to outputJavaScriptFileInline() and outputCSSFileInline which can take a css and or javascript file and pass it through the php parser without forking and return the results inline. This is still faster then a round trip back to Lighttpd. Soon I will be changing portions of the webConfigurator to use these functions. --- etc/inc/functions.inc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'etc') diff --git a/etc/inc/functions.inc b/etc/inc/functions.inc index a9ecbea..113d6f7 100644 --- a/etc/inc/functions.inc +++ b/etc/inc/functions.inc @@ -69,6 +69,31 @@ if(!function_exists("pfSenseHeader")) { } /* END compatibility goo with HEAD */ +// Return inline javascript file or CSS to minimizie +// request count going back to server. +function outputJavaScriptFileInline($javascript) { + if(file_exists($javascript)) { + echo ""; + } else { + echo "

ERROR! COULD NOT LOCATE $javascript"; + echo "

Please contact webmaster."; + exit; + } +} +function outputCSSFileInline($css) { + if(file_exists($css)) { + echo ""; + } else { + echo "

ERROR! COULD NOT LOCATE $css"; + echo "

Please contact webmaster."; + exit; + } +} + /* include all configuration functions */ require_once("auth.inc"); require_once("captiveportal.inc"); -- cgit v1.1