403Webshell
Server IP : 104.26.2.156  /  Your IP : 216.73.216.185
Web Server : nginx/1.27.1
System : Linux us-1 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User : vinodai ( 3134)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /storage/v1396/themastermynd/public_html/wp-content/plugins/mailpoet/lib/Form/Block/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /storage/v1396/themastermynd/public_html/wp-content/plugins/mailpoet/lib/Form/Block/Column.php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

namespace MailPoet\Form\Block;

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


use MailPoet\WP\Functions as WPFunctions;

class Column {
  /** @var WPFunctions */
  private $wp;

  public function __construct(
    WPFunctions $wp
  ) {
    $this->wp = $wp;
  }

  public function render(array $block, string $content): string {
    return "<div {$this->getClass($block['params'])}{$this->getStyles($block['params'])}>$content</div>";
  }

  private function getStyles(array $params): string {
    $styles = [];
    if (
      !empty($params['width']) &&
      (strlen($params['width']) > 0 && ctype_digit(substr($params['width'], 0, 1)))
    ) {
      $widthValue = $params['width'] . (is_numeric($params['width']) ? '%' : '');
      $styles[] = "flex-basis:{$widthValue}";
    }
    if (!empty($params['padding']) && is_array($params['padding'])) {
      $top = is_scalar($params['padding']['top'] ?? null) ? (string)$params['padding']['top'] : '0';
      $right = is_scalar($params['padding']['right'] ?? null) ? (string)$params['padding']['right'] : '0';
      $bottom = is_scalar($params['padding']['bottom'] ?? null) ? (string)$params['padding']['bottom'] : '0';
      $left = is_scalar($params['padding']['left'] ?? null) ? (string)$params['padding']['left'] : '0';
      $styles[] = "padding:{$top} {$right} {$bottom} {$left};";
    }
    if (!empty($params['text_color'])) {
      $styles[] = "color:{$params['text_color']};";
    }
    if (!empty($params['background_color'])) {
      $styles[] = "background-color:{$params['background_color']};";
    }
    if (!empty($params['gradient'])) {
      $styles[] = "background:{$params['gradient']};";
    }
    if (!count($styles)) {
      return '';
    }
    return ' style="' . $this->wp->escAttr(implode(';', $styles)) . ';"';
  }

  private function getClass(array $params): string {
    $classes = ['mailpoet_form_column'];
    if (!empty($params['vertical_alignment'])) {
      $classes[] = "mailpoet_vertically_align_{$params['vertical_alignment']}";
    }
    if (!empty($params['class_name'])) {
      $classes[] = $params['class_name'];
    }
    $classes = implode(' ', $classes);
    return "class=\"{$this->wp->escAttr($classes)}\"";
  }
}

Youez - 2016 - github.com/yon3zu
LinuXploit