ltsecurityinc安防产品在线商城代码
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\TestModuleWysiwygConfig\Model;
|
||||
|
||||
class Config implements \Magento\Framework\Data\Wysiwyg\ConfigProviderInterface
|
||||
{
|
||||
/**
|
||||
* Configuration override for WYSIWYG height
|
||||
* @var string
|
||||
*/
|
||||
const CONFIG_HEIGHT = 'something_else';
|
||||
|
||||
/**
|
||||
* Configuration override for WYSIWYG content css
|
||||
* @var string
|
||||
*/
|
||||
const CONFIG_CONTENT_CSS = 'something_else.css';
|
||||
|
||||
/** @var \Magento\Cms\Model\Wysiwyg\DefaultConfigProvider */
|
||||
private $cmsConfigProvider;
|
||||
|
||||
/**
|
||||
* @param \Magento\Cms\Model\Wysiwyg\DefaultConfigProvider $cmsConfigProvider
|
||||
*/
|
||||
public function __construct(\Magento\Cms\Model\Wysiwyg\DefaultConfigProvider $cmsConfigProvider)
|
||||
{
|
||||
$this->cmsConfigProvider = $cmsConfigProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function getConfig(\Magento\Framework\DataObject $config): \Magento\Framework\DataObject
|
||||
{
|
||||
//get default config
|
||||
$config = $this->cmsConfigProvider->getConfig($config);
|
||||
|
||||
$config = $this->removeSpecialCharacterFromToolbar($config);
|
||||
|
||||
$config = $this->modifyHeightAndContentCss($config);
|
||||
return $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify height and content_css in the config
|
||||
*
|
||||
* @param \Magento\Framework\DataObject $config
|
||||
* @return \Magento\Framework\DataObject
|
||||
*/
|
||||
private function modifyHeightAndContentCss(\Magento\Framework\DataObject $config) : \Magento\Framework\DataObject
|
||||
{
|
||||
return $config->addData(
|
||||
[
|
||||
'height' => self::CONFIG_HEIGHT,
|
||||
'content_css' => self::CONFIG_CONTENT_CSS
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the special character from the toolbar configuration
|
||||
*
|
||||
* @param \Magento\Framework\DataObject $config
|
||||
* @return \Magento\Framework\DataObject
|
||||
*/
|
||||
private function removeSpecialCharacterFromToolbar(
|
||||
\Magento\Framework\DataObject $config
|
||||
) : \Magento\Framework\DataObject {
|
||||
$tinymce = $config->getData('tinymce');
|
||||
if (isset($tinymce['toolbar']) && isset($tinymce['plugins'])) {
|
||||
$toolbar = $tinymce['toolbar'];
|
||||
$plugins = $tinymce['plugins'];
|
||||
$tinymce['toolbar'] = str_replace('charmap', '', $toolbar);
|
||||
$tinymce['plugins'] = str_replace('charmap', '', $plugins);
|
||||
$config->setData('tinymce', $tinymce);
|
||||
}
|
||||
return $config;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
|
||||
<type name="Magento\Cms\Model\Wysiwyg\CompositeConfigProvider">
|
||||
<arguments>
|
||||
<argument name="wysiwygConfigPostProcessor" xsi:type="array">
|
||||
<item name="testAdapter" xsi:type="string">Magento\TestModuleWysiwygConfig\Model\Config</item>
|
||||
<item name="Magento_TestModuleWysiwygConfig/wysiwyg/tinymceTestAdapter" xsi:type="string">Magento\TestModuleWysiwygConfig\Model\Config</item>
|
||||
</argument>
|
||||
<argument name="variablePluginConfigProvider" xsi:type="array">
|
||||
<item name="testAdapter" xsi:type="string">Magento\Variable\Model\Variable\ConfigProvider</item>
|
||||
</argument>
|
||||
<argument name="widgetPluginConfigProvider" xsi:type="array">
|
||||
<item name="testAdapter" xsi:type="string">Magento\Widget\Model\Widget\Config</item>
|
||||
</argument>
|
||||
<argument name="galleryConfigProvider" xsi:type="array">
|
||||
<item name="testAdapter" xsi:type="string">Magento\Cms\Model\Wysiwyg\Gallery\DefaultConfigProvider</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
<type name="Magento\Cms\Model\Config\Source\Wysiwyg\Editor">
|
||||
<arguments>
|
||||
<argument name="adapterOptions" xsi:type="array">
|
||||
<item name="testAdapter" xsi:type="array">
|
||||
<item name="value" xsi:type="string">Magento_TestModuleWysiwygConfig/wysiwyg/tinymceTestAdapter</item>
|
||||
<item name="label" xsi:type="string" translatable="true">Test Adapter</item>
|
||||
</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
</config>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
|
||||
<type name="Magento\Ui\Block\Wysiwyg\ActiveEditor">
|
||||
<arguments>
|
||||
<argument name="availableAdapterPaths" xsi:type="array">
|
||||
<item name="Magento_TestModuleWysiwygConfig/wysiwyg/tinymceTestAdapter" xsi:type="string"/>
|
||||
</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
</config>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
|
||||
<module name="Magento_TestModuleWysiwygConfig" active="true">
|
||||
<sequence>
|
||||
<module name="Magento_Cms"/>
|
||||
</sequence>
|
||||
</module>
|
||||
</config>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
use Magento\Framework\Component\ComponentRegistrar;
|
||||
|
||||
$registrar = new ComponentRegistrar();
|
||||
if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestModuleWysiwygConfig') === null) {
|
||||
ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModuleWysiwygConfig', __DIR__);
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/* global popups, tinyMceEditors, MediabrowserUtility, Base64 */
|
||||
/* eslint-disable strict */
|
||||
define([
|
||||
'mage/adminhtml/wysiwyg/tiny_mce/tinymce5Adapter'
|
||||
], function (tinyMCE) {
|
||||
'use strict';
|
||||
|
||||
return tinyMCE;
|
||||
});
|
||||
Reference in New Issue
Block a user