echo CHtml::mailto(Html::fontAwesome('envelope', 'a') . $delegate->user->getAttributeValue('name', true), $delegate->user->email); ?> <?php } ?> </dd> <?php } elseif ($competition->isOld() && $competition->old->getAttributeValue('delegate')) { ?> <dt><?php echo Yii::t('Competition', 'Delegates'); ?> </dt> <dd> <?php echo OldCompetition::formatInfo($competition->old->getAttributeValue('delegate')); ?> </dd> <?php } ?> <dt><?php echo Yii::t('Competition', 'Events'); ?> </dt> <dd> <?php echo implode(Yii::t('common', ', '), array_map(function ($event) use($competition) { return Yii::t('event', $competition->getFullEventName($event)); }, array_keys($competition->getRegistrationEvents()))); ?>
public function getDescription() { if ($this->_description !== null) { return $this->_description; } $description = '{name} is a speedcubing competition held at {venue} on {date}, organized by {organizers}'; if ($this->delegate !== array()) { $description .= ', and is in the charge of{wca} {delegates}'; } $description .= '.'; $params = array('{name}' => $this->getAttributeValue('name'), '{date}' => $this->getDisplayDate(), '{wca}' => $this->type == self::TYPE_WCA ? Yii::t('common', ' the WCA delegate') : ''); if ($this->isMultiLocation()) { $venue = ''; $count = count($this->location); foreach ($this->location as $key => $location) { $address = $location->getFullAddress(false); if ($key == 0) { $venue .= $address; } elseif ($key < $count - 1) { $venue .= Yii::t('common', ', ') . $address; } else { $venue .= Yii::t('common', ' and ') . $address; } } } else { $venue = $this->location[0]->getFullAddress(); } $params['{venue}'] = $venue; $organizers = ''; if ($this->isOld()) { $organizers = strip_tags(OldCompetition::formatInfo($this->old->getAttributeValue('organizer'))); } else { $count = count($this->organizer); foreach ($this->organizer as $key => $organizer) { if ($key == 0) { $organizers .= $organizer->user->getAttributeValue('name', true); } elseif ($key < $count - 1) { $organizers .= Yii::t('common', ', ') . $organizer->user->getAttributeValue('name', true); } else { $organizers .= Yii::t('common', ' and ') . $organizer->user->getAttributeValue('name', true); } } } $params['{organizers}'] = $organizers; $delegates = ''; $count = count($this->delegate); foreach ($this->delegate as $key => $delegate) { if ($key == 0) { $delegates .= $delegate->user->getAttributeValue('name', true); } elseif ($key < $count - 1) { $delegates .= Yii::t('common', ', ') . $delegate->user->getAttributeValue('name', true); } else { $delegates .= Yii::t('common', ' and ') . $delegate->user->getAttributeValue('name', true); } } $params['{delegates}'] = $delegates; return $this->_description = Yii::t('common', $description, $params); }