@@ -63,10 +63,10 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | // Select for collection(s) |
| 65 | 65 | $fieldName = 'coll'; |
| 66 | - $fieldId = 'task_' . $fieldName; |
|
| 66 | + $fieldId = 'task_'.$fieldName; |
|
| 67 | 67 | $options = $this->getCollOptions($taskInfo['coll'], $taskInfo['pid']); |
| 68 | 68 | ; |
| 69 | - $fieldHtml = '<select name="tx_scheduler[' . $fieldName . '][]" id="' . $fieldId . '" size="10" multiple="multiple">' . implode("\n", $options) . '</select>'; |
|
| 69 | + $fieldHtml = '<select name="tx_scheduler['.$fieldName.'][]" id="'.$fieldId.'" size="10" multiple="multiple">'.implode("\n", $options).'</select>'; |
|
| 70 | 70 | $additionalFields[$fieldId] = [ |
| 71 | 71 | 'code' => $fieldHtml, |
| 72 | 72 | 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:additionalFields.coll', |
@@ -85,9 +85,9 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | // Checkbox for all |
| 87 | 87 | $fieldName = 'all'; |
| 88 | - $fieldId = 'task_' . $fieldName; |
|
| 89 | - $fieldHtml = '<input type="checkbox" name="tx_scheduler[' . $fieldName . ']" id="' . $fieldId . '" value="1"' . |
|
| 90 | - ($taskInfo['all'] ? ' checked="checked"' : '') . '>'; |
|
| 88 | + $fieldId = 'task_'.$fieldName; |
|
| 89 | + $fieldHtml = '<input type="checkbox" name="tx_scheduler['.$fieldName.']" id="'.$fieldId.'" value="1"'. |
|
| 90 | + ($taskInfo['all'] ? ' checked="checked"' : '').'>'; |
|
| 91 | 91 | $additionalFields[$fieldId] = [ |
| 92 | 92 | 'code' => $fieldHtml, |
| 93 | 93 | 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:additionalFields.all', |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $options = []; |
| 112 | 112 | $collections = $this->getCollections($pid); |
| 113 | 113 | foreach ($collections as $label => $uid) { |
| 114 | - $options[] = '<option value="' . $uid . '" ' . (in_array($uid, $coll) ? 'selected' : '') . ' >' . $label . '</option>'; |
|
| 114 | + $options[] = '<option value="'.$uid.'" '.(in_array($uid, $coll) ? 'selected' : '').' >'.$label.'</option>'; |
|
| 115 | 115 | } |
| 116 | 116 | return $options; |
| 117 | 117 | } |
@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | * |
| 26 | 26 | * @access public |
| 27 | 27 | */ |
| 28 | -class ReindexAdditionalFieldProvider extends BaseAdditionalFieldProvider |
|
| 29 | -{ |
|
| 28 | +class ReindexAdditionalFieldProvider extends BaseAdditionalFieldProvider { |
|
| 30 | 29 | /** |
| 31 | 30 | * Gets additional fields to render in the form to add/edit a task |
| 32 | 31 | * |
@@ -35,8 +34,7 @@ discard block |
||
| 35 | 34 | * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule Reference to the scheduler backend module |
| 36 | 35 | * @return array A two dimensional array, array('Identifier' => array('fieldId' => array('code' => '', 'label' => '', 'cshKey' => '', 'cshLabel' => '')) |
| 37 | 36 | */ |
| 38 | - public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) |
|
| 39 | - { |
|
| 37 | + public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) { |
|
| 40 | 38 | $currentSchedulerModuleAction = $schedulerModule->getCurrentAction(); |
| 41 | 39 | |
| 42 | 40 | /** @var BaseTask $task */ |
@@ -49,13 +49,13 @@ |
||
| 49 | 49 | $taskInfo['all'] = $task->isAll(); |
| 50 | 50 | $taskInfo['softCommit'] = $task->isSoftCommit(); |
| 51 | 51 | } else { |
| 52 | - $taskInfo['dryRun'] = false; |
|
| 52 | + $taskInfo['dryRun'] = FALSE; |
|
| 53 | 53 | $taskInfo['coll'] = []; |
| 54 | 54 | $taskInfo['pid'] = - 1; |
| 55 | 55 | $taskInfo['solr'] = - 1; |
| 56 | 56 | $taskInfo['owner'] = ''; |
| 57 | - $taskInfo['all'] = false; |
|
| 58 | - $taskInfo['softCommit'] = false; |
|
| 57 | + $taskInfo['all'] = FALSE; |
|
| 58 | + $taskInfo['softCommit'] = FALSE; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | $additionalFields = []; |
@@ -12,8 +12,7 @@ discard block |
||
| 12 | 12 | * LICENSE.txt file that was distributed with this source code. |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | -class AnnotationTarget |
|
| 16 | -{ |
|
| 15 | +class AnnotationTarget { |
|
| 17 | 16 | /** |
| 18 | 17 | * @var string |
| 19 | 18 | */ |
@@ -39,8 +38,7 @@ discard block |
||
| 39 | 38 | */ |
| 40 | 39 | protected $rangeValue; |
| 41 | 40 | |
| 42 | - public function __construct($url) |
|
| 43 | - { |
|
| 41 | + public function __construct($url) { |
|
| 44 | 42 | $this->url = $url; |
| 45 | 43 | |
| 46 | 44 | $path = parse_url($url, PHP_URL_PATH); |
@@ -65,40 +63,35 @@ discard block |
||
| 65 | 63 | /** |
| 66 | 64 | * @return string |
| 67 | 65 | */ |
| 68 | - public function getObjectId() |
|
| 69 | - { |
|
| 66 | + public function getObjectId() { |
|
| 70 | 67 | return $this->objectId; |
| 71 | 68 | } |
| 72 | 69 | |
| 73 | 70 | /** |
| 74 | 71 | * @return string |
| 75 | 72 | */ |
| 76 | - public function getId() |
|
| 77 | - { |
|
| 73 | + public function getId() { |
|
| 78 | 74 | return $this->id; |
| 79 | 75 | } |
| 80 | 76 | |
| 81 | 77 | /** |
| 82 | 78 | * @return string |
| 83 | 79 | */ |
| 84 | - public function getRangeParameterName() |
|
| 85 | - { |
|
| 80 | + public function getRangeParameterName() { |
|
| 86 | 81 | return $this->rangeParameterName; |
| 87 | 82 | } |
| 88 | 83 | |
| 89 | 84 | /** |
| 90 | 85 | * @return string |
| 91 | 86 | */ |
| 92 | - public function getRangeValue() |
|
| 93 | - { |
|
| 87 | + public function getRangeValue() { |
|
| 94 | 88 | return $this->rangeValue; |
| 95 | 89 | } |
| 96 | 90 | |
| 97 | 91 | /** |
| 98 | 92 | * @return bool |
| 99 | 93 | */ |
| 100 | - public function isValid() |
|
| 101 | - { |
|
| 94 | + public function isValid() { |
|
| 102 | 95 | if (empty($this->getObjectId())) { |
| 103 | 96 | return false; |
| 104 | 97 | } |
@@ -113,8 +106,7 @@ discard block |
||
| 113 | 106 | /** |
| 114 | 107 | * @return bool |
| 115 | 108 | */ |
| 116 | - public function isValidRange() |
|
| 117 | - { |
|
| 109 | + public function isValidRange() { |
|
| 118 | 110 | if (empty($this->rangeParameterName) && empty($this->rangeValue)) { |
| 119 | 111 | return true; |
| 120 | 112 | } elseif ($this->isFacsimileRange()) { |
@@ -131,24 +123,21 @@ discard block |
||
| 131 | 123 | /** |
| 132 | 124 | * @return bool |
| 133 | 125 | */ |
| 134 | - public function isScoreRange() |
|
| 135 | - { |
|
| 126 | + public function isScoreRange() { |
|
| 136 | 127 | return $this->getRangeParameterName() === 'measureRanges'; |
| 137 | 128 | } |
| 138 | 129 | |
| 139 | 130 | /** |
| 140 | 131 | * @return bool |
| 141 | 132 | */ |
| 142 | - public function isAudioRange() |
|
| 143 | - { |
|
| 133 | + public function isAudioRange() { |
|
| 144 | 134 | return $this->getRangeParameterName() === 't'; |
| 145 | 135 | } |
| 146 | 136 | |
| 147 | 137 | /** |
| 148 | 138 | * @return bool |
| 149 | 139 | */ |
| 150 | - public function isFacsimileRange() |
|
| 151 | - { |
|
| 140 | + public function isFacsimileRange() { |
|
| 152 | 141 | return $this->getRangeParameterName() === 'xywh'; |
| 153 | 142 | } |
| 154 | 143 | } |
@@ -100,14 +100,14 @@ discard block |
||
| 100 | 100 | public function isValid() |
| 101 | 101 | { |
| 102 | 102 | if (empty($this->getObjectId())) { |
| 103 | - return false; |
|
| 103 | + return FALSE; |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | if (parse_url($this->getUrl(), PHP_URL_FRAGMENT)) { |
| 107 | 107 | return !empty($this->getId()) && $this->isValidRange(); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - return true; |
|
| 110 | + return TRUE; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | public function isValidRange() |
| 117 | 117 | { |
| 118 | 118 | if (empty($this->rangeParameterName) && empty($this->rangeValue)) { |
| 119 | - return true; |
|
| 119 | + return TRUE; |
|
| 120 | 120 | } elseif ($this->isFacsimileRange()) { |
| 121 | 121 | return preg_match("/^(\d+)(,\d+){3}?$/", $this->rangeValue) === 1; |
| 122 | 122 | } elseif ($this->isAudioRange()) { |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | return preg_match("/^((\d+|start|end|all|(\d+|start)(-(\d+|end)){0,1})+)(,(\d+|start|end|all|(\d+|start)(-(\d+|end)){0,1})+){0,}?$/", $this->rangeValue) === 1; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - return false; |
|
| 128 | + return FALSE; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -12,8 +12,7 @@ discard block |
||
| 12 | 12 | * LICENSE.txt file that was distributed with this source code. |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | -class Annotation |
|
| 16 | -{ |
|
| 15 | +class Annotation { |
|
| 17 | 16 | /** |
| 18 | 17 | * The complete data of the annotation |
| 19 | 18 | * |
@@ -30,8 +29,7 @@ discard block |
||
| 30 | 29 | /** |
| 31 | 30 | * @param array $data |
| 32 | 31 | */ |
| 33 | - public function __construct($data) |
|
| 34 | - { |
|
| 32 | + public function __construct($data) { |
|
| 35 | 33 | $this->data = $data; |
| 36 | 34 | } |
| 37 | 35 | |
@@ -40,8 +38,7 @@ discard block |
||
| 40 | 38 | * |
| 41 | 39 | * @return array |
| 42 | 40 | */ |
| 43 | - public function getRawData() |
|
| 44 | - { |
|
| 41 | + public function getRawData() { |
|
| 45 | 42 | return $this->data; |
| 46 | 43 | } |
| 47 | 44 | |
@@ -50,8 +47,7 @@ discard block |
||
| 50 | 47 | * |
| 51 | 48 | * @return string |
| 52 | 49 | */ |
| 53 | - public function getId() |
|
| 54 | - { |
|
| 50 | + public function getId() { |
|
| 55 | 51 | return $this->data['id'] ?? ''; |
| 56 | 52 | } |
| 57 | 53 | |
@@ -60,8 +56,7 @@ discard block |
||
| 60 | 56 | * |
| 61 | 57 | * @return string |
| 62 | 58 | */ |
| 63 | - public function getTitle() |
|
| 64 | - { |
|
| 59 | + public function getTitle() { |
|
| 65 | 60 | return $this->data['title'] ?? ''; |
| 66 | 61 | } |
| 67 | 62 | |
@@ -70,8 +65,7 @@ discard block |
||
| 70 | 65 | * |
| 71 | 66 | * @return array |
| 72 | 67 | */ |
| 73 | - public function getBody() |
|
| 74 | - { |
|
| 68 | + public function getBody() { |
|
| 75 | 69 | $body = $this->data['body'] ?? ''; |
| 76 | 70 | |
| 77 | 71 | if (is_array($body)) { |
@@ -85,8 +79,7 @@ discard block |
||
| 85 | 79 | * Gets the name of the annotation creator |
| 86 | 80 | * @return string |
| 87 | 81 | */ |
| 88 | - public function getCreatorName() |
|
| 89 | - { |
|
| 82 | + public function getCreatorName() { |
|
| 90 | 83 | return $this->data['creator']['displayName'] ?? ''; |
| 91 | 84 | } |
| 92 | 85 | |
@@ -94,8 +87,7 @@ discard block |
||
| 94 | 87 | * Gets the creation date of the annotation |
| 95 | 88 | * @return string |
| 96 | 89 | */ |
| 97 | - public function getCreated() |
|
| 98 | - { |
|
| 90 | + public function getCreated() { |
|
| 99 | 91 | return $this->data['created'] ?? ''; |
| 100 | 92 | } |
| 101 | 93 | |
@@ -103,8 +95,7 @@ discard block |
||
| 103 | 95 | * Gets the modification date of the annotation |
| 104 | 96 | * @return string |
| 105 | 97 | */ |
| 106 | - public function getModified() |
|
| 107 | - { |
|
| 98 | + public function getModified() { |
|
| 108 | 99 | return $this->data['modified'] ?? ''; |
| 109 | 100 | } |
| 110 | 101 | |
@@ -113,8 +104,7 @@ discard block |
||
| 113 | 104 | * |
| 114 | 105 | * @return AnnotationTarget[] |
| 115 | 106 | */ |
| 116 | - public function getTargets() |
|
| 117 | - { |
|
| 107 | + public function getTargets() { |
|
| 118 | 108 | if (is_string($this->data['target'])) { |
| 119 | 109 | return [new AnnotationTarget($this->data['target'])]; |
| 120 | 110 | } |
@@ -133,8 +123,7 @@ discard block |
||
| 133 | 123 | * @param array $targetPages |
| 134 | 124 | * @return void |
| 135 | 125 | */ |
| 136 | - public function setTargetPages($targetPages) |
|
| 137 | - { |
|
| 126 | + public function setTargetPages($targetPages) { |
|
| 138 | 127 | $this->targetPages = $targetPages; |
| 139 | 128 | } |
| 140 | 129 | |
@@ -143,8 +132,7 @@ discard block |
||
| 143 | 132 | * |
| 144 | 133 | * @return array |
| 145 | 134 | */ |
| 146 | - public function getTargetPages() |
|
| 147 | - { |
|
| 135 | + public function getTargetPages() { |
|
| 148 | 136 | return $this->targetPages; |
| 149 | 137 | } |
| 150 | 138 | |
@@ -153,8 +141,7 @@ discard block |
||
| 153 | 141 | * |
| 154 | 142 | * @return array |
| 155 | 143 | */ |
| 156 | - public function getPageNumbers() |
|
| 157 | - { |
|
| 144 | + public function getPageNumbers() { |
|
| 158 | 145 | $pages = []; |
| 159 | 146 | if (is_array($this->targetPages)) { |
| 160 | 147 | foreach ($this->targetPages as $target) { |
@@ -170,8 +157,7 @@ discard block |
||
| 170 | 157 | * |
| 171 | 158 | * @return array |
| 172 | 159 | */ |
| 173 | - public function getPageTargets() |
|
| 174 | - { |
|
| 160 | + public function getPageTargets() { |
|
| 175 | 161 | $pageTargets = []; |
| 176 | 162 | if (is_array($this->targetPages)) { |
| 177 | 163 | foreach ($this->targetPages as $target) { |
@@ -189,8 +175,7 @@ discard block |
||
| 189 | 175 | * |
| 190 | 176 | * @return array |
| 191 | 177 | */ |
| 192 | - public function getPageAudioRanges() |
|
| 193 | - { |
|
| 178 | + public function getPageAudioRanges() { |
|
| 194 | 179 | $ranges = []; |
| 195 | 180 | if (is_array($this->getPageTargets())) { |
| 196 | 181 | foreach ($this->getPageTargets() as $pageNumber => $targets) { |
@@ -209,8 +194,7 @@ discard block |
||
| 209 | 194 | * |
| 210 | 195 | * @return array |
| 211 | 196 | */ |
| 212 | - public function getPageScoreRanges() |
|
| 213 | - { |
|
| 197 | + public function getPageScoreRanges() { |
|
| 214 | 198 | $ranges = []; |
| 215 | 199 | if (is_array($this->getPageTargets())) { |
| 216 | 200 | foreach ($this->getPageTargets() as $pageNumber => $targets) { |
@@ -229,8 +213,7 @@ discard block |
||
| 229 | 213 | * |
| 230 | 214 | * @return array |
| 231 | 215 | */ |
| 232 | - public function getPageFacsimileRanges() |
|
| 233 | - { |
|
| 216 | + public function getPageFacsimileRanges() { |
|
| 234 | 217 | $ranges = []; |
| 235 | 218 | if (is_array($this->getPageTargets())) { |
| 236 | 219 | foreach ($this->getPageTargets() as $pageNumber => $targets) { |
@@ -250,8 +233,7 @@ discard block |
||
| 250 | 233 | * |
| 251 | 234 | * @return bool |
| 252 | 235 | */ |
| 253 | - public function isVerovioRelevant() |
|
| 254 | - { |
|
| 236 | + public function isVerovioRelevant() { |
|
| 255 | 237 | foreach ($this->targetPages as $target) { |
| 256 | 238 | if (array_key_exists('verovioRelevant', $target) && $target['verovioRelevant']) { |
| 257 | 239 | return true; |
@@ -254,10 +254,10 @@ |
||
| 254 | 254 | { |
| 255 | 255 | foreach ($this->targetPages as $target) { |
| 256 | 256 | if (array_key_exists('verovioRelevant', $target) && $target['verovioRelevant']) { |
| 257 | - return true; |
|
| 257 | + return TRUE; |
|
| 258 | 258 | } |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | - return false; |
|
| 261 | + return FALSE; |
|
| 262 | 262 | } |
| 263 | 263 | } |
@@ -30,8 +30,7 @@ discard block |
||
| 30 | 30 | * |
| 31 | 31 | * @access public |
| 32 | 32 | */ |
| 33 | -class MetadataFormat extends AbstractEntity |
|
| 34 | -{ |
|
| 33 | +class MetadataFormat extends AbstractEntity { |
|
| 35 | 34 | /** |
| 36 | 35 | * @access protected |
| 37 | 36 | * @var int UID of the ``tx_dlf_metadata`` that is encoded by this metadata entry. |
@@ -76,14 +75,12 @@ discard block |
||
| 76 | 75 | /** |
| 77 | 76 | * constructor |
| 78 | 77 | */ |
| 79 | - public function __construct() |
|
| 80 | - { |
|
| 78 | + public function __construct() { |
|
| 81 | 79 | // Do not remove the next line: It would break the functionality |
| 82 | 80 | $this->initStorageObjects(); |
| 83 | 81 | } |
| 84 | 82 | |
| 85 | - protected function initStorageObjects() |
|
| 86 | - { |
|
| 83 | + protected function initStorageObjects() { |
|
| 87 | 84 | $this->subentries = new ObjectStorage(); |
| 88 | 85 | } |
| 89 | 86 | |
@@ -151,8 +148,7 @@ discard block |
||
| 151 | 148 | $this->xpathSorting = $xpathSorting; |
| 152 | 149 | } |
| 153 | 150 | |
| 154 | - public function getSubentries() |
|
| 155 | - { |
|
| 151 | + public function getSubentries() { |
|
| 156 | 152 | return $this->subentries; |
| 157 | 153 | } |
| 158 | 154 | |
@@ -168,8 +164,7 @@ discard block |
||
| 168 | 164 | * |
| 169 | 165 | * @return void |
| 170 | 166 | */ |
| 171 | - public function addSubentry(MetadataSubentry $subentry) |
|
| 172 | - { |
|
| 167 | + public function addSubentry(MetadataSubentry $subentry) { |
|
| 173 | 168 | $this->subentries->attach($subentry); |
| 174 | 169 | } |
| 175 | 170 | |
@@ -180,8 +175,7 @@ discard block |
||
| 180 | 175 | * |
| 181 | 176 | * @return void |
| 182 | 177 | */ |
| 183 | - public function removeSubentry(MetadataSubentry $subentryToRemove) |
|
| 184 | - { |
|
| 178 | + public function removeSubentry(MetadataSubentry $subentryToRemove) { |
|
| 185 | 179 | $this->subentries->detach($subentryToRemove); |
| 186 | 180 | } |
| 187 | 181 | |
@@ -24,8 +24,7 @@ discard block |
||
| 24 | 24 | * |
| 25 | 25 | * @access public |
| 26 | 26 | */ |
| 27 | -class ToolboxController extends AbstractController |
|
| 28 | -{ |
|
| 27 | +class ToolboxController extends AbstractController { |
|
| 29 | 28 | |
| 30 | 29 | /** |
| 31 | 30 | * @access private |
@@ -208,8 +207,7 @@ discard block |
||
| 208 | 207 | * |
| 209 | 208 | * @return void |
| 210 | 209 | */ |
| 211 | - public function renderScoreTool() |
|
| 212 | - { |
|
| 210 | + public function renderScoreTool() { |
|
| 213 | 211 | if ( |
| 214 | 212 | $this->isDocMissingOrEmpty() |
| 215 | 213 | || empty($this->extConf['files']['fileGrpScore']) |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | private function renderToolByName(string $tool): void |
| 121 | 121 | { |
| 122 | 122 | $this->$tool(); |
| 123 | - $this->view->assign($tool, true); |
|
| 123 | + $this->view->assign($tool, TRUE); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -142,12 +142,12 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | $annotationContainers = $this->currentDocument->physicalStructureInfo[$this->currentDocument->physicalStructure[$this->requestData['page']]]['annotationContainers']; |
| 144 | 144 | if ( |
| 145 | - $annotationContainers != null |
|
| 145 | + $annotationContainers != NULL |
|
| 146 | 146 | && count($annotationContainers) > 0 |
| 147 | 147 | ) { |
| 148 | - $this->view->assign('annotationTool', true); |
|
| 148 | + $this->view->assign('annotationTool', TRUE); |
|
| 149 | 149 | } else { |
| 150 | - $this->view->assign('annotationTool', false); |
|
| 150 | + $this->view->assign('annotationTool', FALSE); |
|
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
@@ -196,10 +196,10 @@ discard block |
||
| 196 | 196 | $this->setPage(); |
| 197 | 197 | |
| 198 | 198 | if (!$this->isFullTextEmpty()) { |
| 199 | - $this->view->assign('fulltext', true); |
|
| 199 | + $this->view->assign('fulltext', TRUE); |
|
| 200 | 200 | $this->view->assign('activateFullTextInitially', MathUtility::forceIntegerInRange($this->settings['activateFullTextInitially'], 0, 1, 0)); |
| 201 | 201 | } else { |
| 202 | - $this->view->assign('fulltext', false); |
|
| 202 | + $this->view->assign('fulltext', FALSE); |
|
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | |
@@ -231,10 +231,10 @@ discard block |
||
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | 233 | if (!empty($scoreFile)) { |
| 234 | - $this->view->assign('score', true); |
|
| 234 | + $this->view->assign('score', TRUE); |
|
| 235 | 235 | $this->view->assign('activateScoreInitially', MathUtility::forceIntegerInRange($this->settings['activateScoreInitially'], 0, 1, 0)); |
| 236 | 236 | } else { |
| 237 | - $this->view->assign('score', false); |
|
| 237 | + $this->view->assign('score', FALSE); |
|
| 238 | 238 | } |
| 239 | 239 | } |
| 240 | 240 | |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | // Set parent element for initialization. |
| 321 | 321 | $parentContainer = !empty($this->settings['parentContainer']) ? $this->settings['parentContainer'] : '.tx-dlf-imagemanipulationtool'; |
| 322 | 322 | |
| 323 | - $this->view->assign('imageManipulation', true); |
|
| 323 | + $this->view->assign('imageManipulation', TRUE); |
|
| 324 | 324 | $this->view->assign('parentContainer', $parentContainer); |
| 325 | 325 | } |
| 326 | 326 | |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | { |
| 484 | 484 | $id = $this->document->getUid(); |
| 485 | 485 | |
| 486 | - if ($id !== null && $id > 0) { |
|
| 486 | + if ($id !== NULL && $id > 0) { |
|
| 487 | 487 | // we found the document uid |
| 488 | 488 | return (string) $id; |
| 489 | 489 | } else { |
@@ -539,9 +539,9 @@ discard block |
||
| 539 | 539 | while ($fileGrpFulltext = array_shift($fileGrpsFulltext)) { |
| 540 | 540 | $files = $this->currentDocument->physicalStructureInfo[$this->currentDocument->physicalStructure[$this->requestData['page']]]['files']; |
| 541 | 541 | if (!empty($files[$fileGrpFulltext])) { |
| 542 | - return false; |
|
| 542 | + return FALSE; |
|
| 543 | 543 | } |
| 544 | 544 | } |
| 545 | - return true; |
|
| 545 | + return TRUE; |
|
| 546 | 546 | } |
| 547 | 547 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $this->renderToolByName('renderScoreTool'); |
| 107 | 107 | break; |
| 108 | 108 | default: |
| 109 | - $this->logger->warning('Incorrect tool configuration: "' . $this->settings['tools'] . '". Tool "' . $tool . '" does not exist.'); |
|
| 109 | + $this->logger->warning('Incorrect tool configuration: "'.$this->settings['tools'].'". Tool "'.$tool.'" does not exist.'); |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | $file['url'] = $this->currentDocument->getDownloadLocation($fileId); |
| 319 | 319 | $file['mimetype'] = $this->currentDocument->getFileMimeType($fileId); |
| 320 | 320 | } else { |
| 321 | - $this->logger->warning('File not found in fileGrp "' . $fileGrp . '"'); |
|
| 321 | + $this->logger->warning('File not found in fileGrp "'.$fileGrp.'"'); |
|
| 322 | 322 | } |
| 323 | 323 | } |
| 324 | 324 | return $file; |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | empty($firstPageLink) |
| 427 | 427 | && empty($secondPageLink) |
| 428 | 428 | ) { |
| 429 | - $this->logger->warning('File not found in fileGrps "' . $this->extConf['files']['fileGrpDownload'] . '"'); |
|
| 429 | + $this->logger->warning('File not found in fileGrps "'.$this->extConf['files']['fileGrpDownload'].'"'); |
|
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | if (!empty($firstPageLink)) { |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | } |
| 465 | 465 | } |
| 466 | 466 | if (empty($workLink)) { |
| 467 | - $this->logger->warning('File not found in fileGrps "' . $this->extConf['files']['fileGrpDownload'] . '"'); |
|
| 467 | + $this->logger->warning('File not found in fileGrps "'.$this->extConf['files']['fileGrpDownload'].'"'); |
|
| 468 | 468 | } |
| 469 | 469 | return $workLink; |
| 470 | 470 | } |
@@ -158,11 +158,11 @@ discard block |
||
| 158 | 158 | if ($doc !== null) { |
| 159 | 159 | $this->document->setCurrentDocument($doc); |
| 160 | 160 | } else { |
| 161 | - $this->logger->error('Failed to load document with record ID "' . $this->requestData['recordId'] . '"'); |
|
| 161 | + $this->logger->error('Failed to load document with record ID "'.$this->requestData['recordId'].'"'); |
|
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | } else { |
| 165 | - $this->logger->error('Invalid ID "' . $documentId . '" or PID "' . $this->settings['storagePid'] . '" for document loading'); |
|
| 165 | + $this->logger->error('Invalid ID "'.$documentId.'" or PID "'.$this->settings['storagePid'].'" for document loading'); |
|
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | 168 | |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | && !MathUtility::canBeInterpretedAsInteger($this->requestData['id']) |
| 260 | 260 | && !GeneralUtility::isValidUrl($this->requestData['id']) |
| 261 | 261 | ) { |
| 262 | - $this->logger->warning('Invalid ID or URI "' . $this->requestData['id'] . '" for document loading'); |
|
| 262 | + $this->logger->warning('Invalid ID or URI "'.$this->requestData['id'].'" for document loading'); |
|
| 263 | 263 | unset($this->requestData['id']); |
| 264 | 264 | } |
| 265 | 265 | |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | $pages = []; |
| 356 | 356 | $pagesSect = []; |
| 357 | 357 | $aRange = []; |
| 358 | - $nRange = 5; // ToDo: should be made configurable |
|
| 358 | + $nRange = 5; // ToDo: should be made configurable |
|
| 359 | 359 | |
| 360 | 360 | // lower limit of the range |
| 361 | 361 | $nBottom = $currentPageNumber - $nRange; |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | |
| 371 | 371 | // check whether the first screen page is > 1, if yes then points must be added |
| 372 | 372 | if ($aRange[0] > 1) { |
| 373 | - array_push($pagesSect, ['label' => '...','startRecordNumber' => '...']); |
|
| 373 | + array_push($pagesSect, ['label' => '...', 'startRecordNumber' => '...']); |
|
| 374 | 374 | }; |
| 375 | 375 | $lastStartRecordNumberGrid = 0; // due to validity outside the loop |
| 376 | 376 | foreach (range($firstPage, $lastPage) as $i) { |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | |
| 414 | 414 | // Check if screen page is in range |
| 415 | 415 | if (in_array($i, $aRange)) { |
| 416 | - array_push($pagesSect, ['label' => $i,'startRecordNumber' => $startRecordNumber]); |
|
| 416 | + array_push($pagesSect, ['label' => $i, 'startRecordNumber' => $startRecordNumber]); |
|
| 417 | 417 | }; |
| 418 | 418 | }; |
| 419 | 419 | }; |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | if ($this->document) { |
| 477 | 477 | $doc = AbstractDocument::getInstance($this->document->getLocation(), $this->settings, true); |
| 478 | 478 | } else { |
| 479 | - $this->logger->error('Invalid UID "' . $documentId . '" or PID "' . $this->settings['storagePid'] . '" for document loading'); |
|
| 479 | + $this->logger->error('Invalid UID "'.$documentId.'" or PID "'.$this->settings['storagePid'].'" for document loading'); |
|
| 480 | 480 | } |
| 481 | 481 | |
| 482 | 482 | return $doc; |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | foreach ($this->requestData['multipleSource'] as $location) { |
| 515 | 515 | $document = AbstractDocument::getInstance($location, $this->settings, true); |
| 516 | 516 | if ($document !== null) { |
| 517 | - $this->documentArray['extra_' . $i] = $document; |
|
| 517 | + $this->documentArray['extra_'.$i] = $document; |
|
| 518 | 518 | } |
| 519 | 519 | $i++; |
| 520 | 520 | } |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | |
| 539 | 539 | $this->document->setLocation($documentId); |
| 540 | 540 | } else { |
| 541 | - $this->logger->error('Invalid location given "' . $documentId . '" for document loading'); |
|
| 541 | + $this->logger->error('Invalid location given "'.$documentId.'" for document loading'); |
|
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | return $doc; |
@@ -35,8 +35,7 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @abstract |
| 37 | 37 | */ |
| 38 | -abstract class AbstractController extends ActionController implements LoggerAwareInterface |
|
| 39 | -{ |
|
| 38 | +abstract class AbstractController extends ActionController implements LoggerAwareInterface { |
|
| 40 | 39 | use LoggerAwareTrait; |
| 41 | 40 | |
| 42 | 41 | /** |
@@ -236,8 +235,7 @@ discard block |
||
| 236 | 235 | * |
| 237 | 236 | * @return null|string|array |
| 238 | 237 | */ |
| 239 | - protected function getParametersSafely(string $parameterName) |
|
| 240 | - { |
|
| 238 | + protected function getParametersSafely(string $parameterName) { |
|
| 241 | 239 | if ($this->request->hasArgument($parameterName)) { |
| 242 | 240 | return $this->request->getArgument($parameterName); |
| 243 | 241 | } |
@@ -333,8 +331,7 @@ discard block |
||
| 333 | 331 | * |
| 334 | 332 | * @return void |
| 335 | 333 | */ |
| 336 | - public function __construct() |
|
| 337 | - { |
|
| 334 | + public function __construct() { |
|
| 338 | 335 | $this->initialize(); |
| 339 | 336 | } |
| 340 | 337 | |
@@ -375,7 +372,8 @@ discard block |
||
| 375 | 372 | $lastStartRecordNumberGrid = 0; // due to validity outside the loop |
| 376 | 373 | foreach (range($firstPage, $lastPage) as $i) { |
| 377 | 374 | // detect which pagination is active: ListView or GridView |
| 378 | - if (get_class($pagination) == 'TYPO3\CMS\Core\Pagination\SimplePagination') { // ListView |
|
| 375 | + if (get_class($pagination) == 'TYPO3\CMS\Core\Pagination\SimplePagination') { |
|
| 376 | +// ListView |
|
| 379 | 377 | $lastStartRecordNumberGrid = $i; // save last $startRecordNumber for LastPage button |
| 380 | 378 | |
| 381 | 379 | $pages[$i] = [ |
@@ -388,7 +386,8 @@ discard block |
||
| 388 | 386 | if (in_array($i, $aRange)) { |
| 389 | 387 | array_push($pagesSect, ['label' => $i, 'startRecordNumber' => $i]); |
| 390 | 388 | }; |
| 391 | - } else { // GridView |
|
| 389 | + } else { |
|
| 390 | +// GridView |
|
| 392 | 391 | // to calculate the values for generation the links for the pagination pages |
| 393 | 392 | /** @var \Kitodo\Dlf\Pagination\PageGridPaginator $paginator */ |
| 394 | 393 | $itemsPerPage = $paginator->getPublicItemsPerPage(); |
@@ -468,8 +467,7 @@ discard block |
||
| 468 | 467 | * |
| 469 | 468 | * @return AbstractDocument |
| 470 | 469 | */ |
| 471 | - private function getDocumentByUid(int $documentId) |
|
| 472 | - { |
|
| 470 | + private function getDocumentByUid(int $documentId) { |
|
| 473 | 471 | $doc = null; |
| 474 | 472 | $this->document = $this->documentRepository->findOneByIdAndSettings($documentId); |
| 475 | 473 | |
@@ -491,8 +489,7 @@ discard block |
||
| 491 | 489 | * |
| 492 | 490 | * @return AbstractDocument |
| 493 | 491 | */ |
| 494 | - protected function getDocumentByUrl(string $documentId) |
|
| 495 | - { |
|
| 492 | + protected function getDocumentByUrl(string $documentId) { |
|
| 496 | 493 | $doc = AbstractDocument::getInstance($documentId, $this->settings, true); |
| 497 | 494 | |
| 498 | 495 | if (isset($this->settings['multiViewType']) && $doc->tableOfContents[0]['type'] === $this->settings['multiViewType']) { |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | * @access protected |
| 62 | 62 | * @var Document|null This holds the current document |
| 63 | 63 | */ |
| 64 | - protected ?Document $document = null; |
|
| 64 | + protected ?Document $document = NULL; |
|
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | 67 | * @access protected |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | // Try to get document format from database |
| 138 | 138 | if (!empty($documentId)) { |
| 139 | 139 | |
| 140 | - $doc = null; |
|
| 140 | + $doc = NULL; |
|
| 141 | 141 | |
| 142 | 142 | if (MathUtility::canBeInterpretedAsInteger($documentId)) { |
| 143 | 143 | $doc = $this->getDocumentByUid($documentId); |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | $doc = $this->getDocumentByUrl($documentId); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - if ($this->document !== null && $doc !== null) { |
|
| 148 | + if ($this->document !== NULL && $doc !== NULL) { |
|
| 149 | 149 | $this->document->setCurrentDocument($doc); |
| 150 | 150 | } |
| 151 | 151 | |
@@ -153,9 +153,9 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | $this->document = $this->documentRepository->findOneByRecordId($this->requestData['recordId']); |
| 155 | 155 | |
| 156 | - if ($this->document !== null) { |
|
| 157 | - $doc = AbstractDocument::getInstance($this->document->getLocation(), $this->settings, true); |
|
| 158 | - if ($doc !== null) { |
|
| 156 | + if ($this->document !== NULL) { |
|
| 157 | + $doc = AbstractDocument::getInstance($this->document->getLocation(), $this->settings, TRUE); |
|
| 158 | + if ($doc !== NULL) { |
|
| 159 | 159 | $this->document->setCurrentDocument($doc); |
| 160 | 160 | } else { |
| 161 | 161 | $this->logger->error('Failed to load document with record ID "' . $this->requestData['recordId'] . '"'); |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | */ |
| 213 | 213 | protected function isDocMissing(): bool |
| 214 | 214 | { |
| 215 | - return $this->document === null || $this->document->getCurrentDocument() === null; |
|
| 215 | + return $this->document === NULL || $this->document->getCurrentDocument() === NULL; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /** |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | if ($this->request->hasArgument($parameterName)) { |
| 242 | 242 | return $this->request->getArgument($parameterName); |
| 243 | 243 | } |
| 244 | - return null; |
|
| 244 | + return NULL; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | /** |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | if (isset($this->settings['multiViewType']) && $this->document->getCurrentDocument()->tableOfContents[0]['type'] === $this->settings['multiViewType']) { |
| 314 | 314 | $i = 0; |
| 315 | 315 | foreach ($this->documentArray as $document) { |
| 316 | - if ($document !== null) { |
|
| 316 | + if ($document !== NULL) { |
|
| 317 | 317 | $this->requestData['docPage'][$i] = MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i], 1, $document->numPages, 1); |
| 318 | 318 | $i++; |
| 319 | 319 | } |
@@ -424,8 +424,8 @@ discard block |
||
| 424 | 424 | }; |
| 425 | 425 | |
| 426 | 426 | // Safely get the next and previous page numbers |
| 427 | - $nextPageNumber = isset($pages[$currentPageNumber + 1]) ? $pages[$currentPageNumber + 1]['startRecordNumber'] : null; |
|
| 428 | - $previousPageNumber = isset($pages[$currentPageNumber - 1]) ? $pages[$currentPageNumber - 1]['startRecordNumber'] : null; |
|
| 427 | + $nextPageNumber = isset($pages[$currentPageNumber + 1]) ? $pages[$currentPageNumber + 1]['startRecordNumber'] : NULL; |
|
| 428 | + $previousPageNumber = isset($pages[$currentPageNumber - 1]) ? $pages[$currentPageNumber - 1]['startRecordNumber'] : NULL; |
|
| 429 | 429 | |
| 430 | 430 | // 'startRecordNumber' is not required in GridView, only the variant for each loop is required |
| 431 | 431 | // 'endRecordNumber' is not required in both views |
@@ -470,11 +470,11 @@ discard block |
||
| 470 | 470 | */ |
| 471 | 471 | private function getDocumentByUid(int $documentId) |
| 472 | 472 | { |
| 473 | - $doc = null; |
|
| 473 | + $doc = NULL; |
|
| 474 | 474 | $this->document = $this->documentRepository->findOneByIdAndSettings($documentId); |
| 475 | 475 | |
| 476 | 476 | if ($this->document) { |
| 477 | - $doc = AbstractDocument::getInstance($this->document->getLocation(), $this->settings, true); |
|
| 477 | + $doc = AbstractDocument::getInstance($this->document->getLocation(), $this->settings, TRUE); |
|
| 478 | 478 | } else { |
| 479 | 479 | $this->logger->error('Invalid UID "' . $documentId . '" or PID "' . $this->settings['storagePid'] . '" for document loading'); |
| 480 | 480 | } |
@@ -493,13 +493,13 @@ discard block |
||
| 493 | 493 | */ |
| 494 | 494 | protected function getDocumentByUrl(string $documentId) |
| 495 | 495 | { |
| 496 | - $doc = AbstractDocument::getInstance($documentId, $this->settings, true); |
|
| 496 | + $doc = AbstractDocument::getInstance($documentId, $this->settings, TRUE); |
|
| 497 | 497 | |
| 498 | 498 | if (isset($this->settings['multiViewType']) && $doc->tableOfContents[0]['type'] === $this->settings['multiViewType']) { |
| 499 | 499 | $childDocuments = $doc->tableOfContents[0]['children']; |
| 500 | 500 | $i = 0; |
| 501 | 501 | foreach ($childDocuments as $document) { |
| 502 | - $this->documentArray[] = AbstractDocument::getInstance($document['points'], $this->settings, true); |
|
| 502 | + $this->documentArray[] = AbstractDocument::getInstance($document['points'], $this->settings, TRUE); |
|
| 503 | 503 | if (!isset($this->requestData['docPage'][$i]) && isset(explode('#', $document['points'])[1])) { |
| 504 | 504 | $initPage = explode('#', $document['points'])[1]; |
| 505 | 505 | $this->requestData['docPage'][$i] = $initPage; |
@@ -512,21 +512,21 @@ discard block |
||
| 512 | 512 | if ($this->requestData['multipleSource'] && is_array($this->requestData['multipleSource'])) { |
| 513 | 513 | $i = 0; |
| 514 | 514 | foreach ($this->requestData['multipleSource'] as $location) { |
| 515 | - $document = AbstractDocument::getInstance($location, $this->settings, true); |
|
| 516 | - if ($document !== null) { |
|
| 515 | + $document = AbstractDocument::getInstance($location, $this->settings, TRUE); |
|
| 516 | + if ($document !== NULL) { |
|
| 517 | 517 | $this->documentArray['extra_' . $i] = $document; |
| 518 | 518 | } |
| 519 | 519 | $i++; |
| 520 | 520 | } |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | - if ($doc !== null) { |
|
| 523 | + if ($doc !== NULL) { |
|
| 524 | 524 | $this->document = GeneralUtility::makeInstance(Document::class); |
| 525 | 525 | |
| 526 | 526 | if ($doc->recordId) { |
| 527 | 527 | // find document from repository by recordId |
| 528 | 528 | $docFromRepository = $this->documentRepository->findOneByRecordId($doc->recordId); |
| 529 | - if ($docFromRepository !== null) { |
|
| 529 | + if ($docFromRepository !== NULL) { |
|
| 530 | 530 | $this->document = $docFromRepository; |
| 531 | 531 | } |
| 532 | 532 | } |
@@ -30,8 +30,7 @@ discard block |
||
| 30 | 30 | * |
| 31 | 31 | * @access public |
| 32 | 32 | */ |
| 33 | -class PageViewController extends AbstractController |
|
| 34 | -{ |
|
| 33 | +class PageViewController extends AbstractController { |
|
| 35 | 34 | /** |
| 36 | 35 | * @access protected |
| 37 | 36 | * @var array Holds the controls to add to the map |
@@ -256,8 +255,7 @@ discard block |
||
| 256 | 255 | * @param $page |
| 257 | 256 | * @return false|int|mixed|string|null |
| 258 | 257 | */ |
| 259 | - public function convertMeasureOrPage($document, $measure = null, $page = null) |
|
| 260 | - { |
|
| 258 | + public function convertMeasureOrPage($document, $measure = null, $page = null) { |
|
| 261 | 259 | $return = null; |
| 262 | 260 | $measure2Page = array_column($document->musicalStructure, 'page'); |
| 263 | 261 | if ($measure) { |
@@ -273,8 +271,7 @@ discard block |
||
| 273 | 271 | * Action to add multiple mets sources (multi page view) |
| 274 | 272 | * @return void |
| 275 | 273 | */ |
| 276 | - public function addDocumentAction(FormAddDocument $formAddDocument) |
|
| 277 | - { |
|
| 274 | + public function addDocumentAction(FormAddDocument $formAddDocument) { |
|
| 278 | 275 | if (GeneralUtility::isValidUrl($formAddDocument->getLocation())) { |
| 279 | 276 | $nextMultipleSourceKey = 0; |
| 280 | 277 | if ($this->requestData['multipleSource']) { |
@@ -367,8 +364,7 @@ discard block |
||
| 367 | 364 | * |
| 368 | 365 | * @return array URL and MIME type of fulltext file |
| 369 | 366 | */ |
| 370 | - protected function getScore(int $page, MetsDocument $specificDoc = null) |
|
| 371 | - { |
|
| 367 | + protected function getScore(int $page, MetsDocument $specificDoc = null) { |
|
| 372 | 368 | $score = []; |
| 373 | 369 | $loc = ''; |
| 374 | 370 | if ($specificDoc) { |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | // convert either page or measure if requestData exists |
| 175 | 175 | if ($this->requestData['docPage'][$i] && empty($this->requestData['docMeasure'][$i])) { |
| 176 | 176 | // convert document page information to measure count information |
| 177 | - $this->requestData['docMeasure'][$i] = $this->convertMeasureOrPage($document, null, $this->requestData['docPage'][$i]); |
|
| 177 | + $this->requestData['docMeasure'][$i] = $this->convertMeasureOrPage($document, NULL, $this->requestData['docPage'][$i]); |
|
| 178 | 178 | |
| 179 | 179 | } elseif ((empty($this->requestData['docPage'][$i]) || $this->requestData['docPage'][$i] === 1) && $this->requestData['docMeasure'][$i]) { |
| 180 | 180 | $this->requestData['docPage'][$i] = $this->convertMeasureOrPage($document, $this->requestData['docMeasure'][$i]); |
@@ -256,9 +256,9 @@ discard block |
||
| 256 | 256 | * @param $page |
| 257 | 257 | * @return false|int|mixed|string|null |
| 258 | 258 | */ |
| 259 | - public function convertMeasureOrPage($document, $measure = null, $page = null) |
|
| 259 | + public function convertMeasureOrPage($document, $measure = NULL, $page = NULL) |
|
| 260 | 260 | { |
| 261 | - $return = null; |
|
| 261 | + $return = NULL; |
|
| 262 | 262 | $measure2Page = array_column($document->musicalStructure, 'page'); |
| 263 | 263 | if ($measure) { |
| 264 | 264 | $return = $measure2Page[$measure]; |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | * @param int|null $docNumber |
| 304 | 304 | * @return array |
| 305 | 305 | */ |
| 306 | - protected function getMeasures(int $page, MetsDocument $specificDoc = null, $docNumber = null): array |
|
| 306 | + protected function getMeasures(int $page, MetsDocument $specificDoc = NULL, $docNumber = NULL): array |
|
| 307 | 307 | { |
| 308 | 308 | if ($specificDoc) { |
| 309 | 309 | $doc = $specificDoc; |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | * |
| 368 | 368 | * @return array URL and MIME type of fulltext file |
| 369 | 369 | */ |
| 370 | - protected function getScore(int $page, MetsDocument $specificDoc = null) |
|
| 370 | + protected function getScore(int $page, MetsDocument $specificDoc = NULL) |
|
| 371 | 371 | { |
| 372 | 372 | $score = []; |
| 373 | 373 | $loc = ''; |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | // Configure @action URL for form. |
| 398 | 398 | $uri = $this->uriBuilder->reset() |
| 399 | 399 | ->setTargetPageUid($this->pageUid) |
| 400 | - ->setCreateAbsoluteUri(!empty($this->settings['forceAbsoluteUrl']) ? true : false) |
|
| 400 | + ->setCreateAbsoluteUri(!empty($this->settings['forceAbsoluteUrl']) ? TRUE : FALSE) |
|
| 401 | 401 | ->setArguments( |
| 402 | 402 | [ |
| 403 | 403 | 'eID' => 'tx_dlf_pageview_proxy', |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | $jsViewer = 'tx_dlf_viewer = [];'; |
| 467 | 467 | $i = 0; |
| 468 | 468 | foreach ($this->documentArray as $document) { |
| 469 | - if ($document !== null) { |
|
| 469 | + if ($document !== NULL) { |
|
| 470 | 470 | $docPage = $this->requestData['docPage'][$i]; |
| 471 | 471 | $docImage = []; |
| 472 | 472 | $docFulltext = []; |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | $docPage = $measure2Page[$this->requestData['docMeasure'][$i]]; |
| 481 | 481 | } |
| 482 | 482 | } |
| 483 | - if ($docPage == null) { |
|
| 483 | + if ($docPage == NULL) { |
|
| 484 | 484 | $docPage = 1; |
| 485 | 485 | } |
| 486 | 486 | $docImage[0] = $this->getImage($docPage, $document); |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | if ($iiif instanceof ManifestInterface) { |
| 568 | 568 | $canvas = $iiif->getContainedResourceById($canvasId); |
| 569 | 569 | /* @var $canvas \Ubl\Iiif\Presentation\Common\Model\Resources\CanvasInterface */ |
| 570 | - if ($canvas != null && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
|
| 570 | + if ($canvas != NULL && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
|
| 571 | 571 | $annotationContainers = []; |
| 572 | 572 | /* |
| 573 | 573 | * TODO Analyzing the annotations on the server side requires loading the annotation lists / pages |
@@ -577,11 +577,11 @@ discard block |
||
| 577 | 577 | * On the other hand, server connections are potentially better than client connections. Downloading annotation lists |
| 578 | 578 | */ |
| 579 | 579 | foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) { |
| 580 | - if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != null) { |
|
| 580 | + if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != NULL) { |
|
| 581 | 581 | foreach ($textAnnotations as $annotation) { |
| 582 | 582 | if ( |
| 583 | 583 | $annotation->getBody()->getFormat() == 'text/plain' |
| 584 | - && $annotation->getBody()->getChars() != null |
|
| 584 | + && $annotation->getBody()->getChars() != NULL |
|
| 585 | 585 | ) { |
| 586 | 586 | $annotationListData = []; |
| 587 | 587 | $annotationListData['uri'] = $annotationContainer->getId(); |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | * |
| 619 | 619 | * @return array URL and MIME type of image file |
| 620 | 620 | */ |
| 621 | - protected function getImage(int $page, MetsDocument $specificDoc = null): array |
|
| 621 | + protected function getImage(int $page, MetsDocument $specificDoc = NULL): array |
|
| 622 | 622 | { |
| 623 | 623 | $image = []; |
| 624 | 624 | // Get @USE value of METS fileGrp. |
@@ -181,18 +181,18 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | $navigationArray[$i]['next'] = [ |
| 184 | - 'tx_dlf[docPage][' . $i . ']' => |
|
| 184 | + 'tx_dlf[docPage]['.$i.']' => |
|
| 185 | 185 | MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i] + 1, 1, $document->numPages, 1) |
| 186 | 186 | ]; |
| 187 | 187 | $navigationArray[$i]['prev'] = [ |
| 188 | - 'tx_dlf[docPage][' . $i . ']' => |
|
| 188 | + 'tx_dlf[docPage]['.$i.']' => |
|
| 189 | 189 | MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i] - 1, 1, $document->numPages, 1) |
| 190 | 190 | ]; |
| 191 | 191 | |
| 192 | 192 | $navigateAllPageNext = array_merge( |
| 193 | 193 | $navigateAllPageNext, |
| 194 | 194 | [ |
| 195 | - 'tx_dlf[docPage][' . $i . ']' => |
|
| 195 | + 'tx_dlf[docPage]['.$i.']' => |
|
| 196 | 196 | MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i] + 1, 1, $document->numPages, 1) |
| 197 | 197 | ] |
| 198 | 198 | ); |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $navigateAllPagePrev = array_merge( |
| 201 | 201 | $navigateAllPagePrev, |
| 202 | 202 | [ |
| 203 | - 'tx_dlf[docPage][' . $i . ']' => |
|
| 203 | + 'tx_dlf[docPage]['.$i.']' => |
|
| 204 | 204 | MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i] - 1, 1, $document->numPages, 1) |
| 205 | 205 | ] |
| 206 | 206 | ); |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | $navigateAllMeasureNext = array_merge( |
| 209 | 209 | $navigateAllMeasureNext, |
| 210 | 210 | [ |
| 211 | - 'tx_dlf[docMeasure][' . $i . ']' => |
|
| 211 | + 'tx_dlf[docMeasure]['.$i.']' => |
|
| 212 | 212 | MathUtility::forceIntegerInRange((int) $this->requestData['docMeasure'][$i] + 1, 1, $document->numMeasures, 1) |
| 213 | 213 | ] |
| 214 | 214 | ); |
@@ -216,19 +216,19 @@ discard block |
||
| 216 | 216 | $navigateAllMeasurePrev = array_merge( |
| 217 | 217 | $navigateAllMeasurePrev, |
| 218 | 218 | [ |
| 219 | - 'tx_dlf[docMeasure][' . $i . ']' => |
|
| 219 | + 'tx_dlf[docMeasure]['.$i.']' => |
|
| 220 | 220 | MathUtility::forceIntegerInRange((int) $this->requestData['docMeasure'][$i] - 1, 1, $document->numMeasures, 1) |
| 221 | 221 | ] |
| 222 | 222 | ); |
| 223 | 223 | |
| 224 | 224 | if ($document->numMeasures > 0) { |
| 225 | 225 | $navigationMeasureArray[$i]['next'] = [ |
| 226 | - 'tx_dlf[docMeasure][' . $i . ']' => |
|
| 226 | + 'tx_dlf[docMeasure]['.$i.']' => |
|
| 227 | 227 | MathUtility::forceIntegerInRange((int) $this->requestData['docMeasure'][$i] + 1, 1, $document->numMeasures, 1) |
| 228 | 228 | ]; |
| 229 | 229 | |
| 230 | 230 | $navigationMeasureArray[$i]['prev'] = [ |
| 231 | - 'tx_dlf[docMeasure][' . $i . ']' => |
|
| 231 | + 'tx_dlf[docMeasure]['.$i.']' => |
|
| 232 | 232 | MathUtility::forceIntegerInRange((int) $this->requestData['docMeasure'][$i] - 1, 1, $document->numMeasures, 1) |
| 233 | 233 | ]; |
| 234 | 234 | } |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | } |
| 283 | 283 | $params = array_merge( |
| 284 | 284 | ['tx_dlf' => $this->requestData], |
| 285 | - ['tx_dlf[multipleSource][' . $nextMultipleSourceKey . ']' => $formAddDocument->getLocation()], |
|
| 285 | + ['tx_dlf[multipleSource]['.$nextMultipleSourceKey.']' => $formAddDocument->getLocation()], |
|
| 286 | 286 | ['tx_dlf[multiview]' => 1] |
| 287 | 287 | ); |
| 288 | 288 | $uriBuilder = $this->uriBuilder; |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | // build link for each measure |
| 330 | 330 | $params = [ |
| 331 | 331 | 'tx_dlf' => $this->requestData, |
| 332 | - 'tx_dlf[docMeasure][' . $docNumber . ']' => $i |
|
| 332 | + 'tx_dlf[docMeasure]['.$docNumber.']' => $i |
|
| 333 | 333 | ]; |
| 334 | 334 | } else { |
| 335 | 335 | // build link for each measure |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | if (empty($score)) { |
| 416 | - $this->logger->notice('No score file found for page "' . $page . '" in fileGrps "' . $this->settings['fileGrpScore'] . '"'); |
|
| 416 | + $this->logger->notice('No score file found for page "'.$page.'" in fileGrps "'.$this->settings['fileGrpScore'].'"'); |
|
| 417 | 417 | } |
| 418 | 418 | return $score; |
| 419 | 419 | } |
@@ -444,11 +444,11 @@ discard block |
||
| 444 | 444 | $fulltext['mimetype'] = $file['mimeType']; |
| 445 | 445 | break; |
| 446 | 446 | } else { |
| 447 | - $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrp "' . $fileGrpFulltext . '"'); |
|
| 447 | + $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrp "'.$fileGrpFulltext.'"'); |
|
| 448 | 448 | } |
| 449 | 449 | } |
| 450 | 450 | if (empty($fulltext)) { |
| 451 | - $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrps "' . $this->extConf['files']['fileGrpFulltext'] . '"'); |
|
| 451 | + $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrps "'.$this->extConf['files']['fileGrpFulltext'].'"'); |
|
| 452 | 452 | } |
| 453 | 453 | return $fulltext; |
| 454 | 454 | } |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | 'measureIdLinks' => $docMeasures['measureLinks'] |
| 509 | 509 | ]; |
| 510 | 510 | |
| 511 | - $jsViewer .= 'tx_dlf_viewer[' . $i . '] = new dlfViewer(' . json_encode($viewer) . '); |
|
| 511 | + $jsViewer .= 'tx_dlf_viewer['.$i.'] = new dlfViewer('.json_encode($viewer).'); |
|
| 512 | 512 | '; |
| 513 | 513 | $i++; |
| 514 | 514 | } |
@@ -517,8 +517,8 @@ discard block |
||
| 517 | 517 | // Viewer configuration. |
| 518 | 518 | $viewerConfiguration = '$(document).ready(function() { |
| 519 | 519 | if (dlfUtils.exists(dlfViewer)) { |
| 520 | - ' . $jsViewer . ' |
|
| 521 | - viewerCount = ' . ($i - 1) . '; |
|
| 520 | + ' . $jsViewer.' |
|
| 521 | + viewerCount = ' . ($i - 1).'; |
|
| 522 | 522 | } |
| 523 | 523 | });'; |
| 524 | 524 | } else { |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | // Viewer configuration. |
| 549 | 549 | $viewerConfiguration = '$(document).ready(function() { |
| 550 | 550 | if (dlfUtils.exists(dlfViewer)) { |
| 551 | - tx_dlf_viewer = new dlfViewer(' . json_encode($viewer) . '); |
|
| 551 | + tx_dlf_viewer = new dlfViewer(' . json_encode($viewer).'); |
|
| 552 | 552 | } |
| 553 | 553 | });'; |
| 554 | 554 | } |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | } |
| 645 | 645 | break; |
| 646 | 646 | } else { |
| 647 | - $this->logger->notice('No image file found for page "' . $page . '" in fileGrp "' . $fileGrpImages . '"'); |
|
| 647 | + $this->logger->notice('No image file found for page "'.$page.'" in fileGrp "'.$fileGrpImages.'"'); |
|
| 648 | 648 | } |
| 649 | 649 | |
| 650 | 650 | } else { |
@@ -664,12 +664,12 @@ discard block |
||
| 664 | 664 | } |
| 665 | 665 | break; |
| 666 | 666 | } else { |
| 667 | - $this->logger->notice('No image file found for page "' . $page . '" in fileGrp "' . $fileGrpImages . '"'); |
|
| 667 | + $this->logger->notice('No image file found for page "'.$page.'" in fileGrp "'.$fileGrpImages.'"'); |
|
| 668 | 668 | } |
| 669 | 669 | } |
| 670 | 670 | } |
| 671 | 671 | if (empty($image)) { |
| 672 | - $this->logger->warning('No image file found for page "' . $page . '" in fileGrps "' . $this->extConf['files']['fileGrpImages'] . '"'); |
|
| 672 | + $this->logger->warning('No image file found for page "'.$page.'" in fileGrps "'.$this->extConf['files']['fileGrpImages'].'"'); |
|
| 673 | 673 | } |
| 674 | 674 | return $image; |
| 675 | 675 | } |
@@ -21,15 +21,13 @@ |
||
| 21 | 21 | * @subpackage dlf |
| 22 | 22 | * @access public |
| 23 | 23 | */ |
| 24 | -class AnnotationController extends AbstractController |
|
| 25 | -{ |
|
| 24 | +class AnnotationController extends AbstractController { |
|
| 26 | 25 | /** |
| 27 | 26 | * The main method of the plugin |
| 28 | 27 | * |
| 29 | 28 | * @return void |
| 30 | 29 | */ |
| 31 | - public function mainAction() |
|
| 32 | - { |
|
| 30 | + public function mainAction() { |
|
| 33 | 31 | $this->loadDocument(); |
| 34 | 32 | |
| 35 | 33 | if ( |
@@ -33,8 +33,8 @@ |
||
| 33 | 33 | $this->loadDocument(); |
| 34 | 34 | |
| 35 | 35 | if ( |
| 36 | - $this->document === null |
|
| 37 | - || $this->document->getCurrentDocument() === null |
|
| 36 | + $this->document === NULL |
|
| 37 | + || $this->document->getCurrentDocument() === NULL |
|
| 38 | 38 | ) { |
| 39 | 39 | // Quit without doing anything if required variables are not set. |
| 40 | 40 | return; |
@@ -18,10 +18,8 @@ discard block |
||
| 18 | 18 | /** |
| 19 | 19 | * Checks if the given subject is an array. |
| 20 | 20 | */ |
| 21 | -class IsArrayViewHelper extends AbstractViewHelper |
|
| 22 | -{ |
|
| 23 | - public function initializeArguments() |
|
| 24 | - { |
|
| 21 | +class IsArrayViewHelper extends AbstractViewHelper { |
|
| 22 | + public function initializeArguments() { |
|
| 25 | 23 | parent::initializeArguments(); |
| 26 | 24 | $this->registerArgument('subject', 'string', 'The subject'); |
| 27 | 25 | } |
@@ -29,8 +27,7 @@ discard block |
||
| 29 | 27 | /** |
| 30 | 28 | * @return bool |
| 31 | 29 | */ |
| 32 | - public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) |
|
| 33 | - { |
|
| 30 | + public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) { |
|
| 34 | 31 | $subject = $arguments['subject']; |
| 35 | 32 | if ($subject === null) { |
| 36 | 33 | $subject = $renderChildrenClosure(); |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) |
| 33 | 33 | { |
| 34 | 34 | $subject = $arguments['subject']; |
| 35 | - if ($subject === null) { |
|
| 35 | + if ($subject === NULL) { |
|
| 36 | 36 | $subject = $renderChildrenClosure(); |
| 37 | 37 | } |
| 38 | 38 | |