Use lower case for all reserved types and keywords
This commit is contained in:
parent
5e4ad588a2
commit
e832d94e20
|
@ -38,7 +38,7 @@ class IndexCommand extends Command
|
|||
->setHelp('')
|
||||
->addOption(
|
||||
'dry-run',
|
||||
NULL,
|
||||
null,
|
||||
InputOption::VALUE_NONE,
|
||||
'If this option is set, the files will not actually be processed but the location URI is shown.'
|
||||
)
|
||||
|
@ -73,7 +73,7 @@ class IndexCommand extends Command
|
|||
// Make sure the _cli_ user is loaded
|
||||
Bootstrap::getInstance()->initializeBackendAuthentication();
|
||||
|
||||
$dryRun = $input->getOption('dry-run') != FALSE ? TRUE : FALSE;
|
||||
$dryRun = $input->getOption('dry-run') != false ? true : false;
|
||||
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
$io->title($this->getDescription());
|
||||
|
@ -129,7 +129,7 @@ class IndexCommand extends Command
|
|||
}
|
||||
|
||||
// Get the document...
|
||||
$doc = Document::getInstance($input->getOption('doc'), $startingPoint, TRUE);
|
||||
$doc = Document::getInstance($input->getOption('doc'), $startingPoint, true);
|
||||
if ($doc->ready) {
|
||||
if ($dryRun) {
|
||||
$io->section('DRY RUN: Would index ' . $doc->uid . ' ("' . $doc->location . '") on UID ' . $startingPoint . ' and Solr core ' . $solrCoreUid . '.');
|
||||
|
|
|
@ -39,7 +39,7 @@ class ReindexCommand extends Command
|
|||
->setHelp('')
|
||||
->addOption(
|
||||
'dry-run',
|
||||
NULL,
|
||||
null,
|
||||
InputOption::VALUE_NONE,
|
||||
'If this option is set, the files will not actually be processed but the location URI is shown.'
|
||||
)
|
||||
|
@ -80,7 +80,7 @@ class ReindexCommand extends Command
|
|||
// Make sure the _cli_ user is loaded
|
||||
Bootstrap::getInstance()->initializeBackendAuthentication();
|
||||
|
||||
$dryRun = $input->getOption('dry-run') != FALSE ? TRUE : FALSE;
|
||||
$dryRun = $input->getOption('dry-run') != false ? true : false;
|
||||
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
$io->title($this->getDescription());
|
||||
|
@ -131,7 +131,7 @@ class ReindexCommand extends Command
|
|||
&& !is_array($input->getOption('coll'))
|
||||
) {
|
||||
// "coll" may be a single integer or a comma-separated list of integers.
|
||||
if (empty(array_filter(GeneralUtility::intExplode(',', $input->getOption('coll'), TRUE)))) {
|
||||
if (empty(array_filter(GeneralUtility::intExplode(',', $input->getOption('coll'), true)))) {
|
||||
$io->error('ERROR: Parameter --coll|-c is not a valid comma-separated list of collection UIDs.');
|
||||
exit(1);
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ class ReindexCommand extends Command
|
|||
}
|
||||
|
||||
foreach ($documents as $id => $document) {
|
||||
$doc = Document::getInstance($document, $startingPoint, TRUE);
|
||||
$doc = Document::getInstance($document, $startingPoint, true);
|
||||
if ($doc->ready) {
|
||||
if ($dryRun) {
|
||||
$io->writeln('DRY RUN: Would index ' . $id . '/' . count($documents) . ' ' . $doc->uid . ' ("' . $doc->location . '") on UID ' . $startingPoint . ' and Solr core ' . $solrCoreUid . '.');
|
||||
|
@ -239,7 +239,7 @@ class ReindexCommand extends Command
|
|||
$queryBuilder->expr()->in(
|
||||
'tx_dlf_collections_join.uid',
|
||||
$queryBuilder->createNamedParameter(
|
||||
GeneralUtility::intExplode(',', $collIds, TRUE),
|
||||
GeneralUtility::intExplode(',', $collIds, true),
|
||||
Connection::PARAM_INT_ARRAY
|
||||
)
|
||||
),
|
||||
|
|
|
@ -27,7 +27,7 @@ abstract class AbstractModule extends \TYPO3\CMS\Backend\Module\BaseScriptClass
|
|||
public $prefixId = 'tx_dlf';
|
||||
|
||||
/**
|
||||
* Holds the page record if access granted or FALSE if access denied
|
||||
* Holds the page record if access granted or false if access denied
|
||||
*
|
||||
* @var mixed
|
||||
* @access protected
|
||||
|
|
|
@ -32,8 +32,8 @@ abstract class AbstractPlugin extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
|
|||
public $prefixId = 'tx_dlf';
|
||||
public $scriptRelPath = 'Classes/Common/AbstractPlugin.php';
|
||||
// Plugins are cached by default (@see setCache()).
|
||||
public $pi_USER_INT_obj = FALSE;
|
||||
public $pi_checkCHash = TRUE;
|
||||
public $pi_USER_INT_obj = false;
|
||||
public $pi_checkCHash = true;
|
||||
|
||||
/**
|
||||
* This holds the current document
|
||||
|
@ -148,7 +148,7 @@ abstract class AbstractPlugin extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
|
|||
$this->doc = Document::getInstance($this->piVars['id'], $pid);
|
||||
if (!$this->doc->ready) {
|
||||
// Destroy the incomplete object.
|
||||
$this->doc = NULL;
|
||||
$this->doc = null;
|
||||
Helper::devLog('Failed to load document with UID ' . $this->piVars['id'], DEVLOG_SEVERITY_ERROR);
|
||||
} else {
|
||||
// Set configuration PID.
|
||||
|
@ -244,20 +244,20 @@ abstract class AbstractPlugin extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setCache($cache = TRUE)
|
||||
protected function setCache($cache = true)
|
||||
{
|
||||
if ($cache) {
|
||||
// Set cObject type to "USER" (default).
|
||||
$this->pi_USER_INT_obj = FALSE;
|
||||
$this->pi_checkCHash = TRUE;
|
||||
$this->pi_USER_INT_obj = false;
|
||||
$this->pi_checkCHash = true;
|
||||
if (count($this->piVars)) {
|
||||
// Check cHash or disable caching.
|
||||
$GLOBALS['TSFE']->reqCHash();
|
||||
}
|
||||
} else {
|
||||
// Set cObject type to "USER_INT".
|
||||
$this->pi_USER_INT_obj = TRUE;
|
||||
$this->pi_checkCHash = FALSE;
|
||||
$this->pi_USER_INT_obj = true;
|
||||
$this->pi_checkCHash = false;
|
||||
// Plugins are of type "USER" by default, so convert it to "USER_INT".
|
||||
$this->cObj->convertToUserIntObject();
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ abstract class Document
|
|||
* @var bool
|
||||
* @access protected
|
||||
*/
|
||||
protected $formatsLoaded = FALSE;
|
||||
protected $formatsLoaded = false;
|
||||
|
||||
/**
|
||||
* Are there any fulltext files available? This also includes IIIF text annotations
|
||||
|
@ -103,7 +103,7 @@ abstract class Document
|
|||
* @var bool
|
||||
* @access protected
|
||||
*/
|
||||
protected $hasFulltext = FALSE;
|
||||
protected $hasFulltext = false;
|
||||
|
||||
/**
|
||||
* Last searched logical and physical page
|
||||
|
@ -111,7 +111,7 @@ abstract class Document
|
|||
* @var array
|
||||
* @access protected
|
||||
*/
|
||||
protected $lastSearchedPhysicalPage = ['logicalPage' => NULL, 'physicalPage' => NULL];
|
||||
protected $lastSearchedPhysicalPage = ['logicalPage' => null, 'physicalPage' => null];
|
||||
|
||||
/**
|
||||
* This holds the documents location
|
||||
|
@ -145,7 +145,7 @@ abstract class Document
|
|||
* @var bool
|
||||
* @access protected
|
||||
*/
|
||||
protected $metadataArrayLoaded = FALSE;
|
||||
protected $metadataArrayLoaded = false;
|
||||
|
||||
/**
|
||||
* The holds the total number of pages
|
||||
|
@ -186,7 +186,7 @@ abstract class Document
|
|||
* @var bool
|
||||
* @access protected
|
||||
*/
|
||||
protected $physicalStructureLoaded = FALSE;
|
||||
protected $physicalStructureLoaded = false;
|
||||
|
||||
/**
|
||||
* This holds the PID of the document or zero if not in database
|
||||
|
@ -211,7 +211,7 @@ abstract class Document
|
|||
* @var bool
|
||||
* @access protected
|
||||
*/
|
||||
protected $ready = FALSE;
|
||||
protected $ready = false;
|
||||
|
||||
/**
|
||||
* The METS file's / IIIF manifest's record identifier
|
||||
|
@ -245,7 +245,7 @@ abstract class Document
|
|||
* @var bool
|
||||
* @access protected
|
||||
*/
|
||||
protected $rootIdLoaded = FALSE;
|
||||
protected $rootIdLoaded = false;
|
||||
|
||||
/**
|
||||
* This holds the smLinks between logical and physical structMap
|
||||
|
@ -262,7 +262,7 @@ abstract class Document
|
|||
* @var bool
|
||||
* @access protected
|
||||
*/
|
||||
protected $smLinksLoaded = FALSE;
|
||||
protected $smLinksLoaded = false;
|
||||
|
||||
/**
|
||||
* This holds the logical structure
|
||||
|
@ -279,7 +279,7 @@ abstract class Document
|
|||
* @var bool
|
||||
* @access protected
|
||||
*/
|
||||
protected $tableOfContentsLoaded = FALSE;
|
||||
protected $tableOfContentsLoaded = false;
|
||||
|
||||
/**
|
||||
* This holds the document's thumbnail location
|
||||
|
@ -296,7 +296,7 @@ abstract class Document
|
|||
* @var bool
|
||||
* @access protected
|
||||
*/
|
||||
protected $thumbnailLoaded = FALSE;
|
||||
protected $thumbnailLoaded = false;
|
||||
|
||||
/**
|
||||
* This holds the toplevel structure's @ID (METS) or the manifest's @id (IIIF)
|
||||
|
@ -413,7 +413,7 @@ abstract class Document
|
|||
*
|
||||
* @return \Kitodo\Dlf\Common\Document Instance of this class, either MetsDocument or IiifManifest
|
||||
*/
|
||||
public static function &getInstance($uid, $pid = 0, $forceReload = FALSE)
|
||||
public static function &getInstance($uid, $pid = 0, $forceReload = false)
|
||||
{
|
||||
// Sanitize input.
|
||||
$pid = max(intval($pid), 0);
|
||||
|
@ -453,10 +453,10 @@ abstract class Document
|
|||
}
|
||||
}
|
||||
// Create new instance depending on format (METS or IIIF) ...
|
||||
$instance = NULL;
|
||||
$documentFormat = NULL;
|
||||
$xml = NULL;
|
||||
$iiif = NULL;
|
||||
$instance = null;
|
||||
$documentFormat = null;
|
||||
$xml = null;
|
||||
$iiif = null;
|
||||
// Try to get document format from database
|
||||
if (MathUtility::canBeInterpretedAsInteger($uid)) {
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
|
@ -505,27 +505,27 @@ abstract class Document
|
|||
@ini_set('user_agent', $extConf['useragent']);
|
||||
}
|
||||
$content = GeneralUtility::getUrl($location);
|
||||
if ($content !== FALSE) {
|
||||
if ($content !== false) {
|
||||
// TODO use single place to load xml
|
||||
// Turn off libxml's error logging.
|
||||
$libxmlErrors = libxml_use_internal_errors(TRUE);
|
||||
$libxmlErrors = libxml_use_internal_errors(true);
|
||||
// Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept
|
||||
$previousValueOfEntityLoader = libxml_disable_entity_loader(TRUE);
|
||||
$previousValueOfEntityLoader = libxml_disable_entity_loader(true);
|
||||
// Try to load XML from file.
|
||||
$xml = simplexml_load_string($content);
|
||||
// reset entity loader setting
|
||||
libxml_disable_entity_loader($previousValueOfEntityLoader);
|
||||
// Reset libxml's error logging.
|
||||
libxml_use_internal_errors($libxmlErrors);
|
||||
if ($xml !== FALSE) {
|
||||
if ($xml !== false) {
|
||||
/* @var $xml \SimpleXMLElement */
|
||||
$xml->registerXPathNamespace('mets', 'http://www.loc.gov/METS/');
|
||||
$xpathResult = $xml->xpath('//mets:mets');
|
||||
$documentFormat = !empty($xpathResult) ? 'METS' : NULL;
|
||||
$documentFormat = !empty($xpathResult) ? 'METS' : null;
|
||||
} else {
|
||||
// Try to load file as IIIF resource instead.
|
||||
$contentAsJsonArray = json_decode($content, TRUE);
|
||||
if ($contentAsJsonArray !== NULL) {
|
||||
$contentAsJsonArray = json_decode($content, true);
|
||||
if ($contentAsJsonArray !== null) {
|
||||
// Load plugin configuration.
|
||||
$conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]);
|
||||
IiifHelper::setUrlReader(IiifUrlReader::getInstance());
|
||||
|
@ -579,7 +579,7 @@ abstract class Document
|
|||
*
|
||||
* @return array Array of the element's id, label, type and physical page indexes/mptr link
|
||||
*/
|
||||
public abstract function getLogicalStructure($id, $recursive = FALSE);
|
||||
public abstract function getLogicalStructure($id, $recursive = false);
|
||||
|
||||
/**
|
||||
* This extracts all the metadata for a logical structure node
|
||||
|
@ -616,7 +616,7 @@ abstract class Document
|
|||
} else {
|
||||
$physicalPage = 0;
|
||||
foreach ($this->physicalStructureInfo as $page) {
|
||||
if (strpos($page['orderlabel'], $logicalPage) !== FALSE) {
|
||||
if (strpos($page['orderlabel'], $logicalPage) !== false) {
|
||||
$this->lastSearchedPhysicalPage['logicalPage'] = $logicalPage;
|
||||
$this->lastSearchedPhysicalPage['physicalPage'] = $physicalPage;
|
||||
return $physicalPage;
|
||||
|
@ -666,11 +666,11 @@ abstract class Document
|
|||
if (!empty($this->physicalStructureInfo[$id])) {
|
||||
// Get fulltext file.
|
||||
$file = GeneralUtility::getUrl($this->getFileLocation($this->physicalStructureInfo[$id]['files'][$extConf['fileGrpFulltext']]));
|
||||
if ($file !== FALSE) {
|
||||
if ($file !== false) {
|
||||
// Turn off libxml's error logging.
|
||||
$libxmlErrors = libxml_use_internal_errors(TRUE);
|
||||
$libxmlErrors = libxml_use_internal_errors(true);
|
||||
// Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept.
|
||||
$previousValueOfEntityLoader = libxml_disable_entity_loader(TRUE);
|
||||
$previousValueOfEntityLoader = libxml_disable_entity_loader(true);
|
||||
// Load XML from file.
|
||||
$rawTextXml = simplexml_load_string($file);
|
||||
// Reset entity loader setting.
|
||||
|
@ -723,7 +723,7 @@ abstract class Document
|
|||
*
|
||||
* @return string The title of the document itself or a parent document
|
||||
*/
|
||||
public static function getTitle($uid, $recursive = FALSE)
|
||||
public static function getTitle($uid, $recursive = false)
|
||||
{
|
||||
$title = '';
|
||||
// Sanitize input.
|
||||
|
@ -756,7 +756,7 @@ abstract class Document
|
|||
&& intval($partof)
|
||||
&& $partof != $uid
|
||||
) {
|
||||
$title = self::getTitle($partof, TRUE);
|
||||
$title = self::getTitle($partof, true);
|
||||
}
|
||||
} else {
|
||||
Helper::devLog('No document with UID ' . $uid . ' found or document not accessible', DEVLOG_SEVERITY_WARNING);
|
||||
|
@ -807,7 +807,7 @@ abstract class Document
|
|||
* @param int $depth: current tree depth
|
||||
* @param string $logId: ID of the logical structure whose depth is requested
|
||||
*
|
||||
* @return int|bool: FALSE if structure with $logId is not a child of this substructure,
|
||||
* @return int|bool: false if structure with $logId is not a child of this substructure,
|
||||
* or the actual depth.
|
||||
*/
|
||||
protected function getTreeDepth($structure, $depth, $logId)
|
||||
|
@ -817,12 +817,12 @@ abstract class Document
|
|||
return $depth;
|
||||
} elseif (array_key_exists('children', $element)) {
|
||||
$foundInChildren = $this->getTreeDepth($element['children'], $depth + 1, $logId);
|
||||
if ($foundInChildren !== FALSE) {
|
||||
if ($foundInChildren !== false) {
|
||||
return $foundInChildren;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -831,7 +831,7 @@ abstract class Document
|
|||
* @access public
|
||||
*
|
||||
* @param string $logId: The id of the logical structure element whose depth is requested
|
||||
* @return int|bool tree depth as integer or FALSE if no element with $logId exists within the TOC.
|
||||
* @return int|bool tree depth as integer or false if no element with $logId exists within the TOC.
|
||||
*/
|
||||
public function getStructureDepth($logId)
|
||||
{
|
||||
|
@ -858,7 +858,7 @@ abstract class Document
|
|||
*
|
||||
* @param \SimpleXMLElement|IiifResourceInterface $preloadedDocument: any instance that has already been loaded
|
||||
*
|
||||
* @return bool TRUE if $preloadedDocument can actually be reused, FALSE if it has to be loaded again
|
||||
* @return bool true if $preloadedDocument can actually be reused, false if it has to be loaded again
|
||||
*/
|
||||
protected abstract function setPreloadedDocument($preloadedDocument);
|
||||
|
||||
|
@ -871,7 +871,7 @@ abstract class Document
|
|||
*
|
||||
* @param string $location: The URL of the file to load
|
||||
*
|
||||
* @return bool TRUE on success or FALSE on failure
|
||||
* @return bool true on success or false on failure
|
||||
*/
|
||||
protected abstract function loadLocation($location);
|
||||
|
||||
|
@ -882,7 +882,7 @@ abstract class Document
|
|||
*
|
||||
* @param string $location: The URL of the file to load
|
||||
*
|
||||
* @return bool TRUE on success or FALSE on failure
|
||||
* @return bool true on success or false on failure
|
||||
*/
|
||||
protected function load($location)
|
||||
{
|
||||
|
@ -899,7 +899,7 @@ abstract class Document
|
|||
} else {
|
||||
Helper::devLog('Invalid file location "' . $location . '" for document loading', DEVLOG_SEVERITY_ERROR);
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -947,7 +947,7 @@ abstract class Document
|
|||
'class' => $resArray['class']
|
||||
];
|
||||
}
|
||||
$this->formatsLoaded = TRUE;
|
||||
$this->formatsLoaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -987,13 +987,13 @@ abstract class Document
|
|||
* @param int $pid: The PID of the saved record
|
||||
* @param int $core: The UID of the Solr core for indexing
|
||||
*
|
||||
* @return bool TRUE on success or FALSE on failure
|
||||
* @return bool true on success or false on failure
|
||||
*/
|
||||
public function save($pid = 0, $core = 0)
|
||||
{
|
||||
if (\TYPO3_MODE !== 'BE') {
|
||||
Helper::devLog('Saving a document is only allowed in the backend', DEVLOG_SEVERITY_ERROR);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// Make sure $pid is a non-negative integer.
|
||||
$pid = max(intval($pid), 0);
|
||||
|
@ -1008,7 +1008,7 @@ abstract class Document
|
|||
$pid = $this->pid;
|
||||
} elseif (!$pid) {
|
||||
Helper::devLog('Invalid PID ' . $pid . ' for document saving', DEVLOG_SEVERITY_ERROR);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// Set PID for metadata definitions.
|
||||
$this->cPid = $pid;
|
||||
|
@ -1021,7 +1021,7 @@ abstract class Document
|
|||
// Check for record identifier.
|
||||
if (empty($metadata['record_id'][0])) {
|
||||
Helper::devLog('No record identifier found to avoid duplication', DEVLOG_SEVERITY_ERROR);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// Load plugin configuration.
|
||||
$conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]);
|
||||
|
@ -1045,7 +1045,7 @@ abstract class Document
|
|||
$structure = $resArray['uid'];
|
||||
} else {
|
||||
Helper::devLog('Could not identify document/structure type "' . $queryBuilder->expr()->literal($metadata['type'][0]) . '"', DEVLOG_SEVERITY_ERROR);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
$metadata['type'][0] = $structure;
|
||||
|
||||
|
@ -1099,12 +1099,12 @@ abstract class Document
|
|||
unset($collData);
|
||||
// Add new collection's UID.
|
||||
$collections[] = $substUid[$collNewUid];
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == FALSE) {
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == false) {
|
||||
Helper::addMessage(
|
||||
htmlspecialchars(sprintf(Helper::getMessage('flash.newCollection'), $collection, $substUid[$collNewUid])),
|
||||
Helper::getMessage('flash.attention', TRUE),
|
||||
Helper::getMessage('flash.attention', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::INFO,
|
||||
TRUE
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1150,12 +1150,12 @@ abstract class Document
|
|||
$substUid = Helper::processDBasAdmin($libData);
|
||||
// Add new library's UID.
|
||||
$ownerUid = $substUid[$libNewUid];
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == FALSE) {
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == false) {
|
||||
Helper::addMessage(
|
||||
htmlspecialchars(sprintf(Helper::getMessage('flash.newLibrary'), $owner, $ownerUid)),
|
||||
Helper::getMessage('flash.attention', TRUE),
|
||||
Helper::getMessage('flash.attention', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::INFO,
|
||||
TRUE
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1236,7 +1236,7 @@ abstract class Document
|
|||
'author' => implode('; ', $metadata['author']),
|
||||
'year' => implode('; ', $metadata['year']),
|
||||
'place' => implode('; ', $metadata['place']),
|
||||
'thumbnail' => $this->_getThumbnail(TRUE),
|
||||
'thumbnail' => $this->_getThumbnail(true),
|
||||
'metadata' => serialize($listed),
|
||||
'metadata_sorting' => serialize($sortable),
|
||||
'structure' => $metadata['type'][0],
|
||||
|
@ -1268,12 +1268,12 @@ abstract class Document
|
|||
$this->pid = $pid;
|
||||
$this->parentId = $partof;
|
||||
}
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == FALSE) {
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == false) {
|
||||
Helper::addMessage(
|
||||
htmlspecialchars(sprintf(Helper::getMessage('flash.documentSaved'), $metadata['title'][0], $this->uid)),
|
||||
Helper::getMessage('flash.done', TRUE),
|
||||
Helper::getMessage('flash.done', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::OK,
|
||||
TRUE
|
||||
true
|
||||
);
|
||||
}
|
||||
// Add document to index.
|
||||
|
@ -1282,7 +1282,7 @@ abstract class Document
|
|||
} else {
|
||||
Helper::devLog('Invalid UID "' . $core . '" for Solr core', DEVLOG_SEVERITY_NOTICE);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1355,7 +1355,7 @@ abstract class Document
|
|||
) {
|
||||
$this->prepareMetadataArray($cPid);
|
||||
$this->metadataArray[0] = $cPid;
|
||||
$this->metadataArrayLoaded = TRUE;
|
||||
$this->metadataArrayLoaded = true;
|
||||
}
|
||||
return $this->metadataArray;
|
||||
}
|
||||
|
@ -1464,7 +1464,7 @@ abstract class Document
|
|||
$parent = self::getInstance($this->parentId, $this->pid);
|
||||
$this->rootId = $parent->rootId;
|
||||
}
|
||||
$this->rootIdLoaded = TRUE;
|
||||
$this->rootIdLoaded = true;
|
||||
}
|
||||
return $this->rootId;
|
||||
}
|
||||
|
@ -1493,8 +1493,8 @@ abstract class Document
|
|||
// Is there no logical structure array yet?
|
||||
if (!$this->tableOfContentsLoaded) {
|
||||
// Get all logical structures.
|
||||
$this->getLogicalStructure('', TRUE);
|
||||
$this->tableOfContentsLoaded = TRUE;
|
||||
$this->getLogicalStructure('', true);
|
||||
$this->tableOfContentsLoaded = true;
|
||||
}
|
||||
return $this->tableOfContents;
|
||||
}
|
||||
|
@ -1510,7 +1510,7 @@ abstract class Document
|
|||
*
|
||||
* @return string The document's thumbnail location
|
||||
*/
|
||||
protected abstract function _getThumbnail($forceReload = FALSE);
|
||||
protected abstract function _getThumbnail($forceReload = false);
|
||||
|
||||
/**
|
||||
* This returns the ID of the toplevel logical structure node
|
||||
|
@ -1569,7 +1569,7 @@ abstract class Document
|
|||
*
|
||||
* @param int $uid: The UID of the document to parse or URL to XML file
|
||||
* @param int $pid: If > 0, then only document with this PID gets loaded
|
||||
* @param \SimpleXMLElement|IiifResourceInterface $preloadedDocument: Either NULL or the \SimpleXMLElement
|
||||
* @param \SimpleXMLElement|IiifResourceInterface $preloadedDocument: Either null or the \SimpleXMLElement
|
||||
* or IiifResourceInterface that has been loaded to determine the basic document format.
|
||||
*
|
||||
* @return void
|
||||
|
@ -1591,7 +1591,7 @@ abstract class Document
|
|||
&& $this->load($uid))) {
|
||||
// Initialize core METS object.
|
||||
$this->init();
|
||||
if ($this->getDocument() !== NULL) {
|
||||
if ($this->getDocument() !== null) {
|
||||
// Cast to string for safety reasons.
|
||||
$location = (string) $uid;
|
||||
$this->establishRecordId($pid);
|
||||
|
@ -1649,30 +1649,30 @@ abstract class Document
|
|||
$this->parentId = $resArray['partof'];
|
||||
$this->thumbnail = $resArray['thumbnail'];
|
||||
$this->location = $resArray['location'];
|
||||
$this->thumbnailLoaded = TRUE;
|
||||
$this->thumbnailLoaded = true;
|
||||
// Load XML file if necessary...
|
||||
if (
|
||||
$this->getDocument() === NULL
|
||||
$this->getDocument() === null
|
||||
&& $this->load($this->location)
|
||||
) {
|
||||
// ...and set some basic properties.
|
||||
$this->init();
|
||||
}
|
||||
// Do we have a METS / IIIF object now?
|
||||
if ($this->getDocument() !== NULL) {
|
||||
if ($this->getDocument() !== null) {
|
||||
// Set new location if necessary.
|
||||
if (!empty($location)) {
|
||||
$this->location = $location;
|
||||
}
|
||||
// Document ready!
|
||||
$this->ready = TRUE;
|
||||
$this->ready = true;
|
||||
}
|
||||
} elseif ($this->getDocument() !== NULL) {
|
||||
} elseif ($this->getDocument() !== null) {
|
||||
// Set location as UID for documents not in database.
|
||||
$this->uid = $location;
|
||||
$this->location = $location;
|
||||
// Document ready!
|
||||
$this->ready = TRUE;
|
||||
$this->ready = true;
|
||||
} else {
|
||||
Helper::devLog('No document with UID ' . $uid . ' found or document not accessible', DEVLOG_SEVERITY_ERROR);
|
||||
}
|
||||
|
@ -1708,7 +1708,7 @@ abstract class Document
|
|||
*
|
||||
* @param string $var: Name of variable to check
|
||||
*
|
||||
* @return bool TRUE if variable is set and not empty, FALSE otherwise
|
||||
* @return bool true if variable is set and not empty, false otherwise
|
||||
*/
|
||||
public function __isset($var) {
|
||||
return !empty($this->__get($var));
|
||||
|
|
|
@ -218,7 +218,7 @@ class DocumentList implements \ArrayAccess, \Countable, \Iterator, \TYPO3\CMS\Co
|
|||
if ($resArray['uid'] == $record['uid']) {
|
||||
$record['thumbnail'] = $resArray['thumbnail'];
|
||||
$record['metadata'] = $metadata;
|
||||
} elseif (($key = array_search(['u' => $resArray['uid']], $record['subparts'], TRUE)) !== FALSE) {
|
||||
} elseif (($key = array_search(['u' => $resArray['uid']], $record['subparts'], true)) !== false) {
|
||||
$record['subparts'][$key] = [
|
||||
'uid' => $resArray['uid'],
|
||||
'page' => 1,
|
||||
|
@ -245,7 +245,7 @@ class DocumentList implements \ArrayAccess, \Countable, \Iterator, \TYPO3\CMS\Co
|
|||
'highlighting' => [
|
||||
'query' => Solr::escapeQuery($this->metadata['searchString']),
|
||||
'field' => 'fulltext',
|
||||
'usefastvectorhighlighter' => TRUE
|
||||
'usefastvectorhighlighter' => true
|
||||
]
|
||||
];
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ class DocumentList implements \ArrayAccess, \Countable, \Iterator, \TYPO3\CMS\Co
|
|||
$record['thumbnail'] = $resArray->thumbnail;
|
||||
$record['metadata'] = $metadata;
|
||||
} else {
|
||||
$highlightedDoc = !empty($highlighting) ? $highlighting->getResult($resArray->id) : NULL;
|
||||
$highlightedDoc = !empty($highlighting) ? $highlighting->getResult($resArray->id) : null;
|
||||
$highlight = !empty($highlightedDoc) ? $highlightedDoc->getField('fulltext')[0] : '';
|
||||
$record['subparts'][$resArray->id] = [
|
||||
'uid' => $resArray->uid,
|
||||
|
@ -559,7 +559,7 @@ class DocumentList implements \ArrayAccess, \Countable, \Iterator, \TYPO3\CMS\Co
|
|||
*
|
||||
* @access protected
|
||||
*
|
||||
* @return bool TRUE on success or FALSE on failure
|
||||
* @return bool true on success or false on failure
|
||||
*/
|
||||
protected function solrConnect()
|
||||
{
|
||||
|
@ -592,10 +592,10 @@ class DocumentList implements \ArrayAccess, \Countable, \Iterator, \TYPO3\CMS\Co
|
|||
// Add static fields.
|
||||
$this->solrConfig['type'] = 'type';
|
||||
} else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -608,7 +608,7 @@ class DocumentList implements \ArrayAccess, \Countable, \Iterator, \TYPO3\CMS\Co
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
public function sort($by, $asc = TRUE)
|
||||
public function sort($by, $asc = true)
|
||||
{
|
||||
$newOrder = [];
|
||||
$nonSortable = [];
|
||||
|
@ -771,7 +771,7 @@ class DocumentList implements \ArrayAccess, \Countable, \Iterator, \TYPO3\CMS\Co
|
|||
*
|
||||
* @param string $var: Name of variable to check
|
||||
*
|
||||
* @return bool TRUE if variable is set and not empty, FALSE otherwise
|
||||
* @return bool true if variable is set and not empty, false otherwise
|
||||
*/
|
||||
public function __isset($var) {
|
||||
return !empty($this->__get($var));
|
||||
|
|
|
@ -71,12 +71,12 @@ class DocumentTypeCheck
|
|||
{
|
||||
// Load current document.
|
||||
$this->loadDocument();
|
||||
if ($this->doc === NULL) {
|
||||
if ($this->doc === null) {
|
||||
// Quit without doing anything if document not available.
|
||||
return '';
|
||||
}
|
||||
$toc = $this->doc->tableOfContents;
|
||||
if ($this->doc instanceof IiifManifest && (!isset($toc[0]['type']) || array_search($toc[0]['type'], ['newspaper', 'year', 'issue']) !== FALSE)) {
|
||||
if ($this->doc instanceof IiifManifest && (!isset($toc[0]['type']) || array_search($toc[0]['type'], ['newspaper', 'year', 'issue']) !== false)) {
|
||||
// Calendar plugin does not support IIIF (yet). Abort for all newspaper related types or if type is missing.
|
||||
return '';
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ class DocumentTypeCheck
|
|||
$this->doc = Document::getInstance($this->piVars['id']);
|
||||
if (!$this->doc->ready) {
|
||||
// Destroy the incomplete object.
|
||||
$this->doc = NULL;
|
||||
$this->doc = null;
|
||||
Helper::devLog('Failed to load document with UID ' . $this->piVars['id'], DEVLOG_SEVERITY_WARNING);
|
||||
}
|
||||
} elseif (!empty($this->piVars['recordId'])) {
|
||||
|
|
|
@ -56,7 +56,7 @@ class Helper
|
|||
*
|
||||
* @return \TYPO3\CMS\Core\Messaging\FlashMessageQueue The queue the message was added to
|
||||
*/
|
||||
public static function addMessage($message, $title, $severity, $session = FALSE, $queue = 'kitodo.default.flashMessages')
|
||||
public static function addMessage($message, $title, $severity, $session = false, $queue = 'kitodo.default.flashMessages')
|
||||
{
|
||||
$flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class);
|
||||
$flashMessageQueue = $flashMessageService->getMessageQueueByIdentifier($queue);
|
||||
|
@ -98,9 +98,9 @@ class Helper
|
|||
$checksum = 'X';
|
||||
}
|
||||
if (!preg_match('/[0-9]{8}[0-9X]{1}/i', $id)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
} elseif (strtoupper(substr($id, -1, 1)) != $checksum) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'ZDB':
|
||||
|
@ -108,19 +108,19 @@ class Helper
|
|||
$checksum = 'X';
|
||||
}
|
||||
if (!preg_match('/[0-9]{8}-[0-9X]{1}/i', $id)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
} elseif (strtoupper(substr($id, -1, 1)) != $checksum) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'SWD':
|
||||
$checksum = 11 - $checksum;
|
||||
if (!preg_match('/[0-9]{8}-[0-9]{1}/i', $id)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
} elseif ($checksum == 10) {
|
||||
return self::checkIdentifier(($digits + 1) . substr($id, -2, 2), 'SWD');
|
||||
} elseif (substr($id, -1, 1) != $checksum) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'GKD':
|
||||
|
@ -129,13 +129,13 @@ class Helper
|
|||
$checksum = 'X';
|
||||
}
|
||||
if (!preg_match('/[0-9]{8}-[0-9X]{1}/i', $id)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
} elseif (strtoupper(substr($id, -1, 1)) != $checksum) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -146,7 +146,7 @@ class Helper
|
|||
* @param string $encrypted: The encrypted value to decrypt
|
||||
* @param string $hash: The control hash for decrypting
|
||||
*
|
||||
* @return mixed The decrypted value or NULL on error
|
||||
* @return mixed The decrypted value or null on error
|
||||
*/
|
||||
public static function decrypt($encrypted, $hash)
|
||||
{
|
||||
|
@ -195,11 +195,11 @@ class Helper
|
|||
$caller = $stacktrace[1]['class'] . $stacktrace[1]['type'] . $stacktrace[1]['function'];
|
||||
foreach ($stacktrace[1]['args'] as $arg) {
|
||||
if (is_bool($arg)) {
|
||||
$args[] = ($arg ? 'TRUE' : 'FALSE');
|
||||
$args[] = ($arg ? 'true' : 'false');
|
||||
} elseif (is_scalar($arg)) {
|
||||
$args[] = (string) $arg;
|
||||
} elseif (is_null($arg)) {
|
||||
$args[] = 'NULL';
|
||||
$args[] = 'null';
|
||||
} elseif (is_array($arg)) {
|
||||
$args[] = '[data]';
|
||||
$data[] = $arg;
|
||||
|
@ -210,7 +210,7 @@ class Helper
|
|||
}
|
||||
}
|
||||
$arguments = '(' . implode(', ', $args) . ')';
|
||||
$additionalData = (empty($data) ? FALSE : $data);
|
||||
$additionalData = (empty($data) ? false : $data);
|
||||
\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[' . $caller . $arguments . '] ' . $message, self::$extKey, $severity, $additionalData);
|
||||
}
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ class Helper
|
|||
}
|
||||
$iv = substr(md5($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']), 0, openssl_cipher_iv_length('BF-CFB'));
|
||||
$encrypted = openssl_encrypt($string, 'BF-CFB', substr($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'], 0, 56), 0, $iv);
|
||||
$salt = substr(md5(uniqid(rand(), TRUE)), 0, 10);
|
||||
$salt = substr(md5(uniqid(rand(), true)), 0, 10);
|
||||
$hash = $salt . substr(sha1($salt . $string), -10);
|
||||
return ['encrypted' => $encrypted, 'hash' => $hash];
|
||||
}
|
||||
|
@ -375,9 +375,9 @@ class Helper
|
|||
$lang = $GLOBALS['TSFE']->getLLL($isoCode, $iso639);
|
||||
}
|
||||
} elseif (\TYPO3_MODE === 'BE') {
|
||||
$iso639 = $GLOBALS['LANG']->includeLLFile($file, FALSE, TRUE);
|
||||
$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, false);
|
||||
}
|
||||
} else {
|
||||
self::devLog('Unexpected TYPO3_MODE "' . \TYPO3_MODE . '"', DEVLOG_SEVERITY_ERROR);
|
||||
|
@ -402,7 +402,7 @@ class Helper
|
|||
*
|
||||
* @return string The translated string or the given key on failure
|
||||
*/
|
||||
public static function getMessage($key, $hsc = FALSE, $default = '')
|
||||
public static function getMessage($key, $hsc = false, $default = '')
|
||||
{
|
||||
// Set initial output to default value.
|
||||
$translated = (string) $default;
|
||||
|
@ -412,7 +412,7 @@ class Helper
|
|||
if (\TYPO3_MODE === 'FE') {
|
||||
self::$messages = $GLOBALS['TSFE']->readLLfile($file);
|
||||
} elseif (\TYPO3_MODE === 'BE') {
|
||||
self::$messages = $GLOBALS['LANG']->includeLLFile($file, FALSE, TRUE);
|
||||
self::$messages = $GLOBALS['LANG']->includeLLFile($file, false, true);
|
||||
} else {
|
||||
self::devLog('Unexpected TYPO3_MODE "' . \TYPO3_MODE . '"', DEVLOG_SEVERITY_ERROR);
|
||||
}
|
||||
|
@ -422,7 +422,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, false);
|
||||
} else {
|
||||
self::devLog('Unexpected TYPO3_MODE "' . \TYPO3_MODE . '"', DEVLOG_SEVERITY_ERROR);
|
||||
}
|
||||
|
@ -577,7 +577,7 @@ class Helper
|
|||
*
|
||||
* @param string $key: Session data key for retrieval
|
||||
*
|
||||
* @return mixed Session value for given key or NULL on failure
|
||||
* @return mixed Session value for given key or null on failure
|
||||
*/
|
||||
public static function loadFromSession($key)
|
||||
{
|
||||
|
@ -606,13 +606,13 @@ class Helper
|
|||
*
|
||||
* @param array $original: Original array
|
||||
* @param array $overrule: Overrule array, overruling the original array
|
||||
* @param bool $addKeys: If set to FALSE, keys that are not found in $original will not be set
|
||||
* @param bool $addKeys: If set to false, keys that are not found in $original will not be set
|
||||
* @param bool $includeEmptyValues: If set, values from $overrule will overrule if they are empty
|
||||
* @param bool $enableUnsetFeature: If set, special value "__UNSET" can be used in the overrule array to unset keys in the original array
|
||||
*
|
||||
* @return array Merged array
|
||||
*/
|
||||
public static function mergeRecursiveWithOverrule(array $original, array $overrule, $addKeys = TRUE, $includeEmptyValues = TRUE, $enableUnsetFeature = TRUE)
|
||||
public static function mergeRecursiveWithOverrule(array $original, array $overrule, $addKeys = true, $includeEmptyValues = true, $enableUnsetFeature = true)
|
||||
{
|
||||
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($original, $overrule, $addKeys, $includeEmptyValues, $enableUnsetFeature);
|
||||
return $original;
|
||||
|
@ -630,7 +630,7 @@ class Helper
|
|||
*
|
||||
* @return array Array of substituted "NEW..." identifiers and their actual UIDs.
|
||||
*/
|
||||
public static function processDBasAdmin(array $data = [], array $cmd = [], $reverseOrder = FALSE, $cmdFirst = FALSE)
|
||||
public static function processDBasAdmin(array $data = [], array $cmd = [], $reverseOrder = false, $cmdFirst = false)
|
||||
{
|
||||
if (
|
||||
\TYPO3_MODE === 'BE'
|
||||
|
@ -720,7 +720,7 @@ class Helper
|
|||
* @param mixed $value: Value to save
|
||||
* @param string $key: Session data key for saving
|
||||
*
|
||||
* @return bool TRUE on success, FALSE on failure
|
||||
* @return bool true on success, false on failure
|
||||
*/
|
||||
public static function saveToSession($value, $key)
|
||||
{
|
||||
|
@ -728,19 +728,19 @@ class Helper
|
|||
$key = (string) $key;
|
||||
if (!$key) {
|
||||
self::devLog('Invalid key "' . $key . '" for session data saving', DEVLOG_SEVERITY_WARNING);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// Save value in session data.
|
||||
if (\TYPO3_MODE === 'FE') {
|
||||
$GLOBALS['TSFE']->fe_user->setKey('ses', $key, $value);
|
||||
$GLOBALS['TSFE']->fe_user->storeSessionData();
|
||||
return TRUE;
|
||||
return true;
|
||||
} elseif (\TYPO3_MODE === 'BE') {
|
||||
$GLOBALS['BE_USER']->setAndSaveSessionData($key, $value);
|
||||
return TRUE;
|
||||
return true;
|
||||
} else {
|
||||
self::devLog('Unexpected TYPO3_MODE "' . \TYPO3_MODE . '"', DEVLOG_SEVERITY_ERROR);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -786,7 +786,7 @@ class Helper
|
|||
->where(
|
||||
$queryBuilder->expr()->eq($table . '.pid', $pid),
|
||||
$queryBuilder->expr()->eq($table . '.index_name', $queryBuilder->expr()->literal($index_name)),
|
||||
self::whereExpression($table, TRUE)
|
||||
self::whereExpression($table, true)
|
||||
)
|
||||
->setMaxResults(1)
|
||||
->execute();
|
||||
|
@ -804,7 +804,7 @@ class Helper
|
|||
$queryBuilder->expr()->eq($table . '.pid', $pid),
|
||||
$queryBuilder->expr()->eq($table . '.uid', $resArray['l18n_parent']),
|
||||
$queryBuilder->expr()->eq($table . '.sys_language_uid', intval($GLOBALS['TSFE']->sys_language_content)),
|
||||
self::whereExpression($table, TRUE)
|
||||
self::whereExpression($table, true)
|
||||
)
|
||||
->setMaxResults(1)
|
||||
->execute();
|
||||
|
@ -839,7 +839,7 @@ class Helper
|
|||
->where(
|
||||
$queryBuilder->expr()->eq($table . '.pid', $pid),
|
||||
$additionalWhere,
|
||||
self::whereExpression($table, TRUE)
|
||||
self::whereExpression($table, true)
|
||||
)
|
||||
->setMaxResults(10000)
|
||||
->execute();
|
||||
|
@ -879,7 +879,7 @@ class Helper
|
|||
*
|
||||
* @return string Additional WHERE clause
|
||||
*/
|
||||
public static function whereClause($table, $showHidden = FALSE)
|
||||
public static function whereClause($table, $showHidden = false)
|
||||
{
|
||||
if (\TYPO3_MODE === 'FE') {
|
||||
// Table "tx_dlf_formats" always has PID 0.
|
||||
|
@ -917,7 +917,7 @@ class Helper
|
|||
*
|
||||
* @return string Additional WHERE expression
|
||||
*/
|
||||
public static function whereExpression($table, $showHidden = FALSE)
|
||||
public static function whereExpression($table, $showHidden = false)
|
||||
{
|
||||
$expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getQueryBuilderForTable($table)
|
||||
|
|
|
@ -86,7 +86,7 @@ final class IiifManifest extends Document
|
|||
* @var bool
|
||||
* @access protected
|
||||
*/
|
||||
protected $hasFulltextSet = FALSE;
|
||||
protected $hasFulltextSet = false;
|
||||
|
||||
/**
|
||||
* This holds the original manifest's parsed metadata array with their corresponding
|
||||
|
@ -119,7 +119,7 @@ final class IiifManifest extends Document
|
|||
*/
|
||||
protected function establishRecordId($pid)
|
||||
{
|
||||
if ($this->iiif !== NULL) {
|
||||
if ($this->iiif !== null) {
|
||||
/*
|
||||
* FIXME This will not consistently work because we can not be sure to have the pid at hand. It may miss
|
||||
* if the plugin that actually loads the manifest allows content from other pages.
|
||||
|
@ -134,7 +134,7 @@ final class IiifManifest extends Document
|
|||
. ' AND tx_dlf_metadataformat.pid=' . intval($pid)
|
||||
. ' AND ((tx_dlf_metadata.uid=tx_dlf_metadataformat.parent_id AND tx_dlf_metadataformat.encoded=tx_dlf_formats.uid'
|
||||
. ' AND tx_dlf_metadata.index_name="record_id" AND tx_dlf_formats.type=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->getIiifVersion(), 'tx_dlf_formats') . ') OR tx_dlf_metadata.format=0)'
|
||||
. Helper::whereClause('tx_dlf_metadata', TRUE)
|
||||
. Helper::whereClause('tx_dlf_metadata', true)
|
||||
. Helper::whereClause('tx_dlf_metadataformat')
|
||||
. Helper::whereClause('tx_dlf_formats')
|
||||
);
|
||||
|
@ -246,8 +246,8 @@ final class IiifManifest extends Document
|
|||
{
|
||||
// Is there no physical structure array yet?
|
||||
if (!$this->physicalStructureLoaded) {
|
||||
if ($this->iiif == NULL || !($this->iiif instanceof ManifestInterface)) {
|
||||
return NULL;
|
||||
if ($this->iiif == null || !($this->iiif instanceof ManifestInterface)) {
|
||||
return null;
|
||||
}
|
||||
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]);
|
||||
$iiifId = $this->iiif->getId();
|
||||
|
@ -257,7 +257,7 @@ final class IiifManifest extends Document
|
|||
$this->physicalStructureInfo[$physSeq[0]]['label'] = $this->iiif->getLabelForDisplay();
|
||||
$this->physicalStructureInfo[$physSeq[0]]['orderlabel'] = $this->iiif->getLabelForDisplay();
|
||||
$this->physicalStructureInfo[$physSeq[0]]['type'] = 'physSequence';
|
||||
$this->physicalStructureInfo[$physSeq[0]]['contentIds'] = NULL;
|
||||
$this->physicalStructureInfo[$physSeq[0]]['contentIds'] = null;
|
||||
$fileUseDownload = $this->getUseGroups('fileGrpDownload');
|
||||
$fileUseFulltext = $this->getUseGroups('fileGrpFulltext');
|
||||
$fileUseThumbs = $this->getUseGroups('fileGrpThumbs');
|
||||
|
@ -271,14 +271,14 @@ final class IiifManifest extends Document
|
|||
if (isset($fileUseFulltext)) {
|
||||
$iiifAlto = $this->iiif->getSeeAlsoUrlsForFormat("application/alto+xml");
|
||||
if (empty($iiifAlto)) {
|
||||
$iiifAlto = $this->iiif->getSeeAlsoUrlsForProfile("http://www.loc.gov/standards/alto/", TRUE);
|
||||
$iiifAlto = $this->iiif->getSeeAlsoUrlsForProfile("http://www.loc.gov/standards/alto/", true);
|
||||
}
|
||||
if (!empty($iiifAlto)) {
|
||||
// TODO use multiple possible alto files?
|
||||
$this->mimeTypes[$iiifAlto[0]] = "application/alto+xml";
|
||||
$this->physicalStructureInfo[$physSeq[0]]['files'][$fileUseFulltext] = $iiifAlto[0];
|
||||
$this->hasFulltext = TRUE;
|
||||
$this->hasFulltextSet = TRUE;
|
||||
$this->hasFulltext = true;
|
||||
$this->hasFulltextSet = true;
|
||||
}
|
||||
}
|
||||
if (!empty($this->iiif->getDefaultCanvases())) {
|
||||
|
@ -295,7 +295,7 @@ final class IiifManifest extends Document
|
|||
// put images in all non specific filegroups
|
||||
if (isset($fileUses)) {
|
||||
foreach ($fileUses as $fileUse) {
|
||||
if ($image->getBody() != NULL && $image->getBody() instanceof ContentResourceInterface) {
|
||||
if ($image->getBody() != null && $image->getBody() instanceof ContentResourceInterface) {
|
||||
$this->physicalStructureInfo[$physSeq[0]]['files'][$fileUse] = $image->getBody()->getId();
|
||||
}
|
||||
}
|
||||
|
@ -303,40 +303,40 @@ final class IiifManifest extends Document
|
|||
// populate structural metadata info
|
||||
$elements[$canvasOrder] = $canvas->getId();
|
||||
$this->physicalStructureInfo[$elements[$canvasOrder]]['id'] = $canvas->getId();
|
||||
$this->physicalStructureInfo[$elements[$canvasOrder]]['dmdId'] = NULL;
|
||||
$this->physicalStructureInfo[$elements[$canvasOrder]]['dmdId'] = null;
|
||||
$this->physicalStructureInfo[$elements[$canvasOrder]]['label'] = $canvas->getLabelForDisplay();
|
||||
$this->physicalStructureInfo[$elements[$canvasOrder]]['orderlabel'] = $canvas->getLabelForDisplay();
|
||||
// assume that a canvas always represents a page
|
||||
$this->physicalStructureInfo[$elements[$canvasOrder]]['type'] = 'page';
|
||||
$this->physicalStructureInfo[$elements[$canvasOrder]]['contentIds'] = NULL;
|
||||
$this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = NULL;
|
||||
$this->physicalStructureInfo[$elements[$canvasOrder]]['contentIds'] = null;
|
||||
$this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = null;
|
||||
if (!empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) {
|
||||
$this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = [];
|
||||
$this->physicalStructureInfo[$physSeq[0]]['annotationContainers'] = [];
|
||||
foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) {
|
||||
$this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'][] = $annotationContainer->getId();
|
||||
if ($extConf['indexAnnotations']) {
|
||||
$this->hasFulltext = TRUE;
|
||||
$this->hasFulltextSet = TRUE;
|
||||
$this->hasFulltext = true;
|
||||
$this->hasFulltextSet = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($fileUseFulltext)) {
|
||||
$alto = $canvas->getSeeAlsoUrlsForFormat("application/alto+xml");
|
||||
if (empty($alto)) {
|
||||
$alto = $canvas->getSeeAlsoUrlsForProfile("http://www.loc.gov/standards/alto/", TRUE);
|
||||
$alto = $canvas->getSeeAlsoUrlsForProfile("http://www.loc.gov/standards/alto/", true);
|
||||
}
|
||||
if (!empty($alto)) {
|
||||
// TODO use all possible alto files?
|
||||
$this->mimeTypes[$alto[0]] = "application/alto+xml";
|
||||
$this->physicalStructureInfo[$elements[$canvasOrder]]['files'][$fileUseFulltext] = $alto[0];
|
||||
$this->hasFulltext = TRUE;
|
||||
$this->hasFulltextSet = TRUE;
|
||||
$this->hasFulltext = true;
|
||||
$this->hasFulltextSet = true;
|
||||
}
|
||||
}
|
||||
if (isset($fileUses)) {
|
||||
foreach ($fileUses as $fileUse) {
|
||||
if ($image->getBody() != NULL && $image->getBody() instanceof ContentResourceInterface) {
|
||||
if ($image->getBody() != null && $image->getBody() instanceof ContentResourceInterface) {
|
||||
$this->physicalStructureInfo[$elements[$canvasOrder]]['files'][$fileUse] = $image->getBody()->getId();
|
||||
}
|
||||
}
|
||||
|
@ -355,7 +355,7 @@ final class IiifManifest extends Document
|
|||
// Merge and re-index the array to get nice numeric indexes.
|
||||
$this->physicalStructure = array_merge($physSeq, $elements);
|
||||
}
|
||||
$this->physicalStructureLoaded = TRUE;
|
||||
$this->physicalStructureLoaded = true;
|
||||
}
|
||||
return $this->physicalStructure;
|
||||
}
|
||||
|
@ -380,15 +380,15 @@ final class IiifManifest extends Document
|
|||
*/
|
||||
public function getFileLocation($id)
|
||||
{
|
||||
if ($id == NULL) {
|
||||
return NULL;
|
||||
if ($id == null) {
|
||||
return null;
|
||||
}
|
||||
$resource = $this->iiif->getContainedResourceById($id);
|
||||
if (isset($resource)) {
|
||||
if ($resource instanceof CanvasInterface) {
|
||||
return (!empty($resource->getImageAnnotations()) && $resource->getImageAnnotations()->getSingleService() != NULL) ? $resource->getImageAnnotations()[0]->getSingleService()->getId() : $id;
|
||||
return (!empty($resource->getImageAnnotations()) && $resource->getImageAnnotations()->getSingleService() != null) ? $resource->getImageAnnotations()[0]->getSingleService()->getId() : $id;
|
||||
} elseif ($resource instanceof ContentResourceInterface) {
|
||||
return $resource->getSingleService() != NULL && $resource->getSingleService() instanceof Service ? $resource->getSingleService()->getId() : $id;
|
||||
return $resource->getSingleService() != null && $resource->getSingleService() instanceof Service ? $resource->getSingleService()->getId() : $id;
|
||||
} elseif ($resource instanceof AbstractImageService) {
|
||||
return $resource->getId();
|
||||
} elseif ($resource instanceof AnnotationContainerInterface) {
|
||||
|
@ -411,7 +411,7 @@ final class IiifManifest extends Document
|
|||
} elseif ($fileResource instanceof AnnotationInterface) {
|
||||
$format = "application/vnd.kitodo.iiif";
|
||||
} elseif ($fileResource instanceof ContentResourceInterface) {
|
||||
if ($fileResource->isText() || $fileResource->isImage() && ($fileResource->getSingleService() == NULL || !($fileResource->getSingleService() instanceof AbstractImageService))) {
|
||||
if ($fileResource->isText() || $fileResource->isImage() && ($fileResource->getSingleService() == null || !($fileResource->getSingleService() instanceof AbstractImageService))) {
|
||||
// Support static images without an image service
|
||||
return $fileResource->getFormat();
|
||||
}
|
||||
|
@ -429,7 +429,7 @@ final class IiifManifest extends Document
|
|||
* {@inheritDoc}
|
||||
* @see Document::getLogicalStructure()
|
||||
*/
|
||||
public function getLogicalStructure($id, $recursive = FALSE)
|
||||
public function getLogicalStructure($id, $recursive = false)
|
||||
{
|
||||
$details = [];
|
||||
if (!$recursive && !empty($this->logicalUnits[$id])) {
|
||||
|
@ -446,8 +446,8 @@ final class IiifManifest extends Document
|
|||
// cache the ranges - they might occure multiple times in the structures "tree" - with full data as well as referenced as id
|
||||
$processedStructures = [];
|
||||
foreach ($logUnits as $logUnit) {
|
||||
if (array_search($logUnit->getId(), $processedStructures) == FALSE) {
|
||||
$this->tableOfContents[] = $this->getLogicalStructureInfo($logUnit, TRUE, $processedStructures);
|
||||
if (array_search($logUnit->getId(), $processedStructures) == false) {
|
||||
$this->tableOfContents[] = $this->getLogicalStructureInfo($logUnit, true, $processedStructures);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -465,13 +465,13 @@ final class IiifManifest extends Document
|
|||
* @param array $processedStructures: IIIF resources that already have been processed
|
||||
* @return array Logical structure array
|
||||
*/
|
||||
protected function getLogicalStructureInfo(IiifResourceInterface $resource, $recursive = FALSE, &$processedStructures = [])
|
||||
protected function getLogicalStructureInfo(IiifResourceInterface $resource, $recursive = false, &$processedStructures = [])
|
||||
{
|
||||
$details = [];
|
||||
$details['id'] = $resource->getId();
|
||||
$details['dmdId'] = '';
|
||||
$details['label'] = $resource->getLabelForDisplay() !== NULL ? $resource->getLabelForDisplay() : '';
|
||||
$details['orderlabel'] = $resource->getLabelForDisplay() !== NULL ? $resource->getLabelForDisplay() : '';
|
||||
$details['label'] = $resource->getLabelForDisplay() !== null ? $resource->getLabelForDisplay() : '';
|
||||
$details['orderlabel'] = $resource->getLabelForDisplay() !== null ? $resource->getLabelForDisplay() : '';
|
||||
$details['contentIds'] = '';
|
||||
$details['volume'] = '';
|
||||
$details['pagination'] = '';
|
||||
|
@ -496,10 +496,10 @@ final class IiifManifest extends Document
|
|||
$startCanvas = $resource->getStartCanvasOrFirstCanvas();
|
||||
$canvases = $resource->getAllCanvases();
|
||||
}
|
||||
if ($startCanvas != NULL) {
|
||||
if ($startCanvas != null) {
|
||||
$details['pagination'] = $startCanvas->getLabel();
|
||||
$startCanvasIndex = array_search($startCanvas, $this->iiif->getDefaultCanvases());
|
||||
if ($startCanvasIndex !== FALSE) {
|
||||
if ($startCanvasIndex !== false) {
|
||||
$details['points'] = $startCanvasIndex + 1;
|
||||
}
|
||||
}
|
||||
|
@ -513,7 +513,7 @@ final class IiifManifest extends Document
|
|||
if ($recursive) {
|
||||
$processedStructures[] = $resource->getId();
|
||||
$details['children'] = [];
|
||||
if ($resource instanceof ManifestInterface && $resource->getRootRanges() != NULL) {
|
||||
if ($resource instanceof ManifestInterface && $resource->getRootRanges() != null) {
|
||||
$rangesToAdd = [];
|
||||
$rootRanges = [];
|
||||
if (sizeof($this->iiif->getRootRanges()) == 1 && $this->iiif->getRootRanges()[0]->isTopRange()) {
|
||||
|
@ -525,15 +525,15 @@ final class IiifManifest extends Document
|
|||
$rootRanges[] = $range;
|
||||
}
|
||||
foreach ($rootRanges as $range) {
|
||||
if ((array_search($range->getId(), $processedStructures) == FALSE)) {
|
||||
$details['children'][] = $this->getLogicalStructureInfo($range, TRUE, $processedStructures);
|
||||
if ((array_search($range->getId(), $processedStructures) == false)) {
|
||||
$details['children'][] = $this->getLogicalStructureInfo($range, true, $processedStructures);
|
||||
}
|
||||
}
|
||||
} elseif ($resource instanceof RangeInterface) {
|
||||
if (!empty($resource->getAllRanges())) {
|
||||
foreach ($resource->getAllRanges() as $range) {
|
||||
if ((array_search($range->getId(), $processedStructures) == FALSE)) {
|
||||
$details['children'][] = $this->getLogicalStructureInfo($range, TRUE, $processedStructures);
|
||||
if ((array_search($range->getId(), $processedStructures) == false)) {
|
||||
$details['children'][] = $this->getLogicalStructureInfo($range, true, $processedStructures);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -558,15 +558,15 @@ final class IiifManifest extends Document
|
|||
*
|
||||
* @todo This method is still in experimental; the method signature may change.
|
||||
*/
|
||||
public function getManifestMetadata($id, $cPid = 0, $withDescription = TRUE, $withRights = TRUE, $withRelated = TRUE)
|
||||
public function getManifestMetadata($id, $cPid = 0, $withDescription = true, $withRights = true, $withRelated = true)
|
||||
{
|
||||
if (!empty($this->originalMetadataArray[$id])) {
|
||||
return $this->originalMetadataArray[$id];
|
||||
}
|
||||
$iiifResource = $this->iiif->getContainedResourceById($id);
|
||||
$result = [];
|
||||
if ($iiifResource != NULL) {
|
||||
if ($iiifResource->getLabel() != NULL && $iiifResource->getLabel() != "") {
|
||||
if ($iiifResource != null) {
|
||||
if ($iiifResource->getLabel() != null && $iiifResource->getLabel() != "") {
|
||||
$result['label'] = $iiifResource->getLabel();
|
||||
}
|
||||
if (!empty($iiifResource->getMetadata())) {
|
||||
|
@ -640,12 +640,12 @@ final class IiifManifest extends Document
|
|||
'tx_dlf_metadata.pid=' . intval($cPid)
|
||||
. ' AND tx_dlf_metadataformat.pid=' . intval($cPid)
|
||||
. ' AND ((tx_dlf_metadata.uid=tx_dlf_metadataformat.parent_id AND tx_dlf_metadataformat.encoded=tx_dlf_formats.uid AND tx_dlf_formats.type=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->getIiifVersion(), 'tx_dlf_formats') . ') OR tx_dlf_metadata.format=0)'
|
||||
. Helper::whereClause('tx_dlf_metadata', TRUE) . Helper::whereClause('tx_dlf_metadataformat') . Helper::whereClause('tx_dlf_formats')
|
||||
. Helper::whereClause('tx_dlf_metadata', true) . Helper::whereClause('tx_dlf_metadataformat') . Helper::whereClause('tx_dlf_formats')
|
||||
);
|
||||
$iiifResource = $this->iiif->getContainedResourceById($id);
|
||||
while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
|
||||
// Set metadata field's value(s).
|
||||
if ($resArray['format'] > 0 && !empty($resArray['xpath']) && ($values = $iiifResource->jsonPath($resArray['xpath'])) != NULL) {
|
||||
if ($resArray['format'] > 0 && !empty($resArray['xpath']) && ($values = $iiifResource->jsonPath($resArray['xpath'])) != null) {
|
||||
if (is_string($values)) {
|
||||
$metadata[$resArray['index_name']] = [trim((string) $values)];
|
||||
} elseif ($values instanceof JSONPath && is_array($values->data()) && count($values->data()) > 1) {
|
||||
|
@ -663,7 +663,7 @@ final class IiifManifest extends Document
|
|||
if (!empty($metadata[$resArray['index_name']]) && $resArray['is_sortable']) {
|
||||
if (
|
||||
$resArray['format'] > 0 && !empty($resArray['xpath_sorting'])
|
||||
&& ($values = $iiifResource->jsonPath($resArray['xpath_sorting']) != NULL)
|
||||
&& ($values = $iiifResource->jsonPath($resArray['xpath_sorting']) != null)
|
||||
) {
|
||||
if (is_string($values)) {
|
||||
$metadata[$resArray['index_name'] . '_sorting'][0] = [trim((string) $values)];
|
||||
|
@ -699,7 +699,7 @@ final class IiifManifest extends Document
|
|||
$this->smLinkRangeCanvasesRecursively($range);
|
||||
}
|
||||
}
|
||||
$this->smLinksLoaded = TRUE;
|
||||
$this->smLinksLoaded = true;
|
||||
}
|
||||
return $this->smLinks;
|
||||
}
|
||||
|
@ -789,7 +789,7 @@ final class IiifManifest extends Document
|
|||
foreach ($annotationContainer->getTextAnnotations(Motivation::PAINTING) as $annotation) {
|
||||
if (
|
||||
$annotation->getTargetResourceId() == $iiifResource->getId() &&
|
||||
$annotation->getBody() != NULL && $annotation->getBody()->getChars() != NULL
|
||||
$annotation->getBody() != null && $annotation->getBody()->getChars() != null
|
||||
) {
|
||||
$annotationTexts[] = $annotation->getBody()->getChars();
|
||||
}
|
||||
|
@ -835,21 +835,21 @@ final class IiifManifest extends Document
|
|||
protected function loadLocation($location)
|
||||
{
|
||||
$fileResource = GeneralUtility::getUrl($location);
|
||||
if ($fileResource !== FALSE) {
|
||||
if ($fileResource !== false) {
|
||||
$conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]);
|
||||
IiifHelper::setUrlReader(IiifUrlReader::getInstance());
|
||||
IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']);
|
||||
IiifHelper::setMaxThumbnailWidth($conf['iiifThumbnailWidth']);
|
||||
$resource = IiifHelper::loadIiifResource($fileResource);
|
||||
if ($resource != NULL) {
|
||||
if ($resource != null) {
|
||||
if ($resource instanceof ManifestInterface) {
|
||||
$this->iiif = $resource;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Helper::devLog('Could not load IIIF manifest from "' . $location . '"', DEVLOG_SEVERITY_ERROR);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -870,9 +870,9 @@ final class IiifManifest extends Document
|
|||
{
|
||||
if ($preloadedDocument instanceof ManifestInterface) {
|
||||
$this->iiif = $preloadedDocument;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -895,22 +895,22 @@ final class IiifManifest extends Document
|
|||
!empty($canvas->getSeeAlsoUrlsForFormat("application/alto+xml")) ||
|
||||
!empty($canvas->getSeeAlsoUrlsForProfile("http://www.loc.gov/standards/alto/"))
|
||||
) {
|
||||
$this->hasFulltextSet = TRUE;
|
||||
$this->hasFulltext = TRUE;
|
||||
$this->hasFulltextSet = true;
|
||||
$this->hasFulltext = true;
|
||||
return;
|
||||
}
|
||||
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]);
|
||||
if ($extConf['indexAnnotations'] == 1 && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) {
|
||||
foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) {
|
||||
if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != NULL) {
|
||||
if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != null) {
|
||||
foreach ($textAnnotations as $annotation) {
|
||||
if (
|
||||
$annotation->getBody() != NULL &&
|
||||
$annotation->getBody() != null &&
|
||||
$annotation->getBody()->getFormat() == "text/plain" &&
|
||||
$annotation->getBody()->getChars() != NULL
|
||||
$annotation->getBody()->getChars() != null
|
||||
) {
|
||||
$this->hasFulltextSet = TRUE;
|
||||
$this->hasFulltext = TRUE;
|
||||
$this->hasFulltextSet = true;
|
||||
$this->hasFulltext = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -918,7 +918,7 @@ final class IiifManifest extends Document
|
|||
}
|
||||
}
|
||||
}
|
||||
$this->hasFulltextSet = TRUE;
|
||||
$this->hasFulltextSet = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -926,7 +926,7 @@ final class IiifManifest extends Document
|
|||
* {@inheritDoc}
|
||||
* @see \Kitodo\Dlf\Common\Document::_getThumbnail()
|
||||
*/
|
||||
protected function _getThumbnail($forceReload = FALSE)
|
||||
protected function _getThumbnail($forceReload = false)
|
||||
{
|
||||
return $this->iiif->getThumbnailUrl();
|
||||
}
|
||||
|
@ -960,7 +960,7 @@ final class IiifManifest extends Document
|
|||
IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']);
|
||||
IiifHelper::setMaxThumbnailWidth($conf['iiifThumbnailWidth']);
|
||||
$resource = IiifHelper::loadIiifResource($this->asJson);
|
||||
if ($resource != NULL && $resource instanceof ManifestInterface) {
|
||||
if ($resource != null && $resource instanceof ManifestInterface) {
|
||||
$this->asJson = '';
|
||||
$this->iiif = $resource;
|
||||
$this->init();
|
||||
|
|
|
@ -41,7 +41,7 @@ class IiifUrlReader implements UrlReaderInterface
|
|||
public function getContent($url)
|
||||
{
|
||||
$fileContents = GeneralUtility::getUrl($url);
|
||||
if ($fileContents !== FALSE) {
|
||||
if ($fileContents !== false) {
|
||||
return $fileContents;
|
||||
} else {
|
||||
return '';
|
||||
|
|
|
@ -60,7 +60,7 @@ class Indexer
|
|||
* @var bool
|
||||
* @access protected
|
||||
*/
|
||||
protected static $fieldsLoaded = FALSE;
|
||||
protected static $fieldsLoaded = false;
|
||||
|
||||
/**
|
||||
* List of already processed documents
|
||||
|
@ -96,7 +96,7 @@ class Indexer
|
|||
$errors = 0;
|
||||
// Handle multi-volume documents.
|
||||
if ($doc->parentId) {
|
||||
$parent = Document::getInstance($doc->parentId, 0, TRUE);
|
||||
$parent = Document::getInstance($doc->parentId, 0, true);
|
||||
if ($parent->ready) {
|
||||
$errors = self::add($parent, $core);
|
||||
} else {
|
||||
|
@ -150,43 +150,43 @@ class Indexer
|
|||
|
||||
$allResults = $result->fetchAll();
|
||||
$resArray = $allResults[0];
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == FALSE) {
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == false) {
|
||||
if (!$errors) {
|
||||
Helper::addMessage(
|
||||
htmlspecialchars(sprintf(Helper::getMessage('flash.documentIndexed'), $resArray['title'], $doc->uid)),
|
||||
Helper::getMessage('flash.done', TRUE),
|
||||
Helper::getMessage('flash.done', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::OK,
|
||||
TRUE
|
||||
true
|
||||
);
|
||||
} else {
|
||||
Helper::addMessage(
|
||||
htmlspecialchars(sprintf(Helper::getMessage('flash.documentNotIndexed'), $resArray['title'], $doc->uid)),
|
||||
Helper::getMessage('flash.error', TRUE),
|
||||
Helper::getMessage('flash.error', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
|
||||
TRUE
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
return $errors;
|
||||
} catch (\Exception $e) {
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == FALSE) {
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == false) {
|
||||
Helper::addMessage(
|
||||
Helper::getMessage('flash.solrException', TRUE) . '<br />' . htmlspecialchars($e->getMessage()),
|
||||
Helper::getMessage('flash.error', TRUE),
|
||||
Helper::getMessage('flash.solrException', true) . '<br />' . htmlspecialchars($e->getMessage()),
|
||||
Helper::getMessage('flash.error', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
|
||||
TRUE
|
||||
true
|
||||
);
|
||||
}
|
||||
Helper::devLog('Apache Solr threw exception: "' . $e->getMessage() . '"', DEVLOG_SEVERITY_ERROR);
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == FALSE) {
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == false) {
|
||||
Helper::addMessage(
|
||||
Helper::getMessage('flash.solrNoConnection', TRUE),
|
||||
Helper::getMessage('flash.warning', TRUE),
|
||||
Helper::getMessage('flash.solrNoConnection', true),
|
||||
Helper::getMessage('flash.warning', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::WARNING,
|
||||
TRUE
|
||||
true
|
||||
);
|
||||
}
|
||||
Helper::devLog('Could not connect to Apache Solr server', DEVLOG_SEVERITY_ERROR);
|
||||
|
@ -229,35 +229,35 @@ class Indexer
|
|||
$updateQuery->addCommit();
|
||||
self::$solr->service->update($updateQuery);
|
||||
} catch (\Exception $e) {
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == FALSE) {
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == false) {
|
||||
Helper::addMessage(
|
||||
Helper::getMessage('flash.solrException', TRUE) . '<br />' . htmlspecialchars($e->getMessage()),
|
||||
Helper::getMessage('flash.error', TRUE),
|
||||
Helper::getMessage('flash.solrException', true) . '<br />' . htmlspecialchars($e->getMessage()),
|
||||
Helper::getMessage('flash.error', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
|
||||
TRUE
|
||||
true
|
||||
);
|
||||
}
|
||||
Helper::devLog('Apache Solr threw exception: "' . $e->getMessage() . '"', DEVLOG_SEVERITY_ERROR);
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == FALSE) {
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == false) {
|
||||
Helper::addMessage(
|
||||
Helper::getMessage('flash.solrNoConnection', TRUE),
|
||||
Helper::getMessage('flash.error', TRUE),
|
||||
Helper::getMessage('flash.solrNoConnection', true),
|
||||
Helper::getMessage('flash.error', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
|
||||
TRUE
|
||||
true
|
||||
);
|
||||
}
|
||||
Helper::devLog('Could not connect to Apache Solr server', DEVLOG_SEVERITY_ERROR);
|
||||
return 1;
|
||||
}
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == FALSE) {
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == false) {
|
||||
Helper::addMessage(
|
||||
htmlspecialchars(sprintf(Helper::getMessage('flash.documentDeleted'), $title, $uid)),
|
||||
Helper::getMessage('flash.done', TRUE),
|
||||
Helper::getMessage('flash.done', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::OK,
|
||||
TRUE
|
||||
true
|
||||
);
|
||||
}
|
||||
return 0;
|
||||
|
@ -358,10 +358,10 @@ class Indexer
|
|||
if ($indexing['index_boost'] > 0.0) {
|
||||
self::$fields['fieldboost'][$indexing['index_name']] = floatval($indexing['index_boost']);
|
||||
} else {
|
||||
self::$fields['fieldboost'][$indexing['index_name']] = FALSE;
|
||||
self::$fields['fieldboost'][$indexing['index_name']] = false;
|
||||
}
|
||||
}
|
||||
self::$fieldsLoaded = TRUE;
|
||||
self::$fieldsLoaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -407,7 +407,7 @@ class Indexer
|
|||
$solrDoc->setField('root', $doc->rootId);
|
||||
$solrDoc->setField('sid', $logicalUnit['id']);
|
||||
// There can be only one toplevel unit per UID, independently of backend configuration
|
||||
$solrDoc->setField('toplevel', $logicalUnit['id'] == $doc->toplevelId ? TRUE : FALSE);
|
||||
$solrDoc->setField('toplevel', $logicalUnit['id'] == $doc->toplevelId ? true : false);
|
||||
$solrDoc->setField('type', $logicalUnit['type'], self::$fields['fieldboost']['type']);
|
||||
$solrDoc->setField('title', $metadata['title'][0], self::$fields['fieldboost']['title']);
|
||||
$solrDoc->setField('volume', $metadata['volume'][0], self::$fields['fieldboost']['volume']);
|
||||
|
@ -459,12 +459,12 @@ class Indexer
|
|||
$updateQuery->addDocument($solrDoc);
|
||||
self::$solr->service->update($updateQuery);
|
||||
} catch (\Exception $e) {
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == FALSE) {
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == false) {
|
||||
Helper::addMessage(
|
||||
Helper::getMessage('flash.solrException', TRUE) . '<br />' . htmlspecialchars($e->getMessage()),
|
||||
Helper::getMessage('flash.error', TRUE),
|
||||
Helper::getMessage('flash.solrException', true) . '<br />' . htmlspecialchars($e->getMessage()),
|
||||
Helper::getMessage('flash.error', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
|
||||
TRUE
|
||||
true
|
||||
);
|
||||
}
|
||||
return 1;
|
||||
|
@ -513,18 +513,18 @@ class Indexer
|
|||
@ini_set('user_agent', $extConf['useragent']);
|
||||
}
|
||||
$fileResource = GeneralUtility::getUrl($file);
|
||||
if ($fileResource !== FALSE) {
|
||||
if ($fileResource !== false) {
|
||||
// Turn off libxml's error logging.
|
||||
$libxmlErrors = libxml_use_internal_errors(TRUE);
|
||||
$libxmlErrors = libxml_use_internal_errors(true);
|
||||
// disable entity loading
|
||||
$previousValueOfEntityLoader = libxml_disable_entity_loader(TRUE);
|
||||
$previousValueOfEntityLoader = libxml_disable_entity_loader(true);
|
||||
// Load XML from file.
|
||||
$xml = simplexml_load_string($fileResource);
|
||||
// reset entity loader setting
|
||||
libxml_disable_entity_loader($previousValueOfEntityLoader);
|
||||
// Reset libxml's error logging.
|
||||
libxml_use_internal_errors($libxmlErrors);
|
||||
if ($xml === FALSE) {
|
||||
if ($xml === false) {
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
|
@ -540,7 +540,7 @@ class Indexer
|
|||
@ini_set('user_agent', $extConf['useragent']);
|
||||
}
|
||||
$fileResource = GeneralUtility::getUrl($annotationContainerId);
|
||||
if ($fileResource !== FALSE) {
|
||||
if ($fileResource !== false) {
|
||||
$annotationContainer = IiifHelper::loadIiifResource($fileResource);
|
||||
if (!($annotationContainer instanceof AnnotationContainerInterface)) {
|
||||
return 1;
|
||||
|
@ -564,7 +564,7 @@ class Indexer
|
|||
$solrDoc->setField('partof', $doc->parentId);
|
||||
$solrDoc->setField('root', $doc->rootId);
|
||||
$solrDoc->setField('sid', $physicalUnit['id']);
|
||||
$solrDoc->setField('toplevel', FALSE);
|
||||
$solrDoc->setField('toplevel', false);
|
||||
$solrDoc->setField('type', $physicalUnit['type'], self::$fields['fieldboost']['type']);
|
||||
$solrDoc->setField('collection', $doc->metadataArray[$doc->toplevelId]['collection']);
|
||||
$solrDoc->setField('fulltext', htmlspecialchars($doc->getRawText($physicalUnit['id'])));
|
||||
|
@ -591,13 +591,13 @@ class Indexer
|
|||
$updateQuery->addDocument($solrDoc);
|
||||
self::$solr->service->update($updateQuery);
|
||||
} catch (\Exception $e) {
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == FALSE) {
|
||||
if ((\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI) == false) {
|
||||
Helper::addMessage(
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
|
||||
Helper::getMessage('flash.solrException', TRUE) . '<br />' . htmlspecialchars($e->getMessage()),
|
||||
Helper::getMessage('flash.error', TRUE),
|
||||
Helper::getMessage('flash.solrException', true) . '<br />' . htmlspecialchars($e->getMessage()),
|
||||
Helper::getMessage('flash.error', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
|
||||
TRUE
|
||||
true
|
||||
);
|
||||
}
|
||||
return 1;
|
||||
|
@ -614,7 +614,7 @@ class Indexer
|
|||
* @param int $core: UID of the Solr core
|
||||
* @param int $pid: UID of the configuration page
|
||||
*
|
||||
* @return bool TRUE on success or FALSE on failure
|
||||
* @return bool true on success or false on failure
|
||||
*/
|
||||
protected static function solrConnect($core, $pid = 0)
|
||||
{
|
||||
|
@ -627,10 +627,10 @@ class Indexer
|
|||
self::loadIndexConf($pid);
|
||||
}
|
||||
} else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -73,7 +73,7 @@ final class MetsDocument extends Document
|
|||
* @var bool
|
||||
* @access protected
|
||||
*/
|
||||
protected $dmdSecLoaded = FALSE;
|
||||
protected $dmdSecLoaded = false;
|
||||
|
||||
/**
|
||||
* The extension key
|
||||
|
@ -99,7 +99,7 @@ final class MetsDocument extends Document
|
|||
* @var bool
|
||||
* @access protected
|
||||
*/
|
||||
protected $fileGrpsLoaded = FALSE;
|
||||
protected $fileGrpsLoaded = false;
|
||||
|
||||
/**
|
||||
* This holds the XML file's METS part as \SimpleXMLElement object
|
||||
|
@ -173,11 +173,11 @@ final class MetsDocument extends Document
|
|||
IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']);
|
||||
IiifHelper::setMaxThumbnailWidth($conf['iiifThumbnailWidth']);
|
||||
$service = IiifHelper::loadIiifResource($fileLocation);
|
||||
if ($service != NULL && $service instanceof AbstractImageService) {
|
||||
if ($service != null && $service instanceof AbstractImageService) {
|
||||
return $service->getImageUrl();
|
||||
}
|
||||
} elseif ($fileMimeType == 'application/vnd.netfpx') {
|
||||
$baseURL = $fileLocation . (strpos($fileLocation, "?") === FALSE ? "?" : "");
|
||||
$baseURL = $fileLocation . (strpos($fileLocation, "?") === false ? "?" : "");
|
||||
// TODO CVT is an optional IIP server capability; in theory, capabilities should be determined in the object request with '&obj=IIP-server'
|
||||
return $baseURL . "&CVT=jpeg";
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ final class MetsDocument extends Document
|
|||
* {@inheritDoc}
|
||||
* @see \Kitodo\Dlf\Common\Document::getLogicalStructure()
|
||||
*/
|
||||
public function getLogicalStructure($id, $recursive = FALSE)
|
||||
public function getLogicalStructure($id, $recursive = false)
|
||||
{
|
||||
$details = [];
|
||||
// Is the requested logical unit already loaded?
|
||||
|
@ -265,7 +265,7 @@ final class MetsDocument extends Document
|
|||
*
|
||||
* @return array Array of the element's id, label, type and physical page indexes/mptr link
|
||||
*/
|
||||
protected function getLogicalStructureInfo(\SimpleXMLElement $structure, $recursive = FALSE)
|
||||
protected function getLogicalStructureInfo(\SimpleXMLElement $structure, $recursive = false)
|
||||
{
|
||||
// Get attributes.
|
||||
foreach ($structure->attributes() as $attribute => $value) {
|
||||
|
@ -310,7 +310,7 @@ final class MetsDocument extends Document
|
|||
&& array_key_exists($details['id'], $this->smLinks['l2p'])
|
||||
) {
|
||||
// Link logical structure to the first corresponding physical page/track.
|
||||
$details['points'] = max(intval(array_search($this->smLinks['l2p'][$details['id']][0], $this->physicalStructure, TRUE)), 1);
|
||||
$details['points'] = max(intval(array_search($this->smLinks['l2p'][$details['id']][0], $this->physicalStructure, true)), 1);
|
||||
if (!empty($this->physicalStructureInfo[$this->smLinks['l2p'][$details['id']][0]]['files'][$extConf['fileGrpThumbs']])) {
|
||||
$details['thumbnailId'] = $this->physicalStructureInfo[$this->smLinks['l2p'][$details['id']][0]]['files'][$extConf['fileGrpThumbs']];
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ final class MetsDocument extends Document
|
|||
$details['children'] = [];
|
||||
foreach ($structure->children('http://www.loc.gov/METS/')->div as $child) {
|
||||
// Repeat for all children.
|
||||
$details['children'][] = $this->getLogicalStructureInfo($child, TRUE);
|
||||
$details['children'][] = $this->getLogicalStructureInfo($child, true);
|
||||
}
|
||||
}
|
||||
return $details;
|
||||
|
@ -416,7 +416,7 @@ final class MetsDocument extends Document
|
|||
if (!empty($dmdIds)) {
|
||||
// Handle multiple DMDIDs separately.
|
||||
$dmdIds = explode(' ', $dmdIds);
|
||||
$hasSupportedMetadata = FALSE;
|
||||
$hasSupportedMetadata = false;
|
||||
} else {
|
||||
// There is no dmdSec for this structure node.
|
||||
return [];
|
||||
|
@ -460,7 +460,7 @@ final class MetsDocument extends Document
|
|||
'tx_dlf_metadata.pid=' . $cPid
|
||||
. ' AND tx_dlf_metadataformat.pid=' . $cPid
|
||||
. ' AND ((tx_dlf_metadata.uid=tx_dlf_metadataformat.parent_id AND tx_dlf_metadataformat.encoded=tx_dlf_formats.uid AND tx_dlf_formats.type=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->dmdSec[$dmdId]['type'], 'tx_dlf_formats') . ') OR tx_dlf_metadata.format=0)'
|
||||
. Helper::whereClause('tx_dlf_metadata', TRUE)
|
||||
. Helper::whereClause('tx_dlf_metadata', true)
|
||||
. Helper::whereClause('tx_dlf_metadataformat')
|
||||
. Helper::whereClause('tx_dlf_formats')
|
||||
);
|
||||
|
@ -549,7 +549,7 @@ final class MetsDocument extends Document
|
|||
}
|
||||
}
|
||||
// Extract metadata only from first supported dmdSec.
|
||||
$hasSupportedMetadata = TRUE;
|
||||
$hasSupportedMetadata = true;
|
||||
break;
|
||||
}
|
||||
if ($hasSupportedMetadata) {
|
||||
|
@ -618,11 +618,11 @@ final class MetsDocument extends Document
|
|||
protected function loadLocation($location)
|
||||
{
|
||||
$fileResource = GeneralUtility::getUrl($location);
|
||||
if ($fileResource !== FALSE) {
|
||||
if ($fileResource !== false) {
|
||||
// Turn off libxml's error logging.
|
||||
$libxmlErrors = libxml_use_internal_errors(TRUE);
|
||||
$libxmlErrors = libxml_use_internal_errors(true);
|
||||
// Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept
|
||||
$previousValueOfEntityLoader = libxml_disable_entity_loader(TRUE);
|
||||
$previousValueOfEntityLoader = libxml_disable_entity_loader(true);
|
||||
// Load XML from file.
|
||||
$xml = simplexml_load_string($fileResource);
|
||||
// reset entity loader setting
|
||||
|
@ -630,13 +630,13 @@ final class MetsDocument extends Document
|
|||
// Reset libxml's error logging.
|
||||
libxml_use_internal_errors($libxmlErrors);
|
||||
// Set some basic properties.
|
||||
if ($xml !== FALSE) {
|
||||
if ($xml !== false) {
|
||||
$this->xml = $xml;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Helper::devLog('Could not load XML file from "' . $location . '"', DEVLOG_SEVERITY_ERROR);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -684,9 +684,9 @@ final class MetsDocument extends Document
|
|||
|
||||
if ($preloadedDocument instanceof \SimpleXMLElement) {
|
||||
$this->xml = $preloadedDocument;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -744,7 +744,7 @@ final class MetsDocument extends Document
|
|||
}
|
||||
}
|
||||
}
|
||||
$this->dmdSecLoaded = TRUE;
|
||||
$this->dmdSecLoaded = true;
|
||||
}
|
||||
return $this->dmdSec;
|
||||
}
|
||||
|
@ -791,9 +791,9 @@ final class MetsDocument extends Document
|
|||
!empty($extConf['fileGrpFulltext'])
|
||||
&& in_array($extConf['fileGrpFulltext'], $this->fileGrps)
|
||||
) {
|
||||
$this->hasFulltext = TRUE;
|
||||
$this->hasFulltext = true;
|
||||
}
|
||||
$this->fileGrpsLoaded = TRUE;
|
||||
$this->fileGrpsLoaded = true;
|
||||
}
|
||||
return $this->fileGrps;
|
||||
}
|
||||
|
@ -882,7 +882,7 @@ final class MetsDocument extends Document
|
|||
$this->physicalStructure = array_merge($physSeq, $elements);
|
||||
}
|
||||
}
|
||||
$this->physicalStructureLoaded = TRUE;
|
||||
$this->physicalStructureLoaded = true;
|
||||
}
|
||||
return $this->physicalStructure;
|
||||
}
|
||||
|
@ -901,7 +901,7 @@ final class MetsDocument extends Document
|
|||
$this->smLinks['p2l'][(string) $smLink->attributes('http://www.w3.org/1999/xlink')->to][] = (string) $smLink->attributes('http://www.w3.org/1999/xlink')->from;
|
||||
}
|
||||
}
|
||||
$this->smLinksLoaded = TRUE;
|
||||
$this->smLinksLoaded = true;
|
||||
}
|
||||
return $this->smLinks;
|
||||
}
|
||||
|
@ -910,7 +910,7 @@ final class MetsDocument extends Document
|
|||
* {@inheritDoc}
|
||||
* @see \Kitodo\Dlf\Common\Document::_getThumbnail()
|
||||
*/
|
||||
protected function _getThumbnail($forceReload = FALSE)
|
||||
protected function _getThumbnail($forceReload = false)
|
||||
{
|
||||
if (
|
||||
!$this->thumbnailLoaded
|
||||
|
@ -920,14 +920,14 @@ final class MetsDocument extends Document
|
|||
$cPid = ($this->cPid ? $this->cPid : $this->pid);
|
||||
if (!$cPid) {
|
||||
Helper::devLog('Invalid PID ' . $cPid . ' for structure definitions', DEVLOG_SEVERITY_ERROR);
|
||||
$this->thumbnailLoaded = TRUE;
|
||||
$this->thumbnailLoaded = true;
|
||||
return $this->thumbnail;
|
||||
}
|
||||
// Load extension configuration.
|
||||
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]);
|
||||
if (empty($extConf['fileGrpThumbs'])) {
|
||||
Helper::devLog('No fileGrp for thumbnails specified', DEVLOG_SEVERITY_WARNING);
|
||||
$this->thumbnailLoaded = TRUE;
|
||||
$this->thumbnailLoaded = true;
|
||||
return $this->thumbnail;
|
||||
}
|
||||
$strctId = $this->_getToplevelId();
|
||||
|
@ -975,7 +975,7 @@ final class MetsDocument extends Document
|
|||
} else {
|
||||
Helper::devLog('No structure of type "' . $metadata['type'][0] . '" found in database', DEVLOG_SEVERITY_ERROR);
|
||||
}
|
||||
$this->thumbnailLoaded = TRUE;
|
||||
$this->thumbnailLoaded = true;
|
||||
}
|
||||
return $this->thumbnail;
|
||||
}
|
||||
|
@ -1034,8 +1034,8 @@ final class MetsDocument extends Document
|
|||
public function __toString()
|
||||
{
|
||||
$xml = new \DOMDocument('1.0', 'utf-8');
|
||||
$xml->appendChild($xml->importNode(dom_import_simplexml($this->mets), TRUE));
|
||||
$xml->formatOutput = TRUE;
|
||||
$xml->appendChild($xml->importNode(dom_import_simplexml($this->mets), true));
|
||||
$xml->formatOutput = true;
|
||||
return $xml->saveXML();
|
||||
}
|
||||
|
||||
|
@ -1050,12 +1050,12 @@ final class MetsDocument extends Document
|
|||
public function __wakeup()
|
||||
{
|
||||
// Turn off libxml's error logging.
|
||||
$libxmlErrors = libxml_use_internal_errors(TRUE);
|
||||
$libxmlErrors = libxml_use_internal_errors(true);
|
||||
// Reload XML from string.
|
||||
$xml = @simplexml_load_string($this->asXML);
|
||||
// Reset libxml's error logging.
|
||||
libxml_use_internal_errors($libxmlErrors);
|
||||
if ($xml !== FALSE) {
|
||||
if ($xml !== false) {
|
||||
$this->asXML = '';
|
||||
$this->xml = $xml;
|
||||
// Rebuild the unserializable properties.
|
||||
|
|
|
@ -87,7 +87,7 @@ class Solr
|
|||
* @var bool
|
||||
* @access protected
|
||||
*/
|
||||
protected $ready = FALSE;
|
||||
protected $ready = false;
|
||||
|
||||
/**
|
||||
* This holds the singleton search objects with their core as array key
|
||||
|
@ -290,7 +290,7 @@ class Solr
|
|||
{
|
||||
$start = max(intval($start), 0);
|
||||
// Check if core already exists.
|
||||
if (self::getInstance('dlfCore' . $start) === NULL) {
|
||||
if (self::getInstance('dlfCore' . $start) === null) {
|
||||
return $start;
|
||||
} else {
|
||||
return self::solrGetCoreNumber($start + 1);
|
||||
|
@ -362,7 +362,7 @@ class Solr
|
|||
'core' => $this->core,
|
||||
'pid' => $this->cPid,
|
||||
'order' => 'score',
|
||||
'order.asc' => TRUE,
|
||||
'order.asc' => true,
|
||||
'numberOfHits' => $this->numberOfHits,
|
||||
'numberOfToplevelHits' => $numberOfToplevelHits
|
||||
]
|
||||
|
@ -393,7 +393,7 @@ class Solr
|
|||
$cache = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->getCache('tx_dlf_solr');
|
||||
|
||||
$resultSet = [];
|
||||
if (($entry = $cache->get($cacheIdentifier)) === FALSE) {
|
||||
if (($entry = $cache->get($cacheIdentifier)) === false) {
|
||||
$selectQuery = $this->service->createSelect(array_merge($this->params, $parameters));
|
||||
$result = $this->service->select($selectQuery);
|
||||
foreach ($result as $doc) {
|
||||
|
@ -528,7 +528,7 @@ class Solr
|
|||
*
|
||||
* @param string $var: Name of variable to check
|
||||
*
|
||||
* @return bool TRUE if variable is set and not empty, FALSE otherwise
|
||||
* @return bool true if variable is set and not empty, false otherwise
|
||||
*/
|
||||
public function __isset($var) {
|
||||
return !empty($this->__get($var));
|
||||
|
@ -592,7 +592,7 @@ class Solr
|
|||
// Set core name.
|
||||
$this->core = $core;
|
||||
// Instantiation successful!
|
||||
$this->ready = TRUE;
|
||||
$this->ready = true;
|
||||
} catch (\Exception $e) {
|
||||
// Nothing to do here.
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ class ConfigurationForm
|
|||
]
|
||||
]);
|
||||
// Try to connect to Solr server.
|
||||
$response = @simplexml_load_string(file_get_contents($url, FALSE, $context));
|
||||
$response = @simplexml_load_string(file_get_contents($url, false, $context));
|
||||
// Check status code.
|
||||
if ($response) {
|
||||
$status = $response->xpath('//lst[@name="responseHeader"]/int[@name="status"]');
|
||||
|
@ -101,12 +101,12 @@ class ConfigurationForm
|
|||
public function checkMetadataFormats(&$params, &$pObj)
|
||||
{
|
||||
$nsDefined = [
|
||||
'MODS' => FALSE,
|
||||
'TEIHDR' => FALSE,
|
||||
'ALTO' => FALSE,
|
||||
'IIIF1' => FALSE,
|
||||
'IIIF2' => FALSE,
|
||||
'IIIF3' => FALSE
|
||||
'MODS' => false,
|
||||
'TEIHDR' => false,
|
||||
'ALTO' => false,
|
||||
'IIIF1' => false,
|
||||
'IIIF2' => false,
|
||||
'IIIF3' => false
|
||||
];
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
|
@ -123,7 +123,7 @@ class ConfigurationForm
|
|||
->execute();
|
||||
|
||||
while ($resArray = $result->fetch()) {
|
||||
$nsDefined[$resArray['type']] = TRUE;
|
||||
$nsDefined[$resArray['type']] = true;
|
||||
}
|
||||
// Build data array.
|
||||
$data = [];
|
||||
|
|
|
@ -124,7 +124,7 @@ class DataHandler
|
|||
// Build request for adding new Solr core.
|
||||
// @see http://wiki.apache.org/solr/CoreAdmin
|
||||
$url = $solrInfo['scheme'] . '://' . $host . ':' . $solrInfo['port'] . '/' . $solrInfo['path'] . '/admin/cores?wt=xml&action=CREATE&name=dlfCore' . $coreNumber . '&instanceDir=dlfCore' . $coreNumber . '&dataDir=data&configSet=dlf';
|
||||
$response = @simplexml_load_string(file_get_contents($url, FALSE, $context));
|
||||
$response = @simplexml_load_string(file_get_contents($url, false, $context));
|
||||
// Process response.
|
||||
if ($response) {
|
||||
$solrStatus = $response->xpath('//lst[@name="responseHeader"]/int[@name="status"]');
|
||||
|
|
|
@ -38,7 +38,7 @@ class ExtensionManagementUtility extends \TYPO3\CMS\Core\Utility\ExtensionManage
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function addPItoST43($key, $class, $suffix = '', $type = 'list_type', $cached = FALSE)
|
||||
public static function addPItoST43($key, $class, $suffix = '', $type = 'list_type', $cached = false)
|
||||
{
|
||||
$internalName = 'tx_' . $key . '_' . strtolower(Helper::getUnqualifiedClassName($class));
|
||||
// General plugin
|
||||
|
|
|
@ -120,7 +120,7 @@ class FormEngine
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function itemsProcFunc_generateList(&$params, $fields, $table, $sorting, $where = '', $localize = TRUE)
|
||||
protected function itemsProcFunc_generateList(&$params, $fields, $table, $sorting, $where = '', $localize = true)
|
||||
{
|
||||
$pages = $params['row']['pages'];
|
||||
if (!empty($pages)) {
|
||||
|
@ -186,7 +186,7 @@ class FormEngine
|
|||
'tx_dlf_solrcores',
|
||||
'label',
|
||||
'OR pid=0',
|
||||
FALSE
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -72,20 +72,20 @@ class NewTenant extends \Kitodo\Dlf\Common\AbstractModule
|
|||
];
|
||||
$i++;
|
||||
}
|
||||
$_ids = Helper::processDBasAdmin($data, [], TRUE);
|
||||
$_ids = Helper::processDBasAdmin($data, [], true);
|
||||
// Check for failed inserts.
|
||||
if (count($_ids) == $i) {
|
||||
// Fine.
|
||||
Helper::addMessage(
|
||||
Helper::getMessage('flash.metadataAddedMsg'),
|
||||
Helper::getMessage('flash.metadataAdded', TRUE),
|
||||
Helper::getMessage('flash.metadataAdded', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
|
||||
);
|
||||
} else {
|
||||
// Something went wrong.
|
||||
Helper::addMessage(
|
||||
Helper::getMessage('flash.metadataNotAddedMsg'),
|
||||
Helper::getMessage('flash.metadataNotAdded', TRUE),
|
||||
Helper::getMessage('flash.metadataNotAdded', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
|
||||
);
|
||||
}
|
||||
|
@ -112,14 +112,14 @@ class NewTenant extends \Kitodo\Dlf\Common\AbstractModule
|
|||
// Fine.
|
||||
Helper::addMessage(
|
||||
Helper::getMessage('flash.solrcoreAddedMsg'),
|
||||
Helper::getMessage('flash.solrcoreAdded', TRUE),
|
||||
Helper::getMessage('flash.solrcoreAdded', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
|
||||
);
|
||||
} else {
|
||||
// Something went wrong.
|
||||
Helper::addMessage(
|
||||
Helper::getMessage('flash.solrcoreNotAddedMsg'),
|
||||
Helper::getMessage('flash.solrcoreNotAdded', TRUE),
|
||||
Helper::getMessage('flash.solrcoreNotAdded', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
|
||||
);
|
||||
}
|
||||
|
@ -147,20 +147,20 @@ class NewTenant extends \Kitodo\Dlf\Common\AbstractModule
|
|||
'thumbnail' => 0,
|
||||
];
|
||||
}
|
||||
$_ids = Helper::processDBasAdmin($data, [], TRUE);
|
||||
$_ids = Helper::processDBasAdmin($data, [], true);
|
||||
// Check for failed inserts.
|
||||
if (count($_ids) == count($structureDefaults)) {
|
||||
// Fine.
|
||||
Helper::addMessage(
|
||||
Helper::getMessage('flash.structureAddedMsg'),
|
||||
Helper::getMessage('flash.structureAdded', TRUE),
|
||||
Helper::getMessage('flash.structureAdded', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
|
||||
);
|
||||
} else {
|
||||
// Something went wrong.
|
||||
Helper::addMessage(
|
||||
Helper::getMessage('flash.structureNotAddedMsg'),
|
||||
Helper::getMessage('flash.structureNotAdded', TRUE),
|
||||
Helper::getMessage('flash.structureNotAdded', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
|
||||
);
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ class NewTenant extends \Kitodo\Dlf\Common\AbstractModule
|
|||
if ($this->pageInfo['doktype'] != 254) {
|
||||
Helper::addMessage(
|
||||
Helper::getMessage('flash.wrongPageTypeMsg'),
|
||||
Helper::getMessage('flash.wrongPageType', TRUE),
|
||||
Helper::getMessage('flash.wrongPageType', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
|
||||
);
|
||||
$this->markerArray['CONTENT'] .= Helper::renderFlashMessages();
|
||||
|
@ -229,7 +229,7 @@ class NewTenant extends \Kitodo\Dlf\Common\AbstractModule
|
|||
// Fine.
|
||||
Helper::addMessage(
|
||||
Helper::getMessage('flash.structureOkayMsg'),
|
||||
Helper::getMessage('flash.structureOkay', TRUE),
|
||||
Helper::getMessage('flash.structureOkay', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
|
||||
);
|
||||
} else {
|
||||
|
@ -237,7 +237,7 @@ class NewTenant extends \Kitodo\Dlf\Common\AbstractModule
|
|||
$_url = GeneralUtility::locationHeaderUrl(GeneralUtility::linkThisScript(['id' => $this->id, 'CMD' => 'addStructure']));
|
||||
Helper::addMessage(
|
||||
sprintf(Helper::getMessage('flash.structureNotOkayMsg'), $_url),
|
||||
Helper::getMessage('flash.structureNotOkay', TRUE),
|
||||
Helper::getMessage('flash.structureNotOkay', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
|
||||
);
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ class NewTenant extends \Kitodo\Dlf\Common\AbstractModule
|
|||
// Fine.
|
||||
Helper::addMessage(
|
||||
Helper::getMessage('flash.metadataOkayMsg'),
|
||||
Helper::getMessage('flash.metadataOkay', TRUE),
|
||||
Helper::getMessage('flash.metadataOkay', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
|
||||
);
|
||||
} else {
|
||||
|
@ -263,7 +263,7 @@ class NewTenant extends \Kitodo\Dlf\Common\AbstractModule
|
|||
$_url = GeneralUtility::locationHeaderUrl(GeneralUtility::linkThisScript(['id' => $this->id, 'CMD' => 'addMetadata']));
|
||||
Helper::addMessage(
|
||||
sprintf(Helper::getMessage('flash.metadataNotOkayMsg'), $_url),
|
||||
Helper::getMessage('flash.metadataNotOkay', TRUE),
|
||||
Helper::getMessage('flash.metadataNotOkay', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
|
||||
);
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ class NewTenant extends \Kitodo\Dlf\Common\AbstractModule
|
|||
// Fine.
|
||||
Helper::addMessage(
|
||||
Helper::getMessage('flash.solrcoreOkayMsg'),
|
||||
Helper::getMessage('flash.solrcoreOkay', TRUE),
|
||||
Helper::getMessage('flash.solrcoreOkay', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
|
||||
);
|
||||
} else {
|
||||
|
@ -296,7 +296,7 @@ class NewTenant extends \Kitodo\Dlf\Common\AbstractModule
|
|||
$_url = GeneralUtility::locationHeaderUrl(GeneralUtility::linkThisScript(['id' => $this->id, 'CMD' => 'addSolrcore']));
|
||||
Helper::addMessage(
|
||||
sprintf(Helper::getMessage('flash.solrcoreDeprecatedMsg'), $_url),
|
||||
Helper::getMessage('flash.solrcoreDeprecatedOkay', TRUE),
|
||||
Helper::getMessage('flash.solrcoreDeprecatedOkay', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::NOTICE
|
||||
);
|
||||
}
|
||||
|
@ -305,7 +305,7 @@ class NewTenant extends \Kitodo\Dlf\Common\AbstractModule
|
|||
$_url = GeneralUtility::locationHeaderUrl(GeneralUtility::linkThisScript(['id' => $this->id, 'CMD' => 'addSolrcore']));
|
||||
Helper::addMessage(
|
||||
sprintf(Helper::getMessage('flash.solrcoreMissingMsg'), $_url),
|
||||
Helper::getMessage('flash.solrcoreMissing', TRUE),
|
||||
Helper::getMessage('flash.solrcoreMissing', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::WARNING
|
||||
);
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ class AudioPlayer extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
// Load current document.
|
||||
$this->loadDocument();
|
||||
if (
|
||||
$this->doc === NULL
|
||||
$this->doc === null
|
||||
|| $this->doc->numPages < 1
|
||||
) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
|
|
|
@ -44,7 +44,7 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
{
|
||||
$this->init($conf);
|
||||
// Don't cache the output.
|
||||
$this->setCache(FALSE);
|
||||
$this->setCache(false);
|
||||
// Load template file.
|
||||
$this->getTemplate();
|
||||
$subpartArray['entry'] = $this->templateService->getSubpart($this->template, '###ENTRY###');
|
||||
|
@ -64,7 +64,7 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
);
|
||||
} else {
|
||||
$GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_dlf_basket', '');
|
||||
$GLOBALS['TSFE']->fe_user->sesData_change = TRUE;
|
||||
$GLOBALS['TSFE']->fe_user->sesData_change = true;
|
||||
$GLOBALS['TSFE']->fe_user->storeSessionData();
|
||||
$query = $GLOBALS['TYPO3_DB']->SELECTquery(
|
||||
'*',
|
||||
|
@ -132,7 +132,7 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
}
|
||||
// set marker
|
||||
$markerArray['###ACTION###'] = $this->pi_getPageLink($GLOBALS['TSFE']->id);
|
||||
$markerArray['###LISTTITLE###'] = $this->pi_getLL('basket', '', TRUE);
|
||||
$markerArray['###LISTTITLE###'] = $this->pi_getLL('basket', '', true);
|
||||
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->countRow() > 0) {
|
||||
$mailForm = '<select name="tx_dlf[mail_action]">';
|
||||
$mailForm .= '<option value="">' . $this->pi_getLL('chooseMail', '', TRUE) . '</option>';
|
||||
$mailForm .= '<option value="">' . $this->pi_getLL('chooseMail', '', true) . '</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="">' . $this->pi_getLL('chooseAction', '', true) . '</option>
|
||||
<option value="open">' . $this->pi_getLL('download', '', true) . '</option>
|
||||
<option value="remove">' . $this->pi_getLL('remove', '', true) . '</option>
|
||||
</select>
|
||||
<input type="submit">
|
||||
';
|
||||
|
@ -192,7 +192,7 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$printForm = '';
|
||||
if ($resultPrinter->countRow() > 0) {
|
||||
$printForm = '<select name="tx_dlf[print_action]">';
|
||||
$printForm .= '<option value="">' . $this->pi_getLL('choosePrinter', '', TRUE) . '</option>';
|
||||
$printForm .= '<option value="">' . $this->pi_getLL('choosePrinter', '', true) . '</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 = $this->pi_getLL('goBasket', '', true);
|
||||
$basketConf = [
|
||||
'parameter' => $this->conf['targetBasket'],
|
||||
'title' => $label
|
||||
|
@ -220,7 +220,7 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
} else {
|
||||
$markerArray['###BASKET###'] = '';
|
||||
}
|
||||
$content = $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($this->template, '###ENTRY###', $entries, TRUE), $markerArray);
|
||||
$content = $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($this->template, '###ENTRY###', $entries, true), $markerArray);
|
||||
return $this->pi_wrapInBaseClass($content);
|
||||
}
|
||||
|
||||
|
@ -270,7 +270,7 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
// return one entry
|
||||
$markerArray['###CONTROLS###'] = $controlMark;
|
||||
$markerArray['###NUMBER###'] = $docData['record_id'];
|
||||
return $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($template['entry'], '###ENTRY###', '', TRUE), $markerArray);
|
||||
return $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($template['entry'], '###ENTRY###', '', true), $markerArray);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -291,7 +291,7 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
} else {
|
||||
$page = intval($_piVars['startpage']);
|
||||
}
|
||||
if ($page != NULL || $_piVars['addToBasket'] == 'list') {
|
||||
if ($page != null || $_piVars['addToBasket'] == 'list') {
|
||||
$documentItem = [
|
||||
'id' => intval($_piVars['id']),
|
||||
'startpage' => intval($_piVars['startpage']),
|
||||
|
@ -437,7 +437,7 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
*
|
||||
* @param int $id: Document id
|
||||
*
|
||||
* @return mixed download url or FALSE
|
||||
* @return mixed download url or false
|
||||
*/
|
||||
protected function getDocumentData($id, $data)
|
||||
{
|
||||
|
@ -460,21 +460,21 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$urlParams = str_replace("##endy##", $data['endY'] === "" ? "" : intval($data['endY']), $urlParams);
|
||||
$urlParams = str_replace("##rotation##", $data['rotation'] === "" ? "" : intval($data['rotation']), $urlParams);
|
||||
$downloadUrl = $this->conf['pdfgenerate'] . $urlParams;
|
||||
$title = $document->getTitle($id, TRUE);
|
||||
$title = $document->getTitle($id, true);
|
||||
if (empty($title)) {
|
||||
$title = $this->pi_getLL('noTitle', '', TRUE);
|
||||
$title = $this->pi_getLL('noTitle', '', true);
|
||||
}
|
||||
// Set page and cutout information
|
||||
$info = '';
|
||||
if ($data['startX'] != '' && $data['endX'] != '') {
|
||||
// cutout
|
||||
$info .= $this->pi_getLL('cutout', '', TRUE) . ' ';
|
||||
$info .= $this->pi_getLL('cutout', '', true) . ' ';
|
||||
}
|
||||
if ($data['startpage'] == $data['endpage']) {
|
||||
// One page
|
||||
$info .= $this->pi_getLL('page', '', TRUE) . ' ' . $data['startpage'];
|
||||
$info .= $this->pi_getLL('page', '', true) . ' ' . $data['startpage'];
|
||||
} else {
|
||||
$info .= $this->pi_getLL('page', '', TRUE) . ' ' . $data['startpage'] . '-' . $data['endpage'];
|
||||
$info .= $this->pi_getLL('page', '', true) . ' ' . $data['startpage'] . '-' . $data['endpage'];
|
||||
}
|
||||
$downloadLink = '<a href="' . $downloadUrl . '" target="_blank">' . $title . '</a> (' . $info . ')';
|
||||
if ($data['startpage'] == $data['endpage']) {
|
||||
|
@ -490,7 +490,7 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
'record_id' => $document->recordId,
|
||||
];
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -521,7 +521,7 @@ class Basket extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
|
||||
$allResults = $resultMail->fetchAll();
|
||||
$mailData = $allResults[0];
|
||||
$mailText = $this->pi_getLL('mailBody', '', TRUE) . "\n";
|
||||
$mailText = $this->pi_getLL('mailBody', '', true) . "\n";
|
||||
$numberOfPages = 0;
|
||||
$pdfUrl = $this->conf['pdfdownload'];
|
||||
// prepare links
|
||||
|
@ -555,7 +555,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', '', true))
|
||||
// Set the From address with an associative array
|
||||
->setFrom($from)
|
||||
// Set the To addresses with an associative array
|
||||
|
|
|
@ -60,7 +60,7 @@ class Calendar extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$this->init($conf);
|
||||
// Load current document.
|
||||
$this->loadDocument();
|
||||
if ($this->doc === NULL) {
|
||||
if ($this->doc === null) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return $content;
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ class Calendar extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
'parameter' => $this->conf['targetPid'],
|
||||
'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($this->pi_getLL('allYears', '', true) . ' ' . $this->doc->getTitle($this->doc->parentId), $linkConf);
|
||||
// Link to current year.
|
||||
$linkConf = [
|
||||
'useCacheHash' => 1,
|
||||
|
@ -235,9 +235,9 @@ class Calendar extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
}
|
||||
$this->template = $this->templateService->substituteSubpart($this->template, '###SINGLEDAY###', $subPartContentList);
|
||||
if (count($allIssues) < 6) {
|
||||
$listViewActive = TRUE;
|
||||
$listViewActive = true;
|
||||
} else {
|
||||
$listViewActive = FALSE;
|
||||
$listViewActive = false;
|
||||
}
|
||||
$markerArray = [
|
||||
'###CALENDARVIEWACTIVE###' => $listViewActive ? '' : 'active',
|
||||
|
@ -266,7 +266,7 @@ class Calendar extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$this->init($conf);
|
||||
// Load current document.
|
||||
$this->loadDocument();
|
||||
if ($this->doc === NULL) {
|
||||
if ($this->doc === null) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return $content;
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ class Calendar extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
'parameter' => $this->conf['targetPid'],
|
||||
'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($this->pi_getLL('allYears', '', true) . ' ' . $this->doc->getTitle($this->doc->uid), $linkConf);
|
||||
// Fill markers.
|
||||
$markerArray = [
|
||||
'###LABEL_CHOOSE_YEAR###' => $this->pi_getLL('label.please_choose_year'),
|
||||
|
|
|
@ -53,7 +53,7 @@ class Collection extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
{
|
||||
$this->init($conf);
|
||||
// Turn cache on.
|
||||
$this->setCache(TRUE);
|
||||
$this->setCache(true);
|
||||
// Quit without doing anything if required configuration variables are not set.
|
||||
if (empty($this->conf['pages'])) {
|
||||
Helper::devLog('Incomplete plugin configuration', DEVLOG_SEVERITY_WARNING);
|
||||
|
@ -202,14 +202,14 @@ class Collection extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$conf = [
|
||||
'useCacheHash' => 1,
|
||||
'parameter' => $GLOBALS['TSFE']->id,
|
||||
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE)
|
||||
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', true, false)
|
||||
];
|
||||
// Link collection's title to list view.
|
||||
$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\ExtensionManagementUtility::siteRelPath($this->extKey) . 'Resources/Public/Icons/txdlffeeds.png" alt="' . $this->pi_getLL('feedAlt', '', TRUE) . '" title="' . $this->pi_getLL('feedTitle', '', TRUE) . '" />';
|
||||
$markerArray[$_key]['###FEED###'] = $this->pi_linkTP($img, [$this->prefixId => ['collection' => $collection['uid']]], FALSE, $this->conf['targetFeed']);
|
||||
$img = '<img src="' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'Resources/Public/Icons/txdlffeeds.png" alt="' . $this->pi_getLL('feedAlt', '', true) . '" title="' . $this->pi_getLL('feedTitle', '', true) . '" />';
|
||||
$markerArray[$_key]['###FEED###'] = $this->pi_linkTP($img, [$this->prefixId => ['collection' => $collection['uid']]], false, $this->conf['targetFeed']);
|
||||
} else {
|
||||
$markerArray[$_key]['###FEED###'] = '';
|
||||
}
|
||||
|
@ -222,16 +222,16 @@ 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'), '', false);
|
||||
$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'), '', false);
|
||||
$markerArray[$_key]['###COUNT_VOLUMES###'] = htmlspecialchars(count($collection['volumes']) . $labelVolumes);
|
||||
}
|
||||
// Randomize sorting?
|
||||
if (!empty($this->conf['randomize'])) {
|
||||
ksort($markerArray, SORT_NUMERIC);
|
||||
// Don't cache the output.
|
||||
$this->setCache(FALSE);
|
||||
$this->setCache(false);
|
||||
}
|
||||
$entry = $this->templateService->getSubpart($this->template, '###ENTRY###');
|
||||
foreach ($markerArray as $marker) {
|
||||
|
@ -243,7 +243,7 @@ class Collection extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$hookObj->showCollectionList_getCustomCollectionList($this, $this->conf['templateFile'], $content, $markerArray);
|
||||
}
|
||||
}
|
||||
return $this->templateService->substituteSubpart($this->template, '###ENTRY###', $content, TRUE);
|
||||
return $this->templateService->substituteSubpart($this->template, '###ENTRY###', $content, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -355,7 +355,7 @@ class Collection extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
'core' => '',
|
||||
'pid' => $this->conf['pages'],
|
||||
'order' => 'title',
|
||||
'order.asc' => TRUE
|
||||
'order.asc' => true
|
||||
]
|
||||
];
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ class PageViewProxy extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
|
|||
// Get last modified date from request header
|
||||
$fetchedHeader = explode("\n", \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($url, 2));
|
||||
foreach ($fetchedHeader as $headerline) {
|
||||
if (stripos($headerline, 'Last-Modified:') !== FALSE) {
|
||||
if (stripos($headerline, 'Last-Modified:') !== false) {
|
||||
header($headerline);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ class Feeds extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
{
|
||||
$this->init($conf);
|
||||
// Don't cache the output.
|
||||
$this->setCache(FALSE);
|
||||
$this->setCache(false);
|
||||
// Create XML document.
|
||||
$rss = new \DOMDocument('1.0', 'utf-8');
|
||||
// Add mandatory root element.
|
||||
|
@ -117,7 +117,7 @@ class Feeds extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
if ((empty($resArray['title']) || !empty($this->conf['prependSuperiorTitle']))
|
||||
&& !empty($resArray['partof'])
|
||||
) {
|
||||
$superiorTitle = Document::getTitle($resArray['partof'], TRUE);
|
||||
$superiorTitle = Document::getTitle($resArray['partof'], true);
|
||||
if (!empty($superiorTitle)) {
|
||||
$title .= '[' . $superiorTitle . ']';
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ class Feeds extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$linkConf = [
|
||||
'parameter' => $this->conf['targetPid'],
|
||||
'forceAbsoluteUrl' => 1,
|
||||
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, ['id' => $resArray['uid']], '', TRUE, FALSE)
|
||||
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, ['id' => $resArray['uid']], '', true, false)
|
||||
];
|
||||
$item->appendChild($rss->createElement('link', htmlspecialchars($this->cObj->typoLink_URL($linkConf), ENT_NOQUOTES, 'UTF-8')));
|
||||
// Add author if applicable.
|
||||
|
|
|
@ -82,35 +82,35 @@ class ListView extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
return '';
|
||||
}
|
||||
// Get separator.
|
||||
$separator = $this->pi_getLL('separator', ' - ', TRUE);
|
||||
$separator = $this->pi_getLL('separator', ' - ', true);
|
||||
// Add link to previous page.
|
||||
if ($this->piVars['pointer'] > 0) {
|
||||
$output = $this->pi_linkTP_keepPIvars($this->pi_getLL('prevPage', '<', TRUE), ['pointer' => $this->piVars['pointer'] - 1], TRUE) . $separator;
|
||||
$output = $this->pi_linkTP_keepPIvars($this->pi_getLL('prevPage', '<', true), ['pointer' => $this->piVars['pointer'] - 1], true) . $separator;
|
||||
} else {
|
||||
$output = $this->pi_getLL('prevPage', '<', TRUE) . $separator;
|
||||
$output = $this->pi_getLL('prevPage', '<', true) . $separator;
|
||||
}
|
||||
$i = 0;
|
||||
$skip = NULL;
|
||||
$skip = null;
|
||||
// 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], TRUE) . $separator;
|
||||
$output .= $this->pi_linkTP_keepPIvars(sprintf($this->pi_getLL('page', '%d', true), $i + 1), ['pointer' => $i], true) . $separator;
|
||||
} else {
|
||||
$output .= sprintf($this->pi_getLL('page', '%d', TRUE), $i + 1) . $separator;
|
||||
$output .= sprintf($this->pi_getLL('page', '%d', true), $i + 1) . $separator;
|
||||
}
|
||||
$skip = TRUE;
|
||||
} elseif ($skip === TRUE) {
|
||||
$output .= $this->pi_getLL('skip', '...', TRUE) . $separator;
|
||||
$skip = FALSE;
|
||||
$skip = true;
|
||||
} elseif ($skip === true) {
|
||||
$output .= $this->pi_getLL('skip', '...', true) . $separator;
|
||||
$skip = false;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
// Add link to next page.
|
||||
if ($this->piVars['pointer'] < $maxPages - 1) {
|
||||
$output .= $this->pi_linkTP_keepPIvars($this->pi_getLL('nextPage', '>', TRUE), ['pointer' => $this->piVars['pointer'] + 1], TRUE);
|
||||
$output .= $this->pi_linkTP_keepPIvars($this->pi_getLL('nextPage', '>', true), ['pointer' => $this->piVars['pointer'] + 1], true);
|
||||
} else {
|
||||
$output .= $this->pi_getLL('nextPage', '>', TRUE);
|
||||
$output .= $this->pi_getLL('nextPage', '>', true);
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ class ListView extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
if ($index_name == 'title') {
|
||||
// Get title of parent document if needed.
|
||||
if (empty($value) && $this->conf['getTitle']) {
|
||||
$superiorTitle = Document::getTitle($this->list[$number]['uid'], TRUE);
|
||||
$superiorTitle = Document::getTitle($this->list[$number]['uid'], true);
|
||||
if (!empty($superiorTitle)) {
|
||||
$value = '[' . $superiorTitle . ']';
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ class ListView extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$conf = [
|
||||
'useCacheHash' => 1,
|
||||
'parameter' => $this->conf['targetPid'],
|
||||
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE)
|
||||
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', true, false)
|
||||
];
|
||||
$value = $this->cObj->typoLink(htmlspecialchars($value), $conf);
|
||||
} elseif ($index_name == 'owner' && !empty($value)) {
|
||||
|
@ -210,12 +210,12 @@ class ListView extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$conf = [
|
||||
'useCacheHash' => 1,
|
||||
'parameter' => $this->conf['targetBasket'],
|
||||
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE)
|
||||
'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($this->pi_getLL('addBasket', '', true), $conf);
|
||||
$markerArray['###BASKETBUTTON###'] = $link;
|
||||
}
|
||||
return $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($template['entry'], '###SUBTEMPLATE###', $subpart, TRUE), $markerArray);
|
||||
return $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($template['entry'], '###SUBTEMPLATE###', $subpart, true), $markerArray);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -257,7 +257,7 @@ class ListView extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
'parameter' => $GLOBALS['TSFE']->id
|
||||
];
|
||||
if (!empty($this->piVars['logicalPage'])) {
|
||||
$linkConf['additionalParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, ['logicalPage' => $this->piVars['logicalPage']], '', TRUE, FALSE);
|
||||
$linkConf['additionalParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, ['logicalPage' => $this->piVars['logicalPage']], '', true, false);
|
||||
}
|
||||
// Build HTML form.
|
||||
$sorting = '<form action="' . $this->cObj->typoLink_URL($linkConf) . '" method="get"><div><input type="hidden" name="id" value="' . $GLOBALS['TSFE']->id . '" />';
|
||||
|
@ -268,10 +268,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 . '">' . $this->pi_getLL('orderBy', '', true) . '</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"' : '') . '>' . $this->pi_getLL('relevance', '', true) . '</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>';
|
||||
|
@ -279,9 +279,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 . '">' . $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 .= '</select></div></form>';
|
||||
return $sorting;
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ class ListView extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
if ($index_name == 'title') {
|
||||
// Get title of parent document if needed.
|
||||
if (empty($value) && $this->conf['getTitle']) {
|
||||
$superiorTitle = Document::getTitle($subpart['uid'], TRUE);
|
||||
$superiorTitle = Document::getTitle($subpart['uid'], true);
|
||||
if (!empty($superiorTitle)) {
|
||||
$value = '[' . $superiorTitle . ']';
|
||||
}
|
||||
|
@ -337,7 +337,7 @@ class ListView extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
// we don't want cHash in case of search parameters
|
||||
'useCacheHash' => empty($this->list->metadata['searchString']) ? 1 : 0,
|
||||
'parameter' => $this->conf['targetPid'],
|
||||
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE)
|
||||
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', true, false)
|
||||
];
|
||||
$value = $this->cObj->typoLink(htmlspecialchars($value), $conf);
|
||||
} elseif ($index_name == 'owner' && !empty($value)) {
|
||||
|
@ -383,14 +383,14 @@ class ListView extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$conf = [
|
||||
'useCacheHash' => 1,
|
||||
'parameter' => $this->conf['targetBasket'],
|
||||
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE)
|
||||
'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($this->pi_getLL('addBasket', '', true), $conf);
|
||||
$markerArray['###SUBBASKETBUTTON###'] = $link;
|
||||
}
|
||||
$content .= $this->templateService->substituteMarkerArray($template['subentry'], $markerArray);
|
||||
}
|
||||
return $this->templateService->substituteSubpart($this->templateService->getSubpart($this->template, '###SUBTEMPLATE###'), '###SUBENTRY###', $content, TRUE);
|
||||
return $this->templateService->substituteSubpart($this->templateService->getSubpart($this->template, '###SUBTEMPLATE###'), '###SUBENTRY###', $content, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -451,7 +451,7 @@ class ListView extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
{
|
||||
$this->init($conf);
|
||||
// Don't cache the output.
|
||||
$this->setCache(FALSE);
|
||||
$this->setCache(false);
|
||||
// Load the list.
|
||||
$this->list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(DocumentList::class);
|
||||
$currentEntry = $this->piVars['pointer'] * $this->conf['limit'];
|
||||
|
@ -544,11 +544,11 @@ 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###'] = $this->pi_getLL('nohits', '', true);
|
||||
}
|
||||
$markerArray['###PAGEBROWSER###'] = $this->getPageBrowser();
|
||||
$markerArray['###SORTING###'] = $this->getSortingForm();
|
||||
$content = $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($this->template, '###ENTRY###', $content, TRUE), $markerArray);
|
||||
$content = $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($this->template, '###ENTRY###', $content, true), $markerArray);
|
||||
return $this->pi_wrapInBaseClass($content);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,10 +55,10 @@ class Metadata extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
{
|
||||
$this->init($conf);
|
||||
// Turn cache on.
|
||||
$this->setCache(TRUE);
|
||||
$this->setCache(true);
|
||||
// Load current document.
|
||||
$this->loadDocument();
|
||||
if ($this->doc === NULL) {
|
||||
if ($this->doc === null) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return $content;
|
||||
} else {
|
||||
|
@ -157,7 +157,7 @@ class Metadata extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
*
|
||||
* @return string The metadata array ready for output
|
||||
*/
|
||||
protected function printMetadata(array $metadataArray, $useOriginalIiifManifestMetadata = FALSE)
|
||||
protected function printMetadata(array $metadataArray, $useOriginalIiifManifestMetadata = false)
|
||||
{
|
||||
// Load template file.
|
||||
$this->getTemplate();
|
||||
|
@ -309,7 +309,7 @@ class Metadata extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
if ($index_name == 'title') {
|
||||
// Get title of parent document if needed.
|
||||
if (empty($value) && $this->conf['getTitle'] && $this->doc->parentId) {
|
||||
$superiorTitle = Document::getTitle($this->doc->parentId, TRUE);
|
||||
$superiorTitle = Document::getTitle($this->doc->parentId, true);
|
||||
if (!empty($superiorTitle)) {
|
||||
$value = '[' . $superiorTitle . ']';
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ class Metadata extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
// Link title to pageview.
|
||||
if ($this->conf['linkTitle'] && $metadata['_id']) {
|
||||
$details = $this->doc->getLogicalStructure($metadata['_id']);
|
||||
$value = $this->pi_linkTP($value, [$this->prefixId => ['id' => $this->doc->uid, 'page' => (!empty($details['points']) ? intval($details['points']) : 1)]], TRUE, $this->conf['targetPid']);
|
||||
$value = $this->pi_linkTP($value, [$this->prefixId => ['id' => $this->doc->uid, 'page' => (!empty($details['points']) ? intval($details['points']) : 1)]], true, $this->conf['targetPid']);
|
||||
}
|
||||
}
|
||||
} elseif ($index_name == 'owner' && !empty($value)) {
|
||||
|
@ -367,6 +367,6 @@ class Metadata extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$output .= $this->templateService->substituteMarkerArray($subpart['block'], $markerArray);
|
||||
}
|
||||
}
|
||||
return $this->templateService->substituteSubpart($this->template, '###BLOCK###', $output, TRUE);
|
||||
return $this->templateService->substituteSubpart($this->template, '###BLOCK###', $output, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,9 +44,9 @@ class Navigation extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$conf = [
|
||||
'useCacheHash' => 1,
|
||||
'parameter' => $this->conf['targetPid'],
|
||||
'title' => $this->pi_getLL('linkToList', '', TRUE)
|
||||
'title' => $this->pi_getLL('linkToList', '', true)
|
||||
];
|
||||
return $this->cObj->typoLink($this->pi_getLL('linkToList', '', TRUE), $conf);
|
||||
return $this->cObj->typoLink($this->pi_getLL('linkToList', '', true), $conf);
|
||||
}
|
||||
}
|
||||
return '';
|
||||
|
@ -74,7 +74,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 . '">' . $this->pi_getLL('selectPage', '', true) . '</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>';
|
||||
}
|
||||
|
@ -96,10 +96,10 @@ class Navigation extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
{
|
||||
$this->init($conf);
|
||||
// Turn cache on.
|
||||
$this->setCache(TRUE);
|
||||
$this->setCache(true);
|
||||
// Load current document.
|
||||
$this->loadDocument();
|
||||
if ($this->doc === NULL) {
|
||||
if ($this->doc === null) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return $content;
|
||||
} else {
|
||||
|
@ -132,67 +132,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($this->pi_getLL('firstPage', '', true), ['page' => 1]);
|
||||
} else {
|
||||
$markerArray['###FIRST###'] = '<span>' . $this->pi_getLL('firstPage', '', TRUE) . '</span>';
|
||||
$markerArray['###FIRST###'] = '<span>' . $this->pi_getLL('firstPage', '', true) . '</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(sprintf($this->pi_getLL('backXPages', '', true), $pageSteps), ['page' => $this->piVars['page'] - $pageSteps]);
|
||||
} else {
|
||||
$markerArray['###BACK###'] = '<span>' . sprintf($this->pi_getLL('backXPages', '', TRUE), $pageSteps) . '</span>';
|
||||
$markerArray['###BACK###'] = '<span>' . sprintf($this->pi_getLL('backXPages', '', true), $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($this->pi_getLL('prevPage', '', true), ['page' => $this->piVars['page'] - (1 + $this->piVars['double'])]);
|
||||
} else {
|
||||
$markerArray['###PREVIOUS###'] = '<span>' . $this->pi_getLL('prevPage', '', TRUE) . '</span>';
|
||||
$markerArray['###PREVIOUS###'] = '<span>' . $this->pi_getLL('prevPage', '', true) . '</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($this->pi_getLL('nextPage', '', true), ['page' => $this->piVars['page'] + (1 + $this->piVars['double'])]);
|
||||
} else {
|
||||
$markerArray['###NEXT###'] = '<span>' . $this->pi_getLL('nextPage', '', TRUE) . '</span>';
|
||||
$markerArray['###NEXT###'] = '<span>' . $this->pi_getLL('nextPage', '', true) . '</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(sprintf($this->pi_getLL('forwardXPages', '', true), $pageSteps), ['page' => $this->piVars['page'] + $pageSteps]);
|
||||
} else {
|
||||
$markerArray['###FORWARD###'] = '<span>' . sprintf($this->pi_getLL('forwardXPages', '', TRUE), $pageSteps) . '</span>';
|
||||
$markerArray['###FORWARD###'] = '<span>' . sprintf($this->pi_getLL('forwardXPages', '', true), $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($this->pi_getLL('lastPage', '', true), ['page' => $this->doc->numPages]);
|
||||
} else {
|
||||
$markerArray['###LAST###'] = '<span>' . $this->pi_getLL('lastPage', '', TRUE) . '</span>';
|
||||
$markerArray['###LAST###'] = '<span>' . $this->pi_getLL('lastPage', '', true) . '</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"');
|
||||
$markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOn', '', true), ['double' => 1], 'class="tx-dlf-navigation-doubleOn"');
|
||||
} else {
|
||||
$markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOff', '', TRUE), ['double' => 0], 'class="tx-dlf-navigation-doubleOff"');
|
||||
$markerArray['###DOUBLEPAGE###'] = $this->makeLink($this->pi_getLL('doublePageOff', '', true), ['double' => 0], 'class="tx-dlf-navigation-doubleOff"');
|
||||
}
|
||||
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]);
|
||||
$markerArray['###DOUBLEPAGE+1###'] = $this->makeLink($this->pi_getLL('doublePage+1', '', true), ['page' => $this->piVars['page'] + 1]);
|
||||
} else {
|
||||
$markerArray['###DOUBLEPAGE+1###'] = '<span>' . $this->pi_getLL('doublePage+1', '', TRUE) . '</span>';
|
||||
$markerArray['###DOUBLEPAGE+1###'] = '<span>' . $this->pi_getLL('doublePage+1', '', true) . '</span>';
|
||||
}
|
||||
} else {
|
||||
$markerArray['###DOUBLEPAGE###'] = '<span>' . $this->pi_getLL('doublePageOn', '', TRUE) . '</span>';
|
||||
$markerArray['###DOUBLEPAGE+1###'] = '<span>' . $this->pi_getLL('doublePage+1', '', TRUE) . '</span>';
|
||||
$markerArray['###DOUBLEPAGE###'] = '<span>' . $this->pi_getLL('doublePageOn', '', true) . '</span>';
|
||||
$markerArray['###DOUBLEPAGE+1###'] = '<span>' . $this->pi_getLL('doublePage+1', '', true) . '</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###'] = $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);
|
||||
$content .= $this->templateService->substituteMarkerArray($this->template, $markerArray);
|
||||
return $this->pi_wrapInBaseClass($content);
|
||||
}
|
||||
|
@ -221,7 +221,7 @@ class Navigation extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
'useCacheHash' => 1,
|
||||
'parameter' => $GLOBALS['TSFE']->id,
|
||||
'ATagParams' => $aTagParams,
|
||||
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $overrulePIvars, '', TRUE, FALSE),
|
||||
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $overrulePIvars, '', true, false),
|
||||
'title' => $label
|
||||
];
|
||||
return $this->cObj->typoLink($label, $conf);
|
||||
|
|
|
@ -37,7 +37,7 @@ class OaiPmh extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
* @var bool
|
||||
* @access protected
|
||||
*/
|
||||
protected $error = FALSE;
|
||||
protected $error = false;
|
||||
|
||||
/**
|
||||
* This holds the OAI DOM object
|
||||
|
@ -102,8 +102,8 @@ 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'));
|
||||
$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->setAttribute('code', $type);
|
||||
return $error;
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ class OaiPmh extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
*/
|
||||
protected function getMetsData(array $metadata)
|
||||
{
|
||||
$mets = NULL;
|
||||
$mets = null;
|
||||
// Load METS file.
|
||||
$xml = new \DOMDocument();
|
||||
if ($xml->load($metadata['location'])) {
|
||||
|
@ -299,15 +299,15 @@ class OaiPmh extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$root = $xml->getElementsByTagNameNS($this->formats['mets']['namespace'], 'mets');
|
||||
if ($root->item(0) instanceof \DOMNode) {
|
||||
// Import node into \DOMDocument.
|
||||
$mets = $this->oai->importNode($root->item(0), TRUE);
|
||||
$mets = $this->oai->importNode($root->item(0), true);
|
||||
} else {
|
||||
Helper::devLog('No METS part found in document with location "' . $metadata['location'] . '"', DEVLOG_SEVERITY_ERROR);
|
||||
}
|
||||
} else {
|
||||
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'));
|
||||
if ($mets === null) {
|
||||
$mets = $this->oai->createElementNS('http://kitodo.org/', 'kitodo:error', htmlspecialchars($this->pi_getLL('error', 'Error!', false), ENT_NOQUOTES, 'UTF-8'));
|
||||
}
|
||||
return $mets;
|
||||
}
|
||||
|
@ -327,7 +327,7 @@ class OaiPmh extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
// Initialize plugin.
|
||||
$this->init($conf);
|
||||
// Turn cache off.
|
||||
$this->setCache(FALSE);
|
||||
$this->setCache(false);
|
||||
// Get GET and POST variables.
|
||||
$this->getUrlParams();
|
||||
// Delete expired resumption tokens.
|
||||
|
|
|
@ -67,7 +67,7 @@ class PageGrid extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$linkConf = [
|
||||
'useCacheHash' => 1,
|
||||
'parameter' => $this->conf['targetPid'],
|
||||
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $piVars, '', TRUE, FALSE),
|
||||
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $piVars, '', true, false),
|
||||
'title' => $markerArray['###PAGINATION###']
|
||||
];
|
||||
$markerArray['###THUMBNAIL###'] = $this->cObj->typoLink($thumbnail, $linkConf);
|
||||
|
@ -90,34 +90,34 @@ class PageGrid extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
return '';
|
||||
}
|
||||
// Get separator.
|
||||
$separator = $this->pi_getLL('separator', ' - ', TRUE);
|
||||
$separator = $this->pi_getLL('separator', ' - ', true);
|
||||
// Add link to previous page.
|
||||
if ($this->piVars['pointer'] > 0) {
|
||||
$output = $this->pi_linkTP_keepPIvars($this->pi_getLL('prevPage', '<', TRUE), ['pointer' => $this->piVars['pointer'] - 1, 'page' => (($this->piVars['pointer'] - 1) * $this->conf['limit']) + 1], TRUE) . $separator;
|
||||
$output = $this->pi_linkTP_keepPIvars($this->pi_getLL('prevPage', '<', true), ['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', '<', TRUE) . '</span>' . $separator;
|
||||
$output = '<span class="prev-page not-active">' . $this->pi_getLL('prevPage', '<', true) . '</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(sprintf($this->pi_getLL('page', '%d', true), $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">' . sprintf($this->pi_getLL('page', '%d', true), $i + 1) . '</span>' . $separator;
|
||||
}
|
||||
$skip = TRUE;
|
||||
} elseif ($skip == TRUE) {
|
||||
$output .= '<span class="skipped">' . $this->pi_getLL('skip', '...', TRUE) . '</span>' . $separator;
|
||||
$skip = FALSE;
|
||||
$skip = true;
|
||||
} elseif ($skip == true) {
|
||||
$output .= '<span class="skipped">' . $this->pi_getLL('skip', '...', true) . '</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', '>', TRUE), ['pointer' => $this->piVars['pointer'] + 1, 'page' => ($this->piVars['pointer'] + 1) * $this->conf['limit'] + 1], TRUE);
|
||||
$output .= $this->pi_linkTP_keepPIvars($this->pi_getLL('nextPage', '>', true), ['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', '>', TRUE) . '</span>';
|
||||
$output .= '<span class="next-page not-active">' . $this->pi_getLL('nextPage', '>', true) . '</span>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ class PageGrid extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$this->init($conf);
|
||||
$this->loadDocument();
|
||||
if (
|
||||
$this->doc === NULL
|
||||
$this->doc === null
|
||||
|| $this->doc->numPages < 1
|
||||
|| empty($this->conf['fileGrpThumbs'])
|
||||
) {
|
||||
|
@ -194,7 +194,7 @@ class PageGrid extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
// Render page browser.
|
||||
$markerArray['###PAGEBROWSER###'] = $this->getPageBrowser();
|
||||
// Merge everything with template.
|
||||
$content = $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($this->template, '###ENTRY###', $content, TRUE), $markerArray);
|
||||
$content = $this->templateService->substituteMarkerArray($this->templateService->substituteSubpart($this->template, '###ENTRY###', $content, true), $markerArray);
|
||||
return $this->pi_wrapInBaseClass($content);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,14 +119,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();">' . $this->pi_getLL('editMode', '', TRUE) . '</a>';
|
||||
$markerArray['###EDITREMOVE###'] = '<a href="javascript: tx_dlf_viewer.resetCropSelection();">' . $this->pi_getLL('editRemove', '', TRUE) . '</a>';
|
||||
$markerArray['###EDITBUTTON###'] = '<a href="javascript: tx_dlf_viewer.activateSelection();">' . $this->pi_getLL('editMode', '', true) . '</a>';
|
||||
$markerArray['###EDITREMOVE###'] = '<a href="javascript: tx_dlf_viewer.resetCropSelection();">' . $this->pi_getLL('editRemove', '', true) . '</a>';
|
||||
} else {
|
||||
$markerArray['###EDITBUTTON###'] = '';
|
||||
$markerArray['###EDITREMOVE###'] = '';
|
||||
}
|
||||
if ($this->conf['magnifier']) {
|
||||
$markerArray['###MAGNIFIER###'] = '<a href="javascript: tx_dlf_viewer.activateMagnifier();">' . $this->pi_getLL('magnifier', '', TRUE) . '</a>';
|
||||
$markerArray['###MAGNIFIER###'] = '<a href="javascript: tx_dlf_viewer.activateMagnifier();">' . $this->pi_getLL('magnifier', '', true) . '</a>';
|
||||
} else {
|
||||
$markerArray['###MAGNIFIER###'] = '';
|
||||
}
|
||||
|
@ -146,17 +146,17 @@ 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 = $this->pi_getLL('addBasket', '', true);
|
||||
$params = [
|
||||
'id' => $this->piVars['id'],
|
||||
'addToBasket' => TRUE
|
||||
'addToBasket' => true
|
||||
];
|
||||
if (empty($this->piVars['page'])) {
|
||||
$params['page'] = 1;
|
||||
}
|
||||
$basketConf = [
|
||||
'parameter' => $this->conf['targetBasket'],
|
||||
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $params, '', TRUE, FALSE),
|
||||
'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $params, '', true, false),
|
||||
'title' => $label
|
||||
];
|
||||
$output = '<form id="addToBasketForm" action="' . $this->cObj->typoLink_URL($basketConf) . '" method="post">';
|
||||
|
@ -259,7 +259,7 @@ class PageView extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
if ($iiif instanceof ManifestInterface) {
|
||||
$canvas = $iiif->getContainedResourceById($canvasId);
|
||||
/* @var $canvas \Ubl\Iiif\Presentation\Common\Model\Resources\CanvasInterface */
|
||||
if ($canvas != NULL && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) {
|
||||
if ($canvas != null && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) {
|
||||
$annotationContainers = [];
|
||||
/*
|
||||
* TODO Analyzing the annotations on the server side requires loading the annotation lists / pages
|
||||
|
@ -269,11 +269,11 @@ class PageView extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
* On the other hand, server connections are potentially better than client connections. Downloading annotation lists
|
||||
*/
|
||||
foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) {
|
||||
if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != NULL) {
|
||||
if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != null) {
|
||||
foreach ($textAnnotations as $annotation) {
|
||||
if (
|
||||
$annotation->getBody()->getFormat() == "text/plain"
|
||||
&& $annotation->getBody()->getChars() != NULL
|
||||
&& $annotation->getBody()->getChars() != null
|
||||
) {
|
||||
$annotationListData = [];
|
||||
$annotationListData["uri"] = $annotationContainer->getId();
|
||||
|
@ -315,7 +315,7 @@ class PageView extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
// Load current document.
|
||||
$this->loadDocument();
|
||||
if (
|
||||
$this->doc === NULL
|
||||
$this->doc === null
|
||||
|| $this->doc->numPages < 1
|
||||
) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
|
|
|
@ -177,11 +177,11 @@ 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 . '">' . $this->pi_getLL($operator, '', true) . '</option>';
|
||||
}
|
||||
// Get field selector options.
|
||||
$fieldSelectorOptions = '';
|
||||
$searchFields = GeneralUtility::trimExplode(',', $this->conf['extendedFields'], TRUE);
|
||||
$searchFields = GeneralUtility::trimExplode(',', $this->conf['extendedFields'], true);
|
||||
foreach ($searchFields as $searchField) {
|
||||
$fieldSelectorOptions .= '<option class="tx-dlf-search-field-option tx-dlf-search-field-' . $searchField . '" value="' . $searchField . '">' . Helper::translate($searchField, 'tx_dlf_metadata', $this->conf['pages']) . '</option>';
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ class Search extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
}
|
||||
// Get facets from plugin configuration.
|
||||
$facets = [];
|
||||
foreach (GeneralUtility::trimExplode(',', $this->conf['facets'], TRUE) as $facet) {
|
||||
foreach (GeneralUtility::trimExplode(',', $this->conf['facets'], true) as $facet) {
|
||||
$facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->conf['pages']);
|
||||
}
|
||||
// Render facets menu.
|
||||
|
@ -306,7 +306,7 @@ class Search extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
// Check if facet is already selected.
|
||||
$queryColumn = array_column($search['params']['filterquery'], 'query');
|
||||
$index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn);
|
||||
if ($index !== FALSE) {
|
||||
if ($index !== false) {
|
||||
// Facet is selected, thus remove it from filter.
|
||||
unset($queryColumn[$index]);
|
||||
$queryColumn = array_values($queryColumn);
|
||||
|
@ -315,7 +315,7 @@ class Search extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
//Reset facets
|
||||
if ($this->conf['resetFacets']) {
|
||||
//remove ($count) for selected facet in template
|
||||
$entryArray['count'] = FALSE;
|
||||
$entryArray['count'] = false;
|
||||
//build link to delete selected facet
|
||||
$entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['query' => $search['query'], 'fq' => $queryColumn]);
|
||||
$entryArray['title'] = sprintf($this->pi_getLL('resetFacet', ''), $entryArray['title']);
|
||||
|
@ -343,7 +343,7 @@ class Search extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
{
|
||||
$this->init($conf);
|
||||
// Disable caching for this plugin.
|
||||
$this->setCache(FALSE);
|
||||
$this->setCache(false);
|
||||
// Quit without doing anything if required variables are not set.
|
||||
if (empty($this->conf['solrcore'])) {
|
||||
Helper::devLog('Incomplete plugin configuration', DEVLOG_SEVERITY_WARNING);
|
||||
|
@ -392,7 +392,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 = $this->pi_getLL('search', '', true);
|
||||
if (!empty($this->piVars['query'])) {
|
||||
$label .= htmlspecialchars(sprintf($this->pi_getLL('for', ''), trim($this->piVars['query'])));
|
||||
}
|
||||
|
@ -419,7 +419,7 @@ class Search extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
&& is_array($this->piVars['extQuery'])
|
||||
) {
|
||||
$allowedOperators = ['AND', 'OR', 'NOT'];
|
||||
$allowedFields = GeneralUtility::trimExplode(',', $this->conf['extendedFields'], TRUE);
|
||||
$allowedFields = GeneralUtility::trimExplode(',', $this->conf['extendedFields'], true);
|
||||
$numberOfExtQueries = count($this->piVars['extQuery']);
|
||||
for ($i = 0; $i < $numberOfExtQueries; $i++) {
|
||||
if (!empty($this->piVars['extQuery'][$i])) {
|
||||
|
@ -465,7 +465,7 @@ class Search extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
) {
|
||||
$index_name = Helper::getIndexNameFromUid($this->piVars['collection'], 'tx_dlf_collections', $this->conf['pages']);
|
||||
$params['filterquery'][]['query'] = 'collection_faceting:("' . Solr::escapeQuery($index_name) . '")';
|
||||
$label .= sprintf($this->pi_getLL('in', '', TRUE), Helper::translate($index_name, 'tx_dlf_collections', $this->conf['pages']));
|
||||
$label .= sprintf($this->pi_getLL('in', '', true), Helper::translate($index_name, 'tx_dlf_collections', $this->conf['pages']));
|
||||
}
|
||||
}
|
||||
// Add filter query for collection restrictions.
|
||||
|
@ -522,7 +522,7 @@ class Search extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$additionalParams['asc'] = !empty($this->piVars['asc']) ? '1' : '0';
|
||||
}
|
||||
}
|
||||
$linkConf['additionalParams'] = GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE);
|
||||
$linkConf['additionalParams'] = GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', true, false);
|
||||
// Send headers.
|
||||
header('Location: ' . GeneralUtility::locationHeaderUrl($this->cObj->typoLink_URL($linkConf)));
|
||||
exit;
|
||||
|
|
|
@ -43,7 +43,7 @@ class Statistics extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
{
|
||||
$this->init($conf);
|
||||
// Turn cache on.
|
||||
$this->setCache(TRUE);
|
||||
$this->setCache(true);
|
||||
// Quit without doing anything if required configuration variables are not set.
|
||||
if (empty($this->conf['pages'])) {
|
||||
Helper::devLog('Incomplete plugin configuration', DEVLOG_SEVERITY_WARNING);
|
||||
|
@ -114,8 +114,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 ? $this->pi_getLL('titles', '', true) : $this->pi_getLL('title', '', true)),
|
||||
$countVolumes . ($countVolumes > 1 ? $this->pi_getLL('volumes', '', true) : $this->pi_getLL('volume', '', true))
|
||||
]
|
||||
];
|
||||
// Apply replacements.
|
||||
|
|
|
@ -44,7 +44,7 @@ class TableOfContents extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
*
|
||||
* @return array HMENU array for menu entry
|
||||
*/
|
||||
protected function getMenuEntry(array $entry, $recursive = FALSE)
|
||||
protected function getMenuEntry(array $entry, $recursive = false)
|
||||
{
|
||||
$entryArray = [];
|
||||
// Set "title", "volume", "type" and "pagination" from $entry array.
|
||||
|
@ -61,25 +61,25 @@ class TableOfContents extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
!empty($entry['points'])
|
||||
&& \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($entry['points'])
|
||||
) {
|
||||
$entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['page' => $entry['points']], TRUE, FALSE, $this->conf['targetPid']);
|
||||
$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']) . '">' . $this->pi_getLL('basketButton', '', true) . '</a>';
|
||||
}
|
||||
} elseif (
|
||||
!empty($entry['points'])
|
||||
&& is_string($entry['points'])
|
||||
) {
|
||||
$entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['id' => $entry['points'], 'page' => 1], TRUE, FALSE, $this->conf['targetPid']);
|
||||
$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']) . '">' . $this->pi_getLL('basketButton', '', true) . '</a>';
|
||||
}
|
||||
} elseif (!empty($entry['targetUid'])) {
|
||||
$entryArray['_OVERRIDE_HREF'] = $this->pi_linkTP_keepPIvars_url(['id' => $entry['targetUid'], 'page' => 1], TRUE, FALSE, $this->conf['targetPid']);
|
||||
$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']) . '">' . $this->pi_getLL('basketButton', '', true) . '</a>';
|
||||
}
|
||||
}
|
||||
// Set "ITEM_STATE" to "CUR" if this entry points to current page.
|
||||
|
@ -88,7 +88,7 @@ class TableOfContents extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
}
|
||||
// Build sub-menu if available and called recursively.
|
||||
if (
|
||||
$recursive == TRUE
|
||||
$recursive == true
|
||||
&& !empty($entry['children'])
|
||||
) {
|
||||
// Build sub-menu only if one of the following conditions apply:
|
||||
|
@ -108,7 +108,7 @@ class TableOfContents extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
if (in_array($child['id'], $this->activeEntries)) {
|
||||
$entryArray['ITEM_STATE'] = 'ACT';
|
||||
}
|
||||
$entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, TRUE);
|
||||
$entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, true);
|
||||
}
|
||||
}
|
||||
// Append "IFSUB" to "ITEM_STATE" if this entry has sub-entries.
|
||||
|
@ -161,7 +161,7 @@ class TableOfContents extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$this->init($conf);
|
||||
// Load current document.
|
||||
$this->loadDocument();
|
||||
if ($this->doc === NULL) {
|
||||
if ($this->doc === null) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return [];
|
||||
} else {
|
||||
|
@ -203,12 +203,12 @@ class TableOfContents extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
}
|
||||
// Go through table of contents and create all menu entries.
|
||||
foreach ($this->doc->tableOfContents as $entry) {
|
||||
$menuArray[] = $this->getMenuEntry($entry, TRUE);
|
||||
$menuArray[] = $this->getMenuEntry($entry, true);
|
||||
}
|
||||
} else {
|
||||
// Go through table of contents and create top-level menu entries.
|
||||
foreach ($this->doc->tableOfContents as $entry) {
|
||||
$menuArray[] = $this->getMenuEntry($entry, FALSE);
|
||||
$menuArray[] = $this->getMenuEntry($entry, false);
|
||||
}
|
||||
// Get all child documents from database.
|
||||
$whereClause = 'tx_dlf_documents.partof=' . intval($this->doc->uid) . ' AND tx_dlf_documents.structure=tx_dlf_structures.uid AND tx_dlf_structures.pid=' . $this->doc->pid . Helper::whereClause('tx_dlf_documents') . Helper::whereClause('tx_dlf_structures');
|
||||
|
@ -234,7 +234,7 @@ class TableOfContents extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
'pagination' => '',
|
||||
'targetUid' => $resArray['uid']
|
||||
];
|
||||
$menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, FALSE);
|
||||
$menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,6 +58,6 @@ class Toolbox extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
$cObj->data = $data;
|
||||
$content .= $this->templateService->substituteMarkerArray($subpart, ['###TOOL###' => $cObj->cObjGetSingle($GLOBALS['TSFE']->tmpl->setup['plugin.'][$tool], $GLOBALS['TSFE']->tmpl->setup['plugin.'][$tool . '.'])]);
|
||||
}
|
||||
return $this->pi_wrapInBaseClass($this->templateService->substituteSubpart($this->template, '###TOOLS###', $content, TRUE));
|
||||
return $this->pi_wrapInBaseClass($this->templateService->substituteSubpart($this->template, '###TOOLS###', $content, true));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ class AnnotationTool extends AbstractPlugin
|
|||
}
|
||||
// Load current document.
|
||||
$this->loadDocument();
|
||||
if ($this->doc === NULL || $this->doc->numPages < 1) {
|
||||
if ($this->doc === null || $this->doc->numPages < 1) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return $content;
|
||||
} else {
|
||||
|
@ -74,13 +74,13 @@ class AnnotationTool extends AbstractPlugin
|
|||
// Load template file.
|
||||
$this->getTemplate();
|
||||
$annotationContainers = $this->doc->physicalStructureInfo[$this->doc->physicalStructure[$this->piVars['page']]]['annotationContainers'];
|
||||
if ($annotationContainers != NULL && sizeof($annotationContainers) > 0) {
|
||||
if ($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) . '"> </a>';
|
||||
. $this->pi_getLL('annotations-on', '', true) . ';annotations-off:'
|
||||
. $this->pi_getLL('annotations-off', '', true) . '"> </a>';
|
||||
// TODO selector for different motivations
|
||||
} else {
|
||||
$markerArray['###ANNOTATION_SELECT###'] = '<span class="no-annotations">' . $this->pi_getLL('annotations-not-available', '', TRUE) . '</span>';
|
||||
$markerArray['###ANNOTATION_SELECT###'] = '<span class="no-annotations">' . $this->pi_getLL('annotations-not-available', '', true) . '</span>';
|
||||
}
|
||||
$content .= $this->templateService->substituteMarkerArray($this->template, $markerArray);
|
||||
return $this->pi_wrapInBaseClass($content);
|
||||
|
|
|
@ -47,7 +47,7 @@ class FulltextTool extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
// Load current document.
|
||||
$this->loadDocument();
|
||||
if (
|
||||
$this->doc === NULL
|
||||
$this->doc === null
|
||||
|| $this->doc->numPages < 1
|
||||
|| empty($this->conf['fileGrpFulltext'])
|
||||
) {
|
||||
|
@ -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) . '"> </a>';
|
||||
$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) . '"> </a>';
|
||||
} else {
|
||||
$markerArray['###FULLTEXT_SELECT###'] = '<span class="no-fulltext">' . $this->pi_getLL('fulltext-not-available', '', TRUE) . '</span>';
|
||||
$markerArray['###FULLTEXT_SELECT###'] = '<span class="no-fulltext">' . $this->pi_getLL('fulltext-not-available', '', true) . '</span>';
|
||||
}
|
||||
$content .= $this->templateService->substituteMarkerArray($this->template, $markerArray);
|
||||
return $this->pi_wrapInBaseClass($content);
|
||||
|
|
|
@ -46,7 +46,7 @@ class ImageDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
// Load current document.
|
||||
$this->loadDocument();
|
||||
if (
|
||||
$this->doc === NULL
|
||||
$this->doc === null
|
||||
|| $this->doc->numPages < 1
|
||||
|| empty($this->conf['fileGrpsImageDownload'])
|
||||
) {
|
||||
|
|
|
@ -45,7 +45,7 @@ class ImageManipulationTool extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
}
|
||||
// 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) . '" 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:' . $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) . '" title="' . $this->pi_getLL('no-support', '', true) . '"></span>';
|
||||
$content .= $this->templateService->substituteMarkerArray($this->template, $markerArray);
|
||||
return $this->pi_wrapInBaseClass($content);
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ class PdfDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
// Load current document.
|
||||
$this->loadDocument();
|
||||
if (
|
||||
$this->doc === NULL
|
||||
$this->doc === null
|
||||
|| $this->doc->numPages < 1
|
||||
|| empty($this->conf['fileGrpDownload'])
|
||||
) {
|
||||
|
|
|
@ -53,7 +53,7 @@ class SearchInDocumentTool extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
// Load current document.
|
||||
$this->loadDocument();
|
||||
if (
|
||||
$this->doc === NULL
|
||||
$this->doc === null
|
||||
|| $this->doc->numPages < 1
|
||||
|| empty($this->conf['fileGrpFulltext'])
|
||||
|| empty($this->conf['solrcore'])
|
||||
|
|
|
@ -38,12 +38,12 @@ class Validator extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
{
|
||||
$this->init($conf);
|
||||
// Disable caching for this plugin.
|
||||
$this->setCache(FALSE);
|
||||
$this->setCache(false);
|
||||
// Load template file.
|
||||
$this->getTemplate();
|
||||
// Load current document.
|
||||
$this->loadDocument();
|
||||
if ($this->doc === NULL) {
|
||||
if ($this->doc === null) {
|
||||
// Document could not be loaded.
|
||||
// Check:
|
||||
// - if document location is valid URL
|
||||
|
|
|
@ -157,14 +157,14 @@ return [
|
|||
'label' => 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_collections.description',
|
||||
'config' => [
|
||||
'behaviour' => [
|
||||
'allowLanguageSynchronization' => TRUE
|
||||
'allowLanguageSynchronization' => true
|
||||
],
|
||||
'type' => 'text',
|
||||
'cols' => 30,
|
||||
'rows' => 10,
|
||||
'wrap' => 'virtual',
|
||||
'default' => '',
|
||||
'enableRichtext' => TRUE,
|
||||
'enableRichtext' => true,
|
||||
],
|
||||
],
|
||||
'thumbnail' => [
|
||||
|
|
|
@ -269,10 +269,10 @@ return [
|
|||
'readOnly' => 1,
|
||||
'fieldControl' => [
|
||||
'elementBrowser' => [
|
||||
'disabled' => TRUE
|
||||
'disabled' => true
|
||||
]
|
||||
],
|
||||
'hideDeleteIcon' => TRUE
|
||||
'hideDeleteIcon' => true
|
||||
],
|
||||
],
|
||||
'volume' => [
|
||||
|
|
|
@ -144,7 +144,7 @@ return [
|
|||
'label' => 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_metadata.wrap',
|
||||
'config' => [
|
||||
'behaviour' => [
|
||||
'allowLanguageSynchronization' => TRUE
|
||||
'allowLanguageSynchronization' => true
|
||||
],
|
||||
'type' => 'text',
|
||||
'cols' => 48,
|
||||
|
@ -152,8 +152,8 @@ return [
|
|||
'wrap' => 'off',
|
||||
'eval' => 'trim',
|
||||
'default' => "key.wrap = <dt>|</dt>\nvalue.required = 1\nvalue.wrap = <dd>|</dd>",
|
||||
'fixedFont' => TRUE,
|
||||
'enableTabulator' => TRUE
|
||||
'fixedFont' => true,
|
||||
'enableTabulator' => true
|
||||
],
|
||||
],
|
||||
'index_tokenized' => [
|
||||
|
|
|
@ -41,17 +41,17 @@ class ext_update
|
|||
public function access()
|
||||
{
|
||||
if (count($this->getMetadataConfig())) {
|
||||
return TRUE;
|
||||
return true;
|
||||
} elseif ($this->oldIndexRelatedTableNames()) {
|
||||
return TRUE;
|
||||
return true;
|
||||
} elseif ($this->solariumSolrUpdateRequired()) {
|
||||
return TRUE;
|
||||
return true;
|
||||
} elseif (count($this->oldFormatClasses())) {
|
||||
return TRUE;
|
||||
return true;
|
||||
} elseif ($this->hasNoFormatForDocument()) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -144,7 +144,7 @@ class ext_update
|
|||
*
|
||||
* @access protected
|
||||
*
|
||||
* @return bool TRUE if old index related columns exist
|
||||
* @return bool true if old index related columns exist
|
||||
*/
|
||||
protected function oldIndexRelatedTableNames()
|
||||
{
|
||||
|
@ -161,7 +161,7 @@ class ext_update
|
|||
|| $resArray['column_name'] == 'boost'
|
||||
|| $resArray['column_name'] == 'autocomplete'
|
||||
) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -185,14 +185,14 @@ class ext_update
|
|||
$result = $GLOBALS['TYPO3_DB']->sql_query($sqlQuery);
|
||||
if ($result) {
|
||||
Helper::addMessage(
|
||||
$GLOBALS['LANG']->getLL('update.copyIndexRelatedColumnsOkay', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.copyIndexRelatedColumns', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.copyIndexRelatedColumnsOkay', true),
|
||||
$GLOBALS['LANG']->getLL('update.copyIndexRelatedColumns', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
|
||||
);
|
||||
} else {
|
||||
Helper::addMessage(
|
||||
$GLOBALS['LANG']->getLL('update.copyIndexRelatedColumnsNotOkay', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.copyIndexRelatedColumns', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.copyIndexRelatedColumnsNotOkay', true),
|
||||
$GLOBALS['LANG']->getLL('update.copyIndexRelatedColumns', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::WARNING
|
||||
);
|
||||
}
|
||||
|
@ -219,8 +219,8 @@ class ext_update
|
|||
$GLOBALS['TYPO3_DB']->sql_query($sqlQuery);
|
||||
}
|
||||
Helper::addMessage(
|
||||
$GLOBALS['LANG']->getLL('update.FormatClassesOkay', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.FormatClasses', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.FormatClassesOkay', true),
|
||||
$GLOBALS['LANG']->getLL('update.FormatClasses', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
|
||||
);
|
||||
$this->content .= Helper::renderFlashMessages();
|
||||
|
@ -265,14 +265,14 @@ class ext_update
|
|||
unset($data);
|
||||
if (!empty($substUids)) {
|
||||
Helper::addMessage(
|
||||
$GLOBALS['LANG']->getLL('update.metadataConfigOkay', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.metadataConfig', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.metadataConfigOkay', true),
|
||||
$GLOBALS['LANG']->getLL('update.metadataConfig', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
|
||||
);
|
||||
} else {
|
||||
Helper::addMessage(
|
||||
$GLOBALS['LANG']->getLL('update.metadataConfigNotOkay', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.metadataConfig', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.metadataConfigNotOkay', true),
|
||||
$GLOBALS['LANG']->getLL('update.metadataConfig', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::WARNING
|
||||
);
|
||||
}
|
||||
|
@ -301,10 +301,10 @@ class ext_update
|
|||
// Instantiate search object.
|
||||
$solr = Solr::getInstance($resArray['index_name']);
|
||||
if (!$solr->ready) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -347,20 +347,20 @@ class ext_update
|
|||
// Build request for adding new Solr core.
|
||||
// @see http://wiki.apache.org/solr/CoreAdmin
|
||||
$url = $solrInfo['scheme'] . '://' . $host . ':' . $solrInfo['port'] . '/' . $solrInfo['path'] . '/admin/cores?wt=xml&action=CREATE&name=' . $resArray['index_name'] . '&instanceDir=' . $resArray['index_name'] . '&dataDir=data&configSet=dlf';
|
||||
$response = @simplexml_load_string(file_get_contents($url, FALSE, $context));
|
||||
$response = @simplexml_load_string(file_get_contents($url, false, $context));
|
||||
// Process response.
|
||||
if ($response) {
|
||||
$status = $response->xpath('//lst[@name="responseHeader"]/int[@name="status"]');
|
||||
if (
|
||||
$status !== FALSE
|
||||
$status !== false
|
||||
&& $status[0] == 0
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
Helper::addMessage(
|
||||
$GLOBALS['LANG']->getLL('update.solariumSolrUpdateNotOkay', TRUE),
|
||||
sprintf($GLOBALS['LANG']->getLL('update.solariumSolrUpdate', TRUE), $resArray['index_name']),
|
||||
$GLOBALS['LANG']->getLL('update.solariumSolrUpdateNotOkay', true),
|
||||
sprintf($GLOBALS['LANG']->getLL('update.solariumSolrUpdate', true), $resArray['index_name']),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
|
||||
);
|
||||
$this->content .= Helper::renderFlashMessages();
|
||||
|
@ -368,8 +368,8 @@ class ext_update
|
|||
}
|
||||
}
|
||||
Helper::addMessage(
|
||||
$GLOBALS['LANG']->getLL('update.solariumSolrUpdateOkay', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.solariumSolrUpdate', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.solariumSolrUpdateOkay', true),
|
||||
$GLOBALS['LANG']->getLL('update.solariumSolrUpdate', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
|
||||
);
|
||||
$this->content .= Helper::renderFlashMessages();
|
||||
|
@ -385,10 +385,10 @@ class ext_update
|
|||
);
|
||||
while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
|
||||
if ($resArray['COLUMN_NAME'] == 'document_format') {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function updateDocumentAddFormat()
|
||||
|
@ -397,14 +397,14 @@ class ext_update
|
|||
$result = $GLOBALS['TYPO3_DB']->sql_query($sqlQuery);
|
||||
if ($result) {
|
||||
Helper::addMessage(
|
||||
$GLOBALS['LANG']->getLL('update.documentAddFormatOkay', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.documentAddFormat', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.documentAddFormatOkay', true),
|
||||
$GLOBALS['LANG']->getLL('update.documentAddFormat', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
|
||||
);
|
||||
} else {
|
||||
Helper::addMessage(
|
||||
$GLOBALS['LANG']->getLL('update.documentAddFormatNotOkay', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.documentAddFormat', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.documentAddFormatNotOkay', true),
|
||||
$GLOBALS['LANG']->getLL('update.documentAddFormat', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::WARNING
|
||||
);
|
||||
$this->content .= Helper::renderFlashMessages();
|
||||
|
@ -415,14 +415,14 @@ class ext_update
|
|||
$result = $GLOBALS['TYPO3_DB']->sql_query($sqlQuery);
|
||||
if ($result) {
|
||||
Helper::addMessage(
|
||||
$GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntriesOkay', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntries', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntriesOkay', true),
|
||||
$GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntries', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::OK
|
||||
);
|
||||
} else {
|
||||
Helper::addMessage(
|
||||
$GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntriesNotOkay', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntries', TRUE),
|
||||
$GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntriesNotOkay', true),
|
||||
$GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntries', true),
|
||||
\TYPO3\CMS\Core\Messaging\FlashMessage::WARNING
|
||||
);
|
||||
return;
|
||||
|
|
|
@ -24,9 +24,9 @@ $EM_CONF[$_EXTKEY] = [
|
|||
'suggests' => []
|
||||
],
|
||||
'state' => 'stable',
|
||||
'uploadfolder' => FALSE,
|
||||
'uploadfolder' => false,
|
||||
'createDirs' => '',
|
||||
'clearCacheOnLoad' => FALSE,
|
||||
'clearCacheOnLoad' => false,
|
||||
'author' => 'Sebastian Meyer (Maintainer)',
|
||||
'author_email' => 'contact@kitodo.org',
|
||||
'author_company' => 'Kitodo. Key to digital objects e. V.',
|
||||
|
|
|
@ -30,35 +30,35 @@ if (!defined('DEVLOG_SEVERITY_ERROR')) {
|
|||
define('DEVLOG_SEVERITY_ERROR', 3);
|
||||
}
|
||||
// Register plugins.
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\AudioPlayer::class, '_audioplayer', 'list_type', TRUE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Basket::class, '_basket', 'list_type', FALSE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Calendar::class, '_calendar', 'list_type', TRUE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Collection::class, '_collection', 'list_type', TRUE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Feeds::class, '_feeds', 'list_type', FALSE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\ListView::class, '_listview', 'list_type', FALSE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Metadata::class, '_metadata', 'list_type', TRUE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Navigation::class, '_navigation', 'list_type', TRUE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\OaiPmh::class, '_oaipmh', 'list_type', FALSE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\PageGrid::class, '_pagegrid', 'list_type', TRUE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\PageView::class, '_pageview', 'list_type', TRUE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Search::class, '_search', 'list_type', TRUE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Statistics::class, '_statistics', 'list_type', TRUE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\TableOfContents::class, '_tableofcontents', 'list_type', TRUE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Toolbox::class, '_toolbox', 'list_type', TRUE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Validator::class, '_validator', 'list_type', FALSE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\AudioPlayer::class, '_audioplayer', 'list_type', true);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Basket::class, '_basket', 'list_type', false);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Calendar::class, '_calendar', 'list_type', true);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Collection::class, '_collection', 'list_type', true);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Feeds::class, '_feeds', 'list_type', false);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\ListView::class, '_listview', 'list_type', false);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Metadata::class, '_metadata', 'list_type', true);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Navigation::class, '_navigation', 'list_type', true);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\OaiPmh::class, '_oaipmh', 'list_type', false);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\PageGrid::class, '_pagegrid', 'list_type', true);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\PageView::class, '_pageview', 'list_type', true);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Search::class, '_search', 'list_type', true);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Statistics::class, '_statistics', 'list_type', true);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\TableOfContents::class, '_tableofcontents', 'list_type', true);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Toolbox::class, '_toolbox', 'list_type', true);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Validator::class, '_validator', 'list_type', false);
|
||||
// Register tools for toolbox plugin.
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'] = [];
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\FulltextTool::class, '_fulltexttool', '', TRUE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\FulltextTool::class, '_fulltexttool', '', true);
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_fulltexttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.fulltexttool';
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\AnnotationTool::class, '_annotationtool', '', TRUE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\AnnotationTool::class, '_annotationtool', '', true);
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_annotationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.annotationtool';
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\ImageDownloadTool::class, '_imagedownloadtool', '', TRUE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\ImageDownloadTool::class, '_imagedownloadtool', '', true);
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_imagedownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagedownloadtool';
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\ImageManipulationTool::class, '_imagemanipulationtool', '', TRUE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\ImageManipulationTool::class, '_imagemanipulationtool', '', true);
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_imagemanipulationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.imagemanipulationtool';
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\PdfDownloadTool::class, '_pdfdownloadtool', '', TRUE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\PdfDownloadTool::class, '_pdfdownloadtool', '', true);
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_pdfdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.pdfdownloadtool';
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\SearchInDocumentTool::class, '_searchindocumenttool', '', TRUE);
|
||||
\Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\Tools\SearchInDocumentTool::class, '_searchindocumenttool', '', true);
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_searchindocumenttool'] = 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_toolbox.searchindocumenttool';
|
||||
// Register hooks.
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = \Kitodo\Dlf\Hooks\DataHandler::class;
|
||||
|
@ -88,7 +88,7 @@ if (\TYPO3_MODE === 'FE') {
|
|||
*
|
||||
* @param string $type: document type string to test for
|
||||
*
|
||||
* @return bool TRUE if document type matches, FALSE if not
|
||||
* @return bool true if document type matches, false if not
|
||||
*/
|
||||
function user_dlf_docTypeCheck($type)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue