git-svn-id: http://xe-core.googlecode.com/svn/trunk@1449 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-05-17 04:24:18 +00:00
parent 43de485436
commit db4065573b
3 changed files with 15 additions and 14 deletions

View file

@ -16,7 +16,7 @@
var $position = 0; var $position = 0;
var $imported_count = 0; var $imported_count = 0;
var $limit_count = 500; var $limit_count = 50;
var $module_srl = 0; var $module_srl = 0;
var $category_srl = 0; var $category_srl = 0;
@ -96,7 +96,7 @@
@set_time_limit(0); @set_time_limit(0);
// 디버그 메세지의 양이 무척 커지기에 디버그 메세지 생성을 중단 // 디버그 메세지의 양이 무척 커지기에 디버그 메세지 생성을 중단
define('__STOP_DEBUG__', true); //define('__STOP_DEBUG__', true);
// 변수 체크 // 변수 체크
$this->module_srl = Context::get('module_srl'); $this->module_srl = Context::get('module_srl');
@ -110,12 +110,8 @@
$this->oXml = new XmlParser(); $this->oXml = new XmlParser();
// module_srl이 있으면 module데이터로 판단하여 처리, 아니면 회원정보로.. // module_srl이 있으면 module데이터로 판단하여 처리, 아니면 회원정보로..
if($this->module_srl) { if($this->module_srl) $this->importDocument($xml_file);
$this->limit_count = 10; else $this->importMember($xml_file);
$this->importDocument($xml_file);
} else {
$this->importMember($xml_file);
}
if($this->position+$this->limit_count > $this->imported_count) { if($this->position+$this->limit_count > $this->imported_count) {
$this->add('is_finished', 'Y'); $this->add('is_finished', 'Y');
@ -229,8 +225,9 @@
$sequence = $matches[1]; $sequence = $matches[1];
$xml_doc = $this->oXml->parse($matches[0]); $xml_doc = $this->oXml->parse($matches[0]);
// 문서 번호 미리 따오기 // 문서 번호와 내용 미리 구해 놓기
$args->document_srl = getNextSequence(); $args->document_srl = getNextSequence();
$args->content = $xml_doc->document->content->body;
// 첨부파일 미리 등록 // 첨부파일 미리 등록
$files = $xml_doc->document->files->file; $files = $xml_doc->document->files->file;
@ -245,7 +242,10 @@
if(FileHandler::getRemoteFile($url, $tmp_filename)) { if(FileHandler::getRemoteFile($url, $tmp_filename)) {
$file_info['tmp_name'] = $tmp_filename; $file_info['tmp_name'] = $tmp_filename;
$file_info['name'] = $filename; $file_info['name'] = $filename;
$this->oFileController->insertFile($file_info, $this->module_srl, $args->document_srl, $download_count); $this->oFileController->insertFile($file_info, $this->module_srl, $args->document_srl, $download_count, true);
// 컨텐츠의 내용 수정 (이미지 첨부파일 관련)
$args->content = str_replace($filename, sprintf('./files/attach/images/%s/%s/%s', $this->module_srl, $args->document_srl, $filename), $args->content);
} }
@unlink($tmp_filename); @unlink($tmp_filename);
} }
@ -257,7 +257,6 @@
$args->is_notice = $xml_doc->document->is_notice->body; $args->is_notice = $xml_doc->document->is_notice->body;
$args->is_secret = $xml_doc->document->is_secret->body; $args->is_secret = $xml_doc->document->is_secret->body;
$args->title = $xml_doc->document->title->body; $args->title = $xml_doc->document->title->body;
$args->content = $xml_doc->document->content->body;
$args->readed_count = $xml_doc->document->readed_count->body; $args->readed_count = $xml_doc->document->readed_count->body;
$args->voted_count = $xml_doc->document->voted_count->body; $args->voted_count = $xml_doc->document->voted_count->body;
$args->comment_count = $xml_doc->document->comment_count->body; $args->comment_count = $xml_doc->document->comment_count->body;
@ -276,6 +275,7 @@
$args->allow_comment = $xml_doc->document->allow_comment->body; $args->allow_comment = $xml_doc->document->allow_comment->body;
$args->lock_comment = $xml_doc->document->lock_comment->body; $args->lock_comment = $xml_doc->document->lock_comment->body;
$args->allow_trackback = $xml_doc->document->allow_trackback->body; $args->allow_trackback = $xml_doc->document->allow_trackback->body;
$output = $this->oDocumentController->insertDocument($args, true); $output = $this->oDocumentController->insertDocument($args, true);
if(!$output->toBool()) return; if(!$output->toBool()) return;

View file

@ -80,7 +80,8 @@
<!-- step 2. XML 파일 지정 --> <!-- step 2. XML 파일 지정 -->
<div id="step2" style="display:none"> <div id="step2" style="display:none">
<form action="./" method="get" onsubmit="return doStep2(this)" id="fo_step2"> <!--<form action="./" method="get" onsubmit="return doStep2(this)" id="fo_step2">-->
<form action="./" method="get" id="fo_step2">
<input type="hidden" name="module" value="importer" /> <input type="hidden" name="module" value="importer" />
<input type="hidden" name="act" value="procImporterAdminImport" /> <input type="hidden" name="act" value="procImporterAdminImport" />
<input type="hidden" name="module_srl" value="" /> <input type="hidden" name="module_srl" value="" />

View file

@ -75,10 +75,10 @@ function doStep2(fo_obj) {
fo_obj.category_srl.value = category_srl; fo_obj.category_srl.value = category_srl;
} }
fo_obj.submit(); procFilter(fo_obj, import_xml);
//procFilter(fo_obj, import_xml);
xGetElementById('step2_status').style.display = 'block'; xGetElementById('step2_status').style.display = 'block';
return false; return false;
} }