403Webshell
Server IP : 172.67.158.161  /  Your IP : 3.137.223.189
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/home/giankuin/thietke365.net/wp-content/plugins/mailpoet/lib/WooCommerce/TransactionalEmails/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/home/giankuin/thietke365.net/wp-content/plugins/mailpoet/lib/WooCommerce/TransactionalEmails/ContentPreprocessor.php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

namespace MailPoet\WooCommerce\TransactionalEmails;

if (!defined('ABSPATH')) exit;


use MailPoet\Newsletter\Editor\LayoutHelper;
use MailPoet\WooCommerce\TransactionalEmails;

class ContentPreprocessor {
  public const WC_HEADING_PLACEHOLDER = '[mailpoet_woocommerce_heading_placeholder]';
  public const WC_CONTENT_PLACEHOLDER = '[mailpoet_woocommerce_content_placeholder]';

  public const WC_HEADING_BEFORE = '
    <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-spacing:0;mso-table-lspace:0;mso-table-rspace:0">
            <tr>
              <td class="mailpoet_text" valign="top" style="padding-top:20px;padding-bottom:20px;word-break:break-word;word-wrap:break-word;">';
  public const WC_HEADING_AFTER = '
        </td>
      </tr>
    </table>';

  /** @var TransactionalEmails */
  private $transactionalEmails;

  public function __construct(
    TransactionalEmails $transactionalEmails
  ) {
    $this->transactionalEmails = $transactionalEmails;
  }

  public function preprocessContent() {
    return $this->renderPlaceholderBlock(self::WC_CONTENT_PLACEHOLDER);
  }

  public function preprocessHeader() {
    $wcEmailSettings = $this->transactionalEmails->getWCEmailSettings();
    $content = self::WC_HEADING_BEFORE . '<h1 style="color:' . $wcEmailSettings['base_text_color'] . ';">' . self::WC_HEADING_PLACEHOLDER . '</h1>' . self::WC_HEADING_AFTER;
    return $this->renderTextBlock($content, ['backgroundColor' => $wcEmailSettings['base_color']]);
  }

  private function renderTextBlock(string $text, array $styles = []): array {
    return [
      LayoutHelper::row([
        LayoutHelper::col([[
          'type' => 'text',
          'text' => $text,
        ]]),
      ], $styles),
    ];
  }

  private function renderPlaceholderBlock(string $placeholder): array {
    return [
      LayoutHelper::row([
        LayoutHelper::col([[
          'type' => 'placeholder',
          'placeholder' => $placeholder,
        ]]),
      ]),
    ];
  }
}

Youez - 2016 - github.com/yon3zu
LinuXploit