/// <summary>
        /// Create a new instance
        /// </summary>
        /// <param name="config">ELFinder config</param>
        /// <param name="modulePath">Module path</param>
        protected ELFinderBaseConnectorModule(IELFinderConfig config, string modulePath) : base(modulePath)
        {
            // Initialize driver
            Driver = new FileSystemConnectorDriver(config);

            // Init routes
            InitRoutes();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a new instance
        /// </summary>
        /// <param name="config">Configuration</param>
        public FileSystemConnectorDriver(IELFinderConfig config)
        {
            // Init root volumes
            RootVolumes = new List <FileSystemRootVolume>();

            // Parse configuration
            ParseConfig(config);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Parse configuration
        /// </summary>
        /// <param name="config"></param>
        protected void ParseConfig(IELFinderConfig config)
        {
            // Create root volumes
            foreach (var rootVolumeConfig in config.RootVolumes)
            {
                // Create instance
                var rootVolume = FileSystemRootVolume.Create(
                    rootVolumeConfig.Directory,
                    config.ThumbnailsStorageDirectory);

                // Assign config values

                // Start directory
                if (!string.IsNullOrWhiteSpace(rootVolumeConfig.StartDirectory))
                {
                    rootVolume.StartDirectory = new DirectoryInfo(rootVolumeConfig.StartDirectory);
                }

                // Max upload size in kilobytes
                rootVolume.MaxUploadSizeKb = rootVolumeConfig.MaxUploadSizeKb;

                // Overwrite files when uploading
                rootVolume.UploadOverwrite = rootVolumeConfig.UploadOverwrite;

                // Thumbnails size
                rootVolume.ThumbnailsSize = config.ThumbnailsSize;

                // Thumbnails url
                rootVolume.ThumbnailsUrl = config.ThumbnailsUrl;

                // Url
                rootVolume.Url = rootVolumeConfig.Url;

                // Is read-only
                rootVolume.IsReadOnly = rootVolumeConfig.IsReadOnly;

                // Is show only
                rootVolume.IsShowOnly = rootVolumeConfig.IsShowOnly;

                // Is locked
                rootVolume.IsLocked = rootVolumeConfig.IsLocked;

                // Add to the driver
                AddRootVolume(rootVolume);
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Create a new instance
 /// </summary>
 /// <param name="config">ELFinder config</param>
 protected ELFinderBaseConnectorController(IELFinderConfig config)
 {
     // Initialize driver using config
     Driver = new FileSystemConnectorDriver(config);
 }