Download the PHP package jodit/connector without Composer
On this page you can find all versions of the php package jodit/connector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jodit/connector
More information about jodit/connector
Files in jodit/connector
Package connector
Short Description Jodit FileBrowser and Uploader connector
License MIT
Informations about the package connector
Jodit FileBrowser Connector for Jodit v.3.0
Official Jodit WYSIWYG PHP connector
old version for Jodit 2.x
Install
or download ZIP archive
Configuration
Available options:
$config['saveSameFileNameStrategy'] = "addNumber"
- Strategy in case the uploaded file has the same name as the file on the server.- "addNumber" - The number "olsen.png" => "olsen(1).png" is added number to the file name, if such a file exists, it will be "olsen(2).png", etc.
- "replace" - Just replace the file
- "error" - Throw the error - "File already exists"
$config['quality'] = 90
- image quality$config['datetimeFormat'] = 'd/m/Y'
- Date format$config['root'] = __DIR__
- the root directory for user files$config['baseurl'] = ($_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . '/'
- Root URL for user files (exp.http://xdsoft.net
)$config['createThumb'] = true
- boolean, true - create thumbnails for previews (true
)$config['safeThumbsCountInOneTime'] = 20
- int, If thecreateThumb
option is enabled, then with a large number of files in the folder, the server will noticeably slow down when generating so many previews. Therefore, at a time, only such a number of pictures are processed.$config['thumbFolderName'] = '_thumbs'
- thumbnails folder$config['excludeDirectoryNames'] = ['.tmb', '.quarantine'],
- exclude these folders$config['extensions'] = ['jpg', 'png', 'gif', 'jpeg']
- an array of valid file extensions that are permitted to be loaded (['jpg', 'png', 'gif', 'jpeg']
)$config['maxFileSize'] = 8mb
- Maximum file size (0 - is unlimited) default 8Mb$config['allowCrossOrigin'] = false
- Allow cross origin request$config['allowReplaceSourceFile'] = true
- Allow replace source image on resized or croped version$config['sources']
- Array of options$config['accessControl']
- Array for checking allow/deny permissions Read more$config['defaultRole']="guest"
- Default role for Access Control$config['roleSessionVar']="JoditUserRole"
- The session key name that Jodit connector will use for checking the role for current user. Read more
you can defined several sources, and override some options:
How use with Jodit
Filebrowser settings Detailt options
and uploader options Default options
Customize config
Change config.php
Do not modify the default.config.php file, instead, override the settings in the config.php file
Authentication
Change connector/checkAuthentication
in connector/Application.php
Like this:
Example Integrate with Joomla
Change Application.php
You can use $action
for allow or deny access
but better use AllowControl
option
Access Control
roleSessionVar
- The session key name that Jodit connector will use for checking the role for current user.
After this you will be able to use $_SESSION['JoditUserRole']
to set inside your script - user role, after that user
was authenticated:
Somewhere in your script
In deafult.config.php
you can find default ACL config
It means that all authenticated user will have all permissions but they are not allowed to download executable files.
In config.php
you can customize it. For example set read-only permission for all users, but give to users with the
role - administrator
full access:
API
All actions case-sensitive
Actions
permissions - get permissions to current path. This action should call after every changing path.
- [:source=default] - key from config (ex. from Joomla config - `joomla Media)
- [:path=source.root] - relative path for source.root
See tests/api/PermissionsCept.php
Answer JSON example:
files - Get all files from folder
- [:source=default] - key from config (ex. from Joomla config - `joomla Media)
- [:path=source.root] - relative path for source.root
See tests/api/getAllFilesByAllSourcesCept.php
and tests/api/getAllFilesByOneSourceCept.php
Answer JSON example:
folders - Get all folders from path
- [:source=default] - key from config (ex. from Joomla config - `joomla Media)
- [:path=source.root] - relative path for source.root.
See tests/api/getAllFoldersByAllSourcesCept.php
and tests/api/getAllFoldersByOneSourceCept.php
Answer JSON example:
fileUploadRemote - Download image from another server
- [:source=default] - key from config (ex. from Joomla config - `joomla Media)
- [:path=source.root] - relative path for source.root.
- :url - full image URL
See tests/api/uploadImageByUrlToServerCept.php
Answer JSON example:
fileUpload - Upload files to server
- [:source=default] - key from config (ex. from Joomla config - `joomla Media)
- [:path=source.root] - relative path for source.root.
- :files - files
See tests/api/uploadImageToServerCept.php
fileRemove - Remove file
- [:source=default] - key from config (ex. from Joomla config - `joomla Media)
- [:path=source.root] - relative path for source.root.
- :name - file name or folder name
See tests/api/removeImageFromServerCept.php
folderRemove - Remove folder from server
- [:source=default] - key from config (ex. from Joomla config - `joomla Media)
- [:path=source.root] - relative path for source.root.
- :name - file name or folder name
folderCreate - Create folder on server
- [:source=default] - key from config (ex. from Joomla config - `joomla Media)
- [:path=source.root] - relative path for source.root.
- :name - new folder name
See tests/api/createFolderCept.php
folderMove - Move folder to another place
- [:source=default] - key from config (ex. from Joomla config - `joomla Media)
- [:path=source.root] - relative path for source.root. This is where the file will be move
- :from - relative path (from source.root) file or folder
See tests/api/moveFileCept.php
fileMove - Move file to another place
- [:source=default] - key from config (ex. from Joomla config - `joomla Media)
- [:path=source.root] - relative path for source.root. This is where the file will be move
- :from - relative path (from source.root) file or folder
See tests/api/moveFileCept.php
imageResize - Resize image
- [:source=default] - key from config (ex. from Joomla config - `joomla Media)
- [:path=source.root] - relative path for source.root.
- :name - File source in
:path
- :newname - new file name in
:path
. Can be equal:name
- :box - new width and height
See tests/api/resizeImageCept.php
imageCrop - Crop image
- [:source=default] - key from config (ex. from Joomla config - `joomla Media)
- [:path=source.root] - relative path for source.root.
- :name - File source in
:path
- :newname - new file name in
:path
. Can be equal:name
- :box - bounding box
See tests/api/cropImageCept.php
getLocalFileByUrl - Get local file by URL
- [:source=default] - key from config (ex. from Joomla config - `joomla Media)
- [:path=source.root] - relative path for source.root.
- :url - Full fil url for source
See tests/api/getlocalFileByURLCept.php
Example:
Answer JSON example:
Road map
- [x] Cross Origin requests
- [ ] Add pagination
- [ ] Create FTP/SFTP sources
- [ ] Create image filters (noise, gray scale etc.)
Contacts
- [email protected]
- Website xdsoft.net
- Jodit