@@ -12,352 +12,352 @@ |
||
| 12 | 12 | // Define structure elements. |
| 13 | 13 | // @see http://dfg-viewer.de/en/structural-data-set/ |
| 14 | 14 | $structures = array ( |
| 15 | - 'act' => array ( |
|
| 16 | - 'toplevel' => 1, |
|
| 17 | - 'oai_name' => '', |
|
| 18 | - ), |
|
| 19 | - 'additional' => array ( |
|
| 20 | - 'toplevel' => 0, |
|
| 21 | - 'oai_name' => '' |
|
| 22 | - ), |
|
| 23 | - 'address' => array ( |
|
| 24 | - 'toplevel' => 0, |
|
| 25 | - 'oai_name' => '' |
|
| 26 | - ), |
|
| 27 | - 'album' => array ( |
|
| 28 | - 'toplevel' => 1, |
|
| 29 | - 'oai_name' => '', |
|
| 30 | - ), |
|
| 31 | - 'annotation' => array ( |
|
| 32 | - 'toplevel' => 0, |
|
| 33 | - 'oai_name' => '' |
|
| 34 | - ), |
|
| 35 | - 'article' => array ( |
|
| 36 | - 'toplevel' => 0, |
|
| 37 | - 'oai_name' => '' |
|
| 38 | - ), |
|
| 39 | - 'atlas' => array ( |
|
| 40 | - 'toplevel' => 1, |
|
| 41 | - 'oai_name' => '', |
|
| 42 | - ), |
|
| 43 | - 'bachelor_thesis' => array ( |
|
| 44 | - 'toplevel' => 1, |
|
| 45 | - 'oai_name' => '', |
|
| 46 | - ), |
|
| 47 | - 'binding' => array ( |
|
| 48 | - 'toplevel' => 0, |
|
| 49 | - 'oai_name' => '' |
|
| 50 | - ), |
|
| 51 | - 'bookplate' => array ( |
|
| 52 | - 'toplevel' => 0, |
|
| 53 | - 'oai_name' => '' |
|
| 54 | - ), |
|
| 55 | - 'cartulary' => array ( |
|
| 56 | - 'toplevel' => 1, |
|
| 57 | - 'oai_name' => '', |
|
| 58 | - ), |
|
| 59 | - 'chapter' => array ( |
|
| 60 | - 'toplevel' => 0, |
|
| 61 | - 'oai_name' => '' |
|
| 62 | - ), |
|
| 63 | - 'collation' => array ( |
|
| 64 | - 'toplevel' => 0, |
|
| 65 | - 'oai_name' => '' |
|
| 66 | - ), |
|
| 67 | - 'colophon' => array ( |
|
| 68 | - 'toplevel' => 0, |
|
| 69 | - 'oai_name' => '' |
|
| 70 | - ), |
|
| 71 | - 'contained_work' => array ( |
|
| 72 | - 'toplevel' => 0, |
|
| 73 | - 'oai_name' => '' |
|
| 74 | - ), |
|
| 75 | - 'contents' => array ( |
|
| 76 | - 'toplevel' => 0, |
|
| 77 | - 'oai_name' => '' |
|
| 78 | - ), |
|
| 79 | - 'corrigenda' => array ( |
|
| 80 | - 'toplevel' => 0, |
|
| 81 | - 'oai_name' => '' |
|
| 82 | - ), |
|
| 83 | - 'cover' => array ( |
|
| 84 | - 'toplevel' => 0, |
|
| 85 | - 'oai_name' => '' |
|
| 86 | - ), |
|
| 87 | - 'cover_front' => array ( |
|
| 88 | - 'toplevel' => 0, |
|
| 89 | - 'oai_name' => '' |
|
| 90 | - ), |
|
| 91 | - 'cover_back' => array ( |
|
| 92 | - 'toplevel' => 0, |
|
| 93 | - 'oai_name' => '' |
|
| 94 | - ), |
|
| 95 | - 'day' => array ( |
|
| 96 | - 'toplevel' => 0, |
|
| 97 | - 'oai_name' => '' |
|
| 98 | - ), |
|
| 99 | - 'dedication' => array ( |
|
| 100 | - 'toplevel' => 0, |
|
| 101 | - 'oai_name' => '' |
|
| 102 | - ), |
|
| 103 | - 'diploma_thesis' => array ( |
|
| 104 | - 'toplevel' => 1, |
|
| 105 | - 'oai_name' => '', |
|
| 106 | - ), |
|
| 107 | - 'doctoral_thesis' => array ( |
|
| 108 | - 'toplevel' => 1, |
|
| 109 | - 'oai_name' => '', |
|
| 110 | - ), |
|
| 111 | - 'document' => array ( |
|
| 112 | - 'toplevel' => 1, |
|
| 113 | - 'oai_name' => '', |
|
| 114 | - ), |
|
| 115 | - 'dossier' => array ( |
|
| 116 | - 'toplevel' => 1, |
|
| 117 | - 'oai_name' => '', |
|
| 118 | - ), |
|
| 119 | - 'edge' => array ( |
|
| 120 | - 'toplevel' => 0, |
|
| 121 | - 'oai_name' => '' |
|
| 122 | - ), |
|
| 123 | - 'endsheet' => array ( |
|
| 124 | - 'toplevel' => 0, |
|
| 125 | - 'oai_name' => '' |
|
| 126 | - ), |
|
| 127 | - 'engraved_titlepage' => array ( |
|
| 128 | - 'toplevel' => 0, |
|
| 129 | - 'oai_name' => '' |
|
| 130 | - ), |
|
| 131 | - 'entry' => array ( |
|
| 132 | - 'toplevel' => 0, |
|
| 133 | - 'oai_name' => '' |
|
| 134 | - ), |
|
| 135 | - 'fascicle' => array ( |
|
| 136 | - 'toplevel' => 0, |
|
| 137 | - 'oai_name' => '' |
|
| 138 | - ), |
|
| 139 | - 'file' => array ( |
|
| 140 | - 'toplevel' => 1, |
|
| 141 | - 'oai_name' => '', |
|
| 142 | - ), |
|
| 143 | - 'folder' => array ( |
|
| 144 | - 'toplevel' => 1, |
|
| 145 | - 'oai_name' => '', |
|
| 146 | - ), |
|
| 147 | - 'fragment' => array ( |
|
| 148 | - 'toplevel' => 1, |
|
| 149 | - 'oai_name' => '' |
|
| 150 | - ), |
|
| 151 | - 'ground_plan' => array ( |
|
| 152 | - 'toplevel' => 1, |
|
| 153 | - 'oai_name' => '', |
|
| 154 | - ), |
|
| 155 | - 'habilitation_thesis' => array ( |
|
| 156 | - 'toplevel' => 1, |
|
| 157 | - 'oai_name' => '', |
|
| 158 | - ), |
|
| 159 | - 'illustration' => array ( |
|
| 160 | - 'toplevel' => 0, |
|
| 161 | - 'oai_name' => '' |
|
| 162 | - ), |
|
| 163 | - 'image' => array ( |
|
| 164 | - 'toplevel' => 1, |
|
| 165 | - 'oai_name' => '', |
|
| 166 | - ), |
|
| 167 | - 'imprint' => array ( |
|
| 168 | - 'toplevel' => 0, |
|
| 169 | - 'oai_name' => '' |
|
| 170 | - ), |
|
| 171 | - 'index' => array ( |
|
| 172 | - 'toplevel' => 0, |
|
| 173 | - 'oai_name' => '' |
|
| 174 | - ), |
|
| 175 | - 'initial_decoration' => array ( |
|
| 176 | - 'toplevel' => 0, |
|
| 177 | - 'oai_name' => '' |
|
| 178 | - ), |
|
| 179 | - 'issue' => array ( |
|
| 180 | - 'toplevel' => 0, |
|
| 181 | - 'oai_name' => '' |
|
| 182 | - ), |
|
| 183 | - 'judgement' => array ( |
|
| 184 | - 'toplevel' => 1, |
|
| 185 | - 'oai_name' => '', |
|
| 186 | - ), |
|
| 187 | - 'land_register' => array ( |
|
| 188 | - 'toplevel' => 1, |
|
| 189 | - 'oai_name' => '', |
|
| 190 | - ), |
|
| 191 | - 'leaflet' => array ( |
|
| 192 | - 'toplevel' => 1, |
|
| 193 | - 'oai_name' => '', |
|
| 194 | - ), |
|
| 195 | - 'lecture' => array ( |
|
| 196 | - 'toplevel' => 1, |
|
| 197 | - 'oai_name' => '', |
|
| 198 | - ), |
|
| 199 | - 'letter' => array ( |
|
| 200 | - 'toplevel' => 0, |
|
| 201 | - 'oai_name' => '', |
|
| 202 | - ), |
|
| 203 | - 'magister_thesis' => array ( |
|
| 204 | - 'toplevel' => 1, |
|
| 205 | - 'oai_name' => '', |
|
| 206 | - ), |
|
| 207 | - 'master_thesis' => array ( |
|
| 208 | - 'toplevel' => 1, |
|
| 209 | - 'oai_name' => '', |
|
| 210 | - ), |
|
| 211 | - 'manuscript' => array ( |
|
| 212 | - 'toplevel' => 1, |
|
| 213 | - 'oai_name' => '' |
|
| 214 | - ), |
|
| 215 | - 'map' => array ( |
|
| 216 | - 'toplevel' => 0, |
|
| 217 | - 'oai_name' => '' |
|
| 218 | - ), |
|
| 219 | - 'monograph' => array ( |
|
| 220 | - 'toplevel' => 1, |
|
| 221 | - 'oai_name' => '' |
|
| 222 | - ), |
|
| 223 | - 'month' => array ( |
|
| 224 | - 'toplevel' => 0, |
|
| 225 | - 'oai_name' => '' |
|
| 226 | - ), |
|
| 227 | - 'multivolume_work' => array ( |
|
| 228 | - 'toplevel' => 1, |
|
| 229 | - 'oai_name' => '' |
|
| 230 | - ), |
|
| 231 | - 'musical_notation' => array ( |
|
| 232 | - 'toplevel' => 0, |
|
| 233 | - 'oai_name' => '' |
|
| 234 | - ), |
|
| 235 | - 'newspaper' => array ( |
|
| 236 | - 'toplevel' => 1, |
|
| 237 | - 'oai_name' => '' |
|
| 238 | - ), |
|
| 239 | - 'note' => array ( |
|
| 240 | - 'toplevel' => 0, |
|
| 241 | - 'oai_name' => '', |
|
| 242 | - ), |
|
| 243 | - 'official_notification' => array ( |
|
| 244 | - 'toplevel' => 1, |
|
| 245 | - 'oai_name' => '', |
|
| 246 | - ), |
|
| 247 | - 'ornament' => array ( |
|
| 248 | - 'toplevel' => 0, |
|
| 249 | - 'oai_name' => '' |
|
| 250 | - ), |
|
| 251 | - 'paper' => array ( |
|
| 252 | - 'toplevel' => 1, |
|
| 253 | - 'oai_name' => '', |
|
| 254 | - ), |
|
| 255 | - 'paste_down' => array ( |
|
| 256 | - 'toplevel' => 0, |
|
| 257 | - 'oai_name' => '' |
|
| 258 | - ), |
|
| 259 | - 'periodical' => array ( |
|
| 260 | - 'toplevel' => 1, |
|
| 261 | - 'oai_name' => '' |
|
| 262 | - ), |
|
| 263 | - 'photograph' => array ( |
|
| 264 | - 'toplevel' => 1, |
|
| 265 | - 'oai_name' => '', |
|
| 266 | - ), |
|
| 267 | - 'plan' => array ( |
|
| 268 | - 'toplevel' => 1, |
|
| 269 | - 'oai_name' => '', |
|
| 270 | - ), |
|
| 271 | - 'poster' => array ( |
|
| 272 | - 'toplevel' => 1, |
|
| 273 | - 'oai_name' => '', |
|
| 274 | - ), |
|
| 275 | - 'preface' => array ( |
|
| 276 | - 'toplevel' => 0, |
|
| 277 | - 'oai_name' => '' |
|
| 278 | - ), |
|
| 279 | - 'preprint' => array ( |
|
| 280 | - 'toplevel' => 1, |
|
| 281 | - 'oai_name' => '', |
|
| 282 | - ), |
|
| 283 | - 'printed_archives' => array ( |
|
| 284 | - 'toplevel' => 1, |
|
| 285 | - 'oai_name' => '', |
|
| 286 | - ), |
|
| 287 | - 'printers_mark' => array ( |
|
| 288 | - 'toplevel' => 0, |
|
| 289 | - 'oai_name' => '' |
|
| 290 | - ), |
|
| 291 | - 'privileges' => array ( |
|
| 292 | - 'toplevel' => 0, |
|
| 293 | - 'oai_name' => '' |
|
| 294 | - ), |
|
| 295 | - 'proceeding' => array ( |
|
| 296 | - 'toplevel' => 1, |
|
| 297 | - 'oai_name' => '', |
|
| 298 | - ), |
|
| 299 | - 'provenance' => array ( |
|
| 300 | - 'toplevel' => 0, |
|
| 301 | - 'oai_name' => '' |
|
| 302 | - ), |
|
| 303 | - 'register' => array ( |
|
| 304 | - 'toplevel' => 1, |
|
| 305 | - 'oai_name' => '', |
|
| 306 | - ), |
|
| 307 | - 'report' => array ( |
|
| 308 | - 'toplevel' => 1, |
|
| 309 | - 'oai_name' => '', |
|
| 310 | - ), |
|
| 311 | - 'research_paper' => array ( |
|
| 312 | - 'toplevel' => 1, |
|
| 313 | - 'oai_name' => '', |
|
| 314 | - ), |
|
| 315 | - 'scheme' => array ( |
|
| 316 | - 'toplevel' => 0, |
|
| 317 | - 'oai_name' => '' |
|
| 318 | - ), |
|
| 319 | - 'seal' => array ( |
|
| 320 | - 'toplevel' => 0, |
|
| 321 | - 'oai_name' => '', |
|
| 322 | - ), |
|
| 323 | - 'section' => array ( |
|
| 324 | - 'toplevel' => 0, |
|
| 325 | - 'oai_name' => '' |
|
| 326 | - ), |
|
| 327 | - 'spine' => array ( |
|
| 328 | - 'toplevel' => 0, |
|
| 329 | - 'oai_name' => '' |
|
| 330 | - ), |
|
| 331 | - 'stamp' => array ( |
|
| 332 | - 'toplevel' => 0, |
|
| 333 | - 'oai_name' => '' |
|
| 334 | - ), |
|
| 335 | - 'study' => array ( |
|
| 336 | - 'toplevel' => 1, |
|
| 337 | - 'oai_name' => '', |
|
| 338 | - ), |
|
| 339 | - 'table' => array ( |
|
| 340 | - 'toplevel' => 0, |
|
| 341 | - 'oai_name' => '' |
|
| 342 | - ), |
|
| 343 | - 'text' => array ( |
|
| 344 | - 'toplevel' => 0, |
|
| 345 | - 'oai_name' => '' |
|
| 346 | - ), |
|
| 347 | - 'title_page' => array ( |
|
| 348 | - 'toplevel' => 0, |
|
| 349 | - 'oai_name' => '' |
|
| 350 | - ), |
|
| 351 | - 'verse' => array ( |
|
| 352 | - 'toplevel' => 0, |
|
| 353 | - 'oai_name' => '' |
|
| 354 | - ), |
|
| 355 | - 'volume' => array ( |
|
| 356 | - 'toplevel' => 1, |
|
| 357 | - 'oai_name' => '' |
|
| 358 | - ), |
|
| 359 | - 'year' => array ( |
|
| 360 | - 'toplevel' => 1, |
|
| 361 | - 'oai_name' => '' |
|
| 362 | - ) |
|
| 15 | + 'act' => array ( |
|
| 16 | + 'toplevel' => 1, |
|
| 17 | + 'oai_name' => '', |
|
| 18 | + ), |
|
| 19 | + 'additional' => array ( |
|
| 20 | + 'toplevel' => 0, |
|
| 21 | + 'oai_name' => '' |
|
| 22 | + ), |
|
| 23 | + 'address' => array ( |
|
| 24 | + 'toplevel' => 0, |
|
| 25 | + 'oai_name' => '' |
|
| 26 | + ), |
|
| 27 | + 'album' => array ( |
|
| 28 | + 'toplevel' => 1, |
|
| 29 | + 'oai_name' => '', |
|
| 30 | + ), |
|
| 31 | + 'annotation' => array ( |
|
| 32 | + 'toplevel' => 0, |
|
| 33 | + 'oai_name' => '' |
|
| 34 | + ), |
|
| 35 | + 'article' => array ( |
|
| 36 | + 'toplevel' => 0, |
|
| 37 | + 'oai_name' => '' |
|
| 38 | + ), |
|
| 39 | + 'atlas' => array ( |
|
| 40 | + 'toplevel' => 1, |
|
| 41 | + 'oai_name' => '', |
|
| 42 | + ), |
|
| 43 | + 'bachelor_thesis' => array ( |
|
| 44 | + 'toplevel' => 1, |
|
| 45 | + 'oai_name' => '', |
|
| 46 | + ), |
|
| 47 | + 'binding' => array ( |
|
| 48 | + 'toplevel' => 0, |
|
| 49 | + 'oai_name' => '' |
|
| 50 | + ), |
|
| 51 | + 'bookplate' => array ( |
|
| 52 | + 'toplevel' => 0, |
|
| 53 | + 'oai_name' => '' |
|
| 54 | + ), |
|
| 55 | + 'cartulary' => array ( |
|
| 56 | + 'toplevel' => 1, |
|
| 57 | + 'oai_name' => '', |
|
| 58 | + ), |
|
| 59 | + 'chapter' => array ( |
|
| 60 | + 'toplevel' => 0, |
|
| 61 | + 'oai_name' => '' |
|
| 62 | + ), |
|
| 63 | + 'collation' => array ( |
|
| 64 | + 'toplevel' => 0, |
|
| 65 | + 'oai_name' => '' |
|
| 66 | + ), |
|
| 67 | + 'colophon' => array ( |
|
| 68 | + 'toplevel' => 0, |
|
| 69 | + 'oai_name' => '' |
|
| 70 | + ), |
|
| 71 | + 'contained_work' => array ( |
|
| 72 | + 'toplevel' => 0, |
|
| 73 | + 'oai_name' => '' |
|
| 74 | + ), |
|
| 75 | + 'contents' => array ( |
|
| 76 | + 'toplevel' => 0, |
|
| 77 | + 'oai_name' => '' |
|
| 78 | + ), |
|
| 79 | + 'corrigenda' => array ( |
|
| 80 | + 'toplevel' => 0, |
|
| 81 | + 'oai_name' => '' |
|
| 82 | + ), |
|
| 83 | + 'cover' => array ( |
|
| 84 | + 'toplevel' => 0, |
|
| 85 | + 'oai_name' => '' |
|
| 86 | + ), |
|
| 87 | + 'cover_front' => array ( |
|
| 88 | + 'toplevel' => 0, |
|
| 89 | + 'oai_name' => '' |
|
| 90 | + ), |
|
| 91 | + 'cover_back' => array ( |
|
| 92 | + 'toplevel' => 0, |
|
| 93 | + 'oai_name' => '' |
|
| 94 | + ), |
|
| 95 | + 'day' => array ( |
|
| 96 | + 'toplevel' => 0, |
|
| 97 | + 'oai_name' => '' |
|
| 98 | + ), |
|
| 99 | + 'dedication' => array ( |
|
| 100 | + 'toplevel' => 0, |
|
| 101 | + 'oai_name' => '' |
|
| 102 | + ), |
|
| 103 | + 'diploma_thesis' => array ( |
|
| 104 | + 'toplevel' => 1, |
|
| 105 | + 'oai_name' => '', |
|
| 106 | + ), |
|
| 107 | + 'doctoral_thesis' => array ( |
|
| 108 | + 'toplevel' => 1, |
|
| 109 | + 'oai_name' => '', |
|
| 110 | + ), |
|
| 111 | + 'document' => array ( |
|
| 112 | + 'toplevel' => 1, |
|
| 113 | + 'oai_name' => '', |
|
| 114 | + ), |
|
| 115 | + 'dossier' => array ( |
|
| 116 | + 'toplevel' => 1, |
|
| 117 | + 'oai_name' => '', |
|
| 118 | + ), |
|
| 119 | + 'edge' => array ( |
|
| 120 | + 'toplevel' => 0, |
|
| 121 | + 'oai_name' => '' |
|
| 122 | + ), |
|
| 123 | + 'endsheet' => array ( |
|
| 124 | + 'toplevel' => 0, |
|
| 125 | + 'oai_name' => '' |
|
| 126 | + ), |
|
| 127 | + 'engraved_titlepage' => array ( |
|
| 128 | + 'toplevel' => 0, |
|
| 129 | + 'oai_name' => '' |
|
| 130 | + ), |
|
| 131 | + 'entry' => array ( |
|
| 132 | + 'toplevel' => 0, |
|
| 133 | + 'oai_name' => '' |
|
| 134 | + ), |
|
| 135 | + 'fascicle' => array ( |
|
| 136 | + 'toplevel' => 0, |
|
| 137 | + 'oai_name' => '' |
|
| 138 | + ), |
|
| 139 | + 'file' => array ( |
|
| 140 | + 'toplevel' => 1, |
|
| 141 | + 'oai_name' => '', |
|
| 142 | + ), |
|
| 143 | + 'folder' => array ( |
|
| 144 | + 'toplevel' => 1, |
|
| 145 | + 'oai_name' => '', |
|
| 146 | + ), |
|
| 147 | + 'fragment' => array ( |
|
| 148 | + 'toplevel' => 1, |
|
| 149 | + 'oai_name' => '' |
|
| 150 | + ), |
|
| 151 | + 'ground_plan' => array ( |
|
| 152 | + 'toplevel' => 1, |
|
| 153 | + 'oai_name' => '', |
|
| 154 | + ), |
|
| 155 | + 'habilitation_thesis' => array ( |
|
| 156 | + 'toplevel' => 1, |
|
| 157 | + 'oai_name' => '', |
|
| 158 | + ), |
|
| 159 | + 'illustration' => array ( |
|
| 160 | + 'toplevel' => 0, |
|
| 161 | + 'oai_name' => '' |
|
| 162 | + ), |
|
| 163 | + 'image' => array ( |
|
| 164 | + 'toplevel' => 1, |
|
| 165 | + 'oai_name' => '', |
|
| 166 | + ), |
|
| 167 | + 'imprint' => array ( |
|
| 168 | + 'toplevel' => 0, |
|
| 169 | + 'oai_name' => '' |
|
| 170 | + ), |
|
| 171 | + 'index' => array ( |
|
| 172 | + 'toplevel' => 0, |
|
| 173 | + 'oai_name' => '' |
|
| 174 | + ), |
|
| 175 | + 'initial_decoration' => array ( |
|
| 176 | + 'toplevel' => 0, |
|
| 177 | + 'oai_name' => '' |
|
| 178 | + ), |
|
| 179 | + 'issue' => array ( |
|
| 180 | + 'toplevel' => 0, |
|
| 181 | + 'oai_name' => '' |
|
| 182 | + ), |
|
| 183 | + 'judgement' => array ( |
|
| 184 | + 'toplevel' => 1, |
|
| 185 | + 'oai_name' => '', |
|
| 186 | + ), |
|
| 187 | + 'land_register' => array ( |
|
| 188 | + 'toplevel' => 1, |
|
| 189 | + 'oai_name' => '', |
|
| 190 | + ), |
|
| 191 | + 'leaflet' => array ( |
|
| 192 | + 'toplevel' => 1, |
|
| 193 | + 'oai_name' => '', |
|
| 194 | + ), |
|
| 195 | + 'lecture' => array ( |
|
| 196 | + 'toplevel' => 1, |
|
| 197 | + 'oai_name' => '', |
|
| 198 | + ), |
|
| 199 | + 'letter' => array ( |
|
| 200 | + 'toplevel' => 0, |
|
| 201 | + 'oai_name' => '', |
|
| 202 | + ), |
|
| 203 | + 'magister_thesis' => array ( |
|
| 204 | + 'toplevel' => 1, |
|
| 205 | + 'oai_name' => '', |
|
| 206 | + ), |
|
| 207 | + 'master_thesis' => array ( |
|
| 208 | + 'toplevel' => 1, |
|
| 209 | + 'oai_name' => '', |
|
| 210 | + ), |
|
| 211 | + 'manuscript' => array ( |
|
| 212 | + 'toplevel' => 1, |
|
| 213 | + 'oai_name' => '' |
|
| 214 | + ), |
|
| 215 | + 'map' => array ( |
|
| 216 | + 'toplevel' => 0, |
|
| 217 | + 'oai_name' => '' |
|
| 218 | + ), |
|
| 219 | + 'monograph' => array ( |
|
| 220 | + 'toplevel' => 1, |
|
| 221 | + 'oai_name' => '' |
|
| 222 | + ), |
|
| 223 | + 'month' => array ( |
|
| 224 | + 'toplevel' => 0, |
|
| 225 | + 'oai_name' => '' |
|
| 226 | + ), |
|
| 227 | + 'multivolume_work' => array ( |
|
| 228 | + 'toplevel' => 1, |
|
| 229 | + 'oai_name' => '' |
|
| 230 | + ), |
|
| 231 | + 'musical_notation' => array ( |
|
| 232 | + 'toplevel' => 0, |
|
| 233 | + 'oai_name' => '' |
|
| 234 | + ), |
|
| 235 | + 'newspaper' => array ( |
|
| 236 | + 'toplevel' => 1, |
|
| 237 | + 'oai_name' => '' |
|
| 238 | + ), |
|
| 239 | + 'note' => array ( |
|
| 240 | + 'toplevel' => 0, |
|
| 241 | + 'oai_name' => '', |
|
| 242 | + ), |
|
| 243 | + 'official_notification' => array ( |
|
| 244 | + 'toplevel' => 1, |
|
| 245 | + 'oai_name' => '', |
|
| 246 | + ), |
|
| 247 | + 'ornament' => array ( |
|
| 248 | + 'toplevel' => 0, |
|
| 249 | + 'oai_name' => '' |
|
| 250 | + ), |
|
| 251 | + 'paper' => array ( |
|
| 252 | + 'toplevel' => 1, |
|
| 253 | + 'oai_name' => '', |
|
| 254 | + ), |
|
| 255 | + 'paste_down' => array ( |
|
| 256 | + 'toplevel' => 0, |
|
| 257 | + 'oai_name' => '' |
|
| 258 | + ), |
|
| 259 | + 'periodical' => array ( |
|
| 260 | + 'toplevel' => 1, |
|
| 261 | + 'oai_name' => '' |
|
| 262 | + ), |
|
| 263 | + 'photograph' => array ( |
|
| 264 | + 'toplevel' => 1, |
|
| 265 | + 'oai_name' => '', |
|
| 266 | + ), |
|
| 267 | + 'plan' => array ( |
|
| 268 | + 'toplevel' => 1, |
|
| 269 | + 'oai_name' => '', |
|
| 270 | + ), |
|
| 271 | + 'poster' => array ( |
|
| 272 | + 'toplevel' => 1, |
|
| 273 | + 'oai_name' => '', |
|
| 274 | + ), |
|
| 275 | + 'preface' => array ( |
|
| 276 | + 'toplevel' => 0, |
|
| 277 | + 'oai_name' => '' |
|
| 278 | + ), |
|
| 279 | + 'preprint' => array ( |
|
| 280 | + 'toplevel' => 1, |
|
| 281 | + 'oai_name' => '', |
|
| 282 | + ), |
|
| 283 | + 'printed_archives' => array ( |
|
| 284 | + 'toplevel' => 1, |
|
| 285 | + 'oai_name' => '', |
|
| 286 | + ), |
|
| 287 | + 'printers_mark' => array ( |
|
| 288 | + 'toplevel' => 0, |
|
| 289 | + 'oai_name' => '' |
|
| 290 | + ), |
|
| 291 | + 'privileges' => array ( |
|
| 292 | + 'toplevel' => 0, |
|
| 293 | + 'oai_name' => '' |
|
| 294 | + ), |
|
| 295 | + 'proceeding' => array ( |
|
| 296 | + 'toplevel' => 1, |
|
| 297 | + 'oai_name' => '', |
|
| 298 | + ), |
|
| 299 | + 'provenance' => array ( |
|
| 300 | + 'toplevel' => 0, |
|
| 301 | + 'oai_name' => '' |
|
| 302 | + ), |
|
| 303 | + 'register' => array ( |
|
| 304 | + 'toplevel' => 1, |
|
| 305 | + 'oai_name' => '', |
|
| 306 | + ), |
|
| 307 | + 'report' => array ( |
|
| 308 | + 'toplevel' => 1, |
|
| 309 | + 'oai_name' => '', |
|
| 310 | + ), |
|
| 311 | + 'research_paper' => array ( |
|
| 312 | + 'toplevel' => 1, |
|
| 313 | + 'oai_name' => '', |
|
| 314 | + ), |
|
| 315 | + 'scheme' => array ( |
|
| 316 | + 'toplevel' => 0, |
|
| 317 | + 'oai_name' => '' |
|
| 318 | + ), |
|
| 319 | + 'seal' => array ( |
|
| 320 | + 'toplevel' => 0, |
|
| 321 | + 'oai_name' => '', |
|
| 322 | + ), |
|
| 323 | + 'section' => array ( |
|
| 324 | + 'toplevel' => 0, |
|
| 325 | + 'oai_name' => '' |
|
| 326 | + ), |
|
| 327 | + 'spine' => array ( |
|
| 328 | + 'toplevel' => 0, |
|
| 329 | + 'oai_name' => '' |
|
| 330 | + ), |
|
| 331 | + 'stamp' => array ( |
|
| 332 | + 'toplevel' => 0, |
|
| 333 | + 'oai_name' => '' |
|
| 334 | + ), |
|
| 335 | + 'study' => array ( |
|
| 336 | + 'toplevel' => 1, |
|
| 337 | + 'oai_name' => '', |
|
| 338 | + ), |
|
| 339 | + 'table' => array ( |
|
| 340 | + 'toplevel' => 0, |
|
| 341 | + 'oai_name' => '' |
|
| 342 | + ), |
|
| 343 | + 'text' => array ( |
|
| 344 | + 'toplevel' => 0, |
|
| 345 | + 'oai_name' => '' |
|
| 346 | + ), |
|
| 347 | + 'title_page' => array ( |
|
| 348 | + 'toplevel' => 0, |
|
| 349 | + 'oai_name' => '' |
|
| 350 | + ), |
|
| 351 | + 'verse' => array ( |
|
| 352 | + 'toplevel' => 0, |
|
| 353 | + 'oai_name' => '' |
|
| 354 | + ), |
|
| 355 | + 'volume' => array ( |
|
| 356 | + 'toplevel' => 1, |
|
| 357 | + 'oai_name' => '' |
|
| 358 | + ), |
|
| 359 | + 'year' => array ( |
|
| 360 | + 'toplevel' => 1, |
|
| 361 | + 'oai_name' => '' |
|
| 362 | + ) |
|
| 363 | 363 | ); |
@@ -11,352 +11,352 @@ |
||
| 11 | 11 | |
| 12 | 12 | // Define structure elements. |
| 13 | 13 | // @see http://dfg-viewer.de/en/structural-data-set/ |
| 14 | -$structures = array ( |
|
| 15 | - 'act' => array ( |
|
| 14 | +$structures = array( |
|
| 15 | + 'act' => array( |
|
| 16 | 16 | 'toplevel' => 1, |
| 17 | 17 | 'oai_name' => '', |
| 18 | 18 | ), |
| 19 | - 'additional' => array ( |
|
| 19 | + 'additional' => array( |
|
| 20 | 20 | 'toplevel' => 0, |
| 21 | 21 | 'oai_name' => '' |
| 22 | 22 | ), |
| 23 | - 'address' => array ( |
|
| 23 | + 'address' => array( |
|
| 24 | 24 | 'toplevel' => 0, |
| 25 | 25 | 'oai_name' => '' |
| 26 | 26 | ), |
| 27 | - 'album' => array ( |
|
| 27 | + 'album' => array( |
|
| 28 | 28 | 'toplevel' => 1, |
| 29 | 29 | 'oai_name' => '', |
| 30 | 30 | ), |
| 31 | - 'annotation' => array ( |
|
| 31 | + 'annotation' => array( |
|
| 32 | 32 | 'toplevel' => 0, |
| 33 | 33 | 'oai_name' => '' |
| 34 | 34 | ), |
| 35 | - 'article' => array ( |
|
| 35 | + 'article' => array( |
|
| 36 | 36 | 'toplevel' => 0, |
| 37 | 37 | 'oai_name' => '' |
| 38 | 38 | ), |
| 39 | - 'atlas' => array ( |
|
| 39 | + 'atlas' => array( |
|
| 40 | 40 | 'toplevel' => 1, |
| 41 | 41 | 'oai_name' => '', |
| 42 | 42 | ), |
| 43 | - 'bachelor_thesis' => array ( |
|
| 43 | + 'bachelor_thesis' => array( |
|
| 44 | 44 | 'toplevel' => 1, |
| 45 | 45 | 'oai_name' => '', |
| 46 | 46 | ), |
| 47 | - 'binding' => array ( |
|
| 47 | + 'binding' => array( |
|
| 48 | 48 | 'toplevel' => 0, |
| 49 | 49 | 'oai_name' => '' |
| 50 | 50 | ), |
| 51 | - 'bookplate' => array ( |
|
| 51 | + 'bookplate' => array( |
|
| 52 | 52 | 'toplevel' => 0, |
| 53 | 53 | 'oai_name' => '' |
| 54 | 54 | ), |
| 55 | - 'cartulary' => array ( |
|
| 55 | + 'cartulary' => array( |
|
| 56 | 56 | 'toplevel' => 1, |
| 57 | 57 | 'oai_name' => '', |
| 58 | 58 | ), |
| 59 | - 'chapter' => array ( |
|
| 59 | + 'chapter' => array( |
|
| 60 | 60 | 'toplevel' => 0, |
| 61 | 61 | 'oai_name' => '' |
| 62 | 62 | ), |
| 63 | - 'collation' => array ( |
|
| 63 | + 'collation' => array( |
|
| 64 | 64 | 'toplevel' => 0, |
| 65 | 65 | 'oai_name' => '' |
| 66 | 66 | ), |
| 67 | - 'colophon' => array ( |
|
| 67 | + 'colophon' => array( |
|
| 68 | 68 | 'toplevel' => 0, |
| 69 | 69 | 'oai_name' => '' |
| 70 | 70 | ), |
| 71 | - 'contained_work' => array ( |
|
| 71 | + 'contained_work' => array( |
|
| 72 | 72 | 'toplevel' => 0, |
| 73 | 73 | 'oai_name' => '' |
| 74 | 74 | ), |
| 75 | - 'contents' => array ( |
|
| 75 | + 'contents' => array( |
|
| 76 | 76 | 'toplevel' => 0, |
| 77 | 77 | 'oai_name' => '' |
| 78 | 78 | ), |
| 79 | - 'corrigenda' => array ( |
|
| 79 | + 'corrigenda' => array( |
|
| 80 | 80 | 'toplevel' => 0, |
| 81 | 81 | 'oai_name' => '' |
| 82 | 82 | ), |
| 83 | - 'cover' => array ( |
|
| 83 | + 'cover' => array( |
|
| 84 | 84 | 'toplevel' => 0, |
| 85 | 85 | 'oai_name' => '' |
| 86 | 86 | ), |
| 87 | - 'cover_front' => array ( |
|
| 87 | + 'cover_front' => array( |
|
| 88 | 88 | 'toplevel' => 0, |
| 89 | 89 | 'oai_name' => '' |
| 90 | 90 | ), |
| 91 | - 'cover_back' => array ( |
|
| 91 | + 'cover_back' => array( |
|
| 92 | 92 | 'toplevel' => 0, |
| 93 | 93 | 'oai_name' => '' |
| 94 | 94 | ), |
| 95 | - 'day' => array ( |
|
| 95 | + 'day' => array( |
|
| 96 | 96 | 'toplevel' => 0, |
| 97 | 97 | 'oai_name' => '' |
| 98 | 98 | ), |
| 99 | - 'dedication' => array ( |
|
| 99 | + 'dedication' => array( |
|
| 100 | 100 | 'toplevel' => 0, |
| 101 | 101 | 'oai_name' => '' |
| 102 | 102 | ), |
| 103 | - 'diploma_thesis' => array ( |
|
| 103 | + 'diploma_thesis' => array( |
|
| 104 | 104 | 'toplevel' => 1, |
| 105 | 105 | 'oai_name' => '', |
| 106 | 106 | ), |
| 107 | - 'doctoral_thesis' => array ( |
|
| 107 | + 'doctoral_thesis' => array( |
|
| 108 | 108 | 'toplevel' => 1, |
| 109 | 109 | 'oai_name' => '', |
| 110 | 110 | ), |
| 111 | - 'document' => array ( |
|
| 111 | + 'document' => array( |
|
| 112 | 112 | 'toplevel' => 1, |
| 113 | 113 | 'oai_name' => '', |
| 114 | 114 | ), |
| 115 | - 'dossier' => array ( |
|
| 115 | + 'dossier' => array( |
|
| 116 | 116 | 'toplevel' => 1, |
| 117 | 117 | 'oai_name' => '', |
| 118 | 118 | ), |
| 119 | - 'edge' => array ( |
|
| 119 | + 'edge' => array( |
|
| 120 | 120 | 'toplevel' => 0, |
| 121 | 121 | 'oai_name' => '' |
| 122 | 122 | ), |
| 123 | - 'endsheet' => array ( |
|
| 123 | + 'endsheet' => array( |
|
| 124 | 124 | 'toplevel' => 0, |
| 125 | 125 | 'oai_name' => '' |
| 126 | 126 | ), |
| 127 | - 'engraved_titlepage' => array ( |
|
| 127 | + 'engraved_titlepage' => array( |
|
| 128 | 128 | 'toplevel' => 0, |
| 129 | 129 | 'oai_name' => '' |
| 130 | 130 | ), |
| 131 | - 'entry' => array ( |
|
| 131 | + 'entry' => array( |
|
| 132 | 132 | 'toplevel' => 0, |
| 133 | 133 | 'oai_name' => '' |
| 134 | 134 | ), |
| 135 | - 'fascicle' => array ( |
|
| 135 | + 'fascicle' => array( |
|
| 136 | 136 | 'toplevel' => 0, |
| 137 | 137 | 'oai_name' => '' |
| 138 | 138 | ), |
| 139 | - 'file' => array ( |
|
| 139 | + 'file' => array( |
|
| 140 | 140 | 'toplevel' => 1, |
| 141 | 141 | 'oai_name' => '', |
| 142 | 142 | ), |
| 143 | - 'folder' => array ( |
|
| 143 | + 'folder' => array( |
|
| 144 | 144 | 'toplevel' => 1, |
| 145 | 145 | 'oai_name' => '', |
| 146 | 146 | ), |
| 147 | - 'fragment' => array ( |
|
| 147 | + 'fragment' => array( |
|
| 148 | 148 | 'toplevel' => 1, |
| 149 | 149 | 'oai_name' => '' |
| 150 | 150 | ), |
| 151 | - 'ground_plan' => array ( |
|
| 151 | + 'ground_plan' => array( |
|
| 152 | 152 | 'toplevel' => 1, |
| 153 | 153 | 'oai_name' => '', |
| 154 | 154 | ), |
| 155 | - 'habilitation_thesis' => array ( |
|
| 155 | + 'habilitation_thesis' => array( |
|
| 156 | 156 | 'toplevel' => 1, |
| 157 | 157 | 'oai_name' => '', |
| 158 | 158 | ), |
| 159 | - 'illustration' => array ( |
|
| 159 | + 'illustration' => array( |
|
| 160 | 160 | 'toplevel' => 0, |
| 161 | 161 | 'oai_name' => '' |
| 162 | 162 | ), |
| 163 | - 'image' => array ( |
|
| 163 | + 'image' => array( |
|
| 164 | 164 | 'toplevel' => 1, |
| 165 | 165 | 'oai_name' => '', |
| 166 | 166 | ), |
| 167 | - 'imprint' => array ( |
|
| 167 | + 'imprint' => array( |
|
| 168 | 168 | 'toplevel' => 0, |
| 169 | 169 | 'oai_name' => '' |
| 170 | 170 | ), |
| 171 | - 'index' => array ( |
|
| 171 | + 'index' => array( |
|
| 172 | 172 | 'toplevel' => 0, |
| 173 | 173 | 'oai_name' => '' |
| 174 | 174 | ), |
| 175 | - 'initial_decoration' => array ( |
|
| 175 | + 'initial_decoration' => array( |
|
| 176 | 176 | 'toplevel' => 0, |
| 177 | 177 | 'oai_name' => '' |
| 178 | 178 | ), |
| 179 | - 'issue' => array ( |
|
| 179 | + 'issue' => array( |
|
| 180 | 180 | 'toplevel' => 0, |
| 181 | 181 | 'oai_name' => '' |
| 182 | 182 | ), |
| 183 | - 'judgement' => array ( |
|
| 183 | + 'judgement' => array( |
|
| 184 | 184 | 'toplevel' => 1, |
| 185 | 185 | 'oai_name' => '', |
| 186 | 186 | ), |
| 187 | - 'land_register' => array ( |
|
| 187 | + 'land_register' => array( |
|
| 188 | 188 | 'toplevel' => 1, |
| 189 | 189 | 'oai_name' => '', |
| 190 | 190 | ), |
| 191 | - 'leaflet' => array ( |
|
| 191 | + 'leaflet' => array( |
|
| 192 | 192 | 'toplevel' => 1, |
| 193 | 193 | 'oai_name' => '', |
| 194 | 194 | ), |
| 195 | - 'lecture' => array ( |
|
| 195 | + 'lecture' => array( |
|
| 196 | 196 | 'toplevel' => 1, |
| 197 | 197 | 'oai_name' => '', |
| 198 | 198 | ), |
| 199 | - 'letter' => array ( |
|
| 199 | + 'letter' => array( |
|
| 200 | 200 | 'toplevel' => 0, |
| 201 | 201 | 'oai_name' => '', |
| 202 | 202 | ), |
| 203 | - 'magister_thesis' => array ( |
|
| 203 | + 'magister_thesis' => array( |
|
| 204 | 204 | 'toplevel' => 1, |
| 205 | 205 | 'oai_name' => '', |
| 206 | 206 | ), |
| 207 | - 'master_thesis' => array ( |
|
| 207 | + 'master_thesis' => array( |
|
| 208 | 208 | 'toplevel' => 1, |
| 209 | 209 | 'oai_name' => '', |
| 210 | 210 | ), |
| 211 | - 'manuscript' => array ( |
|
| 211 | + 'manuscript' => array( |
|
| 212 | 212 | 'toplevel' => 1, |
| 213 | 213 | 'oai_name' => '' |
| 214 | 214 | ), |
| 215 | - 'map' => array ( |
|
| 215 | + 'map' => array( |
|
| 216 | 216 | 'toplevel' => 0, |
| 217 | 217 | 'oai_name' => '' |
| 218 | 218 | ), |
| 219 | - 'monograph' => array ( |
|
| 219 | + 'monograph' => array( |
|
| 220 | 220 | 'toplevel' => 1, |
| 221 | 221 | 'oai_name' => '' |
| 222 | 222 | ), |
| 223 | - 'month' => array ( |
|
| 223 | + 'month' => array( |
|
| 224 | 224 | 'toplevel' => 0, |
| 225 | 225 | 'oai_name' => '' |
| 226 | 226 | ), |
| 227 | - 'multivolume_work' => array ( |
|
| 227 | + 'multivolume_work' => array( |
|
| 228 | 228 | 'toplevel' => 1, |
| 229 | 229 | 'oai_name' => '' |
| 230 | 230 | ), |
| 231 | - 'musical_notation' => array ( |
|
| 231 | + 'musical_notation' => array( |
|
| 232 | 232 | 'toplevel' => 0, |
| 233 | 233 | 'oai_name' => '' |
| 234 | 234 | ), |
| 235 | - 'newspaper' => array ( |
|
| 235 | + 'newspaper' => array( |
|
| 236 | 236 | 'toplevel' => 1, |
| 237 | 237 | 'oai_name' => '' |
| 238 | 238 | ), |
| 239 | - 'note' => array ( |
|
| 239 | + 'note' => array( |
|
| 240 | 240 | 'toplevel' => 0, |
| 241 | 241 | 'oai_name' => '', |
| 242 | 242 | ), |
| 243 | - 'official_notification' => array ( |
|
| 243 | + 'official_notification' => array( |
|
| 244 | 244 | 'toplevel' => 1, |
| 245 | 245 | 'oai_name' => '', |
| 246 | 246 | ), |
| 247 | - 'ornament' => array ( |
|
| 247 | + 'ornament' => array( |
|
| 248 | 248 | 'toplevel' => 0, |
| 249 | 249 | 'oai_name' => '' |
| 250 | 250 | ), |
| 251 | - 'paper' => array ( |
|
| 251 | + 'paper' => array( |
|
| 252 | 252 | 'toplevel' => 1, |
| 253 | 253 | 'oai_name' => '', |
| 254 | 254 | ), |
| 255 | - 'paste_down' => array ( |
|
| 255 | + 'paste_down' => array( |
|
| 256 | 256 | 'toplevel' => 0, |
| 257 | 257 | 'oai_name' => '' |
| 258 | 258 | ), |
| 259 | - 'periodical' => array ( |
|
| 259 | + 'periodical' => array( |
|
| 260 | 260 | 'toplevel' => 1, |
| 261 | 261 | 'oai_name' => '' |
| 262 | 262 | ), |
| 263 | - 'photograph' => array ( |
|
| 263 | + 'photograph' => array( |
|
| 264 | 264 | 'toplevel' => 1, |
| 265 | 265 | 'oai_name' => '', |
| 266 | 266 | ), |
| 267 | - 'plan' => array ( |
|
| 267 | + 'plan' => array( |
|
| 268 | 268 | 'toplevel' => 1, |
| 269 | 269 | 'oai_name' => '', |
| 270 | 270 | ), |
| 271 | - 'poster' => array ( |
|
| 271 | + 'poster' => array( |
|
| 272 | 272 | 'toplevel' => 1, |
| 273 | 273 | 'oai_name' => '', |
| 274 | 274 | ), |
| 275 | - 'preface' => array ( |
|
| 275 | + 'preface' => array( |
|
| 276 | 276 | 'toplevel' => 0, |
| 277 | 277 | 'oai_name' => '' |
| 278 | 278 | ), |
| 279 | - 'preprint' => array ( |
|
| 279 | + 'preprint' => array( |
|
| 280 | 280 | 'toplevel' => 1, |
| 281 | 281 | 'oai_name' => '', |
| 282 | 282 | ), |
| 283 | - 'printed_archives' => array ( |
|
| 283 | + 'printed_archives' => array( |
|
| 284 | 284 | 'toplevel' => 1, |
| 285 | 285 | 'oai_name' => '', |
| 286 | 286 | ), |
| 287 | - 'printers_mark' => array ( |
|
| 287 | + 'printers_mark' => array( |
|
| 288 | 288 | 'toplevel' => 0, |
| 289 | 289 | 'oai_name' => '' |
| 290 | 290 | ), |
| 291 | - 'privileges' => array ( |
|
| 291 | + 'privileges' => array( |
|
| 292 | 292 | 'toplevel' => 0, |
| 293 | 293 | 'oai_name' => '' |
| 294 | 294 | ), |
| 295 | - 'proceeding' => array ( |
|
| 295 | + 'proceeding' => array( |
|
| 296 | 296 | 'toplevel' => 1, |
| 297 | 297 | 'oai_name' => '', |
| 298 | 298 | ), |
| 299 | - 'provenance' => array ( |
|
| 299 | + 'provenance' => array( |
|
| 300 | 300 | 'toplevel' => 0, |
| 301 | 301 | 'oai_name' => '' |
| 302 | 302 | ), |
| 303 | - 'register' => array ( |
|
| 303 | + 'register' => array( |
|
| 304 | 304 | 'toplevel' => 1, |
| 305 | 305 | 'oai_name' => '', |
| 306 | 306 | ), |
| 307 | - 'report' => array ( |
|
| 307 | + 'report' => array( |
|
| 308 | 308 | 'toplevel' => 1, |
| 309 | 309 | 'oai_name' => '', |
| 310 | 310 | ), |
| 311 | - 'research_paper' => array ( |
|
| 311 | + 'research_paper' => array( |
|
| 312 | 312 | 'toplevel' => 1, |
| 313 | 313 | 'oai_name' => '', |
| 314 | 314 | ), |
| 315 | - 'scheme' => array ( |
|
| 315 | + 'scheme' => array( |
|
| 316 | 316 | 'toplevel' => 0, |
| 317 | 317 | 'oai_name' => '' |
| 318 | 318 | ), |
| 319 | - 'seal' => array ( |
|
| 319 | + 'seal' => array( |
|
| 320 | 320 | 'toplevel' => 0, |
| 321 | 321 | 'oai_name' => '', |
| 322 | 322 | ), |
| 323 | - 'section' => array ( |
|
| 323 | + 'section' => array( |
|
| 324 | 324 | 'toplevel' => 0, |
| 325 | 325 | 'oai_name' => '' |
| 326 | 326 | ), |
| 327 | - 'spine' => array ( |
|
| 327 | + 'spine' => array( |
|
| 328 | 328 | 'toplevel' => 0, |
| 329 | 329 | 'oai_name' => '' |
| 330 | 330 | ), |
| 331 | - 'stamp' => array ( |
|
| 331 | + 'stamp' => array( |
|
| 332 | 332 | 'toplevel' => 0, |
| 333 | 333 | 'oai_name' => '' |
| 334 | 334 | ), |
| 335 | - 'study' => array ( |
|
| 335 | + 'study' => array( |
|
| 336 | 336 | 'toplevel' => 1, |
| 337 | 337 | 'oai_name' => '', |
| 338 | 338 | ), |
| 339 | - 'table' => array ( |
|
| 339 | + 'table' => array( |
|
| 340 | 340 | 'toplevel' => 0, |
| 341 | 341 | 'oai_name' => '' |
| 342 | 342 | ), |
| 343 | - 'text' => array ( |
|
| 343 | + 'text' => array( |
|
| 344 | 344 | 'toplevel' => 0, |
| 345 | 345 | 'oai_name' => '' |
| 346 | 346 | ), |
| 347 | - 'title_page' => array ( |
|
| 347 | + 'title_page' => array( |
|
| 348 | 348 | 'toplevel' => 0, |
| 349 | 349 | 'oai_name' => '' |
| 350 | 350 | ), |
| 351 | - 'verse' => array ( |
|
| 351 | + 'verse' => array( |
|
| 352 | 352 | 'toplevel' => 0, |
| 353 | 353 | 'oai_name' => '' |
| 354 | 354 | ), |
| 355 | - 'volume' => array ( |
|
| 355 | + 'volume' => array( |
|
| 356 | 356 | 'toplevel' => 1, |
| 357 | 357 | 'oai_name' => '' |
| 358 | 358 | ), |
| 359 | - 'year' => array ( |
|
| 359 | + 'year' => array( |
|
| 360 | 360 | 'toplevel' => 1, |
| 361 | 361 | 'oai_name' => '' |
| 362 | 362 | ) |
@@ -19,489 +19,489 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | class tx_dlf_modNewclient extends tx_dlf_module { |
| 21 | 21 | |
| 22 | - protected $modPath = 'newclient/'; |
|
| 22 | + protected $modPath = 'newclient/'; |
|
| 23 | 23 | |
| 24 | - protected $buttonArray = array ( |
|
| 25 | - 'SHORTCUT' => '', |
|
| 26 | - ); |
|
| 24 | + protected $buttonArray = array ( |
|
| 25 | + 'SHORTCUT' => '', |
|
| 26 | + ); |
|
| 27 | 27 | |
| 28 | - protected $markerArray = array ( |
|
| 29 | - 'CSH' => '', |
|
| 30 | - 'MOD_MENU' => '', |
|
| 31 | - 'CONTENT' => '', |
|
| 32 | - ); |
|
| 28 | + protected $markerArray = array ( |
|
| 29 | + 'CSH' => '', |
|
| 30 | + 'MOD_MENU' => '', |
|
| 31 | + 'CONTENT' => '', |
|
| 32 | + ); |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Add access rights |
|
| 36 | - * |
|
| 37 | - * @access protected |
|
| 38 | - * |
|
| 39 | - * @return void |
|
| 40 | - */ |
|
| 41 | - protected function cmdAddAccessRights() { |
|
| 34 | + /** |
|
| 35 | + * Add access rights |
|
| 36 | + * |
|
| 37 | + * @access protected |
|
| 38 | + * |
|
| 39 | + * @return void |
|
| 40 | + */ |
|
| 41 | + protected function cmdAddAccessRights() { |
|
| 42 | 42 | |
| 43 | - // Get command line indexer's usergroup. |
|
| 44 | - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 45 | - 'uid,db_mountpoints', |
|
| 46 | - 'be_groups', |
|
| 47 | - 'title='.$GLOBALS['TYPO3_DB']->fullQuoteStr('_cli_dlf', 'be_groups').' AND '.$GLOBALS['TCA']['be_groups']['ctrl']['enablecolumns']['disabled'].'=0'.\TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('be_groups') |
|
| 48 | - ); |
|
| 43 | + // Get command line indexer's usergroup. |
|
| 44 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 45 | + 'uid,db_mountpoints', |
|
| 46 | + 'be_groups', |
|
| 47 | + 'title='.$GLOBALS['TYPO3_DB']->fullQuoteStr('_cli_dlf', 'be_groups').' AND '.$GLOBALS['TCA']['be_groups']['ctrl']['enablecolumns']['disabled'].'=0'.\TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('be_groups') |
|
| 48 | + ); |
|
| 49 | 49 | |
| 50 | - if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
|
| 50 | + if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
|
| 51 | 51 | |
| 52 | - $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); |
|
| 52 | + $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); |
|
| 53 | 53 | |
| 54 | - // Add current page to mountpoints. |
|
| 55 | - if (!\TYPO3\CMS\Core\Utility\GeneralUtility::inList($resArray['db_mountpoints'], $this->id)) { |
|
| 54 | + // Add current page to mountpoints. |
|
| 55 | + if (!\TYPO3\CMS\Core\Utility\GeneralUtility::inList($resArray['db_mountpoints'], $this->id)) { |
|
| 56 | 56 | |
| 57 | - $data['be_groups'][$resArray['uid']]['db_mountpoints'] = $resArray['db_mountpoints'].','.$this->id; |
|
| 57 | + $data['be_groups'][$resArray['uid']]['db_mountpoints'] = $resArray['db_mountpoints'].','.$this->id; |
|
| 58 | 58 | |
| 59 | - tx_dlf_helper::processDBasAdmin($data); |
|
| 59 | + tx_dlf_helper::processDBasAdmin($data); |
|
| 60 | 60 | |
| 61 | - // Fine. |
|
| 62 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 63 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 64 | - tx_dlf_helper::getLL('flash.usergroupAddedMsg'), |
|
| 65 | - tx_dlf_helper::getLL('flash.usergroupAdded', TRUE), |
|
| 66 | - \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 67 | - FALSE |
|
| 68 | - ); |
|
| 61 | + // Fine. |
|
| 62 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 63 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 64 | + tx_dlf_helper::getLL('flash.usergroupAddedMsg'), |
|
| 65 | + tx_dlf_helper::getLL('flash.usergroupAdded', TRUE), |
|
| 66 | + \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 67 | + FALSE |
|
| 68 | + ); |
|
| 69 | 69 | |
| 70 | - tx_dlf_helper::addMessage($_message); |
|
| 70 | + tx_dlf_helper::addMessage($_message); |
|
| 71 | 71 | |
| 72 | - } |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | - } |
|
| 74 | + } |
|
| 75 | 75 | |
| 76 | - } |
|
| 76 | + } |
|
| 77 | 77 | |
| 78 | - /** |
|
| 79 | - * Add metadata configuration |
|
| 80 | - * |
|
| 81 | - * @access protected |
|
| 82 | - * |
|
| 83 | - * @return void |
|
| 84 | - */ |
|
| 85 | - protected function cmdAddMetadata() { |
|
| 78 | + /** |
|
| 79 | + * Add metadata configuration |
|
| 80 | + * |
|
| 81 | + * @access protected |
|
| 82 | + * |
|
| 83 | + * @return void |
|
| 84 | + */ |
|
| 85 | + protected function cmdAddMetadata() { |
|
| 86 | 86 | |
| 87 | - // Include metadata definition file. |
|
| 88 | - include_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey).'modules/'.$this->modPath.'metadata.inc.php'); |
|
| 89 | - |
|
| 90 | - $i = 0; |
|
| 87 | + // Include metadata definition file. |
|
| 88 | + include_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey).'modules/'.$this->modPath.'metadata.inc.php'); |
|
| 89 | + |
|
| 90 | + $i = 0; |
|
| 91 | 91 | |
| 92 | - // Build data array. |
|
| 93 | - foreach ($metadata as $index_name => $values) { |
|
| 92 | + // Build data array. |
|
| 93 | + foreach ($metadata as $index_name => $values) { |
|
| 94 | 94 | |
| 95 | - $formatIds = array (); |
|
| 95 | + $formatIds = array (); |
|
| 96 | 96 | |
| 97 | - foreach ($values['format'] as $format) { |
|
| 98 | - |
|
| 99 | - $formatIds[] = uniqid('NEW'); |
|
| 100 | - |
|
| 101 | - $data['tx_dlf_metadataformat'][end($formatIds)] = $format; |
|
| 102 | - |
|
| 103 | - $data['tx_dlf_metadataformat'][end($formatIds)]['pid'] = intval($this->id); |
|
| 97 | + foreach ($values['format'] as $format) { |
|
| 98 | + |
|
| 99 | + $formatIds[] = uniqid('NEW'); |
|
| 100 | + |
|
| 101 | + $data['tx_dlf_metadataformat'][end($formatIds)] = $format; |
|
| 102 | + |
|
| 103 | + $data['tx_dlf_metadataformat'][end($formatIds)]['pid'] = intval($this->id); |
|
| 104 | 104 | |
| 105 | - $i++; |
|
| 105 | + $i++; |
|
| 106 | 106 | |
| 107 | - } |
|
| 107 | + } |
|
| 108 | 108 | |
| 109 | - $data['tx_dlf_metadata'][uniqid('NEW')] = array ( |
|
| 110 | - 'pid' => intval($this->id), |
|
| 111 | - 'label' => $GLOBALS['LANG']->getLL($index_name), |
|
| 112 | - 'index_name' => $index_name, |
|
| 113 | - 'format' => implode(',', $formatIds), |
|
| 114 | - 'default_value' => $values['default_value'], |
|
| 115 | - 'wrap' => (!empty($values['wrap']) ? $values['wrap'] : $GLOBALS['TCA']['tx_dlf_metadata']['columns']['wrap']['config']['default']), |
|
| 116 | - 'index_tokenized' => $values['index_tokenized'], |
|
| 117 | - 'index_stored' => $values['index_stored'], |
|
| 118 | - 'index_indexed' => $values['index_indexed'], |
|
| 119 | - 'index_boost' => $values['index_boost'], |
|
| 120 | - 'is_sortable' => $values['is_sortable'], |
|
| 121 | - 'is_facet' => $values['is_facet'], |
|
| 122 | - 'is_listed' => $values['is_listed'], |
|
| 123 | - 'index_autocomplete' => $values['index_autocomplete'], |
|
| 124 | - ); |
|
| 125 | - |
|
| 126 | - $i++; |
|
| 127 | - |
|
| 128 | - } |
|
| 129 | - |
|
| 130 | - $_ids = tx_dlf_helper::processDBasAdmin($data); |
|
| 131 | - |
|
| 132 | - // Check for failed inserts. |
|
| 133 | - if (count($_ids) == $i) { |
|
| 134 | - |
|
| 135 | - // Fine. |
|
| 136 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 137 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 138 | - tx_dlf_helper::getLL('flash.metadataAddedMsg'), |
|
| 139 | - tx_dlf_helper::getLL('flash.metadataAdded', TRUE), |
|
| 140 | - \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 141 | - FALSE |
|
| 142 | - ); |
|
| 109 | + $data['tx_dlf_metadata'][uniqid('NEW')] = array ( |
|
| 110 | + 'pid' => intval($this->id), |
|
| 111 | + 'label' => $GLOBALS['LANG']->getLL($index_name), |
|
| 112 | + 'index_name' => $index_name, |
|
| 113 | + 'format' => implode(',', $formatIds), |
|
| 114 | + 'default_value' => $values['default_value'], |
|
| 115 | + 'wrap' => (!empty($values['wrap']) ? $values['wrap'] : $GLOBALS['TCA']['tx_dlf_metadata']['columns']['wrap']['config']['default']), |
|
| 116 | + 'index_tokenized' => $values['index_tokenized'], |
|
| 117 | + 'index_stored' => $values['index_stored'], |
|
| 118 | + 'index_indexed' => $values['index_indexed'], |
|
| 119 | + 'index_boost' => $values['index_boost'], |
|
| 120 | + 'is_sortable' => $values['is_sortable'], |
|
| 121 | + 'is_facet' => $values['is_facet'], |
|
| 122 | + 'is_listed' => $values['is_listed'], |
|
| 123 | + 'index_autocomplete' => $values['index_autocomplete'], |
|
| 124 | + ); |
|
| 125 | + |
|
| 126 | + $i++; |
|
| 127 | + |
|
| 128 | + } |
|
| 129 | + |
|
| 130 | + $_ids = tx_dlf_helper::processDBasAdmin($data); |
|
| 131 | + |
|
| 132 | + // Check for failed inserts. |
|
| 133 | + if (count($_ids) == $i) { |
|
| 134 | + |
|
| 135 | + // Fine. |
|
| 136 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 137 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 138 | + tx_dlf_helper::getLL('flash.metadataAddedMsg'), |
|
| 139 | + tx_dlf_helper::getLL('flash.metadataAdded', TRUE), |
|
| 140 | + \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 141 | + FALSE |
|
| 142 | + ); |
|
| 143 | 143 | |
| 144 | - } else { |
|
| 144 | + } else { |
|
| 145 | 145 | |
| 146 | - // Something went wrong. |
|
| 147 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 148 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 149 | - tx_dlf_helper::getLL('flash.metadataNotAddedMsg'), |
|
| 150 | - tx_dlf_helper::getLL('flash.metadataNotAdded', TRUE), |
|
| 151 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 152 | - FALSE |
|
| 153 | - ); |
|
| 154 | - |
|
| 155 | - } |
|
| 156 | - |
|
| 157 | - tx_dlf_helper::addMessage($_message); |
|
| 158 | - |
|
| 159 | - } |
|
| 160 | - |
|
| 161 | - /** |
|
| 162 | - * Add Solr core |
|
| 163 | - * |
|
| 164 | - * @access protected |
|
| 165 | - * |
|
| 166 | - * @return void |
|
| 167 | - */ |
|
| 168 | - protected function cmdAddSolrCore() { |
|
| 146 | + // Something went wrong. |
|
| 147 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 148 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 149 | + tx_dlf_helper::getLL('flash.metadataNotAddedMsg'), |
|
| 150 | + tx_dlf_helper::getLL('flash.metadataNotAdded', TRUE), |
|
| 151 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 152 | + FALSE |
|
| 153 | + ); |
|
| 154 | + |
|
| 155 | + } |
|
| 156 | + |
|
| 157 | + tx_dlf_helper::addMessage($_message); |
|
| 158 | + |
|
| 159 | + } |
|
| 160 | + |
|
| 161 | + /** |
|
| 162 | + * Add Solr core |
|
| 163 | + * |
|
| 164 | + * @access protected |
|
| 165 | + * |
|
| 166 | + * @return void |
|
| 167 | + */ |
|
| 168 | + protected function cmdAddSolrCore() { |
|
| 169 | 169 | |
| 170 | - // Build data array. |
|
| 171 | - $data['tx_dlf_solrcores'][uniqid('NEW')] = array ( |
|
| 172 | - 'pid' => intval($this->id), |
|
| 173 | - 'label' => $GLOBALS['LANG']->getLL('solrcore').' (PID '.$this->id.')', |
|
| 174 | - 'index_name' => '', |
|
| 175 | - ); |
|
| 176 | - |
|
| 177 | - $_ids = tx_dlf_helper::processDBasAdmin($data); |
|
| 178 | - |
|
| 179 | - // Check for failed inserts. |
|
| 180 | - if (count($_ids) == 1) { |
|
| 181 | - |
|
| 182 | - // Fine. |
|
| 183 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 184 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 185 | - tx_dlf_helper::getLL('flash.solrcoreAddedMsg'), |
|
| 186 | - tx_dlf_helper::getLL('flash.solrcoreAdded', TRUE), |
|
| 187 | - \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 188 | - FALSE |
|
| 189 | - ); |
|
| 190 | - |
|
| 191 | - } else { |
|
| 192 | - |
|
| 193 | - // Something went wrong. |
|
| 194 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 195 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 196 | - tx_dlf_helper::getLL('flash.solrcoreNotAddedMsg'), |
|
| 197 | - tx_dlf_helper::getLL('flash.solrcoreNotAdded', TRUE), |
|
| 198 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 199 | - FALSE |
|
| 200 | - ); |
|
| 201 | - |
|
| 202 | - } |
|
| 203 | - |
|
| 204 | - tx_dlf_helper::addMessage($_message); |
|
| 205 | - |
|
| 206 | - } |
|
| 207 | - |
|
| 208 | - /** |
|
| 209 | - * Add structure configuration |
|
| 210 | - * |
|
| 211 | - * @access protected |
|
| 212 | - * |
|
| 213 | - * @return void |
|
| 214 | - */ |
|
| 215 | - protected function cmdAddStructure() { |
|
| 170 | + // Build data array. |
|
| 171 | + $data['tx_dlf_solrcores'][uniqid('NEW')] = array ( |
|
| 172 | + 'pid' => intval($this->id), |
|
| 173 | + 'label' => $GLOBALS['LANG']->getLL('solrcore').' (PID '.$this->id.')', |
|
| 174 | + 'index_name' => '', |
|
| 175 | + ); |
|
| 176 | + |
|
| 177 | + $_ids = tx_dlf_helper::processDBasAdmin($data); |
|
| 178 | + |
|
| 179 | + // Check for failed inserts. |
|
| 180 | + if (count($_ids) == 1) { |
|
| 181 | + |
|
| 182 | + // Fine. |
|
| 183 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 184 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 185 | + tx_dlf_helper::getLL('flash.solrcoreAddedMsg'), |
|
| 186 | + tx_dlf_helper::getLL('flash.solrcoreAdded', TRUE), |
|
| 187 | + \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 188 | + FALSE |
|
| 189 | + ); |
|
| 190 | + |
|
| 191 | + } else { |
|
| 192 | + |
|
| 193 | + // Something went wrong. |
|
| 194 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 195 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 196 | + tx_dlf_helper::getLL('flash.solrcoreNotAddedMsg'), |
|
| 197 | + tx_dlf_helper::getLL('flash.solrcoreNotAdded', TRUE), |
|
| 198 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 199 | + FALSE |
|
| 200 | + ); |
|
| 201 | + |
|
| 202 | + } |
|
| 203 | + |
|
| 204 | + tx_dlf_helper::addMessage($_message); |
|
| 205 | + |
|
| 206 | + } |
|
| 207 | + |
|
| 208 | + /** |
|
| 209 | + * Add structure configuration |
|
| 210 | + * |
|
| 211 | + * @access protected |
|
| 212 | + * |
|
| 213 | + * @return void |
|
| 214 | + */ |
|
| 215 | + protected function cmdAddStructure() { |
|
| 216 | 216 | |
| 217 | - // Include structure definition file. |
|
| 218 | - include_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey).'modules/'.$this->modPath.'structures.inc.php'); |
|
| 217 | + // Include structure definition file. |
|
| 218 | + include_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey).'modules/'.$this->modPath.'structures.inc.php'); |
|
| 219 | 219 | |
| 220 | - // Build data array. |
|
| 221 | - foreach ($structures as $index_name => $values) { |
|
| 220 | + // Build data array. |
|
| 221 | + foreach ($structures as $index_name => $values) { |
|
| 222 | 222 | |
| 223 | - $data['tx_dlf_structures'][uniqid('NEW')] = array ( |
|
| 224 | - 'pid' => intval($this->id), |
|
| 225 | - 'toplevel' => $values['toplevel'], |
|
| 226 | - 'label' => $GLOBALS['LANG']->getLL($index_name), |
|
| 227 | - 'index_name' => $index_name, |
|
| 228 | - 'oai_name' => $values['oai_name'], |
|
| 229 | - 'thumbnail' => 0, |
|
| 230 | - ); |
|
| 223 | + $data['tx_dlf_structures'][uniqid('NEW')] = array ( |
|
| 224 | + 'pid' => intval($this->id), |
|
| 225 | + 'toplevel' => $values['toplevel'], |
|
| 226 | + 'label' => $GLOBALS['LANG']->getLL($index_name), |
|
| 227 | + 'index_name' => $index_name, |
|
| 228 | + 'oai_name' => $values['oai_name'], |
|
| 229 | + 'thumbnail' => 0, |
|
| 230 | + ); |
|
| 231 | 231 | |
| 232 | - } |
|
| 233 | - |
|
| 234 | - $_ids = tx_dlf_helper::processDBasAdmin($data); |
|
| 235 | - |
|
| 236 | - // Check for failed inserts. |
|
| 237 | - if (count($_ids) == count($structures)) { |
|
| 232 | + } |
|
| 233 | + |
|
| 234 | + $_ids = tx_dlf_helper::processDBasAdmin($data); |
|
| 235 | + |
|
| 236 | + // Check for failed inserts. |
|
| 237 | + if (count($_ids) == count($structures)) { |
|
| 238 | 238 | |
| 239 | - // Fine. |
|
| 240 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 241 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 242 | - tx_dlf_helper::getLL('flash.structureAddedMsg'), |
|
| 243 | - tx_dlf_helper::getLL('flash.structureAdded', TRUE), |
|
| 244 | - \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 245 | - FALSE |
|
| 246 | - ); |
|
| 239 | + // Fine. |
|
| 240 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 241 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 242 | + tx_dlf_helper::getLL('flash.structureAddedMsg'), |
|
| 243 | + tx_dlf_helper::getLL('flash.structureAdded', TRUE), |
|
| 244 | + \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 245 | + FALSE |
|
| 246 | + ); |
|
| 247 | 247 | |
| 248 | - } else { |
|
| 248 | + } else { |
|
| 249 | 249 | |
| 250 | - // Something went wrong. |
|
| 251 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 252 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 253 | - tx_dlf_helper::getLL('flash.structureNotAddedMsg'), |
|
| 254 | - tx_dlf_helper::getLL('flash.structureNotAdded', TRUE), |
|
| 255 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 256 | - FALSE |
|
| 257 | - ); |
|
| 250 | + // Something went wrong. |
|
| 251 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 252 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 253 | + tx_dlf_helper::getLL('flash.structureNotAddedMsg'), |
|
| 254 | + tx_dlf_helper::getLL('flash.structureNotAdded', TRUE), |
|
| 255 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 256 | + FALSE |
|
| 257 | + ); |
|
| 258 | 258 | |
| 259 | - } |
|
| 259 | + } |
|
| 260 | 260 | |
| 261 | - tx_dlf_helper::addMessage($_message); |
|
| 261 | + tx_dlf_helper::addMessage($_message); |
|
| 262 | 262 | |
| 263 | - } |
|
| 263 | + } |
|
| 264 | 264 | |
| 265 | - /** |
|
| 266 | - * Main function of the module |
|
| 267 | - * |
|
| 268 | - * @access public |
|
| 269 | - * |
|
| 270 | - * @return void |
|
| 271 | - */ |
|
| 272 | - public function main() { |
|
| 265 | + /** |
|
| 266 | + * Main function of the module |
|
| 267 | + * |
|
| 268 | + * @access public |
|
| 269 | + * |
|
| 270 | + * @return void |
|
| 271 | + */ |
|
| 272 | + public function main() { |
|
| 273 | 273 | |
| 274 | - // Is the user allowed to access this page? |
|
| 275 | - $access = is_array($this->pageInfo) && $GLOBALS['BE_USER']->isAdmin(); |
|
| 274 | + // Is the user allowed to access this page? |
|
| 275 | + $access = is_array($this->pageInfo) && $GLOBALS['BE_USER']->isAdmin(); |
|
| 276 | 276 | |
| 277 | - if ($this->id && $access) { |
|
| 277 | + if ($this->id && $access) { |
|
| 278 | 278 | |
| 279 | - // Check if page is sysfolder. |
|
| 280 | - if ($this->pageInfo['doktype'] != 254) { |
|
| 279 | + // Check if page is sysfolder. |
|
| 280 | + if ($this->pageInfo['doktype'] != 254) { |
|
| 281 | 281 | |
| 282 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 283 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 284 | - tx_dlf_helper::getLL('flash.wrongPageTypeMsg'), |
|
| 285 | - tx_dlf_helper::getLL('flash.wrongPageType', TRUE), |
|
| 286 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 287 | - FALSE |
|
| 288 | - ); |
|
| 282 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 283 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 284 | + tx_dlf_helper::getLL('flash.wrongPageTypeMsg'), |
|
| 285 | + tx_dlf_helper::getLL('flash.wrongPageType', TRUE), |
|
| 286 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 287 | + FALSE |
|
| 288 | + ); |
|
| 289 | 289 | |
| 290 | - tx_dlf_helper::addMessage($_message); |
|
| 290 | + tx_dlf_helper::addMessage($_message); |
|
| 291 | 291 | |
| 292 | - $this->markerArray['CONTENT'] .= tx_dlf_helper::renderFlashMessages(); |
|
| 292 | + $this->markerArray['CONTENT'] .= tx_dlf_helper::renderFlashMessages(); |
|
| 293 | 293 | |
| 294 | - $this->printContent(); |
|
| 294 | + $this->printContent(); |
|
| 295 | 295 | |
| 296 | - return; |
|
| 296 | + return; |
|
| 297 | 297 | |
| 298 | - } |
|
| 298 | + } |
|
| 299 | 299 | |
| 300 | - // Should we do something? |
|
| 301 | - if (!empty($this->CMD)) { |
|
| 300 | + // Should we do something? |
|
| 301 | + if (!empty($this->CMD)) { |
|
| 302 | 302 | |
| 303 | - // Sanitize input... |
|
| 304 | - $_method = 'cmd'.ucfirst($this->CMD); |
|
| 303 | + // Sanitize input... |
|
| 304 | + $_method = 'cmd'.ucfirst($this->CMD); |
|
| 305 | 305 | |
| 306 | - // ...and unset to prevent infinite looping. |
|
| 307 | - unset ($this->CMD); |
|
| 306 | + // ...and unset to prevent infinite looping. |
|
| 307 | + unset ($this->CMD); |
|
| 308 | 308 | |
| 309 | - if (method_exists($this, $_method)) { |
|
| 309 | + if (method_exists($this, $_method)) { |
|
| 310 | 310 | |
| 311 | - $this->$_method(); |
|
| 311 | + $this->$_method(); |
|
| 312 | 312 | |
| 313 | - } |
|
| 313 | + } |
|
| 314 | 314 | |
| 315 | - } |
|
| 315 | + } |
|
| 316 | 316 | |
| 317 | - // Check for existing structure configuration. |
|
| 318 | - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 319 | - 'uid', |
|
| 320 | - 'tx_dlf_structures', |
|
| 321 | - 'pid='.intval($this->id).tx_dlf_helper::whereClause('tx_dlf_structures') |
|
| 322 | - ); |
|
| 317 | + // Check for existing structure configuration. |
|
| 318 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 319 | + 'uid', |
|
| 320 | + 'tx_dlf_structures', |
|
| 321 | + 'pid='.intval($this->id).tx_dlf_helper::whereClause('tx_dlf_structures') |
|
| 322 | + ); |
|
| 323 | 323 | |
| 324 | - if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
|
| 324 | + if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
|
| 325 | 325 | |
| 326 | - // Fine. |
|
| 327 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 328 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 329 | - tx_dlf_helper::getLL('flash.structureOkayMsg'), |
|
| 330 | - tx_dlf_helper::getLL('flash.structureOkay', TRUE), |
|
| 331 | - \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 332 | - FALSE |
|
| 333 | - ); |
|
| 326 | + // Fine. |
|
| 327 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 328 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 329 | + tx_dlf_helper::getLL('flash.structureOkayMsg'), |
|
| 330 | + tx_dlf_helper::getLL('flash.structureOkay', TRUE), |
|
| 331 | + \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 332 | + FALSE |
|
| 333 | + ); |
|
| 334 | 334 | |
| 335 | - } else { |
|
| 335 | + } else { |
|
| 336 | 336 | |
| 337 | - // Configuration missing. |
|
| 338 | - $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'addStructure'))); |
|
| 337 | + // Configuration missing. |
|
| 338 | + $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'addStructure'))); |
|
| 339 | 339 | |
| 340 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 341 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 342 | - sprintf(tx_dlf_helper::getLL('flash.structureNotOkayMsg'), $_url), |
|
| 343 | - tx_dlf_helper::getLL('flash.structureNotOkay', TRUE), |
|
| 344 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 345 | - FALSE |
|
| 346 | - ); |
|
| 340 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 341 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 342 | + sprintf(tx_dlf_helper::getLL('flash.structureNotOkayMsg'), $_url), |
|
| 343 | + tx_dlf_helper::getLL('flash.structureNotOkay', TRUE), |
|
| 344 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 345 | + FALSE |
|
| 346 | + ); |
|
| 347 | 347 | |
| 348 | - } |
|
| 348 | + } |
|
| 349 | 349 | |
| 350 | - tx_dlf_helper::addMessage($_message); |
|
| 350 | + tx_dlf_helper::addMessage($_message); |
|
| 351 | 351 | |
| 352 | - // Check for existing metadata configuration. |
|
| 353 | - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 354 | - 'uid', |
|
| 355 | - 'tx_dlf_metadata', |
|
| 356 | - 'pid='.intval($this->id).tx_dlf_helper::whereClause('tx_dlf_metadata') |
|
| 357 | - ); |
|
| 352 | + // Check for existing metadata configuration. |
|
| 353 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 354 | + 'uid', |
|
| 355 | + 'tx_dlf_metadata', |
|
| 356 | + 'pid='.intval($this->id).tx_dlf_helper::whereClause('tx_dlf_metadata') |
|
| 357 | + ); |
|
| 358 | 358 | |
| 359 | - if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
|
| 359 | + if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
|
| 360 | 360 | |
| 361 | - // Fine. |
|
| 362 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 363 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 364 | - tx_dlf_helper::getLL('flash.metadataOkayMsg'), |
|
| 365 | - tx_dlf_helper::getLL('flash.metadataOkay', TRUE), |
|
| 366 | - \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 367 | - FALSE |
|
| 368 | - ); |
|
| 361 | + // Fine. |
|
| 362 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 363 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 364 | + tx_dlf_helper::getLL('flash.metadataOkayMsg'), |
|
| 365 | + tx_dlf_helper::getLL('flash.metadataOkay', TRUE), |
|
| 366 | + \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 367 | + FALSE |
|
| 368 | + ); |
|
| 369 | 369 | |
| 370 | - } else { |
|
| 370 | + } else { |
|
| 371 | 371 | |
| 372 | - // Configuration missing. |
|
| 373 | - $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'addMetadata'))); |
|
| 372 | + // Configuration missing. |
|
| 373 | + $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'addMetadata'))); |
|
| 374 | 374 | |
| 375 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 376 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 377 | - sprintf(tx_dlf_helper::getLL('flash.metadataNotOkayMsg'), $_url), |
|
| 378 | - tx_dlf_helper::getLL('flash.metadataNotOkay', TRUE), |
|
| 379 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 380 | - FALSE |
|
| 381 | - ); |
|
| 375 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 376 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 377 | + sprintf(tx_dlf_helper::getLL('flash.metadataNotOkayMsg'), $_url), |
|
| 378 | + tx_dlf_helper::getLL('flash.metadataNotOkay', TRUE), |
|
| 379 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 380 | + FALSE |
|
| 381 | + ); |
|
| 382 | 382 | |
| 383 | - } |
|
| 383 | + } |
|
| 384 | 384 | |
| 385 | - tx_dlf_helper::addMessage($_message); |
|
| 385 | + tx_dlf_helper::addMessage($_message); |
|
| 386 | 386 | |
| 387 | - // Check the access conditions for the command line indexer's user. |
|
| 388 | - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 389 | - 'uid,db_mountpoints', |
|
| 390 | - 'be_groups', |
|
| 391 | - 'title='.$GLOBALS['TYPO3_DB']->fullQuoteStr('_cli_dlf', 'be_groups').' AND '.$GLOBALS['TCA']['be_groups']['ctrl']['enablecolumns']['disabled'].'=0'.\TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('be_groups') |
|
| 392 | - ); |
|
| 387 | + // Check the access conditions for the command line indexer's user. |
|
| 388 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 389 | + 'uid,db_mountpoints', |
|
| 390 | + 'be_groups', |
|
| 391 | + 'title='.$GLOBALS['TYPO3_DB']->fullQuoteStr('_cli_dlf', 'be_groups').' AND '.$GLOBALS['TCA']['be_groups']['ctrl']['enablecolumns']['disabled'].'=0'.\TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('be_groups') |
|
| 392 | + ); |
|
| 393 | 393 | |
| 394 | - if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
|
| 394 | + if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
|
| 395 | 395 | |
| 396 | - $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); |
|
| 396 | + $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); |
|
| 397 | 397 | |
| 398 | - if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($resArray['db_mountpoints'], $this->id)) { |
|
| 398 | + if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($resArray['db_mountpoints'], $this->id)) { |
|
| 399 | 399 | |
| 400 | - // Fine. |
|
| 401 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 402 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 403 | - tx_dlf_helper::getLL('flash.usergroupOkayMsg'), |
|
| 404 | - tx_dlf_helper::getLL('flash.usergroupOkay', TRUE), |
|
| 405 | - \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 406 | - FALSE |
|
| 407 | - ); |
|
| 400 | + // Fine. |
|
| 401 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 402 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 403 | + tx_dlf_helper::getLL('flash.usergroupOkayMsg'), |
|
| 404 | + tx_dlf_helper::getLL('flash.usergroupOkay', TRUE), |
|
| 405 | + \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 406 | + FALSE |
|
| 407 | + ); |
|
| 408 | 408 | |
| 409 | - } else { |
|
| 409 | + } else { |
|
| 410 | 410 | |
| 411 | - // Configuration missing. |
|
| 412 | - $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'addAccessRights'))); |
|
| 411 | + // Configuration missing. |
|
| 412 | + $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'addAccessRights'))); |
|
| 413 | 413 | |
| 414 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 415 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 416 | - sprintf(tx_dlf_helper::getLL('flash.usergroupNotOkayMsg'), $_url), |
|
| 417 | - tx_dlf_helper::getLL('flash.usergroupNotOkay', TRUE), |
|
| 418 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 419 | - FALSE |
|
| 420 | - ); |
|
| 414 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 415 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 416 | + sprintf(tx_dlf_helper::getLL('flash.usergroupNotOkayMsg'), $_url), |
|
| 417 | + tx_dlf_helper::getLL('flash.usergroupNotOkay', TRUE), |
|
| 418 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 419 | + FALSE |
|
| 420 | + ); |
|
| 421 | 421 | |
| 422 | - } |
|
| 422 | + } |
|
| 423 | 423 | |
| 424 | - } else { |
|
| 424 | + } else { |
|
| 425 | 425 | |
| 426 | - // Usergoup missing. |
|
| 427 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 428 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 429 | - tx_dlf_helper::getLL('flash.usergroupMissingMsg'), |
|
| 430 | - tx_dlf_helper::getLL('flash.usergroupMissing', TRUE), |
|
| 431 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 432 | - FALSE |
|
| 433 | - ); |
|
| 426 | + // Usergoup missing. |
|
| 427 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 428 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 429 | + tx_dlf_helper::getLL('flash.usergroupMissingMsg'), |
|
| 430 | + tx_dlf_helper::getLL('flash.usergroupMissing', TRUE), |
|
| 431 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 432 | + FALSE |
|
| 433 | + ); |
|
| 434 | 434 | |
| 435 | - } |
|
| 435 | + } |
|
| 436 | 436 | |
| 437 | - tx_dlf_helper::addMessage($_message); |
|
| 437 | + tx_dlf_helper::addMessage($_message); |
|
| 438 | 438 | |
| 439 | - // Check for existing Solr core. |
|
| 440 | - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 441 | - 'uid,pid', |
|
| 442 | - 'tx_dlf_solrcores', |
|
| 443 | - 'pid IN ('.intval($this->id).',0)'.tx_dlf_helper::whereClause('tx_dlf_solrcores') |
|
| 444 | - ); |
|
| 439 | + // Check for existing Solr core. |
|
| 440 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 441 | + 'uid,pid', |
|
| 442 | + 'tx_dlf_solrcores', |
|
| 443 | + 'pid IN ('.intval($this->id).',0)'.tx_dlf_helper::whereClause('tx_dlf_solrcores') |
|
| 444 | + ); |
|
| 445 | 445 | |
| 446 | - if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
|
| 446 | + if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
|
| 447 | 447 | |
| 448 | - $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); |
|
| 448 | + $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); |
|
| 449 | 449 | |
| 450 | - if ($resArray['pid']) { |
|
| 450 | + if ($resArray['pid']) { |
|
| 451 | 451 | |
| 452 | - // Fine. |
|
| 453 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 454 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 455 | - tx_dlf_helper::getLL('flash.solrcoreOkayMsg'), |
|
| 456 | - tx_dlf_helper::getLL('flash.solrcoreOkay', TRUE), |
|
| 457 | - \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 458 | - FALSE |
|
| 459 | - ); |
|
| 452 | + // Fine. |
|
| 453 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 454 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 455 | + tx_dlf_helper::getLL('flash.solrcoreOkayMsg'), |
|
| 456 | + tx_dlf_helper::getLL('flash.solrcoreOkay', TRUE), |
|
| 457 | + \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 458 | + FALSE |
|
| 459 | + ); |
|
| 460 | 460 | |
| 461 | - } else { |
|
| 461 | + } else { |
|
| 462 | 462 | |
| 463 | - // Default core available, but this is deprecated. |
|
| 464 | - $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'addSolrcore'))); |
|
| 463 | + // Default core available, but this is deprecated. |
|
| 464 | + $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'addSolrcore'))); |
|
| 465 | 465 | |
| 466 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 467 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 468 | - sprintf(tx_dlf_helper::getLL('flash.solrcoreDeprecatedMsg'), $_url), |
|
| 469 | - tx_dlf_helper::getLL('flash.solrcoreDeprecatedOkay', TRUE), |
|
| 470 | - \TYPO3\CMS\Core\Messaging\FlashMessage::NOTICE, |
|
| 471 | - FALSE |
|
| 472 | - ); |
|
| 466 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 467 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 468 | + sprintf(tx_dlf_helper::getLL('flash.solrcoreDeprecatedMsg'), $_url), |
|
| 469 | + tx_dlf_helper::getLL('flash.solrcoreDeprecatedOkay', TRUE), |
|
| 470 | + \TYPO3\CMS\Core\Messaging\FlashMessage::NOTICE, |
|
| 471 | + FALSE |
|
| 472 | + ); |
|
| 473 | 473 | |
| 474 | - } |
|
| 474 | + } |
|
| 475 | 475 | |
| 476 | - } else { |
|
| 476 | + } else { |
|
| 477 | 477 | |
| 478 | - // Solr core missing. |
|
| 479 | - $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'addSolrcore'))); |
|
| 478 | + // Solr core missing. |
|
| 479 | + $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'addSolrcore'))); |
|
| 480 | 480 | |
| 481 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 482 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 483 | - sprintf(tx_dlf_helper::getLL('flash.solrcoreMissingMsg'), $_url), |
|
| 484 | - tx_dlf_helper::getLL('flash.solrcoreMissing', TRUE), |
|
| 485 | - \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING, |
|
| 486 | - FALSE |
|
| 487 | - ); |
|
| 481 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 482 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 483 | + sprintf(tx_dlf_helper::getLL('flash.solrcoreMissingMsg'), $_url), |
|
| 484 | + tx_dlf_helper::getLL('flash.solrcoreMissing', TRUE), |
|
| 485 | + \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING, |
|
| 486 | + FALSE |
|
| 487 | + ); |
|
| 488 | 488 | |
| 489 | - } |
|
| 489 | + } |
|
| 490 | 490 | |
| 491 | - tx_dlf_helper::addMessage($_message); |
|
| 491 | + tx_dlf_helper::addMessage($_message); |
|
| 492 | 492 | |
| 493 | - $this->markerArray['CONTENT'] .= tx_dlf_helper::renderFlashMessages(); |
|
| 493 | + $this->markerArray['CONTENT'] .= tx_dlf_helper::renderFlashMessages(); |
|
| 494 | 494 | |
| 495 | - } else { |
|
| 495 | + } else { |
|
| 496 | 496 | |
| 497 | - // TODO: Ändern! |
|
| 498 | - $this->markerArray['CONTENT'] .= 'You are not allowed to access this page or have not selected a page, yet.'; |
|
| 497 | + // TODO: Ändern! |
|
| 498 | + $this->markerArray['CONTENT'] .= 'You are not allowed to access this page or have not selected a page, yet.'; |
|
| 499 | 499 | |
| 500 | - } |
|
| 500 | + } |
|
| 501 | 501 | |
| 502 | - $this->printContent(); |
|
| 502 | + $this->printContent(); |
|
| 503 | 503 | |
| 504 | - } |
|
| 504 | + } |
|
| 505 | 505 | |
| 506 | 506 | } |
| 507 | 507 | |
@@ -21,11 +21,11 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | protected $modPath = 'newclient/'; |
| 23 | 23 | |
| 24 | - protected $buttonArray = array ( |
|
| 24 | + protected $buttonArray = array( |
|
| 25 | 25 | 'SHORTCUT' => '', |
| 26 | 26 | ); |
| 27 | 27 | |
| 28 | - protected $markerArray = array ( |
|
| 28 | + protected $markerArray = array( |
|
| 29 | 29 | 'CSH' => '', |
| 30 | 30 | 'MOD_MENU' => '', |
| 31 | 31 | 'CONTENT' => '', |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | // Build data array. |
| 93 | 93 | foreach ($metadata as $index_name => $values) { |
| 94 | 94 | |
| 95 | - $formatIds = array (); |
|
| 95 | + $formatIds = array(); |
|
| 96 | 96 | |
| 97 | 97 | foreach ($values['format'] as $format) { |
| 98 | 98 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - $data['tx_dlf_metadata'][uniqid('NEW')] = array ( |
|
| 109 | + $data['tx_dlf_metadata'][uniqid('NEW')] = array( |
|
| 110 | 110 | 'pid' => intval($this->id), |
| 111 | 111 | 'label' => $GLOBALS['LANG']->getLL($index_name), |
| 112 | 112 | 'index_name' => $index_name, |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | protected function cmdAddSolrCore() { |
| 169 | 169 | |
| 170 | 170 | // Build data array. |
| 171 | - $data['tx_dlf_solrcores'][uniqid('NEW')] = array ( |
|
| 171 | + $data['tx_dlf_solrcores'][uniqid('NEW')] = array( |
|
| 172 | 172 | 'pid' => intval($this->id), |
| 173 | 173 | 'label' => $GLOBALS['LANG']->getLL('solrcore').' (PID '.$this->id.')', |
| 174 | 174 | 'index_name' => '', |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | // Build data array. |
| 221 | 221 | foreach ($structures as $index_name => $values) { |
| 222 | 222 | |
| 223 | - $data['tx_dlf_structures'][uniqid('NEW')] = array ( |
|
| 223 | + $data['tx_dlf_structures'][uniqid('NEW')] = array( |
|
| 224 | 224 | 'pid' => intval($this->id), |
| 225 | 225 | 'toplevel' => $values['toplevel'], |
| 226 | 226 | 'label' => $GLOBALS['LANG']->getLL($index_name), |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | } else { |
| 336 | 336 | |
| 337 | 337 | // Configuration missing. |
| 338 | - $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'addStructure'))); |
|
| 338 | + $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('id' => $this->id, 'CMD' => 'addStructure'))); |
|
| 339 | 339 | |
| 340 | 340 | $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
| 341 | 341 | 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | } else { |
| 371 | 371 | |
| 372 | 372 | // Configuration missing. |
| 373 | - $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'addMetadata'))); |
|
| 373 | + $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('id' => $this->id, 'CMD' => 'addMetadata'))); |
|
| 374 | 374 | |
| 375 | 375 | $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
| 376 | 376 | 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | } else { |
| 410 | 410 | |
| 411 | 411 | // Configuration missing. |
| 412 | - $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'addAccessRights'))); |
|
| 412 | + $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('id' => $this->id, 'CMD' => 'addAccessRights'))); |
|
| 413 | 413 | |
| 414 | 414 | $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
| 415 | 415 | 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | } else { |
| 462 | 462 | |
| 463 | 463 | // Default core available, but this is deprecated. |
| 464 | - $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'addSolrcore'))); |
|
| 464 | + $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('id' => $this->id, 'CMD' => 'addSolrcore'))); |
|
| 465 | 465 | |
| 466 | 466 | $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
| 467 | 467 | 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | } else { |
| 477 | 477 | |
| 478 | 478 | // Solr core missing. |
| 479 | - $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'addSolrcore'))); |
|
| 479 | + $_url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('id' => $this->id, 'CMD' => 'addSolrcore'))); |
|
| 480 | 480 | |
| 481 | 481 | $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
| 482 | 482 | 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
@@ -12,328 +12,328 @@ |
||
| 12 | 12 | // Define metadata elements. |
| 13 | 13 | // @see http://dfg-viewer.de/en/profile-of-the-metadata/ |
| 14 | 14 | $metadata = array ( |
| 15 | - 'type' => array ( |
|
| 16 | - 'format' => array (), |
|
| 17 | - 'default_value' => '', |
|
| 18 | - 'wrap' => '', |
|
| 19 | - 'index_tokenized' => 0, |
|
| 20 | - 'index_stored' => 1, |
|
| 21 | - 'index_indexed' => 0, |
|
| 22 | - 'index_boost' => 1.00, |
|
| 23 | - 'is_sortable' => 1, |
|
| 24 | - 'is_facet' => 1, |
|
| 25 | - 'is_listed' => 1, |
|
| 26 | - 'index_autocomplete' => 0, |
|
| 27 | - ), |
|
| 28 | - 'title' => array ( |
|
| 29 | - 'format' => array ( |
|
| 30 | - array ( |
|
| 31 | - 'encoded' => 1, |
|
| 32 | - 'xpath' => 'concat(./mods:titleInfo/mods:nonSort," ",./mods:titleInfo/mods:title)', |
|
| 33 | - 'xpath_sorting' => './mods:titleInfo/mods:title', |
|
| 34 | - ), |
|
| 35 | - array ( |
|
| 36 | - 'encoded' => 2, |
|
| 37 | - 'xpath' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:head/teihdr:note[@type="caption"]', |
|
| 38 | - 'xpath_sorting' => '', |
|
| 39 | - ), |
|
| 40 | - ), |
|
| 41 | - 'default_value' => '', |
|
| 42 | - 'wrap' => "key.wrap = <dt class=\"tx-dlf-metadata-title\">|</dt>\nvalue.required = 1\nvalue.wrap = <dd class=\"tx-dlf-metadata-title\">|</dd>", |
|
| 43 | - 'index_tokenized' => 1, |
|
| 44 | - 'index_stored' => 1, |
|
| 45 | - 'index_indexed' => 1, |
|
| 46 | - 'index_boost' => 2.00, |
|
| 47 | - 'is_sortable' => 1, |
|
| 48 | - 'is_facet' => 0, |
|
| 49 | - 'is_listed' => 1, |
|
| 50 | - 'index_autocomplete' => 1, |
|
| 51 | - ), |
|
| 52 | - 'volume' => array ( |
|
| 53 | - 'format' => array ( |
|
| 54 | - array ( |
|
| 55 | - 'encoded' => 1, |
|
| 56 | - 'xpath' => './mods:part/mods:detail/mods:number', |
|
| 57 | - 'xpath_sorting' => './mods:part[@type="host"]/@order', |
|
| 58 | - ), |
|
| 59 | - ), |
|
| 60 | - 'default_value' => '', |
|
| 61 | - 'wrap' => '', |
|
| 62 | - 'index_tokenized' => 0, |
|
| 63 | - 'index_stored' => 1, |
|
| 64 | - 'index_indexed' => 0, |
|
| 65 | - 'index_boost' => 1.00, |
|
| 66 | - 'is_sortable' => 1, |
|
| 67 | - 'is_facet' => 0, |
|
| 68 | - 'is_listed' => 1, |
|
| 69 | - 'index_autocomplete' => 0, |
|
| 70 | - ), |
|
| 71 | - 'author' => array ( |
|
| 72 | - 'format' => array ( |
|
| 73 | - array ( |
|
| 74 | - 'encoded' => 2, |
|
| 75 | - 'xpath' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:head/teihdr:name', |
|
| 76 | - 'xpath_sorting' => '', |
|
| 77 | - ), |
|
| 78 | - ), |
|
| 79 | - 'default_value' => '', |
|
| 80 | - 'wrap' => '', |
|
| 81 | - 'index_tokenized' => 1, |
|
| 82 | - 'index_stored' => 1, |
|
| 83 | - 'index_indexed' => 1, |
|
| 84 | - 'index_boost' => 2.00, |
|
| 85 | - 'is_sortable' => 1, |
|
| 86 | - 'is_facet' => 1, |
|
| 87 | - 'is_listed' => 1, |
|
| 88 | - 'index_autocomplete' => 1, |
|
| 89 | - ), |
|
| 90 | - 'place' => array ( |
|
| 91 | - 'format' => array ( |
|
| 92 | - array ( |
|
| 93 | - 'encoded' => 2, |
|
| 94 | - 'xpath' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:head/teihdr:origPlace', |
|
| 95 | - 'xpath_sorting' => '', |
|
| 96 | - ), |
|
| 97 | - ), |
|
| 98 | - 'default_value' => '', |
|
| 99 | - 'wrap' => '', |
|
| 100 | - 'index_tokenized' => 1, |
|
| 101 | - 'index_stored' => 1, |
|
| 102 | - 'index_indexed' => 1, |
|
| 103 | - 'index_boost' => 1.00, |
|
| 104 | - 'is_sortable' => 1, |
|
| 105 | - 'is_facet' => 1, |
|
| 106 | - 'is_listed' => 1, |
|
| 107 | - 'index_autocomplete' => 0, |
|
| 108 | - ), |
|
| 109 | - 'year' => array ( |
|
| 110 | - 'format' => array ( |
|
| 111 | - array ( |
|
| 112 | - 'encoded' => 2, |
|
| 113 | - 'xpath' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:head/teihdr:origDate', |
|
| 114 | - 'xpath_sorting' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:head/teihdr:origDate/@when', |
|
| 115 | - ), |
|
| 116 | - ), |
|
| 117 | - 'default_value' => '', |
|
| 118 | - 'wrap' => '', |
|
| 119 | - 'index_tokenized' => 0, |
|
| 120 | - 'index_stored' => 1, |
|
| 121 | - 'index_indexed' => 1, |
|
| 122 | - 'index_boost' => 1.00, |
|
| 123 | - 'is_sortable' => 1, |
|
| 124 | - 'is_facet' => 1, |
|
| 125 | - 'is_listed' => 1, |
|
| 126 | - 'index_autocomplete' => 0, |
|
| 127 | - ), |
|
| 128 | - 'language' => array ( |
|
| 129 | - 'format' => array ( |
|
| 130 | - array ( |
|
| 131 | - 'encoded' => 1, |
|
| 132 | - 'xpath' => './mods:language/mods:languageTerm', |
|
| 133 | - 'xpath_sorting' => '', |
|
| 134 | - ), |
|
| 135 | - ), |
|
| 136 | - 'default_value' => '', |
|
| 137 | - 'wrap' => '', |
|
| 138 | - 'index_tokenized' => 0, |
|
| 139 | - 'index_stored' => 0, |
|
| 140 | - 'index_indexed' => 1, |
|
| 141 | - 'index_boost' => 1.00, |
|
| 142 | - 'is_sortable' => 0, |
|
| 143 | - 'is_facet' => 1, |
|
| 144 | - 'is_listed' => 0, |
|
| 145 | - 'index_autocomplete' => 0, |
|
| 146 | - ), |
|
| 147 | - 'collection' => array ( |
|
| 148 | - 'format' => array ( |
|
| 149 | - array ( |
|
| 150 | - 'encoded' => 1, |
|
| 151 | - 'xpath' => './mods:classification', |
|
| 152 | - 'xpath_sorting' => '', |
|
| 153 | - ), |
|
| 154 | - array ( |
|
| 155 | - 'encoded' => 2, |
|
| 156 | - 'xpath' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:msIdentifier/teihdr:collection', |
|
| 157 | - 'xpath_sorting' => '', |
|
| 158 | - ), |
|
| 159 | - ), |
|
| 160 | - 'default_value' => '', |
|
| 161 | - 'wrap' => '', |
|
| 162 | - 'index_tokenized' => 1, |
|
| 163 | - 'index_stored' => 0, |
|
| 164 | - 'index_indexed' => 1, |
|
| 165 | - 'index_boost' => 1.00, |
|
| 166 | - 'is_sortable' => 0, |
|
| 167 | - 'is_facet' => 1, |
|
| 168 | - 'is_listed' => 0, |
|
| 169 | - 'index_autocomplete' => 0, |
|
| 170 | - ), |
|
| 171 | - 'owner' => array ( |
|
| 172 | - 'format' => array ( |
|
| 173 | - array ( |
|
| 174 | - 'encoded' => 1, |
|
| 175 | - 'xpath' => './mods:name[./mods:role/mods:roleTerm="own"]/mods:displayForm', |
|
| 176 | - 'xpath_sorting' => '', |
|
| 177 | - ), |
|
| 178 | - array ( |
|
| 179 | - 'encoded' => 2, |
|
| 180 | - 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:publisher', |
|
| 181 | - 'xpath_sorting' => '', |
|
| 182 | - ), |
|
| 183 | - ), |
|
| 184 | - 'default_value' => '', |
|
| 185 | - 'wrap' => '', |
|
| 186 | - 'index_tokenized' => 0, |
|
| 187 | - 'index_stored' => 0, |
|
| 188 | - 'index_indexed' => 1, |
|
| 189 | - 'index_boost' => 1.00, |
|
| 190 | - 'is_sortable' => 0, |
|
| 191 | - 'is_facet' => 1, |
|
| 192 | - 'is_listed' => 0, |
|
| 193 | - 'index_autocomplete' => 0, |
|
| 194 | - ), |
|
| 195 | - 'purl' => array ( |
|
| 196 | - 'format' => array ( |
|
| 197 | - array ( |
|
| 198 | - 'encoded' => 1, |
|
| 199 | - 'xpath' => './mods:identifier[@type="purl"]', |
|
| 200 | - 'xpath_sorting' => '', |
|
| 201 | - ), |
|
| 202 | - array ( |
|
| 203 | - 'encoded' => 2, |
|
| 204 | - 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="purl"]', |
|
| 205 | - 'xpath_sorting' => '', |
|
| 206 | - ), |
|
| 207 | - ), |
|
| 208 | - 'default_value' => '', |
|
| 209 | - 'wrap' => "key.wrap = <dt>|</dt>\nvalue.required = 1\nvalue.setContentToCurrent = 1\nvalue.typolink.parameter.current = 1\nvalue.wrap = <dd>|</dd>", |
|
| 210 | - 'index_tokenized' => 0, |
|
| 211 | - 'index_stored' => 0, |
|
| 212 | - 'index_indexed' => 0, |
|
| 213 | - 'index_boost' => 1.00, |
|
| 214 | - 'is_sortable' => 0, |
|
| 215 | - 'is_facet' => 0, |
|
| 216 | - 'is_listed' => 0, |
|
| 217 | - 'index_autocomplete' => 0, |
|
| 218 | - ), |
|
| 219 | - 'urn' => array ( |
|
| 220 | - 'format' => array ( |
|
| 221 | - array ( |
|
| 222 | - 'encoded' => 1, |
|
| 223 | - 'xpath' => './mods:identifier[@type="urn"]', |
|
| 224 | - 'xpath_sorting' => '', |
|
| 225 | - ), |
|
| 226 | - array ( |
|
| 227 | - 'encoded' => 2, |
|
| 228 | - 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="urn"]', |
|
| 229 | - 'xpath_sorting' => '', |
|
| 230 | - ), |
|
| 231 | - ), |
|
| 232 | - 'default_value' => '', |
|
| 233 | - 'wrap' => "key.wrap = <dt>|</dt>\nvalue.required = 1\nvalue.setContentToCurrent = 1\nvalue.typolink.parameter.current = 1\nvalue.typolink.parameter.prepend = TEXT\nvalue.typolink.parameter.prepend.value = http://nbn-resolving.de/\nvalue.wrap = <dd>|</dd>", |
|
| 234 | - 'index_tokenized' => 0, |
|
| 235 | - 'index_stored' => 0, |
|
| 236 | - 'index_indexed' => 1, |
|
| 237 | - 'index_boost' => 1.00, |
|
| 238 | - 'is_sortable' => 0, |
|
| 239 | - 'is_facet' => 0, |
|
| 240 | - 'is_listed' => 0, |
|
| 241 | - 'index_autocomplete' => 0, |
|
| 242 | - ), |
|
| 243 | - 'opac_id' => array ( |
|
| 244 | - 'format' => array ( |
|
| 245 | - array ( |
|
| 246 | - 'encoded' => 1, |
|
| 247 | - 'xpath' => './mods:identifier[@type="opac"]', |
|
| 248 | - 'xpath_sorting' => '', |
|
| 249 | - ), |
|
| 250 | - array ( |
|
| 251 | - 'encoded' => 2, |
|
| 252 | - 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="opac"]', |
|
| 253 | - 'xpath_sorting' => '', |
|
| 254 | - ), |
|
| 255 | - ), |
|
| 256 | - 'default_value' => '', |
|
| 257 | - 'wrap' => '', |
|
| 258 | - 'index_tokenized' => 0, |
|
| 259 | - 'index_stored' => 0, |
|
| 260 | - 'index_indexed' => 1, |
|
| 261 | - 'index_boost' => 1.00, |
|
| 262 | - 'is_sortable' => 0, |
|
| 263 | - 'is_facet' => 0, |
|
| 264 | - 'is_listed' => 0, |
|
| 265 | - 'index_autocomplete' => 0, |
|
| 266 | - ), |
|
| 267 | - 'union_id' => array ( |
|
| 268 | - 'format' => array ( |
|
| 269 | - array ( |
|
| 270 | - 'encoded' => 1, |
|
| 271 | - 'xpath' => './mods:identifier[@type="ppn"]', |
|
| 272 | - 'xpath_sorting' => '', |
|
| 273 | - ), |
|
| 274 | - array ( |
|
| 275 | - 'encoded' => 2, |
|
| 276 | - 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="mmid"]', |
|
| 277 | - 'xpath_sorting' => '', |
|
| 278 | - ), |
|
| 279 | - ), |
|
| 280 | - 'default_value' => '', |
|
| 281 | - 'wrap' => '', |
|
| 282 | - 'index_tokenized' => 0, |
|
| 283 | - 'index_stored' => 0, |
|
| 284 | - 'index_indexed' => 1, |
|
| 285 | - 'index_boost' => 1.00, |
|
| 286 | - 'is_sortable' => 0, |
|
| 287 | - 'is_facet' => 0, |
|
| 288 | - 'is_listed' => 0, |
|
| 289 | - 'index_autocomplete' => 0, |
|
| 290 | - ), |
|
| 291 | - 'record_id' => array ( |
|
| 292 | - 'format' => array ( |
|
| 293 | - array ( |
|
| 294 | - 'encoded' => 1, |
|
| 295 | - 'xpath' => './mods:recordInfo/mods:recordIdentifier', |
|
| 296 | - 'xpath_sorting' => '', |
|
| 297 | - ), |
|
| 298 | - array ( |
|
| 299 | - 'encoded' => 2, |
|
| 300 | - 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="recordIdentifier"]', |
|
| 301 | - 'xpath_sorting' => '', |
|
| 302 | - ), |
|
| 303 | - ), |
|
| 304 | - 'default_value' => '', |
|
| 305 | - 'wrap' => '', |
|
| 306 | - 'index_tokenized' => 0, |
|
| 307 | - 'index_stored' => 0, |
|
| 308 | - 'index_indexed' => 1, |
|
| 309 | - 'index_boost' => 1.00, |
|
| 310 | - 'is_sortable' => 0, |
|
| 311 | - 'is_facet' => 0, |
|
| 312 | - 'is_listed' => 0, |
|
| 313 | - 'index_autocomplete' => 0, |
|
| 314 | - ), |
|
| 315 | - 'prod_id' => array ( |
|
| 316 | - 'format' => array ( |
|
| 317 | - array ( |
|
| 318 | - 'encoded' => 1, |
|
| 319 | - 'xpath' => './mods:identifier[@type="goobi"]', |
|
| 320 | - 'xpath_sorting' => '', |
|
| 321 | - ), |
|
| 322 | - array ( |
|
| 323 | - 'encoded' => 2, |
|
| 324 | - 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="goobi"]', |
|
| 325 | - 'xpath_sorting' => '', |
|
| 326 | - ), |
|
| 327 | - ), |
|
| 328 | - 'default_value' => '', |
|
| 329 | - 'wrap' => '', |
|
| 330 | - 'index_tokenized' => 0, |
|
| 331 | - 'index_stored' => 0, |
|
| 332 | - 'index_indexed' => 0, |
|
| 333 | - 'index_boost' => 0.00, |
|
| 334 | - 'is_sortable' => 0, |
|
| 335 | - 'is_facet' => 0, |
|
| 336 | - 'is_listed' => 0, |
|
| 337 | - 'index_autocomplete' => 0, |
|
| 338 | - ) |
|
| 15 | + 'type' => array ( |
|
| 16 | + 'format' => array (), |
|
| 17 | + 'default_value' => '', |
|
| 18 | + 'wrap' => '', |
|
| 19 | + 'index_tokenized' => 0, |
|
| 20 | + 'index_stored' => 1, |
|
| 21 | + 'index_indexed' => 0, |
|
| 22 | + 'index_boost' => 1.00, |
|
| 23 | + 'is_sortable' => 1, |
|
| 24 | + 'is_facet' => 1, |
|
| 25 | + 'is_listed' => 1, |
|
| 26 | + 'index_autocomplete' => 0, |
|
| 27 | + ), |
|
| 28 | + 'title' => array ( |
|
| 29 | + 'format' => array ( |
|
| 30 | + array ( |
|
| 31 | + 'encoded' => 1, |
|
| 32 | + 'xpath' => 'concat(./mods:titleInfo/mods:nonSort," ",./mods:titleInfo/mods:title)', |
|
| 33 | + 'xpath_sorting' => './mods:titleInfo/mods:title', |
|
| 34 | + ), |
|
| 35 | + array ( |
|
| 36 | + 'encoded' => 2, |
|
| 37 | + 'xpath' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:head/teihdr:note[@type="caption"]', |
|
| 38 | + 'xpath_sorting' => '', |
|
| 39 | + ), |
|
| 40 | + ), |
|
| 41 | + 'default_value' => '', |
|
| 42 | + 'wrap' => "key.wrap = <dt class=\"tx-dlf-metadata-title\">|</dt>\nvalue.required = 1\nvalue.wrap = <dd class=\"tx-dlf-metadata-title\">|</dd>", |
|
| 43 | + 'index_tokenized' => 1, |
|
| 44 | + 'index_stored' => 1, |
|
| 45 | + 'index_indexed' => 1, |
|
| 46 | + 'index_boost' => 2.00, |
|
| 47 | + 'is_sortable' => 1, |
|
| 48 | + 'is_facet' => 0, |
|
| 49 | + 'is_listed' => 1, |
|
| 50 | + 'index_autocomplete' => 1, |
|
| 51 | + ), |
|
| 52 | + 'volume' => array ( |
|
| 53 | + 'format' => array ( |
|
| 54 | + array ( |
|
| 55 | + 'encoded' => 1, |
|
| 56 | + 'xpath' => './mods:part/mods:detail/mods:number', |
|
| 57 | + 'xpath_sorting' => './mods:part[@type="host"]/@order', |
|
| 58 | + ), |
|
| 59 | + ), |
|
| 60 | + 'default_value' => '', |
|
| 61 | + 'wrap' => '', |
|
| 62 | + 'index_tokenized' => 0, |
|
| 63 | + 'index_stored' => 1, |
|
| 64 | + 'index_indexed' => 0, |
|
| 65 | + 'index_boost' => 1.00, |
|
| 66 | + 'is_sortable' => 1, |
|
| 67 | + 'is_facet' => 0, |
|
| 68 | + 'is_listed' => 1, |
|
| 69 | + 'index_autocomplete' => 0, |
|
| 70 | + ), |
|
| 71 | + 'author' => array ( |
|
| 72 | + 'format' => array ( |
|
| 73 | + array ( |
|
| 74 | + 'encoded' => 2, |
|
| 75 | + 'xpath' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:head/teihdr:name', |
|
| 76 | + 'xpath_sorting' => '', |
|
| 77 | + ), |
|
| 78 | + ), |
|
| 79 | + 'default_value' => '', |
|
| 80 | + 'wrap' => '', |
|
| 81 | + 'index_tokenized' => 1, |
|
| 82 | + 'index_stored' => 1, |
|
| 83 | + 'index_indexed' => 1, |
|
| 84 | + 'index_boost' => 2.00, |
|
| 85 | + 'is_sortable' => 1, |
|
| 86 | + 'is_facet' => 1, |
|
| 87 | + 'is_listed' => 1, |
|
| 88 | + 'index_autocomplete' => 1, |
|
| 89 | + ), |
|
| 90 | + 'place' => array ( |
|
| 91 | + 'format' => array ( |
|
| 92 | + array ( |
|
| 93 | + 'encoded' => 2, |
|
| 94 | + 'xpath' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:head/teihdr:origPlace', |
|
| 95 | + 'xpath_sorting' => '', |
|
| 96 | + ), |
|
| 97 | + ), |
|
| 98 | + 'default_value' => '', |
|
| 99 | + 'wrap' => '', |
|
| 100 | + 'index_tokenized' => 1, |
|
| 101 | + 'index_stored' => 1, |
|
| 102 | + 'index_indexed' => 1, |
|
| 103 | + 'index_boost' => 1.00, |
|
| 104 | + 'is_sortable' => 1, |
|
| 105 | + 'is_facet' => 1, |
|
| 106 | + 'is_listed' => 1, |
|
| 107 | + 'index_autocomplete' => 0, |
|
| 108 | + ), |
|
| 109 | + 'year' => array ( |
|
| 110 | + 'format' => array ( |
|
| 111 | + array ( |
|
| 112 | + 'encoded' => 2, |
|
| 113 | + 'xpath' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:head/teihdr:origDate', |
|
| 114 | + 'xpath_sorting' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:head/teihdr:origDate/@when', |
|
| 115 | + ), |
|
| 116 | + ), |
|
| 117 | + 'default_value' => '', |
|
| 118 | + 'wrap' => '', |
|
| 119 | + 'index_tokenized' => 0, |
|
| 120 | + 'index_stored' => 1, |
|
| 121 | + 'index_indexed' => 1, |
|
| 122 | + 'index_boost' => 1.00, |
|
| 123 | + 'is_sortable' => 1, |
|
| 124 | + 'is_facet' => 1, |
|
| 125 | + 'is_listed' => 1, |
|
| 126 | + 'index_autocomplete' => 0, |
|
| 127 | + ), |
|
| 128 | + 'language' => array ( |
|
| 129 | + 'format' => array ( |
|
| 130 | + array ( |
|
| 131 | + 'encoded' => 1, |
|
| 132 | + 'xpath' => './mods:language/mods:languageTerm', |
|
| 133 | + 'xpath_sorting' => '', |
|
| 134 | + ), |
|
| 135 | + ), |
|
| 136 | + 'default_value' => '', |
|
| 137 | + 'wrap' => '', |
|
| 138 | + 'index_tokenized' => 0, |
|
| 139 | + 'index_stored' => 0, |
|
| 140 | + 'index_indexed' => 1, |
|
| 141 | + 'index_boost' => 1.00, |
|
| 142 | + 'is_sortable' => 0, |
|
| 143 | + 'is_facet' => 1, |
|
| 144 | + 'is_listed' => 0, |
|
| 145 | + 'index_autocomplete' => 0, |
|
| 146 | + ), |
|
| 147 | + 'collection' => array ( |
|
| 148 | + 'format' => array ( |
|
| 149 | + array ( |
|
| 150 | + 'encoded' => 1, |
|
| 151 | + 'xpath' => './mods:classification', |
|
| 152 | + 'xpath_sorting' => '', |
|
| 153 | + ), |
|
| 154 | + array ( |
|
| 155 | + 'encoded' => 2, |
|
| 156 | + 'xpath' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:msIdentifier/teihdr:collection', |
|
| 157 | + 'xpath_sorting' => '', |
|
| 158 | + ), |
|
| 159 | + ), |
|
| 160 | + 'default_value' => '', |
|
| 161 | + 'wrap' => '', |
|
| 162 | + 'index_tokenized' => 1, |
|
| 163 | + 'index_stored' => 0, |
|
| 164 | + 'index_indexed' => 1, |
|
| 165 | + 'index_boost' => 1.00, |
|
| 166 | + 'is_sortable' => 0, |
|
| 167 | + 'is_facet' => 1, |
|
| 168 | + 'is_listed' => 0, |
|
| 169 | + 'index_autocomplete' => 0, |
|
| 170 | + ), |
|
| 171 | + 'owner' => array ( |
|
| 172 | + 'format' => array ( |
|
| 173 | + array ( |
|
| 174 | + 'encoded' => 1, |
|
| 175 | + 'xpath' => './mods:name[./mods:role/mods:roleTerm="own"]/mods:displayForm', |
|
| 176 | + 'xpath_sorting' => '', |
|
| 177 | + ), |
|
| 178 | + array ( |
|
| 179 | + 'encoded' => 2, |
|
| 180 | + 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:publisher', |
|
| 181 | + 'xpath_sorting' => '', |
|
| 182 | + ), |
|
| 183 | + ), |
|
| 184 | + 'default_value' => '', |
|
| 185 | + 'wrap' => '', |
|
| 186 | + 'index_tokenized' => 0, |
|
| 187 | + 'index_stored' => 0, |
|
| 188 | + 'index_indexed' => 1, |
|
| 189 | + 'index_boost' => 1.00, |
|
| 190 | + 'is_sortable' => 0, |
|
| 191 | + 'is_facet' => 1, |
|
| 192 | + 'is_listed' => 0, |
|
| 193 | + 'index_autocomplete' => 0, |
|
| 194 | + ), |
|
| 195 | + 'purl' => array ( |
|
| 196 | + 'format' => array ( |
|
| 197 | + array ( |
|
| 198 | + 'encoded' => 1, |
|
| 199 | + 'xpath' => './mods:identifier[@type="purl"]', |
|
| 200 | + 'xpath_sorting' => '', |
|
| 201 | + ), |
|
| 202 | + array ( |
|
| 203 | + 'encoded' => 2, |
|
| 204 | + 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="purl"]', |
|
| 205 | + 'xpath_sorting' => '', |
|
| 206 | + ), |
|
| 207 | + ), |
|
| 208 | + 'default_value' => '', |
|
| 209 | + 'wrap' => "key.wrap = <dt>|</dt>\nvalue.required = 1\nvalue.setContentToCurrent = 1\nvalue.typolink.parameter.current = 1\nvalue.wrap = <dd>|</dd>", |
|
| 210 | + 'index_tokenized' => 0, |
|
| 211 | + 'index_stored' => 0, |
|
| 212 | + 'index_indexed' => 0, |
|
| 213 | + 'index_boost' => 1.00, |
|
| 214 | + 'is_sortable' => 0, |
|
| 215 | + 'is_facet' => 0, |
|
| 216 | + 'is_listed' => 0, |
|
| 217 | + 'index_autocomplete' => 0, |
|
| 218 | + ), |
|
| 219 | + 'urn' => array ( |
|
| 220 | + 'format' => array ( |
|
| 221 | + array ( |
|
| 222 | + 'encoded' => 1, |
|
| 223 | + 'xpath' => './mods:identifier[@type="urn"]', |
|
| 224 | + 'xpath_sorting' => '', |
|
| 225 | + ), |
|
| 226 | + array ( |
|
| 227 | + 'encoded' => 2, |
|
| 228 | + 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="urn"]', |
|
| 229 | + 'xpath_sorting' => '', |
|
| 230 | + ), |
|
| 231 | + ), |
|
| 232 | + 'default_value' => '', |
|
| 233 | + 'wrap' => "key.wrap = <dt>|</dt>\nvalue.required = 1\nvalue.setContentToCurrent = 1\nvalue.typolink.parameter.current = 1\nvalue.typolink.parameter.prepend = TEXT\nvalue.typolink.parameter.prepend.value = http://nbn-resolving.de/\nvalue.wrap = <dd>|</dd>", |
|
| 234 | + 'index_tokenized' => 0, |
|
| 235 | + 'index_stored' => 0, |
|
| 236 | + 'index_indexed' => 1, |
|
| 237 | + 'index_boost' => 1.00, |
|
| 238 | + 'is_sortable' => 0, |
|
| 239 | + 'is_facet' => 0, |
|
| 240 | + 'is_listed' => 0, |
|
| 241 | + 'index_autocomplete' => 0, |
|
| 242 | + ), |
|
| 243 | + 'opac_id' => array ( |
|
| 244 | + 'format' => array ( |
|
| 245 | + array ( |
|
| 246 | + 'encoded' => 1, |
|
| 247 | + 'xpath' => './mods:identifier[@type="opac"]', |
|
| 248 | + 'xpath_sorting' => '', |
|
| 249 | + ), |
|
| 250 | + array ( |
|
| 251 | + 'encoded' => 2, |
|
| 252 | + 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="opac"]', |
|
| 253 | + 'xpath_sorting' => '', |
|
| 254 | + ), |
|
| 255 | + ), |
|
| 256 | + 'default_value' => '', |
|
| 257 | + 'wrap' => '', |
|
| 258 | + 'index_tokenized' => 0, |
|
| 259 | + 'index_stored' => 0, |
|
| 260 | + 'index_indexed' => 1, |
|
| 261 | + 'index_boost' => 1.00, |
|
| 262 | + 'is_sortable' => 0, |
|
| 263 | + 'is_facet' => 0, |
|
| 264 | + 'is_listed' => 0, |
|
| 265 | + 'index_autocomplete' => 0, |
|
| 266 | + ), |
|
| 267 | + 'union_id' => array ( |
|
| 268 | + 'format' => array ( |
|
| 269 | + array ( |
|
| 270 | + 'encoded' => 1, |
|
| 271 | + 'xpath' => './mods:identifier[@type="ppn"]', |
|
| 272 | + 'xpath_sorting' => '', |
|
| 273 | + ), |
|
| 274 | + array ( |
|
| 275 | + 'encoded' => 2, |
|
| 276 | + 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="mmid"]', |
|
| 277 | + 'xpath_sorting' => '', |
|
| 278 | + ), |
|
| 279 | + ), |
|
| 280 | + 'default_value' => '', |
|
| 281 | + 'wrap' => '', |
|
| 282 | + 'index_tokenized' => 0, |
|
| 283 | + 'index_stored' => 0, |
|
| 284 | + 'index_indexed' => 1, |
|
| 285 | + 'index_boost' => 1.00, |
|
| 286 | + 'is_sortable' => 0, |
|
| 287 | + 'is_facet' => 0, |
|
| 288 | + 'is_listed' => 0, |
|
| 289 | + 'index_autocomplete' => 0, |
|
| 290 | + ), |
|
| 291 | + 'record_id' => array ( |
|
| 292 | + 'format' => array ( |
|
| 293 | + array ( |
|
| 294 | + 'encoded' => 1, |
|
| 295 | + 'xpath' => './mods:recordInfo/mods:recordIdentifier', |
|
| 296 | + 'xpath_sorting' => '', |
|
| 297 | + ), |
|
| 298 | + array ( |
|
| 299 | + 'encoded' => 2, |
|
| 300 | + 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="recordIdentifier"]', |
|
| 301 | + 'xpath_sorting' => '', |
|
| 302 | + ), |
|
| 303 | + ), |
|
| 304 | + 'default_value' => '', |
|
| 305 | + 'wrap' => '', |
|
| 306 | + 'index_tokenized' => 0, |
|
| 307 | + 'index_stored' => 0, |
|
| 308 | + 'index_indexed' => 1, |
|
| 309 | + 'index_boost' => 1.00, |
|
| 310 | + 'is_sortable' => 0, |
|
| 311 | + 'is_facet' => 0, |
|
| 312 | + 'is_listed' => 0, |
|
| 313 | + 'index_autocomplete' => 0, |
|
| 314 | + ), |
|
| 315 | + 'prod_id' => array ( |
|
| 316 | + 'format' => array ( |
|
| 317 | + array ( |
|
| 318 | + 'encoded' => 1, |
|
| 319 | + 'xpath' => './mods:identifier[@type="goobi"]', |
|
| 320 | + 'xpath_sorting' => '', |
|
| 321 | + ), |
|
| 322 | + array ( |
|
| 323 | + 'encoded' => 2, |
|
| 324 | + 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="goobi"]', |
|
| 325 | + 'xpath_sorting' => '', |
|
| 326 | + ), |
|
| 327 | + ), |
|
| 328 | + 'default_value' => '', |
|
| 329 | + 'wrap' => '', |
|
| 330 | + 'index_tokenized' => 0, |
|
| 331 | + 'index_stored' => 0, |
|
| 332 | + 'index_indexed' => 0, |
|
| 333 | + 'index_boost' => 0.00, |
|
| 334 | + 'is_sortable' => 0, |
|
| 335 | + 'is_facet' => 0, |
|
| 336 | + 'is_listed' => 0, |
|
| 337 | + 'index_autocomplete' => 0, |
|
| 338 | + ) |
|
| 339 | 339 | ); |
@@ -11,9 +11,9 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | // Define metadata elements. |
| 13 | 13 | // @see http://dfg-viewer.de/en/profile-of-the-metadata/ |
| 14 | -$metadata = array ( |
|
| 15 | - 'type' => array ( |
|
| 16 | - 'format' => array (), |
|
| 14 | +$metadata = array( |
|
| 15 | + 'type' => array( |
|
| 16 | + 'format' => array(), |
|
| 17 | 17 | 'default_value' => '', |
| 18 | 18 | 'wrap' => '', |
| 19 | 19 | 'index_tokenized' => 0, |
@@ -25,14 +25,14 @@ discard block |
||
| 25 | 25 | 'is_listed' => 1, |
| 26 | 26 | 'index_autocomplete' => 0, |
| 27 | 27 | ), |
| 28 | - 'title' => array ( |
|
| 29 | - 'format' => array ( |
|
| 30 | - array ( |
|
| 28 | + 'title' => array( |
|
| 29 | + 'format' => array( |
|
| 30 | + array( |
|
| 31 | 31 | 'encoded' => 1, |
| 32 | 32 | 'xpath' => 'concat(./mods:titleInfo/mods:nonSort," ",./mods:titleInfo/mods:title)', |
| 33 | 33 | 'xpath_sorting' => './mods:titleInfo/mods:title', |
| 34 | 34 | ), |
| 35 | - array ( |
|
| 35 | + array( |
|
| 36 | 36 | 'encoded' => 2, |
| 37 | 37 | 'xpath' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:head/teihdr:note[@type="caption"]', |
| 38 | 38 | 'xpath_sorting' => '', |
@@ -49,9 +49,9 @@ discard block |
||
| 49 | 49 | 'is_listed' => 1, |
| 50 | 50 | 'index_autocomplete' => 1, |
| 51 | 51 | ), |
| 52 | - 'volume' => array ( |
|
| 53 | - 'format' => array ( |
|
| 54 | - array ( |
|
| 52 | + 'volume' => array( |
|
| 53 | + 'format' => array( |
|
| 54 | + array( |
|
| 55 | 55 | 'encoded' => 1, |
| 56 | 56 | 'xpath' => './mods:part/mods:detail/mods:number', |
| 57 | 57 | 'xpath_sorting' => './mods:part[@type="host"]/@order', |
@@ -68,9 +68,9 @@ discard block |
||
| 68 | 68 | 'is_listed' => 1, |
| 69 | 69 | 'index_autocomplete' => 0, |
| 70 | 70 | ), |
| 71 | - 'author' => array ( |
|
| 72 | - 'format' => array ( |
|
| 73 | - array ( |
|
| 71 | + 'author' => array( |
|
| 72 | + 'format' => array( |
|
| 73 | + array( |
|
| 74 | 74 | 'encoded' => 2, |
| 75 | 75 | 'xpath' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:head/teihdr:name', |
| 76 | 76 | 'xpath_sorting' => '', |
@@ -87,9 +87,9 @@ discard block |
||
| 87 | 87 | 'is_listed' => 1, |
| 88 | 88 | 'index_autocomplete' => 1, |
| 89 | 89 | ), |
| 90 | - 'place' => array ( |
|
| 91 | - 'format' => array ( |
|
| 92 | - array ( |
|
| 90 | + 'place' => array( |
|
| 91 | + 'format' => array( |
|
| 92 | + array( |
|
| 93 | 93 | 'encoded' => 2, |
| 94 | 94 | 'xpath' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:head/teihdr:origPlace', |
| 95 | 95 | 'xpath_sorting' => '', |
@@ -106,9 +106,9 @@ discard block |
||
| 106 | 106 | 'is_listed' => 1, |
| 107 | 107 | 'index_autocomplete' => 0, |
| 108 | 108 | ), |
| 109 | - 'year' => array ( |
|
| 110 | - 'format' => array ( |
|
| 111 | - array ( |
|
| 109 | + 'year' => array( |
|
| 110 | + 'format' => array( |
|
| 111 | + array( |
|
| 112 | 112 | 'encoded' => 2, |
| 113 | 113 | 'xpath' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:head/teihdr:origDate', |
| 114 | 114 | 'xpath_sorting' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:head/teihdr:origDate/@when', |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | 'is_listed' => 1, |
| 126 | 126 | 'index_autocomplete' => 0, |
| 127 | 127 | ), |
| 128 | - 'language' => array ( |
|
| 129 | - 'format' => array ( |
|
| 130 | - array ( |
|
| 128 | + 'language' => array( |
|
| 129 | + 'format' => array( |
|
| 130 | + array( |
|
| 131 | 131 | 'encoded' => 1, |
| 132 | 132 | 'xpath' => './mods:language/mods:languageTerm', |
| 133 | 133 | 'xpath_sorting' => '', |
@@ -144,14 +144,14 @@ discard block |
||
| 144 | 144 | 'is_listed' => 0, |
| 145 | 145 | 'index_autocomplete' => 0, |
| 146 | 146 | ), |
| 147 | - 'collection' => array ( |
|
| 148 | - 'format' => array ( |
|
| 149 | - array ( |
|
| 147 | + 'collection' => array( |
|
| 148 | + 'format' => array( |
|
| 149 | + array( |
|
| 150 | 150 | 'encoded' => 1, |
| 151 | 151 | 'xpath' => './mods:classification', |
| 152 | 152 | 'xpath_sorting' => '', |
| 153 | 153 | ), |
| 154 | - array ( |
|
| 154 | + array( |
|
| 155 | 155 | 'encoded' => 2, |
| 156 | 156 | 'xpath' => './teihdr:fileDesc/teihdr:sourceDesc/teihdr:msDesc/teihdr:msIdentifier/teihdr:collection', |
| 157 | 157 | 'xpath_sorting' => '', |
@@ -168,14 +168,14 @@ discard block |
||
| 168 | 168 | 'is_listed' => 0, |
| 169 | 169 | 'index_autocomplete' => 0, |
| 170 | 170 | ), |
| 171 | - 'owner' => array ( |
|
| 172 | - 'format' => array ( |
|
| 173 | - array ( |
|
| 171 | + 'owner' => array( |
|
| 172 | + 'format' => array( |
|
| 173 | + array( |
|
| 174 | 174 | 'encoded' => 1, |
| 175 | 175 | 'xpath' => './mods:name[./mods:role/mods:roleTerm="own"]/mods:displayForm', |
| 176 | 176 | 'xpath_sorting' => '', |
| 177 | 177 | ), |
| 178 | - array ( |
|
| 178 | + array( |
|
| 179 | 179 | 'encoded' => 2, |
| 180 | 180 | 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:publisher', |
| 181 | 181 | 'xpath_sorting' => '', |
@@ -192,14 +192,14 @@ discard block |
||
| 192 | 192 | 'is_listed' => 0, |
| 193 | 193 | 'index_autocomplete' => 0, |
| 194 | 194 | ), |
| 195 | - 'purl' => array ( |
|
| 196 | - 'format' => array ( |
|
| 197 | - array ( |
|
| 195 | + 'purl' => array( |
|
| 196 | + 'format' => array( |
|
| 197 | + array( |
|
| 198 | 198 | 'encoded' => 1, |
| 199 | 199 | 'xpath' => './mods:identifier[@type="purl"]', |
| 200 | 200 | 'xpath_sorting' => '', |
| 201 | 201 | ), |
| 202 | - array ( |
|
| 202 | + array( |
|
| 203 | 203 | 'encoded' => 2, |
| 204 | 204 | 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="purl"]', |
| 205 | 205 | 'xpath_sorting' => '', |
@@ -216,14 +216,14 @@ discard block |
||
| 216 | 216 | 'is_listed' => 0, |
| 217 | 217 | 'index_autocomplete' => 0, |
| 218 | 218 | ), |
| 219 | - 'urn' => array ( |
|
| 220 | - 'format' => array ( |
|
| 221 | - array ( |
|
| 219 | + 'urn' => array( |
|
| 220 | + 'format' => array( |
|
| 221 | + array( |
|
| 222 | 222 | 'encoded' => 1, |
| 223 | 223 | 'xpath' => './mods:identifier[@type="urn"]', |
| 224 | 224 | 'xpath_sorting' => '', |
| 225 | 225 | ), |
| 226 | - array ( |
|
| 226 | + array( |
|
| 227 | 227 | 'encoded' => 2, |
| 228 | 228 | 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="urn"]', |
| 229 | 229 | 'xpath_sorting' => '', |
@@ -240,14 +240,14 @@ discard block |
||
| 240 | 240 | 'is_listed' => 0, |
| 241 | 241 | 'index_autocomplete' => 0, |
| 242 | 242 | ), |
| 243 | - 'opac_id' => array ( |
|
| 244 | - 'format' => array ( |
|
| 245 | - array ( |
|
| 243 | + 'opac_id' => array( |
|
| 244 | + 'format' => array( |
|
| 245 | + array( |
|
| 246 | 246 | 'encoded' => 1, |
| 247 | 247 | 'xpath' => './mods:identifier[@type="opac"]', |
| 248 | 248 | 'xpath_sorting' => '', |
| 249 | 249 | ), |
| 250 | - array ( |
|
| 250 | + array( |
|
| 251 | 251 | 'encoded' => 2, |
| 252 | 252 | 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="opac"]', |
| 253 | 253 | 'xpath_sorting' => '', |
@@ -264,14 +264,14 @@ discard block |
||
| 264 | 264 | 'is_listed' => 0, |
| 265 | 265 | 'index_autocomplete' => 0, |
| 266 | 266 | ), |
| 267 | - 'union_id' => array ( |
|
| 268 | - 'format' => array ( |
|
| 269 | - array ( |
|
| 267 | + 'union_id' => array( |
|
| 268 | + 'format' => array( |
|
| 269 | + array( |
|
| 270 | 270 | 'encoded' => 1, |
| 271 | 271 | 'xpath' => './mods:identifier[@type="ppn"]', |
| 272 | 272 | 'xpath_sorting' => '', |
| 273 | 273 | ), |
| 274 | - array ( |
|
| 274 | + array( |
|
| 275 | 275 | 'encoded' => 2, |
| 276 | 276 | 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="mmid"]', |
| 277 | 277 | 'xpath_sorting' => '', |
@@ -288,14 +288,14 @@ discard block |
||
| 288 | 288 | 'is_listed' => 0, |
| 289 | 289 | 'index_autocomplete' => 0, |
| 290 | 290 | ), |
| 291 | - 'record_id' => array ( |
|
| 292 | - 'format' => array ( |
|
| 293 | - array ( |
|
| 291 | + 'record_id' => array( |
|
| 292 | + 'format' => array( |
|
| 293 | + array( |
|
| 294 | 294 | 'encoded' => 1, |
| 295 | 295 | 'xpath' => './mods:recordInfo/mods:recordIdentifier', |
| 296 | 296 | 'xpath_sorting' => '', |
| 297 | 297 | ), |
| 298 | - array ( |
|
| 298 | + array( |
|
| 299 | 299 | 'encoded' => 2, |
| 300 | 300 | 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="recordIdentifier"]', |
| 301 | 301 | 'xpath_sorting' => '', |
@@ -312,14 +312,14 @@ discard block |
||
| 312 | 312 | 'is_listed' => 0, |
| 313 | 313 | 'index_autocomplete' => 0, |
| 314 | 314 | ), |
| 315 | - 'prod_id' => array ( |
|
| 316 | - 'format' => array ( |
|
| 317 | - array ( |
|
| 315 | + 'prod_id' => array( |
|
| 316 | + 'format' => array( |
|
| 317 | + array( |
|
| 318 | 318 | 'encoded' => 1, |
| 319 | 319 | 'xpath' => './mods:identifier[@type="goobi"]', |
| 320 | 320 | 'xpath_sorting' => '', |
| 321 | 321 | ), |
| 322 | - array ( |
|
| 322 | + array( |
|
| 323 | 323 | 'encoded' => 2, |
| 324 | 324 | 'xpath' => './teihdr:fileDesc/teihdr:publicationStmt/teihdr:idno[@type="goobi"]', |
| 325 | 325 | 'xpath_sorting' => '', |
@@ -19,363 +19,363 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | class tx_dlf_modIndexing extends tx_dlf_module { |
| 21 | 21 | |
| 22 | - protected $modPath = 'indexing/'; |
|
| 22 | + protected $modPath = 'indexing/'; |
|
| 23 | 23 | |
| 24 | - protected $buttonArray = array ( |
|
| 25 | - 'SHORTCUT' => '', |
|
| 26 | - ); |
|
| 24 | + protected $buttonArray = array ( |
|
| 25 | + 'SHORTCUT' => '', |
|
| 26 | + ); |
|
| 27 | 27 | |
| 28 | - protected $markerArray = array ( |
|
| 29 | - 'CSH' => '', |
|
| 30 | - 'MOD_MENU' => '', |
|
| 31 | - 'CONTENT' => '', |
|
| 32 | - ); |
|
| 28 | + protected $markerArray = array ( |
|
| 29 | + 'CSH' => '', |
|
| 30 | + 'MOD_MENU' => '', |
|
| 31 | + 'CONTENT' => '', |
|
| 32 | + ); |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * This holds a list of documents to index |
|
| 36 | - * |
|
| 37 | - * @var tx_dlf_list |
|
| 38 | - * @access protected |
|
| 39 | - */ |
|
| 40 | - protected $list; |
|
| 34 | + /** |
|
| 35 | + * This holds a list of documents to index |
|
| 36 | + * |
|
| 37 | + * @var tx_dlf_list |
|
| 38 | + * @access protected |
|
| 39 | + */ |
|
| 40 | + protected $list; |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * Builds HTML form for selecting a collection |
|
| 44 | - * |
|
| 45 | - * @access protected |
|
| 46 | - * |
|
| 47 | - * @return string The HTML output |
|
| 48 | - */ |
|
| 49 | - protected function getCollList() { |
|
| 42 | + /** |
|
| 43 | + * Builds HTML form for selecting a collection |
|
| 44 | + * |
|
| 45 | + * @access protected |
|
| 46 | + * |
|
| 47 | + * @return string The HTML output |
|
| 48 | + */ |
|
| 49 | + protected function getCollList() { |
|
| 50 | 50 | |
| 51 | - // Get all available Solr cores. |
|
| 52 | - $_cores = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 53 | - 'tx_dlf_solrcores.label AS label,tx_dlf_solrcores.uid AS uid', |
|
| 54 | - 'tx_dlf_solrcores', |
|
| 55 | - 'tx_dlf_solrcores.pid IN (0,'.intval($this->id).')'.tx_dlf_helper::whereClause('tx_dlf_solrcores'), |
|
| 56 | - '', |
|
| 57 | - '', |
|
| 58 | - '' |
|
| 59 | - ); |
|
| 51 | + // Get all available Solr cores. |
|
| 52 | + $_cores = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 53 | + 'tx_dlf_solrcores.label AS label,tx_dlf_solrcores.uid AS uid', |
|
| 54 | + 'tx_dlf_solrcores', |
|
| 55 | + 'tx_dlf_solrcores.pid IN (0,'.intval($this->id).')'.tx_dlf_helper::whereClause('tx_dlf_solrcores'), |
|
| 56 | + '', |
|
| 57 | + '', |
|
| 58 | + '' |
|
| 59 | + ); |
|
| 60 | 60 | |
| 61 | - // Get all available collections. |
|
| 62 | - $_collections = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 63 | - 'tx_dlf_collections.label AS label,tx_dlf_collections.uid AS uid', |
|
| 64 | - 'tx_dlf_collections', |
|
| 65 | - 'tx_dlf_collections.fe_cruser_id=0 AND tx_dlf_collections.pid='.intval($this->id).tx_dlf_helper::whereClause('tx_dlf_collections'), |
|
| 66 | - '', |
|
| 67 | - 'tx_dlf_collections.label ASC', |
|
| 68 | - '' |
|
| 69 | - ); |
|
| 61 | + // Get all available collections. |
|
| 62 | + $_collections = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 63 | + 'tx_dlf_collections.label AS label,tx_dlf_collections.uid AS uid', |
|
| 64 | + 'tx_dlf_collections', |
|
| 65 | + 'tx_dlf_collections.fe_cruser_id=0 AND tx_dlf_collections.pid='.intval($this->id).tx_dlf_helper::whereClause('tx_dlf_collections'), |
|
| 66 | + '', |
|
| 67 | + 'tx_dlf_collections.label ASC', |
|
| 68 | + '' |
|
| 69 | + ); |
|
| 70 | 70 | |
| 71 | - // TODO: Ändern! |
|
| 72 | - $form = '<label for="tx-dlf-modIndexing-id">Kollektion:</label>'; |
|
| 71 | + // TODO: Ändern! |
|
| 72 | + $form = '<label for="tx-dlf-modIndexing-id">Kollektion:</label>'; |
|
| 73 | 73 | |
| 74 | - $form .= '<select id="tx-dlf-modIndexing-collection" name="'.$this->prefixId.'[collection]">'; |
|
| 74 | + $form .= '<select id="tx-dlf-modIndexing-collection" name="'.$this->prefixId.'[collection]">'; |
|
| 75 | 75 | |
| 76 | - $form .= '<option value="0">Alle</option>'; |
|
| 76 | + $form .= '<option value="0">Alle</option>'; |
|
| 77 | 77 | |
| 78 | - while ($_collection = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_collections)) { |
|
| 78 | + while ($_collection = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_collections)) { |
|
| 79 | 79 | |
| 80 | - $form .= '<option value="'.$_collection['uid'].'">'.htmlspecialchars($_collection['label']).'</option>'; |
|
| 80 | + $form .= '<option value="'.$_collection['uid'].'">'.htmlspecialchars($_collection['label']).'</option>'; |
|
| 81 | 81 | |
| 82 | - } |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - $form .= '</select><br />'; |
|
| 84 | + $form .= '</select><br />'; |
|
| 85 | 85 | |
| 86 | - $form .= '<select id="tx-dlf-modIndexing-core" name="'.$this->prefixId.'[core]">'; |
|
| 86 | + $form .= '<select id="tx-dlf-modIndexing-core" name="'.$this->prefixId.'[core]">'; |
|
| 87 | 87 | |
| 88 | - $form .= '<option value="0">---</option>'; |
|
| 88 | + $form .= '<option value="0">---</option>'; |
|
| 89 | 89 | |
| 90 | - while ($_core = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_cores)) { |
|
| 90 | + while ($_core = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_cores)) { |
|
| 91 | 91 | |
| 92 | - $form .= '<option value="'.$_core['uid'].'">'.htmlspecialchars($_core['label']).'</option>'; |
|
| 92 | + $form .= '<option value="'.$_core['uid'].'">'.htmlspecialchars($_core['label']).'</option>'; |
|
| 93 | 93 | |
| 94 | - } |
|
| 94 | + } |
|
| 95 | 95 | |
| 96 | - $form .= '</select><br />'; |
|
| 96 | + $form .= '</select><br />'; |
|
| 97 | 97 | |
| 98 | - $form .= '<input type="hidden" name="CMD" value="reindexDocs" />'; |
|
| 98 | + $form .= '<input type="hidden" name="CMD" value="reindexDocs" />'; |
|
| 99 | 99 | |
| 100 | - $form .= '<input type="submit" name="'.$this->prefixId.'[submit]" value="'.$GLOBALS['LANG']->getLL('form.submit').'" />'; |
|
| 100 | + $form .= '<input type="submit" name="'.$this->prefixId.'[submit]" value="'.$GLOBALS['LANG']->getLL('form.submit').'" />'; |
|
| 101 | 101 | |
| 102 | - return $form; |
|
| 102 | + return $form; |
|
| 103 | 103 | |
| 104 | - } |
|
| 104 | + } |
|
| 105 | 105 | |
| 106 | - /** |
|
| 107 | - * Builds HTML form for selecting a file |
|
| 108 | - * |
|
| 109 | - * @access protected |
|
| 110 | - * |
|
| 111 | - * @return string The HTML output |
|
| 112 | - */ |
|
| 113 | - protected function getFileForm() { |
|
| 106 | + /** |
|
| 107 | + * Builds HTML form for selecting a file |
|
| 108 | + * |
|
| 109 | + * @access protected |
|
| 110 | + * |
|
| 111 | + * @return string The HTML output |
|
| 112 | + */ |
|
| 113 | + protected function getFileForm() { |
|
| 114 | 114 | |
| 115 | - // Get all available Solr cores. |
|
| 116 | - $_cores = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 117 | - 'tx_dlf_solrcores.label AS label,tx_dlf_solrcores.uid AS uid', |
|
| 118 | - 'tx_dlf_solrcores', |
|
| 119 | - 'tx_dlf_solrcores.pid IN (0,'.intval($this->id).')'.tx_dlf_helper::whereClause('tx_dlf_solrcores'), |
|
| 120 | - '', |
|
| 121 | - '', |
|
| 122 | - '' |
|
| 123 | - ); |
|
| 115 | + // Get all available Solr cores. |
|
| 116 | + $_cores = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 117 | + 'tx_dlf_solrcores.label AS label,tx_dlf_solrcores.uid AS uid', |
|
| 118 | + 'tx_dlf_solrcores', |
|
| 119 | + 'tx_dlf_solrcores.pid IN (0,'.intval($this->id).')'.tx_dlf_helper::whereClause('tx_dlf_solrcores'), |
|
| 120 | + '', |
|
| 121 | + '', |
|
| 122 | + '' |
|
| 123 | + ); |
|
| 124 | 124 | |
| 125 | - // TODO: Ändern! |
|
| 126 | - $form = '<label for="tx-dlf-modIndexing-id">METS-Datei:</label>'; |
|
| 125 | + // TODO: Ändern! |
|
| 126 | + $form = '<label for="tx-dlf-modIndexing-id">METS-Datei:</label>'; |
|
| 127 | 127 | |
| 128 | - $form .= '<input type="text" id="tx-dlf-modIndexing-id" name="'.$this->prefixId.'[id]" value="" /><br />'; |
|
| 128 | + $form .= '<input type="text" id="tx-dlf-modIndexing-id" name="'.$this->prefixId.'[id]" value="" /><br />'; |
|
| 129 | 129 | |
| 130 | - $form .= '<select id="tx-dlf-modIndexing-core" name="'.$this->prefixId.'[core]">'; |
|
| 130 | + $form .= '<select id="tx-dlf-modIndexing-core" name="'.$this->prefixId.'[core]">'; |
|
| 131 | 131 | |
| 132 | - $form .= '<option value="0">---</option>'; |
|
| 132 | + $form .= '<option value="0">---</option>'; |
|
| 133 | 133 | |
| 134 | - while ($_core = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_cores)) { |
|
| 134 | + while ($_core = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_cores)) { |
|
| 135 | 135 | |
| 136 | - $form .= '<option value="'.$_core['uid'].'">'.htmlspecialchars($_core['label']).'</option>'; |
|
| 136 | + $form .= '<option value="'.$_core['uid'].'">'.htmlspecialchars($_core['label']).'</option>'; |
|
| 137 | 137 | |
| 138 | - } |
|
| 138 | + } |
|
| 139 | 139 | |
| 140 | - $form .= '</select><br />'; |
|
| 140 | + $form .= '</select><br />'; |
|
| 141 | 141 | |
| 142 | - $form .= '<input type="hidden" name="CMD" value="indexFile" />'; |
|
| 142 | + $form .= '<input type="hidden" name="CMD" value="indexFile" />'; |
|
| 143 | 143 | |
| 144 | - $form .= '<input type="submit" name="'.$this->prefixId.'[submit]" value="'.$GLOBALS['LANG']->getLL('form.submit').'" />'; |
|
| 144 | + $form .= '<input type="submit" name="'.$this->prefixId.'[submit]" value="'.$GLOBALS['LANG']->getLL('form.submit').'" />'; |
|
| 145 | 145 | |
| 146 | - return $form; |
|
| 146 | + return $form; |
|
| 147 | 147 | |
| 148 | - } |
|
| 148 | + } |
|
| 149 | 149 | |
| 150 | - /** |
|
| 151 | - * Iterates through list of documents and indexes them |
|
| 152 | - * |
|
| 153 | - * @access protected |
|
| 154 | - * |
|
| 155 | - * @return void |
|
| 156 | - */ |
|
| 157 | - protected function indexLoop() { |
|
| 150 | + /** |
|
| 151 | + * Iterates through list of documents and indexes them |
|
| 152 | + * |
|
| 153 | + * @access protected |
|
| 154 | + * |
|
| 155 | + * @return void |
|
| 156 | + */ |
|
| 157 | + protected function indexLoop() { |
|
| 158 | 158 | |
| 159 | - // Get document from list. |
|
| 160 | - list ($uid, $title) = $this->list->remove(0); |
|
| 159 | + // Get document from list. |
|
| 160 | + list ($uid, $title) = $this->list->remove(0); |
|
| 161 | 161 | |
| 162 | - $this->list->save(); |
|
| 162 | + $this->list->save(); |
|
| 163 | 163 | |
| 164 | - // Save document to database and index. |
|
| 165 | - $doc =& tx_dlf_document::getInstance($uid, 0, TRUE); |
|
| 164 | + // Save document to database and index. |
|
| 165 | + $doc =& tx_dlf_document::getInstance($uid, 0, TRUE); |
|
| 166 | 166 | |
| 167 | - if ($doc->ready) { |
|
| 167 | + if ($doc->ready) { |
|
| 168 | 168 | |
| 169 | - $doc->save($doc->pid, $this->data['core']); |
|
| 169 | + $doc->save($doc->pid, $this->data['core']); |
|
| 170 | 170 | |
| 171 | - } |
|
| 171 | + } |
|
| 172 | 172 | |
| 173 | - // Give feedback about progress. |
|
| 174 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 175 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 176 | - htmlspecialchars(sprintf(tx_dlf_helper::getLL('flash.documentsToGo'), count($this->list))), |
|
| 177 | - tx_dlf_helper::getLL('flash.running', TRUE), |
|
| 178 | - \TYPO3\CMS\Core\Messaging\FlashMessage::INFO, |
|
| 179 | - TRUE |
|
| 180 | - ); |
|
| 173 | + // Give feedback about progress. |
|
| 174 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 175 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 176 | + htmlspecialchars(sprintf(tx_dlf_helper::getLL('flash.documentsToGo'), count($this->list))), |
|
| 177 | + tx_dlf_helper::getLL('flash.running', TRUE), |
|
| 178 | + \TYPO3\CMS\Core\Messaging\FlashMessage::INFO, |
|
| 179 | + TRUE |
|
| 180 | + ); |
|
| 181 | 181 | |
| 182 | - $this->markerArray['CONTENT'] .= $_message->render(); |
|
| 182 | + $this->markerArray['CONTENT'] .= $_message->render(); |
|
| 183 | 183 | |
| 184 | - // Start next loop. |
|
| 185 | - $this->markerArray['CONTENT'] .= '<script type="text/javascript">window.location.href=unescape("'.\TYPO3\CMS\Core\Utility\GeneralUtility::rawUrlEncodeJS(\TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'indexLoop', $this->prefixId => array ('core' => $this->data['core']), 'random' => uniqid())))).'");</script>'; |
|
| 184 | + // Start next loop. |
|
| 185 | + $this->markerArray['CONTENT'] .= '<script type="text/javascript">window.location.href=unescape("'.\TYPO3\CMS\Core\Utility\GeneralUtility::rawUrlEncodeJS(\TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'indexLoop', $this->prefixId => array ('core' => $this->data['core']), 'random' => uniqid())))).'");</script>'; |
|
| 186 | 186 | |
| 187 | - $this->printContent(); |
|
| 187 | + $this->printContent(); |
|
| 188 | 188 | |
| 189 | - } |
|
| 189 | + } |
|
| 190 | 190 | |
| 191 | - /** |
|
| 192 | - * Main function of the module |
|
| 193 | - * |
|
| 194 | - * @access public |
|
| 195 | - * |
|
| 196 | - * @return void |
|
| 197 | - */ |
|
| 198 | - public function main() { |
|
| 191 | + /** |
|
| 192 | + * Main function of the module |
|
| 193 | + * |
|
| 194 | + * @access public |
|
| 195 | + * |
|
| 196 | + * @return void |
|
| 197 | + */ |
|
| 198 | + public function main() { |
|
| 199 | 199 | |
| 200 | - // Is the user allowed to access this page? |
|
| 201 | - $access = is_array($this->pageInfo) || $GLOBALS['BE_USER']->isAdmin(); |
|
| 200 | + // Is the user allowed to access this page? |
|
| 201 | + $access = is_array($this->pageInfo) || $GLOBALS['BE_USER']->isAdmin(); |
|
| 202 | 202 | |
| 203 | - if ($this->id && $access) { |
|
| 203 | + if ($this->id && $access) { |
|
| 204 | 204 | |
| 205 | - // Increase max_execution_time and max_input_time for large documents. |
|
| 206 | - if (!ini_get('safe_mode')) { |
|
| 205 | + // Increase max_execution_time and max_input_time for large documents. |
|
| 206 | + if (!ini_get('safe_mode')) { |
|
| 207 | 207 | |
| 208 | - ini_set('max_execution_time', '0'); |
|
| 208 | + ini_set('max_execution_time', '0'); |
|
| 209 | 209 | |
| 210 | - ini_set('max_input_time', '-1'); |
|
| 210 | + ini_set('max_input_time', '-1'); |
|
| 211 | 211 | |
| 212 | - } |
|
| 212 | + } |
|
| 213 | 213 | |
| 214 | - switch ($this->CMD) { |
|
| 214 | + switch ($this->CMD) { |
|
| 215 | 215 | |
| 216 | - case 'indexFile': |
|
| 216 | + case 'indexFile': |
|
| 217 | 217 | |
| 218 | - if (!empty($this->data['id']) && isset($this->data['core']) |
|
| 219 | - && \TYPO3\CMS\Core\Utility\GeneralUtility::isValidUrl($this->data['id'])) { |
|
| 218 | + if (!empty($this->data['id']) && isset($this->data['core']) |
|
| 219 | + && \TYPO3\CMS\Core\Utility\GeneralUtility::isValidUrl($this->data['id'])) { |
|
| 220 | 220 | |
| 221 | - // Save document to database and index. |
|
| 222 | - $doc =& tx_dlf_document::getInstance($this->data['id'], $this->id, TRUE); |
|
| 221 | + // Save document to database and index. |
|
| 222 | + $doc =& tx_dlf_document::getInstance($this->data['id'], $this->id, TRUE); |
|
| 223 | 223 | |
| 224 | - if ($doc->ready) { |
|
| 224 | + if ($doc->ready) { |
|
| 225 | 225 | |
| 226 | - $doc->save($this->id, $this->data['core']); |
|
| 226 | + $doc->save($this->id, $this->data['core']); |
|
| 227 | 227 | |
| 228 | - } else { |
|
| 228 | + } else { |
|
| 229 | 229 | |
| 230 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 231 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 232 | - htmlspecialchars(sprintf(tx_dlf_helper::getLL('flash.fileNotLoaded'), $this->data['id'])), |
|
| 233 | - tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 234 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 235 | - TRUE |
|
| 236 | - ); |
|
| 230 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 231 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 232 | + htmlspecialchars(sprintf(tx_dlf_helper::getLL('flash.fileNotLoaded'), $this->data['id'])), |
|
| 233 | + tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 234 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 235 | + TRUE |
|
| 236 | + ); |
|
| 237 | 237 | |
| 238 | - tx_dlf_helper::addMessage($_message); |
|
| 238 | + tx_dlf_helper::addMessage($_message); |
|
| 239 | 239 | |
| 240 | - } |
|
| 240 | + } |
|
| 241 | 241 | |
| 242 | - } |
|
| 242 | + } |
|
| 243 | 243 | |
| 244 | - break; |
|
| 244 | + break; |
|
| 245 | 245 | |
| 246 | - case 'reindexDocs': |
|
| 246 | + case 'reindexDocs': |
|
| 247 | 247 | |
| 248 | - if (isset($this->data['core'])) { |
|
| 248 | + if (isset($this->data['core'])) { |
|
| 249 | 249 | |
| 250 | - if (!empty($this->data['collection'])) { |
|
| 250 | + if (!empty($this->data['collection'])) { |
|
| 251 | 251 | |
| 252 | - // Get all documents in this collection. |
|
| 253 | - $_result = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query( |
|
| 254 | - 'tx_dlf_documents.title AS title,tx_dlf_documents.uid AS uid', |
|
| 255 | - 'tx_dlf_documents', |
|
| 256 | - 'tx_dlf_relations', |
|
| 257 | - 'tx_dlf_collections', |
|
| 258 | - 'AND tx_dlf_documents.pid='.intval($this->id).' AND tx_dlf_collections.uid='.intval($this->data['collection']).' AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations').tx_dlf_helper::whereClause('tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_collections'), |
|
| 259 | - 'tx_dlf_documents.uid', |
|
| 260 | - '', |
|
| 261 | - '' |
|
| 262 | - ); |
|
| 252 | + // Get all documents in this collection. |
|
| 253 | + $_result = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query( |
|
| 254 | + 'tx_dlf_documents.title AS title,tx_dlf_documents.uid AS uid', |
|
| 255 | + 'tx_dlf_documents', |
|
| 256 | + 'tx_dlf_relations', |
|
| 257 | + 'tx_dlf_collections', |
|
| 258 | + 'AND tx_dlf_documents.pid='.intval($this->id).' AND tx_dlf_collections.uid='.intval($this->data['collection']).' AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations').tx_dlf_helper::whereClause('tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_collections'), |
|
| 259 | + 'tx_dlf_documents.uid', |
|
| 260 | + '', |
|
| 261 | + '' |
|
| 262 | + ); |
|
| 263 | 263 | |
| 264 | - } else { |
|
| 264 | + } else { |
|
| 265 | 265 | |
| 266 | - // Get all documents. |
|
| 267 | - $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 268 | - 'tx_dlf_documents.title AS title,tx_dlf_documents.uid AS uid', |
|
| 269 | - 'tx_dlf_documents', |
|
| 270 | - 'tx_dlf_documents.pid='.intval($this->id).tx_dlf_helper::whereClause('tx_dlf_documents'), |
|
| 271 | - '', |
|
| 272 | - '', |
|
| 273 | - '' |
|
| 274 | - ); |
|
| 266 | + // Get all documents. |
|
| 267 | + $_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 268 | + 'tx_dlf_documents.title AS title,tx_dlf_documents.uid AS uid', |
|
| 269 | + 'tx_dlf_documents', |
|
| 270 | + 'tx_dlf_documents.pid='.intval($this->id).tx_dlf_helper::whereClause('tx_dlf_documents'), |
|
| 271 | + '', |
|
| 272 | + '', |
|
| 273 | + '' |
|
| 274 | + ); |
|
| 275 | 275 | |
| 276 | - } |
|
| 276 | + } |
|
| 277 | 277 | |
| 278 | - // Save them as a list object in user's session. |
|
| 279 | - $elements = array (); |
|
| 278 | + // Save them as a list object in user's session. |
|
| 279 | + $elements = array (); |
|
| 280 | 280 | |
| 281 | - while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) { |
|
| 281 | + while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) { |
|
| 282 | 282 | |
| 283 | - $elements[] = array ($resArray['uid'], $resArray['title']); |
|
| 283 | + $elements[] = array ($resArray['uid'], $resArray['title']); |
|
| 284 | 284 | |
| 285 | - } |
|
| 285 | + } |
|
| 286 | 286 | |
| 287 | - $this->list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list', $elements); |
|
| 287 | + $this->list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list', $elements); |
|
| 288 | 288 | |
| 289 | - // Start index looping. |
|
| 290 | - if (count($this->list) > 0) { |
|
| 289 | + // Start index looping. |
|
| 290 | + if (count($this->list) > 0) { |
|
| 291 | 291 | |
| 292 | - $this->indexLoop(); |
|
| 292 | + $this->indexLoop(); |
|
| 293 | 293 | |
| 294 | - } |
|
| 294 | + } |
|
| 295 | 295 | |
| 296 | - } |
|
| 296 | + } |
|
| 297 | 297 | |
| 298 | - break; |
|
| 298 | + break; |
|
| 299 | 299 | |
| 300 | - case 'indexLoop': |
|
| 300 | + case 'indexLoop': |
|
| 301 | 301 | |
| 302 | - // Refresh user's session to prevent session timeout. |
|
| 303 | - $GLOBALS['BE_USER']->fetchUserSession(); |
|
| 302 | + // Refresh user's session to prevent session timeout. |
|
| 303 | + $GLOBALS['BE_USER']->fetchUserSession(); |
|
| 304 | 304 | |
| 305 | - // Get document list from user's session. |
|
| 306 | - $this->list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list'); |
|
| 305 | + // Get document list from user's session. |
|
| 306 | + $this->list = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_dlf_list'); |
|
| 307 | 307 | |
| 308 | - // Continue index looping. |
|
| 309 | - if (count($this->list) > 0 && isset($this->data['core'])) { |
|
| 308 | + // Continue index looping. |
|
| 309 | + if (count($this->list) > 0 && isset($this->data['core'])) { |
|
| 310 | 310 | |
| 311 | - $this->indexLoop(); |
|
| 311 | + $this->indexLoop(); |
|
| 312 | 312 | |
| 313 | - } else { |
|
| 313 | + } else { |
|
| 314 | 314 | |
| 315 | - $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 316 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 317 | - tx_dlf_helper::getLL('flash.seeLog', TRUE), |
|
| 318 | - tx_dlf_helper::getLL('flash.done', TRUE), |
|
| 319 | - \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 320 | - TRUE |
|
| 321 | - ); |
|
| 315 | + $_message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 316 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 317 | + tx_dlf_helper::getLL('flash.seeLog', TRUE), |
|
| 318 | + tx_dlf_helper::getLL('flash.done', TRUE), |
|
| 319 | + \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 320 | + TRUE |
|
| 321 | + ); |
|
| 322 | 322 | |
| 323 | - tx_dlf_helper::addMessage($_message); |
|
| 323 | + tx_dlf_helper::addMessage($_message); |
|
| 324 | 324 | |
| 325 | - } |
|
| 325 | + } |
|
| 326 | 326 | |
| 327 | - break; |
|
| 327 | + break; |
|
| 328 | 328 | |
| 329 | - } |
|
| 329 | + } |
|
| 330 | 330 | |
| 331 | 331 | |
| 332 | - $this->markerArray['CONTENT'] .= tx_dlf_helper::renderFlashMessages(); |
|
| 332 | + $this->markerArray['CONTENT'] .= tx_dlf_helper::renderFlashMessages(); |
|
| 333 | 333 | |
| 334 | - switch ($this->MOD_SETTINGS['function']) { |
|
| 334 | + switch ($this->MOD_SETTINGS['function']) { |
|
| 335 | 335 | |
| 336 | - case 'indexFile': |
|
| 336 | + case 'indexFile': |
|
| 337 | 337 | |
| 338 | - $this->markerArray['CONTENT'] .= $this->getFileForm(); |
|
| 338 | + $this->markerArray['CONTENT'] .= $this->getFileForm(); |
|
| 339 | 339 | |
| 340 | - break; |
|
| 340 | + break; |
|
| 341 | 341 | |
| 342 | - case 'reindexDocs': |
|
| 342 | + case 'reindexDocs': |
|
| 343 | 343 | |
| 344 | - $this->markerArray['CONTENT'] .= $this->getCollList(); |
|
| 344 | + $this->markerArray['CONTENT'] .= $this->getCollList(); |
|
| 345 | 345 | |
| 346 | - break; |
|
| 346 | + break; |
|
| 347 | 347 | |
| 348 | - } |
|
| 348 | + } |
|
| 349 | 349 | |
| 350 | - } else { |
|
| 350 | + } else { |
|
| 351 | 351 | |
| 352 | - // TODO: Ändern! |
|
| 353 | - $this->markerArray['CONTENT'] .= 'You are not allowed to access this page or have not selected a page, yet.'; |
|
| 352 | + // TODO: Ändern! |
|
| 353 | + $this->markerArray['CONTENT'] .= 'You are not allowed to access this page or have not selected a page, yet.'; |
|
| 354 | 354 | |
| 355 | - } |
|
| 355 | + } |
|
| 356 | 356 | |
| 357 | - $this->printContent(); |
|
| 357 | + $this->printContent(); |
|
| 358 | 358 | |
| 359 | - } |
|
| 359 | + } |
|
| 360 | 360 | |
| 361 | - /** |
|
| 362 | - * Sets the module's MOD_MENU configuration |
|
| 363 | - * |
|
| 364 | - * @access protected |
|
| 365 | - * |
|
| 366 | - * @return void |
|
| 367 | - */ |
|
| 368 | - protected function setMOD_MENU() { |
|
| 361 | + /** |
|
| 362 | + * Sets the module's MOD_MENU configuration |
|
| 363 | + * |
|
| 364 | + * @access protected |
|
| 365 | + * |
|
| 366 | + * @return void |
|
| 367 | + */ |
|
| 368 | + protected function setMOD_MENU() { |
|
| 369 | 369 | |
| 370 | - $this->MOD_MENU = array ( |
|
| 371 | - 'function' => array ( |
|
| 372 | - 'indexFile' => $GLOBALS['LANG']->getLL('function.indexFile'), |
|
| 373 | - //'reindexDoc' => $GLOBALS['LANG']->getLL('function.reindexDoc'), |
|
| 374 | - 'reindexDocs' => $GLOBALS['LANG']->getLL('function.reindexDocs'), |
|
| 375 | - ) |
|
| 376 | - ); |
|
| 370 | + $this->MOD_MENU = array ( |
|
| 371 | + 'function' => array ( |
|
| 372 | + 'indexFile' => $GLOBALS['LANG']->getLL('function.indexFile'), |
|
| 373 | + //'reindexDoc' => $GLOBALS['LANG']->getLL('function.reindexDoc'), |
|
| 374 | + 'reindexDocs' => $GLOBALS['LANG']->getLL('function.reindexDocs'), |
|
| 375 | + ) |
|
| 376 | + ); |
|
| 377 | 377 | |
| 378 | - } |
|
| 378 | + } |
|
| 379 | 379 | |
| 380 | 380 | } |
| 381 | 381 | |
@@ -21,11 +21,11 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | protected $modPath = 'indexing/'; |
| 23 | 23 | |
| 24 | - protected $buttonArray = array ( |
|
| 24 | + protected $buttonArray = array( |
|
| 25 | 25 | 'SHORTCUT' => '', |
| 26 | 26 | ); |
| 27 | 27 | |
| 28 | - protected $markerArray = array ( |
|
| 28 | + protected $markerArray = array( |
|
| 29 | 29 | 'CSH' => '', |
| 30 | 30 | 'MOD_MENU' => '', |
| 31 | 31 | 'CONTENT' => '', |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $this->list->save(); |
| 163 | 163 | |
| 164 | 164 | // Save document to database and index. |
| 165 | - $doc =& tx_dlf_document::getInstance($uid, 0, TRUE); |
|
| 165 | + $doc = & tx_dlf_document::getInstance($uid, 0, TRUE); |
|
| 166 | 166 | |
| 167 | 167 | if ($doc->ready) { |
| 168 | 168 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $this->markerArray['CONTENT'] .= $_message->render(); |
| 183 | 183 | |
| 184 | 184 | // Start next loop. |
| 185 | - $this->markerArray['CONTENT'] .= '<script type="text/javascript">window.location.href=unescape("'.\TYPO3\CMS\Core\Utility\GeneralUtility::rawUrlEncodeJS(\TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array ('id' => $this->id, 'CMD' => 'indexLoop', $this->prefixId => array ('core' => $this->data['core']), 'random' => uniqid())))).'");</script>'; |
|
| 185 | + $this->markerArray['CONTENT'] .= '<script type="text/javascript">window.location.href=unescape("'.\TYPO3\CMS\Core\Utility\GeneralUtility::rawUrlEncodeJS(\TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('id' => $this->id, 'CMD' => 'indexLoop', $this->prefixId => array('core' => $this->data['core']), 'random' => uniqid())))).'");</script>'; |
|
| 186 | 186 | |
| 187 | 187 | $this->printContent(); |
| 188 | 188 | |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | && \TYPO3\CMS\Core\Utility\GeneralUtility::isValidUrl($this->data['id'])) { |
| 220 | 220 | |
| 221 | 221 | // Save document to database and index. |
| 222 | - $doc =& tx_dlf_document::getInstance($this->data['id'], $this->id, TRUE); |
|
| 222 | + $doc = & tx_dlf_document::getInstance($this->data['id'], $this->id, TRUE); |
|
| 223 | 223 | |
| 224 | 224 | if ($doc->ready) { |
| 225 | 225 | |
@@ -276,11 +276,11 @@ discard block |
||
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | // Save them as a list object in user's session. |
| 279 | - $elements = array (); |
|
| 279 | + $elements = array(); |
|
| 280 | 280 | |
| 281 | 281 | while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) { |
| 282 | 282 | |
| 283 | - $elements[] = array ($resArray['uid'], $resArray['title']); |
|
| 283 | + $elements[] = array($resArray['uid'], $resArray['title']); |
|
| 284 | 284 | |
| 285 | 285 | } |
| 286 | 286 | |
@@ -367,8 +367,8 @@ discard block |
||
| 367 | 367 | */ |
| 368 | 368 | protected function setMOD_MENU() { |
| 369 | 369 | |
| 370 | - $this->MOD_MENU = array ( |
|
| 371 | - 'function' => array ( |
|
| 370 | + $this->MOD_MENU = array( |
|
| 371 | + 'function' => array( |
|
| 372 | 372 | 'indexFile' => $GLOBALS['LANG']->getLL('function.indexFile'), |
| 373 | 373 | //'reindexDoc' => $GLOBALS['LANG']->getLL('function.reindexDoc'), |
| 374 | 374 | 'reindexDocs' => $GLOBALS['LANG']->getLL('function.reindexDocs'), |
@@ -12,45 +12,45 @@ |
||
| 12 | 12 | $extensionPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('dlf'); |
| 13 | 13 | |
| 14 | 14 | return array ( |
| 15 | - 'tx_dlf_cli' => $extensionPath.'cli/class.tx_dlf_cli.php', |
|
| 16 | - 'tx_dlf_alto' => $extensionPath.'common/class.tx_dlf_alto.php', |
|
| 17 | - 'tx_dlf_document' => $extensionPath.'common/class.tx_dlf_document.php', |
|
| 18 | - 'tx_dlf_format' => $extensionPath.'common/class.tx_dlf_format.php', |
|
| 19 | - 'tx_dlf_fulltext' => $extensionPath.'common/class.tx_dlf_fulltext.php', |
|
| 20 | - 'tx_dlf_helper' => $extensionPath.'common/class.tx_dlf_helper.php', |
|
| 21 | - 'tx_dlf_indexing' => $extensionPath.'common/class.tx_dlf_indexing.php', |
|
| 22 | - 'tx_dlf_list' => $extensionPath.'common/class.tx_dlf_list.php', |
|
| 23 | - 'tx_dlf_mods' => $extensionPath.'common/class.tx_dlf_mods.php', |
|
| 24 | - 'tx_dlf_module' => $extensionPath.'common/class.tx_dlf_module.php', |
|
| 25 | - 'tx_dlf_plugin' => $extensionPath.'common/class.tx_dlf_plugin.php', |
|
| 26 | - 'tx_dlf_solr' => $extensionPath.'common/class.tx_dlf_solr.php', |
|
| 27 | - 'tx_dlf_teihdr' => $extensionPath.'common/class.tx_dlf_teihdr.php', |
|
| 28 | - 'tx_dlf_doctype' => $extensionPath.'hooks/class.tx_dlf_doctype.php', |
|
| 29 | - 'tx_dlf_em' => $extensionPath.'hooks/class.tx_dlf_em.php', |
|
| 30 | - 'tx_dlf_hacks' => $extensionPath.'hooks/class.tx_dlf_hacks.php', |
|
| 31 | - 'tx_dlf_tceforms' => $extensionPath.'hooks/class.tx_dlf_tceforms.php', |
|
| 32 | - 'tx_dlf_tcemain' => $extensionPath.'hooks/class.tx_dlf_tcemain.php', |
|
| 33 | - 'tx_dlf_modIndexing' => $extensionPath.'modules/indexing/index.php', |
|
| 34 | - 'tx_dlf_modNewclient' => $extensionPath.'modules/newclient/index.php', |
|
| 35 | - 'tx_dlf_audioplayer' => $extensionPath.'plugins/audioplayer/class.tx_dlf_audioplayer.php', |
|
| 36 | - 'tx_dlf_basket' => $extensionPath.'plugins/basket/class.tx_dlf_basket.php', |
|
| 37 | - 'tx_dlf_collection' => $extensionPath.'plugins/collection/class.tx_dlf_collection.php', |
|
| 38 | - 'tx_dlf_feeds' => $extensionPath.'plugins/feeds/class.tx_dlf_feeds.php', |
|
| 39 | - 'tx_dlf_listview' => $extensionPath.'plugins/listview/class.tx_dlf_listview.php', |
|
| 40 | - 'tx_dlf_metadata' => $extensionPath.'plugins/metadata/class.tx_dlf_metadata.php', |
|
| 41 | - 'tx_dlf_navigation' => $extensionPath.'plugins/navigation/class.tx_dlf_navigation.php', |
|
| 42 | - 'tx_dlf_newspaper' => $extensionPath.'plugins/newspaper/class.tx_dlf_newspaper.php', |
|
| 43 | - 'tx_dlf_oai' => $extensionPath.'plugins/oai/class.tx_dlf_oai.php', |
|
| 44 | - 'tx_dlf_pagegrid' => $extensionPath.'plugins/pagegrid/class.tx_dlf_pagegrid.php', |
|
| 45 | - 'tx_dlf_pageview' => $extensionPath.'plugins/pageview/class.tx_dlf_pageview.php', |
|
| 46 | - 'tx_dlf_search' => $extensionPath.'plugins/search/class.tx_dlf_search.php', |
|
| 47 | - 'tx_dlf_search_suggest' => $extensionPath.'plugins/search/class.tx_dlf_search_suggest.php', |
|
| 48 | - 'tx_dlf_statistics' => $extensionPath.'plugins/statistics/class.tx_dlf_statistics.php', |
|
| 49 | - 'tx_dlf_toc' => $extensionPath.'plugins/toc/class.tx_dlf_toc.php', |
|
| 50 | - 'tx_dlf_toolbox' => $extensionPath.'plugins/toolbox/class.tx_dlf_toolbox.php', |
|
| 51 | - 'tx_dlf_toolsPdf' => $extensionPath.'plugins/toolbox/tools/pdf/class.tx_dlf_toolsPdf.php', |
|
| 52 | - 'tx_dlf_toolsFulltext' => $extensionPath.'plugins/toolbox/tools/fulltext/class.tx_dlf_toolsFulltext.php', |
|
| 53 | - 'tx_dlf_toolsImagemanipulation' => $extensionPath.'plugins/toolbox/tools/imagemanipulation/class.tx_dlf_toolsImagemanipulation.php', |
|
| 54 | - 'tx_dlf_toolsImagedownload' => $extensionPath.'plugins/toolbox/tools/imagedownload/class.tx_dlf_toolsImagedownload.php', |
|
| 55 | - 'tx_dlf_validator' => $extensionPath.'plugins/validator/class.tx_dlf_validator.php' |
|
| 15 | + 'tx_dlf_cli' => $extensionPath.'cli/class.tx_dlf_cli.php', |
|
| 16 | + 'tx_dlf_alto' => $extensionPath.'common/class.tx_dlf_alto.php', |
|
| 17 | + 'tx_dlf_document' => $extensionPath.'common/class.tx_dlf_document.php', |
|
| 18 | + 'tx_dlf_format' => $extensionPath.'common/class.tx_dlf_format.php', |
|
| 19 | + 'tx_dlf_fulltext' => $extensionPath.'common/class.tx_dlf_fulltext.php', |
|
| 20 | + 'tx_dlf_helper' => $extensionPath.'common/class.tx_dlf_helper.php', |
|
| 21 | + 'tx_dlf_indexing' => $extensionPath.'common/class.tx_dlf_indexing.php', |
|
| 22 | + 'tx_dlf_list' => $extensionPath.'common/class.tx_dlf_list.php', |
|
| 23 | + 'tx_dlf_mods' => $extensionPath.'common/class.tx_dlf_mods.php', |
|
| 24 | + 'tx_dlf_module' => $extensionPath.'common/class.tx_dlf_module.php', |
|
| 25 | + 'tx_dlf_plugin' => $extensionPath.'common/class.tx_dlf_plugin.php', |
|
| 26 | + 'tx_dlf_solr' => $extensionPath.'common/class.tx_dlf_solr.php', |
|
| 27 | + 'tx_dlf_teihdr' => $extensionPath.'common/class.tx_dlf_teihdr.php', |
|
| 28 | + 'tx_dlf_doctype' => $extensionPath.'hooks/class.tx_dlf_doctype.php', |
|
| 29 | + 'tx_dlf_em' => $extensionPath.'hooks/class.tx_dlf_em.php', |
|
| 30 | + 'tx_dlf_hacks' => $extensionPath.'hooks/class.tx_dlf_hacks.php', |
|
| 31 | + 'tx_dlf_tceforms' => $extensionPath.'hooks/class.tx_dlf_tceforms.php', |
|
| 32 | + 'tx_dlf_tcemain' => $extensionPath.'hooks/class.tx_dlf_tcemain.php', |
|
| 33 | + 'tx_dlf_modIndexing' => $extensionPath.'modules/indexing/index.php', |
|
| 34 | + 'tx_dlf_modNewclient' => $extensionPath.'modules/newclient/index.php', |
|
| 35 | + 'tx_dlf_audioplayer' => $extensionPath.'plugins/audioplayer/class.tx_dlf_audioplayer.php', |
|
| 36 | + 'tx_dlf_basket' => $extensionPath.'plugins/basket/class.tx_dlf_basket.php', |
|
| 37 | + 'tx_dlf_collection' => $extensionPath.'plugins/collection/class.tx_dlf_collection.php', |
|
| 38 | + 'tx_dlf_feeds' => $extensionPath.'plugins/feeds/class.tx_dlf_feeds.php', |
|
| 39 | + 'tx_dlf_listview' => $extensionPath.'plugins/listview/class.tx_dlf_listview.php', |
|
| 40 | + 'tx_dlf_metadata' => $extensionPath.'plugins/metadata/class.tx_dlf_metadata.php', |
|
| 41 | + 'tx_dlf_navigation' => $extensionPath.'plugins/navigation/class.tx_dlf_navigation.php', |
|
| 42 | + 'tx_dlf_newspaper' => $extensionPath.'plugins/newspaper/class.tx_dlf_newspaper.php', |
|
| 43 | + 'tx_dlf_oai' => $extensionPath.'plugins/oai/class.tx_dlf_oai.php', |
|
| 44 | + 'tx_dlf_pagegrid' => $extensionPath.'plugins/pagegrid/class.tx_dlf_pagegrid.php', |
|
| 45 | + 'tx_dlf_pageview' => $extensionPath.'plugins/pageview/class.tx_dlf_pageview.php', |
|
| 46 | + 'tx_dlf_search' => $extensionPath.'plugins/search/class.tx_dlf_search.php', |
|
| 47 | + 'tx_dlf_search_suggest' => $extensionPath.'plugins/search/class.tx_dlf_search_suggest.php', |
|
| 48 | + 'tx_dlf_statistics' => $extensionPath.'plugins/statistics/class.tx_dlf_statistics.php', |
|
| 49 | + 'tx_dlf_toc' => $extensionPath.'plugins/toc/class.tx_dlf_toc.php', |
|
| 50 | + 'tx_dlf_toolbox' => $extensionPath.'plugins/toolbox/class.tx_dlf_toolbox.php', |
|
| 51 | + 'tx_dlf_toolsPdf' => $extensionPath.'plugins/toolbox/tools/pdf/class.tx_dlf_toolsPdf.php', |
|
| 52 | + 'tx_dlf_toolsFulltext' => $extensionPath.'plugins/toolbox/tools/fulltext/class.tx_dlf_toolsFulltext.php', |
|
| 53 | + 'tx_dlf_toolsImagemanipulation' => $extensionPath.'plugins/toolbox/tools/imagemanipulation/class.tx_dlf_toolsImagemanipulation.php', |
|
| 54 | + 'tx_dlf_toolsImagedownload' => $extensionPath.'plugins/toolbox/tools/imagedownload/class.tx_dlf_toolsImagedownload.php', |
|
| 55 | + 'tx_dlf_validator' => $extensionPath.'plugins/validator/class.tx_dlf_validator.php' |
|
| 56 | 56 | ); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | $extensionPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('dlf'); |
| 13 | 13 | |
| 14 | -return array ( |
|
| 14 | +return array( |
|
| 15 | 15 | 'tx_dlf_cli' => $extensionPath.'cli/class.tx_dlf_cli.php', |
| 16 | 16 | 'tx_dlf_alto' => $extensionPath.'common/class.tx_dlf_alto.php', |
| 17 | 17 | 'tx_dlf_document' => $extensionPath.'common/class.tx_dlf_document.php', |
@@ -20,115 +20,115 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | abstract class tx_dlf_module extends \TYPO3\CMS\Backend\Module\BaseScriptClass { |
| 22 | 22 | |
| 23 | - public $extKey = 'dlf'; |
|
| 24 | - |
|
| 25 | - public $prefixId = 'tx_dlf'; |
|
| 26 | - |
|
| 27 | - /** |
|
| 28 | - * Holds the path to this module relative to 'EXT:dlf/modules/' and with trailing slash |
|
| 29 | - * |
|
| 30 | - * @var string |
|
| 31 | - * @access protected |
|
| 32 | - */ |
|
| 33 | - protected $modPath = ''; |
|
| 34 | - |
|
| 35 | - /** |
|
| 36 | - * Holds the page record if access granted or FALSE if access denied |
|
| 37 | - * |
|
| 38 | - * @var mixed |
|
| 39 | - * @access protected |
|
| 40 | - */ |
|
| 41 | - protected $pageInfo; |
|
| 42 | - |
|
| 43 | - /** |
|
| 44 | - * Holds the module's button array |
|
| 45 | - * |
|
| 46 | - * @var array |
|
| 47 | - * @access protected |
|
| 48 | - */ |
|
| 49 | - protected $buttonArray = array (); |
|
| 50 | - |
|
| 51 | - /** |
|
| 52 | - * Holds the module's marker array |
|
| 53 | - * |
|
| 54 | - * @var array |
|
| 55 | - * @access protected |
|
| 56 | - */ |
|
| 57 | - protected $markerArray = array (); |
|
| 58 | - |
|
| 59 | - /** |
|
| 60 | - * Holds the module's subpart array |
|
| 61 | - * |
|
| 62 | - * @var array |
|
| 63 | - * @access protected |
|
| 64 | - */ |
|
| 65 | - protected $subpartArray = array (); |
|
| 66 | - |
|
| 67 | - /** |
|
| 68 | - * Holds the TYPO3_CONF_VARS array of this extension |
|
| 69 | - * |
|
| 70 | - * @var array |
|
| 71 | - * @access protected |
|
| 72 | - */ |
|
| 73 | - protected $conf = array (); |
|
| 74 | - |
|
| 75 | - /** |
|
| 76 | - * Holds the submitted form's data |
|
| 77 | - * |
|
| 78 | - * @var array |
|
| 79 | - * @access protected |
|
| 80 | - */ |
|
| 81 | - protected $data; |
|
| 82 | - |
|
| 83 | - /** |
|
| 84 | - * Initializes the backend module by setting internal variables, initializing the menu. |
|
| 85 | - * |
|
| 86 | - * @access public |
|
| 87 | - * |
|
| 88 | - * @return void |
|
| 89 | - */ |
|
| 90 | - public function __construct() { |
|
| 91 | - |
|
| 92 | - $GLOBALS['BE_USER']->modAccess($GLOBALS['MCONF'], 1); |
|
| 93 | - |
|
| 94 | - $GLOBALS['LANG']->includeLLFile('EXT:'.$this->extKey.'/modules/'.$this->modPath.'locallang.xml'); |
|
| 95 | - |
|
| 96 | - $this->setMOD_MENU(); |
|
| 97 | - |
|
| 98 | - parent::init(); |
|
| 99 | - |
|
| 100 | - $this->conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]); |
|
| 101 | - |
|
| 102 | - $this->pageInfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause); |
|
| 103 | - |
|
| 104 | - $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate'); |
|
| 105 | - |
|
| 106 | - $this->doc->setModuleTemplate('EXT:'.$this->extKey.'/modules/'.$this->modPath.'template.tmpl'); |
|
| 107 | - |
|
| 108 | - $this->doc->getPageRenderer()->addCssFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($this->extKey).'res/backend.css'); |
|
| 109 | - |
|
| 110 | - $this->doc->backPath = $GLOBALS['BACK_PATH']; |
|
| 111 | - |
|
| 112 | - $this->doc->bodyTagAdditions = 'class="ext-'.$this->extKey.'-modules"'; |
|
| 113 | - |
|
| 114 | - $this->doc->form = '<form action="" method="post" enctype="multipart/form-data">'; |
|
| 115 | - |
|
| 116 | - $this->data = \TYPO3\CMS\Core\Utility\GeneralUtility::_GPmerged($this->prefixId); |
|
| 117 | - |
|
| 118 | - } |
|
| 119 | - |
|
| 120 | - /** |
|
| 121 | - * Sets the module's MOD_MENU configuration. |
|
| 122 | - * |
|
| 123 | - * @access protected |
|
| 124 | - * |
|
| 125 | - * @return void |
|
| 126 | - */ |
|
| 127 | - protected function setMOD_MENU() { |
|
| 128 | - |
|
| 129 | - // Set $this->MOD_MENU array here or leave empty. |
|
| 130 | - |
|
| 131 | - /* Example code: |
|
| 23 | + public $extKey = 'dlf'; |
|
| 24 | + |
|
| 25 | + public $prefixId = 'tx_dlf'; |
|
| 26 | + |
|
| 27 | + /** |
|
| 28 | + * Holds the path to this module relative to 'EXT:dlf/modules/' and with trailing slash |
|
| 29 | + * |
|
| 30 | + * @var string |
|
| 31 | + * @access protected |
|
| 32 | + */ |
|
| 33 | + protected $modPath = ''; |
|
| 34 | + |
|
| 35 | + /** |
|
| 36 | + * Holds the page record if access granted or FALSE if access denied |
|
| 37 | + * |
|
| 38 | + * @var mixed |
|
| 39 | + * @access protected |
|
| 40 | + */ |
|
| 41 | + protected $pageInfo; |
|
| 42 | + |
|
| 43 | + /** |
|
| 44 | + * Holds the module's button array |
|
| 45 | + * |
|
| 46 | + * @var array |
|
| 47 | + * @access protected |
|
| 48 | + */ |
|
| 49 | + protected $buttonArray = array (); |
|
| 50 | + |
|
| 51 | + /** |
|
| 52 | + * Holds the module's marker array |
|
| 53 | + * |
|
| 54 | + * @var array |
|
| 55 | + * @access protected |
|
| 56 | + */ |
|
| 57 | + protected $markerArray = array (); |
|
| 58 | + |
|
| 59 | + /** |
|
| 60 | + * Holds the module's subpart array |
|
| 61 | + * |
|
| 62 | + * @var array |
|
| 63 | + * @access protected |
|
| 64 | + */ |
|
| 65 | + protected $subpartArray = array (); |
|
| 66 | + |
|
| 67 | + /** |
|
| 68 | + * Holds the TYPO3_CONF_VARS array of this extension |
|
| 69 | + * |
|
| 70 | + * @var array |
|
| 71 | + * @access protected |
|
| 72 | + */ |
|
| 73 | + protected $conf = array (); |
|
| 74 | + |
|
| 75 | + /** |
|
| 76 | + * Holds the submitted form's data |
|
| 77 | + * |
|
| 78 | + * @var array |
|
| 79 | + * @access protected |
|
| 80 | + */ |
|
| 81 | + protected $data; |
|
| 82 | + |
|
| 83 | + /** |
|
| 84 | + * Initializes the backend module by setting internal variables, initializing the menu. |
|
| 85 | + * |
|
| 86 | + * @access public |
|
| 87 | + * |
|
| 88 | + * @return void |
|
| 89 | + */ |
|
| 90 | + public function __construct() { |
|
| 91 | + |
|
| 92 | + $GLOBALS['BE_USER']->modAccess($GLOBALS['MCONF'], 1); |
|
| 93 | + |
|
| 94 | + $GLOBALS['LANG']->includeLLFile('EXT:'.$this->extKey.'/modules/'.$this->modPath.'locallang.xml'); |
|
| 95 | + |
|
| 96 | + $this->setMOD_MENU(); |
|
| 97 | + |
|
| 98 | + parent::init(); |
|
| 99 | + |
|
| 100 | + $this->conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]); |
|
| 101 | + |
|
| 102 | + $this->pageInfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause); |
|
| 103 | + |
|
| 104 | + $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate'); |
|
| 105 | + |
|
| 106 | + $this->doc->setModuleTemplate('EXT:'.$this->extKey.'/modules/'.$this->modPath.'template.tmpl'); |
|
| 107 | + |
|
| 108 | + $this->doc->getPageRenderer()->addCssFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($this->extKey).'res/backend.css'); |
|
| 109 | + |
|
| 110 | + $this->doc->backPath = $GLOBALS['BACK_PATH']; |
|
| 111 | + |
|
| 112 | + $this->doc->bodyTagAdditions = 'class="ext-'.$this->extKey.'-modules"'; |
|
| 113 | + |
|
| 114 | + $this->doc->form = '<form action="" method="post" enctype="multipart/form-data">'; |
|
| 115 | + |
|
| 116 | + $this->data = \TYPO3\CMS\Core\Utility\GeneralUtility::_GPmerged($this->prefixId); |
|
| 117 | + |
|
| 118 | + } |
|
| 119 | + |
|
| 120 | + /** |
|
| 121 | + * Sets the module's MOD_MENU configuration. |
|
| 122 | + * |
|
| 123 | + * @access protected |
|
| 124 | + * |
|
| 125 | + * @return void |
|
| 126 | + */ |
|
| 127 | + protected function setMOD_MENU() { |
|
| 128 | + |
|
| 129 | + // Set $this->MOD_MENU array here or leave empty. |
|
| 130 | + |
|
| 131 | + /* Example code: |
|
| 132 | 132 | $this->MOD_MENU = array ( |
| 133 | 133 | 'function' => array ( |
| 134 | 134 | '1' => $GLOBALS['LANG']->getLL('function1'), |
@@ -137,30 +137,30 @@ discard block |
||
| 137 | 137 | ) |
| 138 | 138 | ); */ |
| 139 | 139 | |
| 140 | - } |
|
| 141 | - |
|
| 142 | - /** |
|
| 143 | - * Main function of the module. |
|
| 144 | - * |
|
| 145 | - * @access public |
|
| 146 | - * |
|
| 147 | - * @abstract |
|
| 148 | - * |
|
| 149 | - * @return void |
|
| 150 | - */ |
|
| 151 | - abstract public function main(); |
|
| 152 | - |
|
| 153 | - /** |
|
| 154 | - * Outputs all contents. |
|
| 155 | - * |
|
| 156 | - * @access protected |
|
| 157 | - * |
|
| 158 | - * @return void |
|
| 159 | - */ |
|
| 160 | - protected function printContent() { |
|
| 161 | - |
|
| 162 | - // Add Javascript for function menu. |
|
| 163 | - $this->doc->JScode .= ' |
|
| 140 | + } |
|
| 141 | + |
|
| 142 | + /** |
|
| 143 | + * Main function of the module. |
|
| 144 | + * |
|
| 145 | + * @access public |
|
| 146 | + * |
|
| 147 | + * @abstract |
|
| 148 | + * |
|
| 149 | + * @return void |
|
| 150 | + */ |
|
| 151 | + abstract public function main(); |
|
| 152 | + |
|
| 153 | + /** |
|
| 154 | + * Outputs all contents. |
|
| 155 | + * |
|
| 156 | + * @access protected |
|
| 157 | + * |
|
| 158 | + * @return void |
|
| 159 | + */ |
|
| 160 | + protected function printContent() { |
|
| 161 | + |
|
| 162 | + // Add Javascript for function menu. |
|
| 163 | + $this->doc->JScode .= ' |
|
| 164 | 164 | <script type="text/javascript"> |
| 165 | 165 | script_ended = 0; |
| 166 | 166 | function jumpToUrl(URL) { |
@@ -168,46 +168,46 @@ discard block |
||
| 168 | 168 | } |
| 169 | 169 | </script>'; |
| 170 | 170 | |
| 171 | - // Add Javascript for convenient module switch. |
|
| 172 | - $this->doc->postCode .= ' |
|
| 171 | + // Add Javascript for convenient module switch. |
|
| 172 | + $this->doc->postCode .= ' |
|
| 173 | 173 | <script type="text/javascript"> |
| 174 | 174 | script_ended = 1; |
| 175 | 175 | </script>'; |
| 176 | 176 | |
| 177 | - // Render output. |
|
| 178 | - $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title')); |
|
| 177 | + // Render output. |
|
| 178 | + $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title')); |
|
| 179 | 179 | |
| 180 | - // Set defaults for buttons and menu. |
|
| 181 | - if (empty($this->buttonArray['RELOAD'])) { |
|
| 180 | + // Set defaults for buttons and menu. |
|
| 181 | + if (empty($this->buttonArray['RELOAD'])) { |
|
| 182 | 182 | |
| 183 | - $this->buttonArray['RELOAD'] = '<a href="'.$GLOBALS['MCONF']['_'].'" title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.reload', TRUE).'">'.\TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-system-refresh').'</a>'; |
|
| 183 | + $this->buttonArray['RELOAD'] = '<a href="'.$GLOBALS['MCONF']['_'].'" title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.reload', TRUE).'">'.\TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-system-refresh').'</a>'; |
|
| 184 | 184 | |
| 185 | - } |
|
| 185 | + } |
|
| 186 | 186 | |
| 187 | - if (empty($this->buttonArray['SHORTCUT'])) { |
|
| 187 | + if (empty($this->buttonArray['SHORTCUT'])) { |
|
| 188 | 188 | |
| 189 | - $this->buttonArray['SHORTCUT'] = $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']); |
|
| 189 | + $this->buttonArray['SHORTCUT'] = $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']); |
|
| 190 | 190 | |
| 191 | - } |
|
| 191 | + } |
|
| 192 | 192 | |
| 193 | - if (empty($this->markerArray['CSH'])) { |
|
| 193 | + if (empty($this->markerArray['CSH'])) { |
|
| 194 | 194 | |
| 195 | - $this->markerArray['CSH'] = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('_MOD_'.$GLOBALS['MCONF']['name'], 'csh', $GLOBALS['BACK_PATH'], '', TRUE); |
|
| 195 | + $this->markerArray['CSH'] = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('_MOD_'.$GLOBALS['MCONF']['name'], 'csh', $GLOBALS['BACK_PATH'], '', TRUE); |
|
| 196 | 196 | |
| 197 | - } |
|
| 197 | + } |
|
| 198 | 198 | |
| 199 | - if (empty($this->markerArray['MOD_MENU'])) { |
|
| 199 | + if (empty($this->markerArray['MOD_MENU'])) { |
|
| 200 | 200 | |
| 201 | - $this->markerArray['MOD_MENU'] = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']); |
|
| 201 | + $this->markerArray['MOD_MENU'] = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']); |
|
| 202 | 202 | |
| 203 | - } |
|
| 203 | + } |
|
| 204 | 204 | |
| 205 | - $this->content .= $this->doc->moduleBody($this->pageInfo, $this->buttonArray, $this->markerArray, $this->subpartArray); |
|
| 205 | + $this->content .= $this->doc->moduleBody($this->pageInfo, $this->buttonArray, $this->markerArray, $this->subpartArray); |
|
| 206 | 206 | |
| 207 | - $this->content .= $this->doc->endPage(); |
|
| 207 | + $this->content .= $this->doc->endPage(); |
|
| 208 | 208 | |
| 209 | - echo $this->content; |
|
| 209 | + echo $this->content; |
|
| 210 | 210 | |
| 211 | - } |
|
| 211 | + } |
|
| 212 | 212 | |
| 213 | 213 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * @var array |
| 47 | 47 | * @access protected |
| 48 | 48 | */ |
| 49 | - protected $buttonArray = array (); |
|
| 49 | + protected $buttonArray = array(); |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * Holds the module's marker array |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * @var array |
| 55 | 55 | * @access protected |
| 56 | 56 | */ |
| 57 | - protected $markerArray = array (); |
|
| 57 | + protected $markerArray = array(); |
|
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | 60 | * Holds the module's subpart array |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * @var array |
| 63 | 63 | * @access protected |
| 64 | 64 | */ |
| 65 | - protected $subpartArray = array (); |
|
| 65 | + protected $subpartArray = array(); |
|
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | 68 | * Holds the TYPO3_CONF_VARS array of this extension |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * @var array |
| 71 | 71 | * @access protected |
| 72 | 72 | */ |
| 73 | - protected $conf = array (); |
|
| 73 | + protected $conf = array(); |
|
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | 76 | * Holds the submitted form's data |
@@ -19,870 +19,870 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | class tx_dlf_indexing { |
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * The extension key |
|
| 24 | - * |
|
| 25 | - * @var string |
|
| 26 | - * @access public |
|
| 27 | - */ |
|
| 28 | - public static $extKey = 'dlf'; |
|
| 29 | - |
|
| 30 | - /** |
|
| 31 | - * Array of metadata fields' configuration |
|
| 32 | - * @see loadIndexConf() |
|
| 33 | - * |
|
| 34 | - * @var array |
|
| 35 | - * @access protected |
|
| 36 | - */ |
|
| 37 | - protected static $fields = array ( |
|
| 38 | - 'autocomplete' => array (), |
|
| 39 | - 'facets' => array (), |
|
| 40 | - 'sortables' => array (), |
|
| 41 | - 'indexed' => array (), |
|
| 42 | - 'stored' => array (), |
|
| 43 | - 'tokenized' => array (), |
|
| 44 | - 'fieldboost' => array () |
|
| 45 | - ); |
|
| 22 | + /** |
|
| 23 | + * The extension key |
|
| 24 | + * |
|
| 25 | + * @var string |
|
| 26 | + * @access public |
|
| 27 | + */ |
|
| 28 | + public static $extKey = 'dlf'; |
|
| 29 | + |
|
| 30 | + /** |
|
| 31 | + * Array of metadata fields' configuration |
|
| 32 | + * @see loadIndexConf() |
|
| 33 | + * |
|
| 34 | + * @var array |
|
| 35 | + * @access protected |
|
| 36 | + */ |
|
| 37 | + protected static $fields = array ( |
|
| 38 | + 'autocomplete' => array (), |
|
| 39 | + 'facets' => array (), |
|
| 40 | + 'sortables' => array (), |
|
| 41 | + 'indexed' => array (), |
|
| 42 | + 'stored' => array (), |
|
| 43 | + 'tokenized' => array (), |
|
| 44 | + 'fieldboost' => array () |
|
| 45 | + ); |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * Is the index configuration loaded? |
|
| 49 | - * @see $fields |
|
| 50 | - * |
|
| 51 | - * @var boolean |
|
| 52 | - * @access protected |
|
| 53 | - */ |
|
| 54 | - protected static $fieldsLoaded = FALSE; |
|
| 47 | + /** |
|
| 48 | + * Is the index configuration loaded? |
|
| 49 | + * @see $fields |
|
| 50 | + * |
|
| 51 | + * @var boolean |
|
| 52 | + * @access protected |
|
| 53 | + */ |
|
| 54 | + protected static $fieldsLoaded = FALSE; |
|
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * List of already processed documents |
|
| 58 | - * |
|
| 59 | - * @var array |
|
| 60 | - * @access protected |
|
| 61 | - */ |
|
| 62 | - protected static $processedDocs = array (); |
|
| 56 | + /** |
|
| 57 | + * List of already processed documents |
|
| 58 | + * |
|
| 59 | + * @var array |
|
| 60 | + * @access protected |
|
| 61 | + */ |
|
| 62 | + protected static $processedDocs = array (); |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * Instance of Apache_Solr_Service class |
|
| 66 | - * |
|
| 67 | - * @var Apache_Solr_Service |
|
| 68 | - * @access protected |
|
| 69 | - */ |
|
| 70 | - protected static $solr; |
|
| 64 | + /** |
|
| 65 | + * Instance of Apache_Solr_Service class |
|
| 66 | + * |
|
| 67 | + * @var Apache_Solr_Service |
|
| 68 | + * @access protected |
|
| 69 | + */ |
|
| 70 | + protected static $solr; |
|
| 71 | 71 | |
| 72 | - /** |
|
| 73 | - * Array of toplevel structure elements |
|
| 74 | - * @see loadIndexConf() |
|
| 75 | - * |
|
| 76 | - * @var array |
|
| 77 | - * @access protected |
|
| 78 | - */ |
|
| 79 | - protected static $toplevel = array (); |
|
| 72 | + /** |
|
| 73 | + * Array of toplevel structure elements |
|
| 74 | + * @see loadIndexConf() |
|
| 75 | + * |
|
| 76 | + * @var array |
|
| 77 | + * @access protected |
|
| 78 | + */ |
|
| 79 | + protected static $toplevel = array (); |
|
| 80 | 80 | |
| 81 | - /** |
|
| 82 | - * Insert given document into Solr index |
|
| 83 | - * |
|
| 84 | - * @access public |
|
| 85 | - * |
|
| 86 | - * @param tx_dlf_document &$doc: The document to add |
|
| 87 | - * @param integer $core: UID of the Solr core to use |
|
| 88 | - * |
|
| 89 | - * @return integer 0 on success or 1 on failure |
|
| 90 | - */ |
|
| 91 | - public static function add(tx_dlf_document &$doc, $core = 0) { |
|
| 81 | + /** |
|
| 82 | + * Insert given document into Solr index |
|
| 83 | + * |
|
| 84 | + * @access public |
|
| 85 | + * |
|
| 86 | + * @param tx_dlf_document &$doc: The document to add |
|
| 87 | + * @param integer $core: UID of the Solr core to use |
|
| 88 | + * |
|
| 89 | + * @return integer 0 on success or 1 on failure |
|
| 90 | + */ |
|
| 91 | + public static function add(tx_dlf_document &$doc, $core = 0) { |
|
| 92 | 92 | |
| 93 | - if (in_array($doc->uid, self::$processedDocs)) { |
|
| 93 | + if (in_array($doc->uid, self::$processedDocs)) { |
|
| 94 | 94 | |
| 95 | - return 0; |
|
| 95 | + return 0; |
|
| 96 | 96 | |
| 97 | - } elseif (self::solrConnect($core, $doc->pid)) { |
|
| 97 | + } elseif (self::solrConnect($core, $doc->pid)) { |
|
| 98 | 98 | |
| 99 | - $errors = 0; |
|
| 99 | + $errors = 0; |
|
| 100 | 100 | |
| 101 | - // Handle multi-volume documents. |
|
| 102 | - if ($doc->parentId) { |
|
| 101 | + // Handle multi-volume documents. |
|
| 102 | + if ($doc->parentId) { |
|
| 103 | 103 | |
| 104 | - $parent =& tx_dlf_document::getInstance($doc->parentId, 0, TRUE); |
|
| 104 | + $parent =& tx_dlf_document::getInstance($doc->parentId, 0, TRUE); |
|
| 105 | 105 | |
| 106 | - if ($parent->ready) { |
|
| 106 | + if ($parent->ready) { |
|
| 107 | 107 | |
| 108 | - $errors = self::add($parent, $core); |
|
| 108 | + $errors = self::add($parent, $core); |
|
| 109 | 109 | |
| 110 | - } else { |
|
| 110 | + } else { |
|
| 111 | 111 | |
| 112 | - if (TYPO3_DLOG) { |
|
| 112 | + if (TYPO3_DLOG) { |
|
| 113 | 113 | |
| 114 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Could not load parent document with UID "'.$doc->parentId.'"', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 114 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Could not load parent document with UID "'.$doc->parentId.'"', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 115 | 115 | |
| 116 | - } |
|
| 116 | + } |
|
| 117 | 117 | |
| 118 | - return 1; |
|
| 118 | + return 1; |
|
| 119 | 119 | |
| 120 | - } |
|
| 120 | + } |
|
| 121 | 121 | |
| 122 | - } |
|
| 122 | + } |
|
| 123 | 123 | |
| 124 | - try { |
|
| 124 | + try { |
|
| 125 | 125 | |
| 126 | - // Add document to list of processed documents. |
|
| 127 | - self::$processedDocs[] = $doc->uid; |
|
| 126 | + // Add document to list of processed documents. |
|
| 127 | + self::$processedDocs[] = $doc->uid; |
|
| 128 | 128 | |
| 129 | - // Delete old Solr documents. |
|
| 130 | - self::$solr->service->deleteByQuery('uid:'.$doc->uid); |
|
| 129 | + // Delete old Solr documents. |
|
| 130 | + self::$solr->service->deleteByQuery('uid:'.$doc->uid); |
|
| 131 | 131 | |
| 132 | - // Index every logical unit as separate Solr document. |
|
| 133 | - foreach ($doc->tableOfContents as $logicalUnit) { |
|
| 132 | + // Index every logical unit as separate Solr document. |
|
| 133 | + foreach ($doc->tableOfContents as $logicalUnit) { |
|
| 134 | 134 | |
| 135 | - if (!$errors) { |
|
| 135 | + if (!$errors) { |
|
| 136 | 136 | |
| 137 | - $errors = self::processLogical($doc, $logicalUnit); |
|
| 137 | + $errors = self::processLogical($doc, $logicalUnit); |
|
| 138 | 138 | |
| 139 | - } else { |
|
| 139 | + } else { |
|
| 140 | 140 | |
| 141 | - break; |
|
| 141 | + break; |
|
| 142 | 142 | |
| 143 | - } |
|
| 143 | + } |
|
| 144 | 144 | |
| 145 | - } |
|
| 145 | + } |
|
| 146 | 146 | |
| 147 | - // Index fulltext files if available. |
|
| 148 | - if ($doc->hasFulltext) { |
|
| 147 | + // Index fulltext files if available. |
|
| 148 | + if ($doc->hasFulltext) { |
|
| 149 | 149 | |
| 150 | - foreach ($doc->physicalStructure as $pageNumber => $xmlId) { |
|
| 150 | + foreach ($doc->physicalStructure as $pageNumber => $xmlId) { |
|
| 151 | 151 | |
| 152 | - if (!$errors) { |
|
| 152 | + if (!$errors) { |
|
| 153 | 153 | |
| 154 | - $errors = self::processPhysical($doc, $pageNumber, $doc->physicalStructureInfo[$xmlId]); |
|
| 154 | + $errors = self::processPhysical($doc, $pageNumber, $doc->physicalStructureInfo[$xmlId]); |
|
| 155 | 155 | |
| 156 | - } else { |
|
| 156 | + } else { |
|
| 157 | 157 | |
| 158 | - break; |
|
| 158 | + break; |
|
| 159 | 159 | |
| 160 | - } |
|
| 160 | + } |
|
| 161 | 161 | |
| 162 | - } |
|
| 162 | + } |
|
| 163 | 163 | |
| 164 | - } |
|
| 164 | + } |
|
| 165 | 165 | |
| 166 | - self::$solr->service->commit(); |
|
| 166 | + self::$solr->service->commit(); |
|
| 167 | 167 | |
| 168 | - // Get document title from database. |
|
| 169 | - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 170 | - 'tx_dlf_documents.title AS title', |
|
| 171 | - 'tx_dlf_documents', |
|
| 172 | - 'tx_dlf_documents.uid='.intval($doc->uid).tx_dlf_helper::whereClause('tx_dlf_documents'), |
|
| 173 | - '', |
|
| 174 | - '', |
|
| 175 | - '1' |
|
| 176 | - ); |
|
| 168 | + // Get document title from database. |
|
| 169 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 170 | + 'tx_dlf_documents.title AS title', |
|
| 171 | + 'tx_dlf_documents', |
|
| 172 | + 'tx_dlf_documents.uid='.intval($doc->uid).tx_dlf_helper::whereClause('tx_dlf_documents'), |
|
| 173 | + '', |
|
| 174 | + '', |
|
| 175 | + '1' |
|
| 176 | + ); |
|
| 177 | 177 | |
| 178 | - $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); |
|
| 178 | + $resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result); |
|
| 179 | 179 | |
| 180 | - if (!defined('TYPO3_cliMode')) { |
|
| 180 | + if (!defined('TYPO3_cliMode')) { |
|
| 181 | 181 | |
| 182 | - if (!$errors) { |
|
| 182 | + if (!$errors) { |
|
| 183 | 183 | |
| 184 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 185 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 186 | - htmlspecialchars(sprintf(tx_dlf_helper::getLL('flash.documentIndexed'), $resArray['title'], $doc->uid)), |
|
| 187 | - tx_dlf_helper::getLL('flash.done', TRUE), |
|
| 188 | - \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 189 | - TRUE |
|
| 190 | - ); |
|
| 184 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 185 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 186 | + htmlspecialchars(sprintf(tx_dlf_helper::getLL('flash.documentIndexed'), $resArray['title'], $doc->uid)), |
|
| 187 | + tx_dlf_helper::getLL('flash.done', TRUE), |
|
| 188 | + \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 189 | + TRUE |
|
| 190 | + ); |
|
| 191 | 191 | |
| 192 | - } else { |
|
| 192 | + } else { |
|
| 193 | 193 | |
| 194 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 195 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 196 | - htmlspecialchars(sprintf(tx_dlf_helper::getLL('flash.documentNotIndexed'), $resArray['title'], $doc->uid)), |
|
| 197 | - tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 198 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 199 | - TRUE |
|
| 200 | - ); |
|
| 194 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 195 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 196 | + htmlspecialchars(sprintf(tx_dlf_helper::getLL('flash.documentNotIndexed'), $resArray['title'], $doc->uid)), |
|
| 197 | + tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 198 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 199 | + TRUE |
|
| 200 | + ); |
|
| 201 | 201 | |
| 202 | - } |
|
| 202 | + } |
|
| 203 | 203 | |
| 204 | - tx_dlf_helper::addMessage($message); |
|
| 204 | + tx_dlf_helper::addMessage($message); |
|
| 205 | 205 | |
| 206 | - } |
|
| 206 | + } |
|
| 207 | 207 | |
| 208 | - return $errors; |
|
| 208 | + return $errors; |
|
| 209 | 209 | |
| 210 | - } catch (Exception $e) { |
|
| 210 | + } catch (Exception $e) { |
|
| 211 | 211 | |
| 212 | - if (!defined('TYPO3_cliMode')) { |
|
| 212 | + if (!defined('TYPO3_cliMode')) { |
|
| 213 | 213 | |
| 214 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 215 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 216 | - tx_dlf_helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 217 | - tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 218 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 219 | - TRUE |
|
| 220 | - ); |
|
| 214 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 215 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 216 | + tx_dlf_helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 217 | + tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 218 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 219 | + TRUE |
|
| 220 | + ); |
|
| 221 | 221 | |
| 222 | - tx_dlf_helper::addMessage($message); |
|
| 222 | + tx_dlf_helper::addMessage($message); |
|
| 223 | 223 | |
| 224 | - } |
|
| 224 | + } |
|
| 225 | 225 | |
| 226 | - if (TYPO3_DLOG) { |
|
| 226 | + if (TYPO3_DLOG) { |
|
| 227 | 227 | |
| 228 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Apache Solr threw exception: "'.$e->getMessage().'"', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 228 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Apache Solr threw exception: "'.$e->getMessage().'"', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 229 | 229 | |
| 230 | - } |
|
| 230 | + } |
|
| 231 | 231 | |
| 232 | - return 1; |
|
| 232 | + return 1; |
|
| 233 | 233 | |
| 234 | - } |
|
| 234 | + } |
|
| 235 | 235 | |
| 236 | - } else { |
|
| 236 | + } else { |
|
| 237 | 237 | |
| 238 | - if (!defined('TYPO3_cliMode')) { |
|
| 238 | + if (!defined('TYPO3_cliMode')) { |
|
| 239 | 239 | |
| 240 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 241 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 242 | - tx_dlf_helper::getLL('flash.solrNoConnection', TRUE), |
|
| 243 | - tx_dlf_helper::getLL('flash.warning', TRUE), |
|
| 244 | - \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING, |
|
| 245 | - TRUE |
|
| 246 | - ); |
|
| 240 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 241 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 242 | + tx_dlf_helper::getLL('flash.solrNoConnection', TRUE), |
|
| 243 | + tx_dlf_helper::getLL('flash.warning', TRUE), |
|
| 244 | + \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING, |
|
| 245 | + TRUE |
|
| 246 | + ); |
|
| 247 | 247 | |
| 248 | - tx_dlf_helper::addMessage($message); |
|
| 248 | + tx_dlf_helper::addMessage($message); |
|
| 249 | 249 | |
| 250 | - } |
|
| 250 | + } |
|
| 251 | 251 | |
| 252 | - if (TYPO3_DLOG) { |
|
| 252 | + if (TYPO3_DLOG) { |
|
| 253 | 253 | |
| 254 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Could not connect to Apache Solr server', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 254 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Could not connect to Apache Solr server', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 255 | 255 | |
| 256 | - } |
|
| 256 | + } |
|
| 257 | 257 | |
| 258 | - return 1; |
|
| 258 | + return 1; |
|
| 259 | 259 | |
| 260 | - } |
|
| 260 | + } |
|
| 261 | 261 | |
| 262 | - } |
|
| 262 | + } |
|
| 263 | 263 | |
| 264 | - /** |
|
| 265 | - * Delete document from Solr index |
|
| 266 | - * |
|
| 267 | - * @access public |
|
| 268 | - * |
|
| 269 | - * @param integer $uid: UID of the document to delete |
|
| 270 | - * |
|
| 271 | - * @return integer 0 on success or 1 on failure |
|
| 272 | - */ |
|
| 273 | - public static function delete($uid) { |
|
| 264 | + /** |
|
| 265 | + * Delete document from Solr index |
|
| 266 | + * |
|
| 267 | + * @access public |
|
| 268 | + * |
|
| 269 | + * @param integer $uid: UID of the document to delete |
|
| 270 | + * |
|
| 271 | + * @return integer 0 on success or 1 on failure |
|
| 272 | + */ |
|
| 273 | + public static function delete($uid) { |
|
| 274 | 274 | |
| 275 | - // Save parameter for logging purposes. |
|
| 276 | - $_uid = $uid; |
|
| 275 | + // Save parameter for logging purposes. |
|
| 276 | + $_uid = $uid; |
|
| 277 | 277 | |
| 278 | - // Sanitize input. |
|
| 279 | - $uid = max(intval($uid), 0); |
|
| 278 | + // Sanitize input. |
|
| 279 | + $uid = max(intval($uid), 0); |
|
| 280 | 280 | |
| 281 | - // Get Solr core for document. |
|
| 282 | - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 283 | - 'tx_dlf_solrcores.uid AS uid,tx_dlf_documents.title AS title', |
|
| 284 | - 'tx_dlf_solrcores,tx_dlf_documents', |
|
| 285 | - 'tx_dlf_solrcores.uid=tx_dlf_documents.solrcore AND tx_dlf_documents.uid='.$uid.tx_dlf_helper::whereClause('tx_dlf_solrcores'), |
|
| 286 | - '', |
|
| 287 | - '', |
|
| 288 | - '1' |
|
| 289 | - ); |
|
| 281 | + // Get Solr core for document. |
|
| 282 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 283 | + 'tx_dlf_solrcores.uid AS uid,tx_dlf_documents.title AS title', |
|
| 284 | + 'tx_dlf_solrcores,tx_dlf_documents', |
|
| 285 | + 'tx_dlf_solrcores.uid=tx_dlf_documents.solrcore AND tx_dlf_documents.uid='.$uid.tx_dlf_helper::whereClause('tx_dlf_solrcores'), |
|
| 286 | + '', |
|
| 287 | + '', |
|
| 288 | + '1' |
|
| 289 | + ); |
|
| 290 | 290 | |
| 291 | - if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
|
| 291 | + if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) { |
|
| 292 | 292 | |
| 293 | - list ($core, $title) = $GLOBALS['TYPO3_DB']->sql_fetch_row($result); |
|
| 293 | + list ($core, $title) = $GLOBALS['TYPO3_DB']->sql_fetch_row($result); |
|
| 294 | 294 | |
| 295 | - // Establish Solr connection. |
|
| 296 | - if (self::solrConnect($core)) { |
|
| 295 | + // Establish Solr connection. |
|
| 296 | + if (self::solrConnect($core)) { |
|
| 297 | 297 | |
| 298 | - try { |
|
| 298 | + try { |
|
| 299 | 299 | |
| 300 | - // Delete Solr document. |
|
| 301 | - self::$solr->service->deleteByQuery('uid:'.$uid); |
|
| 300 | + // Delete Solr document. |
|
| 301 | + self::$solr->service->deleteByQuery('uid:'.$uid); |
|
| 302 | 302 | |
| 303 | - self::$solr->service->commit(); |
|
| 303 | + self::$solr->service->commit(); |
|
| 304 | 304 | |
| 305 | - } catch (Exception $e) { |
|
| 305 | + } catch (Exception $e) { |
|
| 306 | 306 | |
| 307 | - if (!defined('TYPO3_cliMode')) { |
|
| 307 | + if (!defined('TYPO3_cliMode')) { |
|
| 308 | 308 | |
| 309 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 310 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 311 | - tx_dlf_helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 312 | - tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 313 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 314 | - TRUE |
|
| 315 | - ); |
|
| 309 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 310 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 311 | + tx_dlf_helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 312 | + tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 313 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 314 | + TRUE |
|
| 315 | + ); |
|
| 316 | 316 | |
| 317 | - tx_dlf_helper::addMessage($message); |
|
| 317 | + tx_dlf_helper::addMessage($message); |
|
| 318 | 318 | |
| 319 | - } |
|
| 319 | + } |
|
| 320 | 320 | |
| 321 | - if (TYPO3_DLOG) { |
|
| 321 | + if (TYPO3_DLOG) { |
|
| 322 | 322 | |
| 323 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->delete('.$_uid.')] Apache Solr threw exception: "'.$e->getMessage().'"', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 323 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->delete('.$_uid.')] Apache Solr threw exception: "'.$e->getMessage().'"', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 324 | 324 | |
| 325 | - } |
|
| 325 | + } |
|
| 326 | 326 | |
| 327 | - return 1; |
|
| 327 | + return 1; |
|
| 328 | 328 | |
| 329 | - } |
|
| 329 | + } |
|
| 330 | 330 | |
| 331 | - } else { |
|
| 331 | + } else { |
|
| 332 | 332 | |
| 333 | - if (!defined('TYPO3_cliMode')) { |
|
| 333 | + if (!defined('TYPO3_cliMode')) { |
|
| 334 | 334 | |
| 335 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 336 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 337 | - tx_dlf_helper::getLL('flash.solrNoConnection', TRUE), |
|
| 338 | - tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 339 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 340 | - TRUE |
|
| 341 | - ); |
|
| 335 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 336 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 337 | + tx_dlf_helper::getLL('flash.solrNoConnection', TRUE), |
|
| 338 | + tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 339 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 340 | + TRUE |
|
| 341 | + ); |
|
| 342 | 342 | |
| 343 | - tx_dlf_helper::addMessage($message); |
|
| 343 | + tx_dlf_helper::addMessage($message); |
|
| 344 | 344 | |
| 345 | - } |
|
| 345 | + } |
|
| 346 | 346 | |
| 347 | - if (TYPO3_DLOG) { |
|
| 347 | + if (TYPO3_DLOG) { |
|
| 348 | 348 | |
| 349 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->delete('.$_uid.')] Could not connect to Apache Solr server', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 349 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->delete('.$_uid.')] Could not connect to Apache Solr server', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 350 | 350 | |
| 351 | - } |
|
| 351 | + } |
|
| 352 | 352 | |
| 353 | - return 1; |
|
| 353 | + return 1; |
|
| 354 | 354 | |
| 355 | - } |
|
| 355 | + } |
|
| 356 | 356 | |
| 357 | - if (!defined('TYPO3_cliMode')) { |
|
| 357 | + if (!defined('TYPO3_cliMode')) { |
|
| 358 | 358 | |
| 359 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 360 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 361 | - htmlspecialchars(sprintf(tx_dlf_helper::getLL('flash.documentDeleted'), $title, $uid)), |
|
| 362 | - tx_dlf_helper::getLL('flash.done', TRUE), |
|
| 363 | - \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 364 | - TRUE |
|
| 365 | - ); |
|
| 359 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 360 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 361 | + htmlspecialchars(sprintf(tx_dlf_helper::getLL('flash.documentDeleted'), $title, $uid)), |
|
| 362 | + tx_dlf_helper::getLL('flash.done', TRUE), |
|
| 363 | + \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
|
| 364 | + TRUE |
|
| 365 | + ); |
|
| 366 | 366 | |
| 367 | - tx_dlf_helper::addMessage($message); |
|
| 367 | + tx_dlf_helper::addMessage($message); |
|
| 368 | 368 | |
| 369 | - } |
|
| 369 | + } |
|
| 370 | 370 | |
| 371 | - return 0; |
|
| 371 | + return 0; |
|
| 372 | 372 | |
| 373 | - } else { |
|
| 373 | + } else { |
|
| 374 | 374 | |
| 375 | - if (TYPO3_DLOG) { |
|
| 375 | + if (TYPO3_DLOG) { |
|
| 376 | 376 | |
| 377 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->delete('.$_uid.')] Invalid UID "'.$uid.'" for document deletion', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 377 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->delete('.$_uid.')] Invalid UID "'.$uid.'" for document deletion', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 378 | 378 | |
| 379 | - } |
|
| 379 | + } |
|
| 380 | 380 | |
| 381 | - return 1; |
|
| 381 | + return 1; |
|
| 382 | 382 | |
| 383 | - } |
|
| 383 | + } |
|
| 384 | 384 | |
| 385 | - } |
|
| 385 | + } |
|
| 386 | 386 | |
| 387 | - /** |
|
| 388 | - * Returns the dynamic index field name for the given metadata field. |
|
| 389 | - * |
|
| 390 | - * @access public |
|
| 391 | - * |
|
| 392 | - * @param string $index_name: The metadata field's name in database |
|
| 393 | - * @param integer $pid: UID of the configuration page |
|
| 394 | - * |
|
| 395 | - * @return string The field's dynamic index name |
|
| 396 | - */ |
|
| 397 | - public static function getIndexFieldName($index_name, $pid = 0) { |
|
| 387 | + /** |
|
| 388 | + * Returns the dynamic index field name for the given metadata field. |
|
| 389 | + * |
|
| 390 | + * @access public |
|
| 391 | + * |
|
| 392 | + * @param string $index_name: The metadata field's name in database |
|
| 393 | + * @param integer $pid: UID of the configuration page |
|
| 394 | + * |
|
| 395 | + * @return string The field's dynamic index name |
|
| 396 | + */ |
|
| 397 | + public static function getIndexFieldName($index_name, $pid = 0) { |
|
| 398 | 398 | |
| 399 | - // Save parameter for logging purposes. |
|
| 400 | - $_pid = $pid; |
|
| 399 | + // Save parameter for logging purposes. |
|
| 400 | + $_pid = $pid; |
|
| 401 | 401 | |
| 402 | - // Sanitize input. |
|
| 403 | - $pid = max(intval($pid), 0); |
|
| 402 | + // Sanitize input. |
|
| 403 | + $pid = max(intval($pid), 0); |
|
| 404 | 404 | |
| 405 | - if (!$pid) { |
|
| 405 | + if (!$pid) { |
|
| 406 | 406 | |
| 407 | - if (TYPO3_DLOG) { |
|
| 407 | + if (TYPO3_DLOG) { |
|
| 408 | 408 | |
| 409 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->getIndexFieldName('.$index_name.', '.$_pid.')] Invalid PID "'.$pid.'" for metadata configuration', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 409 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('[tx_dlf_indexing->getIndexFieldName('.$index_name.', '.$_pid.')] Invalid PID "'.$pid.'" for metadata configuration', self::$extKey, SYSLOG_SEVERITY_ERROR); |
|
| 410 | 410 | |
| 411 | - } |
|
| 411 | + } |
|
| 412 | 412 | |
| 413 | - return ''; |
|
| 413 | + return ''; |
|
| 414 | 414 | |
| 415 | - } |
|
| 415 | + } |
|
| 416 | 416 | |
| 417 | - // Load metadata configuration. |
|
| 418 | - self::loadIndexConf($pid); |
|
| 417 | + // Load metadata configuration. |
|
| 418 | + self::loadIndexConf($pid); |
|
| 419 | 419 | |
| 420 | - // Build field's suffix. |
|
| 421 | - $suffix = (in_array($index_name, self::$fields['tokenized']) ? 't' : 'u'); |
|
| 420 | + // Build field's suffix. |
|
| 421 | + $suffix = (in_array($index_name, self::$fields['tokenized']) ? 't' : 'u'); |
|
| 422 | 422 | |
| 423 | - $suffix .= (in_array($index_name, self::$fields['stored']) ? 's' : 'u'); |
|
| 423 | + $suffix .= (in_array($index_name, self::$fields['stored']) ? 's' : 'u'); |
|
| 424 | 424 | |
| 425 | - $suffix .= (in_array($index_name, self::$fields['indexed']) ? 'i' : 'u'); |
|
| 425 | + $suffix .= (in_array($index_name, self::$fields['indexed']) ? 'i' : 'u'); |
|
| 426 | 426 | |
| 427 | - $index_name .= '_'.$suffix; |
|
| 427 | + $index_name .= '_'.$suffix; |
|
| 428 | 428 | |
| 429 | - return $index_name; |
|
| 429 | + return $index_name; |
|
| 430 | 430 | |
| 431 | - } |
|
| 431 | + } |
|
| 432 | 432 | |
| 433 | - /** |
|
| 434 | - * Load indexing configuration |
|
| 435 | - * |
|
| 436 | - * @access protected |
|
| 437 | - * |
|
| 438 | - * @param integer $pid: The configuration page's UID |
|
| 439 | - * |
|
| 440 | - * @return void |
|
| 441 | - */ |
|
| 442 | - protected static function loadIndexConf($pid) { |
|
| 433 | + /** |
|
| 434 | + * Load indexing configuration |
|
| 435 | + * |
|
| 436 | + * @access protected |
|
| 437 | + * |
|
| 438 | + * @param integer $pid: The configuration page's UID |
|
| 439 | + * |
|
| 440 | + * @return void |
|
| 441 | + */ |
|
| 442 | + protected static function loadIndexConf($pid) { |
|
| 443 | 443 | |
| 444 | - if (!self::$fieldsLoaded) { |
|
| 444 | + if (!self::$fieldsLoaded) { |
|
| 445 | 445 | |
| 446 | - // Get the list of toplevel structures. |
|
| 447 | - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 448 | - 'tx_dlf_structures.index_name AS index_name', |
|
| 449 | - 'tx_dlf_structures', |
|
| 450 | - 'tx_dlf_structures.toplevel=1 AND tx_dlf_structures.pid='.intval($pid).tx_dlf_helper::whereClause('tx_dlf_structures'), |
|
| 451 | - '', |
|
| 452 | - '', |
|
| 453 | - '' |
|
| 454 | - ); |
|
| 446 | + // Get the list of toplevel structures. |
|
| 447 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 448 | + 'tx_dlf_structures.index_name AS index_name', |
|
| 449 | + 'tx_dlf_structures', |
|
| 450 | + 'tx_dlf_structures.toplevel=1 AND tx_dlf_structures.pid='.intval($pid).tx_dlf_helper::whereClause('tx_dlf_structures'), |
|
| 451 | + '', |
|
| 452 | + '', |
|
| 453 | + '' |
|
| 454 | + ); |
|
| 455 | 455 | |
| 456 | - while ($toplevel = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
|
| 456 | + while ($toplevel = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
|
| 457 | 457 | |
| 458 | - self::$toplevel[] = $toplevel['index_name']; |
|
| 458 | + self::$toplevel[] = $toplevel['index_name']; |
|
| 459 | 459 | |
| 460 | - } |
|
| 460 | + } |
|
| 461 | 461 | |
| 462 | - // Get the metadata indexing options. |
|
| 463 | - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 464 | - 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.index_tokenized AS index_tokenized,tx_dlf_metadata.index_stored AS index_stored,tx_dlf_metadata.index_indexed AS index_indexed,tx_dlf_metadata.is_sortable AS is_sortable,tx_dlf_metadata.is_facet AS is_facet,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.index_autocomplete AS index_autocomplete,tx_dlf_metadata.index_boost AS index_boost', |
|
| 465 | - 'tx_dlf_metadata', |
|
| 466 | - 'tx_dlf_metadata.pid='.intval($pid).tx_dlf_helper::whereClause('tx_dlf_metadata'), |
|
| 467 | - '', |
|
| 468 | - '', |
|
| 469 | - '' |
|
| 470 | - ); |
|
| 462 | + // Get the metadata indexing options. |
|
| 463 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|
| 464 | + 'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.index_tokenized AS index_tokenized,tx_dlf_metadata.index_stored AS index_stored,tx_dlf_metadata.index_indexed AS index_indexed,tx_dlf_metadata.is_sortable AS is_sortable,tx_dlf_metadata.is_facet AS is_facet,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.index_autocomplete AS index_autocomplete,tx_dlf_metadata.index_boost AS index_boost', |
|
| 465 | + 'tx_dlf_metadata', |
|
| 466 | + 'tx_dlf_metadata.pid='.intval($pid).tx_dlf_helper::whereClause('tx_dlf_metadata'), |
|
| 467 | + '', |
|
| 468 | + '', |
|
| 469 | + '' |
|
| 470 | + ); |
|
| 471 | 471 | |
| 472 | - while ($indexing = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
|
| 472 | + while ($indexing = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
|
| 473 | 473 | |
| 474 | - if ($indexing['index_tokenized']) { |
|
| 474 | + if ($indexing['index_tokenized']) { |
|
| 475 | 475 | |
| 476 | - self::$fields['tokenized'][] = $indexing['index_name']; |
|
| 476 | + self::$fields['tokenized'][] = $indexing['index_name']; |
|
| 477 | 477 | |
| 478 | - } |
|
| 478 | + } |
|
| 479 | 479 | |
| 480 | - if ($indexing['index_stored'] || $indexing['is_listed']) { |
|
| 480 | + if ($indexing['index_stored'] || $indexing['is_listed']) { |
|
| 481 | 481 | |
| 482 | - self::$fields['stored'][] = $indexing['index_name']; |
|
| 482 | + self::$fields['stored'][] = $indexing['index_name']; |
|
| 483 | 483 | |
| 484 | - } |
|
| 484 | + } |
|
| 485 | 485 | |
| 486 | - if ($indexing['index_indexed'] || $indexing['index_autocomplete']) { |
|
| 486 | + if ($indexing['index_indexed'] || $indexing['index_autocomplete']) { |
|
| 487 | 487 | |
| 488 | - self::$fields['indexed'][] = $indexing['index_name']; |
|
| 488 | + self::$fields['indexed'][] = $indexing['index_name']; |
|
| 489 | 489 | |
| 490 | - } |
|
| 490 | + } |
|
| 491 | 491 | |
| 492 | - if ($indexing['is_sortable']) { |
|
| 492 | + if ($indexing['is_sortable']) { |
|
| 493 | 493 | |
| 494 | - self::$fields['sortables'][] = $indexing['index_name']; |
|
| 494 | + self::$fields['sortables'][] = $indexing['index_name']; |
|
| 495 | 495 | |
| 496 | - } |
|
| 496 | + } |
|
| 497 | 497 | |
| 498 | - if ($indexing['is_facet']) { |
|
| 498 | + if ($indexing['is_facet']) { |
|
| 499 | 499 | |
| 500 | - self::$fields['facets'][] = $indexing['index_name']; |
|
| 500 | + self::$fields['facets'][] = $indexing['index_name']; |
|
| 501 | 501 | |
| 502 | - } |
|
| 502 | + } |
|
| 503 | 503 | |
| 504 | - if ($indexing['index_autocomplete']) { |
|
| 504 | + if ($indexing['index_autocomplete']) { |
|
| 505 | 505 | |
| 506 | - self::$fields['autocomplete'][] = $indexing['index_name']; |
|
| 506 | + self::$fields['autocomplete'][] = $indexing['index_name']; |
|
| 507 | 507 | |
| 508 | - } |
|
| 508 | + } |
|
| 509 | 509 | |
| 510 | - if ($indexing['index_boost'] > 0.0) { |
|
| 510 | + if ($indexing['index_boost'] > 0.0) { |
|
| 511 | 511 | |
| 512 | - self::$fields['fieldboost'][$indexing['index_name']] = floatval($indexing['index_boost']); |
|
| 512 | + self::$fields['fieldboost'][$indexing['index_name']] = floatval($indexing['index_boost']); |
|
| 513 | 513 | |
| 514 | - } else { |
|
| 514 | + } else { |
|
| 515 | 515 | |
| 516 | - self::$fields['fieldboost'][$indexing['index_name']] = FALSE; |
|
| 516 | + self::$fields['fieldboost'][$indexing['index_name']] = FALSE; |
|
| 517 | 517 | |
| 518 | - } |
|
| 518 | + } |
|
| 519 | 519 | |
| 520 | - } |
|
| 520 | + } |
|
| 521 | 521 | |
| 522 | - self::$fieldsLoaded = TRUE; |
|
| 522 | + self::$fieldsLoaded = TRUE; |
|
| 523 | 523 | |
| 524 | - } |
|
| 524 | + } |
|
| 525 | 525 | |
| 526 | - } |
|
| 526 | + } |
|
| 527 | 527 | |
| 528 | - /** |
|
| 529 | - * Processes a logical unit (and its children) for the Solr index |
|
| 530 | - * |
|
| 531 | - * @access protected |
|
| 532 | - * |
|
| 533 | - * @param tx_dlf_document &$doc: The METS document |
|
| 534 | - * @param array $logicalUnit: Array of the logical unit to process |
|
| 535 | - * |
|
| 536 | - * @return integer 0 on success or 1 on failure |
|
| 537 | - */ |
|
| 538 | - protected static function processLogical(tx_dlf_document &$doc, array $logicalUnit) { |
|
| 528 | + /** |
|
| 529 | + * Processes a logical unit (and its children) for the Solr index |
|
| 530 | + * |
|
| 531 | + * @access protected |
|
| 532 | + * |
|
| 533 | + * @param tx_dlf_document &$doc: The METS document |
|
| 534 | + * @param array $logicalUnit: Array of the logical unit to process |
|
| 535 | + * |
|
| 536 | + * @return integer 0 on success or 1 on failure |
|
| 537 | + */ |
|
| 538 | + protected static function processLogical(tx_dlf_document &$doc, array $logicalUnit) { |
|
| 539 | 539 | |
| 540 | - $errors = 0; |
|
| 540 | + $errors = 0; |
|
| 541 | 541 | |
| 542 | - // Get metadata for logical unit. |
|
| 543 | - $metadata = $doc->metadataArray[$logicalUnit['id']]; |
|
| 542 | + // Get metadata for logical unit. |
|
| 543 | + $metadata = $doc->metadataArray[$logicalUnit['id']]; |
|
| 544 | 544 | |
| 545 | - if (!empty($metadata)) { |
|
| 545 | + if (!empty($metadata)) { |
|
| 546 | 546 | |
| 547 | - // Load class. |
|
| 548 | - if (!class_exists('Apache_Solr_Document')) { |
|
| 547 | + // Load class. |
|
| 548 | + if (!class_exists('Apache_Solr_Document')) { |
|
| 549 | 549 | |
| 550 | - require_once(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('EXT:'.self::$extKey.'/lib/SolrPhpClient/Apache/Solr/Document.php')); |
|
| 550 | + require_once(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('EXT:'.self::$extKey.'/lib/SolrPhpClient/Apache/Solr/Document.php')); |
|
| 551 | 551 | |
| 552 | - } |
|
| 552 | + } |
|
| 553 | 553 | |
| 554 | - // Create new Solr document. |
|
| 555 | - $solrDoc = new Apache_Solr_Document(); |
|
| 554 | + // Create new Solr document. |
|
| 555 | + $solrDoc = new Apache_Solr_Document(); |
|
| 556 | 556 | |
| 557 | - // Create unique identifier from document's UID and unit's XML ID. |
|
| 558 | - $solrDoc->setField('id', $doc->uid.$logicalUnit['id']); |
|
| 557 | + // Create unique identifier from document's UID and unit's XML ID. |
|
| 558 | + $solrDoc->setField('id', $doc->uid.$logicalUnit['id']); |
|
| 559 | 559 | |
| 560 | - $solrDoc->setField('uid', $doc->uid); |
|
| 560 | + $solrDoc->setField('uid', $doc->uid); |
|
| 561 | 561 | |
| 562 | - $solrDoc->setField('pid', $doc->pid); |
|
| 562 | + $solrDoc->setField('pid', $doc->pid); |
|
| 563 | 563 | |
| 564 | - if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($logicalUnit['points'])) { |
|
| 564 | + if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($logicalUnit['points'])) { |
|
| 565 | 565 | |
| 566 | - $solrDoc->setField('page', $logicalUnit['points']); |
|
| 566 | + $solrDoc->setField('page', $logicalUnit['points']); |
|
| 567 | 567 | |
| 568 | - } |
|
| 568 | + } |
|
| 569 | 569 | |
| 570 | - if ($logicalUnit['id'] == $doc->toplevelId) { |
|
| 570 | + if ($logicalUnit['id'] == $doc->toplevelId) { |
|
| 571 | 571 | |
| 572 | - $solrDoc->setField('thumbnail', $doc->thumbnail); |
|
| 572 | + $solrDoc->setField('thumbnail', $doc->thumbnail); |
|
| 573 | 573 | |
| 574 | - } elseif (!empty($logicalUnit['thumbnailId'])) { |
|
| 574 | + } elseif (!empty($logicalUnit['thumbnailId'])) { |
|
| 575 | 575 | |
| 576 | - $solrDoc->setField('thumbnail', $doc->getFileLocation($logicalUnit['thumbnailId'])); |
|
| 576 | + $solrDoc->setField('thumbnail', $doc->getFileLocation($logicalUnit['thumbnailId'])); |
|
| 577 | 577 | |
| 578 | - } |
|
| 578 | + } |
|
| 579 | 579 | |
| 580 | - $solrDoc->setField('partof', $doc->parentId); |
|
| 580 | + $solrDoc->setField('partof', $doc->parentId); |
|
| 581 | 581 | |
| 582 | - $solrDoc->setField('root', $doc->rootId); |
|
| 582 | + $solrDoc->setField('root', $doc->rootId); |
|
| 583 | 583 | |
| 584 | - $solrDoc->setField('sid', $logicalUnit['id']); |
|
| 584 | + $solrDoc->setField('sid', $logicalUnit['id']); |
|
| 585 | 585 | |
| 586 | - $solrDoc->setField('toplevel', in_array($logicalUnit['type'], self::$toplevel)); |
|
| 586 | + $solrDoc->setField('toplevel', in_array($logicalUnit['type'], self::$toplevel)); |
|
| 587 | 587 | |
| 588 | - $solrDoc->setField('type', $logicalUnit['type'], self::$fields['fieldboost']['type']); |
|
| 588 | + $solrDoc->setField('type', $logicalUnit['type'], self::$fields['fieldboost']['type']); |
|
| 589 | 589 | |
| 590 | - $solrDoc->setField('title', $metadata['title'][0], self::$fields['fieldboost']['title']); |
|
| 590 | + $solrDoc->setField('title', $metadata['title'][0], self::$fields['fieldboost']['title']); |
|
| 591 | 591 | |
| 592 | - $solrDoc->setField('volume', $metadata['volume'][0], self::$fields['fieldboost']['volume']); |
|
| 592 | + $solrDoc->setField('volume', $metadata['volume'][0], self::$fields['fieldboost']['volume']); |
|
| 593 | 593 | |
| 594 | - $solrDoc->setField('record_id', $metadata['record_id'][0]); |
|
| 594 | + $solrDoc->setField('record_id', $metadata['record_id'][0]); |
|
| 595 | 595 | |
| 596 | - $solrDoc->setField('purl', $metadata['purl'][0]); |
|
| 596 | + $solrDoc->setField('purl', $metadata['purl'][0]); |
|
| 597 | 597 | |
| 598 | - $solrDoc->setField('location',$doc->location); |
|
| 598 | + $solrDoc->setField('location',$doc->location); |
|
| 599 | 599 | |
| 600 | - $solrDoc->setField('urn', $metadata['urn']); |
|
| 600 | + $solrDoc->setField('urn', $metadata['urn']); |
|
| 601 | 601 | |
| 602 | - $solrDoc->setField('collection', $metadata['collection']); |
|
| 602 | + $solrDoc->setField('collection', $metadata['collection']); |
|
| 603 | 603 | |
| 604 | - $autocomplete = array (); |
|
| 604 | + $autocomplete = array (); |
|
| 605 | 605 | |
| 606 | - foreach ($metadata as $index_name => $data) { |
|
| 606 | + foreach ($metadata as $index_name => $data) { |
|
| 607 | 607 | |
| 608 | - if (!empty($data) && substr($index_name, -8) !== '_sorting') { |
|
| 608 | + if (!empty($data) && substr($index_name, -8) !== '_sorting') { |
|
| 609 | 609 | |
| 610 | - $solrDoc->setField(self::getIndexFieldName($index_name, $doc->pid), $data, self::$fields['fieldboost'][$index_name]); |
|
| 610 | + $solrDoc->setField(self::getIndexFieldName($index_name, $doc->pid), $data, self::$fields['fieldboost'][$index_name]); |
|
| 611 | 611 | |
| 612 | - if (in_array($index_name, self::$fields['sortables'])) { |
|
| 612 | + if (in_array($index_name, self::$fields['sortables'])) { |
|
| 613 | 613 | |
| 614 | - // Add sortable fields to index. |
|
| 615 | - $solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]); |
|
| 614 | + // Add sortable fields to index. |
|
| 615 | + $solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]); |
|
| 616 | 616 | |
| 617 | - } |
|
| 617 | + } |
|
| 618 | 618 | |
| 619 | - if (in_array($index_name, self::$fields['facets'])) { |
|
| 619 | + if (in_array($index_name, self::$fields['facets'])) { |
|
| 620 | 620 | |
| 621 | - // Add facets to index. |
|
| 622 | - $solrDoc->setField($index_name.'_faceting', $data); |
|
| 621 | + // Add facets to index. |
|
| 622 | + $solrDoc->setField($index_name.'_faceting', $data); |
|
| 623 | 623 | |
| 624 | - } |
|
| 624 | + } |
|
| 625 | 625 | |
| 626 | - if (in_array($index_name, self::$fields['autocomplete'])) { |
|
| 626 | + if (in_array($index_name, self::$fields['autocomplete'])) { |
|
| 627 | 627 | |
| 628 | - $autocomplete = array_merge($autocomplete, $data); |
|
| 628 | + $autocomplete = array_merge($autocomplete, $data); |
|
| 629 | 629 | |
| 630 | - } |
|
| 630 | + } |
|
| 631 | 631 | |
| 632 | - } |
|
| 632 | + } |
|
| 633 | 633 | |
| 634 | - } |
|
| 634 | + } |
|
| 635 | 635 | |
| 636 | - // Add autocomplete values to index. |
|
| 637 | - if (!empty($autocomplete)) { |
|
| 636 | + // Add autocomplete values to index. |
|
| 637 | + if (!empty($autocomplete)) { |
|
| 638 | 638 | |
| 639 | - $solrDoc->setField('autocomplete', $autocomplete); |
|
| 639 | + $solrDoc->setField('autocomplete', $autocomplete); |
|
| 640 | 640 | |
| 641 | - } |
|
| 641 | + } |
|
| 642 | 642 | |
| 643 | - // Add collection information to logical sub-elements if applicable. |
|
| 644 | - if (in_array('collection', self::$fields['facets']) |
|
| 645 | - && empty($metadata['collection']) |
|
| 646 | - && !empty($doc->metadataArray[$doc->toplevelId]['collection'])) { |
|
| 643 | + // Add collection information to logical sub-elements if applicable. |
|
| 644 | + if (in_array('collection', self::$fields['facets']) |
|
| 645 | + && empty($metadata['collection']) |
|
| 646 | + && !empty($doc->metadataArray[$doc->toplevelId]['collection'])) { |
|
| 647 | 647 | |
| 648 | - $solrDoc->setField('collection_faceting', $doc->metadataArray[$doc->toplevelId]['collection']); |
|
| 648 | + $solrDoc->setField('collection_faceting', $doc->metadataArray[$doc->toplevelId]['collection']); |
|
| 649 | 649 | |
| 650 | - } |
|
| 650 | + } |
|
| 651 | 651 | |
| 652 | - try { |
|
| 652 | + try { |
|
| 653 | 653 | |
| 654 | - self::$solr->service->addDocument($solrDoc); |
|
| 654 | + self::$solr->service->addDocument($solrDoc); |
|
| 655 | 655 | |
| 656 | - } catch (Exception $e) { |
|
| 656 | + } catch (Exception $e) { |
|
| 657 | 657 | |
| 658 | - if (!defined('TYPO3_cliMode')) { |
|
| 658 | + if (!defined('TYPO3_cliMode')) { |
|
| 659 | 659 | |
| 660 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 661 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 662 | - tx_dlf_helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 663 | - tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 664 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 665 | - TRUE |
|
| 666 | - ); |
|
| 660 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 661 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 662 | + tx_dlf_helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 663 | + tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 664 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 665 | + TRUE |
|
| 666 | + ); |
|
| 667 | 667 | |
| 668 | - tx_dlf_helper::addMessage($message); |
|
| 668 | + tx_dlf_helper::addMessage($message); |
|
| 669 | 669 | |
| 670 | - } |
|
| 670 | + } |
|
| 671 | 671 | |
| 672 | - return 1; |
|
| 672 | + return 1; |
|
| 673 | 673 | |
| 674 | - } |
|
| 674 | + } |
|
| 675 | 675 | |
| 676 | - } |
|
| 676 | + } |
|
| 677 | 677 | |
| 678 | - // Check for child elements... |
|
| 679 | - if (!empty($logicalUnit['children'])) { |
|
| 678 | + // Check for child elements... |
|
| 679 | + if (!empty($logicalUnit['children'])) { |
|
| 680 | 680 | |
| 681 | - foreach ($logicalUnit['children'] as $child) { |
|
| 681 | + foreach ($logicalUnit['children'] as $child) { |
|
| 682 | 682 | |
| 683 | - if (!$errors) { |
|
| 683 | + if (!$errors) { |
|
| 684 | 684 | |
| 685 | - // ...and process them, too. |
|
| 686 | - $errors = self::processLogical($doc, $child); |
|
| 685 | + // ...and process them, too. |
|
| 686 | + $errors = self::processLogical($doc, $child); |
|
| 687 | 687 | |
| 688 | - } else { |
|
| 688 | + } else { |
|
| 689 | 689 | |
| 690 | - break; |
|
| 690 | + break; |
|
| 691 | 691 | |
| 692 | - } |
|
| 692 | + } |
|
| 693 | 693 | |
| 694 | - } |
|
| 694 | + } |
|
| 695 | 695 | |
| 696 | - } |
|
| 696 | + } |
|
| 697 | 697 | |
| 698 | - return $errors; |
|
| 698 | + return $errors; |
|
| 699 | 699 | |
| 700 | - } |
|
| 700 | + } |
|
| 701 | 701 | |
| 702 | - /** |
|
| 703 | - * Processes a physical unit for the Solr index |
|
| 704 | - * |
|
| 705 | - * @access protected |
|
| 706 | - * |
|
| 707 | - * @param tx_dlf_document &$doc: The METS document |
|
| 708 | - * @param integer $page: The page number |
|
| 709 | - * @param array $physicalUnit: Array of the physical unit to process |
|
| 710 | - * |
|
| 711 | - * @return integer 0 on success or 1 on failure |
|
| 712 | - */ |
|
| 713 | - protected static function processPhysical(tx_dlf_document &$doc, $page, array $physicalUnit) { |
|
| 702 | + /** |
|
| 703 | + * Processes a physical unit for the Solr index |
|
| 704 | + * |
|
| 705 | + * @access protected |
|
| 706 | + * |
|
| 707 | + * @param tx_dlf_document &$doc: The METS document |
|
| 708 | + * @param integer $page: The page number |
|
| 709 | + * @param array $physicalUnit: Array of the physical unit to process |
|
| 710 | + * |
|
| 711 | + * @return integer 0 on success or 1 on failure |
|
| 712 | + */ |
|
| 713 | + protected static function processPhysical(tx_dlf_document &$doc, $page, array $physicalUnit) { |
|
| 714 | 714 | |
| 715 | - $errors = 0; |
|
| 715 | + $errors = 0; |
|
| 716 | 716 | |
| 717 | - // Read extension configuration. |
|
| 718 | - $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
|
| 717 | + // Read extension configuration. |
|
| 718 | + $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
|
| 719 | 719 | |
| 720 | - if (!empty($physicalUnit['files'][$extConf['fileGrpFulltext']])) { |
|
| 720 | + if (!empty($physicalUnit['files'][$extConf['fileGrpFulltext']])) { |
|
| 721 | 721 | |
| 722 | - $file = $doc->getFileLocation($physicalUnit['files'][$extConf['fileGrpFulltext']]); |
|
| 722 | + $file = $doc->getFileLocation($physicalUnit['files'][$extConf['fileGrpFulltext']]); |
|
| 723 | 723 | |
| 724 | - // Load XML file. |
|
| 725 | - if (\TYPO3\CMS\Core\Utility\GeneralUtility::isValidUrl($file)) { |
|
| 724 | + // Load XML file. |
|
| 725 | + if (\TYPO3\CMS\Core\Utility\GeneralUtility::isValidUrl($file)) { |
|
| 726 | 726 | |
| 727 | - // Set user-agent to identify self when fetching XML data. |
|
| 728 | - if (!empty($extConf['useragent'])) { |
|
| 727 | + // Set user-agent to identify self when fetching XML data. |
|
| 728 | + if (!empty($extConf['useragent'])) { |
|
| 729 | 729 | |
| 730 | - @ini_set('user_agent', $extConf['useragent']); |
|
| 730 | + @ini_set('user_agent', $extConf['useragent']); |
|
| 731 | 731 | |
| 732 | - } |
|
| 732 | + } |
|
| 733 | 733 | |
| 734 | - // Turn off libxml's error logging. |
|
| 735 | - $libxmlErrors = libxml_use_internal_errors(TRUE); |
|
| 734 | + // Turn off libxml's error logging. |
|
| 735 | + $libxmlErrors = libxml_use_internal_errors(TRUE); |
|
| 736 | 736 | |
| 737 | - // disable entity loading |
|
| 738 | - $previousValueOfEntityLoader = libxml_disable_entity_loader(TRUE); |
|
| 737 | + // disable entity loading |
|
| 738 | + $previousValueOfEntityLoader = libxml_disable_entity_loader(TRUE); |
|
| 739 | 739 | |
| 740 | - // Load XML from file. |
|
| 741 | - $xml = simplexml_load_string(\TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($file)); |
|
| 740 | + // Load XML from file. |
|
| 741 | + $xml = simplexml_load_string(\TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($file)); |
|
| 742 | 742 | |
| 743 | - // reset entity loader setting |
|
| 744 | - libxml_disable_entity_loader($previousValueOfEntityLoader); |
|
| 743 | + // reset entity loader setting |
|
| 744 | + libxml_disable_entity_loader($previousValueOfEntityLoader); |
|
| 745 | 745 | |
| 746 | - // Reset libxml's error logging. |
|
| 747 | - libxml_use_internal_errors($libxmlErrors); |
|
| 746 | + // Reset libxml's error logging. |
|
| 747 | + libxml_use_internal_errors($libxmlErrors); |
|
| 748 | 748 | |
| 749 | - if ($xml === FALSE) { |
|
| 749 | + if ($xml === FALSE) { |
|
| 750 | 750 | |
| 751 | - return 1; |
|
| 751 | + return 1; |
|
| 752 | 752 | |
| 753 | - } |
|
| 753 | + } |
|
| 754 | 754 | |
| 755 | - } else { |
|
| 755 | + } else { |
|
| 756 | 756 | |
| 757 | - return 1; |
|
| 757 | + return 1; |
|
| 758 | 758 | |
| 759 | - } |
|
| 759 | + } |
|
| 760 | 760 | |
| 761 | - // Load class. |
|
| 762 | - if (!class_exists('Apache_Solr_Document')) { |
|
| 761 | + // Load class. |
|
| 762 | + if (!class_exists('Apache_Solr_Document')) { |
|
| 763 | 763 | |
| 764 | - require_once(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('EXT:'.self::$extKey.'/lib/SolrPhpClient/Apache/Solr/Document.php')); |
|
| 764 | + require_once(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('EXT:'.self::$extKey.'/lib/SolrPhpClient/Apache/Solr/Document.php')); |
|
| 765 | 765 | |
| 766 | - } |
|
| 766 | + } |
|
| 767 | 767 | |
| 768 | - // Create new Solr document. |
|
| 769 | - $solrDoc = new Apache_Solr_Document(); |
|
| 768 | + // Create new Solr document. |
|
| 769 | + $solrDoc = new Apache_Solr_Document(); |
|
| 770 | 770 | |
| 771 | - // Create unique identifier from document's UID and unit's XML ID. |
|
| 772 | - $solrDoc->setField('id', $doc->uid.$physicalUnit['id']); |
|
| 771 | + // Create unique identifier from document's UID and unit's XML ID. |
|
| 772 | + $solrDoc->setField('id', $doc->uid.$physicalUnit['id']); |
|
| 773 | 773 | |
| 774 | - $solrDoc->setField('uid', $doc->uid); |
|
| 774 | + $solrDoc->setField('uid', $doc->uid); |
|
| 775 | 775 | |
| 776 | - $solrDoc->setField('pid', $doc->pid); |
|
| 776 | + $solrDoc->setField('pid', $doc->pid); |
|
| 777 | 777 | |
| 778 | - $solrDoc->setField('page', $page); |
|
| 778 | + $solrDoc->setField('page', $page); |
|
| 779 | 779 | |
| 780 | - if (!empty($physicalUnit['files'][$extConf['fileGrpThumbs']])) { |
|
| 780 | + if (!empty($physicalUnit['files'][$extConf['fileGrpThumbs']])) { |
|
| 781 | 781 | |
| 782 | - $solrDoc->setField('thumbnail', $doc->getFileLocation($physicalUnit['files'][$extConf['fileGrpThumbs']])); |
|
| 782 | + $solrDoc->setField('thumbnail', $doc->getFileLocation($physicalUnit['files'][$extConf['fileGrpThumbs']])); |
|
| 783 | 783 | |
| 784 | - } |
|
| 784 | + } |
|
| 785 | 785 | |
| 786 | - $solrDoc->setField('partof', $doc->parentId); |
|
| 786 | + $solrDoc->setField('partof', $doc->parentId); |
|
| 787 | 787 | |
| 788 | - $solrDoc->setField('root', $doc->rootId); |
|
| 788 | + $solrDoc->setField('root', $doc->rootId); |
|
| 789 | 789 | |
| 790 | - $solrDoc->setField('sid', $physicalUnit['id']); |
|
| 790 | + $solrDoc->setField('sid', $physicalUnit['id']); |
|
| 791 | 791 | |
| 792 | - $solrDoc->setField('toplevel', FALSE); |
|
| 792 | + $solrDoc->setField('toplevel', FALSE); |
|
| 793 | 793 | |
| 794 | - $solrDoc->setField('type', $physicalUnit['type'], self::$fields['fieldboost']['type']); |
|
| 794 | + $solrDoc->setField('type', $physicalUnit['type'], self::$fields['fieldboost']['type']); |
|
| 795 | 795 | |
| 796 | - $solrDoc->setField('fulltext', tx_dlf_alto::getRawText($xml)); |
|
| 796 | + $solrDoc->setField('fulltext', tx_dlf_alto::getRawText($xml)); |
|
| 797 | 797 | |
| 798 | - // Add faceting information to physical sub-elements if applicable. |
|
| 799 | - foreach ($doc->metadataArray[$doc->toplevelId] as $index_name => $data) { |
|
| 798 | + // Add faceting information to physical sub-elements if applicable. |
|
| 799 | + foreach ($doc->metadataArray[$doc->toplevelId] as $index_name => $data) { |
|
| 800 | 800 | |
| 801 | - if (!empty($data) && substr($index_name, -8) !== '_sorting') { |
|
| 801 | + if (!empty($data) && substr($index_name, -8) !== '_sorting') { |
|
| 802 | 802 | |
| 803 | - if (in_array($index_name, self::$fields['facets'])) { |
|
| 803 | + if (in_array($index_name, self::$fields['facets'])) { |
|
| 804 | 804 | |
| 805 | - // Add facets to index. |
|
| 806 | - $solrDoc->setField($index_name.'_faceting', $data); |
|
| 805 | + // Add facets to index. |
|
| 806 | + $solrDoc->setField($index_name.'_faceting', $data); |
|
| 807 | 807 | |
| 808 | - } |
|
| 808 | + } |
|
| 809 | 809 | |
| 810 | - } |
|
| 810 | + } |
|
| 811 | 811 | |
| 812 | - } |
|
| 812 | + } |
|
| 813 | 813 | |
| 814 | - try { |
|
| 814 | + try { |
|
| 815 | 815 | |
| 816 | - self::$solr->service->addDocument($solrDoc); |
|
| 816 | + self::$solr->service->addDocument($solrDoc); |
|
| 817 | 817 | |
| 818 | - } catch (Exception $e) { |
|
| 818 | + } catch (Exception $e) { |
|
| 819 | 819 | |
| 820 | - if (!defined('TYPO3_cliMode')) { |
|
| 820 | + if (!defined('TYPO3_cliMode')) { |
|
| 821 | 821 | |
| 822 | - $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 823 | - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 824 | - tx_dlf_helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 825 | - tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 826 | - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 827 | - TRUE |
|
| 828 | - ); |
|
| 822 | + $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
| 823 | + 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', |
|
| 824 | + tx_dlf_helper::getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()), |
|
| 825 | + tx_dlf_helper::getLL('flash.error', TRUE), |
|
| 826 | + \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, |
|
| 827 | + TRUE |
|
| 828 | + ); |
|
| 829 | 829 | |
| 830 | - tx_dlf_helper::addMessage($message); |
|
| 830 | + tx_dlf_helper::addMessage($message); |
|
| 831 | 831 | |
| 832 | - } |
|
| 832 | + } |
|
| 833 | 833 | |
| 834 | - return 1; |
|
| 834 | + return 1; |
|
| 835 | 835 | |
| 836 | - } |
|
| 836 | + } |
|
| 837 | 837 | |
| 838 | - } |
|
| 838 | + } |
|
| 839 | 839 | |
| 840 | - return $errors; |
|
| 840 | + return $errors; |
|
| 841 | 841 | |
| 842 | - } |
|
| 842 | + } |
|
| 843 | 843 | |
| 844 | - /** |
|
| 845 | - * Connects to Solr server. |
|
| 846 | - * |
|
| 847 | - * @access protected |
|
| 848 | - * |
|
| 849 | - * @param integer $core: UID of the Solr core |
|
| 850 | - * @param integer $pid: UID of the configuration page |
|
| 851 | - * |
|
| 852 | - * @return boolean TRUE on success or FALSE on failure |
|
| 853 | - */ |
|
| 854 | - protected static function solrConnect($core, $pid = 0) { |
|
| 844 | + /** |
|
| 845 | + * Connects to Solr server. |
|
| 846 | + * |
|
| 847 | + * @access protected |
|
| 848 | + * |
|
| 849 | + * @param integer $core: UID of the Solr core |
|
| 850 | + * @param integer $pid: UID of the configuration page |
|
| 851 | + * |
|
| 852 | + * @return boolean TRUE on success or FALSE on failure |
|
| 853 | + */ |
|
| 854 | + protected static function solrConnect($core, $pid = 0) { |
|
| 855 | 855 | |
| 856 | - // Get Solr instance. |
|
| 857 | - if (!self::$solr) { |
|
| 856 | + // Get Solr instance. |
|
| 857 | + if (!self::$solr) { |
|
| 858 | 858 | |
| 859 | - // Connect to Solr server. |
|
| 860 | - if (self::$solr = tx_dlf_solr::getInstance($core)) { |
|
| 859 | + // Connect to Solr server. |
|
| 860 | + if (self::$solr = tx_dlf_solr::getInstance($core)) { |
|
| 861 | 861 | |
| 862 | - // Load indexing configuration if needed. |
|
| 863 | - if ($pid) { |
|
| 862 | + // Load indexing configuration if needed. |
|
| 863 | + if ($pid) { |
|
| 864 | 864 | |
| 865 | - self::loadIndexConf($pid); |
|
| 865 | + self::loadIndexConf($pid); |
|
| 866 | 866 | |
| 867 | - } |
|
| 867 | + } |
|
| 868 | 868 | |
| 869 | - } else { |
|
| 869 | + } else { |
|
| 870 | 870 | |
| 871 | - return FALSE; |
|
| 871 | + return FALSE; |
|
| 872 | 872 | |
| 873 | - } |
|
| 873 | + } |
|
| 874 | 874 | |
| 875 | - } |
|
| 875 | + } |
|
| 876 | 876 | |
| 877 | - return TRUE; |
|
| 877 | + return TRUE; |
|
| 878 | 878 | |
| 879 | - } |
|
| 879 | + } |
|
| 880 | 880 | |
| 881 | - /** |
|
| 882 | - * This is a static class, thus no instances should be created |
|
| 883 | - * |
|
| 884 | - * @access private |
|
| 885 | - */ |
|
| 886 | - private function __construct() {} |
|
| 881 | + /** |
|
| 882 | + * This is a static class, thus no instances should be created |
|
| 883 | + * |
|
| 884 | + * @access private |
|
| 885 | + */ |
|
| 886 | + private function __construct() {} |
|
| 887 | 887 | |
| 888 | 888 | } |
@@ -34,14 +34,14 @@ discard block |
||
| 34 | 34 | * @var array |
| 35 | 35 | * @access protected |
| 36 | 36 | */ |
| 37 | - protected static $fields = array ( |
|
| 38 | - 'autocomplete' => array (), |
|
| 39 | - 'facets' => array (), |
|
| 40 | - 'sortables' => array (), |
|
| 41 | - 'indexed' => array (), |
|
| 42 | - 'stored' => array (), |
|
| 43 | - 'tokenized' => array (), |
|
| 44 | - 'fieldboost' => array () |
|
| 37 | + protected static $fields = array( |
|
| 38 | + 'autocomplete' => array(), |
|
| 39 | + 'facets' => array(), |
|
| 40 | + 'sortables' => array(), |
|
| 41 | + 'indexed' => array(), |
|
| 42 | + 'stored' => array(), |
|
| 43 | + 'tokenized' => array(), |
|
| 44 | + 'fieldboost' => array() |
|
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * @var array |
| 60 | 60 | * @access protected |
| 61 | 61 | */ |
| 62 | - protected static $processedDocs = array (); |
|
| 62 | + protected static $processedDocs = array(); |
|
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * Instance of Apache_Solr_Service class |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * @var array |
| 77 | 77 | * @access protected |
| 78 | 78 | */ |
| 79 | - protected static $toplevel = array (); |
|
| 79 | + protected static $toplevel = array(); |
|
| 80 | 80 | |
| 81 | 81 | /** |
| 82 | 82 | * Insert given document into Solr index |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | // Handle multi-volume documents. |
| 102 | 102 | if ($doc->parentId) { |
| 103 | 103 | |
| 104 | - $parent =& tx_dlf_document::getInstance($doc->parentId, 0, TRUE); |
|
| 104 | + $parent = & tx_dlf_document::getInstance($doc->parentId, 0, TRUE); |
|
| 105 | 105 | |
| 106 | 106 | if ($parent->ready) { |
| 107 | 107 | |
@@ -595,13 +595,13 @@ discard block |
||
| 595 | 595 | |
| 596 | 596 | $solrDoc->setField('purl', $metadata['purl'][0]); |
| 597 | 597 | |
| 598 | - $solrDoc->setField('location',$doc->location); |
|
| 598 | + $solrDoc->setField('location', $doc->location); |
|
| 599 | 599 | |
| 600 | 600 | $solrDoc->setField('urn', $metadata['urn']); |
| 601 | 601 | |
| 602 | 602 | $solrDoc->setField('collection', $metadata['collection']); |
| 603 | 603 | |
| 604 | - $autocomplete = array (); |
|
| 604 | + $autocomplete = array(); |
|
| 605 | 605 | |
| 606 | 606 | foreach ($metadata as $index_name => $data) { |
| 607 | 607 | |
@@ -19,159 +19,159 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | class tx_dlf_mods implements tx_dlf_format { |
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * This extracts the essential MODS metadata from XML |
|
| 24 | - * |
|
| 25 | - * @access public |
|
| 26 | - * |
|
| 27 | - * @param SimpleXMLElement $xml: The XML to extract the metadata from |
|
| 28 | - * @param array &$metadata: The metadata array to fill |
|
| 29 | - * |
|
| 30 | - * @return void |
|
| 31 | - */ |
|
| 32 | - public function extractMetadata(SimpleXMLElement $xml, array &$metadata) { |
|
| 22 | + /** |
|
| 23 | + * This extracts the essential MODS metadata from XML |
|
| 24 | + * |
|
| 25 | + * @access public |
|
| 26 | + * |
|
| 27 | + * @param SimpleXMLElement $xml: The XML to extract the metadata from |
|
| 28 | + * @param array &$metadata: The metadata array to fill |
|
| 29 | + * |
|
| 30 | + * @return void |
|
| 31 | + */ |
|
| 32 | + public function extractMetadata(SimpleXMLElement $xml, array &$metadata) { |
|
| 33 | 33 | |
| 34 | - $xml->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3'); |
|
| 34 | + $xml->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3'); |
|
| 35 | 35 | |
| 36 | - // Get "author" and "author_sorting". |
|
| 37 | - $authors = $xml->xpath('./mods:name[./mods:role/mods:roleTerm[@type="code" and @authority="marcrelator"]="aut"]'); |
|
| 36 | + // Get "author" and "author_sorting". |
|
| 37 | + $authors = $xml->xpath('./mods:name[./mods:role/mods:roleTerm[@type="code" and @authority="marcrelator"]="aut"]'); |
|
| 38 | 38 | |
| 39 | - // Get "author" and "author_sorting" again if that was to sophisticated. |
|
| 40 | - if (!$authors) { |
|
| 39 | + // Get "author" and "author_sorting" again if that was to sophisticated. |
|
| 40 | + if (!$authors) { |
|
| 41 | 41 | |
| 42 | - // Get all names which do not have any role term assigned and assume these are authors. |
|
| 43 | - $authors = $xml->xpath('./mods:name[not(./mods:role)]'); |
|
| 42 | + // Get all names which do not have any role term assigned and assume these are authors. |
|
| 43 | + $authors = $xml->xpath('./mods:name[not(./mods:role)]'); |
|
| 44 | 44 | |
| 45 | - } |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - if (is_array($authors)) { |
|
| 47 | + if (is_array($authors)) { |
|
| 48 | 48 | |
| 49 | - for ($i = 0, $j = count($authors); $i < $j; $i++) { |
|
| 49 | + for ($i = 0, $j = count($authors); $i < $j; $i++) { |
|
| 50 | 50 | |
| 51 | - $authors[$i]->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3'); |
|
| 51 | + $authors[$i]->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3'); |
|
| 52 | 52 | |
| 53 | - // Check if there is a display form. |
|
| 54 | - if (($displayForm = $authors[$i]->xpath('./mods:displayForm'))) { |
|
| 53 | + // Check if there is a display form. |
|
| 54 | + if (($displayForm = $authors[$i]->xpath('./mods:displayForm'))) { |
|
| 55 | 55 | |
| 56 | - $metadata['author'][$i] = (string) $displayForm[0]; |
|
| 56 | + $metadata['author'][$i] = (string) $displayForm[0]; |
|
| 57 | 57 | |
| 58 | - } elseif (($nameParts = $authors[$i]->xpath('./mods:namePart'))) { |
|
| 58 | + } elseif (($nameParts = $authors[$i]->xpath('./mods:namePart'))) { |
|
| 59 | 59 | |
| 60 | - $name = array (); |
|
| 60 | + $name = array (); |
|
| 61 | 61 | |
| 62 | - $k = 4; |
|
| 62 | + $k = 4; |
|
| 63 | 63 | |
| 64 | - foreach ($nameParts as $namePart) { |
|
| 64 | + foreach ($nameParts as $namePart) { |
|
| 65 | 65 | |
| 66 | - if (isset($namePart['type']) && (string) $namePart['type'] == 'family') { |
|
| 66 | + if (isset($namePart['type']) && (string) $namePart['type'] == 'family') { |
|
| 67 | 67 | |
| 68 | - $name[0] = (string) $namePart; |
|
| 68 | + $name[0] = (string) $namePart; |
|
| 69 | 69 | |
| 70 | - } elseif (isset($namePart['type']) && (string) $namePart['type'] == 'given') { |
|
| 70 | + } elseif (isset($namePart['type']) && (string) $namePart['type'] == 'given') { |
|
| 71 | 71 | |
| 72 | - $name[1] = (string) $namePart; |
|
| 72 | + $name[1] = (string) $namePart; |
|
| 73 | 73 | |
| 74 | - } elseif (isset($namePart['type']) && (string) $namePart['type'] == 'termsOfAddress') { |
|
| 74 | + } elseif (isset($namePart['type']) && (string) $namePart['type'] == 'termsOfAddress') { |
|
| 75 | 75 | |
| 76 | - $name[2] = (string) $namePart; |
|
| 76 | + $name[2] = (string) $namePart; |
|
| 77 | 77 | |
| 78 | - } elseif (isset($namePart['type']) && (string) $namePart['type'] == 'date') { |
|
| 78 | + } elseif (isset($namePart['type']) && (string) $namePart['type'] == 'date') { |
|
| 79 | 79 | |
| 80 | - $name[3] = (string) $namePart; |
|
| 80 | + $name[3] = (string) $namePart; |
|
| 81 | 81 | |
| 82 | - } else { |
|
| 82 | + } else { |
|
| 83 | 83 | |
| 84 | - $name[$k] = (string) $namePart; |
|
| 84 | + $name[$k] = (string) $namePart; |
|
| 85 | 85 | |
| 86 | - } |
|
| 86 | + } |
|
| 87 | 87 | |
| 88 | - $k++; |
|
| 88 | + $k++; |
|
| 89 | 89 | |
| 90 | - } |
|
| 90 | + } |
|
| 91 | 91 | |
| 92 | - ksort($name); |
|
| 92 | + ksort($name); |
|
| 93 | 93 | |
| 94 | - $metadata['author'][$i] = trim(implode(', ', $name)); |
|
| 94 | + $metadata['author'][$i] = trim(implode(', ', $name)); |
|
| 95 | 95 | |
| 96 | - } |
|
| 96 | + } |
|
| 97 | 97 | |
| 98 | - } |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | - } |
|
| 100 | + } |
|
| 101 | 101 | |
| 102 | - // Get "place" and "place_sorting". |
|
| 103 | - $places = $xml->xpath('./mods:originInfo[not(./mods:edition="[Electronic ed.]")]/mods:place/mods:placeTerm'); |
|
| 102 | + // Get "place" and "place_sorting". |
|
| 103 | + $places = $xml->xpath('./mods:originInfo[not(./mods:edition="[Electronic ed.]")]/mods:place/mods:placeTerm'); |
|
| 104 | 104 | |
| 105 | - // Get "place" and "place_sorting" again if that was to sophisticated. |
|
| 106 | - if (!$places) { |
|
| 105 | + // Get "place" and "place_sorting" again if that was to sophisticated. |
|
| 106 | + if (!$places) { |
|
| 107 | 107 | |
| 108 | - // Get all places and assume these are places of publication. |
|
| 109 | - $places = $xml->xpath('./mods:originInfo/mods:place/mods:placeTerm'); |
|
| 108 | + // Get all places and assume these are places of publication. |
|
| 109 | + $places = $xml->xpath('./mods:originInfo/mods:place/mods:placeTerm'); |
|
| 110 | 110 | |
| 111 | - } |
|
| 111 | + } |
|
| 112 | 112 | |
| 113 | - if (is_array($places)) { |
|
| 113 | + if (is_array($places)) { |
|
| 114 | 114 | |
| 115 | - foreach ($places as $place) { |
|
| 115 | + foreach ($places as $place) { |
|
| 116 | 116 | |
| 117 | - $metadata['place'][] = (string) $place; |
|
| 117 | + $metadata['place'][] = (string) $place; |
|
| 118 | 118 | |
| 119 | - if (!$metadata['place_sorting'][0]) { |
|
| 119 | + if (!$metadata['place_sorting'][0]) { |
|
| 120 | 120 | |
| 121 | - $metadata['place_sorting'][0] = preg_replace('/[[:punct:]]/', '', (string) $place); |
|
| 121 | + $metadata['place_sorting'][0] = preg_replace('/[[:punct:]]/', '', (string) $place); |
|
| 122 | 122 | |
| 123 | - } |
|
| 123 | + } |
|
| 124 | 124 | |
| 125 | - } |
|
| 125 | + } |
|
| 126 | 126 | |
| 127 | - } |
|
| 127 | + } |
|
| 128 | 128 | |
| 129 | - // Get "year_sorting". |
|
| 130 | - if (($years_sorting = $xml->xpath('./mods:originInfo[not(./mods:edition="[Electronic ed.]")]/mods:dateOther[@type="order" and @encoding="w3cdtf"]'))) { |
|
| 129 | + // Get "year_sorting". |
|
| 130 | + if (($years_sorting = $xml->xpath('./mods:originInfo[not(./mods:edition="[Electronic ed.]")]/mods:dateOther[@type="order" and @encoding="w3cdtf"]'))) { |
|
| 131 | 131 | |
| 132 | - foreach ($years_sorting as $year_sorting) { |
|
| 132 | + foreach ($years_sorting as $year_sorting) { |
|
| 133 | 133 | |
| 134 | - $metadata['year_sorting'][0] = intval($year_sorting); |
|
| 134 | + $metadata['year_sorting'][0] = intval($year_sorting); |
|
| 135 | 135 | |
| 136 | - } |
|
| 136 | + } |
|
| 137 | 137 | |
| 138 | - } |
|
| 138 | + } |
|
| 139 | 139 | |
| 140 | - // Get "year" and "year_sorting" if not specified separately. |
|
| 141 | - $years = $xml->xpath('./mods:originInfo[not(./mods:edition="[Electronic ed.]")]/mods:dateIssued[@keyDate="yes"]'); |
|
| 140 | + // Get "year" and "year_sorting" if not specified separately. |
|
| 141 | + $years = $xml->xpath('./mods:originInfo[not(./mods:edition="[Electronic ed.]")]/mods:dateIssued[@keyDate="yes"]'); |
|
| 142 | 142 | |
| 143 | - // Get "year" and "year_sorting" again if that was to sophisticated. |
|
| 144 | - if (!$years) { |
|
| 143 | + // Get "year" and "year_sorting" again if that was to sophisticated. |
|
| 144 | + if (!$years) { |
|
| 145 | 145 | |
| 146 | - // Get all dates and assume these are dates of publication. |
|
| 147 | - $years = $xml->xpath('./mods:originInfo/mods:dateIssued'); |
|
| 146 | + // Get all dates and assume these are dates of publication. |
|
| 147 | + $years = $xml->xpath('./mods:originInfo/mods:dateIssued'); |
|
| 148 | 148 | |
| 149 | - } |
|
| 149 | + } |
|
| 150 | 150 | |
| 151 | - if (is_array($years)) { |
|
| 151 | + if (is_array($years)) { |
|
| 152 | 152 | |
| 153 | - foreach ($years as $year) { |
|
| 153 | + foreach ($years as $year) { |
|
| 154 | 154 | |
| 155 | - $metadata['year'][] = (string) $year; |
|
| 155 | + $metadata['year'][] = (string) $year; |
|
| 156 | 156 | |
| 157 | - if (!$metadata['year_sorting'][0]) { |
|
| 157 | + if (!$metadata['year_sorting'][0]) { |
|
| 158 | 158 | |
| 159 | - $year_sorting = str_ireplace('x', '5', preg_replace('/[^\d.x]/i', '', (string) $year)); |
|
| 159 | + $year_sorting = str_ireplace('x', '5', preg_replace('/[^\d.x]/i', '', (string) $year)); |
|
| 160 | 160 | |
| 161 | - if (strpos($year_sorting, '.') || strlen($year_sorting) < 3) { |
|
| 161 | + if (strpos($year_sorting, '.') || strlen($year_sorting) < 3) { |
|
| 162 | 162 | |
| 163 | - $year_sorting = ((intval(trim($year_sorting, '.')) - 1) * 100) + 50; |
|
| 163 | + $year_sorting = ((intval(trim($year_sorting, '.')) - 1) * 100) + 50; |
|
| 164 | 164 | |
| 165 | - } |
|
| 165 | + } |
|
| 166 | 166 | |
| 167 | - $metadata['year_sorting'][0] = intval($year_sorting); |
|
| 167 | + $metadata['year_sorting'][0] = intval($year_sorting); |
|
| 168 | 168 | |
| 169 | - } |
|
| 169 | + } |
|
| 170 | 170 | |
| 171 | - } |
|
| 171 | + } |
|
| 172 | 172 | |
| 173 | - } |
|
| 173 | + } |
|
| 174 | 174 | |
| 175 | - } |
|
| 175 | + } |
|
| 176 | 176 | |
| 177 | 177 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | |
| 58 | 58 | } elseif (($nameParts = $authors[$i]->xpath('./mods:namePart'))) { |
| 59 | 59 | |
| 60 | - $name = array (); |
|
| 60 | + $name = array(); |
|
| 61 | 61 | |
| 62 | 62 | $k = 4; |
| 63 | 63 | |
@@ -19,20 +19,20 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | class tx_dlf_teihdr implements tx_dlf_format { |
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * This extracts the essential TEIHDR metadata from XML |
|
| 24 | - * |
|
| 25 | - * @access public |
|
| 26 | - * |
|
| 27 | - * @param SimpleXMLElement $xml: The XML to extract the metadata from |
|
| 28 | - * @param array &$metadata: The metadata array to fill |
|
| 29 | - * |
|
| 30 | - * @return void |
|
| 31 | - */ |
|
| 32 | - public function extractMetadata(SimpleXMLElement $xml, array &$metadata) { |
|
| 22 | + /** |
|
| 23 | + * This extracts the essential TEIHDR metadata from XML |
|
| 24 | + * |
|
| 25 | + * @access public |
|
| 26 | + * |
|
| 27 | + * @param SimpleXMLElement $xml: The XML to extract the metadata from |
|
| 28 | + * @param array &$metadata: The metadata array to fill |
|
| 29 | + * |
|
| 30 | + * @return void |
|
| 31 | + */ |
|
| 32 | + public function extractMetadata(SimpleXMLElement $xml, array &$metadata) { |
|
| 33 | 33 | |
| 34 | - $xml->registerXPathNamespace('teihdr', 'http://www.tei-c.org/ns/1.0'); |
|
| 34 | + $xml->registerXPathNamespace('teihdr', 'http://www.tei-c.org/ns/1.0'); |
|
| 35 | 35 | |
| 36 | - } |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | 38 | } |