mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 05:59:21 +03:00
Moved CKEditor to be plugin
This commit is contained in:
parent
240b0381f9
commit
af3c79ce80
217 changed files with 467 additions and 8683 deletions
38
plugins/ckeditor/index.php
Normal file
38
plugins/ckeditor/index.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
class CKEditorPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||
{
|
||||
const
|
||||
NAME = 'CKEditor',
|
||||
VERSION = '2.0',
|
||||
RELEASE = '2021-03-25',
|
||||
REQUIRED = '2.4.2',
|
||||
DESCRIPTION = 'Use CKEditor instead of Squire as WYSIWYG';
|
||||
|
||||
public function Init() : void
|
||||
{
|
||||
$path = APP_VERSION_ROOT_PATH . 'static/ckeditor';
|
||||
|
||||
// Apache AH00037: Symbolic link not allowed or link target not accessible
|
||||
// That's why we clone the source
|
||||
if (!\is_dir($path)/* && !\is_link($path)*/) {
|
||||
// $active = \symlink(__DIR__ . '/src', $path);
|
||||
\mkdir($path, 0755);
|
||||
$iterator = new \RecursiveIteratorIterator(
|
||||
new \RecursiveDirectoryIterator(__DIR__ . '/src', \RecursiveDirectoryIterator::SKIP_DOTS),
|
||||
\RecursiveIteratorIterator::SELF_FIRST
|
||||
);
|
||||
foreach ($iterator as $item) {
|
||||
if ($item->isDir()) {
|
||||
\mkdir($path . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
|
||||
} else {
|
||||
\copy($item, $path . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (\is_file("{$path}/ckeditor.js")) {
|
||||
$this->addJs('ckeditor.js');
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue