restore 기능 추가, history list 정렬 및 페이징 추가

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6224 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
haneul 2009-04-28 07:44:34 +00:00
parent ba309f290b
commit 108d5a2175
9 changed files with 47 additions and 6 deletions

View file

@ -913,11 +913,13 @@
else return $output->data->document_srl;
}
function getHistories($document_srl)
function getHistories($document_srl, $list_count, $page)
{
$args->list_count = $list_count;
$args->page = $page;
$args->document_srl = $document_srl;
$output = executeQueryArray('document.getHistories', $args);
return $output->data;
return $output;
}
function getHistory($history_srl)

View file

@ -8,4 +8,10 @@
<conditions>
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
</conditions>
<navigation>
<index var="sort_index" default="history_srl" order="desc" />
<list_count var="list_count" default="20" />
<page_count var="page_count" default="10" />
<page var="page" default="1" />
</navigation>
</query>

View file

@ -14,4 +14,5 @@
$lang->about_use_comment = 'You may configure to enable comments.';
$lang->contributors = 'Contributors';
$lang->notice_old_revision = 'This is an old revision';
$lang->restore = 'Restore';
?>

View file

@ -14,4 +14,5 @@
$lang->about_use_comment = 'コメント機能をオン・オフを設定します。';
$lang->contributors = '投稿者';
$lang->notice_old_revision = '過去のバージョンです。';
$lang->restore = 'Restore';
?>

View file

@ -14,4 +14,5 @@
$lang->about_use_comment = '댓글을 활성화하거나 비활성화할 수 있습니다';
$lang->contributors = '공헌자';
$lang->notice_old_revision = '옛날 버전을 보고 계십니다';
$lang->restore = '복원';
?>

View file

@ -14,4 +14,5 @@
$lang->about_use_comment = 'You may configure to enable comments.';
$lang->contributors = 'Contributors';
$lang->notice_old_revision = 'This is an old revision';
$lang->restore = 'Restore';
?>

View file

@ -14,4 +14,5 @@
$lang->about_use_comment = '可設定是否使用評論功能。';
$lang->contributors = '作者';
$lang->notice_old_revision = '此為舊版本';
$lang->restore = 'Restore';
?>

View file

@ -1,15 +1,34 @@
<!--#include("header.html")-->
<div class="readBody">
<ul class="histories">
<!--@if(!$page || $page == 1)-->
<li class="_item"><div class="info"><span class="date">{$oDocument->getUpdate()}</span> by {$oDocument->getNickName()} (current)</div><a href="{getUrl('act','',page,'','history_srl','')}" class="view">[{$lang->cmd_move}]</a></li>
<!--@endif-->
<!--@foreach($histories as $val)-->
<li class="_item"><div class="info"><span class="date">{zdate($val->regdate, 'Y.m.d H:i:s')}</span> by <a href="#" onclick="return false;" class="member_{$val->member_srl}">{$val->nick_name}</a> </div><!--@if($val->content)--><a href="#" onclick="viewHistory('{$val->history_srl}'); return false;" class="view">[{$lang->cmd_view}]</a><!--@end-->
<li class="_item"><div class="info"><span class="date">{zdate($val->regdate, 'Y.m.d H:i:s')}</span> by <a href="#" onclick="return false;" class="member_{$val->member_srl}">{$val->nick_name}</a> </div>
<!--@if($val->content)-->
<a href="{getUrl('act','dispWikiEditPage','history_srl',$val->history_srl)}" class="view">[{$lang->restore}]</a>
<a href="#" onclick="viewHistory('{$val->history_srl}'); return false;" class="view">[{$lang->cmd_view}]</a>
<!--@end-->
<div id="historyContent{$val->history_srl}" class="historyContent">
{$val->content}
</div>
</li>
<!--@end-->
</ul>
<!--@if($page_navigation)-->
<div class="pagination a1">
<a href="{getUrl('page','')}" class="prevEnd">{$lang->first_page}</a>
<!--@while($page_no = $page_navigation->getNextPage())-->
<!--@if($page == $page_no)-->
<strong>{$page_no}</strong>
<!--@else-->
<a href="{getUrl('page',$page_no)}">{$page_no}</a>
<!--@end-->
<!--@end-->
<a href="{getUrl('page',$page_navigation->last_page)}" class="nextEnd">{$lang->last_page}</a>
</div>
<!--@endif-->
</div>
<!--#include("footer.html")-->

View file

@ -49,9 +49,18 @@
if(!$oDocument->isExists()) return $this->stop('msg_invalid_request');
$entry = $oDocument->getTitleText();
Context::set('entry',$entry);
$histories = $oDocumentModel->getHistories($document_srl, 10, $page);
if(!$histories) $histories = array();
Context::set('histories',$histories);
$output = $oDocumentModel->getHistories($document_srl, 10, $page);
debugPrint($output);
if(!$output->toBool() || !$output->data)
{
Context::set('histories', array());
}
else {
Context::set('histories',$output->data);
Context::set('page', $output->page);
Context::set('page_navigation', $output->page_navigation);
}
Context::set('oDocument', $oDocument);
$this->setTemplateFile('histories');
}