Skip to content

Commit

Permalink
Merge pull request #18 from zans-laksa/2917-ltr-rtl-switch
Browse files Browse the repository at this point in the history
LTR / RTL Switch BE
  • Loading branch information
carinadues authored Jul 20, 2021
2 parents c9e9fb6 + 1bbcb20 commit 517d8a5
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/Model/LayoutDirection/Source/LayoutDirection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
/**
* @category ScandiPWA
* @package ScandiPWA\Customization
* @copyright Copyright (c) 2015 Scandiweb, Ltd (http://scandiweb.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

namespace ScandiPWA\Customization\Model\LayoutDirection\Source;

use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource;
use Magento\Framework\Exception\NoSuchEntityException;

/**
* Class LayoutDirection
* @package ScandiPWA\Customization\Model\LayoutDirection\Source
*/
class LayoutDirection extends AbstractSource
{
/**
* Retrieve All options
*
* @return array
* @throws NoSuchEntityException
*/
public function getAllOptions()
{
return [
['value' => 'ltr', 'label' => __('LTR')],
['value' => 'rtl', 'label' => __('RTL')]
];
}
}
1 change: 1 addition & 0 deletions src/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
<include path="ScandiPWA_Customization::system/colors.xml"/>
<include path="ScandiPWA_Customization::system/content.xml"/>
<include path="ScandiPWA_Customization::system/webmanifest.xml"/>
<include path="ScandiPWA_Customization::system/layout-direction.xml"/>
</system>
</config>
26 changes: 26 additions & 0 deletions src/etc/adminhtml/system/layout-direction.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<!--
/**
* @category ScandiPWA
* @package ScandiPWA\Customization
* @copyright Copyright (c) 2015 Scandiweb, Ltd (http://scandiweb.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
-->
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
<section id="layout_direction_configuration" translate="label" type="text" sortOrder="1000" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Layout direction</label>
<tab>scandipwa</tab>
<resource>ScandiPWA_Customization::scandipwa_config</resource>

<group id="layout_direction_section" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Layout Direction Configuration</label>
<comment>Determines layout direction for LTR and RTL languages</comment>

<field id="layout_direction" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Layout Direction</label>
<source_model>ScandiPWA\Customization\Model\LayoutDirection\Source\LayoutDirection</source_model>
</field>
</group>
</section>
</include>

0 comments on commit 517d8a5

Please sign in to comment.