' . esc_html($text !== '' ? $text : __('No data yet.', 'blyzer-events')) . '';
}
private static function crest(string $logo, string $initials, string $size = '28', string $class = 'bze-crest'): string
{
return '{{#' . $logo . '}}{{/' . $logo . '}}'
. '{{^' . $logo . '}}{{/' . $logo . '}}';
}
private static function teamCell(string $logo, string $initials, string $url, string $title): string
{
return '' . self::crest($logo, $initials)
. '{{#' . $url . '}}{{' . $title . '}}{{/' . $url . '}}{{^' . $url . '}}{{' . $title . '}}{{/' . $url . '}}';
}
private static function abbr(string $short, string $long): string
{
return '' . esc_html($short) . '';
}
private static function duel(): string
{
$side = '
' . esc_html__('Organised by', 'blyzer-events') . ' {{organizer}}
{{/organizer}}' . '| # | ' . '' . $team . ' | ' . '' . self::abbr(_x('P', 'played', 'blyzer-events'), __('Played', 'blyzer-events')) . ' | ' . '' . self::abbr(_x('W', 'wins', 'blyzer-events'), __('Wins', 'blyzer-events')) . ' | ' . '{{#showExtra}}' . self::abbr(_x('OTW', 'wins after overtime', 'blyzer-events'), __('Wins after overtime', 'blyzer-events')) . ' | {{/showExtra}}' . '' . self::abbr(_x('D', 'draws', 'blyzer-events'), __('Draws', 'blyzer-events')) . ' | ' . '{{#showExtra}}' . self::abbr(_x('OTL', 'losses after overtime', 'blyzer-events'), __('Losses after overtime', 'blyzer-events')) . ' | {{/showExtra}}' . '' . self::abbr(_x('L', 'losses', 'blyzer-events'), __('Losses', 'blyzer-events')) . ' | ' . '' . esc_html__('Score', 'blyzer-events') . ' | ' . '{{#showDiff}}' . self::abbr('+/−', __('Goal difference', 'blyzer-events')) . ' | {{/showDiff}}' . '' . self::abbr(_x('Pts', 'points', 'blyzer-events'), __('Points', 'blyzer-events')) . ' | ' . '{{#showForm}}' . esc_html__('Form', 'blyzer-events') . ' | {{/showForm}}' . '
|---|---|---|---|---|---|---|---|---|---|---|---|
| {{position}} | ' . '' . self::teamCell('teamLogo', 'initials', 'teamUrl', 'teamTitle') . ' | ' . '{{played}} | {{wins}} | {{#showExtra}}{{winsExtraTime}} | {{/showExtra}}{{ties}} | {{#showExtra}}{{lossesExtraTime}} | {{/showExtra}}{{losses}} | ' . '{{scoreLabel}} | {{#showDiff}}{{diffLabel}} | {{/showDiff}}' . '{{points}} | ' . '{{#showForm}}{{#formItems}}{{label}}{{/formItems}} | {{/showForm}}' . '
{{teamsLabel}}{{#rule}} – {{rule}}{{/rule}}
{{/legend}}{{/hasPlaces}}' . '{{^hasPlaces}}' . self::empty(__('No teams in this group yet.', 'blyzer-events')) . '{{/hasPlaces}}' . '' . esc_html__('Full schedule on Blyzer.net', 'blyzer-events') . '
{{/moreUrl}}', 'players' => '{{#hasItems}}| # | ' . '' . esc_html__('Player', 'blyzer-events') . ' | ' . '' . $team . ' | ' . '{{#statistics}}{{label}} | {{/statistics}}' . '{{#showSum}}' . self::abbr(_x('Pts', 'points', 'blyzer-events'), __('Points', 'blyzer-events')) . ' | {{/showSum}}' . '
|---|---|---|---|---|
| {{rank}} | ' . '' . self::crest('photo', 'initials', '28', 'bze-crest bze-crest--round') . '{{#url}}{{name}}{{/url}}{{^url}}{{name}}{{/url}}' . '{{#dress}}#{{dress}}{{/dress}}' . '{{#positionLabel}}{{positionLabel}}{{/positionLabel}} | ' . '' . self::teamCell('teamLogo', 'teamInitials', 'teamUrl', 'teamTitle') . ' | ' . '{{#stats}}{{value}} | {{/stats}}' . '{{#showSum}}{{sumValue}} | {{/showSum}}' . '
' . esc_html__('All statistics on Blyzer.net', 'blyzer-events') . '
{{/moreUrl}}', 'race_stages' => '{{#hasItems}}{{description}}
{{/description}}' . '{{#hasResults}}| # | ' . $team . ' | ' . '' . esc_html__('Result', 'blyzer-events') . ' | ' . '{{#showPoints}}' . self::abbr(_x('Pts', 'points', 'blyzer-events'), __('Points', 'blyzer-events')) . ' | {{/showPoints}}' . '
|---|---|---|---|
| {{rankLabel}} | ' . '' . self::teamCell('teamLogo', 'initials', 'teamUrl', 'teamTitle') . ' | ' . '{{valueLabel}} | {{#showPoints}}{{pointsLabel}} | {{/showPoints}}
| # | ' . $team . ' | ' . '{{#showStages}}' . esc_html__('Stages', 'blyzer-events') . ' | {{/showStages}}' . '' . esc_html__('Total', 'blyzer-events') . ' | ' . '
|---|---|---|---|
| {{rankLabel}} | ' . '' . self::teamCell('teamLogo', 'initials', 'teamUrl', 'teamTitle') . ' | ' . '{{#showStages}}{{stagesLabel}} | {{/showStages}}' . '{{totalLabel}} |