313 lines
19 KiB
PHP
313 lines
19 KiB
PHP
<?php
|
|
$sub_menu = '000200';
|
|
include_once('./_common.php');
|
|
|
|
auth_check_menu($auth, $sub_menu, "w");
|
|
|
|
$md_id = isset($_GET['md_id']) ? preg_replace('/[^0-9]/', '', $_GET['md_id']) : '';
|
|
$table_name = (isset($_GET['tables']) && $_GET['tables']) ? $_GET['tables'] : 'rb_module';
|
|
$w = isset($_GET['w']) ? $_GET['w'] : '';
|
|
$is_shop = (defined('G5_USE_SHOP') && G5_USE_SHOP) ? 1 : 0;
|
|
|
|
$html_title = '모듈';
|
|
$g5['title'] = $html_title . ' 관리';
|
|
|
|
if ($w == 'u') {
|
|
$html_title .= ' 수정';
|
|
$sql = "SELECT * FROM {$table_name} WHERE md_id = '{$md_id}'";
|
|
$module = sql_fetch($sql);
|
|
if (!$module['md_id']) {
|
|
alert('존재하지 않는 모듈입니다.');
|
|
}
|
|
} else {
|
|
$html_title .= ' 입력';
|
|
// 기본값 설정
|
|
$module = array(
|
|
'md_type' => 'latest', 'md_skin' => 'basic', 'md_col' => 4, 'md_row' => 1,
|
|
'md_col_mo' => 2, 'md_row_mo' => 2, 'md_cnt' => 4, 'md_title_color' => '#25282b',
|
|
'md_title_size' => 20, 'md_title_font' => 'font-B', 'md_width' => '100%', 'md_height' => 'auto',
|
|
'md_gap' => 40, 'md_gap_mo' => 20, 'md_auto_time' => 3000, 'md_subject_is' => 1,
|
|
'md_thumb_is' => 1, 'md_nick_is' => 1, 'md_date_is' => 1, 'md_content_is' => 1,
|
|
'md_icon_is' => 1, 'md_comment_is' => 1, 'md_ca_is' => 1, 'md_swiper_is' => 0,
|
|
'md_auto_is' => 0, 'md_order' => 'wr_num', 'md_order_id' => 0, 'md_title_hide' => 0,
|
|
'md_notice' => 0, 'md_show' => '1', 'md_size' => '%', 'md_border' => '', 'md_radius' => '',
|
|
'md_padding' => '', 'md_padding_mo' => '', 'md_margin_top_pc' => '', 'md_margin_btm_pc' => '',
|
|
'md_margin_top_mo' => '', 'md_margin_btm_mo' => '', 'md_banner_bg' => '', 'md_layout' => (isset($_GET['md_layout']) ? $_GET['md_layout'] : ''),
|
|
'md_theme' => (isset($_GET['theme_name']) ? $_GET['theme_name'] : ''), 'md_layout_name' => '', 'md_title' => '', 'md_bo_table' => '',
|
|
'md_sca' => '', 'md_widget' => '', 'md_poll' => '', 'md_poll_id' => '', 'md_custom_skin' => '',
|
|
'md_banner' => '', 'md_banner_id' => '', 'md_banner_skin' => '', 'md_module' => '',
|
|
'md_tab_list' => '', 'md_tab_skin' => '', 'md_order_latest' => '', 'md_custom_survey_key' => '',
|
|
);
|
|
}
|
|
|
|
include_once(G5_ADMIN_PATH . '/admin.head.php');
|
|
?>
|
|
|
|
<form name="fmodule" id="fmodule" action="./moduleformupdate.php" method="post" enctype="multipart/form-data">
|
|
<input type="hidden" name="w" value="<?php echo $w; ?>">
|
|
<input type="hidden" name="md_id" value="<?php echo $md_id; ?>">
|
|
<input type="hidden" name="tables" value="<?php echo $table_name; ?>">
|
|
<input type="hidden" name="qstr" value="<?php echo $qstr; ?>">
|
|
<input type="hidden" name="md_layout" value="<?php echo get_text($module['md_layout']); ?>">
|
|
<input type="hidden" name="md_theme" value="<?php echo get_text($module['md_theme']); ?>">
|
|
<input type="hidden" name="md_layout_name" value="<?php echo get_text($module['md_layout_name']); ?>">
|
|
|
|
<div class="tbl_frm01 tbl_wrap">
|
|
<table>
|
|
<caption><?php echo $g5['title']; ?></caption>
|
|
<colgroup>
|
|
<col class="grid_4">
|
|
<col>
|
|
</colgroup>
|
|
<tbody>
|
|
|
|
<!-- 1. 기본 설정 -->
|
|
<tr>
|
|
<th scope="row"><label for="md_title">모듈 타이틀</label></th>
|
|
<td>
|
|
<input type="text" name="md_title" value="<?php echo get_text($module['md_title']); ?>" id="md_title" class="frm_input" size="80">
|
|
<input type="checkbox" name="md_title_hide" value="1" id="md_title_hide" <?php echo ($module['md_title_hide'] == 1) ? 'checked' : ''; ?>>
|
|
<label for="md_title_hide">타이틀 숨김</label>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="md_type">모듈 타입</label></th>
|
|
<td>
|
|
<select name="md_type" id="md_type">
|
|
<option value="">출력 타입을 선택하세요.</option>
|
|
<option value="latest" <?php echo get_selected($module['md_type'], 'latest'); ?>>최신글</option>
|
|
<option value="tab" <?php echo get_selected($module['md_type'], 'tab'); ?>>최신글 탭</option>
|
|
<option value="widget" <?php echo get_selected($module['md_type'], 'widget'); ?>>위젯</option>
|
|
<option value="banner" <?php echo get_selected($module['md_type'], 'banner'); ?>>배너</option>
|
|
<option value="poll" <?php echo get_selected($module['md_type'], 'poll'); ?>>투표</option>
|
|
<?php if($is_shop) { ?>
|
|
<option value="item" <?php echo get_selected($module['md_type'], 'item'); ?>>상품</option>
|
|
<?php } ?>
|
|
<option value="custom" <?php echo get_selected($module['md_type'], 'custom'); ?>>커스텀 모듈</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="md_show">출력 여부</label></th>
|
|
<td>
|
|
<select name="md_show" id="md_show">
|
|
<option value="1" <?php echo get_selected($module['md_show'], '1'); ?>>보임</option>
|
|
<option value="0" <?php echo get_selected($module['md_show'], '0'); ?>>숨김</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="md_order_id">출력 순서</label></th>
|
|
<td>
|
|
<input type="text" name="md_order_id" value="<?php echo $module['md_order_id']; ?>" id="md_order_id" class="frm_input" size="5">
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- 2. 타입별 상세 설정 -->
|
|
<tbody class="module_options">
|
|
<!-- 최신글 옵션 -->
|
|
<tr class="latest_option">
|
|
<th scope="row"><label for="md_bo_table">게시판 선택</label></th>
|
|
<td>
|
|
<select name="md_bo_table" id="md_bo_table">
|
|
<option value="">선택하세요</option>
|
|
<?php echo rb_board_list($module['md_bo_table']); ?>
|
|
</select>
|
|
<label for="md_sca" class="ml-3">카테고리</label>
|
|
<input type="text" name="md_sca" value="<?php echo get_text($module['md_sca']); ?>" id="md_sca" class="frm_input" size="20">
|
|
</td>
|
|
</tr>
|
|
<tr class="latest_option">
|
|
<th scope="row"><label for="md_skin">최신글 스킨</label></th>
|
|
<td>
|
|
<select name="md_skin" id="md_skin">
|
|
<option value="">선택하세요</option>
|
|
<?php echo rb_skin_select('latest', $module['md_skin']); ?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- 최신글 탭 옵션 -->
|
|
<tr class="tab_option">
|
|
<th scope="row">탭 리스트</th>
|
|
<td>
|
|
<textarea name="md_tab_list" id="md_tab_list" class="frm_input" style="width:100%; height:100px;" placeholder='[{"bo_table":"notice", "sca":"공지"}, {"bo_table":"free"}]'><?php echo get_text($module['md_tab_list']); ?></textarea>
|
|
<?php echo help('JSON 형식으로 입력합니다. 예: [{"bo_table":"notice", "sca":"공지"}, {"bo_table":"free"}]'); ?>
|
|
</td>
|
|
</tr>
|
|
<tr class="tab_option">
|
|
<th scope="row"><label for="md_tab_skin">탭 스킨</label></th>
|
|
<td>
|
|
<select name="md_tab_skin" id="md_tab_skin">
|
|
<option value="">선택하세요</option>
|
|
<?php echo rb_skin_select('latest_tabs', $module['md_tab_skin']); ?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- 상품 옵션 -->
|
|
<?php if($is_shop): ?>
|
|
<tr class="item_option">
|
|
<th scope="row"><label for="md_module">상품 타입</label></th>
|
|
<td>
|
|
<select name="md_module" id="md_module">
|
|
<option value="0" <?php echo get_selected($module['md_module'], "0"); ?>>전체상품</option>
|
|
<option value="1" <?php echo get_selected($module['md_module'], "1"); ?>>히트상품</option>
|
|
<option value="2" <?php echo get_selected($module['md_module'], "2"); ?>>추천상품</option>
|
|
<option value="3" <?php echo get_selected($module['md_module'], "3"); ?>>최신상품</option>
|
|
<option value="4" <?php echo get_selected($module['md_module'], "4"); ?>>인기상품</option>
|
|
<option value="5" <?php echo get_selected($module['md_module'], "5"); ?>>할인상품</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr class="item_option">
|
|
<th scope="row"><label for="md_sca_item">상품 카테고리</label></th>
|
|
<td>
|
|
<select name="md_sca_item" id="md_sca_item">
|
|
<option value="">전체</option>
|
|
<?php
|
|
$category_select = '';
|
|
$sql_cat = " select * from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
|
|
$result_cat = sql_query($sql_cat);
|
|
for ($i=0; $row_cat=sql_fetch_array($result_cat); $i++) {
|
|
$len = strlen($row_cat['ca_id']) / 2 - 1;
|
|
$nbsp = str_repeat(" ", $len);
|
|
$category_select .= "<option value=\"{$row_cat['ca_id']}\" ".get_selected($module['md_sca'], $row_cat['ca_id']).">$nbsp{$row_cat['ca_name']}</option>\n";
|
|
}
|
|
echo $category_select;
|
|
?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
|
|
<!-- 기타 옵션들 (위젯, 배너, 투표, 커스텀) -->
|
|
<tr class="widget_option"><th scope="row"><label for="md_widget">위젯</label></th><td><input type="text" name="md_widget" value="<?php echo get_text($module['md_widget']); ?>" id="md_widget" class="frm_input" size="50"></td></tr>
|
|
<tr class="banner_option"><th scope="row"><label for="md_banner">배너 그룹</label></th><td><input type="text" name="md_banner" value="<?php echo get_text($module['md_banner']); ?>" id="md_banner" class="frm_input" size="20"></td></tr>
|
|
<tr class="banner_option"><th scope="row"><label for="md_banner_skin">배너 스킨</label></th><td><select name="md_banner_skin" id="md_banner_skin"><option value="">선택</option><?php echo rb_banner_skin_select('rb.mod/banner/skin', $module['md_banner_skin']); ?></select></td></tr>
|
|
<tr class="poll_option"><th scope="row"><label for="md_poll_id">투표 ID</label></th><td><input type="text" name="md_poll_id" value="<?php echo get_text($module['md_poll_id']); ?>" id="md_poll_id" class="frm_input" size="10"></td></tr>
|
|
<tr class="custom_option"><th scope="row"><label for="md_custom_skin">커스텀 모듈</label></th><td><select name="md_custom_skin" id="md_custom_skin"><option value="">선택</option><?php echo rb_dir_select("rb.custom", $module['md_custom_skin']); ?></select></td></tr>
|
|
<tr class="custom_option"><th scope="row"><label for="md_custom_survey_key">커스텀 설문 키</label></th><td><input type="text" name="md_custom_survey_key" value="<?php echo get_text($module['md_custom_survey_key']); ?>" id="md_custom_survey_key" class="frm_input" size="30"></td></tr>
|
|
</tbody>
|
|
|
|
<!-- 3. 레이아웃 및 디자인 설정 -->
|
|
<tbody class="common_options">
|
|
<tr><th colspan="2" class="title_heading">레이아웃 및 디자인</th></tr>
|
|
<tr>
|
|
<th scope="row">출력 갯수</th>
|
|
<td>
|
|
<label for="md_cnt">총 갯수</label> <input type="text" name="md_cnt" value="<?php echo get_text($module['md_cnt']); ?>" id="md_cnt" class="frm_input" size="5">
|
|
<label for="md_col" class="ml-3">PC 열</label> <input type="text" name="md_col" value="<?php echo get_text($module['md_col']); ?>" id="md_col" class="frm_input" size="5">
|
|
<label for="md_row">PC 행</label> <input type="text" name="md_row" value="<?php echo get_text($module['md_row']); ?>" id="md_row" class="frm_input" size="5">
|
|
<label for="md_col_mo" class="ml-3">모바일 열</label> <input type="text" name="md_col_mo" value="<?php echo get_text($module['md_col_mo']); ?>" id="md_col_mo" class="frm_input" size="5">
|
|
<label for="md_row_mo">모바일 행</label> <input type="text" name="md_row_mo" value="<?php echo get_text($module['md_row_mo']); ?>" id="md_row_mo" class="frm_input" size="5">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">크기 및 간격</th>
|
|
<td>
|
|
<label for="md_width">가로</label> <input type="text" name="md_width" value="<?php echo get_text($module['md_width']); ?>" id="md_width" class="frm_input" size="5">
|
|
<select name="md_size" id="md_size"><option value="%" <?php echo get_selected($module['md_size'], '%'); ?>>%</option><option value="px" <?php echo get_selected($module['md_size'], 'px'); ?>>px</option></select>
|
|
<label for="md_height" class="ml-3">세로</label> <input type="text" name="md_height" value="<?php echo get_text($module['md_height']); ?>" id="md_height" class="frm_input" size="5">
|
|
<label for="md_gap" class="ml-3">PC 간격</label> <input type="text" name="md_gap" value="<?php echo get_text($module['md_gap']); ?>" id="md_gap" class="frm_input" size="5">
|
|
<label for="md_gap_mo">모바일 간격</label> <input type="text" name="md_gap_mo" value="<?php echo get_text($module['md_gap_mo']); ?>" id="md_gap_mo" class="frm_input" size="5">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">여백 (Margin)</th>
|
|
<td>
|
|
<label for="md_margin_top_pc">PC 상단</label> <input type="text" name="md_margin_top_pc" value="<?php echo get_text($module['md_margin_top_pc']); ?>" id="md_margin_top_pc" class="frm_input" size="5">
|
|
<label for="md_margin_btm_pc">PC 하단</label> <input type="text" name="md_margin_btm_pc" value="<?php echo get_text($module['md_margin_btm_pc']); ?>" id="md_margin_btm_pc" class="frm_input" size="5">
|
|
<label for="md_margin_top_mo" class="ml-3">모바일 상단</label> <input type="text" name="md_margin_top_mo" value="<?php echo get_text($module['md_margin_top_mo']); ?>" id="md_margin_top_mo" class="frm_input" size="5">
|
|
<label for="md_margin_btm_mo">모바일 하단</label> <input type="text" name="md_margin_btm_mo" value="<?php echo get_text($module['md_margin_btm_mo']); ?>" id="md_margin_btm_mo" class="frm_input" size="5">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">안쪽 여백 (Padding)</th>
|
|
<td>
|
|
<label for="md_padding">PC</label> <input type="text" name="md_padding" value="<?php echo get_text($module['md_padding']); ?>" id="md_padding" class="frm_input" size="10">
|
|
<label for="md_padding_mo" class="ml-3">모바일</label> <input type="text" name="md_padding_mo" value="<?php echo get_text($module['md_padding_mo']); ?>" id="md_padding_mo" class="frm_input" size="10">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">스타일</th>
|
|
<td>
|
|
<label for="md_border">테두리</label> <input type="text" name="md_border" value="<?php echo get_text($module['md_border']); ?>" id="md_border" class="frm_input" size="10">
|
|
<label for="md_radius" class="ml-3">라운드</label> <input type="text" name="md_radius" value="<?php echo get_text($module['md_radius']); ?>" id="md_radius" class="frm_input" size="5">
|
|
<label for="md_banner_bg" class="ml-3">배경</label> <input type="text" name="md_banner_bg" value="<?php echo get_text($module['md_banner_bg']); ?>" id="md_banner_bg" class="frm_input" size="20">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">타이틀 스타일</th>
|
|
<td>
|
|
<label for="md_title_color">색상</label> <input type="text" name="md_title_color" value="<?php echo get_text($module['md_title_color']); ?>" id="md_title_color" class="frm_input" size="10">
|
|
<label for="md_title_size" class="ml-3">크기</label> <input type="text" name="md_title_size" value="<?php echo get_text($module['md_title_size']); ?>" id="md_title_size" class="frm_input" size="5">
|
|
<label for="md_title_font" class="ml-3">폰트</label> <input type="text" name="md_title_font" value="<?php echo get_text($module['md_title_font']); ?>" id="md_title_font" class="frm_input" size="10">
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
|
|
<!-- 4. 기능 설정 -->
|
|
<tbody class="common_options">
|
|
<tr><th colspan="2" class="title_heading">기능 설정</th></tr>
|
|
<tr>
|
|
<th scope="row">기능 설정</th>
|
|
<td>
|
|
<input type="checkbox" name="md_swiper_is" value="1" id="md_swiper_is" <?php echo ($module['md_swiper_is'] == 1) ? 'checked' : ''; ?>> <label for="md_swiper_is">스와이프(슬라이드) 사용</label>
|
|
<span class="ml-3">
|
|
<input type="checkbox" name="md_auto_is" value="1" id="md_auto_is" <?php echo ($module['md_auto_is'] == 1) ? 'checked' : ''; ?>> <label for="md_auto_is">자동롤링</label>
|
|
(시간: <input type="text" name="md_auto_time" value="<?php echo get_text($module['md_auto_time']); ?>" id="md_auto_time" class="frm_input" size="5"> ms)
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr class="latest_option tab_option item_option">
|
|
<th scope="row">출력 항목</th>
|
|
<td>
|
|
<input type="checkbox" name="md_subject_is" value="1" id="md_subject_is" <?php echo ($module['md_subject_is'] == 1) ? 'checked' : ''; ?>> <label for="md_subject_is">제목</label>
|
|
<input type="checkbox" name="md_content_is" value="1" id="md_content_is" <?php echo ($module['md_content_is'] == 1) ? 'checked' : ''; ?>> <label for="md_content_is">내용</label>
|
|
<input type="checkbox" name="md_thumb_is" value="1" id="md_thumb_is" <?php echo ($module['md_thumb_is'] == 1) ? 'checked' : ''; ?>> <label for="md_thumb_is">썸네일</label>
|
|
<input type="checkbox" name="md_nick_is" value="1" id="md_nick_is" <?php echo ($module['md_nick_is'] == 1) ? 'checked' : ''; ?>> <label for="md_nick_is">작성자</label>
|
|
<input type="checkbox" name="md_date_is" value="1" id="md_date_is" <?php echo ($module['md_date_is'] == 1) ? 'checked' : ''; ?>> <label for="md_date_is">날짜</label>
|
|
<input type="checkbox" name="md_icon_is" value="1" id="md_icon_is" <?php echo ($module['md_icon_is'] == 1) ? 'checked' : ''; ?>> <label for="md_icon_is">아이콘</label>
|
|
<input type="checkbox" name="md_comment_is" value="1" id="md_comment_is" <?php echo ($module['md_comment_is'] == 1) ? 'checked' : ''; ?>> <label for="md_comment_is">댓글수</label>
|
|
<input type="checkbox" name="md_ca_is" value="1" id="md_ca_is" <?php echo ($module['md_ca_is'] == 1) ? 'checked' : ''; ?>> <label for="md_ca_is">카테고리</label>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="btn_fixed_top">
|
|
<a href="./module_list.php?<?php echo $qstr; ?>" class="btn btn_02">목록</a>
|
|
<input type="submit" value="확인" class="btn_submit btn" accesskey="s">
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<script>
|
|
jQuery(function($){
|
|
function toggle_fields() {
|
|
var type = $('#md_type').val();
|
|
|
|
$('.module_options > tr').hide();
|
|
|
|
if (type) {
|
|
$('.common_options').show();
|
|
$('.' + type + '_option').show();
|
|
} else {
|
|
$('.common_options').hide();
|
|
}
|
|
}
|
|
|
|
toggle_fields();
|
|
|
|
$('#md_type').on('change', function() {
|
|
toggle_fields();
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<?php
|
|
include_once(G5_ADMIN_PATH . '/admin.tail.php');
|
|
?>
|