
<!-- 取色 -->
<link href="<?php echo $base_url;?>/common/css/bootstrap/bootstrap-3.3.7/plugins/colorpicker/css/bootstrap-colorpicker.css" rel="stylesheet">
<script type="text/javascript" src="<?php echo $base_url;?>/common/css/bootstrap/bootstrap-3.3.7/plugins/colorpicker/js/bootstrap-colorpicker.js"></script>

<!-- 上传框 -->
<script src="<?php echo $base_url;?>/common/plugins/fileinput/js/fileinput.min.js" type="text/javascript"></script>
<script src="<?php echo $base_url;?>/common/plugins/fileinput/js/locales/zh.js" type="text/javascript"></script>
<link href="<?php echo $base_url;?>/common/plugins/fileinput/css/fileinput.min.css" media="all" rel="stylesheet" type="text/css">

<!-- 触发生成  -->
<?php if(session::get("cache_make_php_array")!="" && config::get("cache_make_open")){ ?>
<script type="text/javascript">
    gotoinurl("<?php echo url("cache/make_php_all",true);?>");
</script>
<?php }; ?>

<div class="main-right-box">
    <h5>
        <?php echo lang_admin('set_up');?>
        <a href="#" onclick="gotourl(this)" data-dataurl="<?php echo url('config/index');?>" data-dataurlname="<?php echo lang_admin('set_up');?>" class="pull-right btn btn-default">
            <i class="icon-action-redo"></i>
        </a>
    </h5>

    <div class="box" id="box">
        <form method="post" action="<?php echo uri();?>" name="config_form" id="config_form" onsubmit="return checkform(this);">
             <span class="pull-right" >
                <input  name="submit" value="1" type="hidden">
                <button class="btn btn-success" type="submit">
                        <span class="glyphicon glyphicon-floppy-disk"></span> <?php echo lang_admin('preservation');?>
                </button>
                <a href="#" onclick="gotohome()" data-dataurlname="<?php echo lang_admin('home');?>" class="btn btn-default">
                        <i class="glyphicon glyphicon-trash"></i>
                </a>
                <a id="content-eidt-nav-btn" class="btn btn-default" style="display:none;">
                    <i class="icon-close"></i>
                </a>
            </span>

            <div id="content-eidt-nav"></div>
            <ul class="nav nav-tabs" role="tablist">
                <?php
                if (is_array($data))
                foreach ($configtitle as $titlekey=>$titleval){ ?>
                    <li role="presentation" class="tag_<?php echo $titlekey;?> <?php if ($titlekey==$set){ ?> active <?php } ?>">
                        <a data-dataurlname=" <?php echo $titleval;?>" href="#tag1" name="<?php echo $titlekey;?>" role="tab" data-toggle="tab">
                            <?php echo $titleval;?>
                        </a>
                    </li>
                <?php }?>
            </ul>
            <div class="blank30"></div>
            <div class="tab-content">
                <div role="tabpanel" class="tab-pane active" id="tag1" name="tagdiv">
                    <?php
                    if (is_array($data))
                        foreach ($data as $item){ ?>
                            <div class="row">
                                <div class="col-xs-4 col-sm-4 col-md-3 col-lg-2 text-right"><?php echo ($item['remarks']?$item['remarks']:lang_admin($item['name']));?>：</div>
                                <div class="col-xs-8 col-sm-7 col-md-7 col-lg-5 text-left">
                                <?php if ($item['selecttype']=="select") {
                                    echo form::select($item['name'],$item['key'],$item['select'],'class="select"');
                                 } elseif ($item['selecttype']=="image") {
                                    echo form::upload_image($item['name'],$item['key']);
                                 } elseif ($item['selecttype']=="radio") {
                                    $_res="";
                                    foreach ($item['select'] as $rkey=>$rval){
                                        $_res .= form::radio($item['name'], $rkey, $rkey ==$item['key']) . $rval;
                                    }
                                    echo $_res;
                                 }elseif (strlen($item['key'],true)>50) {
                                    echo form::textarea($item['name'],$item['key'],' class="textarea"');
                                 }  elseif ($item['name']=="admin_dir") {
                                    echo form::input($item['name'],$item['key'],'onkeyup="value=value.replace(/[^\w\.\/]/ig,\'\')"');
                                 } else {
                                    if ("site_url"==$item['name']){
                                        $option="disabled";
                                    }else{
                                        $option="";
                                    }
                                    echo form::input($item['name'],$item['key'],$option);
                                }?>
                                </div>
                            </div>
                            <div class="clearfix blank20"></div>
                            <?php }?>
                </div>
            </div>
        </form>
    </div>
</div>




<!-- 查看大图 -->
<script type="text/javascript">
    $(function() {
        enlargeImg();
    });
    //查看大图
    function enlargeImg() {
        $(".enlargeImg").click(function() {
            var imgSrc = $(this).attr('src');
            $(this).after("<div onclick='closeImg()' class='enlargeImg_wrapper'><img src='" + imgSrc + "'</div>");
            $('.enlargeImg_wrapper').fadeIn(200);
        })
    }
    //关闭并移除图层
    function closeImg() {
        $('.enlargeImg_wrapper').fadeOut(200).remove();
    }

</script>
<script type="text/javascript">
    <!--
    $(document).ready(function(){
        $(window).scroll(function() {
            var top = $("#index_connent").offset().top; //获取指定位置
            var scrollTop = $(window).scrollTop();  //获取当前滑动位置
            if(scrollTop > top){                 //滑动到该位置时执行代码

                $(".content-eidt-nav").addClass("sabit");

                $(".sabit #fullscreen-btn").css("display","inline-block");
                $(".sabit #content-eidt-nav-btn").css("display","inline-block");

            }else{
                $(".content-eidt-nav").removeClass("sabit");
                $("#fullscreen-btn").css("display","none");
                $(".fixed #fullscreen-btn").css("display","inline-block");
                $("#content-eidt-nav-btn").css("display","none");
            }
        });
    });


    $(document).ready(function(){
        $("#content-eidt-nav-btn").click(function(){

            $(".content-eidt-nav").removeClass("sabit");
        });
    });
    //-->
</script>
<script type="text/javascript">
    <!--
    var fullscreen = false;
    let btn = document.getElementById('fullscreen-btn');
    let fullarea = document.getElementById('box')
    btn.addEventListener('click',function(){
        if (fullscreen) {
            // 退出全屏
            $(".content-eidt-nav").removeClass("fixed");
            $(".content-eidt-nav").css({
                "background-color":"#ffffff"
            });
            $(".content-eidt-nav.sabit").css({
                "padding-right":"15px",
            });
            $(".fixed #fullscreen-btn").css("display","none");
            if (document.exitFullscreen) {
                document.exitFullscreen();
            } else if (document.webkitCancelFullScreen) {
                document.webkitCancelFullScreen();
            } else if (document.mozCancelFullScreen) {
                document.mozCancelFullScreen();
            } else if (document.msExitFullscreen) {
                document.msExitFullscreen();
            }
        } else {
            // 进入全屏
            $("#box").css({
                "overflow":"hidden",
                "overflow-y":"auto"
            });
            $(".content-eidt-nav").addClass("fixed");

            $(".fixed #fullscreen-btn").css("display","inline-block");

            if (fullarea.requestFullscreen) {
                fullarea.requestFullscreen();
            } else if (fullarea.webkitRequestFullScreen) {
                fullarea.webkitRequestFullScreen();
            } else if (fullarea.mozRequestFullScreen) {
                fullarea.mozRequestFullScreen();
            } else if (fullarea.msRequestFullscreen) {
                // IE11
                fullarea.msRequestFullscreen();
            }
        }
        fullscreen = !fullscreen;
    });
    //-->
</script>