Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataGlobals.php |
— | — | @@ -43,6 +43,7 @@ |
44 | 44 | $wgPopupAnnotationName, |
45 | 45 | $wgPossibleSynonymAttributeName, |
46 | 46 | $wgPossiblySynonymousAttributeName, |
| 47 | + $wgPropertyAttributeName, |
47 | 48 | $wgRelationsAttributeName, |
48 | 49 | $wgRelationTypeAttributeName, |
49 | 50 | $wgSourceAttributeName, |
— | — | @@ -90,6 +91,7 @@ |
91 | 92 | $wgPopupAnnotationName = "Annotation"; |
92 | 93 | $wgPossibleSynonymAttributeName = "Possible synonym"; |
93 | 94 | $wgPossiblySynonymousAttributeName = "Possibly synonymous"; |
| 95 | +$wgPropertyAttributeName = "Property"; |
94 | 96 | $wgRelationsAttributeName = "Relations"; |
95 | 97 | $wgRelationTypeAttributeName = "Relation type"; |
96 | 98 | $wgSpellingAttributeName = "Spelling"; |
Index: trunk/extensions/Wikidata/OmegaWiki/PropertyToColumnFilter.php |
— | — | @@ -3,17 +3,23 @@ |
4 | 4 | require_once('Attribute.php'); |
5 | 5 | |
6 | 6 | class PropertyToColumnFilter { |
7 | | - public $attributeIDs; // Array containing the defined meaning ids of the attributes that should be filtered |
8 | | - protected $attribute; // Attribute |
| 7 | + public $attributeIDs; // Array containing the defined meaning ids of the attributes that should be filtered |
| 8 | + protected $attribute; // Attribute |
| 9 | + protected $propertyCaption; // Caption of the first column |
9 | 10 | |
10 | | - public function __construct($identifier, $caption, array $attributeIDs) { |
| 11 | + public function __construct($identifier, $caption, $propertyCaption, array $attributeIDs) { |
11 | 12 | $this->attributeIDs = $attributeIDs; |
12 | | - $this->attribute = new Attribute($identifier, $caption, "will-be-specified-later"); |
| 13 | + $this->attribute = new Attribute($identifier, $caption, "will-be-specified-later"); |
| 14 | + $this->propertyCaption = $propertyCaption; |
13 | 15 | } |
14 | 16 | |
15 | 17 | public function getAttribute() { |
16 | 18 | return $this->attribute; |
17 | 19 | } |
| 20 | + |
| 21 | + public function getPropertyCaption() { |
| 22 | + return $this->propertyCaption; |
| 23 | + } |
18 | 24 | } |
19 | 25 | |
20 | 26 | ?> |
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiEditors.php |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | protected $propertyAttribute; |
25 | 25 | protected $valueAttribute; |
26 | 26 | |
27 | | - public function __construct(Attribute $attribute, ViewInformation $viewInformation) { |
| 27 | + public function __construct(Attribute $attribute, $propertyCaption, ViewInformation $viewInformation) { |
28 | 28 | parent::__construct(new RecordUnorderedListEditor($attribute, 5)); |
29 | 29 | |
30 | 30 | $this->recordSetTableEditor = new RecordSetTableEditor( |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | null |
38 | 38 | ); |
39 | 39 | |
40 | | - $this->propertyAttribute = new Attribute("property", "Property", "short-text"); |
| 40 | + $this->propertyAttribute = new Attribute("property", $propertyCaption, "short-text"); |
41 | 41 | $this->valueAttribute = new Attribute("value", "Value", "short-text"); |
42 | 42 | |
43 | 43 | foreach ($viewInformation->getPropertyToColumnFilters() as $propertyToColumnFilter) |
— | — | @@ -184,24 +184,26 @@ |
185 | 185 | $textValueObjectAttributesEditors, $textAttributeIdAttribute, |
186 | 186 | $linkValueObjectAttributesEditors, $linkAttributeIdAttribute, |
187 | 187 | $translatedTextValueObjectAttributesEditors, $translatedTextAttributeIdAttribute, |
188 | | - $optionValueObjectAttributesEditors, $optionAttributeIdAttribute, $annotationMeaningName; |
| 188 | + $optionValueObjectAttributesEditors, $optionAttributeIdAttribute, $annotationMeaningName, |
| 189 | + $wgPropertyAttributeName; |
189 | 190 | |
190 | 191 | $linkValueObjectAttributesEditors = array(); |
191 | 192 | $textValueObjectAttributesEditors = array(); |
192 | 193 | |
193 | 194 | foreach ($viewInformation->getPropertyToColumnFilters() as $propertyToColumnFilter) { |
194 | 195 | $attribute = $propertyToColumnFilter->getAttribute(); |
| 196 | + $propertyCaption = $propertyToColumnFilter->getPropertyCaption(); |
195 | 197 | |
196 | | - $textValueObjectAttributesEditors[] = new ObjectAttributeValuesEditor($attribute, $viewInformation); |
197 | | - $linkValueObjectAttributeEditors[] = new ObjectAttributeValuesEditor($attribute, $viewInformation); |
198 | | - $translatedTextValueObjectAttributesEditors[] = new ObjectAttributeValuesEditor($attribute, $viewInformation); |
199 | | - $optionValueObjectAttributesEditors[] = new ObjectAttributeValuesEditor($attribute, $viewInformation); |
| 198 | + $textValueObjectAttributesEditors[] = new ObjectAttributeValuesEditor($attribute, $propertyCaption, $viewInformation); |
| 199 | + $linkValueObjectAttributeEditors[] = new ObjectAttributeValuesEditor($attribute, $propertyCaption, $viewInformation); |
| 200 | + $translatedTextValueObjectAttributesEditors[] = new ObjectAttributeValuesEditor($attribute, $propertyCaption, $viewInformation); |
| 201 | + $optionValueObjectAttributesEditors[] = new ObjectAttributeValuesEditor($attribute, $propertyCaption, $viewInformation); |
200 | 202 | } |
201 | 203 | |
202 | | - $textValueObjectAttributesEditors[] = new ObjectAttributeValuesEditor($objectAttributesAttribute, $viewInformation); |
203 | | - $linkValueObjectAttributesEditors[] = new ObjectAttributeValuesEditor($objectAttributesAttribute, $viewInformation); |
204 | | - $translatedTextValueObjectAttributesEditors[] = new ObjectAttributeValuesEditor($objectAttributesAttribute, $viewInformation); |
205 | | - $optionValueObjectAttributesEditors[] = new ObjectAttributeValuesEditor($objectAttributesAttribute, $viewInformation); |
| 204 | + $textValueObjectAttributesEditors[] = new ObjectAttributeValuesEditor($objectAttributesAttribute, $wgPropertyAttributeName, $viewInformation); |
| 205 | + $linkValueObjectAttributesEditors[] = new ObjectAttributeValuesEditor($objectAttributesAttribute, $wgPropertyAttributeName, $viewInformation); |
| 206 | + $translatedTextValueObjectAttributesEditors[] = new ObjectAttributeValuesEditor($objectAttributesAttribute, $wgPropertyAttributeName, $viewInformation); |
| 207 | + $optionValueObjectAttributesEditors[] = new ObjectAttributeValuesEditor($objectAttributesAttribute, $wgPropertyAttributeName, $viewInformation); |
206 | 208 | |
207 | 209 | foreach ($textValueObjectAttributesEditors as $textValueObjectAttributesEditor) |
208 | 210 | addObjectAttributesEditors($textValueObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $textAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
— | — | @@ -264,7 +266,8 @@ |
265 | 267 | function getDefinitionEditor(ViewInformation $viewInformation) { |
266 | 268 | global |
267 | 269 | $definitionAttribute, $translatedTextAttribute, $wgPopupAnnotationName, |
268 | | - $objectAttributesAttribute, $definedMeaningIdAttribute, $definitionMeaningName, $objectAttributesAttribute; |
| 270 | + $objectAttributesAttribute, $definedMeaningIdAttribute, $definitionMeaningName, $objectAttributesAttribute, |
| 271 | + $wgPropertyAttributeName; |
269 | 272 | |
270 | 273 | $editor = new RecordDivListEditor($definitionAttribute); |
271 | 274 | $editor->addEditor(getTranslatedTextEditor( |
— | — | @@ -276,14 +279,15 @@ |
277 | 280 | |
278 | 281 | foreach ($viewInformation->getPropertyToColumnFilters() as $propertyToColumnFilter) { |
279 | 282 | $attribute = $propertyToColumnFilter->getAttribute(); |
| 283 | + $propertyCaption = $propertyToColumnFilter->getPropertyCaption(); |
280 | 284 | $editor->addEditor(new PopUpEditor( |
281 | | - createDefinitionObjectAttributesEditor($viewInformation, $attribute, $definedMeaningIdAttribute, 0, $definitionMeaningName), |
| 285 | + createDefinitionObjectAttributesEditor($viewInformation, $attribute, $propertyCaption, $definedMeaningIdAttribute, 0, $definitionMeaningName), |
282 | 286 | $attribute->name |
283 | 287 | )); |
284 | 288 | } |
285 | 289 | |
286 | 290 | $editor->addEditor(new PopUpEditor( |
287 | | - createDefinitionObjectAttributesEditor($viewInformation, $objectAttributesAttribute, $definedMeaningIdAttribute, 0, $definitionMeaningName), |
| 291 | + createDefinitionObjectAttributesEditor($viewInformation, $objectAttributesAttribute, $wgPropertyAttributeName, $definedMeaningIdAttribute, 0, $definitionMeaningName), |
288 | 292 | $wgPopupAnnotationName |
289 | 293 | )); |
290 | 294 | |
— | — | @@ -295,7 +299,8 @@ |
296 | 300 | |
297 | 301 | foreach ($viewInformation->getPropertyToColumnFilters() as $propertyToColumnFilter) { |
298 | 302 | $attribute = $propertyToColumnFilter->getAttribute(); |
299 | | - $result[] = createObjectAttributesEditor($viewInformation, $attribute, $idAttribute, $levelsFromDefinedMeaning, $levelName); |
| 303 | + $propertyCaption = $propertyToColumnFilter->getPropertyCaption(); |
| 304 | + $result[] = createObjectAttributesEditor($viewInformation, $attribute, $propertyCaption, $idAttribute, $levelsFromDefinedMeaning, $levelName); |
300 | 305 | } |
301 | 306 | |
302 | 307 | return $result; |
— | — | @@ -332,11 +337,11 @@ |
333 | 338 | $objectAttributesEditor->addEditor(getOptionAttributeValuesEditor($viewInformation, new OptionAttributeValuesController($objectIdFetcher), $levelDefinedMeaningName, $dmObjectIdFetcher)); |
334 | 339 | } |
335 | 340 | |
336 | | -function createObjectAttributesEditor(ViewInformation $viewInformation, Attribute $attribute, Attribute $idAttribute, $levelsFromDefinedMeaning, $levelName) { |
| 341 | +function createObjectAttributesEditor(ViewInformation $viewInformation, Attribute $attribute, $propertyCaption, Attribute $idAttribute, $levelsFromDefinedMeaning, $levelName) { |
337 | 342 | global |
338 | 343 | $objectAttributesAttribute, $definedMeaningIdAttribute; |
339 | 344 | |
340 | | - $result = new ObjectAttributeValuesEditor($attribute, $viewInformation); |
| 345 | + $result = new ObjectAttributeValuesEditor($attribute, $propertyCaption, $viewInformation); |
341 | 346 | |
342 | 347 | addObjectAttributesEditors( |
343 | 348 | $result, |
— | — | @@ -349,11 +354,11 @@ |
350 | 355 | return $result; |
351 | 356 | } |
352 | 357 | |
353 | | -function createDefinitionObjectAttributesEditor(ViewInformation $viewInformation, Attribute $attribute, Attribute $idAttribute, $levelsFromDefinedMeaning, $levelName) { |
| 358 | +function createDefinitionObjectAttributesEditor(ViewInformation $viewInformation, Attribute $attribute, $propertyCaption, Attribute $idAttribute, $levelsFromDefinedMeaning, $levelName) { |
354 | 359 | global |
355 | 360 | $objectAttributesAttribute, $definedMeaningIdAttribute; |
356 | 361 | |
357 | | - $result = new ObjectAttributeValuesEditor($attribute, $viewInformation); |
| 362 | + $result = new ObjectAttributeValuesEditor($attribute, $propertyCaption, $viewInformation); |
358 | 363 | |
359 | 364 | addObjectAttributesEditors( |
360 | 365 | $result, |
— | — | @@ -427,7 +432,8 @@ |
428 | 433 | global |
429 | 434 | $synonymsAndTranslationsAttribute, $identicalMeaningAttribute, $expressionIdAttribute, |
430 | 435 | $expressionAttribute, $wgPopupAnnotationName, |
431 | | - $syntransIdAttribute, $synTransMeaningName, $objectAttributesAttribute; |
| 436 | + $syntransIdAttribute, $synTransMeaningName, $objectAttributesAttribute, |
| 437 | + $wgPropertyAttributeName; |
432 | 438 | |
433 | 439 | $tableEditor = new RecordSetTableEditor( |
434 | 440 | $synonymsAndTranslationsAttribute, |
— | — | @@ -445,7 +451,7 @@ |
446 | 452 | addPropertyToColumnFilterEditors($tableEditor, $viewInformation, $syntransIdAttribute, 1, $synTransMeaningName); |
447 | 453 | |
448 | 454 | $tableEditor->addEditor(new PopUpEditor( |
449 | | - createObjectAttributesEditor($viewInformation, $objectAttributesAttribute, $syntransIdAttribute, 1, $synTransMeaningName), |
| 455 | + createObjectAttributesEditor($viewInformation, $objectAttributesAttribute, $wgPropertyAttributeName, $syntransIdAttribute, 1, $synTransMeaningName), |
450 | 456 | $wgPopupAnnotationName |
451 | 457 | )); |
452 | 458 | |
— | — | @@ -457,7 +463,8 @@ |
458 | 464 | function getDefinedMeaningRelationsEditor(ViewInformation $viewInformation) { |
459 | 465 | global |
460 | 466 | $relationsAttribute, $relationTypeAttribute, $otherDefinedMeaningAttribute, $objectAttributesAttribute, |
461 | | - $relationsObjectAttributesEditor, $relationIdAttribute, $relationMeaningName, $wgPopupAnnotationName; |
| 467 | + $relationsObjectAttributesEditor, $relationIdAttribute, $relationMeaningName, $wgPopupAnnotationName, |
| 468 | + $wgPropertyAttributeName; |
462 | 469 | |
463 | 470 | $editor = new RecordSetTableEditor($relationsAttribute, new SimplePermissionController(true), new ShowEditFieldChecker(true), new AllowAddController(true), true, false, new DefinedMeaningRelationController()); |
464 | 471 | $editor->addEditor(new RelationTypeReferenceEditor($relationTypeAttribute, new SimplePermissionController(false), true)); |
— | — | @@ -466,7 +473,7 @@ |
467 | 474 | addPropertyToColumnFilterEditors($editor, $viewInformation, $relationIdAttribute, 1, $relationMeaningName); |
468 | 475 | |
469 | 476 | $editor->addEditor(new PopUpEditor( |
470 | | - createObjectAttributesEditor($viewInformation, $objectAttributesAttribute, $relationIdAttribute, 1, $relationMeaningName), |
| 477 | + createObjectAttributesEditor($viewInformation, $objectAttributesAttribute, $wgPropertyAttributeName, $relationIdAttribute, 1, $relationMeaningName), |
471 | 478 | $wgPopupAnnotationName |
472 | 479 | )); |
473 | 480 | |
— | — | @@ -478,7 +485,8 @@ |
479 | 486 | function getDefinedMeaningReciprocalRelationsEditor(ViewInformation $viewInformation) { |
480 | 487 | global |
481 | 488 | $reciprocalRelationsAttribute, $relationTypeAttribute, $otherDefinedMeaningAttribute, $objectAttributesAttribute, |
482 | | - $relationsObjectAttributesEditor, $relationIdAttribute, $relationMeaningName, $wgPopupAnnotationName; |
| 489 | + $relationsObjectAttributesEditor, $relationIdAttribute, $relationMeaningName, $wgPopupAnnotationName, |
| 490 | + $wgPropertyAttributeName; |
483 | 491 | |
484 | 492 | $editor = new RecordSetTableEditor($reciprocalRelationsAttribute, new SimplePermissionController(false), new ShowEditFieldChecker(true), new AllowAddController(false), false, false, null); |
485 | 493 | $editor->addEditor(new DefinedMeaningReferenceEditor($otherDefinedMeaningAttribute, new SimplePermissionController(false), true)); |
— | — | @@ -487,7 +495,7 @@ |
488 | 496 | addPropertyToColumnFilterEditors($editor, $viewInformation, $relationIdAttribute, 1, $relationMeaningName); |
489 | 497 | |
490 | 498 | $editor->addEditor(new PopUpEditor( |
491 | | - createObjectAttributesEditor($viewInformation, $objectAttributesAttribute, $relationIdAttribute, 1, $relationMeaningName), |
| 499 | + createObjectAttributesEditor($viewInformation, $objectAttributesAttribute, $wgPropertyAttributeName, $relationIdAttribute, 1, $relationMeaningName), |
492 | 500 | $wgPopupAnnotationName |
493 | 501 | )); |
494 | 502 | |
— | — | @@ -711,7 +719,8 @@ |
712 | 720 | global |
713 | 721 | $wdDefinedMeaningAttributesOrder, $definedMeaningIdAttribute, $definedMeaningMeaningName, |
714 | 722 | $definedMeaningAttribute, $possiblySynonymousIdAttribute, $possiblySynonymousAttribute, |
715 | | - $possibleSynonymAttribute, $relationMeaningName, $objectAttributesAttribute, $definedMeaningAttributesAttribute; |
| 723 | + $possibleSynonymAttribute, $relationMeaningName, $objectAttributesAttribute, $definedMeaningAttributesAttribute, |
| 724 | + $wgPropertyAttributeName; |
716 | 725 | |
717 | 726 | $definitionEditor = getDefinitionEditor($viewInformation); |
718 | 727 | $alternativeDefinitionsEditor = getAlternativeDefinitionsEditor($viewInformation); |
— | — | @@ -728,7 +737,7 @@ |
729 | 738 | $possibleSynonymAttribute, |
730 | 739 | $viewInformation->possiblySynonymousRelationTypeId, |
731 | 740 | $viewInformation, |
732 | | - createObjectAttributesEditor($viewInformation, $objectAttributesAttribute, $possiblySynonymousIdAttribute, 1, $relationMeaningName) |
| 741 | + createObjectAttributesEditor($viewInformation, $objectAttributesAttribute, $wgPropertyAttributeName, $possiblySynonymousIdAttribute, 1, $relationMeaningName) |
733 | 742 | ); |
734 | 743 | |
735 | 744 | $availableEditors = new AttributeEditorMap(); |
— | — | @@ -744,7 +753,7 @@ |
745 | 754 | foreach (createPropertyToColumnFilterEditors($viewInformation, $definedMeaningIdAttribute, 0, $definedMeaningMeaningName) as $propertyToColumnEditor) |
746 | 755 | $availableEditors->addEditor($propertyToColumnEditor); |
747 | 756 | |
748 | | - $availableEditors->addEditor(createObjectAttributesEditor($viewInformation, $definedMeaningAttributesAttribute, $definedMeaningIdAttribute, 0, $definedMeaningMeaningName)); |
| 757 | + $availableEditors->addEditor(createObjectAttributesEditor($viewInformation, $definedMeaningAttributesAttribute, $wgPropertyAttributeName, $definedMeaningIdAttribute, 0, $definedMeaningMeaningName)); |
749 | 758 | |
750 | 759 | if ($viewInformation->possiblySynonymousRelationTypeId != 0) |
751 | 760 | $availableEditors->addEditor($possiblySynonymousEditor); |