Wordpress.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Copyright © 2016 Ihor Vansach (ihor@magefan.com). All rights reserved.
  4. * See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).
  5. *
  6. * Glory to Ukraine! Glory to the heroes!
  7. */
  8. namespace Magefan\Blog\Controller\Adminhtml\Import;
  9. /**
  10. * Blog prepare wordpress import controller
  11. */
  12. class Wordpress extends \Magento\Backend\App\Action
  13. {
  14. /**
  15. * Prepare wordpress import
  16. * @return \Magento\Framework\Controller\ResultInterface
  17. */
  18. public function execute()
  19. {
  20. $this->_view->loadLayout();
  21. $this->_setActiveMenu('Magefan_Blog::import');
  22. $title = __('Blog Import from WordPress (beta)');
  23. $this->_view->getPage()->getConfig()->getTitle()->prepend($title);
  24. $this->_addBreadcrumb($title, $title);
  25. $config = new \Magento\Framework\DataObject(
  26. (array)$this->_getSession()->getData('import_wordpress_form_data', true) ?: []
  27. );
  28. $this->_objectManager->get('\Magento\Framework\Registry')->register('import_config', $config);
  29. $this->_view->renderLayout();
  30. }
  31. /**
  32. * Check is allowed access
  33. *
  34. * @return bool
  35. */
  36. protected function _isAllowed()
  37. {
  38. return $this->_authorization->isAllowed('Magefan_Blog::import');
  39. }
  40. }