This repository has been archived by the owner on Feb 8, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from mageplaza/2.3-develop
2.3 develop
- Loading branch information
Showing
8 changed files
with
615 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
/** | ||
* Mageplaza | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Mageplaza.com license that is | ||
* available through the world-wide-web at this URL: | ||
* https://www.mageplaza.com/LICENSE.txt | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade this extension to newer | ||
* version in the future. | ||
* | ||
* @category Mageplaza | ||
* @package Mageplaza_Sitemap | ||
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) | ||
* @license https://www.mageplaza.com/LICENSE.txt | ||
*/ | ||
|
||
namespace Mageplaza\Sitemap\Model\Source; | ||
|
||
use Magento\Framework\Option\ArrayInterface; | ||
|
||
/** | ||
* Class DisplayType | ||
* @package Mageplaza\Sitemap\Model\Config\Source | ||
*/ | ||
class DisplayType implements ArrayInterface | ||
{ | ||
const LIST = 'list'; | ||
const DROPDOWN = 'dropdown'; | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function toOptionArray() | ||
{ | ||
$options = []; | ||
foreach ($this->toArray() as $value => $label) { | ||
$options[] = [ | ||
'value' => $value, | ||
'label' => $label | ||
]; | ||
} | ||
|
||
return $options; | ||
} | ||
|
||
/** | ||
* Get options in "key-value" format | ||
* | ||
* @return array | ||
*/ | ||
public function toArray() | ||
{ | ||
return [ | ||
self::LIST => __('List'), | ||
self::DROPDOWN => __('Dropdown'), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
/** | ||
* Mageplaza | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Mageplaza.com license that is | ||
* available through the world-wide-web at this URL: | ||
* https://www.mageplaza.com/LICENSE.txt | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade this extension to newer | ||
* version in the future. | ||
* | ||
* @category Mageplaza | ||
* @package Mageplaza_Sitemap | ||
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) | ||
* @license https://www.mageplaza.com/LICENSE.txt | ||
*/ | ||
|
||
namespace Mageplaza\Sitemap\Model\Source; | ||
|
||
use Magento\Framework\Option\ArrayInterface; | ||
|
||
/** | ||
* Class SortDirection | ||
* @package Mageplaza\Sitemap\Model\Config\Source | ||
*/ | ||
class SortDirection implements ArrayInterface | ||
{ | ||
const ASC = 'asc'; | ||
const DESC = 'desc'; | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function toOptionArray() | ||
{ | ||
$options = []; | ||
foreach ($this->toArray() as $value => $label) { | ||
$options[] = [ | ||
'value' => $value, | ||
'label' => $label | ||
]; | ||
} | ||
|
||
return $options; | ||
} | ||
|
||
/** | ||
* Get options in "key-value" format | ||
* | ||
* @return array | ||
*/ | ||
public function toArray() | ||
{ | ||
return [ | ||
self::ASC => __('Ascending'), | ||
self::DESC => __('Descending'), | ||
]; | ||
} | ||
} |
Oops, something went wrong.