@@ -224,7 +224,7 @@ |
||
| 224 | 224 | $result = $queryBuilder |
| 225 | 225 | ->select('COLUMN_NAME') |
| 226 | 226 | ->from('INFORMATION_SCHEMA.COLUMNS') |
| 227 | - ->where('TABLE_NAME="tx_dlf_documents" AND TABLE_SCHEMA="' . $database . '" AND COLUMN_NAME="document_format"') |
|
| 227 | + ->where('TABLE_NAME="tx_dlf_documents" AND TABLE_SCHEMA="'.$database.'" AND COLUMN_NAME="document_format"') |
|
| 228 | 228 | ->execute(); |
| 229 | 229 | while ($resArray = $result->fetch()) { |
| 230 | 230 | if ($resArray['COLUMN_NAME'] === 'document_format') { |
@@ -65,9 +65,9 @@ discard block |
||
| 65 | 65 | } elseif (!empty($this->conf['placeholder'])) { |
| 66 | 66 | $thumbnailFile = $GLOBALS['TSFE']->tmpl->getFileName($this->conf['placeholder']); |
| 67 | 67 | } else { |
| 68 | - $thumbnailFile = PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)) . 'Resources/Public/Images/PageGridPlaceholder.jpg'; |
|
| 68 | + $thumbnailFile = PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)).'Resources/Public/Images/PageGridPlaceholder.jpg'; |
|
| 69 | 69 | } |
| 70 | - $thumbnail = '<img alt="' . $markerArray['###PAGINATION###'] . '" src="' . $thumbnailFile . '" />'; |
|
| 70 | + $thumbnail = '<img alt="'.$markerArray['###PAGINATION###'].'" src="'.$thumbnailFile.'" />'; |
|
| 71 | 71 | // Get new plugin variables for typolink. |
| 72 | 72 | $piVars = $this->piVars; |
| 73 | 73 | // Unset no longer needed plugin variables. |
@@ -105,22 +105,22 @@ discard block |
||
| 105 | 105 | $separator = htmlspecialchars($this->pi_getLL('separator', ' - ')); |
| 106 | 106 | // Add link to previous page. |
| 107 | 107 | if ($this->piVars['pointer'] > 0) { |
| 108 | - $output = $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('prevPage', '<')), ['pointer' => $this->piVars['pointer'] - 1, 'page' => (($this->piVars['pointer'] - 1) * $this->conf['limit']) + 1], true) . $separator; |
|
| 108 | + $output = $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('prevPage', '<')), ['pointer' => $this->piVars['pointer'] - 1, 'page' => (($this->piVars['pointer'] - 1) * $this->conf['limit']) + 1], true).$separator; |
|
| 109 | 109 | } else { |
| 110 | - $output = '<span class="prev-page not-active">' . htmlspecialchars($this->pi_getLL('prevPage', '<')) . '</span>' . $separator; |
|
| 110 | + $output = '<span class="prev-page not-active">'.htmlspecialchars($this->pi_getLL('prevPage', '<')).'</span>'.$separator; |
|
| 111 | 111 | } |
| 112 | 112 | $i = 0; |
| 113 | 113 | // Add links to pages. |
| 114 | 114 | while ($i < $maxPages) { |
| 115 | 115 | if ($i < 3 || ($i > $this->piVars['pointer'] - 3 && $i < $this->piVars['pointer'] + 3) || $i > $maxPages - 4) { |
| 116 | 116 | if ($this->piVars['pointer'] != $i) { |
| 117 | - $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)), ['pointer' => $i, 'page' => ($i * $this->conf['limit']) + 1], true) . $separator; |
|
| 117 | + $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)), ['pointer' => $i, 'page' => ($i * $this->conf['limit']) + 1], true).$separator; |
|
| 118 | 118 | } else { |
| 119 | - $output .= '<span class="active">' . htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)) . '</span>' . $separator; |
|
| 119 | + $output .= '<span class="active">'.htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)).'</span>'.$separator; |
|
| 120 | 120 | } |
| 121 | 121 | $skip = true; |
| 122 | 122 | } elseif ($skip == true) { |
| 123 | - $output .= '<span class="skipped">' . htmlspecialchars($this->pi_getLL('skip', '...')) . '</span>' . $separator; |
|
| 123 | + $output .= '<span class="skipped">'.htmlspecialchars($this->pi_getLL('skip', '...')).'</span>'.$separator; |
|
| 124 | 124 | $skip = false; |
| 125 | 125 | } |
| 126 | 126 | $i++; |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | if ($this->piVars['pointer'] < $maxPages - 1) { |
| 130 | 130 | $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('nextPage', '>')), ['pointer' => $this->piVars['pointer'] + 1, 'page' => ($this->piVars['pointer'] + 1) * $this->conf['limit'] + 1], true); |
| 131 | 131 | } else { |
| 132 | - $output .= '<span class="next-page not-active">' . htmlspecialchars($this->pi_getLL('nextPage', '>')) . '</span>'; |
|
| 132 | + $output .= '<span class="next-page not-active">'.htmlspecialchars($this->pi_getLL('nextPage', '>')).'</span>'; |
|
| 133 | 133 | } |
| 134 | 134 | return $output; |
| 135 | 135 | } |
@@ -88,9 +88,9 @@ discard block |
||
| 88 | 88 | $additionalWhere = ''; |
| 89 | 89 | // Check for pre-selected collections. |
| 90 | 90 | if (!empty($this->piVars['collection'])) { |
| 91 | - $additionalWhere = 'tx_dlf_collections.uid=' . intval($this->piVars['collection']); |
|
| 91 | + $additionalWhere = 'tx_dlf_collections.uid='.intval($this->piVars['collection']); |
|
| 92 | 92 | } elseif (!empty($this->conf['collections'])) { |
| 93 | - $additionalWhere = 'tx_dlf_collections.uid IN (' . implode(',', GeneralUtility::intExplode(',', $this->conf['collections'])) . ')'; |
|
| 93 | + $additionalWhere = 'tx_dlf_collections.uid IN ('.implode(',', GeneralUtility::intExplode(',', $this->conf['collections'])).')'; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
@@ -145,12 +145,12 @@ discard block |
||
| 145 | 145 | ) { |
| 146 | 146 | $superiorTitle = Document::getTitle($resArray['partof'], true); |
| 147 | 147 | if (!empty($superiorTitle)) { |
| 148 | - $title .= '[' . $superiorTitle . ']'; |
|
| 148 | + $title .= '['.$superiorTitle.']'; |
|
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | // Get title of document. |
| 152 | 152 | if (!empty($resArray['title'])) { |
| 153 | - $title .= ' ' . $resArray['title']; |
|
| 153 | + $title .= ' '.$resArray['title']; |
|
| 154 | 154 | } |
| 155 | 155 | // Set default title if empty. |
| 156 | 156 | if (empty($title)) { |
@@ -158,13 +158,13 @@ discard block |
||
| 158 | 158 | } |
| 159 | 159 | // Append volume information. |
| 160 | 160 | if (!empty($resArray['volume'])) { |
| 161 | - $title .= ', ' . $this->pi_getLL('volume') . ' ' . $resArray['volume']; |
|
| 161 | + $title .= ', '.$this->pi_getLL('volume').' '.$resArray['volume']; |
|
| 162 | 162 | } |
| 163 | 163 | // Is this document new or updated? |
| 164 | 164 | if ($resArray['crdate'] == $resArray['tstamp']) { |
| 165 | - $title = $this->pi_getLL('new') . ' ' . trim($title); |
|
| 165 | + $title = $this->pi_getLL('new').' '.trim($title); |
|
| 166 | 166 | } else { |
| 167 | - $title = $this->pi_getLL('update') . ' ' . trim($title); |
|
| 167 | + $title = $this->pi_getLL('update').' '.trim($title); |
|
| 168 | 168 | } |
| 169 | 169 | $item->appendChild($rss->createElement('title', htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8'))); |
| 170 | 170 | // Add link. |
@@ -196,10 +196,10 @@ discard block |
||
| 196 | 196 | // Send headers. |
| 197 | 197 | header('HTTP/1.1 200 OK'); |
| 198 | 198 | header('Cache-Control: no-cache'); |
| 199 | - header('Content-Length: ' . strlen($content)); |
|
| 199 | + header('Content-Length: '.strlen($content)); |
|
| 200 | 200 | header('Content-Type: application/rss+xml; charset=utf-8'); |
| 201 | - header('Date: ' . date('r', $GLOBALS['EXEC_TIME'])); |
|
| 202 | - header('Expires: ' . date('r', $GLOBALS['EXEC_TIME'])); |
|
| 201 | + header('Date: '.date('r', $GLOBALS['EXEC_TIME'])); |
|
| 202 | + header('Expires: '.date('r', $GLOBALS['EXEC_TIME'])); |
|
| 203 | 203 | echo $content; |
| 204 | 204 | exit; |
| 205 | 205 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | { |
| 135 | 135 | // Get next available core name if none given. |
| 136 | 136 | if (empty($core)) { |
| 137 | - $core = 'dlfCore' . self::getNextCoreNumber(); |
|
| 137 | + $core = 'dlfCore'.self::getNextCoreNumber(); |
|
| 138 | 138 | } |
| 139 | 139 | // Get Solr service instance. |
| 140 | 140 | $solr = self::getInstance($core); |
@@ -230,13 +230,13 @@ discard block |
||
| 230 | 230 | ->execute(); |
| 231 | 231 | |
| 232 | 232 | while ($resArray = $result->fetch()) { |
| 233 | - $fields[] = $resArray['index_name'] . '_' . ($resArray['index_tokenized'] ? 't' : 'u') . ($resArray['index_stored'] ? 's' : 'u') . 'i'; |
|
| 233 | + $fields[] = $resArray['index_name'].'_'.($resArray['index_tokenized'] ? 't' : 'u').($resArray['index_stored'] ? 's' : 'u').'i'; |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | // Check if queried field is valid. |
| 237 | 237 | $splitQuery = explode(':', $query, 2); |
| 238 | 238 | if (in_array($splitQuery[0], $fields)) { |
| 239 | - $query = $splitQuery[0] . ':(' . self::escapeQuery(trim($splitQuery[1], '()')) . ')'; |
|
| 239 | + $query = $splitQuery[0].':('.self::escapeQuery(trim($splitQuery[1], '()')).')'; |
|
| 240 | 240 | } else { |
| 241 | 241 | $query = self::escapeQuery($query); |
| 242 | 242 | } |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | { |
| 344 | 344 | $number = max(intval($number), 0); |
| 345 | 345 | // Check if core already exists. |
| 346 | - $solr = self::getInstance('dlfCore' . $number); |
|
| 346 | + $solr = self::getInstance('dlfCore'.$number); |
|
| 347 | 347 | if (!$solr->ready) { |
| 348 | 348 | return $number; |
| 349 | 349 | } else { |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | // Set filter query to just get toplevel documents. |
| 419 | 419 | $params['filterquery'][] = ['query' => 'toplevel:true']; |
| 420 | 420 | // Set join query to get all documents with the same uids. |
| 421 | - $params['query'] = '{!join from=uid to=uid}' . $params['query']; |
|
| 421 | + $params['query'] = '{!join from=uid to=uid}'.$params['query']; |
|
| 422 | 422 | // Perform search to determine the total number of toplevel hits and fetch the required rows. |
| 423 | 423 | $selectQuery = $this->service->createSelect($params); |
| 424 | 424 | $results = $this->service->select($selectQuery); |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | // Set query. |
| 476 | 476 | $parameters['query'] = $query; |
| 477 | 477 | // Calculate cache identifier. |
| 478 | - $cacheIdentifier = Helper::digest($this->core . print_r(array_merge($this->params, $parameters), true)); |
|
| 478 | + $cacheIdentifier = Helper::digest($this->core.print_r(array_merge($this->params, $parameters), true)); |
|
| 479 | 479 | $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr'); |
| 480 | 480 | $resultSet = []; |
| 481 | 481 | if (($entry = $cache->get($cacheIdentifier)) === false) { |
@@ -606,12 +606,12 @@ discard block |
||
| 606 | 606 | */ |
| 607 | 607 | public function __get($var) |
| 608 | 608 | { |
| 609 | - $method = '_get' . ucfirst($var); |
|
| 609 | + $method = '_get'.ucfirst($var); |
|
| 610 | 610 | if ( |
| 611 | 611 | !property_exists($this, $var) |
| 612 | 612 | || !method_exists($this, $method) |
| 613 | 613 | ) { |
| 614 | - $this->logger->warning('There is no getter function for property "' . $var . '"'); |
|
| 614 | + $this->logger->warning('There is no getter function for property "'.$var.'"'); |
|
| 615 | 615 | return; |
| 616 | 616 | } else { |
| 617 | 617 | return $this->$method(); |
@@ -644,12 +644,12 @@ discard block |
||
| 644 | 644 | */ |
| 645 | 645 | public function __set($var, $value) |
| 646 | 646 | { |
| 647 | - $method = '_set' . ucfirst($var); |
|
| 647 | + $method = '_set'.ucfirst($var); |
|
| 648 | 648 | if ( |
| 649 | 649 | !property_exists($this, $var) |
| 650 | 650 | || !method_exists($this, $method) |
| 651 | 651 | ) { |
| 652 | - $this->logger->warning('There is no setter function for property "' . $var . '"'); |
|
| 652 | + $this->logger->warning('There is no setter function for property "'.$var.'"'); |
|
| 653 | 653 | } else { |
| 654 | 654 | $this->$method($value); |
| 655 | 655 | } |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | 'scheme' => $this->config['scheme'], |
| 687 | 687 | 'host' => $this->config['host'], |
| 688 | 688 | 'port' => $this->config['port'], |
| 689 | - 'path' => '/' . $this->config['path'], |
|
| 689 | + 'path' => '/'.$this->config['path'], |
|
| 690 | 690 | 'core' => $core, |
| 691 | 691 | 'username' => $this->config['username'], |
| 692 | 692 | 'password' => $this->config['password'], |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $templateFile = $this->conf['templateFile']; |
| 82 | 82 | } else { |
| 83 | 83 | // Load default template from extension. |
| 84 | - $templateFile = 'EXT:' . $this->extKey . '/Resources/Private/Templates/' . Helper::getUnqualifiedClassName(get_class($this)) . '.tmpl'; |
|
| 84 | + $templateFile = 'EXT:'.$this->extKey.'/Resources/Private/Templates/'.Helper::getUnqualifiedClassName(get_class($this)).'.tmpl'; |
|
| 85 | 85 | } |
| 86 | 86 | // Substitute strings like "EXT:" in given template file location. |
| 87 | 87 | $fileResource = $GLOBALS['TSFE']->tmpl->getFileName($templateFile); |
@@ -107,12 +107,12 @@ discard block |
||
| 107 | 107 | $conf = Helper::mergeRecursiveWithOverrule($flexFormConf, $conf); |
| 108 | 108 | } |
| 109 | 109 | // Read plugin TS configuration. |
| 110 | - $pluginConf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_dlf_' . strtolower(Helper::getUnqualifiedClassName(get_class($this))) . '.']; |
|
| 110 | + $pluginConf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_dlf_'.strtolower(Helper::getUnqualifiedClassName(get_class($this))).'.']; |
|
| 111 | 111 | if (is_array($pluginConf)) { |
| 112 | 112 | $conf = Helper::mergeRecursiveWithOverrule($pluginConf, $conf); |
| 113 | 113 | } |
| 114 | 114 | // Read general TS configuration. |
| 115 | - $generalConf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId . '.']; |
|
| 115 | + $generalConf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId.'.']; |
|
| 116 | 116 | if (is_array($generalConf)) { |
| 117 | 117 | $conf = Helper::mergeRecursiveWithOverrule($generalConf, $conf); |
| 118 | 118 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | // Set default plugin variables. |
| 128 | 128 | $this->pi_setPiVarDefaults(); |
| 129 | 129 | // Load translation files. |
| 130 | - $this->pi_loadLL('EXT:' . $this->extKey . '/Resources/Private/Language/' . Helper::getUnqualifiedClassName(get_class($this)) . '.xml'); |
|
| 130 | + $this->pi_loadLL('EXT:'.$this->extKey.'/Resources/Private/Language/'.Helper::getUnqualifiedClassName(get_class($this)).'.xml'); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /** |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | if (!$this->doc->ready) { |
| 152 | 152 | // Destroy the incomplete object. |
| 153 | 153 | $this->doc = null; |
| 154 | - $this->logger->error('Failed to load document with UID ' . $this->piVars['id']); |
|
| 154 | + $this->logger->error('Failed to load document with UID '.$this->piVars['id']); |
|
| 155 | 155 | } else { |
| 156 | 156 | // Set configuration PID. |
| 157 | 157 | $this->doc->cPid = $this->conf['pages']; |
@@ -179,10 +179,10 @@ discard block |
||
| 179 | 179 | // Try to load document. |
| 180 | 180 | $this->loadDocument(); |
| 181 | 181 | } else { |
| 182 | - $this->logger->error('Failed to load document with record ID "' . $this->piVars['recordId'] . '"'); |
|
| 182 | + $this->logger->error('Failed to load document with record ID "'.$this->piVars['recordId'].'"'); |
|
| 183 | 183 | } |
| 184 | 184 | } else { |
| 185 | - $this->logger->error('Invalid UID ' . $this->piVars['id'] . ' or PID ' . $this->conf['pages'] . ' for document loading'); |
|
| 185 | + $this->logger->error('Invalid UID '.$this->piVars['id'].' or PID '.$this->conf['pages'].' for document loading'); |
|
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $conf['no_cache'] = true; |
| 237 | 237 | } |
| 238 | 238 | $conf['parameter'] = $altPageId ? : ($this->pi_tmpPageId ? : 'current'); |
| 239 | - $conf['additionalParams'] = $this->conf['parent.']['addParams'] . HttpUtility::buildQueryString($urlParameters, '&', true) . $this->pi_moreParams; |
|
| 239 | + $conf['additionalParams'] = $this->conf['parent.']['addParams'].HttpUtility::buildQueryString($urlParameters, '&', true).$this->pi_moreParams; |
|
| 240 | 240 | // Add additional configuration for absolute URLs. |
| 241 | 241 | $conf['forceAbsoluteUrl'] = !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0; |
| 242 | 242 | $conf['forceAbsoluteUrl.']['scheme'] = !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'; |
@@ -257,9 +257,9 @@ discard block |
||
| 257 | 257 | { |
| 258 | 258 | if (!$this->frontendController->config['config']['disableWrapInBaseClass']) { |
| 259 | 259 | // Use class name instead of $this->prefixId for content wrapping because $this->prefixId is the same for all plugins. |
| 260 | - $content = '<div class="tx-dlf-' . strtolower(Helper::getUnqualifiedClassName(get_class($this))) . '">' . $content . '</div>'; |
|
| 260 | + $content = '<div class="tx-dlf-'.strtolower(Helper::getUnqualifiedClassName(get_class($this))).'">'.$content.'</div>'; |
|
| 261 | 261 | if (!$this->frontendController->config['config']['disablePrefixComment']) { |
| 262 | - $content = "\n\n<!-- BEGIN: Content of extension '" . $this->extKey . "', plugin '" . Helper::getUnqualifiedClassName(get_class($this)) . "' -->\n\n" . $content . "\n\n<!-- END: Content of extension '" . $this->extKey . "', plugin '" . Helper::getUnqualifiedClassName(get_class($this)) . "' -->\n\n"; |
|
| 262 | + $content = "\n\n<!-- BEGIN: Content of extension '".$this->extKey."', plugin '".Helper::getUnqualifiedClassName(get_class($this))."' -->\n\n".$content."\n\n<!-- END: Content of extension '".$this->extKey."', plugin '".Helper::getUnqualifiedClassName(get_class($this))."' -->\n\n"; |
|
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | 265 | return $content; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | if ($doc->ready) { |
| 117 | 117 | return $doc; |
| 118 | 118 | } else { |
| 119 | - $this->logger->warning('Failed to load document with UID ' . $piVars['id']); |
|
| 119 | + $this->logger->warning('Failed to load document with UID '.$piVars['id']); |
|
| 120 | 120 | } |
| 121 | 121 | } elseif (!empty($piVars['recordId'])) { |
| 122 | 122 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | // Try to load document. |
| 138 | 138 | return $this->loadDocument(['id' => $resArray['uid']]); |
| 139 | 139 | } else { |
| 140 | - $this->logger->warning('Failed to load document with record ID "' . $piVars['recordId'] . '"'); |
|
| 140 | + $this->logger->warning('Failed to load document with record ID "'.$piVars['recordId'].'"'); |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -176,12 +176,12 @@ discard block |
||
| 176 | 176 | foreach ($collections as $collection) { |
| 177 | 177 | $solr_query = ''; |
| 178 | 178 | if ($collection['index_query'] != '') { |
| 179 | - $solr_query .= '(' . $collection['index_query'] . ')'; |
|
| 179 | + $solr_query .= '('.$collection['index_query'].')'; |
|
| 180 | 180 | } else { |
| 181 | - $solr_query .= 'collection:("' . $collection['index_name'] . '")'; |
|
| 181 | + $solr_query .= 'collection:("'.$collection['index_name'].'")'; |
|
| 182 | 182 | } |
| 183 | - $partOfNothing = $solr->search_raw($solr_query . ' AND partof:0 AND toplevel:true', $params); |
|
| 184 | - $partOfSomething = $solr->search_raw($solr_query . ' AND NOT partof:0 AND toplevel:true', $params); |
|
| 183 | + $partOfNothing = $solr->search_raw($solr_query.' AND partof:0 AND toplevel:true', $params); |
|
| 184 | + $partOfSomething = $solr->search_raw($solr_query.' AND NOT partof:0 AND toplevel:true', $params); |
|
| 185 | 185 | // Titles are all documents that are "root" elements i.e. partof == 0 |
| 186 | 186 | $collection['titles'] = []; |
| 187 | 187 | foreach ($partOfNothing as $doc) { |
@@ -219,14 +219,14 @@ discard block |
||
| 219 | 219 | $markerArray[$_key]['###TITLE###'] = $this->cObj->typoLink(htmlspecialchars($collection['label']), $conf); |
| 220 | 220 | // Add feed link if applicable. |
| 221 | 221 | if (!empty($this->conf['targetFeed'])) { |
| 222 | - $img = '<img src="' . \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey)) . 'Resources/Public/Icons/txdlffeeds.png" alt="' . htmlspecialchars($this->pi_getLL('feedAlt', '')) . '" title="' . htmlspecialchars($this->pi_getLL('feedTitle', '')) . '" />'; |
|
| 222 | + $img = '<img src="'.\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey)).'Resources/Public/Icons/txdlffeeds.png" alt="'.htmlspecialchars($this->pi_getLL('feedAlt', '')).'" title="'.htmlspecialchars($this->pi_getLL('feedTitle', '')).'" />'; |
|
| 223 | 223 | $markerArray[$_key]['###FEED###'] = $this->pi_linkTP($img, [$this->prefixId => ['collection' => $collection['uid']]], false, $this->conf['targetFeed']); |
| 224 | 224 | } else { |
| 225 | 225 | $markerArray[$_key]['###FEED###'] = ''; |
| 226 | 226 | } |
| 227 | 227 | // Add thumbnail. |
| 228 | 228 | if (!empty($collection['thumbnail'])) { |
| 229 | - $markerArray[$_key]['###THUMBNAIL###'] = '<img alt="" title="' . htmlspecialchars($collection['label']) . '" src="' . $collection['thumbnail'] . '" />'; |
|
| 229 | + $markerArray[$_key]['###THUMBNAIL###'] = '<img alt="" title="'.htmlspecialchars($collection['label']).'" src="'.$collection['thumbnail'].'" />'; |
|
| 230 | 230 | } else { |
| 231 | 231 | $markerArray[$_key]['###THUMBNAIL###'] = ''; |
| 232 | 232 | } |
@@ -234,9 +234,9 @@ discard block |
||
| 234 | 234 | $markerArray[$_key]['###DESCRIPTION###'] = $this->pi_RTEcssText($collection['description']); |
| 235 | 235 | // Build statistic's output. |
| 236 | 236 | $labelTitles = $this->pi_getLL((count($collection['titles']) > 1 ? 'titles' : 'title'), ''); |
| 237 | - $markerArray[$_key]['###COUNT_TITLES###'] = htmlspecialchars(count($collection['titles']) . $labelTitles); |
|
| 237 | + $markerArray[$_key]['###COUNT_TITLES###'] = htmlspecialchars(count($collection['titles']).$labelTitles); |
|
| 238 | 238 | $labelVolumes = $this->pi_getLL((count($collection['volumes']) > 1 ? 'volumes' : 'volume'), ''); |
| 239 | - $markerArray[$_key]['###COUNT_VOLUMES###'] = htmlspecialchars(count($collection['volumes']) . $labelVolumes); |
|
| 239 | + $markerArray[$_key]['###COUNT_VOLUMES###'] = htmlspecialchars(count($collection['volumes']).$labelVolumes); |
|
| 240 | 240 | } |
| 241 | 241 | // Randomize sorting? |
| 242 | 242 | if (!empty($this->conf['randomize'])) { |
@@ -320,14 +320,14 @@ discard block |
||
| 320 | 320 | $collectionData = $resArray; |
| 321 | 321 | } |
| 322 | 322 | } else { |
| 323 | - $this->logger->warning('No collection with UID ' . $id . ' found.'); |
|
| 323 | + $this->logger->warning('No collection with UID '.$id.' found.'); |
|
| 324 | 324 | return; |
| 325 | 325 | } |
| 326 | 326 | // Fetch corresponding document UIDs from Solr. |
| 327 | 327 | if ($collectionData['index_search'] != '') { |
| 328 | - $solr_query = '(' . $collectionData['index_search'] . ')'; |
|
| 328 | + $solr_query = '('.$collectionData['index_search'].')'; |
|
| 329 | 329 | } else { |
| 330 | - $solr_query = 'collection:("' . $collectionData['index_name'] . '") AND toplevel:true'; |
|
| 330 | + $solr_query = 'collection:("'.$collectionData['index_name'].'") AND toplevel:true'; |
|
| 331 | 331 | } |
| 332 | 332 | $solr = Solr::getInstance($this->conf['solrcore']); |
| 333 | 333 | if (!$solr->ready) { |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | 'source' => 'collection', |
| 377 | 377 | 'select' => $id, |
| 378 | 378 | 'userid' => $collectionData['userid'], |
| 379 | - 'params' => ['filterquery' => [['query' => 'collection_faceting:("' . $collectionData['index_name'] . '")']]], |
|
| 379 | + 'params' => ['filterquery' => [['query' => 'collection_faceting:("'.$collectionData['index_name'].'")']]], |
|
| 380 | 380 | 'core' => '', |
| 381 | 381 | 'pid' => $this->conf['pages'], |
| 382 | 382 | 'order' => 'title', |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | ]; |
| 406 | 406 | } else { |
| 407 | 407 | // volume_sorting should be always set - but it's not a required field. We append the uid to the array key to make it always unique. |
| 408 | - $subparts[$resArray['partof']][$resArray['volume_sorting'] . str_pad($resArray['uid'], 9, '0', STR_PAD_LEFT)] = [ |
|
| 408 | + $subparts[$resArray['partof']][$resArray['volume_sorting'].str_pad($resArray['uid'], 9, '0', STR_PAD_LEFT)] = [ |
|
| 409 | 409 | 'u' => $resArray['uid'], |
| 410 | 410 | 'h' => '', |
| 411 | 411 | 's' => $sorting, |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 441 | 441 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'] |
| 442 | 442 | ]; |
| 443 | - header('Location: ' . GeneralUtility::locationHeaderUrl($this->cObj->typoLink_URL($linkConf))); |
|
| 443 | + header('Location: '.GeneralUtility::locationHeaderUrl($this->cObj->typoLink_URL($linkConf))); |
|
| 444 | 444 | exit; |
| 445 | 445 | } |
| 446 | 446 | } |
@@ -159,13 +159,13 @@ discard block |
||
| 159 | 159 | $oai_dc = $this->oai->createElementNS($this->formats['oai_dc']['namespace'], 'oai_dc:dc'); |
| 160 | 160 | $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:dc', 'http://purl.org/dc/elements/1.1/'); |
| 161 | 161 | $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); |
| 162 | - $oai_dc->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['oai_dc']['namespace'] . ' ' . $this->formats['oai_dc']['schema']); |
|
| 162 | + $oai_dc->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['oai_dc']['namespace'].' '.$this->formats['oai_dc']['schema']); |
|
| 163 | 163 | $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', htmlspecialchars($metadata['record_id'], ENT_NOQUOTES, 'UTF-8'))); |
| 164 | 164 | if (!empty($metadata['purl'])) { |
| 165 | 165 | $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', htmlspecialchars($metadata['purl'], ENT_NOQUOTES, 'UTF-8'))); |
| 166 | 166 | } |
| 167 | 167 | if (!empty($metadata['prod_id'])) { |
| 168 | - $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', 'kitodo:production:' . htmlspecialchars($metadata['prod_id'], ENT_NOQUOTES, 'UTF-8'))); |
|
| 168 | + $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', 'kitodo:production:'.htmlspecialchars($metadata['prod_id'], ENT_NOQUOTES, 'UTF-8'))); |
|
| 169 | 169 | } |
| 170 | 170 | if (!empty($metadata['urn'])) { |
| 171 | 171 | $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', htmlspecialchars($metadata['urn'], ENT_NOQUOTES, 'UTF-8'))); |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | } |
| 263 | 263 | // Add attributes and build XML tree. |
| 264 | 264 | $epicur->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); |
| 265 | - $epicur->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['epicur']['namespace'] . ' ' . $this->formats['epicur']['schema']); |
|
| 265 | + $epicur->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['epicur']['namespace'].' '.$this->formats['epicur']['schema']); |
|
| 266 | 266 | // Do we update an URN or register a new one? |
| 267 | 267 | if ($metadata['tstamp'] == $metadata['crdate']) { |
| 268 | 268 | $update->setAttribute('type', 'urn_new'); |
@@ -309,10 +309,10 @@ discard block |
||
| 309 | 309 | // Import node into \DOMDocument. |
| 310 | 310 | $mets = $this->oai->importNode($root->item(0), true); |
| 311 | 311 | } else { |
| 312 | - $this->logger->error('No METS part found in document with location "' . $metadata['location'] . '"'); |
|
| 312 | + $this->logger->error('No METS part found in document with location "'.$metadata['location'].'"'); |
|
| 313 | 313 | } |
| 314 | 314 | } else { |
| 315 | - $this->logger->error('Could not load XML file from "' . $metadata['location'] . '"'); |
|
| 315 | + $this->logger->error('Could not load XML file from "'.$metadata['location'].'"'); |
|
| 316 | 316 | } |
| 317 | 317 | if ($mets === null) { |
| 318 | 318 | $mets = $this->oai->createElementNS('http://kitodo.org/', 'kitodo:error', htmlspecialchars($this->pi_getLL('error', 'Error!'), ENT_NOQUOTES, 'UTF-8')); |
@@ -348,15 +348,15 @@ discard block |
||
| 348 | 348 | if (strpos($this->conf['stylesheet'], 'EXT:') === 0) { |
| 349 | 349 | [$extKey, $filePath] = explode('/', substr($this->conf['stylesheet'], 4), 2); |
| 350 | 350 | if (ExtensionManagementUtility::isLoaded($extKey)) { |
| 351 | - $this->conf['stylesheet'] = PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($extKey)) . $filePath; |
|
| 351 | + $this->conf['stylesheet'] = PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($extKey)).$filePath; |
|
| 352 | 352 | } |
| 353 | 353 | } |
| 354 | 354 | $stylesheet = GeneralUtility::locationHeaderUrl($this->conf['stylesheet']); |
| 355 | 355 | } else { |
| 356 | 356 | // Use default stylesheet if no custom stylesheet is given. |
| 357 | - $stylesheet = GeneralUtility::locationHeaderUrl(PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)) . 'Resources/Public/Stylesheets/OaiPmh.xsl'); |
|
| 357 | + $stylesheet = GeneralUtility::locationHeaderUrl(PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)).'Resources/Public/Stylesheets/OaiPmh.xsl'); |
|
| 358 | 358 | } |
| 359 | - $this->oai->appendChild($this->oai->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="' . htmlspecialchars($stylesheet, ENT_NOQUOTES, 'UTF-8') . '"')); |
|
| 359 | + $this->oai->appendChild($this->oai->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="'.htmlspecialchars($stylesheet, ENT_NOQUOTES, 'UTF-8').'"')); |
|
| 360 | 360 | // Create root element. |
| 361 | 361 | $root = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'OAI-PMH'); |
| 362 | 362 | $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); |
@@ -407,10 +407,10 @@ discard block |
||
| 407 | 407 | // Send headers. |
| 408 | 408 | header('HTTP/1.1 200 OK'); |
| 409 | 409 | header('Cache-Control: no-cache'); |
| 410 | - header('Content-Length: ' . strlen($content)); |
|
| 410 | + header('Content-Length: '.strlen($content)); |
|
| 411 | 411 | header('Content-Type: text/xml; charset=utf-8'); |
| 412 | - header('Date: ' . date('r', $GLOBALS['EXEC_TIME'])); |
|
| 413 | - header('Expires: ' . date('r', $GLOBALS['EXEC_TIME'] + $this->conf['expired'])); |
|
| 412 | + header('Date: '.date('r', $GLOBALS['EXEC_TIME'])); |
|
| 413 | + header('Expires: '.date('r', $GLOBALS['EXEC_TIME'] + $this->conf['expired'])); |
|
| 414 | 414 | echo $content; |
| 415 | 415 | exit; |
| 416 | 416 | } |
@@ -471,16 +471,16 @@ discard block |
||
| 471 | 471 | |
| 472 | 472 | $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tx_dlf_documents'); |
| 473 | 473 | |
| 474 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
| 475 | - 'FROM `tx_dlf_documents` ' . |
|
| 476 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
| 477 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
| 478 | - 'WHERE `tx_dlf_documents`.`record_id` = ? ' . |
|
| 479 | - 'AND `tx_dlf_documents`.`pid` = ? ' . |
|
| 480 | - 'AND `tx_dlf_collections`.`pid` = ? ' . |
|
| 481 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
| 482 | - $where . |
|
| 483 | - 'AND ' . Helper::whereExpression('tx_dlf_collections'); |
|
| 474 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
| 475 | + 'FROM `tx_dlf_documents` '. |
|
| 476 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
| 477 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
| 478 | + 'WHERE `tx_dlf_documents`.`record_id` = ? '. |
|
| 479 | + 'AND `tx_dlf_documents`.`pid` = ? '. |
|
| 480 | + 'AND `tx_dlf_collections`.`pid` = ? '. |
|
| 481 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
| 482 | + $where. |
|
| 483 | + 'AND '.Helper::whereExpression('tx_dlf_collections'); |
|
| 484 | 484 | |
| 485 | 485 | $values = [ |
| 486 | 486 | $this->piVars['identifier'], |
@@ -607,7 +607,7 @@ discard block |
||
| 607 | 607 | $timestamp = $resArray['tstamp']; |
| 608 | 608 | $earliestDatestamp = gmdate('Y-m-d\TH:i:s\Z', $timestamp); |
| 609 | 609 | } else { |
| 610 | - $this->logger->notice('No records found with PID ' . $this->conf['pages']); |
|
| 610 | + $this->logger->notice('No records found with PID '.$this->conf['pages']); |
|
| 611 | 611 | } |
| 612 | 612 | $linkConf = [ |
| 613 | 613 | 'parameter' => $GLOBALS['TSFE']->id, |
@@ -868,9 +868,9 @@ discard block |
||
| 868 | 868 | } |
| 869 | 869 | $resArray = $allResults[0]; |
| 870 | 870 | if ($resArray['index_query'] != "") { |
| 871 | - $solr_query .= '(' . $resArray['index_query'] . ')'; |
|
| 871 | + $solr_query .= '('.$resArray['index_query'].')'; |
|
| 872 | 872 | } else { |
| 873 | - $solr_query .= 'collection:' . '"' . $resArray['index_name'] . '"'; |
|
| 873 | + $solr_query .= 'collection:'.'"'.$resArray['index_name'].'"'; |
|
| 874 | 874 | } |
| 875 | 875 | } else { |
| 876 | 876 | // If no set is specified we have to query for all collections |
@@ -878,7 +878,7 @@ discard block |
||
| 878 | 878 | } |
| 879 | 879 | // Check for required fields. |
| 880 | 880 | foreach ($this->formats[$this->piVars['metadataPrefix']]['requiredFields'] as $required) { |
| 881 | - $solr_query .= ' NOT ' . $required . ':""'; |
|
| 881 | + $solr_query .= ' NOT '.$required.':""'; |
|
| 882 | 882 | } |
| 883 | 883 | // toplevel="true" is always required |
| 884 | 884 | $solr_query .= ' AND toplevel:true'; |
@@ -891,7 +891,7 @@ discard block |
||
| 891 | 891 | || is_array($date_array = strptime($this->piVars['from'], '%Y-%m-%d')) |
| 892 | 892 | ) { |
| 893 | 893 | $timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'], $date_array['tm_mon'] + 1, $date_array['tm_mday'], $date_array['tm_year'] + 1900); |
| 894 | - $from = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.000Z'; |
|
| 894 | + $from = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.000Z'; |
|
| 895 | 895 | } else { |
| 896 | 896 | throw new \Exception('badArgument'); |
| 897 | 897 | } |
@@ -905,7 +905,7 @@ discard block |
||
| 905 | 905 | || is_array($date_array = strptime($this->piVars['until'], '%Y-%m-%d')) |
| 906 | 906 | ) { |
| 907 | 907 | $timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'], $date_array['tm_mon'] + 1, $date_array['tm_mday'], $date_array['tm_year'] + 1900); |
| 908 | - $until = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.999Z'; |
|
| 908 | + $until = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.999Z'; |
|
| 909 | 909 | if ($from != "*" && $from > $until) { |
| 910 | 910 | throw new \Exception('badArgument'); |
| 911 | 911 | } |
@@ -922,7 +922,7 @@ discard block |
||
| 922 | 922 | throw new \Exception('badArgument'); |
| 923 | 923 | } |
| 924 | 924 | } |
| 925 | - $solr_query .= ' AND timestamp:[' . $from . ' TO ' . $until . ']'; |
|
| 925 | + $solr_query .= ' AND timestamp:['.$from.' TO '.$until.']'; |
|
| 926 | 926 | $documentSet = []; |
| 927 | 927 | $solr = Solr::getInstance($this->conf['solrcore']); |
| 928 | 928 | if (!$solr->ready) { |
@@ -965,16 +965,16 @@ discard block |
||
| 965 | 965 | $connection = GeneralUtility::makeInstance(ConnectionPool::class) |
| 966 | 966 | ->getConnectionForTable('tx_dlf_documents'); |
| 967 | 967 | |
| 968 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
| 969 | - 'FROM `tx_dlf_documents` ' . |
|
| 970 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
| 971 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
| 972 | - 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) ' . |
|
| 973 | - 'AND `tx_dlf_documents`.`pid` = ? ' . |
|
| 974 | - 'AND `tx_dlf_collections`.`pid` = ? ' . |
|
| 975 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
| 976 | - 'AND ' . Helper::whereExpression('tx_dlf_collections') . ' ' . |
|
| 977 | - 'GROUP BY `tx_dlf_documents`.`uid` ' . |
|
| 968 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
| 969 | + 'FROM `tx_dlf_documents` '. |
|
| 970 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
| 971 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
| 972 | + 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) '. |
|
| 973 | + 'AND `tx_dlf_documents`.`pid` = ? '. |
|
| 974 | + 'AND `tx_dlf_collections`.`pid` = ? '. |
|
| 975 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
| 976 | + 'AND '.Helper::whereExpression('tx_dlf_collections').' '. |
|
| 977 | + 'GROUP BY `tx_dlf_documents`.`uid` '. |
|
| 978 | 978 | 'LIMIT ?'; |
| 979 | 979 | |
| 980 | 980 | $values = [ |
@@ -81,12 +81,12 @@ discard block |
||
| 81 | 81 | return ''; |
| 82 | 82 | } |
| 83 | 83 | // Get separator. |
| 84 | - $separator = '<span class="separator">' . htmlspecialchars($this->pi_getLL('separator', ' - ')) . '</span>'; |
|
| 84 | + $separator = '<span class="separator">'.htmlspecialchars($this->pi_getLL('separator', ' - ')).'</span>'; |
|
| 85 | 85 | // Add link to previous page. |
| 86 | 86 | if ($this->piVars['pointer'] > 0) { |
| 87 | - $output = $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('prevPage', '<')), ['pointer' => $this->piVars['pointer'] - 1], true) . $separator; |
|
| 87 | + $output = $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('prevPage', '<')), ['pointer' => $this->piVars['pointer'] - 1], true).$separator; |
|
| 88 | 88 | } else { |
| 89 | - $output = '<span>' . htmlspecialchars($this->pi_getLL('prevPage', '<')) . '</span>' . $separator; |
|
| 89 | + $output = '<span>'.htmlspecialchars($this->pi_getLL('prevPage', '<')).'</span>'.$separator; |
|
| 90 | 90 | } |
| 91 | 91 | $i = 0; |
| 92 | 92 | $skip = null; |
@@ -94,13 +94,13 @@ discard block |
||
| 94 | 94 | while ($i < $maxPages) { |
| 95 | 95 | if ($i < 3 || ($i > $this->piVars['pointer'] - 3 && $i < $this->piVars['pointer'] + 3) || $i > $maxPages - 4) { |
| 96 | 96 | if ($this->piVars['pointer'] != $i) { |
| 97 | - $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)), ['pointer' => $i], true) . $separator; |
|
| 97 | + $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)), ['pointer' => $i], true).$separator; |
|
| 98 | 98 | } else { |
| 99 | - $output .= '<span class="active">' . htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)) . '</span>' . $separator; |
|
| 99 | + $output .= '<span class="active">'.htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)).'</span>'.$separator; |
|
| 100 | 100 | } |
| 101 | 101 | $skip = true; |
| 102 | 102 | } elseif ($skip === true) { |
| 103 | - $output .= '<span class="skip">' . htmlspecialchars($this->pi_getLL('skip', '...')) . '</span>' . $separator; |
|
| 103 | + $output .= '<span class="skip">'.htmlspecialchars($this->pi_getLL('skip', '...')).'</span>'.$separator; |
|
| 104 | 104 | $skip = false; |
| 105 | 105 | } |
| 106 | 106 | $i++; |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | if ($this->piVars['pointer'] < $maxPages - 1) { |
| 110 | 110 | $output .= $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('nextPage', '>')), ['pointer' => $this->piVars['pointer'] + 1], true); |
| 111 | 111 | } else { |
| 112 | - $output .= '<span>' . htmlspecialchars($this->pi_getLL('nextPage', '>')) . '</span>'; |
|
| 112 | + $output .= '<span>'.htmlspecialchars($this->pi_getLL('nextPage', '>')).'</span>'; |
|
| 113 | 113 | } |
| 114 | 114 | return $output; |
| 115 | 115 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | if (empty($value) && $this->conf['getTitle']) { |
| 147 | 147 | $superiorTitle = Document::getTitle($this->list[$number]['uid'], true); |
| 148 | 148 | if (!empty($superiorTitle)) { |
| 149 | - $value = '[' . $superiorTitle . ']'; |
|
| 149 | + $value = '['.$superiorTitle.']'; |
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | // Set fake title if still not present. |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | } |
| 196 | 196 | // Add thumbnail. |
| 197 | 197 | if (!empty($this->list[$number]['thumbnail'])) { |
| 198 | - $markerArray['###THUMBNAIL###'] = '<img alt="' . $imgAlt . '" src="' . $this->list[$number]['thumbnail'] . '" />'; |
|
| 198 | + $markerArray['###THUMBNAIL###'] = '<img alt="'.$imgAlt.'" src="'.$this->list[$number]['thumbnail'].'" />'; |
|
| 199 | 199 | } |
| 200 | 200 | // Add preview. |
| 201 | 201 | if (!empty($this->list[$number]['preview'])) { |
@@ -265,28 +265,28 @@ discard block |
||
| 265 | 265 | $linkConf['additionalParams'] = GeneralUtility::implodeArrayForUrl($this->prefixId, ['logicalPage' => $this->piVars['logicalPage']], '', true, false); |
| 266 | 266 | } |
| 267 | 267 | // Build HTML form. |
| 268 | - $sorting = '<form action="' . $this->cObj->typoLink_URL($linkConf) . '" method="get"><div><input type="hidden" name="id" value="' . $GLOBALS['TSFE']->id . '" />'; |
|
| 268 | + $sorting = '<form action="'.$this->cObj->typoLink_URL($linkConf).'" method="get"><div><input type="hidden" name="id" value="'.$GLOBALS['TSFE']->id.'" />'; |
|
| 269 | 269 | foreach ($this->piVars as $piVar => $value) { |
| 270 | 270 | if ($piVar != 'order' && $piVar != 'DATA' && !empty($value)) { |
| 271 | - $sorting .= '<input type="hidden" name="' . $this->prefixId . '[' . preg_replace('/[^A-Za-z0-9_-]/', '', $piVar) . ']" value="' . htmlspecialchars($value) . '" />'; |
|
| 271 | + $sorting .= '<input type="hidden" name="'.$this->prefixId.'['.preg_replace('/[^A-Za-z0-9_-]/', '', $piVar).']" value="'.htmlspecialchars($value).'" />'; |
|
| 272 | 272 | } |
| 273 | 273 | } |
| 274 | 274 | // Select sort field. |
| 275 | - $uniqId = uniqid($prefix . '-'); |
|
| 276 | - $sorting .= '<label for="' . $uniqId . '">' . htmlspecialchars($this->pi_getLL('orderBy', '')) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[order]" onchange="javascript:this.form.submit();">'; |
|
| 275 | + $uniqId = uniqid($prefix.'-'); |
|
| 276 | + $sorting .= '<label for="'.$uniqId.'">'.htmlspecialchars($this->pi_getLL('orderBy', '')).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[order]" onchange="javascript:this.form.submit();">'; |
|
| 277 | 277 | // Add relevance sorting if this is a search result list. |
| 278 | 278 | if ($this->list->metadata['options']['source'] == 'search') { |
| 279 | - $sorting .= '<option value="score"' . (($this->list->metadata['options']['order'] == 'score') ? ' selected="selected"' : '') . '>' . htmlspecialchars($this->pi_getLL('relevance', '')) . '</option>'; |
|
| 279 | + $sorting .= '<option value="score"'.(($this->list->metadata['options']['order'] == 'score') ? ' selected="selected"' : '').'>'.htmlspecialchars($this->pi_getLL('relevance', '')).'</option>'; |
|
| 280 | 280 | } |
| 281 | 281 | foreach ($this->sortables as $index_name => $label) { |
| 282 | - $sorting .= '<option value="' . htmlspecialchars($index_name) . '"' . (($this->list->metadata['options']['order'] == $index_name) ? ' selected="selected"' : '') . '>' . htmlspecialchars($label) . '</option>'; |
|
| 282 | + $sorting .= '<option value="'.htmlspecialchars($index_name).'"'.(($this->list->metadata['options']['order'] == $index_name) ? ' selected="selected"' : '').'>'.htmlspecialchars($label).'</option>'; |
|
| 283 | 283 | } |
| 284 | 284 | $sorting .= '</select>'; |
| 285 | 285 | // Select sort direction. |
| 286 | - $uniqId = uniqid($prefix . '-'); |
|
| 287 | - $sorting .= '<label for="' . $uniqId . '">' . htmlspecialchars($this->pi_getLL('direction', '')) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[asc]" onchange="javascript:this.form.submit();">'; |
|
| 288 | - $sorting .= '<option value="1" ' . ($this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '') . '>' . htmlspecialchars($this->pi_getLL('direction.asc', '')) . '</option>'; |
|
| 289 | - $sorting .= '<option value="0" ' . (!$this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '') . '>' . htmlspecialchars($this->pi_getLL('direction.desc', '')) . '</option>'; |
|
| 286 | + $uniqId = uniqid($prefix.'-'); |
|
| 287 | + $sorting .= '<label for="'.$uniqId.'">'.htmlspecialchars($this->pi_getLL('direction', '')).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[asc]" onchange="javascript:this.form.submit();">'; |
|
| 288 | + $sorting .= '<option value="1" '.($this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '').'>'.htmlspecialchars($this->pi_getLL('direction.asc', '')).'</option>'; |
|
| 289 | + $sorting .= '<option value="0" '.(!$this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '').'>'.htmlspecialchars($this->pi_getLL('direction.desc', '')).'</option>'; |
|
| 290 | 290 | $sorting .= '</select></div></form>'; |
| 291 | 291 | return $sorting; |
| 292 | 292 | } |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | if (empty($value) && $this->conf['getTitle']) { |
| 323 | 323 | $superiorTitle = Document::getTitle($subpart['uid'], true); |
| 324 | 324 | if (!empty($superiorTitle)) { |
| 325 | - $value = '[' . $superiorTitle . ']'; |
|
| 325 | + $value = '['.$superiorTitle.']'; |
|
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 | // Set fake title if still not present. |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | $value = htmlspecialchars(Helper::translate($value, 'tx_dlf_structures', $this->conf['pages'])); |
| 357 | 357 | // Add page number for single pages. |
| 358 | 358 | if ($_value == 'page') { |
| 359 | - $value .= ' ' . intval($subpart['page']); |
|
| 359 | + $value .= ' '.intval($subpart['page']); |
|
| 360 | 360 | } |
| 361 | 361 | } elseif ($index_name == 'language' && !empty($value)) { |
| 362 | 362 | // Translate ISO 639 language code. |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | } |
| 378 | 378 | // Add thumbnail. |
| 379 | 379 | if (!empty($subpart['thumbnail'])) { |
| 380 | - $markerArray['###SUBTHUMBNAIL###'] = '<img alt="' . $imgAlt . '" src="' . $subpart['thumbnail'] . '" />'; |
|
| 380 | + $markerArray['###SUBTHUMBNAIL###'] = '<img alt="'.$imgAlt.'" src="'.$subpart['thumbnail'].'" />'; |
|
| 381 | 381 | } |
| 382 | 382 | // Add preview. |
| 383 | 383 | if (!empty($subpart['preview'])) { |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | || (isset($this->piVars['asc']) && $this->piVars['asc'] != $listMetadata['options']['order.asc']) |
| 492 | 492 | ) { |
| 493 | 493 | // Update list's metadata. |
| 494 | - $listMetadata['options']['params']['sort'] = [$this->piVars['order'] . "_sorting" => (bool) $this->piVars['asc'] ? 'asc' : 'desc']; |
|
| 494 | + $listMetadata['options']['params']['sort'] = [$this->piVars['order']."_sorting" => (bool) $this->piVars['asc'] ? 'asc' : 'desc']; |
|
| 495 | 495 | $listMetadata['options']['order'] = $this->piVars['order']; |
| 496 | 496 | $listMetadata['options']['order.asc'] = (bool) $this->piVars['asc']; |
| 497 | 497 | // Reset pointer. |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | $this->list = $solr->search(); |
| 516 | 516 | } |
| 517 | 517 | // Add list description |
| 518 | - $listMetadata['description'] = '<p class="tx-dlf-search-numHits">' . htmlspecialchars(sprintf($this->pi_getLL('hits', ''), $this->list->metadata['options']['numberOfHits'], $this->list->metadata['options']['numberOfToplevelHits'])) . '</p>'; |
|
| 518 | + $listMetadata['description'] = '<p class="tx-dlf-search-numHits">'.htmlspecialchars(sprintf($this->pi_getLL('hits', ''), $this->list->metadata['options']['numberOfHits'], $this->list->metadata['options']['numberOfToplevelHits'])).'</p>'; |
|
| 519 | 519 | $this->list->metadata = $listMetadata; |
| 520 | 520 | // Save updated list. |
| 521 | 521 | $this->list->save(); |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | $markerArray['###LISTTITLE###'] = $this->list->metadata['label']; |
| 545 | 545 | $markerArray['###LISTDESCRIPTION###'] = $this->list->metadata['description']; |
| 546 | 546 | if (!empty($this->list->metadata['thumbnail'])) { |
| 547 | - $markerArray['###LISTTHUMBNAIL###'] = '<img alt="" src="' . $this->list->metadata['thumbnail'] . '" />'; |
|
| 547 | + $markerArray['###LISTTHUMBNAIL###'] = '<img alt="" src="'.$this->list->metadata['thumbnail'].'" />'; |
|
| 548 | 548 | } else { |
| 549 | 549 | $markerArray['###LISTTHUMBNAIL###'] = ''; |
| 550 | 550 | } |