first
This commit is contained in:
114
widgets/rc-default/site/menu/drawer-default/admin.php
Normal file
114
widgets/rc-default/site/menu/drawer-default/admin.php
Normal file
@@ -0,0 +1,114 @@
|
||||
<div id="mjointbox">
|
||||
<h5>
|
||||
<i class="fa fa-info-circle"></i>
|
||||
<?php echo getFolderName($g['path_widget'].$swidget)?>
|
||||
</h5>
|
||||
|
||||
<form name="procform" class="form-horizontal rb-form" role="form">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">시작메뉴</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="smenu" class="form-control custom-select">
|
||||
<option value="0"<?php if(!$wdgvar['smenu']):?> selected<?php endif?>>ㆍ처음(root)</option>
|
||||
<option value="-1">ㆍ1단계 선택메뉴</option>
|
||||
<option value="-2">ㆍ2단계 선택메뉴</option>
|
||||
<option value="-3">ㆍ3단계 선택메뉴</option>
|
||||
<option value="0">----------------------------------------------------------------</option>
|
||||
<?php $_isUid='u'?>
|
||||
<?php $cat=$wdgvar['smenu']?>
|
||||
<?php include $g['path_core'].'function/menu1.func.php'?>
|
||||
<?php getMenuShowSelect($s,$table['s_menu'],0,0,0,0,0,'')?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">추출단계</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="limit" class="form-control custom-select">
|
||||
<?php for($i = 1; $i < 3; $i++):?>
|
||||
<option value="<?php echo $i?>"<?php if($wdgvar['limit']==$i||(!$wdgvar['limit']&&$i==2)):?> selected="selected"<?php endif?>>ㆍ<?php echo sprintf('시작메뉴 포함 %s단계',$i)?></option>
|
||||
<?php endfor?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">링크방식</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="link" class="form-control custom-select">
|
||||
<option value="link">ㆍ일반</option>
|
||||
<option value="bookmark">ㆍ북마크</option>
|
||||
</select>
|
||||
<small class="form-text text-muted mt-2">
|
||||
북마크 방식을 지정하면 링크가 다음과 같이 생성됩니다.<br>
|
||||
<code><a data-scroll href="#MENUCODE"></code>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">아코디언<br><span class="badge badge-light">accordion</span></label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">#</span>
|
||||
</div>
|
||||
<input type="text" name="collid" value="<?php echo $wdgvar['collid']?$wdgvar['collid']:'drawer-menu'?>" class="form-control">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="accordion" name="accordion" value="1" checked>
|
||||
<label class="custom-control-label" for="accordion">사용</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<small class="form-text text-muted mt-2">
|
||||
ID를 지정해 주세요. 아코디언 기능 적용시에 필요합니다.
|
||||
</small>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">컬랩스<br><span class="badge badge-light">collapse</span></label>
|
||||
<div class="col-sm-8 pt-1">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="collapse" name="collapse" value="1" checked>
|
||||
<label class="custom-control-label" for="collapse">사용</label>
|
||||
</div>
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="dispfmenu" name="dispfmenu" value="1">
|
||||
<label class="custom-control-label" for="dispfmenu">부모메뉴를 포함시킴</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
//위젯코드 리턴
|
||||
function widgetCode(n)
|
||||
{
|
||||
var f = document.procform;
|
||||
var widgetName = "<?php echo $swidget?>"; // 위젯명칭
|
||||
var widgetInfo = "";
|
||||
|
||||
if(f.smenu.value) widgetInfo+= "'smenu'=>'"+f.smenu.value+"',";
|
||||
if(f.limit.value) widgetInfo+= "'limit'=>'"+f.limit.value+"',";
|
||||
if(f.link.value) widgetInfo+= "'link'=>'"+f.link.value+"',";
|
||||
if(f.collid.value) widgetInfo+= "'collid'=>'"+f.collid.value+"',";
|
||||
if(f.accordion.checked) widgetInfo+= "'accordion'=>'1',";
|
||||
if(f.dispfmenu.checked) widgetInfo+= "'dispfmenu'=>'1',";
|
||||
if(f.collapse.checked) widgetInfo+= "'collapse'=>'1',";
|
||||
|
||||
if (n) return "<img alt=\"getWidget('"+widgetName+"',array("+widgetInfo+"))\" class=\"rb-widget-edit-img\" src=\"./_core/images/blank.gif\">"; // 에디터삽입 위젯 이미지 코드
|
||||
else return "<"+"?php "+"getWidget('"+widgetName+"',array("+widgetInfo+"))?>"; // PHP 위젯함수 코드
|
||||
}
|
||||
//위젯 삽입하기
|
||||
function saveCheck(n)
|
||||
{
|
||||
<?php $isCodeOnly='Y'?>// 코드추출만 지원할 경우
|
||||
}
|
||||
</script>
|
||||
104
widgets/rc-default/site/menu/drawer-default/main.php
Normal file
104
widgets/rc-default/site/menu/drawer-default/main.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
if (!function_exists('getMenuWidgetCollapse'))
|
||||
{
|
||||
function getMenuWidgetCollapse($site,$table,$is_child,$parent,$depth,$id,$w,$_C)
|
||||
{
|
||||
global $_CA;
|
||||
$CD = getDbSelect($table,($site?'site='.$site.' and ':'').'hidden=0 and mobile=1 and parent='.$parent.' and depth='.($depth+1).($w['mobile']?' and mobile=1':'').' order by gid asc','*');
|
||||
if(db_num_rows($CD))
|
||||
{
|
||||
?>
|
||||
<li class="table-view-cell table-view-divider small">메뉴</li>
|
||||
<?php
|
||||
while($C = db_fetch_array($CD)):
|
||||
$CD1 = getDbSelect($table,($site?'site='.$site.' and ':'').'hidden=0 and mobile=1 and parent='.$C['uid'].' and depth='.($C['depth']+1).' order by gid asc','*');
|
||||
$_newTree = ($id?$id.'/':'').$C['id'];
|
||||
$_newTreeB = str_replace('/','-',$_newTree);
|
||||
$_href = $w['link']=='bookmark'?'#'.$_newTreeB:RW('c='.$_newTree);
|
||||
$_name = $C['name'];
|
||||
$_target = $C['target']=='_blank'?' target="_blank"':'';
|
||||
$_addattr = $C['addattr']?' '.$C['addattr']:'';
|
||||
$_isActive = in_array($C['id'],$_CA);
|
||||
?>
|
||||
<?php if($C['is_child'] && $w['limit'] > 1 && $w['collapse']):?>
|
||||
<li class="table-view-cell">
|
||||
<a data-toggle="collapse" data-parent="#<?php echo $w['accordion']?$w['collid']:''?>" href="#<?php echo $w['collid']?>-<?php echo $C['uid']?>" class="navigate-updown collapsed<?php if($_isActive):?> active<?php endif?>">
|
||||
<?php echo $C['name']?>
|
||||
</a>
|
||||
|
||||
<ul class="table-view collapse<?php if($_isActive):?> in<?php endif?>" id="<?php echo $w['collid']?>-<?php echo $C['uid']?>">
|
||||
<?php if($w['dispfmenu']):?>
|
||||
<li class="table-view-cell"><a data-href="<?php echo $_href?>"<?php echo $_addattr.$_target?> data-toggle="drawer-close"><?php echo $_name?></a></li>
|
||||
<?php endif?>
|
||||
<?php while($C1 = db_fetch_array($CD1)):?>
|
||||
<li class="table-view-cell<?php if(in_array($C1['id'],$_CA)):?> table-view-info<?php endif?>">
|
||||
<a class="" data-href="<?php echo $w['link']=='bookmark'?'#'.$_newTreeB.'-'.$C1['id']:RW('c='.$_newTree.'/'.$C1['id'])?>" data-toggle="drawer-close" <?php if($C1['addattr']):?> <?php echo $C1['addattr']?><?php endif?><?php if($C1['target']):?> target="<?php echo $C1['target']?>"<?php endif?>>
|
||||
<?php echo $C1['name']?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endwhile?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php else:?>
|
||||
<li class="table-view-cell<?php if($_isActive):?> table-view-info<?php endif?>">
|
||||
<a data-href="<?php echo $_href?>"<?php echo $_addattr.$_target?> data-toggle="drawer-close">
|
||||
<?php echo $C['name']?>
|
||||
<?php if($C['is_child']):?><span class="branch"></span><?php endif?>
|
||||
</a>
|
||||
<?php if($C['is_child'] && $w['limit'] > 1 && $_isActive):?>
|
||||
<ul class="table-view">
|
||||
<?php while($C1 = db_fetch_array($CD1)):?>
|
||||
<li class="table-view-cell<?php if(in_array($C1['id'],$_CA)):?> table-view-info<?php endif?>">
|
||||
<a data-href="<?php echo $w['link']=='bookmark'?'#'.$_newTreeB.'-'.$C1['id']:RW('c='.$_newTree.'/'.$C1['id'])?>" data-toggle="drawer-close" <?php if($C1['addattr']):?> <?php echo $C1['addattr']?><?php endif?><?php if($C1['target']):?> target="<?php echo $C1['target']?>"<?php endif?>>
|
||||
<?php echo $C1['name']?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endwhile?>
|
||||
</ul>
|
||||
<?php endif?>
|
||||
</li>
|
||||
<?php endif?>
|
||||
<?php endwhile?>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
$wdgvar['limit'] = $wdgvar['limit'] < 6 ? $wdgvar['limit'] : 5;
|
||||
if ($wdgvar['smenu'] < 0)
|
||||
{
|
||||
if (strstr($c,'/'))
|
||||
{
|
||||
$wdgvar['mnarr'] = explode('/',$c);
|
||||
$wdgvar['count'] = (- $wdgvar['smenu']) - 1;
|
||||
for ($j = 0; $j <= $wdgvar['count']; $j++) $wdgvar['sid'] .= $wdgvar['mnarr'][$j].'/';
|
||||
$wdgvar['sid'] = $wdgvar['sid'] ? substr($wdgvar['sid'],0,strlen($wdgvar['sid'])-1): '';
|
||||
$wdgvar['path'] = getDbData($table['s_menu'],"id='".$wdgvar['mnarr'][$wdgvar['count']]."'",'uid,depth');
|
||||
$wdgvar['smenu'] = $wdgvar['path']['uid'];
|
||||
$wdgvar['depth'] = $wdgvar['path']['depth'];
|
||||
}
|
||||
else {
|
||||
$wdgvar['sid'] = $c;
|
||||
$wdgvar['smenu'] = $_HM['uid'];
|
||||
$wdgvar['depth'] = $_HM['depth'];
|
||||
}
|
||||
}
|
||||
else if ($wdgvar['smenu'])
|
||||
{
|
||||
$wdgvar['mnarr'] = explode('/',$wdgvar['smenu']);
|
||||
$wdgvar['count'] = count($wdgvar['mnarr']);
|
||||
for ($j = 0; $j < $wdgvar['count']; $j++)
|
||||
{
|
||||
$wdgvar['path'] = getDbData($table['s_menu'],'uid='.(int)$wdgvar['mnarr'][$j],'uid,id,depth');
|
||||
$wdgvar['sid'] .= $wdgvar['path']['id'].'/';
|
||||
$wdgvar['smenu'] = $wdgvar['path']['uid'];
|
||||
$wdgvar['depth'] = $wdgvar['path']['depth'];
|
||||
}
|
||||
$wdgvar['sid'] = $wdgvar['sid'] ? substr($wdgvar['sid'],0,strlen($wdgvar['sid'])-1): '';
|
||||
}
|
||||
else {
|
||||
$wdgvar['depth'] = 0;
|
||||
}
|
||||
$wdgvar['olimit']= $wdgvar['limit'];
|
||||
$wdgvar['limit'] = $wdgvar['limit'] + $wdgvar['depth'];
|
||||
getMenuWidgetCollapse($s,$table['s_menu'],0,$wdgvar['smenu'],$wdgvar['depth'],$wdgvar['sid'],$wdgvar,array());
|
||||
?>
|
||||
1
widgets/rc-default/site/menu/drawer-default/name.txt
Normal file
1
widgets/rc-default/site/menu/drawer-default/name.txt
Normal file
@@ -0,0 +1 @@
|
||||
모바일-드로어 메뉴
|
||||
BIN
widgets/rc-default/site/menu/drawer-default/thumb.png
Normal file
BIN
widgets/rc-default/site/menu/drawer-default/thumb.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 300 KiB |
Reference in New Issue
Block a user