{% set const = TabaFileManager2Constants %}
{% set bind_prefix = constant('ADMIN_BIND_PREFIX',const) %}
{% set trans_prefix = constant('PLUGIN_CODE_LC',const) %}
<script>
$(function() {
var appendNav = $('#nav-{{ constant('PLUGIN_CODE_LC',const) }}-subnav');
$('#nav-{{ constant('PLUGIN_CATEGORY_ID',const) }}').prepend(appendNav.html());
$('#{{ constant('PLUGIN_CODE_LC',const) }}-modal-open').on('click',function(){
swFileManager = new SwFileManager();
swFileManager.enable = false;
$('#{{ constant('PLUGIN_CODE_LC',const) }}-modal').modal('show');
});
$('#{{ constant('PLUGIN_CODE_LC',const) }}-modal').on('show.bs.modal', function (e) {
$(this).find('.modal-content').css({'height': ($(window).height() - 100) + 'px'});
if (!$(this).find('iframe').attr('src')) {
$(this).find('iframe').attr('src','{{ url(bind_prefix~'_index') }}');
}
});
});
var SwFileManager = function() {
var instance = this;
instance.enable = false;
instance.callbackFunction = null;
instance.exec = function(callbackFunction) {
instance.enable = true;
instance.callbackFunction = callbackFunction;
$('#{{ constant('PLUGIN_CODE_LC',const) }}-modal').modal('show');
};
instance.setFile = function(file) {
instance.callbackFunction(file);
$('#{{ constant('PLUGIN_CODE_LC',const) }}-modal').modal('hide');
};
SwFileManager = function() {
return instance;
};
}
</script>
<ul id="nav-{{ constant('PLUGIN_CODE_LC',const) }}-subnav" style="display:none;">
<li><a href="#" id="{{ constant('PLUGIN_CODE_LC',const) }}-modal-open"><span>ファイル管理</span></a></li>
</ul>
<div class="modal fade" id="{{ constant('PLUGIN_CODE_LC',const) }}-modal" tabindex="-1" role="dialog" aria-hidden="true" style="z-index: 100000 !important;background-color: rgba(0,0,0,0.3) !important;">
<div class="modal-dialog modal-dialog-centered" role="document" style="max-width: 90% !important;">
<div class="modal-content">
<iframe src="" style="width:100%;height:100%;border: none;" id="{{ constant('PLUGIN_CODE_LC',const) }}-modal-content"></iframe>
</div>
</div>
</div>