WysiwygPlugin.php 1022 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Variable\Controller\Adminhtml\System\Variable;
  8. /**
  9. * Retrieve variables list for WYSIWYG
  10. *
  11. * @api
  12. * @since 100.0.2
  13. */
  14. class WysiwygPlugin extends \Magento\Variable\Controller\Adminhtml\System\Variable
  15. {
  16. /**
  17. * WYSIWYG Plugin Action
  18. *
  19. * @return \Magento\Framework\Controller\Result\Json
  20. */
  21. public function execute()
  22. {
  23. $customVariables = $this->_objectManager->create(\Magento\Variable\Model\Variable::class)
  24. ->getVariablesOptionArray(true);
  25. $storeContactVariables = $this->_objectManager->create(
  26. \Magento\Variable\Model\Source\Variables::class
  27. )->toOptionArray(
  28. true
  29. );
  30. /** @var \Magento\Framework\Controller\Result\Json $resultJson */
  31. $resultJson = $this->resultJsonFactory->create();
  32. return $resultJson->setData([$storeContactVariables, $customVariables]);
  33. }
  34. }