Skip to content
Snippets Groups Projects
Select Git revision
  • 3f5bb7d9fc8bb1be2980db075124d3ce6044fef1
  • 11.x default protected
  • 11.2.x protected
  • 10.5.x protected
  • 10.6.x protected
  • 11.1.x protected
  • 10.4.x protected
  • 11.0.x protected
  • 10.3.x protected
  • 7.x protected
  • 10.2.x protected
  • 10.1.x protected
  • 9.5.x protected
  • 10.0.x protected
  • 9.4.x protected
  • 9.3.x protected
  • 9.2.x protected
  • 9.1.x protected
  • 8.9.x protected
  • 9.0.x protected
  • 8.8.x protected
  • 10.5.1 protected
  • 11.2.2 protected
  • 11.2.1 protected
  • 11.2.0 protected
  • 10.5.0 protected
  • 11.2.0-rc2 protected
  • 10.5.0-rc1 protected
  • 11.2.0-rc1 protected
  • 10.4.8 protected
  • 11.1.8 protected
  • 10.5.0-beta1 protected
  • 11.2.0-beta1 protected
  • 11.2.0-alpha1 protected
  • 10.4.7 protected
  • 11.1.7 protected
  • 10.4.6 protected
  • 11.1.6 protected
  • 10.3.14 protected
  • 10.4.5 protected
  • 11.0.13 protected
41 results

theme.inc

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    webform.tokens.inc 47.24 KiB
    <?php
    
    /**
     * @file
     * Builds placeholder replacement tokens for webforms and submissions.
     */
    
    use Drupal\Component\Utility\NestedArray;
    use Drupal\Component\Render\MarkupInterface;
    use Drupal\Core\Datetime\Entity\DateFormat;
    use Drupal\Core\Entity\EntityInterface;
    use Drupal\Core\Render\BubbleableMetadata;
    use Drupal\Core\Render\Markup;
    use Drupal\Core\Session\AccountInterface;
    use Drupal\Core\Url;
    use Drupal\user\Entity\User;
    use Drupal\webform\Element\WebformHtmlEditor;
    use Drupal\webform\Plugin\WebformElementManagerInterface;
    use Drupal\webform\Plugin\WebformElementEntityReferenceInterface;
    use Drupal\webform\Plugin\WebformElement\WebformComputedBase;
    use Drupal\webform\Plugin\WebformElement\WebformMarkupBase;
    use Drupal\webform\Utility\WebformDateHelper;
    use Drupal\webform\Utility\WebformHtmlHelper;
    use Drupal\webform\Utility\WebformLogicHelper;
    use Drupal\webform\WebformInterface;
    use Drupal\webform\WebformSubmissionInterface;
    
    /**
     * Implements hook_token_info().
     */
    function webform_token_info() {
      $types = [];
      $tokens = [];
    
      /****************************************************************************/
      // Webform submission.
      /****************************************************************************/
    
      $types['webform_submission'] = [
        'name' => t('Webform submissions'),
        'description' => t('Tokens related to webform submission.'),
        'needs-data' => 'webform_submission',
      ];
    
      $webform_submission = [];
      $webform_submission['serial'] = [
        'name' => t('Submission serial number'),
        'description' => t('The serial number of the webform submission.'),
      ];
      $webform_submission['sid'] = [
        'name' => t('Submission ID'),
        'description' => t('The ID of the webform submission.'),
      ];
      $webform_submission['uuid'] = [
        'name' => t('UUID'),
        'description' => t('The UUID of the webform submission.'),
      ];
      $webform_submission['token'] = [
        'name' => t('Token'),
        'description' => t('A secure token used to look up a submission.'),
      ];
      $webform_submission['ip-address'] = [
        'name' => t('IP address'),
        'description' => t('The IP address that was used when submitting the webform submission.'),
      ];
      $webform_submission['source-title'] = [
        'name' => t('Source URL'),
        'description' => t('The Title of the source entity or webform.'),
      ];
      $webform_submission['source-url'] = [