Wiki에 계층보기 기능 추가 (글쓰기 권한이 있는 사용자가 문서들을 tree구조로 바꿀 수 있도록 함)

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6637 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2009-06-22 09:16:53 +00:00
parent c40d10f686
commit 461144c955
22 changed files with 431 additions and 4 deletions

View file

@ -151,6 +151,7 @@
/* Search Form */
.wikiSearchForm{ position:relative; float:right; margin:0; padding:1px 0; line-height:normal;}
.wikiSearchForm.footer { clear:both; float:none; margin:20px 0; text-align:center; }
.wikiSearchForm *{ margin:0; padding:0;}
.wikiSearchForm fieldset{ border:0; clear:both; text-align:center;}
.wikiSearchForm fieldset:after{ content:""; display:block; float:none; clear:both;}
@ -422,3 +423,6 @@ a.buttonOfficial{ _margin-top:-1px;}
a.buttonOfficial a{ _vertical-align:top;}
.hide { display:none; }
/* tree */
#tree ul.simpleTree li.noIcon { background:none; }

View file

@ -23,15 +23,16 @@
<div class="wikiInformation">
<div class="infoView">
<span class="buttonOfficial"><a href="{getUrl('act','dispWikiContent','entry','','document_srl','')}">Front Page</a></span>
<span class="buttonOfficial"><a href="{getUrl('act','dispWikiTitleIndex','entry','','document_srl','')}">Title Index</a></span>
<!--@if($grant->manager)-->
<span class="buttonOfficial"><a href="{getUrl('act','dispWikiAdminInsertWiki')}">{$lang->cmd_setup}</a></span>
<!--@end-->
<span class="buttonOfficial"><a href="{getUrl('act','dispWikiTitleIndex','entry','','document_srl','')}">{$lang->cmd_view_document_list}</a></span>
<span class="buttonOfficial"><a href="{getUrl('act','dispWikiTreeIndex','entry','','document_srl','')}">{$lang->cmd_view_document_tree}</a></span>
</div>
<form action="./" method="get" onsubmit="moveHistory(this); return false;" class="wikiSearchForm">
<input type="text" class="inputText" name="entry" />
<span class="buttonOfficial"><input type="submit" value="{$lang->cmd_move}" /></span>
<!--@if($grant->manager)-->
<span class="buttonOfficial"><input type="button" onclick="location.href='{getUrl('act','dispWikiAdminInsertWiki')}';return false;" value="{$lang->cmd_setup}" /></span>
<!--@end-->
</form>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

View file

@ -11,3 +11,80 @@ function viewHistory(history_srl) {
if(zone.css('display')=='block') zone.css('display','none');
else zone.css('display','block');
}
/**
* @file modules/document/tpl/js/document_category.js
* @author sol (sol@ngleader.com)
* @brief document 모듈의 category tree javascript
**/
var simpleTreeCollection;
function Tree(){
var url = request_uri.setQuery('mid',current_mid).setQuery('act','getWikiTreeList');
if(typeof(xeVid)!='undefined') url.setQuery('vid',xeVid);
// clear tree;
jQuery('#tree > ul > li > ul').remove();
//ajax get data and transeform ul il
jQuery.get(url,function(data){
jQuery(data).find("node").each(function(i){
var title = jQuery(this).attr("title");
var node_srl = jQuery(this).attr("node_srl");
var parent_srl = jQuery(this).attr("parent_srl");
var url = request_uri;
var args = new Array("mid="+current_mid, "entry="+title);
if(typeof(xeVid)!='undefined') args[args.length] = "vid="+xeVid;
url = request_uri+'?'+args.join('&');
// node
var node = jQuery('<li id="tree_'+node_srl+'" rel="'+url+'"><span>'+title+'</span></li>');
// insert parent child
if(parent_srl>0){
if(jQuery('#tree_'+parent_srl+'>ul').length==0) jQuery('#tree_'+parent_srl).append(jQuery('<ul>'));
jQuery('#tree_'+parent_srl+'> ul').append(node);
}else{
if(jQuery('#tree ul.simpleTree > li > ul').length==0) jQuery("<ul>").appendTo('#tree ul.simpleTree > li');
jQuery('#tree ul.simpleTree > li > ul').append(node);
}
});
// draw tree
simpleTreeCollection = jQuery('.simpleTree').simpleTree({
autoclose: false,
afterClick:function(node){
location.href = node.attr('rel');
return false;
},
afterMove:function(destination, source, pos){
if(!isManageGranted) return;
if(destination.size() == 0){
Tree();
return;
}
var parent_srl = destination.attr('id').replace(/.*_/g,'');
var source_srl = source.attr('id').replace(/.*_/g,'');
var target = source.prevAll("li:not([class^=line])");
var target_srl = 0;
if(target.length >0){
target_srl = source.prevAll("li:not([class^=line])").get(0).id.replace(/.*_/g,'');
parent_srl = 0;
}
jQuery.exec_json("wiki.procWikiMoveTree",{ "mid":current_mid,"parent_srl":parent_srl,"target_srl":target_srl,"source_srl":source_srl}, function(data){ Tree(); });
},
beforeMovedToLine : function() { return true; },
beforeMovedToFolder : function() { return true; },
afterAjax:function() { },
docToFolderConvert:true,
drag:isManageGranted
});
jQuery("[class*=close]", simpleTreeCollection[0]).each(function(){
simpleTreeCollection[0].nodeToggle(this);
});
},"xml");
}

View file

@ -21,6 +21,28 @@
</tbody>
</table>
<form action="{getUrl()}" method="get" class="wikiSearchForm footer">
<fieldset>
<legend>Wiki Search</legend>
<input type="hidden" name="vid" value="{$vid}" />
<input type="hidden" name="mid" value="{$mid}" />
<input type="hidden" name="act" value="{$act}" />
<input type="hidden" name="category" value="{$category}" />
<input type="hidden" name="search_target" value="title_content" />
<select name="search_target">
<!--@foreach($search_option as $key => $val)-->
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
<!--@end-->
</select>
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" class="inputText" accesskey="S" title="{$lang->cmd_search}" />
<!--@if($last_division)-->
<a href="{getUrl('page',1,'document_srl','','division',$last_division,'last_division','')}" class="button"><span>{$lang->cmd_search_next}</span></a>
<!--@end-->
<span class="buttonOfficial"><button type="submit">{$lang->cmd_search}</button></span>
</fieldset>
</form>
<div class="pagination a1">
<a href="{getUrl('page','','document_srl','','division',$division,'last_division',$last_division,'entry','')}" class="prevEnd">{$lang->first_page}</a>
<!--@while($page_no = $page_navigation->getNextPage())-->

View file

@ -0,0 +1,17 @@
<!--#include("header.html")-->
<!--// tree javascript plugin load -->
<!--%load_js_plugin("ui.tree")-->
<div id="tree">
<ul class="simpleTree">
<li class="root noIcon"></li>
</ul>
</div>
<script type="text/javascript">
var isManageGranted = {$isManageGranted};
jQuery(window).load( function() { Tree(); } );
</script>
<!--#include("footer.html")-->