app/Plugin/TabaFileManager2/Resource/template/admin/snippet/nav.twig line 1

Open in your IDE?
  1. {% set const = TabaFileManager2Constants %}
  2. {% set bind_prefix = constant('ADMIN_BIND_PREFIX',const) %}
  3. {% set trans_prefix = constant('PLUGIN_CODE_LC',const) %}
  4. <script>
  5.     $(function() {
  6.         var appendNav = $('#nav-{{ constant('PLUGIN_CODE_LC',const) }}-subnav');
  7.         $('#nav-{{ constant('PLUGIN_CATEGORY_ID',const) }}').prepend(appendNav.html());
  8.         $('#{{ constant('PLUGIN_CODE_LC',const) }}-modal-open').on('click',function(){
  9.             swFileManager = new SwFileManager();
  10.             swFileManager.enable = false;
  11.             $('#{{ constant('PLUGIN_CODE_LC',const) }}-modal').modal('show');
  12.         });
  13.         $('#{{ constant('PLUGIN_CODE_LC',const) }}-modal').on('show.bs.modal', function (e) {
  14.             $(this).find('.modal-content').css({'height': ($(window).height() - 100) + 'px'});
  15.             if (!$(this).find('iframe').attr('src')) {
  16.                 $(this).find('iframe').attr('src','{{ url(bind_prefix~'_index') }}');
  17.             }
  18.         });
  19.     });
  20.     var SwFileManager = function() {
  21.         var instance = this;
  22.         instance.enable = false;
  23.         instance.callbackFunction = null;
  24.         instance.exec = function(callbackFunction) {
  25.             instance.enable = true;
  26.             instance.callbackFunction = callbackFunction;
  27.             $('#{{ constant('PLUGIN_CODE_LC',const) }}-modal').modal('show');
  28.         };
  29.         instance.setFile = function(file) {
  30.             instance.callbackFunction(file);
  31.             $('#{{ constant('PLUGIN_CODE_LC',const) }}-modal').modal('hide');
  32.         };
  33.         SwFileManager = function() {
  34.             return instance;
  35.         };
  36.     }
  37. </script>
  38. <ul id="nav-{{ constant('PLUGIN_CODE_LC',const) }}-subnav" style="display:none;">
  39.     <li><a href="#" id="{{ constant('PLUGIN_CODE_LC',const) }}-modal-open"><span>ファイル管理</span></a></li>
  40. </ul>
  41. <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;">
  42.   <div class="modal-dialog modal-dialog-centered" role="document" style="max-width: 90% !important;">
  43.     <div class="modal-content">
  44.         <iframe src="" style="width:100%;height:100%;border: none;" id="{{ constant('PLUGIN_CODE_LC',const) }}-modal-content"></iframe>
  45.     </div>
  46.   </div>
  47. </div>