<?php
!defined('EMLOG_ROOT') && exit('access deined!');

 function plugin_setting_view(){

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $plugin_storage = Storage::getInstance('x_nav');
    $classValue = $_POST['class'];
    $plugin_storage->setValue('class', $classValue);

    header("Location:/admin/plugin.php?plugin=x_nav " );
    
} else {
    $plugin_storage = Storage::getInstance('x_nav');
    $class = $plugin_storage->getValue('class');
}
?>
<div class="d-sm-flex align-items-center justify-content-between mb-4">
        <h1 class="h3 mb-0 text-gray-800">文章目录</h1>
    </div>
    <div class="row mt-6">
        <div class="col-lg-6">
            <div class="card">
                <div class="card-header">
                    类名编辑块
                </div>
                <div class="card-body">
                    <form method="post">
                        <div class="form-group">
                            <label for="classInput">包裹log_content的类名:</label>
                            <input type="text" class="form-control" id="classInput" name="class" placeholder="请输入类名" value="<?php echo htmlspecialchars($class); ?>">
                        </div>
                        <button type="submit" class="btn btn-primary">保存</button>
                    </form>
                </div>
            </div>
        </div>

        <div class="col-lg-6">
            <div class="card">
                <div class="card-header">
                    使用方法
                </div>
                <div class="card-body">
<p>为了适配更多模板所以使用选择类名方式，打开模板的<span style="color: #3598db;">echo_log.php</span>文件，找到<span style="color: #3598db;">$log_content</span>复制前面第一个class名(前面要加.)添加到左侧输入框保存就完成了</p>
<p><img src="/content/plugins/x_nav/QQ20241203-143222.png" alt="" width="100%" /></p>
                </div>
            </div>
        </div>
    </div> 
<script>

$("#menu_category_ext").addClass('active');
</script>

<?php
    }
?>
