AvocadoAmber/AvocadoEdition_Light/adm/theme.php

72 lines
2.5 KiB
PHP
Raw Normal View History

2024-09-19 21:03:48 +09:00
<?php
$sub_menu = "100280";
2024-09-23 11:10:50 +09:00
include_once "./_common.php";
2024-09-19 21:03:48 +09:00
if ($is_admin != 'super')
alert('최고관리자만 접근 가능합니다.');
// 테마 필드 추가
if (!isset($config['cf_theme'])) {
2024-09-19 21:06:35 +09:00
sql_query(" ALTER TABLE `{$g5['config_table']}` ADD `cf_theme` varchar(255) NOT NULL DEFAULT '' AFTER `cf_title` ", true);
2024-09-19 21:03:48 +09:00
}
$theme = get_theme_dir();
if ($config['cf_theme'] && in_array($config['cf_theme'], $theme))
array_unshift($theme, $config['cf_theme']);
$theme = array_values(array_unique($theme));
$total_count = count($theme);
// 설정된 테마가 존재하지 않는다면 cf_theme 초기화
if ($config['cf_theme'] && !in_array($config['cf_theme'], $theme))
2024-09-30 01:58:32 +09:00
sql_query("UPDATE {$g5['config_table']} SET cf_theme = '' ");
2024-09-19 21:03:48 +09:00
$g5['title'] = "테마설정";
2024-09-23 11:10:50 +09:00
include_once "./admin.head.php";
2024-09-19 21:03:48 +09:00
?>
<script src="<?php echo G5_ADMIN_URL; ?>/js/theme.js"></script>
<div class="local_wr">
<span class="btn_ov01"><span class="ov_txt">설치된 테마</span><span class="ov_num">
<?php echo number_format($total_count); ?></span></span>
</div>
<?php if ($total_count > 0) { ?>
<ul id="theme_list">
<?php
2024-09-19 21:06:35 +09:00
foreach($theme as $tm) {
$info = get_theme_info($tm);
2024-09-19 21:03:48 +09:00
$name = get_text($info['theme_name']);
if ($info['screenshot'])
2024-09-19 21:06:35 +09:00
$screenshot = $info['screenshot'];
2024-09-19 21:03:48 +09:00
else
2024-09-19 21:06:35 +09:00
$screenshot = G5_ADMIN_URL . '/img/theme_img.jpg';
2024-09-19 21:03:48 +09:00
2024-09-19 21:06:35 +09:00
if ($config['cf_theme'] == $tm) {
$btn_active = '<span class="theme_sl theme_sl_use">사용중</span><button type="button" class="theme_sl theme_deactive" data-theme="' . $tm . '" ' . 'data-name="' . $name . '">사용안함</button>';
2024-09-19 21:03:48 +09:00
} else {
2024-09-19 21:06:35 +09:00
$tconfig = get_theme_config_value($tm, 'set_default_skin');
2024-09-19 21:03:48 +09:00
if ($tconfig['set_default_skin'])
$set_default_skin = 'true';
else
$set_default_skin = 'false';
2024-09-19 21:06:35 +09:00
$btn_active = '<button type="button" class="theme_sl theme_active" data-theme="' . $tm . '" ' . 'data-name="' . $name . '" data-set_default_skin="' . $set_default_skin . '">테마적용</button>';
2024-09-19 21:03:48 +09:00
}
?>
<li>
2024-09-19 21:06:35 +09:00
<div class="tmli_if" style="--bg:url(<?=$screenshot?>">
2024-09-19 21:03:48 +09:00
<div class="tmli_tit">
2024-09-19 21:06:35 +09:00
<p><?= get_text($info['theme_name']); ?></p>
2024-09-19 21:03:48 +09:00
</div>
</div>
<?php echo $btn_active; ?>
2024-09-19 21:06:35 +09:00
<button type="button" class="tmli_dt theme_preview" data-theme="<?php echo $tm; ?>">상세보기</button>
2024-09-19 21:03:48 +09:00
</li>
<?php
}
?>
</ul>
<?php } else { ?>
<p class="no_theme">설치된 테마가 없습니다.</p>
<?php }
2024-09-23 11:10:50 +09:00
include_once "./admin.tail.php";