11<?php
22/**
3- * Copyright © 2017 MagePal LLC. All rights reserved.
3+ * Copyright © MagePal LLC. All rights reserved.
44 * See COPYING.txt for license details.
55 */
66
77namespace MagePal \CheckoutSuccessMiscScript \Block \Adminhtml \System \Config \Form \Field ;
88
99use Magento \Config \Block \System \Config \Form \Field \FieldArray \AbstractFieldArray ;
10+
1011/**
1112 * Class Locations Backend system config array field renderer
1213 */
@@ -23,13 +24,11 @@ class MiscScript extends AbstractFieldArray
2324 */
2425 protected $ helper ;
2526
26-
2727 public function __construct (
2828 \Magento \Backend \Block \Template \Context $ context ,
2929 \MagePal \CheckoutSuccessMiscScript \Helper \Data $ helper ,
3030 array $ data = []
31- )
32- {
31+ ) {
3332 $ this ->helper = $ helper ;
3433 parent ::__construct ($ context , $ data );
3534 }
@@ -71,10 +70,11 @@ protected function _construct()
7170 parent ::_construct ();
7271 }
7372
74- public function getTemplateButtonList (){
73+ public function getTemplateButtonList ()
74+ {
7575 $ html = '' ;
7676
77- foreach ($ this ->helper ->getTemplateVariableKey () as $ key ){
77+ foreach ($ this ->helper ->getTemplateVariableKey () as $ key ) {
7878 $ html .= '<button style="margin:3px;" data-mage-init= \\\'{"checkoutSuccessMiscScript":{"textareaId":"<%- _id %>_scripts"}} \\\' type="button"> ' . $ key . '</button> ' ;
7979 }
8080
@@ -112,7 +112,7 @@ public function renderCellTemplate($columnName)
112112 $ inputName = $ this ->_getCellInputElementName ($ columnName );
113113
114114 if ($ column ['renderer ' ]) {
115- return str_replace (array ( "\n" , "\t" , "\r" ) , '' , $ column ['renderer ' ]->setInputName (
115+ return str_replace ([ "\n" , "\t" , "\r" ] , '' , $ column ['renderer ' ]->setInputName (
116116 $ inputName
117117 )->setInputId (
118118 $ this ->_getCellInputElementId ('<%- _id %> ' , $ columnName )
@@ -123,7 +123,7 @@ public function renderCellTemplate($columnName)
123123 )->toHtml ());
124124 }
125125
126- if ($ column ['type ' ] == 'text ' ){
126+ if ($ column ['type ' ] == 'text ' ) {
127127 return '<input type=" ' . $ column ['type ' ] . '" id=" ' . $ this ->_getCellInputElementId (
128128 '<%- _id %> ' ,
129129 $ columnName
@@ -143,8 +143,7 @@ public function renderCellTemplate($columnName)
143143 ) ? $ column ['class ' ] : 'input-text ' ) . '" ' . (isset (
144144 $ column ['style ' ]
145145 ) ? ' style=" ' . $ column ['style ' ] . '" ' : '' ) . '/> ' ;
146- }
147- else if ($ column ['type ' ] == 'checkbox ' ){
146+ } elseif ($ column ['type ' ] == 'checkbox ' ) {
148147 return '<input type=" ' . $ column ['type ' ] . '" id=" ' . $ this ->_getCellInputElementId (
149148 '<%- _id %> ' ,
150149 $ columnName
@@ -164,8 +163,7 @@ public function renderCellTemplate($columnName)
164163 ) ? $ column ['class ' ] : 'input-text ' ) . '" ' . (isset (
165164 $ column ['style ' ]
166165 ) ? ' style=" ' . $ column ['style ' ] . '" ' : '' ) . '/> ' ;
167- }
168- else {
166+ } else {
169167 return '<textarea id=" ' . $ this ->_getCellInputElementId (
170168 '<%- _id %> ' ,
171169 $ columnName
@@ -184,6 +182,5 @@ public function renderCellTemplate($columnName)
184182 $ column ['style ' ]
185183 ) ? ' style=" ' . $ column ['style ' ] . '" ' : '' ) . '><%- ' . $ columnName . ' %></textarea> ' ;
186184 }
187-
188185 }
189186}
0 commit comments