@@ -105,7 +105,7 @@ |
||
| 105 | 105 | public function setInputOptions(\EWW\Dpf\Domain\Model\InputOptionList $inputOptionList = null) |
| 106 | 106 | { |
| 107 | 107 | |
| 108 | - $this->inputOptions = array(); |
|
| 108 | + $this->inputOptions = array (); |
|
| 109 | 109 | |
| 110 | 110 | if ($inputOptionList) { |
| 111 | 111 | $this->inputOptions[''] = ''; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | // doi |
| 36 | 36 | $metsDoi = $metsXml->xpath("//mods:identifier[@type='doi']"); |
| 37 | - if(!empty($metsDoi)) { |
|
| 37 | + if (!empty($metsDoi)) { |
|
| 38 | 38 | $dataCiteDoi = $metsDoi[0]; |
| 39 | 39 | } else { |
| 40 | 40 | $dataCiteDoi = '10.1000/1'; // http://www.doi.org/index.html as default |
@@ -42,20 +42,20 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | // creators |
| 44 | 44 | $metsCreator = $metsXml->xpath("//mods:name[@type='personal']"); |
| 45 | - $dataCiteCreator = array(); |
|
| 46 | - foreach($metsCreator as $creator) |
|
| 45 | + $dataCiteCreator = array (); |
|
| 46 | + foreach ($metsCreator as $creator) |
|
| 47 | 47 | { |
| 48 | 48 | $creator->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3'); |
| 49 | 49 | $role = $creator->xpath(".//mods:roleTerm[@type='code']"); |
| 50 | - if($role[0] != 'aut' && $role[0] != 'cmp') { |
|
| 50 | + if ($role[0] != 'aut' && $role[0] != 'cmp') { |
|
| 51 | 51 | continue; |
| 52 | 52 | } |
| 53 | - $names = array(); |
|
| 53 | + $names = array (); |
|
| 54 | 54 | $givenName = $creator->xpath(".//mods:namePart[@type='given']"); |
| 55 | 55 | $familyName = $creator->xpath(".//mods:namePart[@type='family']"); |
| 56 | 56 | $creatorName = $creator->xpath(".//mods:namePart[@type='displayForm']"); |
| 57 | - if(empty($creatorName)) { |
|
| 58 | - if(!empty($givenName) && !empty($familyName)) { |
|
| 57 | + if (empty($creatorName)) { |
|
| 58 | + if (!empty($givenName) && !empty($familyName)) { |
|
| 59 | 59 | $creatorName = "<creatorName>{$familyName[0]}, {$givenName[0]}</creatorName>"; |
| 60 | 60 | } else { |
| 61 | 61 | $creatorName = ""; |
@@ -77,36 +77,36 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | // subtitles |
| 79 | 79 | $metsSubTitles = $metsXml->xpath("//mods:titleInfo[@usage='primary']/mods:subTitle"); |
| 80 | - foreach($metsSubTitles as $title) { |
|
| 80 | + foreach ($metsSubTitles as $title) { |
|
| 81 | 81 | $dataCiteTitle .= (!empty($title)) ? "<title titleType=\"Subtitle\">{$title}</title>" : ""; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | // publisher |
| 85 | 85 | $metsPublisher = $metsXml->xpath("//mods:name[@type='corporate']"); |
| 86 | 86 | $dataCitePublisher = ''; |
| 87 | - foreach($metsPublisher as $corporation) { |
|
| 87 | + foreach ($metsPublisher as $corporation) { |
|
| 88 | 88 | $corporation->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3'); |
| 89 | 89 | $role = $corporation->xpath(".//mods:roleTerm[@type='code']"); |
| 90 | 90 | $role = (string) $role[0]; |
| 91 | 91 | $name = $corporation->xpath(".//mods:namePart"); |
| 92 | 92 | $name = (string) $name[0]; |
| 93 | - if($role == 'pbl') { |
|
| 93 | + if ($role == 'pbl') { |
|
| 94 | 94 | $dataCitePublisher = $name; |
| 95 | 95 | break; |
| 96 | - } elseif($role == 'dgg' || ($role == 'edt' && $dataCitePublisher == '')) { |
|
| 96 | + } elseif ($role == 'dgg' || ($role == 'edt' && $dataCitePublisher == '')) { |
|
| 97 | 97 | $dataCitePublisher = $name; |
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | // publication year |
| 102 | 102 | $metsPublicationYear = $metsXml->xpath("//mods:originInfo[@eventType='publication']/mods:dateIssued"); |
| 103 | - if(!empty($metsPublicationYear)) { |
|
| 103 | + if (!empty($metsPublicationYear)) { |
|
| 104 | 104 | $dataCitePublicationYear = $metsPublicationYear[0]; |
| 105 | 105 | } else { |
| 106 | 106 | $metsPublicationYear = $metsXml->xpath("//mods:originInfo/mods:dateIssued"); |
| 107 | 107 | $dataCitePublicationYear = (!empty($metsPublicationYear)) ? $metsPublicationYear[0] : ""; |
| 108 | 108 | } |
| 109 | - if(strlen($dataCitePublicationYear) != 4) { |
|
| 109 | + if (strlen($dataCitePublicationYear) != 4) { |
|
| 110 | 110 | $dataCitePublicationYear = substr($dataCitePublicationYear, 0, 4); |
| 111 | 111 | } |
| 112 | 112 | $dataCitePublicationYear = (preg_match('/(19|20)\d{2}/', $dataCitePublicationYear)) ? $dataCitePublicationYear : ""; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | // subjects |
| 115 | 115 | $metsSubjects = $metsXml->xpath("//mods:classification[@authority='z']"); |
| 116 | 116 | $dataCiteSubjects = ''; |
| 117 | - foreach(GeneralUtility::trimExplode(',', $metsSubjects[0]) as $subject) { |
|
| 117 | + foreach (GeneralUtility::trimExplode(',', $metsSubjects[0]) as $subject) { |
|
| 118 | 118 | $dataCiteSubjects .= "<subject>{$subject}</subject>"; |
| 119 | 119 | } |
| 120 | 120 | |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | $json = json_decode($content); |
| 39 | 39 | |
| 40 | 40 | |
| 41 | - $listArray = array(); |
|
| 41 | + $listArray = array (); |
|
| 42 | 42 | $i = 0; |
| 43 | 43 | foreach ($json as $value) { |
| 44 | 44 | $listArray[$i]['value'] = $value->label; |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $tokenStack = 0; |
| 49 | 49 | $insidePredicate = false; |
| 50 | 50 | $predicateString = ""; |
| 51 | - $loopStack = array(); |
|
| 51 | + $loopStack = array (); |
|
| 52 | 52 | |
| 53 | 53 | foreach ($matches[0] as $key => $value) { |
| 54 | 54 | $firstChar = substr($value, 0, 1); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $this->endAttribute(); |
| 89 | 89 | array_pop($loopStack); |
| 90 | 90 | $predicateStack--; |
| 91 | - } else if ($firstChar !== '=' && $firstChar !== '[' && $firstChar !== '@' && $firstChar !== '/' && $firstChar!== '.') { |
|
| 91 | + } else if ($firstChar !== '=' && $firstChar !== '[' && $firstChar !== '@' && $firstChar !== '/' && $firstChar !== '.') { |
|
| 92 | 92 | $this->startToken($value); |
| 93 | 93 | $loopStack[] = 'token'; |
| 94 | 94 | if ($predicateStack > 0) { |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $this->endToken(); |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | - $this->stack = array(); |
|
| 109 | + $this->stack = array (); |
|
| 110 | 110 | |
| 111 | 111 | } |
| 112 | 112 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | // initialize elasticsearch lib |
| 53 | 53 | $extensionPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('dpf'); |
| 54 | 54 | |
| 55 | - $params['hosts'] = array( |
|
| 55 | + $params['hosts'] = array ( |
|
| 56 | 56 | $this->server . ':' . $this->port, |
| 57 | 57 | ); |
| 58 | 58 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $this->resultList = $results['hits']; |
| 87 | 87 | |
| 88 | 88 | return $this->resultList; |
| 89 | - } catch ( \Elasticsearch\Common\Exceptions\Curl\CouldNotConnectToHost $exception) { |
|
| 89 | + } catch (\Elasticsearch\Common\Exceptions\Curl\CouldNotConnectToHost $exception) { |
|
| 90 | 90 | throw new \EWW\Dpf\Exceptions\ElasticSearchConnectionErrorException("Could not connect to repository server."); |
| 91 | 91 | } catch (\Elasticsearch\Common\Exceptions\Curl\CouldNotResolveHostException $exception) { |
| 92 | 92 | throw new \EWW\Dpf\Exceptions\ElasticSearchConnectionErrorException("Could not connect to repository server."); |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | $dataCite = $this->uriBuilder |
| 54 | 54 | ->reset() |
| 55 | 55 | ->setTargetPageUid($apiPid) |
| 56 | - ->setArguments(array( 'tx_dpf' => $row)) |
|
| 56 | + ->setArguments(array ('tx_dpf' => $row)) |
|
| 57 | 57 | ->setCreateAbsoluteUri(true) |
| 58 | 58 | ->setUseCacheHash(FALSE) |
| 59 | 59 | ->buildFrontendUri(); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $previewMets = $this->uriBuilder |
| 85 | 85 | ->reset() |
| 86 | 86 | ->setTargetPageUid($apiPid) |
| 87 | - ->setArguments(array( 'tx_dpf' => $row)) |
|
| 87 | + ->setArguments(array ('tx_dpf' => $row)) |
|
| 88 | 88 | ->setCreateAbsoluteUri(true) |
| 89 | 89 | ->setUseCacheHash(FALSE) |
| 90 | 90 | //->setNoCache(TRUE) |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | ->setUseCacheHash(TRUE) |
| 97 | 97 | //->setNoCache(TRUE) |
| 98 | 98 | ->setArguments( |
| 99 | - array( 'tx_dlf' => array( |
|
| 99 | + array ('tx_dlf' => array ( |
|
| 100 | 100 | 'id' => urldecode($previewMets), |
| 101 | 101 | ) |
| 102 | 102 | ) |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | ->buildFrontendUri(); |
| 106 | 106 | |
| 107 | 107 | $title = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('manager.tooltip.preview', 'dpf', $arguments = null); |
| 108 | - $icon = '<a href="'. $additionalGetVars . '" data-toggle="tooltip" class="' . $class . '" title="' . $title . '">' . $insideText . '</a>'; |
|
| 108 | + $icon = '<a href="' . $additionalGetVars . '" data-toggle="tooltip" class="' . $class . '" title="' . $title . '">' . $insideText . '</a>'; |
|
| 109 | 109 | |
| 110 | 110 | return $icon; |
| 111 | 111 | |
@@ -20,5 +20,5 @@ |
||
| 20 | 20 | class MetadataObjectRepository extends \EWW\Dpf\Domain\Repository\AbstractRepository |
| 21 | 21 | { |
| 22 | 22 | |
| 23 | - protected $defaultOrderings = array("sorting" => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING); |
|
| 23 | + protected $defaultOrderings = array ("sorting" => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING); |
|
| 24 | 24 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | * |
| 53 | 53 | * @var array |
| 54 | 54 | */ |
| 55 | - protected $accessRestrictionRoles = array(); |
|
| 55 | + protected $accessRestrictionRoles = array (); |
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * |