34 if ($preferredLocale && $this->
getData($key, $preferredLocale)) {
35 return $this->
getData($key, $preferredLocale);
46 $data = $this->
getData($key,
null);
47 foreach ((array) $data as $value) {
78 $allTitles = (array) $this->
getData(
'title');
80 foreach ($allTitles as $locale => $title) {
100 return $prefix .
' ' . $title;
111 $allTitles = $this->
getData(
'title');
113 foreach ($allTitles as $locale => $title) {
131 $authors = $this->
getData(
'authors');
133 if (empty($authors)) {
138 $lastUserGroupId =
null;
139 foreach($authors as $author) {
141 if ($lastUserGroupId != $author->getData(
'userGroupId')) {
142 foreach ($userGroups as $userGroup) {
143 if ($lastUserGroupId === $userGroup->getId()) {
144 if ($userGroup->getData(
'showTitle')) {
145 $str .=
' (' . $userGroup->getLocalizedData(
'name') .
')';
150 $str .= __(
'common.semicolonListSeparator');
152 $str .= __(
'common.commaListSeparator');
155 $str .= $author->getFullName();
156 $lastUserGroupId = $author->getUserGroupId();
160 if (isset($author)) {
161 foreach($userGroups as $userGroup) {
162 if ($author->getData(
'userGroupId') === $userGroup->getId()) {
163 if ($userGroup->getData(
'showTitle')) {
164 $str .=
' (' . $userGroup->getLocalizedData(
'name') .
')';
182 $authors = $this->
getData(
'authors');
184 if (empty($authors)) {
188 $str = $authors[0]->getLocalizedFamilyName();
190 $str = $authors[0]->getLocalizedGivenName();
193 if (count($authors) > 1) {
195 return __(
'submission.shortAuthor', [
'author' => $str]);
207 if (empty($this->
getData(
'authors'))) {
210 foreach ($this->
getData(
'authors') as $author) {
211 if ($author->getId() === $this->getData(
'primaryContactId')) {
234 $firstRange = array_shift($ranges);
235 if (is_array($firstRange)) {
236 return array_shift($firstRange);
251 $lastRange = array_pop($ranges);
252 $lastPage = is_array($lastRange) ? array_pop($lastRange) :
"";
253 return isset($lastPage) ? $lastPage :
"";
272 $pages = $this->
getData(
'pages');
274 if (preg_match(
'/^[[:alpha:]]+\W/', $pages)) {
276 if (!preg_match(
'/^[MDCLXVUI]+\W/i', $pages)) {
278 $pages = preg_replace(
'/^[[:alpha:]]+[:.]?/',
'', $pages);
282 $pages = trim($pages);
288 $ranges = explode(
',', $pages);
289 $pageArray = array();
290 foreach ($ranges as $range) {
292 $pageArray[] = array_map(
'trim', explode(
'-', str_replace(
'--',
'-', $range), 2));
303 return preg_match(
'/creativecommons\.org/i', $this->
getData(
'licenseUrl'));
313 return $this->
getData(
'pub-id::' . $pubIdType);