@@ -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[''] = ''; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dpf_metatags'] = 'pi_flexform'; |
| 55 | 55 | |
| 56 | 56 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin( |
| 57 | - array('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:tt_content.dpf_metatags', |
|
| 57 | + array ('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:tt_content.dpf_metatags', |
|
| 58 | 58 | 'dpf_metatags'), |
| 59 | 59 | 'list_type', |
| 60 | 60 | 'dpf' |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dpf_downloadtool'] = 'pi_flexform'; |
| 67 | 67 | |
| 68 | 68 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin( |
| 69 | - array('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:tt_content.dpf_downloadtool', |
|
| 69 | + array ('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:tt_content.dpf_downloadtool', |
|
| 70 | 70 | 'dpf_downloadtool'), |
| 71 | 71 | 'list_type', |
| 72 | 72 | 'dpf' |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dpf_relatedlisttool'] = 'pi_flexform'; |
| 79 | 79 | |
| 80 | 80 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin( |
| 81 | - array('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:tt_content.dpf_relatedlisttool', |
|
| 81 | + array ('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:tt_content.dpf_relatedlisttool', |
|
| 82 | 82 | 'dpf_relatedlisttool'), |
| 83 | 83 | 'list_type', |
| 84 | 84 | 'dpf' |
@@ -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 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | foreach ($relatedItems as $key => $value) { |
| 85 | 85 | // set link |
| 86 | 86 | if ($value['type'] == 'local') { |
| 87 | - $confApi = array( |
|
| 87 | + $confApi = array ( |
|
| 88 | 88 | 'useCacheHash' => 0, |
| 89 | 89 | 'parameter' => $this->conf['apiPid'], |
| 90 | 90 | 'additionalParams' => '&tx_dpf[qid]=' . $value['docId'] . '&tx_dpf[action]=mets', |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | $metsApiUrl = urlencode($this->cObj->typoLink_URL($confApi)); |
| 95 | 95 | |
| 96 | - $conf = array( |
|
| 96 | + $conf = array ( |
|
| 97 | 97 | 'useCacheHash' => 1, |
| 98 | 98 | 'parameter' => $GLOBALS['TSFE']->page['uid'], |
| 99 | 99 | 'additionalParams' => '&tx_dlf[id]=' . $metsApiUrl, |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | } elseif ($value['type'] == 'urn') { |
| 104 | 104 | // use urn link |
| 105 | - $conf = array( |
|
| 105 | + $conf = array ( |
|
| 106 | 106 | 'useCacheHash' => 0, |
| 107 | 107 | 'parameter' => 'http://nbn-resolving.de/' . $value['docId'], |
| 108 | 108 | 'forceAbsoluteUrl' => true, |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | } else { |
| 112 | 112 | |
| 113 | - $conf = array( |
|
| 113 | + $conf = array ( |
|
| 114 | 114 | 'useCacheHash' => 0, |
| 115 | 115 | 'forceAbsoluteUrl' => true, |
| 116 | 116 | ); |
@@ -132,8 +132,8 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | private function compareByOrderVolumeTitle($a, $b) |
| 134 | 134 | { |
| 135 | - $s1 = join(' ', array($a['order'], $a['volume'], $a['title'])); |
|
| 136 | - $s2 = join(' ', array($b['order'], $b['volume'], $b['title'])); |
|
| 135 | + $s1 = join(' ', array ($a['order'], $a['volume'], $a['title'])); |
|
| 136 | + $s2 = join(' ', array ($b['order'], $b['volume'], $b['title'])); |
|
| 137 | 137 | return strnatcmp($s1, $s2); |
| 138 | 138 | } |
| 139 | 139 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | $items = $this->doc->mets->xpath($xPath); |
| 145 | 145 | |
| 146 | - $relatedItems = array(); |
|
| 146 | + $relatedItems = array (); |
|
| 147 | 147 | |
| 148 | 148 | foreach ($items as $index => $relatedItemXmlElement) { |
| 149 | 149 | $relatedItemXmlElement->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3'); |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | $order = (string) $relatedItemXmlElement->xpath('mods:extension/slub:info/slub:sortingKey')[0]; |
| 156 | 156 | $volume = (string) $relatedItemXmlElement->xpath('mods:part[@type="volume" or @type="issue"]/mods:detail/mods:number')[0]; |
| 157 | 157 | |
| 158 | - $element = array(); |
|
| 158 | + $element = array (); |
|
| 159 | 159 | $element['type'] = $type; |
| 160 | 160 | $element['title'] = $title; |
| 161 | 161 | $element['docId'] = $docId; |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $relatedItems[$index] = $element; |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - usort($relatedItems, array('EWW\Dpf\Plugins\RelatedListTool\RelatedListTool', 'compareByOrderVolumeTitle')); |
|
| 168 | + usort($relatedItems, array ('EWW\Dpf\Plugins\RelatedListTool\RelatedListTool', 'compareByOrderVolumeTitle')); |
|
| 169 | 169 | |
| 170 | 170 | return $relatedItems; |
| 171 | 171 | } |
@@ -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."); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - $metadata = array(); |
|
| 85 | + $metadata = array (); |
|
| 86 | 86 | |
| 87 | 87 | $metadata = $this->doc->getTitleData($this->conf['pages']); |
| 88 | 88 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | $outArray['citation_title'][] = $values[0]; |
| 150 | 150 | |
| 151 | - $GLOBALS['TSFE']->page['title'] = $values[0]; |
|
| 151 | + $GLOBALS['TSFE']->page['title'] = $values[0]; |
|
| 152 | 152 | |
| 153 | 153 | } |
| 154 | 154 | |
@@ -180,8 +180,8 @@ discard block |
||
| 180 | 180 | break; |
| 181 | 181 | |
| 182 | 182 | case 'attachments': |
| 183 | - foreach($values as $attachment) { |
|
| 184 | - $conf = array( |
|
| 183 | + foreach ($values as $attachment) { |
|
| 184 | + $conf = array ( |
|
| 185 | 185 | 'useCacheHash' => 0, |
| 186 | 186 | 'parameter' => $this->conf['apiPid'], |
| 187 | 187 | 'additionalParams' => '&tx_dpf[qid]=' . $this->doc->recordId . '&tx_dpf[action]=attachment&tx_dpf[attachment]=' . $attachment['ID'], |
@@ -258,14 +258,14 @@ discard block |
||
| 258 | 258 | */ |
| 259 | 259 | protected function getAttachments() |
| 260 | 260 | { |
| 261 | - $attachments = array(); |
|
| 261 | + $attachments = array (); |
|
| 262 | 262 | |
| 263 | 263 | $xPath = 'mets:fileSec/mets:fileGrp[@USE="' . $this->conf['fileGrpDownload'] . '"]/mets:file'; |
| 264 | 264 | $files = $this->doc->mets->xpath($xPath); |
| 265 | 265 | |
| 266 | 266 | if (is_array($files)) { |
| 267 | 267 | foreach ($files as $key => $file) { |
| 268 | - $singleFile = array(); |
|
| 268 | + $singleFile = array (); |
|
| 269 | 269 | |
| 270 | 270 | foreach ($file->attributes('mext', 1) as $attribute => $value) { |
| 271 | 271 | $singleFile[$attribute] = $value; |
@@ -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(); |