From 12d606ef13873809d83a9ff7329ae01350f97ace Mon Sep 17 00:00:00 2001 From: wdlee91 Date: Wed, 9 Apr 2008 04:39:22 +0000 Subject: [PATCH] =?UTF-8?q?,=20=EC=97=90=20?= =?UTF-8?q?=EB=8C=80=ED=95=B4=20IE=20conditional=20comment=EB=A5=BC=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=ED=95=A0=20=EC=88=98=20=EC=9E=88=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20%import=20=EA=B5=AC=EB=AC=B8=EC=97=90=20targetie=20?= =?UTF-8?q?=EC=9D=B8=EC=9E=90=20=EC=B6=94=EA=B0=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4087 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/context/Context.class.php | 16 ++++---- classes/template/TemplateHandler.class.php | 12 ++++-- common/tpl/common_layout.html | 44 +++++++++++++++++----- 3 files changed, 51 insertions(+), 21 deletions(-) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 68670940e..0498cb5ac 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -714,18 +714,18 @@ /** * @brief js file을 추가 **/ - function addJsFile($file, $optimized = true) { + function addJsFile($file, $optimized = true, $targetie = '') { $oContext = &Context::getInstance(); - return $oContext->_addJsFile($file, $optimized); + return $oContext->_addJsFile($file, $optimized, $targetie); } /** * @brief js file을 추가 **/ - function _addJsFile($file, $optimized) { + function _addJsFile($file, $optimized, $targetie) { if(in_array($file, $this->js_files)) return; //if(!preg_match('/^http:\/\//i',$file)) $file = str_replace(realpath("."), ".", realpath($file)); - $this->js_files[] = array('file' => $file, 'optimized' => $optimized); + $this->js_files[] = array('file' => $file, 'optimized' => $optimized, 'targetie' => $targetie); } /** @@ -763,19 +763,19 @@ /** * @brief CSS file 추가 **/ - function addCSSFile($file, $optimized = true, $media = 'all') { + function addCSSFile($file, $optimized = true, $media = 'all', $targetie = '') { $oContext = &Context::getInstance(); - return $oContext->_addCSSFile($file, $optimized, $media); + return $oContext->_addCSSFile($file, $optimized, $media, $targetie); } /** * @brief CSS file 추가 **/ - function _addCSSFile($file, $optimized, $media) { + function _addCSSFile($file, $optimized, $media, $targetie) { if(in_array($file, $this->css_files)) return; //if(preg_match('/^http:\/\//i',$file)) $file = str_replace(realpath("."), ".", realpath($file)); - $this->css_files[] = array('file' => $file, 'optimized' => $optimized, 'media' => $media); + $this->css_files[] = array('file' => $file, 'optimized' => $optimized, 'media' => $media, 'targetie' => $targetie); } /** diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index c4c81f7cc..3a69da858 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -115,8 +115,8 @@ // 의 변경 $buff = preg_replace_callback('!<\!--@(.*?)-->!is', array($this, '_compileFuncToCode'), $buff); - // import xml filter/ css/ js/ 언어파일 (media는 css에만 적용) - $buff = preg_replace_callback('!<\!--%import\(\"([^\"]*?)\"(,optimized\=(true|false)(,media\=\"([^\"]*)\")?)?\)-->!is', array($this, '_compileImportCode'), $buff); + // import xml filter/ css/ js/ 언어파일 (media는 css에만 적용) + $buff = preg_replace_callback('!<\!--%import\(\"([^\"]*?)\"(,optimized\=(true|false))?(,media\=\"([^\"]*)\")?(,targetie=\"([^\"]*)\")?\)-->!is', array($this, '_compileImportCode'), $buff); // 파일에 쓰기 전에 직접 호출되는 것을 방지 $buff = sprintf('%s%s%s','',"\n",$buff); @@ -265,6 +265,10 @@ if(isset($matches[5])) $media = trim($matches[5]); if(!$media) $media = 'all'; + if(isset($matches[7])) + $targetie = trim($matches[7]); + if(!$targetie) $targetie = ''; + else $optimized = 'false'; // given_file이 lang으로 끝나게 되면 언어팩을 읽도록 함 if(substr($given_file, -4)=='lang') { @@ -309,12 +313,12 @@ // css file case 'css' : $meta_file = sprintf('%s%s', $base_path, $filename); - $output = sprintf('', $base_path, $filename, $optimized, $media); + $output = sprintf('', $base_path, $filename, $optimized, $media, $targetie); break; // js file case 'js' : $meta_file = sprintf('%s%s', $base_path, $filename); - $output = sprintf('', $base_path, $filename, $optimized); + $output = sprintf('', $base_path, $filename, $optimized, $targetie); break; } } diff --git a/common/tpl/common_layout.html b/common/tpl/common_layout.html index e85616e68..6f339a186 100644 --- a/common/tpl/common_layout.html +++ b/common/tpl/common_layout.html @@ -3,16 +3,42 @@ - - - - - + + + + + + + + + + + + + {Context::getBrowserTitle()} - - - - + + + + + + + + + + + + + + + +