1.4.5.2 modified source merge to 1.5.0

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8276 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2011-04-06 07:56:37 +00:00
commit 52f37ded17
24 changed files with 138 additions and 125 deletions

View file

@ -372,6 +372,7 @@
break;
case 'number' :
case 'numbers' :
if(is_array($val)) $val = join(',', $val);
if(!preg_match('/^(-?)[0-9]+(,\-?[0-9]+)*$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_number, $lang->{$key} ? $lang->{$key} : $key));
break;
case 'alpha' :

View file

@ -70,7 +70,7 @@ class HTMLDisplayHandler {
$output = preg_replace_callback('!<style(.*?)<\/style>!is', array($this,'_moveStyleToHeader'), $output);
// 메타 파일 변경 (캐싱기능등으로 인해 위젯등에서 <!--Meta:경로--> 태그를 content에 넣는 경우가 있음
$output = preg_replace_callback('/<!--Meta:([a-z0-9\_\/\.\@]+)-->/is', array($this,'_transMeta'), $output);
$output = preg_replace_callback('/<!--(#)?Meta:([a-z0-9\_\/\.\@]+)-->/is', array($this,'_transMeta'), $output);
// rewrite module 사용시 생기는 상대경로에 대한 처리를 함
if(Context::isAllowRewrite()) {
@ -128,8 +128,9 @@ class HTMLDisplayHandler {
* @param[in] $oModule the module object
**/
function _transMeta($matches) {
if(substr($matches[1],'-4')=='.css') Context::addCSSFile($matches[1]);
elseif(substr($matches[1],'-3')=='.js') Context::addJSFile($matches[1]);
if($matches[1]) return '';
if(substr($matches[2],'-4')=='.css') Context::addCSSFile($matches[2]);
elseif(substr($matches[2],'-3')=='.js') Context::addJSFile($matches[2]);
}
function _loadJSCSS()

View file

@ -294,6 +294,13 @@
$this->module_info->module_type = $type;
$oModule->setModuleInfo($this->module_info, $xml_info);
if($type == "view" && $this->module_info->use_mobile == "Y" && Mobile::isMobileCheckByAgent())
{
global $lang;
$footer = '<div style="margin:1em 0;padding:.5em;background:#333;border:1px solid #666;border-left:0;border-right:0"><p style="color:#fff;text-align:center;margin:1em 0">'.$lang->msg_pc_to_mobile.' <a href="'.getUrl('m', '1').'" style="color:#FF0; font-weight:bold">'.$lang->cmd_move.'</a></p></div>';
Context::addHtmlFooter($footer);
}
// execute the action, and if failed, set error
if(!$oModule->proc()) $this->error = $oModule->getMessage();

View file

@ -518,6 +518,7 @@
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;
@ -526,12 +527,14 @@
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;
}
@ -794,6 +797,7 @@
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 = $base_path.$filename;
$output = sprintf('<?php Context::addCSSFile("%s%s", %s, "%s", "%s", %s); ?>', $base_path, $filename, $optimized, $media, $targetie, $index);
}
break;
@ -802,12 +806,14 @@
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 = $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;
}