diff options
author | Andreas Gohr <andi@splitbrain.org> | 2005-08-01 20:22:42 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2005-08-01 20:22:42 +0200 |
commit | 3600bd520df3cf84efc7cd146657eb6e45694d3f (patch) | |
tree | d52fbcc69b19397b8793bff12c2274654c6ba05a /inc | |
parent | a2bd8ce7506a8286835dd5972a09fdf94c738046 (diff) | |
download | rpg-3600bd520df3cf84efc7cd146657eb6e45694d3f.tar.gz rpg-3600bd520df3cf84efc7cd146657eb6e45694d3f.tar.bz2 |
Load plugin javascript
Javascript files from plugins called script.js are loaded automatically
darcs-hash:20050801182242-7ad00-2bc839c92c54e641347ed1cbeadf8bba3ef6a7a8.gz
Diffstat (limited to 'inc')
-rw-r--r-- | inc/pluginutils.php | 7 | ||||
-rw-r--r-- | inc/template.php | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/inc/pluginutils.php b/inc/pluginutils.php index 4988a169c..5fcc6acfe 100644 --- a/inc/pluginutils.php +++ b/inc/pluginutils.php @@ -7,9 +7,9 @@ */ /** - * prints needed HTML to include plugin CSS files + * prints needed HTML to include plugin CSS and JS files */ -function plugin_printCSS(){ +function plugin_printCSSJS(){ $plugins = plugin_list(); foreach ($plugins as $p){ $dir = "lib/plugins/$p/"; @@ -22,6 +22,9 @@ function plugin_printCSS(){ if(@file_exists(DOKU_INC.$dir.'print.css')){ print ' <link rel="stylesheet" media="print" type="text/css" href="'.DOKU_BASE.$dir.'print.css" />'."\n"; } + if(@file_exists(DOKU_INC.$dir.'script.js')){ + print ' <script type="text/javascript" language="javascript" charset="utf-8" src="'.DOKU_BASE.$dir.'print.css"></script>'."\n"; + } } } diff --git a/inc/template.php b/inc/template.php index b48a591f8..4f6511e97 100644 --- a/inc/template.php +++ b/inc/template.php @@ -207,8 +207,8 @@ function tpl_metaheaders(){ ptln('<script language="javascript" type="text/javascript" charset="utf-8" src="'. DOKU_BASE.'lib/scripts/domTT.js"></script>',$it); - // plugin stylesheets - plugin_printCSS(); + // plugin stylesheets and Scripts + plugin_printCSSJS(); } /** |