mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@546 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
be5a6f90eb
commit
e277f86f12
1 changed files with 0 additions and 48 deletions
|
|
@ -47,9 +47,6 @@
|
||||||
// 확장 정보(코멘트나 기타 등등) 플래그가 false이면 기본 문서 정보만 return
|
// 확장 정보(코멘트나 기타 등등) 플래그가 false이면 기본 문서 정보만 return
|
||||||
if(!$get_extra_info) return $document;
|
if(!$get_extra_info) return $document;
|
||||||
|
|
||||||
// 내용 변경
|
|
||||||
$document->content = $this->transContent($document->content);
|
|
||||||
|
|
||||||
// document controller 객체 생성
|
// document controller 객체 생성
|
||||||
$oDocumentController = &getController('document');
|
$oDocumentController = &getController('document');
|
||||||
|
|
||||||
|
|
@ -313,50 +310,5 @@
|
||||||
$output = $oDB->executeQuery('document.getCategoryDocumentCount', $args);
|
$output = $oDB->executeQuery('document.getCategoryDocumentCount', $args);
|
||||||
return (int)$output->data->count;
|
return (int)$output->data->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 내용의 플러그인이나 기타 기능에 대한 code를 실제 code로 변경
|
|
||||||
**/
|
|
||||||
function transContent($content) {
|
|
||||||
// 에디터 컴포넌트를 찾아서 결과 코드로 변환
|
|
||||||
$content = preg_replace_callback('!<(div|img)([^\>]*?)>(<\/div>)?!is', array($this,'_transMultimedia'), $content);
|
|
||||||
|
|
||||||
// <br> 코드 변환
|
|
||||||
$content = str_replace(array("<BR>","<br>","<Br>"),"<br />", $content);
|
|
||||||
|
|
||||||
// <img ...> 코드를 <img ... /> 코드로 변환
|
|
||||||
$content = preg_replace('!<img(.*?)(\/){0,1}>!is','<img\\1 />', $content);
|
|
||||||
|
|
||||||
return $content;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 내용의 멀티미디어 태그를 html 태그로 변경
|
|
||||||
* <img ... class="multimedia" ..> 로 되어 있는 코드를 변경
|
|
||||||
**/
|
|
||||||
function _transMultimedia($matches) {
|
|
||||||
// IE에서는 태그의 특성중에서 " 를 빼어 버리는 경우가 있기에 정규표현식으로 추가해줌
|
|
||||||
$buff = $matches[0];
|
|
||||||
$buff = preg_replace('/([^=^"^ ]*)=([^"])([^=^ ]*)/i', '$1="$2$3"', $buff);
|
|
||||||
|
|
||||||
// 플러그인에서 생성된 코드 (img, div태그내에 plugin코드 존재)의 parameter를 추출
|
|
||||||
$oXmlParser = new XmlParser();
|
|
||||||
$xml_doc = $oXmlParser->parse($buff);
|
|
||||||
|
|
||||||
// plugin attribute가 없으면 return
|
|
||||||
$editor_component = $xml_doc->attrs->editor_component;
|
|
||||||
if(!$editor_component) return $matches[0];
|
|
||||||
|
|
||||||
// editor class 객체 생성하여 component 객체 받음
|
|
||||||
$oEditor = &getClass('editor');
|
|
||||||
if(!is_object($oEditor)) return $matches[0];
|
|
||||||
|
|
||||||
// component::transHTML() 을 이용하여 변환된 코드를 받음
|
|
||||||
$oComponent = &$oEditor->getComponentObject($editor_component, 0);
|
|
||||||
if(!is_object($oComponent)||!method_exists($oComponent, 'transHTML')) return $matches[0];
|
|
||||||
|
|
||||||
return $oComponent->transHTML($xml_doc);
|
|
||||||
//return sprintf("<script type=\"text/javascript\">displayMultimedia(\"%s\", \"%s\", \"%s\");</script>", $obj->type, $obj->src, $style);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue