configure upload dir for tonymce module
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -19,6 +19,7 @@ local/media/images/*
|
||||
web/assets/*
|
||||
web/cache/*
|
||||
web/tinymce
|
||||
web/media
|
||||
phpdoc*.log
|
||||
php-cs
|
||||
xhprof/
|
||||
|
||||
1
local/modules/Tinymce/.gitignore
vendored
Normal file
1
local/modules/Tinymce/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Resources/*
|
||||
@@ -41,20 +41,26 @@ class VerifyTinymceListener implements EventSubscriberInterface
|
||||
|
||||
public function verifyTinymce(Event $event)
|
||||
{
|
||||
if(false === file_exists(THELIA_WEB_DIR . '/tinymce')) {
|
||||
$fs = new Filesystem();
|
||||
|
||||
$fs = new Filesystem();
|
||||
if (false === file_exists(THELIA_WEB_DIR . '/tinymce')) {
|
||||
$fs->mirror(__DIR__ . '/../Resources/js/tinymce', THELIA_WEB_DIR . '/tinymce');
|
||||
}
|
||||
|
||||
if (false === file_exists(THELIA_WEB_DIR . '/media')) {
|
||||
$fs->symlink(__DIR__ . '/../Resources/media', THELIA_WEB_DIR . '/media');
|
||||
}
|
||||
}
|
||||
|
||||
public function clearCache(CacheEvent $event)
|
||||
{
|
||||
$fs = new Filesystem();
|
||||
if (true === file_exists(THELIA_WEB_DIR . '/tinymce')) {
|
||||
echo "toto";
|
||||
$fs = new Filesystem();
|
||||
|
||||
$directory = new \DirectoryIterator(THELIA_WEB_DIR . '/tinymce');
|
||||
$directory = new \DirectoryIterator(THELIA_WEB_DIR . '/tinymce');
|
||||
|
||||
$fs->remove($directory);
|
||||
$fs->remove($directory);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,7 +87,7 @@ class VerifyTinymceListener implements EventSubscriberInterface
|
||||
{
|
||||
return array(
|
||||
TheliaEvents::BOOT => array('verifyTinymce', 128),
|
||||
TheliaEvents::CACHE_CLEAR => array("clearCache", 128)
|
||||
TheliaEvents::CACHE_CLEAR => array("clearCache", 0)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -61,9 +61,9 @@ if (false === $isGranted) {
|
||||
|
||||
$base_url=rtrim(\Thelia\Model\ConfigQuery::read('url_site'), '/'); // base url (only domain) of site (without final /). If you prefer relative urls leave empty
|
||||
$upload_dir = '/media/'; // path from base_url to base of upload folder (with start and final /)
|
||||
$current_path = '../source/'; // relative path from filemanager folder to upload folder (with final /)
|
||||
$current_path = '../../../media/'; // relative path from filemanager folder to upload folder (with final /)
|
||||
//thumbs folder can't put inside upload folder
|
||||
$thumbs_base_path = '../thumbs/'; // relative path from filemanager folder to thumbs folder (with final /)
|
||||
$thumbs_base_path = '../../../media/'; // relative path from filemanager folder to thumbs folder (with final /)
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// YOU CAN COPY AND CHANGE THESE VARIABLES IN FOLDERS config.php FILES
|
||||
|
||||
0
local/modules/Tinymce/Resources/media/.gitkeep
Normal file → Executable file
0
local/modules/Tinymce/Resources/media/.gitkeep
Normal file → Executable file
@@ -38,5 +38,6 @@ class Tinymce extends BaseModule
|
||||
$fs = new Filesystem();
|
||||
|
||||
$fs->mirror(__DIR__ . '/Resources/js/tinymce', THELIA_WEB_DIR . '/tinymce');
|
||||
$fs->symlink(__DIR__ . 'Resource/media', THELIA_WEB_DIR . '/media');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user