You are here

public static function WebformSubmissionController::buildLocked in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Controller/WebformSubmissionController.php \Drupal\webform\Controller\WebformSubmissionController::buildLocked()

Build locked icon.

Parameters

\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.

Return value

\Drupal\Component\Render\FormattableMarkup Locked icon.

2 calls to WebformSubmissionController::buildLocked()
WebformSubmissionController::locked in src/Controller/WebformSubmissionController.php
Toggle webform submission locked.
WebformSubmissionListBuilder::buildRowColumn in src/WebformSubmissionListBuilder.php
Build row column.

File

src/Controller/WebformSubmissionController.php, line 155

Class

WebformSubmissionController
Provides route responses for Webform submissions.

Namespace

Drupal\webform\Controller

Code

public static function buildLocked(WebformSubmissionInterface $webform_submission) {
  $t_args = [
    '@label' => $webform_submission
      ->label(),
  ];
  $args = [
    '@state' => $webform_submission
      ->isLocked() ? 'on' : 'off',
    '@label' => $webform_submission
      ->isLocked() ? t('Unlock @label', $t_args) : t('Lock @label', $t_args),
  ];
  return new FormattableMarkup('<span class="webform-icon webform-icon-lock webform-icon-locked--@state"></span><span class="visually-hidden">@label</span>', $args);
}