fix file manager integration
This commit is contained in:
parent
56a7f1a67f
commit
6d7280ef92
@ -30,7 +30,6 @@ use O3\TinyMCE\Application\Core\TinyMCE\Options\ContextMenu;
|
|||||||
use O3\TinyMCE\Application\Core\TinyMCE\Options\DocumentBaseUrl;
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\DocumentBaseUrl;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Options\EntityEncoding;
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\EntityEncoding;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Options\ExternalPlugins;
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\ExternalPlugins;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Options\FilePickerCallback;
|
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Options\FilemanagerUrl;
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\FilemanagerUrl;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Options\ImageAdvtab;
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\ImageAdvtab;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Options\Language;
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\Language;
|
||||||
@ -159,7 +158,6 @@ class Configuration
|
|||||||
$this->addOption(oxNew( Plugins::class, $this->loader));
|
$this->addOption(oxNew( Plugins::class, $this->loader));
|
||||||
$this->addOption(oxNew( ExternalPlugins::class, $this->loader));
|
$this->addOption(oxNew( ExternalPlugins::class, $this->loader));
|
||||||
$this->addOption(oxNew( FilemanagerUrl::class, $this->loader));
|
$this->addOption(oxNew( FilemanagerUrl::class, $this->loader));
|
||||||
$this->addOption(oxNew( FilePickerCallback::class, $this->loader));
|
|
||||||
$this->addOption(oxNew(QuickbarsInsertToolbar::class, $this->loader));
|
$this->addOption(oxNew(QuickbarsInsertToolbar::class, $this->loader));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,43 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This file is part of O3-Shop TinyMCE editor module.
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, version 3.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* General Public License for more details.
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with O3-Shop. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
*
|
|
||||||
* @copyright Copyright (c) 2022 OXID Marat Bedoev, bestlife AG
|
|
||||||
* @copyright Copyright (c) 2023 O3-Shop (https://www.o3-shop.com)
|
|
||||||
* @license https://www.gnu.org/licenses/gpl-3.0 GNU General Public License 3 (GPLv3)
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace O3\TinyMCE\Application\Core\TinyMCE\Options;
|
|
||||||
|
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Loader;
|
|
||||||
|
|
||||||
class FilePickerCallback extends AbstractOption
|
|
||||||
{
|
|
||||||
protected string $key = 'file_picker_callback';
|
|
||||||
|
|
||||||
protected Loader $loader;
|
|
||||||
|
|
||||||
public function get(): string
|
|
||||||
{
|
|
||||||
return 'RoxyFileBrowser';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function requireRegistration(): bool
|
|
||||||
{
|
|
||||||
return (bool) $this->loader->getShopConfig()->getConfigParam("blTinyMCE_filemanager");
|
|
||||||
}
|
|
||||||
}
|
|
@ -41,7 +41,7 @@ class FilemanagerUrl extends AbstractOption
|
|||||||
return str_replace(
|
return str_replace(
|
||||||
'&',
|
'&',
|
||||||
'&',
|
'&',
|
||||||
Registry::getConfig()->getActiveView()->getViewConfig()->getSslSelfLink()."cl=tinyfilemanager&input=form-field_3980235013121680647721848"
|
Registry::getConfig()->getActiveView()->getViewConfig()->getSslSelfLink()."cl=tinyfilemanager"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
"PREVIEW_THUMB_HEIGHT": "100",
|
"PREVIEW_THUMB_HEIGHT": "100",
|
||||||
"MAX_IMAGE_WIDTH": "2000",
|
"MAX_IMAGE_WIDTH": "2000",
|
||||||
"MAX_IMAGE_HEIGHT": "2000",
|
"MAX_IMAGE_HEIGHT": "2000",
|
||||||
"INTEGRATION": "tinymce4",
|
"INTEGRATION": "custom",
|
||||||
"DIRLIST": "php/dirtree.php",
|
"DIRLIST": "php/dirtree.php",
|
||||||
"CREATEDIR": "php/createdir.php",
|
"CREATEDIR": "php/createdir.php",
|
||||||
"DELETEDIR": "php/deletedir.php",
|
"DELETEDIR": "php/deletedir.php",
|
||||||
|
@ -33,8 +33,12 @@ function FileSelected(file){
|
|||||||
* height - if the file is image, this will be the height of the original image, 0 otherwise
|
* height - if the file is image, this will be the height of the original image, 0 otherwise
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
alert('"' + file.fullPath + "\" selected.\n To integrate with CKEditor or TinyMCE change INTEGRATION setting in conf.json. For more details see the Installation instructions at http://www.roxyfileman.com/install.");
|
window.parent.postMessage({
|
||||||
|
mceAction: 'FileSelected',
|
||||||
|
content: file.fullPath
|
||||||
|
}, '*');
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetSelectedValue(){
|
function GetSelectedValue(){
|
||||||
/**
|
/**
|
||||||
* This function is called to retrieve selected value when custom integration is used.
|
* This function is called to retrieve selected value when custom integration is used.
|
||||||
|
@ -1,35 +1,32 @@
|
|||||||
/**
|
/**
|
||||||
* vanilla-thunder/oxid-module-tinymce
|
* This file is part of O3-Shop TinyMCE editor module.
|
||||||
* TinyMCE 5 Integration for OXID eShop V6.2
|
|
||||||
*
|
*
|
||||||
* This program is free software;
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
|
* it under the terms of the GNU General Public License as published by
|
||||||
* either version 3 of the License, or (at your option) any later version.
|
* the Free Software Foundation, version 3.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with O3-Shop. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2022 OXID Marat Bedoev, bestlife AG
|
||||||
|
* @copyright Copyright (c) 2023 O3-Shop (https://www.o3-shop.com)
|
||||||
|
* @license https://www.gnu.org/licenses/gpl-3.0 GNU General Public License 3 (GPLv3)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global tinymce:true */
|
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
const PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||||
PluginManager.add('roxy', function (editor) {
|
PluginManager.add('roxy', function (editor) {
|
||||||
|
|
||||||
editor.settings.file_picker_callback = function ($callback, $value, $meta) {
|
editor.settings.file_picker_callback = function ($callback, $value, $meta) {
|
||||||
console.log($callback);
|
|
||||||
console.log($value);
|
|
||||||
console.log($meta);
|
|
||||||
//var selectedimage =
|
|
||||||
|
|
||||||
var url = editor.settings.filemanager_url
|
var url = editor.settings.filemanager_url
|
||||||
+ "&type=" + $meta.filetype
|
+ "&type=" + $meta.filetype
|
||||||
+ '&value=' + $value
|
+ '&value=' + $value
|
||||||
+ '&selected=' + $value;
|
+ '&selected=' + $value;
|
||||||
|
|
||||||
|
|
||||||
if (editor.settings.language) {
|
if (editor.settings.language) {
|
||||||
url += '&langCode=' + editor.settings.language;
|
url += '&langCode=' + editor.settings.language;
|
||||||
}
|
}
|
||||||
@ -37,14 +34,16 @@
|
|||||||
url += '&akey=' + editor.settings.filemanager_access_key;
|
url += '&akey=' + editor.settings.filemanager_access_key;
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.windowManager.openUrl({
|
const instanceApi = editor.windowManager.openUrl({
|
||||||
title: 'Filemanager',
|
title: 'Filemanager',
|
||||||
url: url,
|
url: url,
|
||||||
width: window.innerWidth,
|
width: window.innerWidth,
|
||||||
height: window.innerHeight - 40
|
height: window.innerHeight - 40,
|
||||||
|
onMessage: function(dialogApi, details) {
|
||||||
|
$callback(details.content);
|
||||||
|
instanceApi.close();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//$callback('myimage.jpg', {alt: 'My alt text'});
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}());
|
}());
|
Loading…
Reference in New Issue
Block a user