Skip to content

StanislavDK/PHP-Filemanager-Summernote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Filemanager Summernote

Lightweight AJAX (PHP, JQuery) File Manager for Summernote

This script is a lightweight and simple File Manager plugin for the Summernote. Written in php using bootstrap and jquery. It is based on scripts https://github.com/jcampbell1/simple-file-manager, http://github.com/jamiebicknell/Thumb, https://github.com/zpalffy/preview-image-jquery, https://github.com/gumlet/php-image-resize/.

Features:

  • Lightweight, simple;
  • Responsive design and usability;
  • Download files;
  • Resize images depending on the destination folder;
  • Preview downloaded images;
  • Delete, rename files;
  • Search file;
  • Create folder;
  • Password and CSRF protection;

Summernote filemanager Summernote filemanager

Installation:

  1. On the page where the summernote is called:
<script src="/summernote/plugins/filebrowser/filemanager.js"></script>

<div id="summernote"><p>Hello Summernote</p></div>
<script>
  $(document).ready(function() {
      $('#summernote').summernote({
      toolbar: [
        ['style', ['style']],
        ['style', ['bold', 'italic', 'underline', 'clear']],
        ['font', ['strikethrough', 'superscript', 'subscript']],
        ['color', ['color']],
        ['insert', ['link', 'video', 'table','filebrowser', 'hr']],
        ['para', ['ul', 'ol', 'paragraph']],
        ['undo', ['undo', 'redo']],
        ['codeview', ['codeview']],
      ]
    });
  });
</script>
  1. In the /summernote/plugins/filebrowser/filemanager.js, you must change the name of the element summernote (in example "#summernote").
  2. In the /summernote/plugins/filebrowser/filemanager.php:
  $disallowed_extensions - array with forbidden extensions
  $allowed_extensions - array with allowed extensions
  $images_extensions - array with image extensions
  $allowed_types - array with allowed mime-type
  $custom_folder - an array with individual parameters for images of a specific folder (size, prefix, the ability to create new folders) 
  $PASSWORD - if set, a password will be requested
  $base_dir - directory for download

Optional:

 <iframe width=100% height=450px style="border:0" id="iframe" src="/manager/plugins/summernote/plugins/filebrowser/filemanager.php?folder=prices&subfolder='+    Price_Name +'&namefile='+ NameFile +'&returnid=price_setting  " id="eframe" class="eframe"></iframe>

returnid - returned item id #

In the /summernote/plugins/filebrowser/filemanager.php:

$custom_prices = array("folder" => "/prices", "prefix" => "pr", "size" => "200", "foldercreate" => "yes"); 

When uploading a file to the "prices" directory, the prefix "pr" will be added to the file name, image size will be reduced to 200 px, it is possible to create a new folder.

Attention! This script was created for a project, support is limited (3 years ago).

About

Lightweight AJAX (php) file manager for summernote

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published