Merge branch 'master' into rework-toolbox

This commit is contained in:
Sebastian Meyer 2020-05-19 11:33:42 +02:00 committed by GitHub
commit 68169be28b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 134 additions and 135 deletions

View File

@ -376,7 +376,7 @@ class Helper
} elseif (\TYPO3_MODE === 'BE') {
$iso639 = $GLOBALS['LANG']->includeLLFile($file, false, true);
if (!empty($iso639['default'][$isoCode])) {
$lang = $GLOBALS['LANG']->getLLL($isoCode, $iso639, false);
$lang = $GLOBALS['LANG']->getLLL($isoCode, $iso639);
}
} else {
self::devLog('Unexpected TYPO3_MODE "' . \TYPO3_MODE . '"', DEVLOG_SEVERITY_ERROR);
@ -421,7 +421,7 @@ class Helper
if (\TYPO3_MODE === 'FE') {
$translated = $GLOBALS['TSFE']->getLLL($key, self::$messages);
} elseif (\TYPO3_MODE === 'BE') {
$translated = $GLOBALS['LANG']->getLLL($key, self::$messages, false);
$translated = $GLOBALS['LANG']->getLLL($key, self::$messages);
} else {
self::devLog('Unexpected TYPO3_MODE "' . \TYPO3_MODE . '"', DEVLOG_SEVERITY_ERROR);
}

View File

@ -71,16 +71,16 @@ class ConfigurationForm
$status = $response->xpath('//lst[@name="responseHeader"]/int[@name="status"]');
if (is_array($status)) {
Helper::addMessage(
sprintf($GLOBALS['LANG']->getLL('solr.status'), (string) $status[0]),
$GLOBALS['LANG']->getLL('solr.connected'),
htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('solr.status'), (string) $status[0])),
htmlspecialchars($GLOBALS['LANG']->getLL('solr.connected')),
($status[0] == 0 ? \TYPO3\CMS\Core\Messaging\FlashMessage::OK : \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING)
);
return Helper::renderFlashMessages();
}
}
Helper::addMessage(
sprintf($GLOBALS['LANG']->getLL('solr.error'), $url),
$GLOBALS['LANG']->getLL('solr.notConnected'),
htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('solr.error'), $url)),
htmlspecialchars($GLOBALS['LANG']->getLL('solr.notConnected')),
\TYPO3\CMS\Core\Messaging\FlashMessage::WARNING
);
return Helper::renderFlashMessages();
@ -197,21 +197,21 @@ class ConfigurationForm
$substUid = Helper::processDBasAdmin($data);
if (!empty($substUid)) {
Helper::addMessage(
$GLOBALS['LANG']->getLL('metadataFormats.nsCreatedMsg'),
$GLOBALS['LANG']->getLL('metadataFormats.nsCreated'),
htmlspecialchars($GLOBALS['LANG']->getLL('metadataFormats.nsCreatedMsg')),
htmlspecialchars($GLOBALS['LANG']->getLL('metadataFormats.nsCreated')),
\TYPO3\CMS\Core\Messaging\FlashMessage::INFO
);
} else {
Helper::addMessage(
$GLOBALS['LANG']->getLL('metadataFormats.nsNotCreatedMsg'),
$GLOBALS['LANG']->getLL('metadataFormats.nsNotCreated'),
htmlspecialchars($GLOBALS['LANG']->getLL('metadataFormats.nsNotCreatedMsg')),
htmlspecialchars($GLOBALS['LANG']->getLL('metadataFormats.nsNotCreated')),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
);
}
} else {
Helper::addMessage(
$GLOBALS['LANG']->getLL('metadataFormats.nsOkayMsg'),
$GLOBALS['LANG']->getLL('metadataFormats.nsOkay'),
htmlspecialchars($GLOBALS['LANG']->getLL('metadataFormats.nsOkayMsg')),
htmlspecialchars($GLOBALS['LANG']->getLL('metadataFormats.nsOkay')),
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
);
}

View File

@ -132,7 +132,7 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
// set marker
$linkToCurrentPage = $this->pi_linkTP('|');
$markerArray['###ACTION###'] = !empty($linkToCurrentPage) ? $this->cObj->lastTypoLinkUrl : '';
$markerArray['###LISTTITLE###'] = $this->pi_getLL('basket', '', true);
$markerArray['###LISTTITLE###'] = htmlspecialchars($this->pi_getLL('basket', ''));
if ($basketData['doc_ids']) {
if (is_object($basketData['doc_ids'])) {
$basketData['doc_ids'] = get_object_vars($basketData['doc_ids']);
@ -158,7 +158,7 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
if ($resultMail->rowCount() > 0) {
$mailForm = '<select name="tx_dlf[mail_action]">';
$mailForm .= '<option value="">' . $this->pi_getLL('chooseMail', '', true) . '</option>';
$mailForm .= '<option value="">' . htmlspecialchars($this->pi_getLL('chooseMail', '')) . '</option>';
while ($row = $resultMail->fetch()) {
$mailForm .= '<option value="' . $row['uid'] . '">' . $row['name'] . ' (' . $row['mail'] . ')</option>';
}
@ -169,9 +169,9 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
// remove action form
$markerArray['###REMOVEACTION###'] = '
<select name="tx_dlf[basket_action]">
<option value="">' . $this->pi_getLL('chooseAction', '', true) . '</option>
<option value="open">' . $this->pi_getLL('download', '', true) . '</option>
<option value="remove">' . $this->pi_getLL('remove', '', true) . '</option>
<option value="">' . htmlspecialchars($this->pi_getLL('chooseAction', '')) . '</option>
<option value="open">' . htmlspecialchars($this->pi_getLL('download', '')) . '</option>
<option value="remove">' . htmlspecialchars($this->pi_getLL('remove', '')) . '</option>
</select>
<input type="submit">
';
@ -192,7 +192,7 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
$printForm = '';
if ($resultPrinter->rowCount() > 0) {
$printForm = '<select name="tx_dlf[print_action]">';
$printForm .= '<option value="">' . $this->pi_getLL('choosePrinter', '', true) . '</option>';
$printForm .= '<option value="">' . htmlspecialchars($this->pi_getLL('choosePrinter', '')) . '</option>';
while ($row = $resultPrinter->fetch()) {
$printForm .= '<option value="' . $row['uid'] . '">' . $row['label'] . '</option>';
}
@ -211,7 +211,7 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
}
// basket go to
if ($this->conf['targetBasket'] && $this->conf['basketGoToButton'] && $this->piVars['id']) {
$label = $this->pi_getLL('goBasket', '', true);
$label = htmlspecialchars($this->pi_getLL('goBasket', ''));
$basketConf = [
'parameter' => $this->conf['targetBasket'],
'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0,
@ -464,19 +464,19 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
$downloadUrl = $this->conf['pdfgenerate'] . $urlParams;
$title = $document->getTitle($id, true);
if (empty($title)) {
$title = $this->pi_getLL('noTitle', '', true);
$title = htmlspecialchars($this->pi_getLL('noTitle', ''));
}
// Set page and cutout information
$info = '';
if ($data['startX'] != '' && $data['endX'] != '') {
// cutout
$info .= $this->pi_getLL('cutout', '', true) . ' ';
$info .= htmlspecialchars($this->pi_getLL('cutout', '')) . ' ';
}
if ($data['startpage'] == $data['endpage']) {
// One page
$info .= $this->pi_getLL('page', '', true) . ' ' . $data['startpage'];
$info .= htmlspecialchars($this->pi_getLL('page', '')) . ' ' . $data['startpage'];
} else {
$info .= $this->pi_getLL('page', '', true) . ' ' . $data['startpage'] . '-' . $data['endpage'];
$info .= htmlspecialchars($this->pi_getLL('page', '')) . ' ' . $data['startpage'] . '-' . $data['endpage'];
}
$downloadLink = '<a href="' . $downloadUrl . '" target="_blank">' . $title . '</a> (' . $info . ')';
if ($data['startpage'] == $data['endpage']) {
@ -523,7 +523,7 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
$allResults = $resultMail->fetchAll();
$mailData = $allResults[0];
$mailText = $this->pi_getLL('mailBody', '', true) . "\n";
$mailText = htmlspecialchars($this->pi_getLL('mailBody', '')) . "\n";
$numberOfPages = 0;
$pdfUrl = $this->conf['pdfdownload'];
// prepare links
@ -557,7 +557,7 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
// Prepare and send the message
$mail
// subject
->setSubject($this->pi_getLL('mailSubject', '', true))
->setSubject($this->pi_getLL('mailSubject', ''))
// Set the From address with an associative array
->setFrom($from)
// Set the To addresses with an associative array

View File

@ -219,15 +219,15 @@ class Calendar extends \Kitodo\Dlf\Common\AbstractPlugin
'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'],
'additionalParams' => '&' . $this->prefixId . '[id]=' . urlencode($this->doc->parentId),
];
$allYearsLink = $this->cObj->typoLink($this->pi_getLL('allYears', '', true) . ' ' . $this->doc->getTitle($this->doc->parentId), $linkConf);
$allYearsLink = $this->cObj->typoLink(htmlspecialchars($this->pi_getLL('allYears', '')) . ' ' . $this->doc->getTitle($this->doc->parentId), $linkConf);
// Fill marker array.
$markerArray = [
'###CALENDARVIEWACTIVE###' => count($this->allIssues) > 5 ? 'active' : '',
'###LISTVIEWACTIVE###' => count($this->allIssues) < 6 ? 'active' : '',
'###CALYEAR###' => $yearLink,
'###CALALLYEARS###' => $allYearsLink,
'###LABEL_CALENDAR###' => $this->pi_getLL('label.view_calendar'),
'###LABEL_LIST_VIEW###' => $this->pi_getLL('label.view_list'),
'###LABEL_CALENDAR###' => htmlspecialchars($this->pi_getLL('label.view_calendar')),
'###LABEL_LIST_VIEW###' => htmlspecialchars($this->pi_getLL('label.view_list')),
];
$this->template = $this->templateService->substituteMarkerArray($this->template, $markerArray);
return $this->templateService->substituteSubpart($this->template, '###CALMONTH###', $subPartContent);
@ -435,10 +435,10 @@ class Calendar extends \Kitodo\Dlf\Common\AbstractPlugin
'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'],
'additionalParams' => '&' . $this->prefixId . '[id]=' . $this->doc->uid,
];
$allYearsLink = $this->cObj->typoLink($this->pi_getLL('allYears', '', true) . ' ' . $this->doc->getTitle($this->doc->uid), $linkConf);
$allYearsLink = $this->cObj->typoLink(htmlspecialchars($this->pi_getLL('allYears', '')) . ' ' . $this->doc->getTitle($this->doc->uid), $linkConf);
// Fill markers.
$markerArray = [
'###LABEL_CHOOSE_YEAR###' => $this->pi_getLL('label.please_choose_year'),
'###LABEL_CHOOSE_YEAR###' => htmlspecialchars($this->pi_getLL('label.please_choose_year')),
'###CALALLYEARS###' => $allYearsLink
];
$this->template = $this->templateService->substituteMarkerArray($this->template, $markerArray);

View File

@ -212,7 +212,7 @@ class Collection extends \Kitodo\Dlf\Common\AbstractPlugin
$markerArray[$_key]['###TITLE###'] = $this->cObj->typoLink(htmlspecialchars($collection['label']), $conf);
// Add feed link if applicable.
if (!empty($this->conf['targetFeed'])) {
$img = '<img src="' . \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey)) . 'Resources/Public/Icons/txdlffeeds.png" alt="' . $this->pi_getLL('feedAlt', '', true) . '" title="' . $this->pi_getLL('feedTitle', '', true) . '" />';
$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', '')) . '" />';
$markerArray[$_key]['###FEED###'] = $this->pi_linkTP($img, [$this->prefixId => ['collection' => $collection['uid']]], false, $this->conf['targetFeed']);
} else {
$markerArray[$_key]['###FEED###'] = '';
@ -226,9 +226,9 @@ class Collection extends \Kitodo\Dlf\Common\AbstractPlugin
// Add description.
$markerArray[$_key]['###DESCRIPTION###'] = $this->pi_RTEcssText($collection['description']);
// Build statistic's output.
$labelTitles = $this->pi_getLL((count($collection['titles']) > 1 ? 'titles' : 'title'), '', false);
$labelTitles = $this->pi_getLL((count($collection['titles']) > 1 ? 'titles' : 'title'), '');
$markerArray[$_key]['###COUNT_TITLES###'] = htmlspecialchars(count($collection['titles']) . $labelTitles);
$labelVolumes = $this->pi_getLL((count($collection['volumes']) > 1 ? 'volumes' : 'volume'), '', false);
$labelVolumes = $this->pi_getLL((count($collection['volumes']) > 1 ? 'volumes' : 'volume'), '');
$markerArray[$_key]['###COUNT_VOLUMES###'] = htmlspecialchars(count($collection['volumes']) . $labelVolumes);
}
// Randomize sorting?

View File

@ -81,12 +81,12 @@ class ListView extends \Kitodo\Dlf\Common\AbstractPlugin
return '';
}
// Get separator.
$separator = '<span class="separator">' . $this->pi_getLL('separator', ' - ', true) . '</span>';
$separator = '<span class="separator">' . htmlspecialchars($this->pi_getLL('separator', ' - ')) . '</span>';
// Add link to previous page.
if ($this->piVars['pointer'] > 0) {
$output = $this->pi_linkTP_keepPIvars($this->pi_getLL('prevPage', '&lt;', true), ['pointer' => $this->piVars['pointer'] - 1], true) . $separator;
$output = $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('prevPage', '<')), ['pointer' => $this->piVars['pointer'] - 1], true) . $separator;
} else {
$output = '<span>' . $this->pi_getLL('prevPage', '&lt;', true) . '</span>' . $separator;
$output = '<span>' . htmlspecialchars($this->pi_getLL('prevPage', '<')) . '</span>' . $separator;
}
$i = 0;
$skip = null;
@ -94,22 +94,22 @@ class ListView extends \Kitodo\Dlf\Common\AbstractPlugin
while ($i < $maxPages) {
if ($i < 3 || ($i > $this->piVars['pointer'] - 3 && $i < $this->piVars['pointer'] + 3) || $i > $maxPages - 4) {
if ($this->piVars['pointer'] != $i) {
$output .= $this->pi_linkTP_keepPIvars(sprintf($this->pi_getLL('page', '%d', true), $i + 1), ['pointer' => $i], true) . $separator;
$output .= $this->pi_linkTP_keepPIvars(htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)), ['pointer' => $i], true) . $separator;
} else {
$output .= '<span class="active">' . sprintf($this->pi_getLL('page', '%d', true), $i + 1) . '</span>' . $separator;
$output .= '<span class="active">' . htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)) . '</span>' . $separator;
}
$skip = true;
} elseif ($skip === true) {
$output .= '<span class="skip">' . $this->pi_getLL('skip', '...', true) . '</span>' . $separator;
$output .= '<span class="skip">' . htmlspecialchars($this->pi_getLL('skip', '...')) . '</span>' . $separator;
$skip = false;
}
$i++;
}
// Add link to next page.
if ($this->piVars['pointer'] < $maxPages - 1) {
$output .= $this->pi_linkTP_keepPIvars($this->pi_getLL('nextPage', '&gt;', true), ['pointer' => $this->piVars['pointer'] + 1], true);
$output .= $this->pi_linkTP_keepPIvars(htmlspecialchars($this->pi_getLL('nextPage', '>')), ['pointer' => $this->piVars['pointer'] + 1], true);
} else {
$output .= '<span>' . $this->pi_getLL('nextPage', '&gt;', true) . '</span>';
$output .= '<span>' . htmlspecialchars($this->pi_getLL('nextPage', '>')) . '</span>';
}
return $output;
}
@ -215,7 +215,7 @@ class ListView extends \Kitodo\Dlf\Common\AbstractPlugin
'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'],
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', true, false)
];
$link = $this->cObj->typoLink($this->pi_getLL('addBasket', '', true), $conf);
$link = $this->cObj->typoLink(htmlspecialchars($this->pi_getLL('addBasket', '')), $conf);
$markerArray['###BASKETBUTTON###'] = $link;
}
return $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($template['entry'], '###SUBTEMPLATE###', $subpart, true), $markerArray);
@ -273,10 +273,10 @@ class ListView extends \Kitodo\Dlf\Common\AbstractPlugin
}
// Select sort field.
$uniqId = uniqid($prefix . '-');
$sorting .= '<label for="' . $uniqId . '">' . $this->pi_getLL('orderBy', '', true) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[order]" onchange="javascript:this.form.submit();">';
$sorting .= '<label for="' . $uniqId . '">' . htmlspecialchars($this->pi_getLL('orderBy', '')) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[order]" onchange="javascript:this.form.submit();">';
// Add relevance sorting if this is a search result list.
if ($this->list->metadata['options']['source'] == 'search') {
$sorting .= '<option value="score"' . (($this->list->metadata['options']['order'] == 'score') ? ' selected="selected"' : '') . '>' . $this->pi_getLL('relevance', '', true) . '</option>';
$sorting .= '<option value="score"' . (($this->list->metadata['options']['order'] == 'score') ? ' selected="selected"' : '') . '>' . htmlspecialchars($this->pi_getLL('relevance', '')) . '</option>';
}
foreach ($this->sortables as $index_name => $label) {
$sorting .= '<option value="' . $index_name . '"' . (($this->list->metadata['options']['order'] == $index_name) ? ' selected="selected"' : '') . '>' . htmlspecialchars($label) . '</option>';
@ -284,9 +284,9 @@ class ListView extends \Kitodo\Dlf\Common\AbstractPlugin
$sorting .= '</select>';
// Select sort direction.
$uniqId = uniqid($prefix . '-');
$sorting .= '<label for="' . $uniqId . '">' . $this->pi_getLL('direction', '', true) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[asc]" onchange="javascript:this.form.submit();">';
$sorting .= '<option value="1" ' . ($this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '') . '>' . $this->pi_getLL('direction.asc', '', true) . '</option>';
$sorting .= '<option value="0" ' . (!$this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '') . '>' . $this->pi_getLL('direction.desc', '', true) . '</option>';
$sorting .= '<label for="' . $uniqId . '">' . htmlspecialchars($this->pi_getLL('direction', '')) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[asc]" onchange="javascript:this.form.submit();">';
$sorting .= '<option value="1" ' . ($this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '') . '>' . htmlspecialchars($this->pi_getLL('direction.asc', '')) . '</option>';
$sorting .= '<option value="0" ' . (!$this->list->metadata['options']['order.asc'] ? ' selected="selected"' : '') . '>' . htmlspecialchars($this->pi_getLL('direction.desc', '')) . '</option>';
$sorting .= '</select></div></form>';
return $sorting;
}
@ -394,7 +394,7 @@ class ListView extends \Kitodo\Dlf\Common\AbstractPlugin
'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'],
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', true, false)
];
$link = $this->cObj->typoLink($this->pi_getLL('addBasket', '', true), $conf);
$link = $this->cObj->typoLink(htmlspecialchars($this->pi_getLL('addBasket', '')), $conf);
$markerArray['###SUBBASKETBUTTON###'] = $link;
}
$content .= $this->templateService->substituteMarkerArray($template['subentry'], $markerArray);
@ -553,7 +553,7 @@ class ListView extends \Kitodo\Dlf\Common\AbstractPlugin
$lastEntry = ($this->piVars['pointer'] * $this->conf['limit']) + $this->conf['limit'];
$markerArray['###COUNT###'] = htmlspecialchars(sprintf($this->pi_getLL('count'), $currentEntry, $lastEntry < $this->list->metadata['options']['numberOfToplevelHits'] ? $lastEntry : $this->list->metadata['options']['numberOfToplevelHits'], $this->list->metadata['options']['numberOfToplevelHits']));
} else {
$markerArray['###COUNT###'] = $this->pi_getLL('nohits', '', true);
$markerArray['###COUNT###'] = htmlspecialchars($this->pi_getLL('nohits', ''));
}
$markerArray['###PAGEBROWSER###'] = $this->getPageBrowser();
$markerArray['###SORTING###'] = $this->getSortingForm();

View File

@ -46,9 +46,9 @@ class Navigation extends \Kitodo\Dlf\Common\AbstractPlugin
'parameter' => $this->conf['targetPid'],
'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0,
'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'],
'title' => $this->pi_getLL('linkToList', '', true)
'title' => htmlspecialchars($this->pi_getLL('linkToList', ''))
];
return $this->cObj->typoLink($this->pi_getLL('linkToList', '', true), $conf);
return $this->cObj->typoLink(htmlspecialchars($this->pi_getLL('linkToList', '')), $conf);
}
}
return '';
@ -78,7 +78,7 @@ class Navigation extends \Kitodo\Dlf\Common\AbstractPlugin
}
// Add page selector.
$uniqId = uniqid(Helper::getUnqualifiedClassName(get_class($this)) . '-');
$output .= '<label for="' . $uniqId . '">' . $this->pi_getLL('selectPage', '', true) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[page]" onchange="javascript:this.form.submit();"' . ($this->doc->numPages < 1 ? ' disabled="disabled"' : '') . '>';
$output .= '<label for="' . $uniqId . '">' . htmlspecialchars($this->pi_getLL('selectPage', '')) . '</label><select id="' . $uniqId . '" name="' . $this->prefixId . '[page]" onchange="javascript:this.form.submit();"' . ($this->doc->numPages < 1 ? ' disabled="disabled"' : '') . '>';
for ($i = 1; $i <= $this->doc->numPages; $i++) {
$output .= '<option value="' . $i . '"' . ($this->piVars['page'] == $i ? ' selected="selected"' : '') . '>[' . $i . ']' . ($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$i]]['orderlabel'] ? ' - ' . htmlspecialchars($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$i]]['orderlabel']) : '') . '</option>';
}
@ -136,67 +136,67 @@ class Navigation extends \Kitodo\Dlf\Common\AbstractPlugin
$pageSteps = $this->conf['pageStep'] * ($this->piVars['double'] + 1);
// Link to first page.
if ($this->piVars['page'] > 1) {
$markerArray['###FIRST###'] = $this->makeLink($this->pi_getLL('firstPage', '', true), ['page' => 1]);
$markerArray['###FIRST###'] = $this->makeLink(htmlspecialchars($this->pi_getLL('firstPage', '')), ['page' => 1]);
} else {
$markerArray['###FIRST###'] = '<span title="' . $this->pi_getLL('firstPage', '', true) . '">' . $this->pi_getLL('firstPage', '', true) . '</span>';
$markerArray['###FIRST###'] = '<span title="' . htmlspecialchars($this->pi_getLL('firstPage', '')) . '">' . htmlspecialchars($this->pi_getLL('firstPage', '')) . '</span>';
}
// Link back X pages.
if ($this->piVars['page'] > $pageSteps) {
$markerArray['###BACK###'] = $this->makeLink(sprintf($this->pi_getLL('backXPages', '', true), $pageSteps), ['page' => $this->piVars['page'] - $pageSteps]);
$markerArray['###BACK###'] = $this->makeLink(htmlspecialchars(sprintf($this->pi_getLL('backXPages', ''), $pageSteps)), ['page' => $this->piVars['page'] - $pageSteps]);
} else {
$markerArray['###BACK###'] = '<span title="' . sprintf($this->pi_getLL('backXPages', '', true), $pageSteps) . '">' . sprintf($this->pi_getLL('backXPages', '', true), $pageSteps) . '</span>';
$markerArray['###BACK###'] = '<span title="' . htmlspecialchars(sprintf($this->pi_getLL('backXPages', ''), $pageSteps)) . '">' . htmlspecialchars(sprintf($this->pi_getLL('backXPages', ''), $pageSteps)) . '</span>';
}
// Link to previous page.
if ($this->piVars['page'] > (1 + $this->piVars['double'])) {
$markerArray['###PREVIOUS###'] = $this->makeLink($this->pi_getLL('prevPage', '', true), ['page' => $this->piVars['page'] - (1 + $this->piVars['double'])]);
$markerArray['###PREVIOUS###'] = $this->makeLink(htmlspecialchars($this->pi_getLL('prevPage', '')), ['page' => $this->piVars['page'] - (1 + $this->piVars['double'])]);
} else {
$markerArray['###PREVIOUS###'] = '<span title="' . $this->pi_getLL('prevPage', '', true) . '">' . $this->pi_getLL('prevPage', '', true) . '</span>';
$markerArray['###PREVIOUS###'] = '<span title="' . htmlspecialchars($this->pi_getLL('prevPage', '')) . '">' . htmlspecialchars($this->pi_getLL('prevPage', '')) . '</span>';
}
// Link to next page.
if ($this->piVars['page'] < ($this->doc->numPages - $this->piVars['double'])) {
$markerArray['###NEXT###'] = $this->makeLink($this->pi_getLL('nextPage', '', true), ['page' => $this->piVars['page'] + (1 + $this->piVars['double'])]);
$markerArray['###NEXT###'] = $this->makeLink(htmlspecialchars($this->pi_getLL('nextPage', '')), ['page' => $this->piVars['page'] + (1 + $this->piVars['double'])]);
} else {
$markerArray['###NEXT###'] = '<span title="' . $this->pi_getLL('nextPage', '', true) . '">' . $this->pi_getLL('nextPage', '', true) . '</span>';
$markerArray['###NEXT###'] = '<span title="' . htmlspecialchars($this->pi_getLL('nextPage', '')) . '">' . htmlspecialchars($this->pi_getLL('nextPage', '')) . '</span>';
}
// Link forward X pages.
if ($this->piVars['page'] <= ($this->doc->numPages - $pageSteps)) {
$markerArray['###FORWARD###'] = $this->makeLink(sprintf($this->pi_getLL('forwardXPages', '', true), $pageSteps), ['page' => $this->piVars['page'] + $pageSteps]);
$markerArray['###FORWARD###'] = $this->makeLink(htmlspecialchars(sprintf($this->pi_getLL('forwardXPages', ''), $pageSteps)), ['page' => $this->piVars['page'] + $pageSteps]);
} else {
$markerArray['###FORWARD###'] = '<span title="' . sprintf($this->pi_getLL('forwardXPages', '', true), $pageSteps) . '">' . sprintf($this->pi_getLL('forwardXPages', '', true), $pageSteps) . '</span>';
$markerArray['###FORWARD###'] = '<span title="' . htmlspecialchars(sprintf($this->pi_getLL('forwardXPages', ''), $pageSteps)) . '">' . htmlspecialchars(sprintf($this->pi_getLL('forwardXPages', ''), $pageSteps)) . '</span>';
}
// Link to last page.
if ($this->piVars['page'] < $this->doc->numPages) {
$markerArray['###LAST###'] = $this->makeLink($this->pi_getLL('lastPage', '', true), ['page' => $this->doc->numPages]);
$markerArray['###LAST###'] = $this->makeLink(htmlspecialchars($this->pi_getLL('lastPage', '')), ['page' => $this->doc->numPages]);
} else {
$markerArray['###LAST###'] = '<span title="' . $this->pi_getLL('lastPage', '', true) . '">' . $this->pi_getLL('lastPage', '', true) . '</span>';
$markerArray['###LAST###'] = '<span title="' . htmlspecialchars($this->pi_getLL('lastPage', '')) . '">' . htmlspecialchars($this->pi_getLL('lastPage', '')) . '</span>';
}
// Add double page switcher.
if ($this->doc->numPages > 0) {
if (!$this->piVars['double']) {
$markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOn', '', true), ['double' => 1], 'class="tx-dlf-navigation-doubleOn" title="' . $this->pi_getLL('doublePageOn', '', true) . '"');
$markerArray['###DOUBLEPAGE###'] = $this->makeLink(htmlspecialchars($this->pi_getLL('doublePageOn', '')), ['double' => 1], 'class="tx-dlf-navigation-doubleOn" title="' . htmlspecialchars($this->pi_getLL('doublePageOn', '')) . '"');
} else {
$markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOff', '', true), ['double' => 0], 'class="tx-dlf-navigation-doubleOff" title="' . $this->pi_getLL('doublePageOff', '', true) . '"');
$markerArray['###DOUBLEPAGE###'] = $this->makeLink(htmlspecialchars($this->pi_getLL('doublePageOff', '')), ['double' => 0], 'class="tx-dlf-navigation-doubleOff" title="' . htmlspecialchars($this->pi_getLL('doublePageOff', '')) . '"');
}
if ($this->piVars['double'] && $this->piVars['page'] < $this->doc->numPages) {
$markerArray['###DOUBLEPAGE+1###'] = $this->makeLink($this->pi_getLL('doublePage+1', '', true), ['page' => $this->piVars['page'] + 1], 'title="' . $this->pi_getLL('doublePage+1', '', true) . '"');
$markerArray['###DOUBLEPAGE+1###'] = $this->makeLink(htmlspecialchars($this->pi_getLL('doublePage+1', '')), ['page' => $this->piVars['page'] + 1], 'title="' . htmlspecialchars($this->pi_getLL('doublePage+1', '')) . '"');
} else {
$markerArray['###DOUBLEPAGE+1###'] = '<span title="' . $this->pi_getLL('doublePage+1', '', true) . '">' . $this->pi_getLL('doublePage+1', '', true) . '</span>';
$markerArray['###DOUBLEPAGE+1###'] = '<span title="' . htmlspecialchars($this->pi_getLL('doublePage+1', '')) . '">' . htmlspecialchars($this->pi_getLL('doublePage+1', '')) . '</span>';
}
} else {
$markerArray['###DOUBLEPAGE###'] = '<span title="' . $this->pi_getLL('doublePageOn', '', true) . '">' . $this->pi_getLL('doublePageOn', '', true) . '</span>';
$markerArray['###DOUBLEPAGE+1###'] = '<span title="' . $this->pi_getLL('doublePage+1', '', true) . '">' . $this->pi_getLL('doublePage+1', '', true) . '</span>';
$markerArray['###DOUBLEPAGE###'] = '<span title="' . htmlspecialchars($this->pi_getLL('doublePageOn', '')) . '">' . htmlspecialchars($this->pi_getLL('doublePageOn', '')) . '</span>';
$markerArray['###DOUBLEPAGE+1###'] = '<span title="' . htmlspecialchars($this->pi_getLL('doublePage+1', '')) . '">' . htmlspecialchars($this->pi_getLL('doublePage+1', '')) . '</span>';
}
// Add page selector.
$markerArray['###PAGESELECT###'] = $this->getPageSelector();
// Add link to listview if applicable.
$markerArray['###LINKLISTVIEW###'] = $this->getLinkToListview();
// Fill some language labels if available.
$markerArray['###ZOOM_IN###'] = $this->pi_getLL('zoom-in', '', true);
$markerArray['###ZOOM_OUT###'] = $this->pi_getLL('zoom-out', '', true);
$markerArray['###ZOOM_FULLSCREEN###'] = $this->pi_getLL('zoom-fullscreen', '', true);
$markerArray['###ROTATE_LEFT###'] = $this->pi_getLL('rotate-left', '', true);
$markerArray['###ROTATE_RIGHT###'] = $this->pi_getLL('rotate-right', '', true);
$markerArray['###ROTATE_RESET###'] = $this->pi_getLL('rotate-reset', '', true);
$markerArray['###ZOOM_IN###'] = htmlspecialchars($this->pi_getLL('zoom-in', ''));
$markerArray['###ZOOM_OUT###'] = htmlspecialchars($this->pi_getLL('zoom-out', ''));
$markerArray['###ZOOM_FULLSCREEN###'] = htmlspecialchars($this->pi_getLL('zoom-fullscreen', ''));
$markerArray['###ROTATE_LEFT###'] = htmlspecialchars($this->pi_getLL('rotate-left', ''));
$markerArray['###ROTATE_RIGHT###'] = htmlspecialchars($this->pi_getLL('rotate-right', ''));
$markerArray['###ROTATE_RESET###'] = htmlspecialchars($this->pi_getLL('rotate-reset', ''));
$content .= $this->templateService->substituteMarkerArray($this->template, $markerArray);
return $this->pi_wrapInBaseClass($content);
}

View File

@ -109,7 +109,7 @@ class OaiPmh extends \Kitodo\Dlf\Common\AbstractPlugin
protected function error($type)
{
$this->error = true;
$error = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'error', htmlspecialchars($this->pi_getLL($type, $type, false), ENT_NOQUOTES, 'UTF-8'));
$error = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'error', htmlspecialchars($this->pi_getLL($type, $type), ENT_NOQUOTES, 'UTF-8'));
$error->setAttribute('code', $type);
return $error;
}
@ -313,7 +313,7 @@ class OaiPmh extends \Kitodo\Dlf\Common\AbstractPlugin
Helper::devLog('Could not load XML file from "' . $metadata['location'] . '"', DEVLOG_SEVERITY_ERROR);
}
if ($mets === null) {
$mets = $this->oai->createElementNS('http://kitodo.org/', 'kitodo:error', htmlspecialchars($this->pi_getLL('error', 'Error!', false), ENT_NOQUOTES, 'UTF-8'));
$mets = $this->oai->createElementNS('http://kitodo.org/', 'kitodo:error', htmlspecialchars($this->pi_getLL('error', 'Error!'), ENT_NOQUOTES, 'UTF-8'));
}
return $mets;
}

View File

@ -92,34 +92,34 @@ class PageGrid extends \Kitodo\Dlf\Common\AbstractPlugin
return '';
}
// Get separator.
$separator = $this->pi_getLL('separator', ' - ', true);
$separator = htmlspecialchars($this->pi_getLL('separator', ' - '));
// Add link to previous page.
if ($this->piVars['pointer'] > 0) {
$output = $this->pi_linkTP_keepPIvars($this->pi_getLL('prevPage', '&lt;', true), ['pointer' => $this->piVars['pointer'] - 1, 'page' => (($this->piVars['pointer'] - 1) * $this->conf['limit']) + 1], true) . $separator;
$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;
} else {
$output = '<span class="prev-page not-active">' . $this->pi_getLL('prevPage', '&lt;', true) . '</span>' . $separator;
$output = '<span class="prev-page not-active">' . htmlspecialchars($this->pi_getLL('prevPage', '<')) . '</span>' . $separator;
}
$i = 0;
// Add links to pages.
while ($i < $maxPages) {
if ($i < 3 || ($i > $this->piVars['pointer'] - 3 && $i < $this->piVars['pointer'] + 3) || $i > $maxPages - 4) {
if ($this->piVars['pointer'] != $i) {
$output .= $this->pi_linkTP_keepPIvars(sprintf($this->pi_getLL('page', '%d', true), $i + 1), ['pointer' => $i, 'page' => ($i * $this->conf['limit']) + 1], true) . $separator;
$output .= $this->pi_linkTP_keepPIvars(htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)), ['pointer' => $i, 'page' => ($i * $this->conf['limit']) + 1], true) . $separator;
} else {
$output .= '<span class="active">' . sprintf($this->pi_getLL('page', '%d', true), $i + 1) . '</span>' . $separator;
$output .= '<span class="active">' . htmlspecialchars(sprintf($this->pi_getLL('page', '%d'), $i + 1)) . '</span>' . $separator;
}
$skip = true;
} elseif ($skip == true) {
$output .= '<span class="skipped">' . $this->pi_getLL('skip', '...', true) . '</span>' . $separator;
$output .= '<span class="skipped">' . htmlspecialchars($this->pi_getLL('skip', '...')) . '</span>' . $separator;
$skip = false;
}
$i++;
}
// Add link to next page.
if ($this->piVars['pointer'] < $maxPages - 1) {
$output .= $this->pi_linkTP_keepPIvars($this->pi_getLL('nextPage', '&gt;', true), ['pointer' => $this->piVars['pointer'] + 1, 'page' => ($this->piVars['pointer'] + 1) * $this->conf['limit'] + 1], true);
$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);
} else {
$output .= '<span class="next-page not-active">' . $this->pi_getLL('nextPage', '&gt;', true) . '</span>';
$output .= '<span class="next-page not-active">' . htmlspecialchars($this->pi_getLL('nextPage', '>')) . '</span>';
}
return $output;
}

View File

@ -144,14 +144,14 @@ class PageView extends \Kitodo\Dlf\Common\AbstractPlugin
$markerArray = [];
if ($this->piVars['id']) {
if ($this->conf['crop']) {
$markerArray['###EDITBUTTON###'] = '<a href="javascript: tx_dlf_viewer.activateSelection();" title="' . $this->pi_getLL('editMode', '', true) . '">' . $this->pi_getLL('editMode', '', true) . '</a>';
$markerArray['###EDITREMOVE###'] = '<a href="javascript: tx_dlf_viewer.resetCropSelection();" title="' . $this->pi_getLL('editRemove', '', true) . '">' . $this->pi_getLL('editRemove', '', true) . '</a>';
$markerArray['###EDITBUTTON###'] = '<a href="javascript: tx_dlf_viewer.activateSelection();" title="' . htmlspecialchars($this->pi_getLL('editMode', '')) . '">' . htmlspecialchars($this->pi_getLL('editMode', '')) . '</a>';
$markerArray['###EDITREMOVE###'] = '<a href="javascript: tx_dlf_viewer.resetCropSelection();" title="' . htmlspecialchars($this->pi_getLL('editRemove', '')) . '">' . htmlspecialchars($this->pi_getLL('editRemove', '')) . '</a>';
} else {
$markerArray['###EDITBUTTON###'] = '';
$markerArray['###EDITREMOVE###'] = '';
}
if ($this->conf['magnifier']) {
$markerArray['###MAGNIFIER###'] = '<a href="javascript: tx_dlf_viewer.activateMagnifier();" title="' . $this->pi_getLL('magnifier', '', true) . '">' . $this->pi_getLL('magnifier', '', true) . '</a>';
$markerArray['###MAGNIFIER###'] = '<a href="javascript: tx_dlf_viewer.activateMagnifier();" title="' . htmlspecialchars($this->pi_getLL('magnifier', '')) . '">' . htmlspecialchars($this->pi_getLL('magnifier', '')) . '</a>';
} else {
$markerArray['###MAGNIFIER###'] = '';
}
@ -171,7 +171,7 @@ class PageView extends \Kitodo\Dlf\Common\AbstractPlugin
$markerArray = [];
// Add basket button
if ($this->conf['basketButton'] && $this->conf['targetBasket'] && $this->piVars['id']) {
$label = $this->pi_getLL('addBasket', '', true);
$label = htmlspecialchars($this->pi_getLL('addBasket', ''));
$params = [
'id' => $this->piVars['id'],
'addToBasket' => true

View File

@ -177,7 +177,7 @@ class Search extends \Kitodo\Dlf\Common\AbstractPlugin
// Get operator options.
$operatorOptions = '';
foreach (['AND', 'OR', 'NOT'] as $operator) {
$operatorOptions .= '<option class="tx-dlf-search-operator-option tx-dlf-search-operator-' . $operator . '" value="' . $operator . '">' . $this->pi_getLL($operator, '', true) . '</option>';
$operatorOptions .= '<option class="tx-dlf-search-operator-option tx-dlf-search-operator-' . $operator . '" value="' . $operator . '">' . htmlspecialchars($this->pi_getLL($operator, '')) . '</option>';
}
// Get field selector options.
$fieldSelectorOptions = '';
@ -244,9 +244,9 @@ class Search extends \Kitodo\Dlf\Common\AbstractPlugin
// Check for plugin configuration.
if (!empty($this->conf['fulltext'])) {
$output .= ' <input class="tx-dlf-search-fulltext" id="tx-dlf-search-fulltext-no" type="radio" name="' . $this->prefixId . '[fulltext]" value="0" ' . ($isFulltextSearch == 0 ? 'checked="checked"' : '') . ' />';
$output .= ' <label for="tx-dlf-search-fulltext-no">' . $this->pi_getLL('label.inMetadata', '') . '</label>';
$output .= ' <label for="tx-dlf-search-fulltext-no">' . htmlspecialchars($this->pi_getLL('label.inMetadata', '')) . '</label>';
$output .= ' <input class="tx-dlf-search-fulltext" id="tx-dlf-search-fulltext-yes" type="radio" name="' . $this->prefixId . '[fulltext]" value="1" ' . ($isFulltextSearch == 1 ? 'checked="checked"' : '') . '/>';
$output .= ' <label for="tx-dlf-search-fulltext-yes">' . $this->pi_getLL('label.inFulltext', '') . '</label>';
$output .= ' <label for="tx-dlf-search-fulltext-yes">' . htmlspecialchars($this->pi_getLL('label.inFulltext', '')) . '</label>';
}
return $output;
}
@ -263,7 +263,7 @@ class Search extends \Kitodo\Dlf\Common\AbstractPlugin
$output = '';
// Check for plugin configuration.
if (!empty($this->conf['showLogicalPageField'])) {
$output .= ' <label for="tx-dlf-search-logical-page">' . $this->pi_getLL('label.logicalPage', '') . ': </label>';
$output .= ' <label for="tx-dlf-search-logical-page">' . htmlspecialchars($this->pi_getLL('label.logicalPage', '')) . ': </label>';
$output .= ' <input class="tx-dlf-search-logical-page" id="tx-dlf-search-logical-page" type="text" name="' . $this->prefixId . '[logicalPage]" />';
}
return $output;
@ -376,8 +376,8 @@ class Search extends \Kitodo\Dlf\Common\AbstractPlugin
// Fill markers.
$markerArray = [
'###ACTION_URL###' => $this->cObj->typoLink_URL($linkConf),
'###LABEL_QUERY###' => (!empty($search['query']) ? htmlspecialchars($search['query']) : $this->pi_getLL('label.query')),
'###LABEL_SUBMIT###' => $this->pi_getLL('label.submit'),
'###LABEL_QUERY###' => (!empty($search['query']) ? htmlspecialchars($search['query']) : htmlspecialchars($this->pi_getLL('label.query'))),
'###LABEL_SUBMIT###' => htmlspecialchars($this->pi_getLL('label.submit')),
'###FIELD_QUERY###' => $this->prefixId . '[query]',
'###QUERY###' => (!empty($search['query']) ? htmlspecialchars($search['query']) : ''),
'###FULLTEXTSWITCH###' => $this->addFulltextSwitch($list->metadata['fulltextSearch']),
@ -394,7 +394,7 @@ class Search extends \Kitodo\Dlf\Common\AbstractPlugin
return $this->pi_wrapInBaseClass($content);
} else {
// Build label for result list.
$label = $this->pi_getLL('search', '', true);
$label = htmlspecialchars($this->pi_getLL('search', ''));
if (!empty($this->piVars['query'])) {
$label .= htmlspecialchars(sprintf($this->pi_getLL('for', ''), trim($this->piVars['query'])));
}

View File

@ -180,8 +180,8 @@ class Statistics extends \Kitodo\Dlf\Common\AbstractPlugin
'###VOLUMES###'
],
'value' => [
$countTitles . ($countTitles > 1 ? $this->pi_getLL('titles', '', true) : $this->pi_getLL('title', '', true)),
$countVolumes . ($countVolumes > 1 ? $this->pi_getLL('volumes', '', true) : $this->pi_getLL('volume', '', true))
$countTitles . ($countTitles > 1 ? htmlspecialchars($this->pi_getLL('titles', '')) : htmlspecialchars($this->pi_getLL('title', ''))),
$countVolumes . ($countVolumes > 1 ? htmlspecialchars($this->pi_getLL('volumes', '')) : htmlspecialchars($this->pi_getLL('volume', '')))
]
];
// Apply replacements.

View File

@ -66,7 +66,7 @@ class TableOfContents extends \Kitodo\Dlf\Common\AbstractPlugin
$entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['page' => $entry['points']], true, false, $this->conf['targetPid']);
$entryArray['doNotLinkIt'] = 0;
if ($this->conf['basketButton']) {
$entryArray['basketButtonHref'] = '<a href="' . $this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['points']], true, false, $this->conf['targetBasket']) . '">' . $this->pi_getLL('basketButton', '', true) . '</a>';
$entryArray['basketButtonHref'] = '<a href="' . $this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['points']], true, false, $this->conf['targetBasket']) . '">' . htmlspecialchars($this->pi_getLL('basketButton', '')) . '</a>';
}
} elseif (
!empty($entry['points'])
@ -75,13 +75,13 @@ class TableOfContents extends \Kitodo\Dlf\Common\AbstractPlugin
$entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['id' => $entry['points'], 'page' => 1], true, false, $this->conf['targetPid']);
$entryArray['doNotLinkIt'] = 0;
if ($this->conf['basketButton']) {
$entryArray['basketButtonHref'] = '<a href="' . $this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['points']], true, false, $this->conf['targetBasket']) . '">' . $this->pi_getLL('basketButton', '', true) . '</a>';
$entryArray['basketButtonHref'] = '<a href="' . $this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['points']], true, false, $this->conf['targetBasket']) . '">' . htmlspecialchars($this->pi_getLL('basketButton', '')) . '</a>';
}
} elseif (!empty($entry['targetUid'])) {
$entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['id' => $entry['targetUid'], 'page' => 1], true, false, $this->conf['targetPid']);
$entryArray['doNotLinkIt'] = 0;
if ($this->conf['basketButton']) {
$entryArray['basketButtonHref'] = '<a href="' . $this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['targetUid']], true, false, $this->conf['targetBasket']) . '">' . $this->pi_getLL('basketButton', '', true) . '</a>';
$entryArray['basketButtonHref'] = '<a href="' . $this->pi_linkTP_keepPIvars_url(['addToBasket' => 'toc', 'logId' => $entry['id'], 'startpage' => $entry['targetUid']], true, false, $this->conf['targetBasket']) . '">' . htmlspecialchars($this->pi_getLL('basketButton', '')) . '</a>';
}
}
// Set "ITEM_STATE" to "CUR" if this entry points to current page.

View File

@ -84,10 +84,9 @@ class AnnotationTool extends AbstractPlugin
$annotationContainers != null
&& sizeof($annotationContainers) > 0
) {
$markerArray['###ANNOTATION_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-annotations" title="" data-dic="annotations-on:' . $this->pi_getLL('annotations-on', '', true) . ';annotations-off:' . $this->pi_getLL('annotations-off', '', true) . '">&nbsp;</a>';
// TODO selector for different motivations
$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', '')) . '">&nbsp;</a>';
} else {
$markerArray['###ANNOTATION_SELECT###'] = '<span class="no-annotations">' . $this->pi_getLL('annotations-not-available', '', true) . '</span>';
$markerArray['###ANNOTATION_SELECT###'] = '<span class="no-annotations">' . htmlspecialchars($this->pi_getLL('annotations-not-available', '')) . '</span>';
}
$content .= $this->templateService->substituteMarkerArray($this->template, $markerArray);
return $this->pi_wrapInBaseClass($content);

View File

@ -75,9 +75,9 @@ class FulltextTool extends \Kitodo\Dlf\Common\AbstractPlugin
$this->getTemplate();
$fullTextFile = $this->doc->physicalStructureInfo[$this->doc->physicalStructure[$this->piVars['page']]]['files'][$this->conf['fileGrpFulltext']];
if (!empty($fullTextFile)) {
$markerArray['###FULLTEXT_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-fulltext" title="" data-dic="fulltext-on:' . $this->pi_getLL('fulltext-on', '', true) . ';fulltext-off:' . $this->pi_getLL('fulltext-off', '', true) . '">&nbsp;</a>';
$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', '')) . '">&nbsp;</a>';
} else {
$markerArray['###FULLTEXT_SELECT###'] = '<span class="no-fulltext">' . $this->pi_getLL('fulltext-not-available', '', true) . '</span>';
$markerArray['###FULLTEXT_SELECT###'] = '<span class="no-fulltext">' . htmlspecialchars($this->pi_getLL('fulltext-not-available', '')) . '</span>';
}
$content .= $this->templateService->substituteMarkerArray($this->template, $markerArray);
return $this->pi_wrapInBaseClass($content);

View File

@ -47,7 +47,7 @@ class ImageManipulationTool extends \Kitodo\Dlf\Common\AbstractPlugin
$parentContainer = !empty($this->conf['parentContainer']) ? $this->conf['parentContainer'] : '.tx-dlf-imagemanipulationtool';
// Load template file.
$this->getTemplate();
$markerArray['###IMAGEMANIPULATION_SELECT###'] = '<span class="tx-dlf-tools-imagetools" id="tx-dlf-tools-imagetools" data-dic="imagemanipulation-on:' . $this->pi_getLL('imagemanipulation-on', '', true) . ';imagemanipulation-off:' . $this->pi_getLL('imagemanipulation-off', '', true) . ';reset:' . $this->pi_getLL('reset', '', true) . ';saturation:' . $this->pi_getLL('saturation', '', true) . ';hue:' . $this->pi_getLL('hue', '', true) . ';contrast:' . $this->pi_getLL('contrast', '', true) . ';brightness:' . $this->pi_getLL('brightness', '', true) . ';invert:' . $this->pi_getLL('invert', '', true) . ';parentContainer:' . $parentContainer . '" title="' . $this->pi_getLL('no-support', '', true) . '"></span>';
$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>';
$content .= $this->templateService->substituteMarkerArray($this->template, $markerArray);
return $this->pi_wrapInBaseClass($content);
}

View File

@ -98,15 +98,15 @@ class SearchInDocumentTool extends \Kitodo\Dlf\Common\AbstractPlugin
// Fill markers.
$markerArray = [
'###ACTION_URL###' => $this->cObj->typoLink_URL($linkConf),
'###LABEL_QUERY###' => $this->pi_getLL('label.query'),
'###LABEL_DELETE_SEARCH###' => $this->pi_getLL('label.delete_search'),
'###LABEL_LOADING###' => $this->pi_getLL('label.loading'),
'###LABEL_SUBMIT###' => $this->pi_getLL('label.submit'),
'###LABEL_SEARCH_IN_DOCUMENT###' => $this->pi_getLL('label.searchInDocument'),
'###LABEL_NEXT###' => $this->pi_getLL('label.next'),
'###LABEL_PREVIOUS###' => $this->pi_getLL('label.previous'),
'###LABEL_PAGE###' => $this->pi_getLL('label.logicalPage'),
'###LABEL_NORESULT###' => $this->pi_getLL('label.noresult'),
'###LABEL_QUERY###' => htmlspecialchars($this->pi_getLL('label.query')),
'###LABEL_DELETE_SEARCH###' => htmlspecialchars($this->pi_getLL('label.delete_search')),
'###LABEL_LOADING###' => htmlspecialchars($this->pi_getLL('label.loading')),
'###LABEL_SUBMIT###' => htmlspecialchars($this->pi_getLL('label.submit')),
'###LABEL_SEARCH_IN_DOCUMENT###' => htmlspecialchars($this->pi_getLL('label.searchInDocument')),
'###LABEL_NEXT###' => htmlspecialchars($this->pi_getLL('label.next')),
'###LABEL_PREVIOUS###' => htmlspecialchars($this->pi_getLL('label.previous')),
'###LABEL_PAGE###' => htmlspecialchars($this->pi_getLL('label.logicalPage')),
'###LABEL_NORESULT###' => htmlspecialchars($this->pi_getLL('label.noresult')),
'###CURRENT_DOCUMENT###' => $this->doc->uid,
'###SOLR_ENCRYPTED###' => isset($encryptedSolr['encrypted']) ? $encryptedSolr['encrypted'] : '',
'###SOLR_HASH###' => isset($encryptedSolr['hash']) ? $encryptedSolr['hash'] : '',

View File

@ -271,14 +271,14 @@ class ext_update
if ($result) {
Helper::addMessage(
$GLOBALS['LANG']->getLL('update.copyIndexRelatedColumnsOkay', true),
$GLOBALS['LANG']->getLL('update.copyIndexRelatedColumns', true),
htmlspecialchars($GLOBALS['LANG']->getLL('update.copyIndexRelatedColumnsOkay')),
htmlspecialchars($GLOBALS['LANG']->getLL('update.copyIndexRelatedColumns')),
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
);
} else {
Helper::addMessage(
$GLOBALS['LANG']->getLL('update.copyIndexRelatedColumnsNotOkay', true),
$GLOBALS['LANG']->getLL('update.copyIndexRelatedColumns', true),
htmlspecialchars($GLOBALS['LANG']->getLL('update.copyIndexRelatedColumnsNotOkay')),
htmlspecialchars($GLOBALS['LANG']->getLL('update.copyIndexRelatedColumns')),
\TYPO3\CMS\Core\Messaging\FlashMessage::WARNING
);
}
@ -312,8 +312,8 @@ class ext_update
->execute();
}
Helper::addMessage(
$GLOBALS['LANG']->getLL('update.FormatClassesOkay', true),
$GLOBALS['LANG']->getLL('update.FormatClasses', true),
htmlspecialchars($GLOBALS['LANG']->getLL('update.FormatClassesOkay')),
htmlspecialchars($GLOBALS['LANG']->getLL('update.FormatClasses')),
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
);
$this->content .= Helper::renderFlashMessages();
@ -368,14 +368,14 @@ class ext_update
unset($data);
if (!empty($substUids)) {
Helper::addMessage(
$GLOBALS['LANG']->getLL('update.metadataConfigOkay', true),
$GLOBALS['LANG']->getLL('update.metadataConfig', true),
htmlspecialchars($GLOBALS['LANG']->getLL('update.metadataConfigOkay')),
htmlspecialchars($GLOBALS['LANG']->getLL('update.metadataConfig')),
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
);
} else {
Helper::addMessage(
$GLOBALS['LANG']->getLL('update.metadataConfigNotOkay', true),
$GLOBALS['LANG']->getLL('update.metadataConfig', true),
htmlspecialchars($GLOBALS['LANG']->getLL('update.metadataConfigNotOkay')),
htmlspecialchars($GLOBALS['LANG']->getLL('update.metadataConfig')),
\TYPO3\CMS\Core\Messaging\FlashMessage::WARNING
);
}
@ -439,8 +439,8 @@ class ext_update
}
}
Helper::addMessage(
$GLOBALS['LANG']->getLL('update.solariumSolrUpdateNotOkay', true),
sprintf($GLOBALS['LANG']->getLL('update.solariumSolrUpdate', true), $resArray['index_name']),
htmlspecialchars($GLOBALS['LANG']->getLL('update.solariumSolrUpdateNotOkay')),
htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('update.solariumSolrUpdate'), $resArray['index_name'])),
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
);
$this->content .= Helper::renderFlashMessages();
@ -448,8 +448,8 @@ class ext_update
}
}
Helper::addMessage(
$GLOBALS['LANG']->getLL('update.solariumSolrUpdateOkay', true),
$GLOBALS['LANG']->getLL('update.solariumSolrUpdate', true),
htmlspecialchars($GLOBALS['LANG']->getLL('update.solariumSolrUpdateOkay')),
htmlspecialchars($GLOBALS['LANG']->getLL('update.solariumSolrUpdate')),
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
);
$this->content .= Helper::renderFlashMessages();
@ -478,14 +478,14 @@ class ext_update
if ($result) {
Helper::addMessage(
$GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntriesOkay', true),
$GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntries', true),
htmlspecialchars($GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntriesOkay')),
htmlspecialchars($GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntries')),
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
);
} else {
Helper::addMessage(
$GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntriesNotOkay', true),
$GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntries', true),
htmlspecialchars($GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntriesNotOkay')),
htmlspecialchars($GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntries')),
\TYPO3\CMS\Core\Messaging\FlashMessage::WARNING
);
}