You are here

public function HideDateTime::summary in Field Formatter Condition 8

Return the summary string.

Parameters

array $settings: The current settings array.

Overrides FieldFormatterConditionBase::summary

File

src/Plugin/Field/FieldFormatter/Condition/HideDateTime.php, line 93

Class

HideDateTime
The plugin for check empty fields.

Namespace

Drupal\fico\Plugin\Field\FieldFormatter\Condition

Code

public function summary($settings) {
  $orientations = array(
    'smaller' => t("smaller than today's date"),
    'greater' => t("greater than today's date"),
    'custom_small' => t("smaller then custom date"),
    'greater_small' => t("greater then custom date"),
  );
  if ($settings['settings']['orientation'] != 'smaller' && $settings['settings']['orientation'] != 'greater') {
    $display_date = ' - ' . $settings['settings']['cutom_date'];
  }
  else {
    $display_date = '';
  }
  return t('Condition: %condition (%orientation%date)', [
    "%condition" => t('Hide date/time'),
    '%orientation' => $orientations[$settings['settings']['orientation']],
    '%date' => $display_date,
  ]);
}