diff options
author | Ermal Luçi <eri@pfsense.org> | 2008-07-23 16:23:36 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2008-07-23 16:23:36 +0000 |
commit | 32dab50e76b6a2b742e2e71855248f532c11c696 (patch) | |
tree | 5352b8bfd38fa48c71983f38b538e363f1232f0b /etc | |
parent | ab346e30be6200a5d0d413d8552862066adf9716 (diff) | |
download | pfsense-32dab50e76b6a2b742e2e71855248f532c11c696.zip pfsense-32dab50e76b6a2b742e2e71855248f532c11c696.tar.gz |
Check if cuntions exists bvefore defining them to preven errors with some scripts mostly from console.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/functions.inc | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/etc/inc/functions.inc b/etc/inc/functions.inc index 113d6f7..38bbd48 100644 --- a/etc/inc/functions.inc +++ b/etc/inc/functions.inc @@ -69,31 +69,35 @@ 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; +if(!function_exists("outputJavaScriptFileInline")) { + // 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; + +if(!function_exists("outputCSSFileInline")) { + 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"); @@ -111,4 +115,4 @@ require_once("gwlb.inc"); require_once("notices.inc"); require_once("cmd_chain.inc"); -?>
\ No newline at end of file +?> |