From 44cba86bdeda65f1e432a623d799309e965680cc Mon Sep 17 00:00:00 2001 From: zero Date: Fri, 18 May 2007 05:24:33 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@1466 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/page/PageHandler.class.php | 2 +- modules/importer/importer.controller.php | 13 +++++++++++++ modules/importer/lang/ko.lang.php | 2 +- modules/importer/tpl/index.html | 1 - modules/importer/tpl/js/importer_admin.js | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/classes/page/PageHandler.class.php b/classes/page/PageHandler.class.php index f4c4ec980..5dd920731 100644 --- a/classes/page/PageHandler.class.php +++ b/classes/page/PageHandler.class.php @@ -45,7 +45,7 @@ **/ function getNextPage() { $page = $this->first_page+$this->point++; - if($this->point > $this->page_count) $page = 0; + if($this->point > $this->page_count || $page > $this->last_page) $page = 0; return $page; } } diff --git a/modules/importer/importer.controller.php b/modules/importer/importer.controller.php index 93f9d0a68..4fba92d5b 100644 --- a/modules/importer/importer.controller.php +++ b/modules/importer/importer.controller.php @@ -14,6 +14,7 @@ var $oCommentController = null; var $oTrackbackController = null; + var $total_count = ''; var $position = 0; var $imported_count = 0; var $limit_count = 50; @@ -124,6 +125,7 @@ } else { $this->add('position', $this->imported_count); $this->add('is_finished', 'N'); + $this->setMessage( sprintf(Context::getLang('msg_importing'), $this->total_count, $this->imported_count) ); } } @@ -145,6 +147,7 @@ $str = fgets($fp,1024); $buff .= $str; + $buff = preg_replace_callback("!]*)>!is", array($this, '_parseRootInfo'), trim($buff)); $buff = preg_replace_callback("!(.*?)<\/member>!is", array($this, '_importMember'), trim($buff)); if($this->position+$this->limit_count <= $this->imported_count) { @@ -221,6 +224,7 @@ while(!feof($fp)) { $str = fread($fp,1024); $buff .= $str; + $buff = preg_replace_callback("!]*)>!is", array($this, '_parseRootInfo'), trim($buff)); $buff = preg_replace_callback("!(.*?)<\/document>!is", array($this, '_importDocument'), trim($buff)); if($this->position+$this->limit_count <= $this->imported_count) { @@ -355,5 +359,14 @@ $this->setMessage('msg_sync_completed'); } + + /** + * @brief 정보를 읽어서 정보를 구함 + **/ + function _parseRootInfo($matches) { + $root = $matches[0].''; + $xml_doc = $this->oXml->parse($root); + $this->total_count = $xml_doc->root->attrs->count; + } } ?> diff --git a/modules/importer/lang/ko.lang.php b/modules/importer/lang/ko.lang.php index 6deb8db40..4d12cfe69 100644 --- a/modules/importer/lang/ko.lang.php +++ b/modules/importer/lang/ko.lang.php @@ -37,7 +37,7 @@ $lang->msg_sync_member = '동기화 버튼을 클릭하시면 회원정보와 게시물정보의 동기화를 시작합니다.'; $lang->msg_no_xml_file = 'XML파일을 찾을 수 없습니다. 경로를 다시 확인해주세요'; $lang->msg_invalid_xml_file = '잘못된 형식의 XML파일입니다'; - $lang->msg_importing = '데이터를 입력중입니다. 혹시 아래 숫자가 변하지 않는다면 계속진행 버튼을 클릭해주세요.'; + $lang->msg_importing = '%d개의 데이터중 %d개를 입력중입니다. (계속 멈추어 있으면 "계속진행" 버튼을 클릭해주세요)'; $lang->msg_import_finished = '%d개의 데이터 입력이 완료되었습니다. 상황에 따라 입력되지 못한 데이터가 있을 수 있습니다.'; $lang->msg_sync_completed = '회원과 게시물, 댓글의 동기화가 완료되었습니다.'; diff --git a/modules/importer/tpl/index.html b/modules/importer/tpl/index.html index 216962e3f..7b3746eb1 100644 --- a/modules/importer/tpl/index.html +++ b/modules/importer/tpl/index.html @@ -91,7 +91,6 @@ diff --git a/modules/importer/tpl/js/importer_admin.js b/modules/importer/tpl/js/importer_admin.js index a8d304d43..4a67e3c36 100644 --- a/modules/importer/tpl/js/importer_admin.js +++ b/modules/importer/tpl/js/importer_admin.js @@ -94,7 +94,7 @@ function completeImport(ret_obj) { } else { var fo_obj = xGetElementById('fo_step2'); fo_obj.position.value = position; - xInnerHtml('step2_position', position); + xInnerHtml('step2_position', message); procFilter(fo_obj, import_xml); } }