Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ActiveEditor.php
Go to the documentation of this file.
1 <?php
7 
11 
18 {
19  const DEFAULT_EDITOR_PATH = 'mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter';
20 
24  private $scopeConfig;
25 
29  private $availableAdapterPaths;
30 
38  public function __construct(
39  Context $context,
40  ScopeConfigInterface $scopeConfig,
41  $availableAdapterPaths = [],
42  array $data = []
43  ) {
44  parent::__construct($context, $data);
45  $this->scopeConfig = $scopeConfig;
46  $this->availableAdapterPaths = $availableAdapterPaths;
47  }
48 
54  public function getWysiwygAdapterPath()
55  {
56  $adapterPath = $this->scopeConfig->getValue(Model\Config::WYSIWYG_EDITOR_CONFIG_PATH);
57  if ($adapterPath !== self::DEFAULT_EDITOR_PATH && !isset($this->availableAdapterPaths[$adapterPath])) {
58  $adapterPath = self::DEFAULT_EDITOR_PATH;
59  }
60  return $this->escapeHtml($adapterPath);
61  }
62 }
const WYSIWYG_EDITOR_CONFIG_PATH
Definition: Config.php:16
__construct(Context $context, ScopeConfigInterface $scopeConfig, $availableAdapterPaths=[], array $data=[])