mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-13 15:32:15 +09:00
issue 19 : JS and CSS files path should start from the XE root directory.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8430 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
c39eab9d05
commit
44d915491d
1 changed files with 6 additions and 8 deletions
|
|
@ -1010,7 +1010,7 @@ class Context {
|
|||
$avail_types = array('head', 'body');
|
||||
if(!in_array($type, $avail_types)) $type = $avail_types[0];
|
||||
|
||||
$key = $self->normalizeFilePath($file)."\t".$targetie;
|
||||
$key = Context::getAbsFileUrl($file)."\t".$targetie;
|
||||
$map = &$self->js_files_map;
|
||||
|
||||
// Is this file already registered?
|
||||
|
|
@ -1024,11 +1024,10 @@ class Context {
|
|||
function unloadJsFile($file, $optimized = false, $targetie = '') {
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
|
||||
$realfile = $self->getAbsFileUrl($file);
|
||||
$remove_key = Context::getAbsFileUrl($file)."\t$targetie";
|
||||
|
||||
foreach($self->js_files_map as $key=>$val) {
|
||||
list($_file, $_targetie) = explode("\t", $key);
|
||||
if($self->getAbsFileUrl($_file)==$realfile && $_targetie == $targetie) {
|
||||
if($key === $remove_key) {
|
||||
unset($self->js_files_map[$key]);
|
||||
return;
|
||||
}
|
||||
|
|
@ -1095,7 +1094,7 @@ class Context {
|
|||
function addCSSFile($file, $optimized=false, $media='all', $targetie='',$index=0) {
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
|
||||
$key = $self->normalizeFilePath($file)."\t".$targetie."\t".$media;
|
||||
$key = Context::getAbsFileUrl($file)."\t$targetie\t$media";
|
||||
$map = &$self->css_files_map;
|
||||
|
||||
if (!isset($map[$key]) || (int)$map[$key] > (int)$index) $map[$key] = (int)$index+count($map)/100-1;
|
||||
|
|
@ -1107,11 +1106,10 @@ class Context {
|
|||
function unloadCSSFile($file, $optimized = false, $media = 'all', $targetie = '') {
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
|
||||
$realfile = $self->getAbsFileUrl($file);
|
||||
$remove_key = Context::getAbsFileUrl($file)."\t$targetie\t$media";
|
||||
|
||||
foreach($self->css_files_map as $key => $val) {
|
||||
list($_file, $_targetie, $_media) = explode("\t", $key);
|
||||
if($self->getAbsFileUrl($_file)==$realfile && $_media==$media && $_targetie==$targetie) {
|
||||
if($key === $remove_key) {
|
||||
unset($self->css_files_map[$key]);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue