Index: trunk/extensions/Wikidata/OmegaWiki/HTMLtable.php |
— | — | @@ -5,10 +5,11 @@ |
6 | 6 | require_once( "RecordSet.php" ); |
7 | 7 | |
8 | 8 | function parityClass( $value ) { |
9 | | - if ( $value % 2 == 0 ) |
| 9 | + if ( $value % 2 == 0 ) { |
10 | 10 | return "even"; |
11 | | - else |
| 11 | + } else { |
12 | 12 | return "odd"; |
| 13 | + } |
13 | 14 | } |
14 | 15 | |
15 | 16 | /* Functions to create a hierarchical table header |
— | — | @@ -69,9 +70,9 @@ |
70 | 71 | $columnIndex . ') } ); </script>' |
71 | 72 | . EOL; |
72 | 73 | $leftmost = False; # There can be only one. |
| 74 | + } else { |
| 75 | + $leftsort = ""; |
73 | 76 | } |
74 | | - else |
75 | | - $leftsort = ""; |
76 | 77 | |
77 | 78 | $class = ' class="' . $type . ' sortable"' . $onclick; |
78 | 79 | } |
— | — | @@ -80,7 +81,7 @@ |
81 | 82 | $sort = ''; |
82 | 83 | $leftsort = ''; |
83 | 84 | } |
84 | | - |
| 85 | + |
85 | 86 | $rowSpan = $height - $childNode->height; |
86 | 87 | $rows[$currentDepth] .= '<th id="' . $idPath->getId() . '-h" ' . $class . |
87 | 88 | ' colspan="' . $childNode->width . '" rowspan="' . $rowSpan . |
— | — | @@ -95,19 +96,20 @@ |
96 | 97 | $rootNode = getTableHeaderNode( $structure ); |
97 | 98 | $result = array(); |
98 | 99 | |
99 | | - for ( $i = 0; $i < $rootNode->height - 1; $i++ ) |
| 100 | + for ( $i = 0; $i < $rootNode->height - 1; $i++ ) { |
100 | 101 | $result[$i] = ""; |
101 | | - |
| 102 | + } |
102 | 103 | addChildNodesToRows( $rootNode, $result, 0, $columnOffset, $idPath ); |
103 | 104 | |
104 | 105 | return $result; |
105 | 106 | } |
106 | 107 | |
107 | 108 | function getHTMLClassForType( $type, Attribute $attribute ) { |
108 | | - if ( $type instanceof Structure ) |
| 109 | + if ( $type instanceof Structure ) { |
109 | 110 | return $attribute->id; |
110 | | - else |
| 111 | + } else { |
111 | 112 | return $type; |
| 113 | + } |
112 | 114 | } |
113 | 115 | |
114 | 116 | function getRecordAsTableCells( IdStack $idPath, Editor $editor, Structure $visibleStructure, Record $record, &$startColumn = 0 ) { |
— | — | @@ -124,9 +126,9 @@ |
125 | 127 | $idPath->pushAttribute( $attribute ); |
126 | 128 | $attributeId = $idPath->getId(); |
127 | 129 | |
128 | | - if ( $childEditor instanceof RecordTableCellEditor ) |
| 130 | + if ( $childEditor instanceof RecordTableCellEditor ) { |
129 | 131 | $result .= getRecordAsTableCells( $idPath, $childEditor, $visibleAttribute->type, $value, $startColumn ); |
130 | | - else { |
| 132 | + } else { |
131 | 133 | $displayValue = $childEditor->showsData( $value ) ? $childEditor->view( $idPath, $value ) : ""; |
132 | 134 | $result .= '<td class="' . getHTMLClassForType( $type, $attribute ) . ' column-' . parityClass( $startColumn ) . '">' . $displayValue . '</td>'; |
133 | 135 | $startColumn++; |
— | — | @@ -134,10 +136,10 @@ |
135 | 137 | |
136 | 138 | $idPath->popAttribute(); |
137 | 139 | } |
138 | | - else |
| 140 | + else { |
139 | 141 | $result .= '<td/>'; |
| 142 | + } |
140 | 143 | } |
141 | | - |
142 | 144 | return $result; |
143 | 145 | } |
144 | 146 | |
— | — | @@ -154,14 +156,14 @@ |
155 | 157 | $value = $record->getAttributeValue( $attribute ); |
156 | 158 | $idPath->pushAttribute( $attribute ); |
157 | 159 | |
158 | | - if ( $childEditor instanceof RecordTableCellEditor ) |
| 160 | + if ( $childEditor instanceof RecordTableCellEditor ) { |
159 | 161 | $result .= getRecordAsEditTableCells( $idPath, $childEditor, $visibleAttribute->type, $value, $startColumn ); |
160 | | - else { |
161 | | - if ( $childEditor->showEditField( $idPath ) ) |
| 162 | + } else { |
| 163 | + if ( $childEditor->showEditField( $idPath ) ) { |
162 | 164 | $displayValue = $childEditor->edit( $idPath, $value ); |
163 | | - else |
| 165 | + } else { |
164 | 166 | $displayValue = ""; |
165 | | - |
| 167 | + } |
166 | 168 | $result .= '<td class="' . getHTMLClassForType( $type, $attribute ) . ' column-' . parityClass( $startColumn ) . '">' . $displayValue . '</td>'; |
167 | 169 | |
168 | 170 | $startColumn++; |
— | — | @@ -169,10 +171,10 @@ |
170 | 172 | |
171 | 173 | $idPath->popAttribute(); |
172 | 174 | } |
173 | | - else |
| 175 | + else { |
174 | 176 | $result .= "<td/>"; |
| 177 | + } |
175 | 178 | } |
176 | | - |
177 | 179 | return $result; |
178 | 180 | } |
179 | 181 | |
Index: trunk/extensions/Wikidata/OmegaWiki/Controller.php |
— | — | @@ -57,8 +57,9 @@ |
58 | 58 | $languageId = $record->language; |
59 | 59 | $text = $record->text; |
60 | 60 | |
61 | | - if ( $languageId != 0 && $text != "" ) |
| 61 | + if ( $languageId != 0 && $text != "" ) { |
62 | 62 | addDefinedMeaningDefinition( $definedMeaningId, $languageId, $text ); |
| 63 | + } |
63 | 64 | } |
64 | 65 | |
65 | 66 | public function remove( $keyPath ) { |
— | — | @@ -72,8 +73,9 @@ |
73 | 74 | $languageId = $keyPath->peek( 0 )->language; |
74 | 75 | $text = $record->text; |
75 | 76 | |
76 | | - if ( $text != "" ) |
| 77 | + if ( $text != "" ) { |
77 | 78 | updateDefinedMeaningDefinition( $definedMeaningId, $languageId, $text ); |
| 79 | + } |
78 | 80 | } |
79 | 81 | } |
80 | 82 | |
— | — | @@ -87,8 +89,9 @@ |
88 | 90 | public function update( $keyPath, $value ) { |
89 | 91 | $definedMeaningId = $keyPath->peek( 0 )->definedMeaningId; |
90 | 92 | |
91 | | - if ( $value != "" ) |
| 93 | + if ( $value != "" ) { |
92 | 94 | updateOrAddDefinedMeaningDefinition( $definedMeaningId, $this->filterLanguageId, $value ); |
| 95 | + } |
93 | 96 | } |
94 | 97 | } |
95 | 98 | |
— | — | @@ -134,8 +137,9 @@ |
135 | 138 | $languageId = $record->language; |
136 | 139 | $text = $record->text; |
137 | 140 | |
138 | | - if ( $languageId != 0 && $text != "" ) |
| 141 | + if ( $languageId != 0 && $text != "" ) { |
139 | 142 | addTranslatedTextIfNotPresent( $definitionId, $languageId, $text ); |
| 143 | + } |
140 | 144 | } |
141 | 145 | |
142 | 146 | public function remove( $keyPath ) { |
— | — | @@ -150,8 +154,9 @@ |
151 | 155 | $languageId = $keyPath->peek( 0 )->language; |
152 | 156 | $text = $record->text; |
153 | 157 | |
154 | | - if ( $text != "" ) |
| 158 | + if ( $text != "" ) { |
155 | 159 | updateTranslatedText( $definitionId, $languageId, $text ); |
| 160 | + } |
156 | 161 | } |
157 | 162 | } |
158 | 163 | |
— | — | @@ -165,8 +170,9 @@ |
166 | 171 | public function update( $keyPath, $value ) { |
167 | 172 | $definitionId = $keyPath->peek( 0 )->definitionId; |
168 | 173 | |
169 | | - if ( $value != "" ) |
| 174 | + if ( $value != "" ) { |
170 | 175 | updateTranslatedText( $definitionId, $this->filterLanguageId, $value ); |
| 176 | + } |
171 | 177 | } |
172 | 178 | } |
173 | 179 | |
— | — | @@ -218,8 +224,9 @@ |
219 | 225 | $attributeMeaningId = $record->classAttributeAttribute; |
220 | 226 | $attributeType = $record->classAttributeType; |
221 | 227 | |
222 | | - if ( ( $attributeLevelId != 0 ) && ( $attributeMeaningId != 0 ) ) |
| 228 | + if ( ( $attributeLevelId != 0 ) && ( $attributeMeaningId != 0 ) ) { |
223 | 229 | addClassAttribute( $definedMeaningId, $attributeLevelId, $attributeMeaningId, $attributeType ); |
| 230 | + } |
224 | 231 | } |
225 | 232 | |
226 | 233 | public function remove( $keyPath ) { |
— | — | @@ -233,8 +240,9 @@ |
234 | 241 | $definedMeaningId = $idPath->getKeyStack()->peek( 0 )->definedMeaningId; |
235 | 242 | $classId = $record->class; |
236 | 243 | |
237 | | - if ( $classId != 0 ) |
| 244 | + if ( $classId != 0 ) { |
238 | 245 | addClassMembership( $definedMeaningId, $classId ); |
| 246 | + } |
239 | 247 | } |
240 | 248 | |
241 | 249 | public function remove( $keyPath ) { |
— | — | @@ -248,8 +256,9 @@ |
249 | 257 | $collectionMeaningId = $record->collectionMeaning; |
250 | 258 | $internalId = $record->sourceIdentifier; |
251 | 259 | |
252 | | - if ( $collectionMeaningId != 0 ) |
| 260 | + if ( $collectionMeaningId != 0 ) { |
253 | 261 | addDefinedMeaningToCollectionIfNotPresent( $definedMeaningId, $collectionMeaningId, $internalId ); |
| 262 | + } |
254 | 263 | } |
255 | 264 | |
256 | 265 | public function remove( $keyPath ) { |
— | — | @@ -265,7 +274,7 @@ |
266 | 275 | $sourceId = $record->sourceIdentifier; |
267 | 276 | |
268 | 277 | // if ($sourceId != "") |
269 | | - updateDefinedMeaningInCollection( $definedMeaningId, $collectionId, $sourceId ); |
| 278 | + updateDefinedMeaningInCollection( $definedMeaningId, $collectionId, $sourceId ); |
270 | 279 | } |
271 | 280 | } |
272 | 281 | |
— | — | @@ -309,11 +318,12 @@ |
310 | 319 | } |
311 | 320 | |
312 | 321 | public function add( IdStack $idPath, $record ) { |
313 | | - if ( $this->filterLanguageId == 0 ) |
| 322 | + if ( $this->filterLanguageId == 0 ) { |
314 | 323 | $expressionLanguageId = $record->expression->language; |
315 | | - else |
| 324 | + } else { |
316 | 325 | $expressionLanguageId = $this->filterLanguageId; |
317 | | - |
| 326 | + } |
| 327 | + |
318 | 328 | $expressionMeanings = $record->expressionMeanings->expressionExactMeanings; |
319 | 329 | |
320 | 330 | if ( $expressionLanguageId != 0 && $expressionMeanings->getRecordCount() > 0 ) { |
— | — | @@ -328,7 +338,7 @@ |
329 | 339 | |
330 | 340 | $text = $definitionRecord->text; |
331 | 341 | $languageId = $definitionRecord->language; |
332 | | - |
| 342 | + |
333 | 343 | if ( $languageId != 0 && $text != "" ) { |
334 | 344 | $expression = findOrCreateExpression( $this->spelling, $expressionLanguageId ); |
335 | 345 | createNewDefinedMeaning( $expression->id, $languageId, $text ); |
— | — | @@ -361,8 +371,9 @@ |
362 | 372 | $classAttributes = $idPath->getClassAttributes()->filterClassAttributesOnLevelAndType( $this->levelName, $annotationType ); |
363 | 373 | $classAttributes = $this->attributeIDFilter->filter( $classAttributes ); |
364 | 374 | |
365 | | - if ( count( $classAttributes ) == 1 ) |
| 375 | + if ( count( $classAttributes ) == 1 ) { |
366 | 376 | $result = $classAttributes[0]; |
| 377 | + } |
367 | 378 | } |
368 | 379 | |
369 | 380 | return $result; |
— | — | @@ -375,8 +386,9 @@ |
376 | 387 | $definedMeaningAttributeId = $this->determineAttributeId( $idPath, "DM", $record->relationType ); |
377 | 388 | $definedMeaningValue = $record->otherDefinedMeaning; |
378 | 389 | |
379 | | - if ( $definedMeaningAttributeId != 0 && $definedMeaningValue != 0 ) |
| 390 | + if ( $definedMeaningAttributeId != 0 && $definedMeaningValue != 0 ) { |
380 | 391 | addRelation( $objectId, $definedMeaningAttributeId, $definedMeaningValue ); |
| 392 | + } |
381 | 393 | } |
382 | 394 | |
383 | 395 | public function remove( $keyPath ) { |
— | — | @@ -391,8 +403,9 @@ |
392 | 404 | $textAttributeId = $this->determineAttributeId( $idPath, "TEXT", $record->textAttribute ); |
393 | 405 | $text = $record->text; |
394 | 406 | |
395 | | - if ( $textAttributeId != 0 && $text != '' ) |
| 407 | + if ( $textAttributeId != 0 && $text != '' ) { |
396 | 408 | addTextAttributeValue( $objectId, $textAttributeId, $text ); |
| 409 | + } |
397 | 410 | } |
398 | 411 | |
399 | 412 | public function remove( $keyPath ) { |
— | — | @@ -405,16 +418,17 @@ |
406 | 419 | |
407 | 420 | $text = $record->text; |
408 | 421 | |
409 | | - if ( $text != "" ) |
| 422 | + if ( $text != "" ) { |
410 | 423 | updateTextAttributeValue( $text, $textId ); |
| 424 | + } |
411 | 425 | } |
412 | 426 | } |
413 | 427 | |
414 | 428 | class LinkAttributeValuesController extends ObjectAttributeValuesController { |
415 | 429 | protected function validateURL( $url ) { |
416 | | - if ( !strpos( $url, "://" ) ) |
| 430 | + if ( !strpos( $url, "://" ) ) { |
417 | 431 | $url = "http://" . $url; |
418 | | - |
| 432 | + } |
419 | 433 | return $url; |
420 | 434 | } |
421 | 435 | |
— | — | @@ -425,8 +439,9 @@ |
426 | 440 | $label = $linkValue->linkLabel; |
427 | 441 | $url = $linkValue->linkURL; |
428 | 442 | |
429 | | - if ( $linkAttributeId != 0 && $url != "" ) |
| 443 | + if ( $linkAttributeId != 0 && $url != "" ) { |
430 | 444 | addLinkAttributeValue( $objectId, $linkAttributeId, $this->validateURL( $url ), $label ); |
| 445 | + } |
431 | 446 | } |
432 | 447 | |
433 | 448 | public function remove( $keyPath ) { |
— | — | @@ -440,8 +455,9 @@ |
441 | 456 | $label = $linkValue->linkLabel; |
442 | 457 | $url = $linkValue->linkURL; |
443 | 458 | |
444 | | - if ( $url != "" ) |
| 459 | + if ( $url != "" ) { |
445 | 460 | updateLinkAttributeValue( $linkId, $this->validateURL( $url ), $label ); |
| 461 | + } |
446 | 462 | } |
447 | 463 | } |
448 | 464 | |
— | — | @@ -491,8 +507,9 @@ |
492 | 508 | $text = $record->text; |
493 | 509 | $translatedTextAttribute = getTranslatedTextAttribute( $valueId ); |
494 | 510 | |
495 | | - if ( $languageId != 0 && $text != "" ) |
| 511 | + if ( $languageId != 0 && $text != "" ) { |
496 | 512 | addTranslatedTextIfNotPresent( $translatedTextAttribute->value_tcid, $languageId, $text ); |
| 513 | + } |
497 | 514 | } |
498 | 515 | |
499 | 516 | public function remove( $keyPath ) { |
— | — | @@ -509,8 +526,9 @@ |
510 | 527 | $text = $record->text; |
511 | 528 | $translatedTextAttribute = getTranslatedTextAttribute( $valueId ); |
512 | 529 | |
513 | | - if ( $text != "" ) |
| 530 | + if ( $text != "" ) { |
514 | 531 | updateTranslatedText( $translatedTextAttribute->value_tcid, $languageId, $text ); |
| 532 | + } |
515 | 533 | } |
516 | 534 | } |
517 | 535 | |
— | — | @@ -525,8 +543,9 @@ |
526 | 544 | $valueId = $keyPath->peek( 0 )->translatedTextAttributeId; |
527 | 545 | $translatedTextAttribute = getTranslatedTextAttribute( $valueId ); |
528 | 546 | |
529 | | - if ( $value != "" ) |
| 547 | + if ( $value != "" ) { |
530 | 548 | updateTranslatedText( $translatedTextAttribute->value_tcid, $this->filterLanguageId, $value ); |
| 549 | + } |
531 | 550 | } |
532 | 551 | } |
533 | 552 | |
— | — | @@ -535,8 +554,9 @@ |
536 | 555 | $objectId = $this->objectIdFetcher->fetch( $idPath->getKeyStack() ); |
537 | 556 | $optionId = $record->optionAttributeOption; |
538 | 557 | |
539 | | - if ( $optionId ) |
| 558 | + if ( $optionId ) { |
540 | 559 | addOptionAttributeValue( $objectId, $optionId ); |
| 560 | + } |
541 | 561 | } |
542 | 562 | |
543 | 563 | public function remove( $keyPath ) { |
— | — | @@ -550,10 +570,12 @@ |
551 | 571 | $attributeId = $idPath->getKeyStack()->peek( 0 )->classAttributeId; |
552 | 572 | $optionMeaningId = $record->optionAttributeOption; |
553 | 573 | $languageId = $record->language; |
554 | | - if ( $languageId == NULL ) $languageId = 0 ; |
555 | | - |
556 | | - if ( $optionMeaningId ) |
| 574 | + if ( $languageId == NULL ) { |
| 575 | + $languageId = 0 ; |
| 576 | + } |
| 577 | + if ( $optionMeaningId ) { |
557 | 578 | addOptionAttributeOption( $attributeId, $optionMeaningId, $languageId ); |
| 579 | + } |
558 | 580 | } |
559 | 581 | |
560 | 582 | public function remove( $keyPath ) { |
— | — | @@ -581,5 +603,3 @@ |
582 | 604 | return $source == null || $source == 0; |
583 | 605 | } |
584 | 606 | } |
585 | | - |
586 | | - |
Index: trunk/extensions/Wikidata/OmegaWiki/RecordSetQueries.php |
— | — | @@ -1,6 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | require_once( 'Transaction.php' ); |
| 5 | +require_once( 'WikiDataTables.php' ); |
5 | 6 | |
6 | 7 | class TableColumnsToAttribute { |
7 | 8 | protected $tableColumns; |
— | — | @@ -24,28 +25,30 @@ |
25 | 26 | protected $tableColumnsToAttributes; |
26 | 27 | |
27 | 28 | public function __construct( $tableColumnsToAttributes ) { |
28 | | - if ( is_array( $tableColumnsToAttributes ) ) |
| 29 | + if ( is_array( $tableColumnsToAttributes ) ) { |
29 | 30 | $this->tableColumnsToAttributes = $tableColumnsToAttributes; |
30 | | - else |
| 31 | + } else { |
31 | 32 | $this->tableColumnsToAttributes = func_get_args(); |
| 33 | + } |
32 | 34 | } |
33 | 35 | |
34 | 36 | public function getSelectColumns() { |
35 | 37 | $result = array(); |
36 | 38 | |
37 | | - foreach ( $this->tableColumnsToAttributes as $tableColumnToAttribute ) |
38 | | - foreach ( $tableColumnToAttribute->getTableColumns() as $tableColumn ) |
| 39 | + foreach ( $this->tableColumnsToAttributes as $tableColumnToAttribute ) { |
| 40 | + foreach ( $tableColumnToAttribute->getTableColumns() as $tableColumn ) { |
39 | 41 | $result[] = $tableColumn; |
40 | | - |
| 42 | + } |
| 43 | + } |
41 | 44 | return $result; |
42 | 45 | } |
43 | 46 | |
44 | 47 | public function getAttributes() { |
45 | 48 | $result = array(); |
46 | 49 | |
47 | | - foreach ( $this->tableColumnsToAttributes as $tableColumnToAttribute ) |
| 50 | + foreach ( $this->tableColumnsToAttributes as $tableColumnToAttribute ) { |
48 | 51 | $result[] = $tableColumnToAttribute->getAttribute(); |
49 | | - |
| 52 | + } |
50 | 53 | return $result; |
51 | 54 | } |
52 | 55 | |
— | — | @@ -68,25 +71,26 @@ |
69 | 72 | $groupBy = $transactionInformation->versioningGroupBy( $table ); |
70 | 73 | $selectFields = array_merge( $selectFields, $transactionInformation->versioningFields( $table->getIdentifier() ) ); |
71 | 74 | } |
72 | | - else |
| 75 | + else { |
73 | 76 | $groupBy = array(); |
| 77 | + } |
74 | 78 | |
75 | 79 | $query = |
76 | 80 | "SELECT " . implode( ", ", $selectFields ) . |
77 | 81 | " FROM " . implode( ", ", $tableNames ); |
78 | 82 | |
79 | | - if ( count( $restrictions ) > 0 ) |
| 83 | + if ( count( $restrictions ) > 0 ) { |
80 | 84 | $query .= " WHERE " . implode( ' AND ', $restrictions ); |
81 | | - |
82 | | - if ( count( $groupBy ) > 0 ) |
| 85 | + } |
| 86 | + if ( count( $groupBy ) > 0 ) { |
83 | 87 | $query .= " GROUP BY " . implode( ', ', $groupBy ); |
84 | | - |
85 | | - if ( count( $orderBy ) > 0 ) |
| 88 | + } |
| 89 | + if ( count( $orderBy ) > 0 ) { |
86 | 90 | $query .= " ORDER BY " . implode( ', ', $orderBy ); |
87 | | - |
88 | | - if ( $count != - 1 ) |
| 91 | + } |
| 92 | + if ( $count != - 1 ) { |
89 | 93 | $query .= " LIMIT " . $offset . ", " . $count; |
90 | | - |
| 94 | + } |
91 | 95 | return $query; |
92 | 96 | } |
93 | 97 | |
— | — | @@ -107,18 +111,20 @@ |
108 | 112 | $selectFields = $tableColumnsToAttributeMapping->getSelectColumns(); |
109 | 113 | $attributes = $tableColumnsToAttributeMapping->getAttributes(); |
110 | 114 | |
111 | | - if ( $table->isVersioned ) |
| 115 | + if ( $table->isVersioned ) { |
112 | 116 | $allAttributes = array_merge( $attributes, $transactionInformation->versioningAttributes() ); |
113 | | - else |
| 117 | + } else { |
114 | 118 | $allAttributes = $attributes; |
| 119 | + } |
115 | 120 | |
116 | 121 | $query = getTransactedSQL( $transactionInformation, $selectFields, $table, $restrictions, $orderBy, $count, $offset ); |
117 | 122 | $queryResult = $dbr->query( $query ); |
118 | 123 | |
119 | | - if ( !is_null( $recordSetStructureId ) ) |
| 124 | + if ( !is_null( $recordSetStructureId ) ) { |
120 | 125 | $structure = new Structure( $recordSetStructureId, $allAttributes ); |
121 | | - else |
| 126 | + } else { |
122 | 127 | $structure = new Structure( $allAttributes ); |
| 128 | + } |
123 | 129 | |
124 | 130 | $recordSet = new ArrayRecordSet( $structure, new Structure( $keyAttribute ) ); |
125 | 131 | |
— | — | @@ -131,10 +137,11 @@ |
132 | 138 | $attribute = $mapping->getAttribute(); |
133 | 139 | $tableColumns = $mapping->getTableColumns(); |
134 | 140 | |
135 | | - if ( count( $tableColumns ) == 1 ) |
| 141 | + if ( count( $tableColumns ) == 1 ) { |
136 | 142 | $value = $row[$columnIndex]; |
137 | | - else |
| 143 | + } else { |
138 | 144 | $value = getRecordFromRow( $row, $columnIndex, $attribute->type ); |
| 145 | + } |
139 | 146 | |
140 | 147 | $record->setAttributeValue( $attribute, $value ); |
141 | 148 | $columnIndex += count( $tableColumns ); |
— | — | @@ -153,8 +160,9 @@ |
154 | 161 | for ( $i = 0; $i < $recordSet->getRecordCount(); $i++ ) { |
155 | 162 | $record = $recordSet->getRecord( $i ); |
156 | 163 | |
157 | | - foreach ( $idAttributes as $idAttribute ) |
| 164 | + foreach ( $idAttributes as $idAttribute ) { |
158 | 165 | $ids[] = $record->getAttributeValue( $idAttribute ); |
| 166 | + } |
159 | 167 | } |
160 | 168 | |
161 | 169 | return array_unique( $ids ); |
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWiki.php |
— | — | @@ -38,8 +38,7 @@ |
39 | 39 | } |
40 | 40 | |
41 | 41 | public function history() { |
42 | | - global |
43 | | - $wgOut, $wgTitle; |
| 42 | + global $wgOut, $wgTitle; |
44 | 43 | |
45 | 44 | parent::history(); |
46 | 45 | |
— | — | @@ -57,8 +56,7 @@ |
58 | 57 | } |
59 | 58 | |
60 | 59 | protected function save( $referenceQueryTransactionInformation ) { |
61 | | - global |
62 | | - $wgTitle; |
| 60 | + global $wgTitle; |
63 | 61 | |
64 | 62 | parent::save( $referenceQueryTransactionInformation ); |
65 | 63 | |
— | — | @@ -71,10 +69,11 @@ |
72 | 70 | } |
73 | 71 | |
74 | 72 | public function edit() { |
75 | | - global |
76 | | - $wgOut, $wgTitle, $wgUser; |
| 73 | + global $wgOut, $wgTitle, $wgUser; |
77 | 74 | |
78 | | - if ( !parent::edit() ) return false; |
| 75 | + if ( !parent::edit() ) { |
| 76 | + return false; |
| 77 | + } |
79 | 78 | $this->outputEditHeader(); |
80 | 79 | |
81 | 80 | $spelling = $wgTitle->getText(); |
— | — | @@ -90,14 +89,13 @@ |
91 | 90 | } |
92 | 91 | |
93 | 92 | public function getTitle() { |
94 | | - global |
95 | | - $wgTitle, $wgUseExpressionPageTitlePrefix; |
| 93 | + global $wgTitle, $wgUseExpressionPageTitlePrefix; |
96 | 94 | |
97 | | - if ( $wgUseExpressionPageTitlePrefix ) |
| 95 | + if ( $wgUseExpressionPageTitlePrefix ) { |
98 | 96 | $title = wfMsg( 'ow_Multiple_meanings', $wgTitle->getText() ); |
99 | | - else |
| 97 | + } else { |
100 | 98 | $title = $wgTitle->getText(); |
101 | | - |
| 99 | + } |
102 | 100 | return $title; |
103 | 101 | } |
104 | 102 | |