Added load type(head, body) in <!--%load_js_plugin()-->

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9995 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2011-12-29 05:51:45 +00:00
parent 9353d7d311
commit bb8daf9bcd
2 changed files with 12 additions and 4 deletions

View file

@ -1254,7 +1254,7 @@ class Context {
/**
* @brief javascript plugin load
**/
function loadJavascriptPlugin($plugin_name) {
function loadJavascriptPlugin($plugin_name, $type='body') {
static $loaded_plugins = array();
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
@ -1273,7 +1273,7 @@ class Context {
if(!$filename) continue;
if(substr($filename,0,2)=='./') $filename = substr($filename,2);
if(preg_match('/\.js$/i', $filename)) $self->loadFile(array($plugin_path.$filename, 'body', '', 0), true);
if(preg_match('/\.js$/i', $filename)) $self->loadFile(array($plugin_path.$filename, $type, '', 0), true);
elseif(preg_match('/\.css$/i', $filename)) $self->loadFile(array($plugin_path.$filename, 'all', '', 0), true);
}