merge from 1.4.5(2)

git-svn-id: http://xe-core.googlecode.com/svn/trunk@8242 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2011-04-01 02:10:00 +00:00
parent 825ccd8328
commit 0a2c470bc8
2 changed files with 4 additions and 22 deletions

View file

@ -24,8 +24,6 @@ class Context {
var $ftp_info = NULL; ///< FTP info.
var $ssl_actions = array(); ///< list of actions to be sent via ssl (it is used by javascript xml handler for ajax)
var $js_files = array(); ///< list of javascript files used for display
var $css_files = array(); ///< list of css files used for display
var $js_files_map = array(); ///< hash map of javascript files. The file name is used as a key
var $css_files_map = array(); ///< hash map of css files. The file name is used as a key
@ -1002,14 +1000,10 @@ class Context {
if(!in_array($type, $avail_types)) $type = $avail_types[0];
$file = $self->normalizeFilePath($file);
// Is this file already registered?
if ($self->js_files_map[$file]) return;
$self->js_files_map[$file] = 1;
if(is_null($index)) $index = count($self->js_files);
while($self->js_files[$index++]);
$self->js_files[--$index] = array('file'=>$file, 'targetie'=>$targetie, 'type'=>$type);
if (!is_array($map[$type])) $map[$type] = array();
if (!isset($map[$type][$key]) || (int)$map[$type][$key] > (int)$index) $map[$type][$key] = (int)$index+count($map[$type])/1000-1;
}
/**
@ -1087,13 +1081,7 @@ class Context {
$file = $self->normalizeFilePath($file);
// Is this file already registered?
if ($self->css_files_map[$file]) return;
$self->css_files_map[$file] = 1;
if(is_null($index)) $index = count($self->css_files);
while($self->css_files[$index++]);
$self->css_files[--$index] = array('file'=>$file, 'targetie'=>$targetie, 'media'=>$media);
if (!isset($map[$key]) || (int)$map[$key] > (int)$index) $map[$key] = (int)$index+count($map)/100-1;
}
/**

View file

@ -518,7 +518,6 @@
if($type == 'unload') {
$output = '<?php Context::unloadCSSFile("'.$source_filename.'"); ?>';
} else {
$meta_file = $source_filename;
$output = '<?php Context::addCSSFile("'.$source_filename.'",false,"'.$attrs['media'].'","'.$attrs['targetie'].'",'.$attrs['index'].'); ?>';
}
break;
@ -527,14 +526,12 @@
if($type == 'unload') {
$output = '<?php Context::unloadJsFile("'.$source_filename.'"); ?>';
} else {
$meta_file = $source_filename;
$output = '<?php Context::addJsFile("'.$source_filename.'",false,"'.$attrs['targetie'].'",'.$attrs['index'].',"'.$attrs['type'].'"); ?>';
}
break;
}
}
if($meta_file) $output = '<!--Meta:'.$meta_file.'-->'.$output;
return $output;
}
@ -797,7 +794,6 @@
if(preg_match('/^(http|\/)/i',$source_filename)) {
$output = sprintf('<?php Context::addCSSFile("%s", %s, "%s", "%s", %s); ?>', $source_filename, 'false', $media, $targetie, $index);
} else {
$meta_file = sprintf('%s%s', $base_path, $filename);
$output = sprintf('<?php Context::addCSSFile("%s%s", %s, "%s", "%s", %s); ?>', $base_path, $filename, $optimized, $media, $targetie, $index);
}
break;
@ -806,14 +802,12 @@
if(preg_match('/^(http|\/)/i',$source_filename)) {
$output = sprintf('<?php Context::addJsFile("%s", %s, "%s", %s,"%s"); ?>', $source_filename, 'false', $targetie, $index, $type);
} else {
$meta_file = sprintf('%s%s', $base_path, $filename);
$output = sprintf('<?php Context::addJsFile("%s%s", %s, "%s", %s, "%s"); ?>', $base_path, $filename, $optimized, $targetie, $index, $type);
}
break;
}
}
if($meta_file) $output = '<!--Meta:'.$meta_file.'-->'.$output;
return $output;
}