From 526025228285f9ea20dd91bd9294b40d54f1b6e7 Mon Sep 17 00:00:00 2001 From: zero Date: Tue, 10 Jun 2008 04:14:52 +0000 Subject: [PATCH] =?UTF-8?q?#471=20rss=EC=B6=9C=EB=A0=A5=EC=8B=9C=20Context?= =?UTF-8?q?::transContent()=EB=A5=BC=20=EA=B1=B0=EC=B9=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=ED=95=98=EA=B3=A0=20=EC=9D=B4=EB=AF=B8=EC=A7=80?= =?UTF-8?q?=EA=B0=A4=EB=9F=AC=EB=A6=AC/=EC=9D=B8=EC=9A=A9=EA=B5=AC?= =?UTF-8?q?=EC=9D=98=20=EA=B2=B0=EA=B3=BC=EB=AC=BC=20=EB=B0=A9=EC=8B=9D?= =?UTF-8?q?=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EA=B2=B0=EA=B3=BC=EB=AC=BC=20?= =?UTF-8?q?=ED=98=95=ED=83=9C=EB=A5=BC=20=EB=8B=A4=EB=A5=B4=EA=B2=8C=20?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=EC=BD=94=EB=93=9C=EB=A5=BC=20=EC=82=BD?= =?UTF-8?q?=EC=9E=85?= 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@4265 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- .../image_gallery/image_gallery.class.php | 10 ++++++++++ .../components/quotation/quotation.class.php | 4 ++++ modules/rss/rss.view.php | 18 ++++++++++++++---- modules/rss/tpl/display.html | 1 + 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 modules/rss/tpl/display.html diff --git a/modules/editor/components/image_gallery/image_gallery.class.php b/modules/editor/components/image_gallery/image_gallery.class.php index 2a7bd8495..a686dcb39 100644 --- a/modules/editor/components/image_gallery/image_gallery.class.php +++ b/modules/editor/components/image_gallery/image_gallery.class.php @@ -51,6 +51,16 @@ $images_list = preg_replace('/\.(gif|jpg|jpeg|png) /i',".\\1\n",$images_list); $gallery_info->images_list = explode("\n",trim($images_list)); + // 만약 출력설정이 XML일 경우 이미지 목록만 출력하도록 코드 생성 + if(Context::getResponseMethod() == 'XMLRPC') { + $output = ''; + for($i=0;$iimages_list);$i++) { + $output .= sprintf('
', $gallery_info->images_list[$i]); + } + return $output; + } + + // HTML 출력일 경우 템플릿 변환을 거쳐서 갤러리 출력 설정에 맞는 html코드를 생성하도록 함 preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches); $gallery_info->width = trim($matches[3][0]); if(!$gallery_info->width) $gallery_info->width = 400; diff --git a/modules/editor/components/quotation/quotation.class.php b/modules/editor/components/quotation/quotation.class.php index 00857a86c..5ecca1f41 100644 --- a/modules/editor/components/quotation/quotation.class.php +++ b/modules/editor/components/quotation/quotation.class.php @@ -55,6 +55,10 @@ $bg_color = $xml_obj->attrs->bg_color; $body = $xml_obj->body; + if(Context::getResponseMethod() == 'XMLRPC') { + return $body; + } + $output = ""; $style = sprintf('margin:%spx;padding:%spx;background-color:#%s;', $margin, $padding, $bg_color); switch($border_style) { diff --git a/modules/rss/rss.view.php b/modules/rss/rss.view.php index 6c285fc0c..dfd6aa71f 100644 --- a/modules/rss/rss.view.php +++ b/modules/rss/rss.view.php @@ -126,11 +126,21 @@ // 결과 출력을 XMLRPC로 강제 지정 Context::setResponseMethod("XMLRPC"); - // 템플릿 파일 지정 - $this->setTemplatePath($this->module_path.'tpl/'); + // 결과물을 얻어와서 에디터 컴포넌트등의 전처리 기능을 수행시킴 + $path = $this->module_path.'tpl/'; + if($args->start_date || $args->end_date) $file = 'xe_rss'; + else $file = 'rss20'; - if($args->start_date || $args->end_date) $this->setTemplateFile('xe_rss'); - else $this->setTemplateFile('rss20'); + $oTemplate = new TemplateHandler(); + $oContext = &Context::getInstance(); + + $content = $oTemplate->compile($path, $file); + $content = $oContext->transContent($content); + Context::set('content', $content); + + // 템플릿 파일 지정 + $this->setTemplatePath($path); + $this->setTemplateFile('display'); } /** diff --git a/modules/rss/tpl/display.html b/modules/rss/tpl/display.html new file mode 100644 index 000000000..d9f1e44a0 --- /dev/null +++ b/modules/rss/tpl/display.html @@ -0,0 +1 @@ +{$content}