Skip to content

Commit

Permalink
Fix media upload, Rewrite some module parts, Change License, update f…
Browse files Browse the repository at this point in the history
…ile composer.json
  • Loading branch information
Danilo Argentiero committed Mar 27, 2019
1 parent a4c728b commit f481661
Show file tree
Hide file tree
Showing 24 changed files with 311 additions and 608 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# Created by .ignore support plugin (hsz.mobi)
.idea
44 changes: 16 additions & 28 deletions Api/ContentInterface.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
<?php
/**
* MageSpecialist
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category MSP
* @package MSP_CmsImportExport
* @copyright Copyright (c) 2017 Skeeller srl (http://www.magespecialist.it)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* Copyright © MageSpecialist - Skeeller srl. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace MSP\CmsImportExport\Api;

/**
Expand All @@ -39,85 +27,85 @@ interface ContentInterface
* @param $mode
* @return ContentInterface
*/
public function setCmsMode($mode);
public function setCmsMode($mode): ContentInterface;

/**
* Set media mode on import
* @param $mode
* @return ContentInterface
*/
public function setMediaMode($mode);
public function setMediaMode($mode): ContentInterface;

/**
* Set stores mapping on import
* @param array $storesMap
* @return ContentInterface
*/
public function setStoresMap(array $storesMap);
public function setStoresMap(array $storesMap): ContentInterface;

/**
* Return CMS block to array
* @param \Magento\Cms\Api\Data\BlockInterface $blockInterface
* @return array
*/
public function blockToArray(\Magento\Cms\Api\Data\BlockInterface $blockInterface);
public function blockToArray(\Magento\Cms\Api\Data\BlockInterface $blockInterface): array ;

/**
* Return CMS page to array
* @param \Magento\Cms\Api\Data\PageInterface $pageInterface
* @return array
*/
public function pageToArray(\Magento\Cms\Api\Data\PageInterface $pageInterface);
public function pageToArray(\Magento\Cms\Api\Data\PageInterface $pageInterface): array;

/**
* Return CMS blocks as array
* @param \Magento\Cms\Api\Data\BlockInterface[] $blockInterfaces
* @return array
*/
public function blocksToArray(array $blockInterfaces);
public function blocksToArray(array $blockInterfaces): array;

/**
* Return CMS pages as array
* @param \Magento\Cms\Api\Data\PageInterface[] $pageInterfaces
* @return array
*/
public function pagesToArray(array $pageInterfaces);
public function pagesToArray(array $pageInterfaces): array;

/**
* Create a zip file and return its name
* @param \Magento\Cms\Api\Data\PageInterface[] $pageInterfaces
* @param \Magento\Cms\Api\Data\BlockInterface[] $blockInterfaces
* @return string
*/
public function asZipFile(array $pageInterfaces, array $blockInterfaces);
public function asZipFile(array $pageInterfaces, array $blockInterfaces): string;

/**
* Import a single page from an array and return false on error and true on success
* @param array $pageData
* @return bool
*/
public function importPageFromArray(array $pageData);
public function importPageFromArray(array $pageData): bool;

/**
* Import a single block from an array and return false on error and true on success
* @param array $blockData
* @return bool
*/
public function importBlockFromArray(array $blockData);
public function importBlockFromArray(array $blockData): bool;

/**
* Import contents from array and return number of imported records (-1 on error)
* @param array $payload
* @param string $archivePath = null
* @return int
*/
public function importFromArray(array $payload, $archivePath = null);
public function importFromArray(array $payload, $archivePath = null): int;

/**
* Import contents from zip archive and return number of imported records (-1 on error)
* @param string $fileName
* @param bool $rm = true
* @return int
*/
public function importFromZipFile($fileName, $rm = false);
public function importFromZipFile($fileName, $rm = false): int;
}
20 changes: 3 additions & 17 deletions Block/Adminhtml/Import.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
<?php
/**
* MageSpecialist
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category MSP
* @package MSP_CmsImportExport
* @copyright Copyright (c) 2017 Skeeller srl (http://www.magespecialist.it)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* Copyright © MageSpecialist - Skeeller srl. All rights reserved.
* See COPYING.txt for license details.
*/

namespace MSP\CmsImportExport\Block\Adminhtml;
Expand All @@ -38,7 +24,7 @@ protected function _construct()
$this->buttonList->update('save', 'label', __('Import'));
}

public function getHeaderText()
public function getHeaderText(): string
{
return __('Import CMS');
}
Expand Down
18 changes: 2 additions & 16 deletions Block/Adminhtml/Import/Upload/Form.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
<?php
/**
* MageSpecialist
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category MSP
* @package MSP_CmsImportExport
* @copyright Copyright (c) 2017 Skeeller srl (http://www.magespecialist.it)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* Copyright © MageSpecialist - Skeeller srl. All rights reserved.
* See COPYING.txt for license details.
*/

namespace MSP\CmsImportExport\Block\Adminhtml\Import\Upload;
Expand Down
5 changes: 5 additions & 0 deletions COPYNG.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Copyright © 2018-present Skeeller srl - MageSpecialist.

Each source file included in this module is licensed under OSL 3.0 .

http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0).
20 changes: 4 additions & 16 deletions Command/ImportPage.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
<?php
/**
* MageSpecialist
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category MSP
* @package MSP_CmsImportExport
* @copyright Copyright (c) 2017 Skeeller srl (http://www.magespecialist.it)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* Copyright © MageSpecialist - Skeeller srl. All rights reserved.
* See COPYING.txt for license details.
*/

namespace MSP\CmsImportExport\Command;
Expand All @@ -29,7 +15,9 @@

class ImportPage extends Command
{

protected $pageInterface;

/**
* @var ObjectManagerInterface
*/
Expand Down
18 changes: 2 additions & 16 deletions Controller/Adminhtml/Block/MassExport.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
<?php
/**
* MageSpecialist
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category MSP
* @package MSP_CmsImportExport
* @copyright Copyright (c) 2017 Skeeller srl (http://www.magespecialist.it)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* Copyright © MageSpecialist - Skeeller srl. All rights reserved.
* See COPYING.txt for license details.
*/

namespace MSP\CmsImportExport\Controller\Adminhtml\Block;
Expand Down
18 changes: 2 additions & 16 deletions Controller/Adminhtml/Import/Index.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
<?php
/**
* MageSpecialist
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category MSP
* @package MSP_CmsImportExport
* @copyright Copyright (c) 2017 Skeeller srl (http://www.magespecialist.it)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* Copyright © MageSpecialist - Skeeller srl. All rights reserved.
* See COPYING.txt for license details.
*/

namespace MSP\CmsImportExport\Controller\Adminhtml\Import;
Expand Down
18 changes: 2 additions & 16 deletions Controller/Adminhtml/Import/Post.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
<?php
/**
* MageSpecialist
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category MSP
* @package MSP_CmsImportExport
* @copyright Copyright (c) 2017 Skeeller srl (http://www.magespecialist.it)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* Copyright © MageSpecialist - Skeeller srl. All rights reserved.
* See COPYING.txt for license details.
*/

namespace MSP\CmsImportExport\Controller\Adminhtml\Import;
Expand Down
18 changes: 2 additions & 16 deletions Controller/Adminhtml/Page/MassExport.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
<?php
/**
* MageSpecialist
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category MSP
* @package MSP_CmsImportExport
* @copyright Copyright (c) 2017 Skeeller srl (http://www.magespecialist.it)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* Copyright © MageSpecialist - Skeeller srl. All rights reserved.
* See COPYING.txt for license details.
*/

namespace MSP\CmsImportExport\Controller\Adminhtml\Page;
Expand Down
Loading

0 comments on commit f481661

Please sign in to comment.