Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiEditors.php |
— | — | @@ -10,36 +10,18 @@ |
11 | 11 | |
12 | 12 | function initializeObjectAttributeEditors(ViewInformation $viewInformation) { |
13 | 13 | global |
14 | | - $objectAttributesAttribute, $definedMeaningAttributesAttribute, |
15 | | - $definedMeaningObjectAttributesEditor, $definedMeaningIdAttribute, |
16 | | - $definitionObjectAttributesEditor, $definedMeaningIdAttribute, |
17 | | - $synonymsAndTranslationsObjectAttributesEditor, $syntransIdAttribute, |
18 | | - $relationsObjectAttributesEditor, $relationIdAttribute, |
19 | | - $possiblySynonymousObjectAttributesEditor, $possiblySynonymousIdAttribute, |
| 14 | + $objectAttributesAttribute, $definedMeaningIdAttribute, |
20 | 15 | $textValueObjectAttributesEditor, $textAttributeIdAttribute, |
21 | 16 | $urlValueObjectAttributesEditor, $urlAttributeIdAttribute, |
22 | 17 | $translatedTextValueObjectAttributesEditor, $translatedTextAttributeIdAttribute, |
23 | | - $optionValueObjectAttributesEditor, $optionAttributeIdAttribute, |
24 | | - $definedMeaningMeaningName, $definitionMeaningName, |
25 | | - $relationMeaningName, $synTransMeaningName, |
26 | | - $annotationMeaningName; |
| 18 | + $optionValueObjectAttributesEditor, $optionAttributeIdAttribute, $annotationMeaningName; |
27 | 19 | |
28 | | - $definedMeaningObjectAttributesEditor = new RecordUnorderedListEditor($definedMeaningAttributesAttribute, 5); |
29 | | - $definitionObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5); |
30 | | - $synonymsAndTranslationsObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5); |
31 | | - $possiblySynonymousObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5); |
32 | | - $relationsObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5); |
33 | 20 | |
34 | 21 | $textValueObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5); |
35 | 22 | $urlValueObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5); |
36 | 23 | $translatedTextValueObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5); |
37 | 24 | $optionValueObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5); |
38 | 25 | |
39 | | - setObjectAttributesEditor($definedMeaningObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $definedMeaningIdAttribute), $definedMeaningMeaningName, new ObjectIdFetcher(0, $definedMeaningIdAttribute)); |
40 | | - setObjectAttributesEditor($definitionObjectAttributesEditor, $viewInformation, new DefinitionObjectIdFetcher(0, $definedMeaningIdAttribute), $definitionMeaningName, new ObjectIdFetcher(0, $definedMeaningIdAttribute)); |
41 | | - setObjectAttributesEditor($synonymsAndTranslationsObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $syntransIdAttribute), $synTransMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
42 | | - setObjectAttributesEditor($possiblySynonymousObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $possiblySynonymousIdAttribute), $relationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
43 | | - setObjectAttributesEditor($relationsObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $relationIdAttribute), $relationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
44 | 26 | setObjectAttributesEditor($textValueObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $textAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
45 | 27 | setObjectAttributesEditor($urlValueObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $urlAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
46 | 28 | setObjectAttributesEditor($translatedTextValueObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $translatedTextAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
— | — | @@ -82,7 +64,8 @@ |
83 | 65 | |
84 | 66 | function getDefinitionEditor(ViewInformation $viewInformation) { |
85 | 67 | global |
86 | | - $definitionAttribute, $translatedTextAttribute, $definitionObjectAttributesEditor, $wgPopupAnnotationName; |
| 68 | + $definitionAttribute, $translatedTextAttribute, $wgPopupAnnotationName, |
| 69 | + $objectAttributesAttribute, $definedMeaningIdAttribute, $definitionMeaningName, $objectAttributesAttribute; |
87 | 70 | |
88 | 71 | $editor = new RecordDivListEditor($definitionAttribute); |
89 | 72 | $editor->addEditor(getTranslatedTextEditor( |
— | — | @@ -91,7 +74,10 @@ |
92 | 75 | new DefinedMeaningFilteredDefinitionController($viewInformation->filterLanguageId), |
93 | 76 | $viewInformation |
94 | 77 | )); |
95 | | - $editor->addEditor(new PopUpEditor($definitionObjectAttributesEditor, $wgPopupAnnotationName)); |
| 78 | + $editor->addEditor(new PopUpEditor( |
| 79 | + createObjectAttributesEditor($viewInformation, $objectAttributesAttribute, $definedMeaningIdAttribute, 0, $definitionMeaningName), |
| 80 | + $wgPopupAnnotationName |
| 81 | + )); |
96 | 82 | |
97 | 83 | return $editor; |
98 | 84 | } |
— | — | @@ -122,6 +108,23 @@ |
123 | 109 | $objectAttributesEditor->addEditor(getOptionAttributeValuesEditor($viewInformation, new OptionAttributeValuesController($objectIdFetcher), $levelDefinedMeaningName, $dmObjectIdFetcher)); |
124 | 110 | } |
125 | 111 | |
| 112 | +function createObjectAttributesEditor(ViewInformation $viewInformation, Attribute $attribute, Attribute $idAttribute, $levelsFromDefinedMeaning, $levelName) { |
| 113 | + global |
| 114 | + $objectAttributesAttribute, $definedMeaningIdAttribute; |
| 115 | + |
| 116 | + $result = new RecordUnorderedListEditor($attribute, 5); |
| 117 | + |
| 118 | + setObjectAttributesEditor( |
| 119 | + $result, |
| 120 | + $viewInformation, |
| 121 | + new ObjectIdFetcher(0, $idAttribute), |
| 122 | + $levelName, |
| 123 | + new ObjectIdFetcher($levelsFromDefinedMeaning, $definedMeaningIdAttribute) |
| 124 | + ); |
| 125 | + |
| 126 | + return $result; |
| 127 | +} |
| 128 | + |
126 | 129 | function getAlternativeDefinitionsEditor(ViewInformation $viewInformation) { |
127 | 130 | global |
128 | 131 | $alternativeDefinitionsAttribute, $alternativeDefinitionAttribute, $sourceAttribute; |
— | — | @@ -182,7 +185,8 @@ |
183 | 186 | function getSynonymsAndTranslationsEditor(ViewInformation $viewInformation) { |
184 | 187 | global |
185 | 188 | $synonymsAndTranslationsAttribute, $identicalMeaningAttribute, $expressionIdAttribute, |
186 | | - $expressionAttribute, $synonymsAndTranslationsObjectAttributesEditor, $wgPopupAnnotationName; |
| 189 | + $expressionAttribute, $wgPopupAnnotationName, |
| 190 | + $syntransIdAttribute, $synTransMeaningName, $objectAttributesAttribute; |
187 | 191 | |
188 | 192 | $tableEditor = new RecordSetTableEditor( |
189 | 193 | $synonymsAndTranslationsAttribute, |
— | — | @@ -196,7 +200,10 @@ |
197 | 201 | |
198 | 202 | $tableEditor->addEditor(getExpressionTableCellEditor($expressionAttribute, $viewInformation)); |
199 | 203 | $tableEditor->addEditor(new BooleanEditor($identicalMeaningAttribute, new SimplePermissionController(true), true, true)); |
200 | | - $tableEditor->addEditor(new PopUpEditor($synonymsAndTranslationsObjectAttributesEditor, $wgPopupAnnotationName)); |
| 204 | + $tableEditor->addEditor(new PopUpEditor( |
| 205 | + createObjectAttributesEditor($viewInformation, $objectAttributesAttribute, $syntransIdAttribute, 1, $synTransMeaningName), |
| 206 | + $wgPopupAnnotationName |
| 207 | + )); |
201 | 208 | |
202 | 209 | addTableMetadataEditors($tableEditor, $viewInformation); |
203 | 210 | |
— | — | @@ -205,13 +212,16 @@ |
206 | 213 | |
207 | 214 | function getDefinedMeaningRelationsEditor(ViewInformation $viewInformation) { |
208 | 215 | global |
209 | | - $relationsAttribute, $relationTypeAttribute, $otherDefinedMeaningAttribute, |
210 | | - $relationsObjectAttributesEditor, $wgPopupAnnotationName; |
| 216 | + $relationsAttribute, $relationTypeAttribute, $otherDefinedMeaningAttribute, $objectAttributesAttribute, |
| 217 | + $relationsObjectAttributesEditor, $relationIdAttribute, $relationMeaningName, $wgPopupAnnotationName; |
211 | 218 | |
212 | 219 | $editor = new RecordSetTableEditor($relationsAttribute, new SimplePermissionController(true), new ShowEditFieldChecker(true), new AllowAddController(true), true, false, new DefinedMeaningRelationController()); |
213 | 220 | $editor->addEditor(new RelationTypeReferenceEditor($relationTypeAttribute, new SimplePermissionController(false), true)); |
214 | 221 | $editor->addEditor(new DefinedMeaningReferenceEditor($otherDefinedMeaningAttribute, new SimplePermissionController(false), true)); |
215 | | - $editor->addEditor(new PopUpEditor($relationsObjectAttributesEditor, $wgPopupAnnotationName)); |
| 222 | + $editor->addEditor(new PopUpEditor( |
| 223 | + createObjectAttributesEditor($viewInformation, $objectAttributesAttribute, $relationIdAttribute, 1, $relationMeaningName), |
| 224 | + $wgPopupAnnotationName |
| 225 | + )); |
216 | 226 | |
217 | 227 | addTableMetadataEditors($editor, $viewInformation); |
218 | 228 | |
— | — | @@ -220,13 +230,16 @@ |
221 | 231 | |
222 | 232 | function getDefinedMeaningReciprocalRelationsEditor(ViewInformation $viewInformation) { |
223 | 233 | global |
224 | | - $reciprocalRelationsAttribute, $relationTypeAttribute, $otherDefinedMeaningAttribute, |
225 | | - $relationsObjectAttributesEditor, $wgPopupAnnotationName; |
| 234 | + $reciprocalRelationsAttribute, $relationTypeAttribute, $otherDefinedMeaningAttribute, $objectAttributesAttribute, |
| 235 | + $relationsObjectAttributesEditor, $relationIdAttribute, $relationMeaningName, $wgPopupAnnotationName; |
226 | 236 | |
227 | 237 | $editor = new RecordSetTableEditor($reciprocalRelationsAttribute, new SimplePermissionController(false), new ShowEditFieldChecker(true), new AllowAddController(false), false, false, null); |
228 | 238 | $editor->addEditor(new DefinedMeaningReferenceEditor($otherDefinedMeaningAttribute, new SimplePermissionController(false), true)); |
229 | 239 | $editor->addEditor(new RelationTypeReferenceEditor($relationTypeAttribute, new SimplePermissionController(false), true)); |
230 | | - $editor->addEditor(new PopUpEditor($relationsObjectAttributesEditor, $wgPopupAnnotationName)); |
| 240 | + $editor->addEditor(new PopUpEditor( |
| 241 | + createObjectAttributesEditor($viewInformation, $objectAttributesAttribute, $relationIdAttribute, 1, $relationMeaningName), |
| 242 | + $wgPopupAnnotationName |
| 243 | + )); |
231 | 244 | |
232 | 245 | addTableMetadataEditors($editor, $viewInformation); |
233 | 246 | |
— | — | @@ -444,9 +457,9 @@ |
445 | 458 | |
446 | 459 | function getDefinedMeaningEditor(ViewInformation $viewInformation) { |
447 | 460 | global |
448 | | - $wdDefinedMeaningAttributesOrder, |
| 461 | + $wdDefinedMeaningAttributesOrder, $definedMeaningIdAttribute, $definedMeaningMeaningName, |
449 | 462 | $definedMeaningAttribute, $possiblySynonymousIdAttribute, $possiblySynonymousAttribute, |
450 | | - $possibleSynonymAttribute, $definedMeaningObjectAttributesEditor, $possiblySynonymousObjectAttributesEditor; |
| 463 | + $possibleSynonymAttribute, $relationMeaningName, $objectAttributesAttribute, $definedMeaningAttributesAttribute; |
451 | 464 | |
452 | 465 | $definitionEditor = getDefinitionEditor($viewInformation); |
453 | 466 | $alternativeDefinitionsEditor = getAlternativeDefinitionsEditor($viewInformation); |
— | — | @@ -463,7 +476,7 @@ |
464 | 477 | $possibleSynonymAttribute, |
465 | 478 | $viewInformation->possiblySynonymousRelationTypeId, |
466 | 479 | $viewInformation, |
467 | | - $possiblySynonymousObjectAttributesEditor |
| 480 | + createObjectAttributesEditor($viewInformation, $objectAttributesAttribute, $possiblySynonymousIdAttribute, 1, $relationMeaningName) |
468 | 481 | ); |
469 | 482 | |
470 | 483 | $availableEditors = new AttributeEditorMap(); |
— | — | @@ -475,7 +488,7 @@ |
476 | 489 | $availableEditors->addEditor($reciprocalRelationsEditor); |
477 | 490 | $availableEditors->addEditor($classMembershipEditor); |
478 | 491 | $availableEditors->addEditor($collectionMembershipEditor); |
479 | | - $availableEditors->addEditor($definedMeaningObjectAttributesEditor); |
| 492 | + $availableEditors->addEditor(createObjectAttributesEditor($viewInformation, $definedMeaningAttributesAttribute, $definedMeaningIdAttribute, 0, $definedMeaningMeaningName)); |
480 | 493 | |
481 | 494 | if ($viewInformation->possiblySynonymousRelationTypeId != 0) |
482 | 495 | $availableEditors->addEditor($possiblySynonymousEditor); |
— | — | @@ -484,7 +497,7 @@ |
485 | 498 | |
486 | 499 | foreach ($wdDefinedMeaningAttributesOrder as $attributeId) { |
487 | 500 | $editor = $availableEditors->getEditorForAttributeId($attributeId); |
488 | | - |
| 501 | + |
489 | 502 | if ($editor != null) |
490 | 503 | $definedMeaningEditor->addEditor($editor); |
491 | 504 | } |
Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataGlobals.php |
— | — | @@ -92,11 +92,11 @@ |
93 | 93 | $wgSourceIdentifierAttributeName = "Source identifier"; |
94 | 94 | $wgTextAttributeAttributeName = "Property"; |
95 | 95 | $wgTextAttributeName = "Text"; |
96 | | -$wgTextAttributeValuesAttributeName = "String properties"; |
| 96 | +$wgTextAttributeValuesAttributeName = "Plain text properties"; |
97 | 97 | $wgTranslatedTextAttributeAttributeName = "Property"; |
98 | 98 | $wgTranslatedTextAttributeName = "Translated text"; |
99 | 99 | $wgTranslatedTextAttributeValueAttributeName = "Text"; |
100 | | -$wgTranslatedTextAttributeValuesAttributeName = "Text properties"; |
| 100 | +$wgTranslatedTextAttributeValuesAttributeName = "Translatable text properties"; |
101 | 101 | $wgUrlAttributeAttributeName = "Property"; |
102 | 102 | $wgUrlAttributeValuesAttributeName = "URL properties"; |
103 | 103 | |