mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-27 14:22:54 +09:00
#471 rss출력시 Context::transContent()를 거치도록 하고 이미지갤러리/인용구의 결과물 방식에 따른 결과물 형태를 다르게 하는 코드를 삽입
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4265 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
f6537987f5
commit
5260252282
4 changed files with 29 additions and 4 deletions
|
|
@ -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;$i<count($gallery_info->images_list);$i++) {
|
||||
$output .= sprintf('<img src="%s" alt="" /><br />', $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;
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
1
modules/rss/tpl/display.html
Normal file
1
modules/rss/tpl/display.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
{$content}
|
||||
Loading…
Add table
Add a link
Reference in a new issue