게시글의 카테고리를 다중 depth를 지원하게 하고 게시판 모듈에서 이 다중 depth를 적용하도록 기본 스킨 수정. 게시글 분류 위젯 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3549 201d5d3c-b55e-5fd7-737f-ddc643e51545
58
widgets/category/skins/default/category.html
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<!--%import("css/category.css")-->
|
||||
<!--%import("js/category.js")-->
|
||||
|
||||
<div class="categoryWidget">
|
||||
|
||||
<div class="top <!--@if($mid == $widget_info->mid && !$category)-->selected<!--@end-->"><a href="{getUrl('','mid',$widget_info->mid)}">{$widget_info->module_info->browser_title}</a> <strong>[{$widget_info->total_document_count}]</strong></div>
|
||||
|
||||
{@ $prev_depth = 0}
|
||||
{@ $prev_last = false}
|
||||
{@ $prev_srl = 0}
|
||||
{@ $prev_expand = false}
|
||||
|
||||
<!--@foreach($widget_info->category_list as $key => $val)-->
|
||||
|
||||
<!--@if($val->last)-->
|
||||
<!--@if($val->child_count)-->
|
||||
<!--@if(!$val->expand)-->{@ $class = "plusBottom" }<!--@else-->{@ $class = "minusBottom" }<!--@end-->
|
||||
<!--@else-->
|
||||
{@ $class = "joinBottom" }
|
||||
<!--@end-->
|
||||
<!--@elseif($val->first)-->
|
||||
<!--@if($val->child_count)-->
|
||||
<!--@if(!$val->expand)-->{@ $class = "plus" }<!--@else-->{@ $class = "minus" }<!--@end-->
|
||||
<!--@else-->
|
||||
{@ $class = "join" }
|
||||
<!--@end-->
|
||||
<!--@else-->
|
||||
<!--@if($val->child_count)-->
|
||||
<!--@if(!$val->expand)-->{@ $class = "plus" }<!--@else-->{@ $class = "minus" }<!--@end-->
|
||||
<!--@else-->
|
||||
{@ $class = "join" }
|
||||
<!--@end-->
|
||||
<!--@end-->
|
||||
|
||||
<!--@if($prev_depth < $val->depth)-->
|
||||
{@ $prev_depth = $val->depth }
|
||||
<div class="<!--@if(!$prev_last)-->child<!--@else-->childBottom<!--@end-->" id="category_{$prev_srl}" <!--@if(!$prev_expand)-->style="display:none;"<!--@end-->>
|
||||
<!--@elseif($prev_depth > $val->depth)-->
|
||||
<!--@for($i=$val->depth;$i<$prev_depth;$i++)--></div><!--@end-->
|
||||
{@ $prev_depth = $val->depth }
|
||||
<!--@end-->
|
||||
|
||||
<div class="{$class}" id="category_parent_{$val->category_srl}">
|
||||
<div class="item <!--@if($val->selected)-->selected<!--@end-->">
|
||||
<a href="{getUrl('','mid',$widget_info->mid, 'category',$val->category_srl)}">{$val->text}</a>
|
||||
<!--@if($val->document_count)--><strong>[{$val->document_count}]</strong><!--@end-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{@ $prev_last = $val->last}
|
||||
{@ $prev_srl = $val->category_srl}
|
||||
{@ $prev_expand = $val->expand}
|
||||
|
||||
<!--@end-->
|
||||
|
||||
<!--@for($i=0;$i<$prev_depth;$i++)--></div><!--@end-->
|
||||
|
||||
</div>
|
||||
80
widgets/category/skins/default/css/category.css
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
@charset "utf-8";
|
||||
|
||||
.categoryWidget .top {
|
||||
background:url("../images/top.gif") no-repeat left -1px;
|
||||
padding-left:14px;
|
||||
height:18px;
|
||||
}
|
||||
|
||||
.categoryWidget a {
|
||||
text-decoration:none;
|
||||
color:#555555;
|
||||
padding:0 2px 0 2px;
|
||||
}
|
||||
|
||||
.categoryWidget a:hover {
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
.categoryWidget strong {
|
||||
font-weight:normal;
|
||||
color:#DF7901;
|
||||
font-size:7pt;
|
||||
font-family:tahoma;
|
||||
}
|
||||
|
||||
.categoryWidget .selected a {
|
||||
background-color:#0A246A;
|
||||
color:#FFFFFF;
|
||||
}
|
||||
|
||||
.categoryWidget .item {
|
||||
background:url("../images/page.gif") no-repeat left 2px;
|
||||
padding-left:13px;
|
||||
height:18px;
|
||||
}
|
||||
|
||||
|
||||
.categoryWidget .child {
|
||||
background:url("../images/line.gif") repeat-y left top;
|
||||
padding-left:16px;
|
||||
}
|
||||
|
||||
.categoryWidget .childBottom {
|
||||
background:none;
|
||||
padding-left:16px;
|
||||
}
|
||||
|
||||
.categoryWidget .plus {
|
||||
background:url("../images/plus.gif") no-repeat left top;
|
||||
padding-left:16px;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.categoryWidget .plusBottom {
|
||||
background:url("../images/plusbottom.gif") no-repeat left top;
|
||||
padding-left:16px;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.categoryWidget .minus {
|
||||
background:url("../images/minus.gif") no-repeat left top;
|
||||
padding-left:16px;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.categoryWidget .minusBottom {
|
||||
background:url("../images/minusbottom.gif") no-repeat left top;
|
||||
padding-left:16px;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.categoryWidget .joinBottom {
|
||||
background:url("../images/joinbottom.gif") no-repeat left top;
|
||||
padding-left:16px;
|
||||
}
|
||||
|
||||
.categoryWidget .join{
|
||||
background:url("../images/join.gif") no-repeat left top;
|
||||
padding-left:16px;
|
||||
}
|
||||
BIN
widgets/category/skins/default/images/join.gif
Normal file
|
After Width: | Height: | Size: 69 B |
BIN
widgets/category/skins/default/images/joinbottom.gif
Normal file
|
After Width: | Height: | Size: 66 B |
BIN
widgets/category/skins/default/images/line.gif
Normal file
|
After Width: | Height: | Size: 66 B |
BIN
widgets/category/skins/default/images/minus.gif
Normal file
|
After Width: | Height: | Size: 86 B |
BIN
widgets/category/skins/default/images/minusbottom.gif
Normal file
|
After Width: | Height: | Size: 85 B |
BIN
widgets/category/skins/default/images/page.gif
Normal file
|
After Width: | Height: | Size: 301 B |
BIN
widgets/category/skins/default/images/plus.gif
Normal file
|
After Width: | Height: | Size: 89 B |
BIN
widgets/category/skins/default/images/plusbottom.gif
Normal file
|
After Width: | Height: | Size: 88 B |
BIN
widgets/category/skins/default/images/plustop.gif
Normal file
|
After Width: | Height: | Size: 481 B |
BIN
widgets/category/skins/default/images/top.gif
Normal file
|
After Width: | Height: | Size: 88 B |
32
widgets/category/skins/default/js/category.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
function toggleCategory(evt) {
|
||||
var e = new xEvent(evt);
|
||||
var obj = e.target;
|
||||
var srl = null;
|
||||
if(obj.nodeName != 'DIV') return;
|
||||
|
||||
if(obj.id && /^category_parent_/.test(obj.id)) {
|
||||
srl = obj.id.replace(/^category_parent_/,'');
|
||||
} else if(obj.id && /^category_/.test(obj.id)) {
|
||||
srl = obj.id.replace(/^category_parent_/,'');
|
||||
} else if(obj.className && /item/.test(obj.className)) {
|
||||
var pObj = obj.parentNode;
|
||||
srl = pObj.id.replace(/^category_parent_/,'');
|
||||
}
|
||||
|
||||
if(!srl) return;
|
||||
var obj = xGetElementById("category_"+srl);
|
||||
if(!obj) return;
|
||||
|
||||
var selObj = xGetElementById("category_parent_"+srl);
|
||||
if(!selObj) return;
|
||||
|
||||
if(!obj.style.display || obj.style.display == 'block') {
|
||||
obj.style.display = 'none';
|
||||
selObj.className = selObj.className.replace('minus','plus');
|
||||
} else {
|
||||
obj.style.display = 'block';
|
||||
selObj.className = selObj.className.replace('plus','minus');
|
||||
}
|
||||
}
|
||||
|
||||
xAddEventListener(document, 'click', toggleCategory);
|
||||
13
widgets/category/skins/default/skin.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<skin>
|
||||
<title xml:lang="ko">분류 출력 기본 스킨</title>
|
||||
<maker email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
|
||||
<name xml:lang="ko">제로</name>
|
||||
<description xml:lang="ko">게시글 분류를 출력하는 기본 스킨입니다</description>
|
||||
</maker>
|
||||
<colorset>
|
||||
<color name="normal">
|
||||
<title xml:lang="ko">기본 컬러</title>
|
||||
</color>
|
||||
</colorset>
|
||||
</skin>
|
||||