Files
citrus-cms/config/elfinder.php
T
2026-04-28 21:15:09 +03:00

197 lines
6.7 KiB
PHP

<?php
return array(
/*
|--------------------------------------------------------------------------
| Upload dir
|--------------------------------------------------------------------------
|
| The dir where to store the images (relative from public)
|
*/
'dir' => ['storage'],
/*
|--------------------------------------------------------------------------
| Filesystem disks (Flysytem)
|--------------------------------------------------------------------------
|
| Define an array of Filesystem disks, which use Flysystem.
| You can set extra options, example:
|
| 'my-disk' => [
| 'URL' => url('to/disk'),
| 'alias' => 'Local storage',
| ]
*/
'disks' => [
/*
'my-disk' => [
'URL' => url('app'),
'alias' => 'Local storage',
]
*/
],
/*
|--------------------------------------------------------------------------
| Routes group config
|--------------------------------------------------------------------------
|
| The default group settings for the elFinder routes.
|
*/
'route' => [
'prefix' => 'app/elfinder',
'middleware' => array('web', 'auth'), //Set to null to disable middleware filter
],
/*
|--------------------------------------------------------------------------
| Access filter
|--------------------------------------------------------------------------
|
| Filter callback to check the files
|
*/
/*
|--------------------------------------------------------------------------
| Roots
|--------------------------------------------------------------------------
|
| By default, the roots file is LocalFileSystem, with the above public dir.
| If you want custom options, you can set your own roots below.
|
*/
'roots' => [
0 => [
'driver' => 'LocalFileSystem',
'path' => storage_path('documents'),
'URL' => '/storage/documents',
'accessControl' => 'App\Http\Controllers\CustomElfinderController::access',
'autoload' => false,
// accessControl function will handle all permissions dynamically
]
],
/*
|--------------------------------------------------------------------------
| Options
|--------------------------------------------------------------------------
|
| These options are merged, together with 'roots' and passed to the Connector.
| See https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options-2.1
|
*/
'options' => [
// Global options for all roots
'locale' => 'en_US.UTF-8',
'debug' => false,
'bind' => [
'mkdir mkfile rename duplicate upload rm paste' => 'history',
'upload.presave' => 'Plugin.AutoResize.onUpLoadPreSave',
],
'plugin' => [
'AutoResize' => [
'enable' => true,
'maxWidth' => 1920,
'maxHeight' => 1080,
'quality' => 95
],
'Sanitizer' => [
'enable' => true,
'targets' => ['\\','/',':','*','?','"','<','>','|',' '],
'replace' => '_'
],
'Edit' => [
'enable' => true,
'mimes' => [
'application/vnd.ms-excel',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'application/vnd.ms-excel.sheet.macroEnabled.12',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/msword',
'application/pdf'
]
],
],
// Permission-based UI customization
'ui' => [
'toolbar' => [
['back', 'forward'],
['reload'],
['home', 'up'],
['mkdir', 'mkfile', 'upload'],
['open', 'download', 'getfile'],
['info'],
['quicklook'],
['copy', 'cut', 'paste'],
['rm'],
['duplicate', 'rename', 'edit', 'resize', 'rotate'],
['extract', 'archive'],
['search'],
['view', 'sort']
]
],
// Custom commands for Office document editing
'commands' => [
'edit' => [
'target' => true,
'mimes' => [
'application/vnd.ms-excel',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'application/vnd.ms-excel.sheet.macroEnabled.12',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/msword',
'application/pdf'
]
]
],
// Custom JavaScript for edit functionality
'customData' => [
'editUrl' => 'https://view.officeapps.live.com/op/embed.aspx?src=',
'editCallback' => 'function(file) {
var url = "https://view.officeapps.live.com/op/embed.aspx?src=" + encodeURIComponent(file.url);
window.open(url, "_blank", "width=1200,height=800,scrollbars=yes,resizable=yes");
}'
]
],
/*
|--------------------------------------------------------------------------
| Root Options
|--------------------------------------------------------------------------
|
| These options are merged, together with every root by default.
| See https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options-2.1#root-options
|
*/
'root_options' => [
// Default root options - will be overridden by accessControl
'read' => true,
'write' => false,
'rm' => false,
'mkdir' => false,
'mkfile' => false,
'upload' => false,
'rename' => false,
'copy' => false,
'move' => false,
'edit' => true, // Enable edit functionality
// File type restrictions
'uploadDeny' => ['text/x-php', 'text/x-python', 'text/x-java-source', 'text/x-c', 'text/x-c++src'],
'uploadAllow' => ['image', 'text/plain', 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
'uploadOrder' => ['deny', 'allow'],
// Size limits
'uploadMaxSize' => '100M',
'uploadMaxConn' => 3,
],
);