Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #88 from mageplaza/2.4-develop
Browse files Browse the repository at this point in the history
2.4-develop
  • Loading branch information
Shinichi69 authored Nov 17, 2021
2 parents 29952d9 + cd8c5d2 commit 975a6f1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"liquid/liquid": "^1.4.8"
},
"type": "magento2-module",
"version": "4.1.1",
"version": "4.1.2",
"license": "proprietary",
"authors": [
{
Expand Down
26 changes: 14 additions & 12 deletions view/adminhtml/templates/hook/body.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
?>
<?php
/* @var $block \Mageplaza\WebHook\Block\Adminhtml\Hook\Edit\Tab\Renderer\Body */

use Mageplaza\Webhook\Helper\Data;
use Magento\Eav\Model\Entity\Attribute;
use Mageplaza\WebHook\Block\Adminhtml\Hook\Edit\Tab\Renderer\Body;

/* @var $block Body */
$element = $block->getElement();
$note = $element->getNote() ? '<div class="note">' . $element->getNote() . '</div>' : '';
$elementBeforeLabel = $element->getExtType() == 'checkbox' || $element->getExtType() == 'radio';
Expand All @@ -31,20 +34,19 @@ $fieldClass .= ($elementBeforeLabel) ? ' choice' : '';
$fieldClass .= ($addOn) ? ' with-addon' : '';
$fieldClass .= ($element->getRequired()) ? ' _required' : '';
$fieldClass .= ($note) ? ' with-note' : '';

$fieldAttributes = $fieldId . ' class="' . $fieldClass . '" ' . $block->getUiId('form-field', $element->getId());
$modifiersData = $block->getModifier() ? \Mageplaza\Webhook\Helper\Data::jsonEncode($block->getModifier()) : '{}';
$fieldAttributes = $fieldId . ' class="' . $fieldClass . '" ' . $block->getUiId('form-field', $element->getId());
$modifiersData = $block->getModifier() ? Data::jsonEncode($block->getModifier()) : '{}';
?>

<?php if (!$element->getNoDisplay()) : ?>
<?php if ($element->getType() == 'hidden') : ?>
<?= $element->getElementHtml() ?>
<?php else : ?>
<div<?= /** @noEscape */ $fieldAttributes ?>>
<div <?= /** @noEscape */ $fieldAttributes ?>>
<?php if ($elementBeforeLabel) : ?>
<?= $element->getElementHtml() ?>
<?= $element->getLabelHtml('', $element->getScopeLabel()) ?>
<?= $block->escapeHtml($note) ?>
<?= $note ?>
<?php else : ?>
<?= $element->getLabelHtml('', $element->getScopeLabel()) ?>
<div class="admin__field-control control">
Expand Down Expand Up @@ -77,7 +79,7 @@ $modifiersData = $block->getModifier() ? \Mageplaza\Webhook\Helper\Data::jsonE
<?= $addOn ? '<div class="addon">' . $element->getElementHtml()
. '</div>' : $element->getElementHtml(); ?>
<?= $block->getHintHtml() ?>
<?= $block->escapeHtml($note) ?>
<?= $note ?>
</div>
<div id="grid_tab_preview_content" style="border-top: 1px solid #adadad;"
aria-labelledby="grid_tab_body" class="ui-widget-content ui-corner-bottom"
Expand Down Expand Up @@ -113,7 +115,7 @@ $modifiersData = $block->getModifier() ? \Mageplaza\Webhook\Helper\Data::jsonE

<fieldset class="config admin__collapsible-block admin__scope-old" id="ox_variable_item">
<?php foreach ($attrCollection as $attr) : ?>
<?php /** @var \Magento\Eav\Model\Entity\Attribute $attr */ ?>
<?php /** @var Attribute $attr */ ?>
<div class="attr-code" id="<?= $block->escapeHtmlAttr($attr->getName()) ?>" code="<?= $block->escapeHtmlAttr($attr->getName()) ?>">
<div class="row">
<label class="attr-code-label"><?= $block->escapeHtml($attr->getTitle() . " ({$attr->getName()})") ?></label>
Expand All @@ -140,7 +142,7 @@ $modifiersData = $block->getModifier() ? \Mageplaza\Webhook\Helper\Data::jsonE

<fieldset class="config admin__collapsible-block admin__scope-old" id="ox_variable_shipping_address">
<?php foreach ($block->getShippingAddressAttrCollection() as $attr) : ?>
<?php /** @var \Magento\Eav\Model\Entity\Attribute $attr */ ?>
<?php /** @var Attribute $attr */ ?>
<div class="attr-code" id="<?= $block->escapeHtmlAttr($attr->getName()) ?>" code="<?= $block->escapeHtmlAttr($attr->getName()) ?>">
<div class="row">
<label class="attr-code-label"><?= $block->escapeHtml($attr->getTitle() . " ({$attr->getName()})") ?></label>
Expand All @@ -167,7 +169,7 @@ $modifiersData = $block->getModifier() ? \Mageplaza\Webhook\Helper\Data::jsonE

<fieldset class="config admin__collapsible-block admin__scope-old" id="ox_variable_shipping_address">
<?php foreach ($block->getShippingAddressAttrCollection() as $attr) : ?>
<?php /** @var \Magento\Eav\Model\Entity\Attribute $attr */ ?>
<?php /** @var Attribute $attr */ ?>
<div class="attr-code" id="<?= $block->escapeHtmlAttr($attr->getName()) ?>" code="<?= $block->escapeHtmlAttr($attr->getName()) ?>">
<div class="row">
<label class="attr-code-label"><?= $block->escapeHtml($attr->getTitle() . " ({$attr->getName()})") ?></label>
Expand Down

0 comments on commit 975a6f1

Please sign in to comment.