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.
This commit is contained in:
Scott Ullrich 2008-07-22 05:55:12 +00:00
parent 510e86d1d1
commit 7388172140

View File

@ -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 "<script type=\"text/javascript\">";
include($javascript);
echo "</script>";
} else {
echo "<p/>ERROR! COULD NOT LOCATE $javascript";
echo "<p/>Please contact webmaster.";
exit;
}
}
function outputCSSFileInline($css) {
if(file_exists($css)) {
echo "<style type=\"text/css\">";
include($css);
echo "</style>";
} else {
echo "<p/>ERROR! COULD NOT LOCATE $css";
echo "<p/>Please contact webmaster.";
exit;
}
}
/* include all configuration functions */
require_once("auth.inc");
require_once("captiveportal.inc");