<div class="input-group-append">
    <button type="button" class="btn btn-alt-primary dropdown-toggle" data-toggle="dropdown" tabindex="-1">选择<?php echo $title; ?></button>
    <div class="dropdown-menu">
        <?php if (AdmincpAccess::app('files.ADD')) { ?>
            <a class="dropdown-item" href="<?php echo ADMINCP_URL; ?>=files&do=add&callback=<?php echo $field; ?>" data-toggle="modal" data-meta='{"width":"300px","height":"80px"}' title="本地上传"><i class="fa fa-fw fa-upload"></i> 本地上传</a>
            <?php if ($multi) { ?>
                <a class="dropdown-item" href="<?php echo ADMINCP_URL; ?>=files&do=multi&callback=<?php echo $field; ?>" data-toggle="modal" title="多图上传"><i class="fa fa-fw fa-upload"></i> 多图上传</a>
            <?php } ?>
        <?php } ?>
        <?php if (AdmincpAccess::app('files.BROWSE')) { ?>
            <a class="dropdown-item" href="<?php echo ADMINCP_URL; ?>=files&do=browse&click=file&callback=<?php echo $field; ?>" data-toggle="modal" title="从网站选择"><i class="fa fa-fw fa-search"></i> 从网站选择</a>
            <div class="dropdown-divider"></div>
        <?php } ?>
        <?php if (AdmincpAccess::app('files.EDIT') &&1) { ?>
            <a class="dropdown-item" href="<?php echo ADMINCP_URL; ?>=files&do=editpic&callback=<?php echo $field; ?>" data-toggle="modal" title="使用美图秀秀编辑图片"><i class="fa fa-fw fa-pencil-alt"></i> 编辑</a>
            <div class="dropdown-divider"></div>
            <?php if ($indexid) { ?>
                <a class="dropdown-item" href="<?php echo ADMINCP_URL; ?>=files&do=editpic&indexid=<?php echo $indexid; ?>&callback=<?php echo $field; ?>" data-toggle="modal" title="使用加载本篇内容所有图片编辑"><i class="fa fa-fw fa-pencil-alt"></i> 多图编辑</a>
                <div class="dropdown-divider"></div>
            <?php } ?>
        <?php } ?>
        <a data-preview="<?php echo $field; ?>" class="dropdown-item" href="<?php echo ADMINCP_URL; ?>=files&do=preview&callback=<?php echo $field; ?>" data-toggle="modal" data-check="1" title="预览"><i class="fa fa-fw fa-eye"></i> 预览</a>
    </div>
    <?php if (!$GLOBALS['multiTpl'] && $multi) { ?>
    <link rel="stylesheet" href="./assets/oneui/js/plugins/magnific-popup/magnific-popup.css">   
    <script src="./assets/oneui/js/plugins/magnific-popup/jquery.magnific-popup.min.js"></script>
    <script>jQuery(function(){One.helpers('magnific-popup');});</script>
    <script id="multiTpl-multi_image" type="text/html">
        <div class="col-md-6 col-lg-4 col-xl-3">
            <a href="javascript:;" class="delete"><i class="fa fa-times"></i></a>
            <a class="img-link img-link-simple img-link-zoom-in img-lightbox" href="<%data.url%>" target="_blank">
                <img src="<%data.url%>" class="img-thumbnail">
            </a>
            <input type="hidden" name="@a@[]" value="<%data.value%>">
        </div>
    </script>
    <script id="multiTpl-multi_file" type="text/html">
        <div class="col-12 mt-1">
            <div class="input-group input-group-sm">
                <div class="input-group-prepend">
                    <a href="javascript:;" class="btn btn-alt-primary delete"><i class="fa fa-times"></i></a>
                    <input type="hidden" name="@a@[]" value="<%data.value%>">
                </div>
                <input class="form-control" readonly type="text" value="<%data.url%>">
            </div>
        </div>
    </script>
    <?php $GLOBALS['multiTpl'] = 1;} ?>
    <script>
    $(function() {
        var a = new files.picbtn({
            id: "<?php echo $field; ?>",
            template: "multiTpl-<?php echo $type; ?>",
            title: "<?php echo $title; ?>",
            is_multi: <?php echo (int) $multi; ?>,
            is_http: <?php echo (int) ($noHttp && Request::isUrl(self::$picData)); ?>,
            vdata: {'<?php echo $field; ?>_http': 1},
            data: <?php echo $json; ?>
        });
        window.modal_<?php echo $field; ?> = function(json,flag){
            if (json.state == 'SUCCESS') {
                return a.modal(null,json,flag);
            } else {
                return iCMS.ui.alert(json.message);
            }
        }
    });
    </script>
</div>
<?php if ($noHttp) { ?>
    <div class="input-group-append">
        <div class="input-group-text" data-toggle="tooltip" title="选中不执行远程文件本地化">
            <div class="custom-control custom-checkbox">
                <input v-model="<?php echo $field; ?>_http" type="checkbox" class="custom-control-input" id="<?php echo $field; ?>_http" name="<?php echo $field; ?>_http" />
                <label class="custom-control-label" for="<?php echo $field; ?>_http"></label>
            </div>
        </div>
    </div>
<?php } ?>
<?php if ($multi) { ?>
    <div class="row js-gallery img-fluid-100 mt-1 w-100"></div>
<?php } ?>  