@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | * @subpackage dlf |
| 26 | 26 | * @access public |
| 27 | 27 | */ |
| 28 | -class Calendar extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 29 | -{ |
|
| 28 | +class Calendar extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 30 | 29 | public $scriptRelPath = 'Classes/Plugin/Calendar.php'; |
| 31 | 30 | |
| 32 | 31 | /** |
@@ -47,8 +46,7 @@ discard block |
||
| 47 | 46 | * |
| 48 | 47 | * @return string The content that is displayed on the website |
| 49 | 48 | */ |
| 50 | - public function main($content, $conf) |
|
| 51 | - { |
|
| 49 | + public function main($content, $conf) { |
|
| 52 | 50 | $this->init($conf); |
| 53 | 51 | |
| 54 | 52 | // Set initial document (anchor or year file) if configured. |
@@ -95,8 +93,7 @@ discard block |
||
| 95 | 93 | * |
| 96 | 94 | * @return string The content that is displayed on the website |
| 97 | 95 | */ |
| 98 | - public function calendar($content, $conf) |
|
| 99 | - { |
|
| 96 | + public function calendar($content, $conf) { |
|
| 100 | 97 | $this->init($conf); |
| 101 | 98 | // Load current document. |
| 102 | 99 | $this->loadDocument(); |
@@ -241,8 +238,7 @@ discard block |
||
| 241 | 238 | * |
| 242 | 239 | * @return string Content for template subpart |
| 243 | 240 | */ |
| 244 | - protected function getCalendarYear($calendarIssuesByMonth, $year, $firstMonth = 1, $lastMonth = 12) |
|
| 245 | - { |
|
| 241 | + protected function getCalendarYear($calendarIssuesByMonth, $year, $firstMonth = 1, $lastMonth = 12) { |
|
| 246 | 242 | // Get subpart templates. |
| 247 | 243 | $subPartContent = ''; |
| 248 | 244 | $subParts['month'] = $this->templateService->getSubpart($this->template, '###CALMONTH###'); |
@@ -360,8 +356,7 @@ discard block |
||
| 360 | 356 | * |
| 361 | 357 | * @return string The content that is displayed on the website |
| 362 | 358 | */ |
| 363 | - public function years($content, $conf) |
|
| 364 | - { |
|
| 359 | + public function years($content, $conf) { |
|
| 365 | 360 | $this->init($conf); |
| 366 | 361 | // Load current document. |
| 367 | 362 | $this->loadDocument(); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $_day = date('j', $dateTimestamp); |
| 158 | 158 | $calendarIssuesByYear[$_year][$_month][$_day][] = $issue; |
| 159 | 159 | } else { |
| 160 | - Helper::devLog('Document with UID ' . $issue['uid'] . 'has no valid date of publication', DEVLOG_SEVERITY_WARNING); |
|
| 160 | + Helper::devLog('Document with UID '.$issue['uid'].'has no valid date of publication', DEVLOG_SEVERITY_WARNING); |
|
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | // Sort by years. |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | 'parameter' => $GLOBALS['TSFE']->id, |
| 207 | 207 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 208 | 208 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 209 | - 'additionalParams' => '&' . $this->prefixId . '[id]=' . urlencode($this->doc->uid), |
|
| 209 | + 'additionalParams' => '&'.$this->prefixId.'[id]='.urlencode($this->doc->uid), |
|
| 210 | 210 | ]; |
| 211 | 211 | $linkTitleData = $this->doc->getTitledata(); |
| 212 | 212 | $linkTitle = !empty($linkTitleData['mets_orderlabel'][0]) ? $linkTitleData['mets_orderlabel'][0] : $linkTitleData['mets_label'][0]; |
@@ -217,9 +217,9 @@ discard block |
||
| 217 | 217 | 'parameter' => $GLOBALS['TSFE']->id, |
| 218 | 218 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 219 | 219 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 220 | - 'additionalParams' => '&' . $this->prefixId . '[id]=' . urlencode($this->doc->parentId), |
|
| 220 | + 'additionalParams' => '&'.$this->prefixId.'[id]='.urlencode($this->doc->parentId), |
|
| 221 | 221 | ]; |
| 222 | - $allYearsLink = $this->cObj->typoLink(htmlspecialchars($this->pi_getLL('allYears', '')) . ' ' . $this->doc->getTitle($this->doc->parentId), $linkConf); |
|
| 222 | + $allYearsLink = $this->cObj->typoLink(htmlspecialchars($this->pi_getLL('allYears', '')).' '.$this->doc->getTitle($this->doc->parentId), $linkConf); |
|
| 223 | 223 | // Fill marker array. |
| 224 | 224 | $markerArray = [ |
| 225 | 225 | '###CALENDARVIEWACTIVE###' => count($this->allIssues) > 5 ? 'active' : '', |
@@ -260,19 +260,19 @@ discard block |
||
| 260 | 260 | '###DAYFRI_NAME###' => strftime('%a', strtotime('last Friday')), |
| 261 | 261 | '###DAYSAT_NAME###' => strftime('%a', strtotime('last Saturday')), |
| 262 | 262 | '###DAYSUN_NAME###' => strftime('%a', strtotime('last Sunday')), |
| 263 | - '###MONTHNAME###' => strftime('%B', strtotime($year . '-' . $i . '-1')) . ' ' . $year, |
|
| 264 | - '###CALYEAR###' => ($i == $firstMonth) ? '<div class="year">' . $year . '</div>' : '' |
|
| 263 | + '###MONTHNAME###' => strftime('%B', strtotime($year.'-'.$i.'-1')).' '.$year, |
|
| 264 | + '###CALYEAR###' => ($i == $firstMonth) ? '<div class="year">'.$year.'</div>' : '' |
|
| 265 | 265 | ]; |
| 266 | 266 | // Fill the month markers. |
| 267 | 267 | $subPartContentMonth = $this->templateService->substituteMarkerArray($subParts['month'], $markerArray); |
| 268 | 268 | // Reset week content of new month. |
| 269 | 269 | $subPartContentWeek = ''; |
| 270 | - $firstOfMonth = strtotime($year . '-' . $i . '-1'); |
|
| 270 | + $firstOfMonth = strtotime($year.'-'.$i.'-1'); |
|
| 271 | 271 | $lastOfMonth = strtotime('last day of', ($firstOfMonth)); |
| 272 | 272 | $firstOfMonthStart = strtotime('last Monday', $firstOfMonth); |
| 273 | 273 | // There are never more than 6 weeks in a month. |
| 274 | 274 | for ($j = 0; $j <= 5; $j++) { |
| 275 | - $firstDayOfWeek = strtotime('+ ' . $j . ' Week', $firstOfMonthStart); |
|
| 275 | + $firstDayOfWeek = strtotime('+ '.$j.' Week', $firstOfMonthStart); |
|
| 276 | 276 | $weekArray = [ |
| 277 | 277 | '###DAYMON###' => ' ', |
| 278 | 278 | '###DAYTUE###' => ' ', |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | ]; |
| 285 | 285 | // Every week has seven days. ;-) |
| 286 | 286 | for ($k = 0; $k <= 6; $k++) { |
| 287 | - $currentDayTime = strtotime('+ ' . $k . ' Day', $firstDayOfWeek); |
|
| 287 | + $currentDayTime = strtotime('+ '.$k.' Day', $firstDayOfWeek); |
|
| 288 | 288 | if ( |
| 289 | 289 | $currentDayTime >= $firstOfMonth |
| 290 | 290 | && $currentDayTime <= $lastOfMonth |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | 'parameter' => $this->conf['targetPid'], |
| 305 | 305 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 306 | 306 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 307 | - 'additionalParams' => '&' . $this->prefixId . '[id]=' . urlencode($issue['uid']), |
|
| 307 | + 'additionalParams' => '&'.$this->prefixId.'[id]='.urlencode($issue['uid']), |
|
| 308 | 308 | 'ATagParams' => ' class="title"', |
| 309 | 309 | ]; |
| 310 | 310 | $dayLinksText[] = $this->cObj->typoLink($dayLinkLabel, $linkConf); |
@@ -316,13 +316,13 @@ discard block |
||
| 316 | 316 | if (!empty($dayLinksText)) { |
| 317 | 317 | $dayLinksList = '<ul>'; |
| 318 | 318 | foreach ($dayLinksText as $link) { |
| 319 | - $dayLinksList .= '<li>' . $link . '</li>'; |
|
| 319 | + $dayLinksList .= '<li>'.$link.'</li>'; |
|
| 320 | 320 | } |
| 321 | 321 | $dayLinksList .= '</ul>'; |
| 322 | 322 | } |
| 323 | - $dayLinkDiv = '<div class="issues"><h4>' . strftime('%d', $currentDayTime) . '</h4><div>' . $dayLinksList . '</div></div>'; |
|
| 323 | + $dayLinkDiv = '<div class="issues"><h4>'.strftime('%d', $currentDayTime).'</h4><div>'.$dayLinksList.'</div></div>'; |
|
| 324 | 324 | } |
| 325 | - switch (strftime('%w', strtotime('+ ' . $k . ' Day', $firstDayOfWeek))) { |
|
| 325 | + switch (strftime('%w', strtotime('+ '.$k.' Day', $firstDayOfWeek))) { |
|
| 326 | 326 | case '0': |
| 327 | 327 | $weekArray['###DAYSUN###'] = ((int) $dayLinks === (int) date('j', $currentDayTime)) ? $dayLinkDiv : strftime('%d', $currentDayTime); |
| 328 | 328 | break; |
@@ -418,8 +418,8 @@ discard block |
||
| 418 | 418 | 'parameter' => $GLOBALS['TSFE']->id, |
| 419 | 419 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 420 | 420 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 421 | - 'additionalParams' => '&' . $this->prefixId . '[id]=' . urlencode($year['uid']), |
|
| 422 | - 'title' => $titleAnchor . ': ' . $year['title'] |
|
| 421 | + 'additionalParams' => '&'.$this->prefixId.'[id]='.urlencode($year['uid']), |
|
| 422 | + 'title' => $titleAnchor.': '.$year['title'] |
|
| 423 | 423 | ]; |
| 424 | 424 | $yearArray = [ |
| 425 | 425 | '###YEARNAME###' => $this->cObj->typoLink($year['title'], $linkConf), |
@@ -433,9 +433,9 @@ discard block |
||
| 433 | 433 | 'parameter' => $GLOBALS['TSFE']->id, |
| 434 | 434 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 435 | 435 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 436 | - 'additionalParams' => '&' . $this->prefixId . '[id]=' . $this->doc->uid, |
|
| 436 | + 'additionalParams' => '&'.$this->prefixId.'[id]='.$this->doc->uid, |
|
| 437 | 437 | ]; |
| 438 | - $allYearsLink = $this->cObj->typoLink(htmlspecialchars($this->pi_getLL('allYears', '')) . ' ' . $this->doc->getTitle($this->doc->uid), $linkConf); |
|
| 438 | + $allYearsLink = $this->cObj->typoLink(htmlspecialchars($this->pi_getLL('allYears', '')).' '.$this->doc->getTitle($this->doc->uid), $linkConf); |
|
| 439 | 439 | // Fill markers. |
| 440 | 440 | $markerArray = [ |
| 441 | 441 | '###LABEL_CHOOSE_YEAR###' => htmlspecialchars($this->pi_getLL('label.please_choose_year')), |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | // Load current document. |
| 60 | 60 | $this->loadDocument(); |
| 61 | - if ($this->doc === null) { |
|
| 61 | + if ($this->doc === NULL) { |
|
| 62 | 62 | // Quit without doing anything if required variables are not set. |
| 63 | 63 | return $content; |
| 64 | 64 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $this->init($conf); |
| 101 | 101 | // Load current document. |
| 102 | 102 | $this->loadDocument(); |
| 103 | - if ($this->doc === null) { |
|
| 103 | + if ($this->doc === NULL) { |
|
| 104 | 104 | // Quit without doing anything if required variables are not set. |
| 105 | 105 | return $content; |
| 106 | 106 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $title = $resArray['title']; |
| 138 | 138 | } else { |
| 139 | 139 | $title = !empty($resArray['label']) ? $resArray['label'] : $resArray['orderlabel']; |
| 140 | - if (strtotime($title) !== false) { |
|
| 140 | + if (strtotime($title) !== FALSE) { |
|
| 141 | 141 | $title = strftime('%x', strtotime($title)); |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $calendarIssuesByYear = []; |
| 152 | 152 | foreach ($issues as $issue) { |
| 153 | 153 | $dateTimestamp = strtotime($issue['year']); |
| 154 | - if ($dateTimestamp !== false) { |
|
| 154 | + if ($dateTimestamp !== FALSE) { |
|
| 155 | 155 | $_year = date('Y', $dateTimestamp); |
| 156 | 156 | $_month = date('n', $dateTimestamp); |
| 157 | 157 | $_day = date('j', $dateTimestamp); |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | $this->init($conf); |
| 372 | 372 | // Load current document. |
| 373 | 373 | $this->loadDocument(); |
| 374 | - if ($this->doc === null) { |
|
| 374 | + if ($this->doc === NULL) { |
|
| 375 | 375 | // Quit without doing anything if required variables are not set. |
| 376 | 376 | return $content; |
| 377 | 377 | } |
@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | * @subpackage dlf |
| 21 | 21 | * @access public |
| 22 | 22 | */ |
| 23 | -class Validator extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 24 | -{ |
|
| 23 | +class Validator extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 25 | 24 | public $scriptRelPath = 'Classes/Plugin/Validator.php'; |
| 26 | 25 | |
| 27 | 26 | /** |
@@ -34,8 +33,7 @@ discard block |
||
| 34 | 33 | * |
| 35 | 34 | * @return string The content that is displayed on the website |
| 36 | 35 | */ |
| 37 | - public function main($content, $conf) |
|
| 38 | - { |
|
| 36 | + public function main($content, $conf) { |
|
| 39 | 37 | $this->init($conf); |
| 40 | 38 | // Disable caching for this plugin. |
| 41 | 39 | $this->setCache(false); |
@@ -38,12 +38,12 @@ |
||
| 38 | 38 | { |
| 39 | 39 | $this->init($conf); |
| 40 | 40 | // Disable caching for this plugin. |
| 41 | - $this->setCache(false); |
|
| 41 | + $this->setCache(FALSE); |
|
| 42 | 42 | // Load template file. |
| 43 | 43 | $this->getTemplate(); |
| 44 | 44 | // Load current document. |
| 45 | 45 | $this->loadDocument(); |
| 46 | - if ($this->doc === null) { |
|
| 46 | + if ($this->doc === NULL) { |
|
| 47 | 47 | // Document could not be loaded. |
| 48 | 48 | // Check: |
| 49 | 49 | // - if document location is valid URL |
@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | * @subpackage dlf |
| 26 | 26 | * @access public |
| 27 | 27 | */ |
| 28 | -class Basket extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 29 | -{ |
|
| 28 | +class Basket extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 30 | 29 | public $scriptRelPath = 'Classes/Plugin/Basket.php'; |
| 31 | 30 | |
| 32 | 31 | /** |
@@ -39,8 +38,7 @@ discard block |
||
| 39 | 38 | * |
| 40 | 39 | * @return string The content that is displayed on the website |
| 41 | 40 | */ |
| 42 | - public function main($content, $conf) |
|
| 43 | - { |
|
| 41 | + public function main($content, $conf) { |
|
| 44 | 42 | $this->init($conf); |
| 45 | 43 | // Don't cache the output. |
| 46 | 44 | $this->setCache(false); |
@@ -233,8 +231,7 @@ discard block |
||
| 233 | 231 | * |
| 234 | 232 | * @return string One basket entry |
| 235 | 233 | */ |
| 236 | - protected function getEntry($data, $template) |
|
| 237 | - { |
|
| 234 | + protected function getEntry($data, $template) { |
|
| 238 | 235 | if (is_object($data)) { |
| 239 | 236 | $data = get_object_vars($data); |
| 240 | 237 | } |
@@ -282,8 +279,7 @@ discard block |
||
| 282 | 279 | * |
| 283 | 280 | * @return array Basket data and Javascript output |
| 284 | 281 | */ |
| 285 | - protected function addToBasket($_piVars, $basketData) |
|
| 286 | - { |
|
| 282 | + protected function addToBasket($_piVars, $basketData) { |
|
| 287 | 283 | $output = ''; |
| 288 | 284 | if (!$_piVars['startpage']) { |
| 289 | 285 | $page = 0; |
@@ -375,8 +371,7 @@ discard block |
||
| 375 | 371 | * |
| 376 | 372 | * @return array basket data |
| 377 | 373 | */ |
| 378 | - protected function removeFromBasket($_piVars, $basketData) |
|
| 379 | - { |
|
| 374 | + protected function removeFromBasket($_piVars, $basketData) { |
|
| 380 | 375 | if (!empty($basketData['doc_ids'])) { |
| 381 | 376 | $items = $basketData['doc_ids']; |
| 382 | 377 | $items = get_object_vars($items); |
@@ -415,8 +410,7 @@ discard block |
||
| 415 | 410 | * |
| 416 | 411 | * @return array basket data |
| 417 | 412 | */ |
| 418 | - protected function openFromBasket($_piVars, $basketData) |
|
| 419 | - { |
|
| 413 | + protected function openFromBasket($_piVars, $basketData) { |
|
| 420 | 414 | $pdfUrl = $this->conf['pdfgenerate']; |
| 421 | 415 | foreach ($this->piVars['selected'] as $docValue) { |
| 422 | 416 | if ($docValue['id']) { |
@@ -438,8 +432,7 @@ discard block |
||
| 438 | 432 | * |
| 439 | 433 | * @return mixed download url or false |
| 440 | 434 | */ |
| 441 | - protected function getDocumentData($id, $data) |
|
| 442 | - { |
|
| 435 | + protected function getDocumentData($id, $data) { |
|
| 443 | 436 | // get document instance to load further information |
| 444 | 437 | $document = Document::getInstance($id, 0); |
| 445 | 438 | if ($document) { |
@@ -499,8 +492,7 @@ discard block |
||
| 499 | 492 | * |
| 500 | 493 | * @return void |
| 501 | 494 | */ |
| 502 | - protected function sendMail() |
|
| 503 | - { |
|
| 495 | + protected function sendMail() { |
|
| 504 | 496 | // send mail |
| 505 | 497 | $mailId = $this->piVars['mail_action']; |
| 506 | 498 | |
@@ -590,8 +582,7 @@ discard block |
||
| 590 | 582 | * |
| 591 | 583 | * @return void |
| 592 | 584 | */ |
| 593 | - protected function printDocument() |
|
| 594 | - { |
|
| 585 | + protected function printDocument() { |
|
| 595 | 586 | $pdfUrl = $this->conf['pdfprint']; |
| 596 | 587 | $numberOfPages = 0; |
| 597 | 588 | foreach ($this->piVars['selected'] as $docId => $docValue) { |
@@ -164,9 +164,9 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | if ($resultMail->rowCount() > 0) { |
| 166 | 166 | $mailForm = '<select name="tx_dlf[mail_action]">'; |
| 167 | - $mailForm .= '<option value="">' . htmlspecialchars($this->pi_getLL('chooseMail', '')) . '</option>'; |
|
| 167 | + $mailForm .= '<option value="">'.htmlspecialchars($this->pi_getLL('chooseMail', '')).'</option>'; |
|
| 168 | 168 | while ($row = $resultMail->fetch()) { |
| 169 | - $mailForm .= '<option value="' . $row['uid'] . '">' . htmlspecialchars($row['name']) . ' (' . htmlspecialchars($row['mail']) . ')</option>'; |
|
| 169 | + $mailForm .= '<option value="'.$row['uid'].'">'.htmlspecialchars($row['name']).' ('.htmlspecialchars($row['mail']).')</option>'; |
|
| 170 | 170 | } |
| 171 | 171 | $mailForm .= '</select><input type="submit">'; |
| 172 | 172 | } |
@@ -175,9 +175,9 @@ discard block |
||
| 175 | 175 | // remove action form |
| 176 | 176 | $markerArray['###REMOVEACTION###'] = ' |
| 177 | 177 | <select name="tx_dlf[basket_action]"> |
| 178 | - <option value="">' . htmlspecialchars($this->pi_getLL('chooseAction', '')) . '</option> |
|
| 179 | - <option value="open">' . htmlspecialchars($this->pi_getLL('download', '')) . '</option> |
|
| 180 | - <option value="remove">' . htmlspecialchars($this->pi_getLL('remove', '')) . '</option> |
|
| 178 | + <option value="">' . htmlspecialchars($this->pi_getLL('chooseAction', '')).'</option> |
|
| 179 | + <option value="open">' . htmlspecialchars($this->pi_getLL('download', '')).'</option> |
|
| 180 | + <option value="remove">' . htmlspecialchars($this->pi_getLL('remove', '')).'</option> |
|
| 181 | 181 | </select> |
| 182 | 182 | <input type="submit"> |
| 183 | 183 | '; |
@@ -198,9 +198,9 @@ discard block |
||
| 198 | 198 | $printForm = ''; |
| 199 | 199 | if ($resultPrinter->rowCount() > 0) { |
| 200 | 200 | $printForm = '<select name="tx_dlf[print_action]">'; |
| 201 | - $printForm .= '<option value="">' . htmlspecialchars($this->pi_getLL('choosePrinter', '')) . '</option>'; |
|
| 201 | + $printForm .= '<option value="">'.htmlspecialchars($this->pi_getLL('choosePrinter', '')).'</option>'; |
|
| 202 | 202 | while ($row = $resultPrinter->fetch()) { |
| 203 | - $printForm .= '<option value="' . $row['uid'] . '">' . htmlspecialchars($row['label']) . '</option>'; |
|
| 203 | + $printForm .= '<option value="'.$row['uid'].'">'.htmlspecialchars($row['label']).'</option>'; |
|
| 204 | 204 | } |
| 205 | 205 | $printForm .= '</select><input type="submit" />'; |
| 206 | 206 | } |
@@ -257,23 +257,23 @@ discard block |
||
| 257 | 257 | $rotation = $data['rotation']; |
| 258 | 258 | $docData = $this->getDocumentData($id, $data); |
| 259 | 259 | $markerArray['###BASKETDATA###'] = $docData['downloadLink']; |
| 260 | - $arrayKey = $id . '_' . $startpage; |
|
| 260 | + $arrayKey = $id.'_'.$startpage; |
|
| 261 | 261 | if (isset($startX)) { |
| 262 | - $arrayKey .= '_' . $startX; |
|
| 262 | + $arrayKey .= '_'.$startX; |
|
| 263 | 263 | } |
| 264 | 264 | if (isset($endX)) { |
| 265 | - $arrayKey .= '_' . $endX; |
|
| 265 | + $arrayKey .= '_'.$endX; |
|
| 266 | 266 | } |
| 267 | - $controlMark = '<input value="' . $id . '" name="tx_dlf[selected][' . $arrayKey . '][id]" type="checkbox">'; |
|
| 268 | - $controlMark .= '<input value="' . $startpage . '" name="tx_dlf[selected][' . $arrayKey . '][startpage]" type="hidden">'; |
|
| 269 | - $controlMark .= '<input value="' . $endpage . '" name="tx_dlf[selected][' . $arrayKey . '][endpage]" type="hidden">'; |
|
| 267 | + $controlMark = '<input value="'.$id.'" name="tx_dlf[selected]['.$arrayKey.'][id]" type="checkbox">'; |
|
| 268 | + $controlMark .= '<input value="'.$startpage.'" name="tx_dlf[selected]['.$arrayKey.'][startpage]" type="hidden">'; |
|
| 269 | + $controlMark .= '<input value="'.$endpage.'" name="tx_dlf[selected]['.$arrayKey.'][endpage]" type="hidden">'; |
|
| 270 | 270 | // add hidden fields for detail information |
| 271 | 271 | if ($startX) { |
| 272 | - $controlMark .= '<input type="hidden" name="tx_dlf[selected][' . $arrayKey . '][startX]" value="' . $startX . '">'; |
|
| 273 | - $controlMark .= '<input type="hidden" name="tx_dlf[selected][' . $arrayKey . '][startY]" value="' . $startY . '">'; |
|
| 274 | - $controlMark .= '<input type="hidden" name="tx_dlf[selected][' . $arrayKey . '][endX]" value="' . $endX . '">'; |
|
| 275 | - $controlMark .= '<input type="hidden" name="tx_dlf[selected][' . $arrayKey . '][endY]" value="' . $endY . '">'; |
|
| 276 | - $controlMark .= '<input type="hidden" name="tx_dlf[selected][' . $arrayKey . '][rotation]" value="' . $rotation . '">'; |
|
| 272 | + $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][startX]" value="'.$startX.'">'; |
|
| 273 | + $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][startY]" value="'.$startY.'">'; |
|
| 274 | + $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][endX]" value="'.$endX.'">'; |
|
| 275 | + $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][endY]" value="'.$endY.'">'; |
|
| 276 | + $controlMark .= '<input type="hidden" name="tx_dlf[selected]['.$arrayKey.'][rotation]" value="'.$rotation.'">'; |
|
| 277 | 277 | } |
| 278 | 278 | // return one entry |
| 279 | 279 | $markerArray['###CONTROLS###'] = $controlMark; |
@@ -329,12 +329,12 @@ discard block |
||
| 329 | 329 | if ($_piVars['addToBasket'] == 'list') { |
| 330 | 330 | $documentItem['endpage'] = $document->numPages; |
| 331 | 331 | } |
| 332 | - $arrayKey = $documentItem['id'] . '_' . $page; |
|
| 332 | + $arrayKey = $documentItem['id'].'_'.$page; |
|
| 333 | 333 | if (!empty($documentItem['startX'])) { |
| 334 | - $arrayKey .= '_' . $documentItem['startX']; |
|
| 334 | + $arrayKey .= '_'.$documentItem['startX']; |
|
| 335 | 335 | } |
| 336 | 336 | if (!empty($documentItem['endX'])) { |
| 337 | - $arrayKey .= '_' . $documentItem['endX']; |
|
| 337 | + $arrayKey .= '_'.$documentItem['endX']; |
|
| 338 | 338 | } |
| 339 | 339 | // do not add more than one identical object |
| 340 | 340 | if (!in_array($arrayKey, $items)) { |
@@ -353,14 +353,14 @@ discard block |
||
| 353 | 353 | // remove parameter endpage |
| 354 | 354 | $pdfParams = str_replace(",##endpage##", '', $pdfParams); |
| 355 | 355 | } |
| 356 | - $pdfGenerateUrl = $this->conf['pdfgenerate'] . $pdfParams; |
|
| 356 | + $pdfGenerateUrl = $this->conf['pdfgenerate'].$pdfParams; |
|
| 357 | 357 | if ($this->conf['pregeneration']) { |
| 358 | 358 | // send ajax request to webapp |
| 359 | 359 | $output .= ' |
| 360 | 360 | <script> |
| 361 | 361 | $(document).ready(function(){ |
| 362 | 362 | $.ajax({ |
| 363 | - url: "' . $pdfGenerateUrl . '", |
|
| 363 | + url: "' . $pdfGenerateUrl.'", |
|
| 364 | 364 | }).done(function() { |
| 365 | 365 | }); |
| 366 | 366 | }); |
@@ -398,12 +398,12 @@ discard block |
||
| 398 | 398 | } |
| 399 | 399 | foreach ($_piVars['selected'] as $value) { |
| 400 | 400 | if (isset($value['id'])) { |
| 401 | - $arrayKey = $value['id'] . '_' . $value['startpage']; |
|
| 401 | + $arrayKey = $value['id'].'_'.$value['startpage']; |
|
| 402 | 402 | if (isset($value['startX'])) { |
| 403 | - $arrayKey .= '_' . $value['startX']; |
|
| 403 | + $arrayKey .= '_'.$value['startX']; |
|
| 404 | 404 | } |
| 405 | 405 | if (isset($value['endX'])) { |
| 406 | - $arrayKey .= '_' . $value['endX']; |
|
| 406 | + $arrayKey .= '_'.$value['endX']; |
|
| 407 | 407 | } |
| 408 | 408 | if (isset($items[$arrayKey])) { |
| 409 | 409 | unset($items[$arrayKey]); |
@@ -442,10 +442,10 @@ discard block |
||
| 442 | 442 | foreach ($this->piVars['selected'] as $docValue) { |
| 443 | 443 | if ($docValue['id']) { |
| 444 | 444 | $docData = $this->getDocumentData($docValue['id'], $docValue); |
| 445 | - $pdfUrl .= $docData['urlParams'] . $this->conf['pdfparamseparator']; |
|
| 445 | + $pdfUrl .= $docData['urlParams'].$this->conf['pdfparamseparator']; |
|
| 446 | 446 | } |
| 447 | 447 | } |
| 448 | - header('Location: ' . $pdfUrl); |
|
| 448 | + header('Location: '.$pdfUrl); |
|
| 449 | 449 | ob_end_flush(); |
| 450 | 450 | exit; |
| 451 | 451 | } |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | $urlParams = str_replace("##endx##", $data['endX'] === "" ? "" : intval($data['endX']), $urlParams); |
| 480 | 480 | $urlParams = str_replace("##endy##", $data['endY'] === "" ? "" : intval($data['endY']), $urlParams); |
| 481 | 481 | $urlParams = str_replace("##rotation##", $data['rotation'] === "" ? "" : intval($data['rotation']), $urlParams); |
| 482 | - $downloadUrl = $this->conf['pdfgenerate'] . $urlParams; |
|
| 482 | + $downloadUrl = $this->conf['pdfgenerate'].$urlParams; |
|
| 483 | 483 | $title = $document->getTitle($id, true); |
| 484 | 484 | if (empty($title)) { |
| 485 | 485 | $title = $this->pi_getLL('noTitle', ''); |
@@ -488,15 +488,15 @@ discard block |
||
| 488 | 488 | $info = ''; |
| 489 | 489 | if ($data['startX'] != '' && $data['endX'] != '') { |
| 490 | 490 | // cutout |
| 491 | - $info .= htmlspecialchars($this->pi_getLL('cutout', '')) . ' '; |
|
| 491 | + $info .= htmlspecialchars($this->pi_getLL('cutout', '')).' '; |
|
| 492 | 492 | } |
| 493 | 493 | if ($data['startpage'] == $data['endpage']) { |
| 494 | 494 | // One page |
| 495 | - $info .= htmlspecialchars($this->pi_getLL('page', '')) . ' ' . $data['startpage']; |
|
| 495 | + $info .= htmlspecialchars($this->pi_getLL('page', '')).' '.$data['startpage']; |
|
| 496 | 496 | } else { |
| 497 | - $info .= htmlspecialchars($this->pi_getLL('page', '')) . ' ' . $data['startpage'] . '-' . $data['endpage']; |
|
| 497 | + $info .= htmlspecialchars($this->pi_getLL('page', '')).' '.$data['startpage'].'-'.$data['endpage']; |
|
| 498 | 498 | } |
| 499 | - $downloadLink = '<a href="' . $downloadUrl . '" target="_blank">' . htmlspecialchars($title) . '</a> (' . $info . ')'; |
|
| 499 | + $downloadLink = '<a href="'.$downloadUrl.'" target="_blank">'.htmlspecialchars($title).'</a> ('.$info.')'; |
|
| 500 | 500 | if ($data['startpage'] == $data['endpage']) { |
| 501 | 501 | $pageNums = 1; |
| 502 | 502 | } else { |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | |
| 542 | 542 | $allResults = $resultMail->fetchAll(); |
| 543 | 543 | $mailData = $allResults[0]; |
| 544 | - $mailText = htmlspecialchars($this->pi_getLL('mailBody', '')) . "\n"; |
|
| 544 | + $mailText = htmlspecialchars($this->pi_getLL('mailBody', ''))."\n"; |
|
| 545 | 545 | $numberOfPages = 0; |
| 546 | 546 | $pdfUrl = $this->conf['pdfdownload']; |
| 547 | 547 | // prepare links |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | if ($docValue['id']) { |
| 550 | 550 | $explodeId = explode("_", $docValue['id']); |
| 551 | 551 | $docData = $this->getDocumentData($explodeId[0], $docValue); |
| 552 | - $pdfUrl .= $docData['urlParams'] . $this->conf['pdfparamseparator']; |
|
| 552 | + $pdfUrl .= $docData['urlParams'].$this->conf['pdfparamseparator']; |
|
| 553 | 553 | $pages = (abs(intval($docValue['startpage']) - intval($docValue['endpage']))); |
| 554 | 554 | if ($pages === 0) { |
| 555 | 555 | $numberOfPages = $numberOfPages + 1; |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | } |
| 561 | 561 | // Remove leading/tailing pdfparamseperator |
| 562 | 562 | $pdfUrl = trim($pdfUrl, $this->conf['pdfparamseparator']); |
| 563 | - $mailBody = $mailText . $pdfUrl; |
|
| 563 | + $mailBody = $mailText.$pdfUrl; |
|
| 564 | 564 | // Get hook objects. |
| 565 | 565 | $hookObjects = Helper::getHookObjects($this->scriptRelPath); |
| 566 | 566 | // Hook for getting a customized mail body. |
@@ -593,12 +593,12 @@ discard block |
||
| 593 | 593 | // internal user |
| 594 | 594 | $insertArray['user_id'] = $GLOBALS["TSFE"]->fe_user->user['uid']; |
| 595 | 595 | $insertArray['name'] = $GLOBALS["TSFE"]->fe_user->user['username']; |
| 596 | - $insertArray['label'] = 'Mail: ' . $mailData['mail']; |
|
| 596 | + $insertArray['label'] = 'Mail: '.$mailData['mail']; |
|
| 597 | 597 | } else { |
| 598 | 598 | // external user |
| 599 | 599 | $insertArray['user_id'] = 0; |
| 600 | 600 | $insertArray['name'] = 'n/a'; |
| 601 | - $insertArray['label'] = 'Mail: ' . $mailData['mail']; |
|
| 601 | + $insertArray['label'] = 'Mail: '.$mailData['mail']; |
|
| 602 | 602 | } |
| 603 | 603 | // add action to protocol |
| 604 | 604 | GeneralUtility::makeInstance(ConnectionPool::class) |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | foreach ($this->piVars['selected'] as $docId => $docValue) { |
| 624 | 624 | if ($docValue['id']) { |
| 625 | 625 | $docData = $this->getDocumentData($docValue['id'], $docValue); |
| 626 | - $pdfUrl .= $docData['urlParams'] . $this->conf['pdfparamseparator']; |
|
| 626 | + $pdfUrl .= $docData['urlParams'].$this->conf['pdfparamseparator']; |
|
| 627 | 627 | $numberOfPages += $docData['pageNums']; |
| 628 | 628 | } |
| 629 | 629 | } |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | if ($docValue['id']) { |
| 655 | 655 | $explodeId = explode("_", $docId); |
| 656 | 656 | $docData = $this->getDocumentData($explodeId[0], $docValue); |
| 657 | - $pdfUrl .= $docData['urlParams'] . $this->conf['pdfparamseparator']; |
|
| 657 | + $pdfUrl .= $docData['urlParams'].$this->conf['pdfparamseparator']; |
|
| 658 | 658 | $numberOfPages += $docData['pageNums']; |
| 659 | 659 | } |
| 660 | 660 | } |
@@ -671,12 +671,12 @@ discard block |
||
| 671 | 671 | // internal user |
| 672 | 672 | $insertArray['user_id'] = $GLOBALS["TSFE"]->fe_user->user['uid']; |
| 673 | 673 | $insertArray['name'] = $GLOBALS["TSFE"]->fe_user->user['username']; |
| 674 | - $insertArray['label'] = 'Print: ' . $printerData['label']; |
|
| 674 | + $insertArray['label'] = 'Print: '.$printerData['label']; |
|
| 675 | 675 | } else { |
| 676 | 676 | // external user |
| 677 | 677 | $insertArray['user_id'] = 0; |
| 678 | 678 | $insertArray['name'] = 'n/a'; |
| 679 | - $insertArray['label'] = 'Print: ' . $printerData['label']; |
|
| 679 | + $insertArray['label'] = 'Print: '.$printerData['label']; |
|
| 680 | 680 | } |
| 681 | 681 | // add action to protocol |
| 682 | 682 | GeneralUtility::makeInstance(ConnectionPool::class) |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | 'tx_dlf_actionlog', |
| 686 | 686 | $insertArray |
| 687 | 687 | ); |
| 688 | - header('Location: ' . $pdfUrl); |
|
| 688 | + header('Location: '.$pdfUrl); |
|
| 689 | 689 | ob_end_flush(); |
| 690 | 690 | exit; |
| 691 | 691 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | $this->init($conf); |
| 45 | 45 | // Don't cache the output. |
| 46 | - $this->setCache(false); |
|
| 46 | + $this->setCache(FALSE); |
|
| 47 | 47 | // Load template file. |
| 48 | 48 | $this->getTemplate(); |
| 49 | 49 | $subpartArray['entry'] = $this->templateService->getSubpart($this->template, '###ENTRY###'); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | ->execute(); |
| 66 | 66 | } else { |
| 67 | 67 | $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_dlf_basket', ''); |
| 68 | - $GLOBALS['TSFE']->fe_user->sesData_change = true; |
|
| 68 | + $GLOBALS['TSFE']->fe_user->sesData_change = TRUE; |
|
| 69 | 69 | $GLOBALS['TSFE']->fe_user->storeSessionData(); |
| 70 | 70 | $result = $queryBuilder |
| 71 | 71 | ->select('*') |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | } else { |
| 229 | 229 | $markerArray['###BASKET###'] = ''; |
| 230 | 230 | } |
| 231 | - $content = $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($this->template, '###ENTRY###', $entries, true), $markerArray); |
|
| 231 | + $content = $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($this->template, '###ENTRY###', $entries, TRUE), $markerArray); |
|
| 232 | 232 | return $this->pi_wrapInBaseClass($content); |
| 233 | 233 | } |
| 234 | 234 | |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | // return one entry |
| 279 | 279 | $markerArray['###CONTROLS###'] = $controlMark; |
| 280 | 280 | $markerArray['###NUMBER###'] = $docData['record_id']; |
| 281 | - return $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($template['entry'], '###ENTRY###', '', true), $markerArray); |
|
| 281 | + return $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($template['entry'], '###ENTRY###', '', TRUE), $markerArray); |
|
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | /** |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | } else { |
| 300 | 300 | $page = intval($_piVars['startpage']); |
| 301 | 301 | } |
| 302 | - if ($page != null || $_piVars['addToBasket'] == 'list') { |
|
| 302 | + if ($page != NULL || $_piVars['addToBasket'] == 'list') { |
|
| 303 | 303 | $documentItem = [ |
| 304 | 304 | 'id' => intval($_piVars['id']), |
| 305 | 305 | 'startpage' => intval($_piVars['startpage']), |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | $urlParams = str_replace("##endy##", $data['endY'] === "" ? "" : intval($data['endY']), $urlParams); |
| 481 | 481 | $urlParams = str_replace("##rotation##", $data['rotation'] === "" ? "" : intval($data['rotation']), $urlParams); |
| 482 | 482 | $downloadUrl = $this->conf['pdfgenerate'] . $urlParams; |
| 483 | - $title = $document->getTitle($id, true); |
|
| 483 | + $title = $document->getTitle($id, TRUE); |
|
| 484 | 484 | if (empty($title)) { |
| 485 | 485 | $title = $this->pi_getLL('noTitle', ''); |
| 486 | 486 | } |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | 'record_id' => $document->recordId, |
| 511 | 511 | ]; |
| 512 | 512 | } |
| 513 | - return false; |
|
| 513 | + return FALSE; |
|
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | /** |
@@ -26,8 +26,7 @@ discard block |
||
| 26 | 26 | * @subpackage dlf |
| 27 | 27 | * @access public |
| 28 | 28 | */ |
| 29 | -class AnnotationTool extends AbstractPlugin |
|
| 30 | -{ |
|
| 29 | +class AnnotationTool extends AbstractPlugin { |
|
| 31 | 30 | /** |
| 32 | 31 | * @access public |
| 33 | 32 | * @var string |
@@ -44,8 +43,7 @@ discard block |
||
| 44 | 43 | * |
| 45 | 44 | * @return string The content that is displayed on the website |
| 46 | 45 | */ |
| 47 | - public function main($content, $conf) |
|
| 48 | - { |
|
| 46 | + public function main($content, $conf) { |
|
| 49 | 47 | $this->init($conf); |
| 50 | 48 | // Merge configuration with conf array of toolbox. |
| 51 | 49 | if (!empty($this->cObj->data['conf'])) { |
@@ -84,9 +84,9 @@ |
||
| 84 | 84 | $annotationContainers != null |
| 85 | 85 | && sizeof($annotationContainers) > 0 |
| 86 | 86 | ) { |
| 87 | - $markerArray['###ANNOTATION_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-annotations" title="" data-dic="annotations-on:' . htmlspecialchars($this->pi_getLL('annotations-on', '')) . ';annotations-off:' . htmlspecialchars($this->pi_getLL('annotations-off', '')) . '"> </a>'; |
|
| 87 | + $markerArray['###ANNOTATION_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-annotations" title="" data-dic="annotations-on:'.htmlspecialchars($this->pi_getLL('annotations-on', '')).';annotations-off:'.htmlspecialchars($this->pi_getLL('annotations-off', '')).'"> </a>'; |
|
| 88 | 88 | } else { |
| 89 | - $markerArray['###ANNOTATION_SELECT###'] = '<span class="no-annotations">' . htmlspecialchars($this->pi_getLL('annotations-not-available', '')) . '</span>'; |
|
| 89 | + $markerArray['###ANNOTATION_SELECT###'] = '<span class="no-annotations">'.htmlspecialchars($this->pi_getLL('annotations-not-available', '')).'</span>'; |
|
| 90 | 90 | } |
| 91 | 91 | $content .= $this->templateService->substituteMarkerArray($this->template, $markerArray); |
| 92 | 92 | return $this->pi_wrapInBaseClass($content); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | // Load current document. |
| 55 | 55 | $this->loadDocument(); |
| 56 | 56 | if ( |
| 57 | - $this->doc === null |
|
| 57 | + $this->doc === NULL |
|
| 58 | 58 | || $this->doc->numPages < 1 |
| 59 | 59 | ) { |
| 60 | 60 | // Quit without doing anything if required variables are not set. |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $this->getTemplate(); |
| 82 | 82 | $annotationContainers = $this->doc->physicalStructureInfo[$this->doc->physicalStructure[$this->piVars['page']]]['annotationContainers']; |
| 83 | 83 | if ( |
| 84 | - $annotationContainers != null |
|
| 84 | + $annotationContainers != NULL |
|
| 85 | 85 | && sizeof($annotationContainers) > 0 |
| 86 | 86 | ) { |
| 87 | 87 | $markerArray['###ANNOTATION_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-annotations" title="" data-dic="annotations-on:' . htmlspecialchars($this->pi_getLL('annotations-on', '')) . ';annotations-off:' . htmlspecialchars($this->pi_getLL('annotations-off', '')) . '"> </a>'; |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | // Load current document. |
| 54 | 54 | $this->loadDocument(); |
| 55 | 55 | if ( |
| 56 | - $this->doc === null |
|
| 56 | + $this->doc === NULL |
|
| 57 | 57 | || $this->doc->numPages < 1 |
| 58 | 58 | || empty($this->conf['fileGrpFulltext']) |
| 59 | 59 | || empty($this->conf['solrcore']) |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | protected function addSearchInDocumentJS() |
| 126 | 126 | { |
| 127 | 127 | $pageRenderer = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class); |
| 128 | - $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey)) . 'Resources/Public/Javascript/Search/SearchInDocument.js'); |
|
| 128 | + $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey)).'Resources/Public/Javascript/Search/SearchInDocument.js'); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -24,8 +24,7 @@ discard block |
||
| 24 | 24 | * @subpackage dlf |
| 25 | 25 | * @access public |
| 26 | 26 | */ |
| 27 | -class SearchInDocumentTool extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 28 | -{ |
|
| 27 | +class SearchInDocumentTool extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 29 | 28 | public $scriptRelPath = 'Classes/Plugin/Tools/SearchInDocumentTool.php'; |
| 30 | 29 | |
| 31 | 30 | /** |
@@ -38,8 +37,7 @@ discard block |
||
| 38 | 37 | * |
| 39 | 38 | * @return string The content that is displayed on the website |
| 40 | 39 | */ |
| 41 | - public function main($content, $conf) |
|
| 42 | - { |
|
| 40 | + public function main($content, $conf) { |
|
| 43 | 41 | |
| 44 | 42 | $this->init($conf); |
| 45 | 43 | |
@@ -122,8 +120,7 @@ discard block |
||
| 122 | 120 | * |
| 123 | 121 | * @return void |
| 124 | 122 | */ |
| 125 | - protected function addSearchInDocumentJS() |
|
| 126 | - { |
|
| 123 | + protected function addSearchInDocumentJS() { |
|
| 127 | 124 | $pageRenderer = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class); |
| 128 | 125 | $pageRenderer->addJsFooterFile(\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey)) . 'Resources/Public/Javascript/Search/SearchInDocument.js'); |
| 129 | 126 | } |
@@ -135,8 +132,7 @@ discard block |
||
| 135 | 132 | * |
| 136 | 133 | * @return array with encrypted core name and hash |
| 137 | 134 | */ |
| 138 | - protected function getEncryptedCoreName() |
|
| 139 | - { |
|
| 135 | + protected function getEncryptedCoreName() { |
|
| 140 | 136 | // Get core name. |
| 141 | 137 | $name = Helper::getIndexNameFromUid($this->conf['solrcore'], 'tx_dlf_solrcores'); |
| 142 | 138 | // Encrypt core name. |
@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | * @subpackage dlf |
| 23 | 23 | * @access public |
| 24 | 24 | */ |
| 25 | -class ImageManipulationTool extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 26 | -{ |
|
| 25 | +class ImageManipulationTool extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 27 | 26 | public $scriptRelPath = 'Classes/Plugin/Tools/ImageManipulationTool.php'; |
| 28 | 27 | |
| 29 | 28 | /** |
@@ -36,8 +35,7 @@ discard block |
||
| 36 | 35 | * |
| 37 | 36 | * @return string The content that is displayed on the website |
| 38 | 37 | */ |
| 39 | - public function main($content, $conf) |
|
| 40 | - { |
|
| 38 | + public function main($content, $conf) { |
|
| 41 | 39 | $this->init($conf); |
| 42 | 40 | // Merge configuration with conf array of toolbox. |
| 43 | 41 | if (!empty($this->cObj->data['conf'])) { |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | $parentContainer = !empty($this->conf['parentContainer']) ? $this->conf['parentContainer'] : '.tx-dlf-imagemanipulationtool'; |
| 48 | 48 | // Load template file. |
| 49 | 49 | $this->getTemplate(); |
| 50 | - $markerArray['###IMAGEMANIPULATION_SELECT###'] = '<span class="tx-dlf-tools-imagetools" id="tx-dlf-tools-imagetools" data-dic="imagemanipulation-on:' . htmlspecialchars($this->pi_getLL('imagemanipulation-on', '')) . ';imagemanipulation-off:' . htmlspecialchars($this->pi_getLL('imagemanipulation-off', '')) . ';reset:' . htmlspecialchars($this->pi_getLL('reset', '')) . ';saturation:' . htmlspecialchars($this->pi_getLL('saturation', '')) . ';hue:' . htmlspecialchars($this->pi_getLL('hue', '')) . ';contrast:' . htmlspecialchars($this->pi_getLL('contrast', '')) . ';brightness:' . htmlspecialchars($this->pi_getLL('brightness', '')) . ';invert:' . htmlspecialchars($this->pi_getLL('invert', '')) . ';parentContainer:' . $parentContainer . '" title="' . htmlspecialchars($this->pi_getLL('no-support', '')) . '"></span>'; |
|
| 50 | + $markerArray['###IMAGEMANIPULATION_SELECT###'] = '<span class="tx-dlf-tools-imagetools" id="tx-dlf-tools-imagetools" data-dic="imagemanipulation-on:'.htmlspecialchars($this->pi_getLL('imagemanipulation-on', '')).';imagemanipulation-off:'.htmlspecialchars($this->pi_getLL('imagemanipulation-off', '')).';reset:'.htmlspecialchars($this->pi_getLL('reset', '')).';saturation:'.htmlspecialchars($this->pi_getLL('saturation', '')).';hue:'.htmlspecialchars($this->pi_getLL('hue', '')).';contrast:'.htmlspecialchars($this->pi_getLL('contrast', '')).';brightness:'.htmlspecialchars($this->pi_getLL('brightness', '')).';invert:'.htmlspecialchars($this->pi_getLL('invert', '')).';parentContainer:'.$parentContainer.'" title="'.htmlspecialchars($this->pi_getLL('no-support', '')).'"></span>'; |
|
| 51 | 51 | $content .= $this->templateService->substituteMarkerArray($this->template, $markerArray); |
| 52 | 52 | return $this->pi_wrapInBaseClass($content); |
| 53 | 53 | } |
@@ -23,8 +23,7 @@ discard block |
||
| 23 | 23 | * @subpackage dlf |
| 24 | 24 | * @access public |
| 25 | 25 | */ |
| 26 | -class PdfDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 27 | -{ |
|
| 26 | +class PdfDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 28 | 27 | public $scriptRelPath = 'Classes/Plugin/Tools/PdfDownloadTool.php'; |
| 29 | 28 | |
| 30 | 29 | /** |
@@ -37,8 +36,7 @@ discard block |
||
| 37 | 36 | * |
| 38 | 37 | * @return string The content that is displayed on the website |
| 39 | 38 | */ |
| 40 | - public function main($content, $conf) |
|
| 41 | - { |
|
| 39 | + public function main($content, $conf) { |
|
| 42 | 40 | $this->init($conf); |
| 43 | 41 | // Merge configuration with conf array of toolbox. |
| 44 | 42 | if (!empty($this->cObj->data['conf'])) { |
@@ -88,8 +86,7 @@ discard block |
||
| 88 | 86 | * |
| 89 | 87 | * @return string Link to downloadable page |
| 90 | 88 | */ |
| 91 | - protected function getPageLink() |
|
| 92 | - { |
|
| 89 | + protected function getPageLink() { |
|
| 93 | 90 | $page1Link = ''; |
| 94 | 91 | $page2Link = ''; |
| 95 | 92 | $pageNumber = $this->piVars['page']; |
@@ -137,8 +134,7 @@ discard block |
||
| 137 | 134 | * |
| 138 | 135 | * @return string Link to downloadable work |
| 139 | 136 | */ |
| 140 | - protected function getWorkLink() |
|
| 141 | - { |
|
| 137 | + protected function getWorkLink() { |
|
| 142 | 138 | $workLink = ''; |
| 143 | 139 | // Get work link. |
| 144 | 140 | if (!empty($this->doc->physicalStructureInfo[$this->doc->physicalStructure[0]]['files'][$this->conf['fileGrpDownload']])) { |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | // Load current document. |
| 48 | 48 | $this->loadDocument(); |
| 49 | 49 | if ( |
| 50 | - $this->doc === null |
|
| 50 | + $this->doc === NULL |
|
| 51 | 51 | || $this->doc->numPages < 1 |
| 52 | 52 | || empty($this->conf['fileGrpDownload']) |
| 53 | 53 | ) { |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | empty($page1Link) |
| 115 | 115 | && empty($page2Link) |
| 116 | 116 | ) { |
| 117 | - Helper::devLog('File not found in fileGrp "' . $this->conf['fileGrpDownload'] . '"', DEVLOG_SEVERITY_WARNING); |
|
| 117 | + Helper::devLog('File not found in fileGrp "'.$this->conf['fileGrpDownload'].'"', DEVLOG_SEVERITY_WARNING); |
|
| 118 | 118 | } |
| 119 | 119 | // Wrap URLs with HTML. |
| 120 | 120 | $linkConf = [ |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $linkConf['title'] = $this->pi_getLL('rightPage', ''); |
| 137 | 137 | $page2Link = $this->cObj->typoLink($this->pi_getLL('rightPage', ''), $linkConf); |
| 138 | 138 | } |
| 139 | - return $page1Link . $page2Link; |
|
| 139 | + return $page1Link.$page2Link; |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | ]; |
| 169 | 169 | $workLink = $this->cObj->typoLink($this->pi_getLL('work', ''), $linkConf); |
| 170 | 170 | } else { |
| 171 | - Helper::devLog('File not found in fileGrp "' . $this->conf['fileGrpDownload'] . '"', DEVLOG_SEVERITY_WARNING); |
|
| 171 | + Helper::devLog('File not found in fileGrp "'.$this->conf['fileGrpDownload'].'"', DEVLOG_SEVERITY_WARNING); |
|
| 172 | 172 | } |
| 173 | 173 | return $workLink; |
| 174 | 174 | } |
@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | * @subpackage dlf |
| 23 | 23 | * @access public |
| 24 | 24 | */ |
| 25 | -class ImageDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 26 | -{ |
|
| 25 | +class ImageDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 27 | 26 | public $scriptRelPath = 'Classes/Plugin/Tools/ImageDownloadTool.php'; |
| 28 | 27 | |
| 29 | 28 | /** |
@@ -36,8 +35,7 @@ discard block |
||
| 36 | 35 | * |
| 37 | 36 | * @return string The content that is displayed on the website |
| 38 | 37 | */ |
| 39 | - public function main($content, $conf) |
|
| 40 | - { |
|
| 38 | + public function main($content, $conf) { |
|
| 41 | 39 | $this->init($conf); |
| 42 | 40 | // Merge configuration with conf array of toolbox. |
| 43 | 41 | if (!empty($this->cObj->data['conf'])) { |
@@ -90,8 +88,7 @@ discard block |
||
| 90 | 88 | * |
| 91 | 89 | * @return string Link to image file with given label |
| 92 | 90 | */ |
| 93 | - protected function getImage($page, $label) |
|
| 94 | - { |
|
| 91 | + protected function getImage($page, $label) { |
|
| 95 | 92 | $image = []; |
| 96 | 93 | // Get @USE value of METS fileGrp. |
| 97 | 94 | $fileGrps = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['fileGrpsImageDownload']); |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | // Load current document. |
| 47 | 47 | $this->loadDocument(); |
| 48 | 48 | if ( |
| 49 | - $this->doc === null |
|
| 49 | + $this->doc === NULL |
|
| 50 | 50 | || $this->doc->numPages < 1 |
| 51 | 51 | || empty($this->conf['fileGrpsImageDownload']) |
| 52 | 52 | ) { |
@@ -114,13 +114,13 @@ |
||
| 114 | 114 | 'parameter' => $image['url'], |
| 115 | 115 | 'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0, |
| 116 | 116 | 'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'], |
| 117 | - 'title' => $label . $mimetypeLabel, |
|
| 117 | + 'title' => $label.$mimetypeLabel, |
|
| 118 | 118 | 'additionalParams' => '', |
| 119 | 119 | ]; |
| 120 | - $imageLink = $this->cObj->typoLink($label . $mimetypeLabel, $linkConf); |
|
| 120 | + $imageLink = $this->cObj->typoLink($label.$mimetypeLabel, $linkConf); |
|
| 121 | 121 | break; |
| 122 | 122 | } else { |
| 123 | - Helper::devLog('File not found in fileGrp "' . $fileGrp . '"', DEVLOG_SEVERITY_WARNING); |
|
| 123 | + Helper::devLog('File not found in fileGrp "'.$fileGrp.'"', DEVLOG_SEVERITY_WARNING); |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | return $imageLink; |
@@ -23,8 +23,7 @@ discard block |
||
| 23 | 23 | * @subpackage dlf |
| 24 | 24 | * @access public |
| 25 | 25 | */ |
| 26 | -class FulltextTool extends \Kitodo\Dlf\Common\AbstractPlugin |
|
| 27 | -{ |
|
| 26 | +class FulltextTool extends \Kitodo\Dlf\Common\AbstractPlugin { |
|
| 28 | 27 | public $scriptRelPath = 'Classes/Plugin/Tools/FulltextTool.php'; |
| 29 | 28 | |
| 30 | 29 | /** |
@@ -37,8 +36,7 @@ discard block |
||
| 37 | 36 | * |
| 38 | 37 | * @return string The content that is displayed on the website |
| 39 | 38 | */ |
| 40 | - public function main($content, $conf) |
|
| 41 | - { |
|
| 39 | + public function main($content, $conf) { |
|
| 42 | 40 | $this->init($conf); |
| 43 | 41 | // Merge configuration with conf array of toolbox. |
| 44 | 42 | if (!empty($this->cObj->data['conf'])) { |
@@ -75,9 +75,9 @@ |
||
| 75 | 75 | $this->getTemplate(); |
| 76 | 76 | $fullTextFile = $this->doc->physicalStructureInfo[$this->doc->physicalStructure[$this->piVars['page']]]['files'][$this->conf['fileGrpFulltext']]; |
| 77 | 77 | if (!empty($fullTextFile)) { |
| 78 | - $markerArray['###FULLTEXT_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-fulltext" title="" data-dic="fulltext-on:' . htmlspecialchars($this->pi_getLL('fulltext-on', '')) . ';fulltext-off:' . htmlspecialchars($this->pi_getLL('fulltext-off', '')) . '"> </a>'; |
|
| 78 | + $markerArray['###FULLTEXT_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-fulltext" title="" data-dic="fulltext-on:'.htmlspecialchars($this->pi_getLL('fulltext-on', '')).';fulltext-off:'.htmlspecialchars($this->pi_getLL('fulltext-off', '')).'"> </a>'; |
|
| 79 | 79 | } else { |
| 80 | - $markerArray['###FULLTEXT_SELECT###'] = '<span class="no-fulltext">' . htmlspecialchars($this->pi_getLL('fulltext-not-available', '')) . '</span>'; |
|
| 80 | + $markerArray['###FULLTEXT_SELECT###'] = '<span class="no-fulltext">'.htmlspecialchars($this->pi_getLL('fulltext-not-available', '')).'</span>'; |
|
| 81 | 81 | } |
| 82 | 82 | $content .= $this->templateService->substituteMarkerArray($this->template, $markerArray); |
| 83 | 83 | return $this->pi_wrapInBaseClass($content); |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | // Load current document. |
| 48 | 48 | $this->loadDocument(); |
| 49 | 49 | if ( |
| 50 | - $this->doc === null |
|
| 50 | + $this->doc === NULL |
|
| 51 | 51 | || $this->doc->numPages < 1 |
| 52 | 52 | || empty($this->conf['fileGrpFulltext']) |
| 53 | 53 | ) { |