html-filemanager-language.php
2 years ago
html-filemanager-list-operations.php
2 years ago
html-filemanager-settings.php
2 years ago
html-filemanager-user-role-restrictions.php
2 years ago
html-filemanager.php
2 years ago
index.php
2 years ago
html-filemanager.php
118 lines
| 1 | <?php |
| 2 | defined('ABSPATH') || exit; |
| 3 | $lang = !empty( $this->options['njt_fs_file_manager_settings']['fm_locale']) ? $this->options['njt_fs_file_manager_settings']['fm_locale'] : ''; |
| 4 | ?> |
| 5 | <div class="njt-fs-file-manager"> |
| 6 | <div class="njt-fs-select-theme"> |
| 7 | <div class="njt-fs-wrap njt-fs-mr0"> |
| 8 | <h1 class="wp-heading-inline njt-fs-pd0"><?php _e("Filester - WordPress File Manager Pro", NJT_FS_BN_DOMAIN); ?></h1> |
| 9 | </div> |
| 10 | <div class="select-theme-content"> |
| 11 | <?php |
| 12 | $selectedTheme = get_option('njt_fs_selector_themes') && get_option('njt_fs_selector_themes')[$this->userRole]['themesValue'] ? get_option('njt_fs_selector_themes')[$this->userRole]['themesValue'] : null; |
| 13 | ?> |
| 14 | <div class="njt-fs-wrap njt-fs-mr0"> |
| 15 | <h3 class="wp-heading-inline select-theme-title"><?php _e("Select theme:", NJT_FS_BN_DOMAIN); ?></h3> |
| 16 | </div> |
| 17 | <select name="selector-themes" id="selector-themes"> |
| 18 | <option value="Default"><?php _e("Default Elfinder", NJT_FS_BN_DOMAIN); ?></option> |
| 19 | <option value="dark-slim"><?php _e("Dark Slim", NJT_FS_BN_DOMAIN); ?></option> |
| 20 | <option value="Material"><?php _e("Material", NJT_FS_BN_DOMAIN); ?></option> |
| 21 | <option value="Material-Gray"><?php _e("Material Gray", NJT_FS_BN_DOMAIN); ?></option> |
| 22 | <option value="Material-Light"><?php _e("Material Light", NJT_FS_BN_DOMAIN); ?></option> |
| 23 | <option value="windows-10"><?php _e("Windows 10", NJT_FS_BN_DOMAIN); ?></option> |
| 24 | </select> |
| 25 | <input type="hidden" name="selected-theme" value="<?php echo ($selectedTheme) ?>"> |
| 26 | |
| 27 | </div> |
| 28 | </div> |
| 29 | |
| 30 | <div class="clear"></div> |
| 31 | <div id="njt-fs-file-manager"> |
| 32 | </div> |
| 33 | </div> |
| 34 | |
| 35 | |
| 36 | <script> |
| 37 | jQuery(document).ready(function() { |
| 38 | jQuery('#njt-fs-file-manager').elfinder({ |
| 39 | url: ajaxurl, |
| 40 | handlers : { |
| 41 | dblclick : function(event, elfinderInstance) { |
| 42 | event.preventDefault(); |
| 43 | elfinderInstance.exec('getfile') |
| 44 | .done(function() { |
| 45 | try { |
| 46 | elfinderInstance.exec('edit'); |
| 47 | } catch (e) { |
| 48 | elfinderInstance.exec('quicklook'); |
| 49 | } |
| 50 | }) |
| 51 | .fail(function() { elfinderInstance.exec('open');}); |
| 52 | } |
| 53 | }, |
| 54 | // disable quicklook |
| 55 | // bootCallback : function(fm) { |
| 56 | // fm.bind('init', function() { |
| 57 | // fm._commands.quicklook.getstate = function() { |
| 58 | // return -1; |
| 59 | // } |
| 60 | // }); |
| 61 | // }, |
| 62 | getFileCallback : function(files, fm) { |
| 63 | return false; |
| 64 | }, |
| 65 | contextmenu: { |
| 66 | // current directory file menu |
| 67 | files: ['getfile', '|', 'open', 'opennew', 'download', 'opendir', 'quicklook', 'email', '|', 'upload', |
| 68 | 'mkdir', '|', 'copy', 'cut', 'paste', 'duplicate', '|', 'rm', 'empty', 'hide', '|', 'rename', 'edit', |
| 69 | 'resize', '|', 'archive', 'extract', '|', 'selectall', 'selectinvert', '|', 'places', 'info', 'chmod', |
| 70 | 'netunmount' |
| 71 | ], |
| 72 | // navbarfolder menu |
| 73 | navbar: ['open', 'opennew', 'download', '|', 'upload', 'mkdir', '|', 'copy', 'cut', 'paste', 'duplicate', |
| 74 | '|', 'rm', 'empty', 'hide', '|', 'rename', '|', 'archive', '|', 'places', 'info', 'chmod', |
| 75 | 'netunmount' |
| 76 | ], |
| 77 | // current directory menu |
| 78 | cwd: ['undo', 'redo', '|', 'back', 'up', 'reload', '|', 'upload', 'mkdir', 'mkfile', 'paste', '|', |
| 79 | 'empty', 'hide', '|', 'view', 'sort', 'selectall', 'colwidth', '|', 'places', 'info', 'chmod', |
| 80 | 'netunmount', |
| 81 | '|', 'fullscreen', '|' |
| 82 | ], |
| 83 | }, |
| 84 | uiOptions: { |
| 85 | // toolbar configuration |
| 86 | toolbar: [ |
| 87 | ['home', 'back', 'forward', 'up', 'reload'], |
| 88 | ['netmount'], |
| 89 | ['mkdir', 'mkfile', 'upload'], |
| 90 | ['open', 'download', 'getfile'], |
| 91 | ['undo', 'redo'], |
| 92 | ['copy', 'cut', 'paste', 'rm', 'empty'], |
| 93 | ['duplicate', 'rename', 'edit', 'resize', 'chmod'], |
| 94 | ['selectall', 'selectnone', 'selectinvert'], |
| 95 | ['quicklook', 'info'], |
| 96 | ['extract', 'archive'], |
| 97 | ['search'], |
| 98 | ['view', 'sort'], |
| 99 | ['help'], |
| 100 | ['fullscreen'] |
| 101 | ], |
| 102 | toolbarExtra: { |
| 103 | // show Preference button into contextmenu of the toolbar (true / false) |
| 104 | preferenceInContextmenu: false |
| 105 | } |
| 106 | }, |
| 107 | ui: ['toolbar', 'tree', 'path', 'stat'], |
| 108 | customData: { |
| 109 | action: 'fs_connector', |
| 110 | nonce: '<?php echo wp_create_nonce( "file-manager-security-token" ); ?>' |
| 111 | }, |
| 112 | lang: '<?php echo ($lang)?>', |
| 113 | requestType: 'post', |
| 114 | width: 'auto', |
| 115 | height: '600', |
| 116 | }); |
| 117 | }); |
| 118 | </script> |