| 1 |
<?php |
| 2 |
|
| 3 |
namespace BitCode\BitForm\Frontend\Form\View\Theme\Fields; |
| 4 |
|
| 5 |
class MollieField |
| 6 |
{ |
| 7 |
public static function init($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error = null, $value = null) |
| 8 |
{ |
| 9 |
$inputWrapper = new ClassicInputWrapper($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error, $value); |
| 10 |
$input = self::field($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error, $value); |
| 11 |
return $inputWrapper->wrapper($input, true); |
| 12 |
} |
| 13 |
|
| 14 |
private static function field($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error = null, $value = null) |
| 15 |
{ |
| 16 |
$fieldHelpers = new ClassicFieldHelpers($field, $rowID, $form_atomic_Cls_map); |
| 17 |
|
| 18 |
return sprintf( |
| 19 |
'<div class="%1$s"> |
| 20 |
<button type="button" class="%2$s"> |
| 21 |
<svg |
| 22 |
version="1.1" |
| 23 |
id="Layer_1" |
| 24 |
xmlns="http://www.w3.org/2000/svg" |
| 25 |
xmlns:xlink="http://www.w3.org/1999/xlink" |
| 26 |
x="0px" |
| 27 |
y="0px" |
| 28 |
viewBox="0 0 80 80" |
| 29 |
xmlSpace="preserve" |
| 30 |
class="%3$s" |
| 31 |
> |
| 32 |
<path |
| 33 |
stroke-width="6" |
| 34 |
fill="currentColor" |
| 35 |
d="M74.79,39.15v21.4c0,0.36-0.07,0.46-0.44,0.46c-3.59-0.02-7.21-0.02-10.8,0c-0.41,0-0.51-0.1-0.51-0.51 c0.02-6.94,0-13.86,0.02-20.79c0-2.89-0.97-5.31-3.25-7.09c-2.62-2.06-5.56-2.5-8.64-1.21c-3.03,1.26-4.76,3.62-5.24,6.89 c-0.05,0.49-0.07,0.99-0.07,1.48c0,6.89,0,13.78,0.02,20.7c0,0.41-0.1,0.53-0.53,0.53c-3.57-0.02-7.16-0.02-10.75,0 c-0.36,0-0.46-0.1-0.46-0.49V39.73c0.02-2.89-0.97-5.34-3.28-7.13c-2.62-2.04-5.56-2.48-8.61-1.19c-3.03,1.26-4.76,3.62-5.22,6.87 c-0.07,0.51-0.07,1.02-0.07,1.53c0,6.89-0.02,13.81,0,20.7c0,0.41-0.1,0.51-0.51,0.51c-3.59-0.02-7.18-0.02-10.77,0 c-0.36,0-0.46-0.1-0.46-0.46c0.02-7.3-0.05-14.61,0.05-21.94c0.05-4.97,1.89-9.37,5.29-13.01c4.54-4.9,10.19-7.09,16.86-6.53 c4.76,0.39,8.83,2.35,12.28,5.63c0.24,0.24,0.36,0.24,0.61,0c4.78-4.46,10.41-6.38,16.91-5.53c8.83,1.14,15.8,7.93,17.28,16.72 C74.69,36.99,74.79,38.06,74.79,39.15z" |
| 36 |
/> |
| 37 |
</svg> |
| 38 |
%4$s |
| 39 |
<svg |
| 40 |
width="20" |
| 41 |
height="20" |
| 42 |
class="mollie-btn-spinner d-none" |
| 43 |
version="1.1" |
| 44 |
id="L9" |
| 45 |
xmlns="http://www.w3.org/2000/svg" |
| 46 |
xmlns:xlink="http://www.w3.org/1999/xlink" |
| 47 |
x="0px" |
| 48 |
y="0px" |
| 49 |
viewBox="20 20 60 60" |
| 50 |
enable-background="new 0 0 0 0" |
| 51 |
xml:space="preserve" |
| 52 |
> |
| 53 |
<path |
| 54 |
fill="#fff" |
| 55 |
d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50" |
| 56 |
> |
| 57 |
<animateTransform |
| 58 |
attributeName="transform" |
| 59 |
attributeType="XML" |
| 60 |
type="rotate" |
| 61 |
dur="1s" |
| 62 |
from="0 50 50" |
| 63 |
to="360 50 50" |
| 64 |
repeatCount="indefinite" |
| 65 |
/> |
| 66 |
</path> |
| 67 |
</svg> |
| 68 |
</button> |
| 69 |
</div>', |
| 70 |
$fieldHelpers->getAtomicCls('mollie-wrp'), |
| 71 |
$fieldHelpers->getAtomicCls('mollie-btn'), |
| 72 |
$fieldHelpers->getAtomicCls('mollie-icn'), |
| 73 |
$fieldHelpers->kses_post($field->txt) |
| 74 |
); |
| 75 |
} |
| 76 |
} |
| 77 |
|