REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 4.19 KB
Close
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/lib/Form/Renderer.php
Text
Base64
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing namespace MailPoet\Form; if (!defined('ABSPATH')) exit; use MailPoet\Entities\FormEntity; use MailPoet\Form\Templates\FormTemplate; use MailPoet\Form\Util\CustomFonts; use MailPoet\Form\Util\Styles; use MailPoet\Settings\SettingsController; use MailPoet\Subscription\Captcha\CaptchaConstants; class Renderer { /** @var Styles */ private $styleUtils; /** @var SettingsController */ private $settings; /** @var BlocksRenderer */ private $blocksRenderer; /** @var CustomFonts */ private $customFonts; public function __construct( Styles $styleUtils, SettingsController $settings, CustomFonts $customFonts, BlocksRenderer $blocksRenderer ) { $this->styleUtils = $styleUtils; $this->settings = $settings; $this->blocksRenderer = $blocksRenderer; $this->customFonts = $customFonts; } public function renderStyles(FormEntity $form, string $prefix, string $displayType): string { $this->customFonts->enqueueStyle(); $html = $this->styleUtils->prefixStyles($this->getCustomStyles($form), $prefix); $html .= strip_tags($this->styleUtils->renderFormSettingsStyles($form, $prefix, $displayType)); return $html; } public function renderHTML(FormEntity $form = null): string { if (($form instanceof FormEntity) && !empty($form->getBody()) && is_array($form->getSettings())) { return $this->renderBlocks($form->getBody(), $form->getSettings() ?? [], $form->getId()); } return ''; } public function getCustomStyles(FormEntity $form = null): string { if (($form instanceof FormEntity) && (strlen(trim($form->getStyles() ?? '')) > 0)) { return strip_tags($form->getStyles() ?? ''); } else { return FormTemplate::DEFAULT_STYLES; } } public function renderBlocks( array $blocks = [], array $formSettings = [], ?int $formId = null, bool $honeypotEnabled = true, bool $captchaEnabled = true ): string { // add honeypot for spambots $html = ($honeypotEnabled) ? $this->renderHoneypot() : ''; foreach ($blocks as $key => $block) { if ( $captchaEnabled && $block['type'] === FormEntity::SUBMIT_BLOCK_TYPE && CaptchaConstants::isRecaptcha($this->settings->get('captcha.type')) ) { $html .= $this->renderReCaptcha(); } if (in_array($block['type'], [FormEntity::COLUMN_BLOCK_TYPE, FormEntity::COLUMNS_BLOCK_TYPE])) { $blocks = $block['body'] ?? []; $html .= $this->blocksRenderer->renderContainerBlock($block, $this->renderBlocks($blocks, $formSettings, $formId, false)) . PHP_EOL; } else { $html .= $this->blocksRenderer->renderBlock($block, $formSettings, $formId) . PHP_EOL; } } return $html; } private function renderHoneypot(): string { return '<label class="mailpoet_hp_email_label" style="display: none !important;">' . __('Please leave this field empty', 'mailpoet') . '<input type="email" name="data[email]"/></label>'; } private function renderReCaptcha(): string { if ($this->settings->get('captcha.type') === CaptchaConstants::TYPE_RECAPTCHA) { $siteKey = $this->settings->get('captcha.recaptcha_site_token'); $size = ''; } else { $siteKey = $this->settings->get('captcha.recaptcha_invisible_site_token'); $size = 'invisible'; } $html = '<div class="mailpoet_recaptcha" data-sitekey="' . $siteKey . '" ' . ($size === 'invisible' ? 'data-size="invisible"' : '') . '> <div class="mailpoet_recaptcha_container"></div> <noscript> <div> <div class="mailpoet_recaptcha_noscript_container"> <div> <iframe src="https://www.google.com/recaptcha/api/fallback?k=' . $siteKey . '" frameborder="0" scrolling="no"> </iframe> </div> </div> <div class="mailpoet_recaptcha_noscript_input"> <textarea id="g-recaptcha-response" name="data[recaptcha]" class="g-recaptcha-response"> </textarea> </div> </div> </noscript> <input class="mailpoet_recaptcha_field" type="hidden" name="recaptchaWidgetId"> </div>'; return $html; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 4 × Files: 15
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Block
DIR
-
drwxr-xr-x
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Listing
DIR
-
drwxr-xr-x
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Templates
DIR
-
drwxr-xr-x
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Util
DIR
-
drwxr-xr-x
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ApiDataSanitizer.php
1.91 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
AssetsController.php
6.09 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
BlocksRenderer.php
4.18 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
BlockStylesRenderer.php
4.04 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
BlockWrapperRenderer.php
642 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DisplayFormInWPContent.php
10.86 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
FormHtmlSanitizer.php
1.26 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
FormMessageController.php
1.61 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
FormSaveController.php
1.16 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
FormsRepository.php
2.61 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.php
0 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PreviewPage.php
4.03 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PreviewWidget.php
726 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Renderer.php
4.19 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Widget.php
9.12 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).