public function formatEditors() { // format names in editors $editorsFormatted = array(); if (!$this->editors) { return ''; } foreach ($this->editors as $editor) { $name = explode(' ', $editor); $lastName = array_pop($name); $editorsFormatted[] = $lastName . ' ' . StringHelper::initials(implode(' ', $name)); } $editorsString = implode(', ', $editorsFormatted); return $editorsString; }
public function formatAuthors() { // format crossRef authors $authors = $this->makeAuthors(); $authorsFormatted = array(); if (count($authors) == 0) { return '[Anonim]'; } $i = 0; foreach ($authors as $author) { $name = $author['family'] . ' ' . StringHelper::initials($author['given']); $authorsFormatted[] = trim($name); $i++; if ($i == 10) { $authorsFormatted[9] .= ' <i>et al</i>'; break; } } $authorsString = implode(', ', $authorsFormatted); return $authorsString; }