| 1 |
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing |
| 2 |
|
| 3 |
namespace MailPoet\Form; |
| 4 |
|
| 5 |
if (!defined('ABSPATH')) exit; |
| 6 |
|
| 7 |
|
| 8 |
class PreviewWidget extends \WP_Widget { |
| 9 |
|
| 10 |
/** @var string */ |
| 11 |
private $formHtml; |
| 12 |
|
| 13 |
public function __construct( |
| 14 |
$formHtml |
| 15 |
) { |
| 16 |
$this->formHtml = $formHtml; |
| 17 |
parent::__construct( |
| 18 |
'mailpoet_form_preview', |
| 19 |
'Dummy form form preview', |
| 20 |
[] |
| 21 |
); |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* Output the widget itself. |
| 26 |
*/ |
| 27 |
public function widget($args, $instance = null) { |
| 28 |
// We control the html |
| 29 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 30 |
echo $this->formHtml; |
| 31 |
} |
| 32 |
} |
| 33 |
|