Index: trunk/extensions/Wikidata/WiktionaryZ/WiktionaryZ.php |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | parent::view(); |
27 | 27 | |
28 | 28 | $spelling = $wgTitle->getText(); |
29 | | - $wgOut->addHTML(getExpressionsEditor($spelling, false)->view(new IdStack("expression"), getExpressionsRecordSet($spelling, new QueryLatestTransactionInformation()))); |
| 29 | + $wgOut->addHTML(getExpressionsEditor($spelling, false, $this->shouldShowAuthorities)->view(new IdStack("expression"), getExpressionsRecordSet($spelling, $this->viewQueryTransactionInformation))); |
30 | 30 | $wgOut->addHTML(DefaultEditor::getExpansionCss()); |
31 | 31 | $wgOut->addHTML("<script language='javascript'><!--\nexpandEditors();\n--></script>"); |
32 | 32 | |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | parent::history(); |
42 | 42 | |
43 | 43 | $spelling = $wgTitle->getText(); |
44 | | - $wgOut->addHTML(getExpressionsEditor($spelling, $this->showRecordLifeSpan)->view(new IdStack("expression"), getExpressionsRecordSet($spelling, $this->queryTransactionInformation))); |
| 44 | + $wgOut->addHTML(getExpressionsEditor($spelling, $this->showRecordLifeSpan, false)->view(new IdStack("expression"), getExpressionsRecordSet($spelling, $this->queryTransactionInformation))); |
45 | 45 | $wgOut->addHTML(DefaultEditor::getExpansionCss()); |
46 | 46 | $wgOut->addHTML("<script language='javascript'><!--\nexpandEditors();\n--></script>"); |
47 | 47 | |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | $wgTitle; |
56 | 56 | |
57 | 57 | $spelling = $wgTitle->getText(); |
58 | | - getExpressionsEditor($spelling, false)->save(new IdStack("expression"), getExpressionsRecordSet($spelling, $referenceTransaction)); |
| 58 | + getExpressionsEditor($spelling, false, false)->save(new IdStack("expression"), getExpressionsRecordSet($spelling, $referenceTransaction)); |
59 | 59 | } |
60 | 60 | |
61 | 61 | public function edit() { |
— | — | @@ -66,7 +66,7 @@ |
67 | 67 | $spelling = $wgTitle->getText(); |
68 | 68 | |
69 | 69 | $this->outputEditHeader(); |
70 | | - $wgOut->addHTML(getExpressionsEditor($spelling, false)->edit(new IdStack("expression"), getExpressionsRecordSet($spelling, new QueryLatestTransactionInformation()))); |
| 70 | + $wgOut->addHTML(getExpressionsEditor($spelling, false, false)->edit(new IdStack("expression"), getExpressionsRecordSet($spelling, new QueryLatestTransactionInformation()))); |
71 | 71 | $this->outputEditFooter(); |
72 | 72 | } |
73 | 73 | } |
Index: trunk/extensions/Wikidata/WiktionaryZ/DefinedMeaning.php |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | |
15 | 15 | // $definedMeaningId = $wgTitle->getText(); |
16 | 16 | $definedMeaningId = $this->getDefinedMeaningIdFromTitle($wgTitle->getText()); |
17 | | - $wgOut->addHTML(getDefinedMeaningEditor(false)->view($this->getIdStack($definedMeaningId), getDefinedMeaningRecord($definedMeaningId, new QueryLatestTransactionInformation()))); |
| 17 | + $wgOut->addHTML(getDefinedMeaningEditor(false, $this->shouldShowAuthorities)->view($this->getIdStack($definedMeaningId), getDefinedMeaningRecord($definedMeaningId, $this->viewQueryTransactionInformation))); |
18 | 18 | $wgOut->addHTML(DefaultEditor::getExpansionCss()); |
19 | 19 | $wgOut->addHTML("<script language='javascript'><!--\nexpandEditors();\n--></script>"); |
20 | 20 | } |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | $definedMeaningId = $this->getDefinedMeaningIdFromTitle($wgTitle->getText()); |
30 | 30 | |
31 | 31 | $this->outputEditHeader(); |
32 | | - $wgOut->addHTML(getDefinedMeaningEditor(false)->edit($this->getIdStack($definedMeaningId), getDefinedMeaningRecord($definedMeaningId, new QueryLatestTransactionInformation()))); |
| 32 | + $wgOut->addHTML(getDefinedMeaningEditor(false, false)->edit($this->getIdStack($definedMeaningId), getDefinedMeaningRecord($definedMeaningId, new QueryLatestTransactionInformation()))); |
33 | 33 | $this->outputEditFooter(); |
34 | 34 | } |
35 | 35 | |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | |
42 | 42 | // $definedMeaningId = $wgTitle->getText(); |
43 | 43 | $definedMeaningId = $this->getDefinedMeaningIdFromTitle($wgTitle->getText()); |
44 | | - $wgOut->addHTML(getDefinedMeaningEditor($this->showRecordLifeSpan)->view( |
| 44 | + $wgOut->addHTML(getDefinedMeaningEditor($this->showRecordLifeSpan, false)->view( |
45 | 45 | new IdStack("defined-meaning"), |
46 | 46 | getDefinedMeaningRecord($definedMeaningId, $this->queryTransactionInformation)) |
47 | 47 | ); |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | |
61 | 61 | // $definedMeaningId = $wgTitle->getText(); |
62 | 62 | $definedMeaningId = $this->getDefinedMeaningIdFromTitle($wgTitle->getText()); |
63 | | - getDefinedMeaningEditor(false)->save($this->getIdStack($definedMeaningId), getDefinedMeaningRecord($definedMeaningId, $referenceTransaction)); |
| 63 | + getDefinedMeaningEditor(false, false)->save($this->getIdStack($definedMeaningId), getDefinedMeaningRecord($definedMeaningId, $referenceTransaction)); |
64 | 64 | } |
65 | 65 | |
66 | 66 | protected function getIdStack($definedMeaningId) { |
Index: trunk/extensions/Wikidata/WiktionaryZ/Wikidata.php |
— | — | @@ -13,6 +13,10 @@ |
14 | 14 | protected $showRecordLifeSpan;
|
15 | 15 | protected $transaction;
|
16 | 16 | protected $queryTransactionInformation;
|
| 17 | + protected $viewQueryTransactionInformation;
|
| 18 | + protected $shouldShowAuthorities;
|
| 19 | +
|
| 20 | + protected $availableAuthorities = array();
|
17 | 21 |
|
18 | 22 | public function __construct() {
|
19 | 23 | global
|
— | — | @@ -44,6 +48,30 @@ |
45 | 49 |
|
46 | 50 | $wgOut->enableClientCache(false);
|
47 | 51 | $wgOut->addHTML($this->getLanguageSelector());
|
| 52 | +
|
| 53 | + $authorities = array();
|
| 54 | +
|
| 55 | + if (count($this->availableAuthorities) > 0) {
|
| 56 | + $authorityOptions = array();
|
| 57 | +
|
| 58 | + foreach($this->availableAuthorities as $authority) {
|
| 59 | + $showAuthority = isset($_GET['authority-' . $authority]);
|
| 60 | +
|
| 61 | + if ($showAuthority)
|
| 62 | + $authorities[] = $authority;
|
| 63 | +
|
| 64 | + $authorityOptions["Show " . getUserName($authority) . " version"] = getCheckBox('authority-' . $authority, $showAuthority);
|
| 65 | + }
|
| 66 | +
|
| 67 | + $wgOut->addHTML(getOptionPanel($authorityOptions));
|
| 68 | + }
|
| 69 | +
|
| 70 | + $this->shouldShowAuthorities = count($authorities) > 0;
|
| 71 | +
|
| 72 | + if ($this->shouldShowAuthorities)
|
| 73 | + $this->viewQueryTransactionInformation = new QueryAuthoritativeTransactionInformation($authorities);
|
| 74 | + else
|
| 75 | + $this->viewQueryTransactionInformation = new QueryLatestTransactionInformation();
|
48 | 76 | }
|
49 | 77 |
|
50 | 78 | protected function save($referenceTransaction) {
|
Index: trunk/extensions/Wikidata/WiktionaryZ/WiktionaryZEditors.php |
— | — | @@ -5,8 +5,8 @@ |
6 | 6 | require_once('WikiDataBootstrappedMeanings.php'); |
7 | 7 | require_once('Fetcher.php'); |
8 | 8 | |
9 | | -initializeObjectAttributeEditors(true); |
10 | | -function initializeObjectAttributeEditors($showRecordLifeSpan) { |
| 9 | +initializeObjectAttributeEditors(true, true); |
| 10 | +function initializeObjectAttributeEditors($showRecordLifeSpan, $showAuthority) { |
11 | 11 | global |
12 | 12 | $objectAttributesAttribute, |
13 | 13 | $definedMeaningObjectAttributesEditor, $definedMeaningIdAttribute, |
— | — | @@ -26,12 +26,12 @@ |
27 | 27 | $textValueObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5); |
28 | 28 | $translatedTextValueObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5); |
29 | 29 | |
30 | | - setObjectAttributesEditor($definedMeaningObjectAttributesEditor, $showRecordLifeSpan, new ObjectIdFetcher(0, $definedMeaningIdAttribute), $definedMeaningMeaningName, new ObjectIdFetcher(0, $definedMeaningIdAttribute)); |
31 | | - setObjectAttributesEditor($definitionObjectAttributesEditor, $showRecordLifeSpan, new DefinitionObjectIdFetcher(0, $definedMeaningIdAttribute), $definitionMeaningName, new ObjectIdFetcher(0, $definedMeaningIdAttribute)); |
32 | | - setObjectAttributesEditor($synonymsAndTranslationsObjectAttributesEditor, $showRecordLifeSpan, new ObjectIdFetcher(0, $syntransIdAttribute), $synTransMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
33 | | - setObjectAttributesEditor($relationsObjectAttributesEditor, $showRecordLifeSpan, new ObjectIdFetcher(0, $relationIdAttribute), $relationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
34 | | - setObjectAttributesEditor($textValueObjectAttributesEditor, $showRecordLifeSpan, new ObjectIdFetcher(0, $textAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
35 | | - setObjectAttributesEditor($translatedTextValueObjectAttributesEditor, $showRecordLifeSpan, new ObjectIdFetcher(0, $translatedTextAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
| 30 | + setObjectAttributesEditor($definedMeaningObjectAttributesEditor, $showRecordLifeSpan, $showAuthority, new ObjectIdFetcher(0, $definedMeaningIdAttribute), $definedMeaningMeaningName, new ObjectIdFetcher(0, $definedMeaningIdAttribute)); |
| 31 | + setObjectAttributesEditor($definitionObjectAttributesEditor, $showRecordLifeSpan, $showAuthority, new DefinitionObjectIdFetcher(0, $definedMeaningIdAttribute), $definitionMeaningName, new ObjectIdFetcher(0, $definedMeaningIdAttribute)); |
| 32 | + setObjectAttributesEditor($synonymsAndTranslationsObjectAttributesEditor, $showRecordLifeSpan, $showAuthority, new ObjectIdFetcher(0, $syntransIdAttribute), $synTransMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
| 33 | + setObjectAttributesEditor($relationsObjectAttributesEditor, $showRecordLifeSpan, $showAuthority, new ObjectIdFetcher(0, $relationIdAttribute), $relationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
| 34 | + setObjectAttributesEditor($textValueObjectAttributesEditor, $showRecordLifeSpan, $showAuthority, new ObjectIdFetcher(0, $textAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
| 35 | + setObjectAttributesEditor($translatedTextValueObjectAttributesEditor, $showRecordLifeSpan, $showAuthority, new ObjectIdFetcher(0, $translatedTextAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
36 | 36 | } |
37 | 37 | |
38 | 38 | function getTransactionEditor($attribute) { |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | $userAttribute, $timestampAttribute; |
41 | 41 | |
42 | 42 | $transactionEditor = new RecordTableCellEditor($attribute); |
43 | | - $transactionEditor->addEditor(new UserEditor($userAttribute, new SimplePermissionController(false), true)); |
| 43 | + $transactionEditor->addEditor(createUserViewer($userAttribute)); |
44 | 44 | $transactionEditor->addEditor(new TimestampEditor($timestampAttribute, new SimplePermissionController(false), true)); |
45 | 45 | |
46 | 46 | return $transactionEditor; |
— | — | @@ -64,18 +64,31 @@ |
65 | 65 | $editor->addEditor(createTableLifeSpanEditor($recordLifeSpanAttribute)); |
66 | 66 | } |
67 | 67 | |
68 | | -function getDefinitionEditor($attribute, $controller, $showRecordLifeSpan) { |
| 68 | +function addTableAuthorityEditor($editor, $showAuthority) { |
69 | 69 | global |
| 70 | + $authorityAttribute; |
| 71 | + |
| 72 | + if ($showAuthority) |
| 73 | + $editor->addEditor(createUserViewer($authorityAttribute)); |
| 74 | +} |
| 75 | + |
| 76 | +function addTableMedataEditors($editor, $showRecordLifeSpan, $showAuthority) { |
| 77 | + addTableLifeSpanEditor($editor, $showRecordLifeSpan); |
| 78 | + addTableAuthorityEditor($editor, $showAuthority); |
| 79 | +} |
| 80 | + |
| 81 | +function getDefinitionEditor($attribute, $controller, $showRecordLifeSpan, $showAuthority) { |
| 82 | + global |
70 | 83 | $translatedTextAttribute, $definitionObjectAttributesEditor; |
71 | 84 | |
72 | 85 | $editor = new RecordDivListEditor($attribute); |
73 | | - $editor->addEditor(getTranslatedTextEditor($translatedTextAttribute, new DefinedMeaningDefinitionController(), $showRecordLifeSpan)); |
| 86 | + $editor->addEditor(getTranslatedTextEditor($translatedTextAttribute, new DefinedMeaningDefinitionController(), $showRecordLifeSpan, $showAuthority)); |
74 | 87 | $editor->addEditor(new PopUpEditor($definitionObjectAttributesEditor, 'Annotation')); |
75 | 88 | |
76 | 89 | return $editor; |
77 | 90 | } |
78 | 91 | |
79 | | -function getTranslatedTextEditor($attribute, $controller, $showRecordLifeSpan) { |
| 92 | +function getTranslatedTextEditor($attribute, $controller, $showRecordLifeSpan, $showAuthority) { |
80 | 93 | global |
81 | 94 | $languageAttribute, $textAttribute; |
82 | 95 | |
— | — | @@ -83,26 +96,26 @@ |
84 | 97 | $editor->addEditor(new LanguageEditor($languageAttribute, new SimplePermissionController(false), true)); |
85 | 98 | $editor->addEditor(new TextEditor($textAttribute, new SimplePermissionController(true), true)); |
86 | 99 | |
87 | | - addTableLifeSpanEditor($editor, $showRecordLifeSpan); |
| 100 | + addTableMedataEditors($editor, $showRecordLifeSpan, $showAuthority); |
88 | 101 | |
89 | 102 | return $editor; |
90 | 103 | } |
91 | 104 | |
92 | | -function setObjectAttributesEditor($objectAttributesEditor, $showRecordLifeSpan, $objectIdFetcher, $levelDefinedMeaningName, $dmObjectIdFetcher) { |
93 | | - $objectAttributesEditor->addEditor(getTextAttributeValuesEditor($showRecordLifeSpan, new TextAttributeValuesController($objectIdFetcher), $levelDefinedMeaningName, $dmObjectIdFetcher)); |
94 | | - $objectAttributesEditor->addEditor(getTranslatedTextAttributeValuesEditor($showRecordLifeSpan, new TranslatedTextAttributeValuesController($objectIdFetcher), $levelDefinedMeaningName, $dmObjectIdFetcher)); |
| 105 | +function setObjectAttributesEditor($objectAttributesEditor, $showRecordLifeSpan, $showAuthority, $objectIdFetcher, $levelDefinedMeaningName, $dmObjectIdFetcher) { |
| 106 | + $objectAttributesEditor->addEditor(getTextAttributeValuesEditor($showRecordLifeSpan, $showAuthority, new TextAttributeValuesController($objectIdFetcher), $levelDefinedMeaningName, $dmObjectIdFetcher)); |
| 107 | + $objectAttributesEditor->addEditor(getTranslatedTextAttributeValuesEditor($showRecordLifeSpan, $showAuthority, new TranslatedTextAttributeValuesController($objectIdFetcher), $levelDefinedMeaningName, $dmObjectIdFetcher)); |
95 | 108 | } |
96 | 109 | |
97 | | -function getAlternativeDefinitionsEditor($showRecordLifeSpan) { |
| 110 | +function getAlternativeDefinitionsEditor($showRecordLifeSpan, $showAuthority) { |
98 | 111 | global |
99 | 112 | $alternativeDefinitionsAttribute, $alternativeDefinitionAttribute, $sourceAttribute; |
100 | 113 | |
101 | 114 | $editor = new RecordSetTableEditor($alternativeDefinitionsAttribute, new SimplePermissionController(true), new ShowEditFieldChecker(true), new AllowAddController(true), true, false, new DefinedMeaningAlternativeDefinitionsController()); |
102 | 115 | // $editor = new RecordSetTableEditor($alternativeDefinitionsAttribute, new AlternativeDefinitionsPermissionController(), new ShowEditFieldChecker(true), new AllowAddController(true), true, false, new DefinedMeaningAlternativeDefinitionsController()); |
103 | | - $editor->addEditor(getTranslatedTextEditor($alternativeDefinitionAttribute, new DefinedMeaningAlternativeDefinitionController(), $showRecordLifeSpan)); |
| 116 | + $editor->addEditor(getTranslatedTextEditor($alternativeDefinitionAttribute, new DefinedMeaningAlternativeDefinitionController(), $showRecordLifeSpan, $showAuthority)); |
104 | 117 | $editor->addEditor(new DefinedMeaningReferenceEditor($sourceAttribute, new SimplePermissionController(false), true)); |
105 | 118 | |
106 | | - addTableLifeSpanEditor($editor, $showRecordLifeSpan); |
| 119 | + addTableMedataEditors($editor, $showRecordLifeSpan, $showAuthority); |
107 | 120 | |
108 | 121 | return $editor; |
109 | 122 | } |
— | — | @@ -118,18 +131,20 @@ |
119 | 132 | return $editor; |
120 | 133 | } |
121 | 134 | |
122 | | -function getClassAttributesEditor($showRecordLifeSpan) { |
| 135 | +function getClassAttributesEditor($showRecordLifeSpan, $showAuthority) { |
123 | 136 | global |
124 | 137 | $definedMeaningIdAttribute, $classAttributesAttribute, $classAttributeLevelAttribute ,$classAttributeAttributeAttribute; |
125 | 138 | |
126 | 139 | $tableEditor = new RecordSetTableEditor($classAttributesAttribute, new SimplePermissionController(true), new ShowEditFieldForClassesChecker(0, $definedMeaningIdAttribute), new AllowAddController(true), true, false, new ClassAttributesController()); |
127 | 140 | $tableEditor->addEditor(new ClassAttributesLevelDefinedMeaningEditor($classAttributeLevelAttribute, new SimplePermissionController(false), true)); |
128 | 141 | $tableEditor->addEditor(new DefinedMeaningReferenceEditor($classAttributeAttributeAttribute, new SimplePermissionController(false), true)); |
129 | | - addTableLifeSpanEditor($tableEditor, $showRecordLifeSpan); |
| 142 | + |
| 143 | + addTableMedataEditors($tableEditor, $showRecordLifeSpan, $showAuthority); |
| 144 | + |
130 | 145 | return $tableEditor; |
131 | 146 | } |
132 | 147 | |
133 | | -function getSynonymsAndTranslationsEditor($showRecordLifeSpan) { |
| 148 | +function getSynonymsAndTranslationsEditor($showRecordLifeSpan, $showAuthority) { |
134 | 149 | global |
135 | 150 | $synonymsAndTranslationsAttribute, $identicalMeaningAttribute, $expressionIdAttribute, |
136 | 151 | $expressionAttribute, $synonymsAndTranslationsObjectAttributesEditor; |
— | — | @@ -139,12 +154,12 @@ |
140 | 155 | $tableEditor->addEditor(new BooleanEditor($identicalMeaningAttribute, new SimplePermissionController(true), true, true)); |
141 | 156 | $tableEditor->addEditor(new PopUpEditor($synonymsAndTranslationsObjectAttributesEditor, 'Annotation')); |
142 | 157 | |
143 | | - addTableLifeSpanEditor($tableEditor, $showRecordLifeSpan); |
| 158 | + addTableMedataEditors($tableEditor, $showRecordLifeSpan, $showAuthority); |
144 | 159 | |
145 | 160 | return $tableEditor; |
146 | 161 | } |
147 | 162 | |
148 | | -function getDefinedMeaningRelationsEditor($showRecordLifeSpan) { |
| 163 | +function getDefinedMeaningRelationsEditor($showRecordLifeSpan, $showAuthority) { |
149 | 164 | global |
150 | 165 | $relationsAttribute, $relationTypeAttribute, $otherDefinedMeaningAttribute, |
151 | 166 | $relationsObjectAttributesEditor; |
— | — | @@ -154,12 +169,12 @@ |
155 | 170 | $editor->addEditor(new DefinedMeaningReferenceEditor($otherDefinedMeaningAttribute, new SimplePermissionController(false), true)); |
156 | 171 | $editor->addEditor(new PopUpEditor($relationsObjectAttributesEditor, 'Annotation')); |
157 | 172 | |
158 | | - addTableLifeSpanEditor($editor, $showRecordLifeSpan); |
| 173 | + addTableMedataEditors($editor, $showRecordLifeSpan, $showAuthority); |
159 | 174 | |
160 | 175 | return $editor; |
161 | 176 | } |
162 | 177 | |
163 | | -function getDefinedMeaningReciprocalRelationsEditor($showRecordLifeSpan) { |
| 178 | +function getDefinedMeaningReciprocalRelationsEditor($showRecordLifeSpan, $showAuthority) { |
164 | 179 | global |
165 | 180 | $reciprocalRelationsAttribute, $relationTypeAttribute, $otherDefinedMeaningAttribute, |
166 | 181 | $relationsObjectAttributesEditor; |
— | — | @@ -169,24 +184,24 @@ |
170 | 185 | $editor->addEditor(new RelationTypeReferenceEditor($relationTypeAttribute, new SimplePermissionController(false), true)); |
171 | 186 | $editor->addEditor(new PopUpEditor($relationsObjectAttributesEditor, 'Annotation')); |
172 | 187 | |
173 | | - addTableLifeSpanEditor($editor, $showRecordLifeSpan); |
| 188 | + addTableMedataEditors($editor, $showRecordLifeSpan, $showAuthority); |
174 | 189 | |
175 | 190 | return $editor; |
176 | 191 | } |
177 | 192 | |
178 | | -function getDefinedMeaningClassMembershipEditor($showRecordLifeSpan) { |
| 193 | +function getDefinedMeaningClassMembershipEditor($showRecordLifeSpan, $showAuthority) { |
179 | 194 | global |
180 | 195 | $classMembershipAttribute, $classAttribute; |
181 | 196 | |
182 | 197 | $editor = new RecordSetTableEditor($classMembershipAttribute, new SimplePermissionController(true), new ShowEditFieldChecker(true), new AllowAddController(true), true, false, new DefinedMeaningClassMembershipController()); |
183 | 198 | $editor->addEditor(new ClassReferenceEditor($classAttribute, new SimplePermissionController(false), true)); |
184 | 199 | |
185 | | - addTableLifeSpanEditor($editor, $showRecordLifeSpan); |
| 200 | + addTableMedataEditors($editor, $showRecordLifeSpan, $showAuthority); |
186 | 201 | |
187 | 202 | return $editor; |
188 | 203 | } |
189 | 204 | |
190 | | -function getDefinedMeaningCollectionMembershipEditor($showRecordLifeSpan) { |
| 205 | +function getDefinedMeaningCollectionMembershipEditor($showRecordLifeSpan, $showAuthority) { |
191 | 206 | global |
192 | 207 | $collectionMembershipAttribute, $collectionMeaningAttribute, $sourceIdentifierAttribute; |
193 | 208 | |
— | — | @@ -194,12 +209,12 @@ |
195 | 210 | $editor->addEditor(new CollectionReferenceEditor($collectionMeaningAttribute, new SimplePermissionController(false), true)); |
196 | 211 | $editor->addEditor(new ShortTextEditor($sourceIdentifierAttribute, new SimplePermissionController(true), true)); |
197 | 212 | |
198 | | - addTableLifeSpanEditor($editor, $showRecordLifeSpan); |
| 213 | + addTableMedataEditors($editor, $showRecordLifeSpan, $showAuthority); |
199 | 214 | |
200 | 215 | return $editor; |
201 | 216 | } |
202 | 217 | |
203 | | -function getTextAttributeValuesEditor($showRecordLifeSpan, $controller, $levelDefinedMeaningName, $objectIdFetcher) { |
| 218 | +function getTextAttributeValuesEditor($showRecordLifeSpan, $showAuthority, $controller, $levelDefinedMeaningName, $objectIdFetcher) { |
204 | 219 | global |
205 | 220 | $textAttributeAttribute, $textAttribute, $textAttributeValuesAttribute, $textValueObjectAttributesEditor; |
206 | 221 | |
— | — | @@ -208,30 +223,30 @@ |
209 | 224 | $editor->addEditor(new TextEditor($textAttribute, new SimplePermissionController(true), true)); |
210 | 225 | $editor->addEditor(new PopUpEditor($textValueObjectAttributesEditor, 'Annotation')); |
211 | 226 | |
212 | | - addTableLifeSpanEditor($editor, $showRecordLifeSpan); |
| 227 | + addTableMedataEditors($editor, $showRecordLifeSpan, $showAuthority); |
213 | 228 | |
214 | 229 | return $editor; |
215 | 230 | } |
216 | 231 | |
217 | | -function getTranslatedTextAttributeValuesEditor($showRecordLifeSpan, $controller, $levelDefinedMeaningName, $objectIdFetcher) { |
| 232 | +function getTranslatedTextAttributeValuesEditor($showRecordLifeSpan, $showAuthority, $controller, $levelDefinedMeaningName, $objectIdFetcher) { |
218 | 233 | global |
219 | 234 | $translatedTextAttributeAttribute, $translatedTextValueAttribute, $translatedTextAttributeValuesAttribute, $translatedTextValueObjectAttributesEditor; |
220 | 235 | |
221 | 236 | $editor = new RecordSetTableEditor($translatedTextAttributeValuesAttribute, new SimplePermissionController(true), new ShowEditFieldChecker(true), new AllowAddController(true), true, false, $controller); |
222 | 237 | $editor->addEditor(new TranslatedTextAttributeEditor($translatedTextAttributeAttribute, new SimplePermissionController(false), true, $levelDefinedMeaningName, $objectIdFetcher)); |
223 | | - $editor->addEditor(getTranslatedTextEditor($translatedTextValueAttribute, new TranslatedTextAttributeValueController(), $showRecordLifeSpan)); |
| 238 | + $editor->addEditor(getTranslatedTextEditor($translatedTextValueAttribute, new TranslatedTextAttributeValueController(), $showRecordLifeSpan, $showAuthority)); |
224 | 239 | $editor->addEditor(new PopUpEditor($translatedTextValueObjectAttributesEditor, 'Annotation')); |
225 | 240 | |
226 | | - addTableLifeSpanEditor($editor, $showRecordLifeSpan); |
| 241 | + addTableMedataEditors($editor, $showRecordLifeSpan, $showAuthority); |
227 | 242 | |
228 | 243 | return $editor; |
229 | 244 | } |
230 | 245 | |
231 | | -function getExpressionMeaningsEditor($attribute, $allowAdd, $showRecordLifeSpan) { |
| 246 | +function getExpressionMeaningsEditor($attribute, $allowAdd, $showRecordLifeSpan, $showAuthority) { |
232 | 247 | global |
233 | 248 | $definedMeaningIdAttribute; |
234 | 249 | |
235 | | - $definedMeaningEditor = getDefinedMeaningEditor($showRecordLifeSpan); |
| 250 | + $definedMeaningEditor = getDefinedMeaningEditor($showRecordLifeSpan, $showAuthority); |
236 | 251 | |
237 | 252 | $definedMeaningCaptionEditor = new DefinedMeaningHeaderEditor($definedMeaningIdAttribute, new SimplePermissionController(false), true, 75); |
238 | 253 | $definedMeaningCaptionEditor->setAddText("New exact meaning"); |
— | — | @@ -243,15 +258,15 @@ |
244 | 259 | return $expressionMeaningsEditor; |
245 | 260 | } |
246 | 261 | |
247 | | -function getExpressionsEditor($spelling, $showRecordLifeSpan) { |
| 262 | +function getExpressionsEditor($spelling, $showRecordLifeSpan, $showAuthority) { |
248 | 263 | global |
249 | 264 | $expressionMeaningsAttribute, $expressionExactMeaningsAttribute, $expressionApproximateMeaningsAttribute, $expressionAttribute, $languageAttribute, $expressionsAttribute; |
250 | 265 | |
251 | 266 | $expressionMeaningsRecordEditor = new RecordUnorderedListEditor($expressionMeaningsAttribute, 3); |
252 | 267 | |
253 | | - $exactMeaningsEditor = getExpressionMeaningsEditor($expressionExactMeaningsAttribute, true, $showRecordLifeSpan); |
| 268 | + $exactMeaningsEditor = getExpressionMeaningsEditor($expressionExactMeaningsAttribute, true, $showRecordLifeSpan, $showAuthority); |
254 | 269 | $expressionMeaningsRecordEditor->addEditor($exactMeaningsEditor); |
255 | | - $expressionMeaningsRecordEditor->addEditor(getExpressionMeaningsEditor($expressionApproximateMeaningsAttribute, false, $showRecordLifeSpan)); |
| 270 | + $expressionMeaningsRecordEditor->addEditor(getExpressionMeaningsEditor($expressionApproximateMeaningsAttribute, false, $showRecordLifeSpan, $showAuthority)); |
256 | 271 | |
257 | 272 | $expressionMeaningsRecordEditor->expandEditor($exactMeaningsEditor); |
258 | 273 | |
— | — | @@ -265,22 +280,22 @@ |
266 | 281 | return $expressionsEditor; |
267 | 282 | } |
268 | 283 | |
269 | | -function getDefinedMeaningEditor($showRecordLifeSpan) { |
| 284 | +function getDefinedMeaningEditor($showRecordLifeSpan, $showAuthority) { |
270 | 285 | global |
271 | 286 | $definitionAttribute, $definedMeaningAttribute, $definedMeaningObjectAttributesEditor; |
272 | 287 | |
273 | | - $definitionEditor = getDefinitionEditor($definitionAttribute, new DefinedMeaningDefinitionController(), $showRecordLifeSpan); |
274 | | - $classAttributesEditor = getClassAttributesEditor($showRecordLifeSpan); |
275 | | - $synonymsAndTranslationsEditor = getSynonymsAndTranslationsEditor($showRecordLifeSpan); |
276 | | - $relationsEditor = getDefinedMeaningRelationsEditor($showRecordLifeSpan); |
277 | | - $reciprocalRelationsEditor = getDefinedMeaningReciprocalRelationsEditor($showRecordLifeSpan); |
278 | | - $classMembershipEditor = getDefinedMeaningClassMembershipEditor($showRecordLifeSpan); |
279 | | - $collectionMembershipEditor = getDefinedMeaningCollectionMembershipEditor($showRecordLifeSpan); |
| 288 | + $definitionEditor = getDefinitionEditor($definitionAttribute, new DefinedMeaningDefinitionController(), $showRecordLifeSpan, $showAuthority); |
| 289 | + $classAttributesEditor = getClassAttributesEditor($showRecordLifeSpan, $showAuthority); |
| 290 | + $synonymsAndTranslationsEditor = getSynonymsAndTranslationsEditor($showRecordLifeSpan, $showAuthority); |
| 291 | + $relationsEditor = getDefinedMeaningRelationsEditor($showRecordLifeSpan, $showAuthority); |
| 292 | + $reciprocalRelationsEditor = getDefinedMeaningReciprocalRelationsEditor($showRecordLifeSpan, $showAuthority); |
| 293 | + $classMembershipEditor = getDefinedMeaningClassMembershipEditor($showRecordLifeSpan, $showAuthority); |
| 294 | + $collectionMembershipEditor = getDefinedMeaningCollectionMembershipEditor($showRecordLifeSpan, $showAuthority); |
280 | 295 | |
281 | 296 | $definedMeaningEditor = new RecordUnorderedListEditor($definedMeaningAttribute, 4); |
282 | 297 | $definedMeaningEditor->addEditor($definitionEditor); |
283 | 298 | $definedMeaningEditor->addEditor($classAttributesEditor); |
284 | | - $definedMeaningEditor->addEditor(getAlternativeDefinitionsEditor($showRecordLifeSpan)); |
| 299 | + $definedMeaningEditor->addEditor(getAlternativeDefinitionsEditor($showRecordLifeSpan, $showAuthority)); |
285 | 300 | $definedMeaningEditor->addEditor($synonymsAndTranslationsEditor); |
286 | 301 | $definedMeaningEditor->addEditor($relationsEditor); |
287 | 302 | $definedMeaningEditor->addEditor($reciprocalRelationsEditor); |
— | — | @@ -339,4 +354,8 @@ |
340 | 355 | return $result; |
341 | 356 | } |
342 | 357 | |
| 358 | +function createUserViewer($attribute) { |
| 359 | + return new UserEditor($attribute, new SimplePermissionController(false), false); |
| 360 | +} |
| 361 | + |
343 | 362 | ?> |
Index: trunk/extensions/Wikidata/WiktionaryZ/Transaction.php |
— | — | @@ -5,18 +5,24 @@ |
6 | 6 | require_once('RecordSet.php');
|
7 | 7 |
|
8 | 8 | interface QueryTransactionInformation {
|
9 | | - public function getRestriction($tableName);
|
| 9 | + public function getRestriction($table);
|
| 10 | + public function getTables();
|
10 | 11 | public function versioningAttributes();
|
11 | 12 | public function versioningFields($tableName);
|
12 | 13 | public function versioningOrderBy();
|
| 14 | + public function versioningGroupBy($table);
|
13 | 15 | public function setVersioningAttributes($record, $row);
|
14 | 16 | }
|
15 | 17 |
|
16 | | -class QueryLatestTransactionInformation implements QueryTransactionInformation {
|
17 | | - public function getRestriction($tableName) {
|
18 | | - return getLatestTransactionRestriction($tableName);
|
| 18 | +class DefaultQueryTransactionInformation {
|
| 19 | + public function getRestriction($table) {
|
| 20 | + return "1";
|
19 | 21 | }
|
20 | 22 |
|
| 23 | + public function getTables() {
|
| 24 | + return array();
|
| 25 | + }
|
| 26 | +
|
21 | 27 | public function versioningAttributes() {
|
22 | 28 | return array();
|
23 | 29 | }
|
— | — | @@ -29,15 +35,24 @@ |
30 | 36 | return array();
|
31 | 37 | }
|
32 | 38 |
|
| 39 | + public function versioningGroupBy($table) {
|
| 40 | + return array();
|
| 41 | + }
|
| 42 | +
|
33 | 43 | public function setVersioningAttributes($record, $row) {
|
34 | 44 | }
|
35 | 45 | }
|
36 | 46 |
|
37 | | -class QueryHistoryTransactionInformation implements QueryTransactionInformation {
|
38 | | - public function getRestriction($tableName) {
|
39 | | - return "1";
|
| 47 | +class QueryLatestTransactionInformation extends DefaultQueryTransactionInformation {
|
| 48 | + public function getRestriction($table) {
|
| 49 | + return getLatestTransactionRestriction($table->name);
|
40 | 50 | }
|
41 | 51 |
|
| 52 | + public function setVersioningAttributes($record, $row) {
|
| 53 | + }
|
| 54 | +}
|
| 55 | +
|
| 56 | +class QueryHistoryTransactionInformation extends DefaultQueryTransactionInformation {
|
42 | 57 | public function versioningAttributes() {
|
43 | 58 | global
|
44 | 59 | $recordLifeSpanAttribute;
|
— | — | @@ -61,15 +76,15 @@ |
62 | 77 | }
|
63 | 78 | }
|
64 | 79 |
|
65 | | -class QueryAtTransactionInformation implements QueryTransactionInformation {
|
| 80 | +class QueryAtTransactionInformation extends DefaultQueryTransactionInformation {
|
66 | 81 | protected $transactionId;
|
67 | 82 |
|
68 | 83 | public function __construct($transactionId) {
|
69 | 84 | $this->transactionId = $transactionId;
|
70 | 85 | }
|
71 | 86 |
|
72 | | - public function getRestriction($tableName) {
|
73 | | - return getAtTransactionRestriction($tableName, $this->transactionId);
|
| 87 | + public function getRestriction($table) {
|
| 88 | + return getAtTransactionRestriction($table->name, $this->transactionId);
|
74 | 89 | }
|
75 | 90 |
|
76 | 91 | public function versioningAttributes() {
|
— | — | @@ -83,10 +98,6 @@ |
84 | 99 | return array($tableName . '.add_transaction_id', $tableName . '.remove_transaction_id', $tableName . '.remove_transaction_id IS NULL AS is_live');
|
85 | 100 | }
|
86 | 101 |
|
87 | | - public function versioningOrderBy() {
|
88 | | - return array();
|
89 | | - }
|
90 | | -
|
91 | 102 | public function setVersioningAttributes($record, $row) {
|
92 | 103 | global
|
93 | 104 | $recordLifeSpanAttribute;
|
— | — | @@ -95,39 +106,108 @@ |
96 | 107 | }
|
97 | 108 | }
|
98 | 109 |
|
99 | | -class QueryUpdateTransactionInformation implements QueryTransactionInformation {
|
| 110 | +class QueryUpdateTransactionInformation extends DefaultQueryTransactionInformation {
|
100 | 111 | protected $transactionId;
|
101 | 112 |
|
102 | 113 | public function __construct($transactionId) {
|
103 | 114 | $this->transactionId = $transactionId;
|
104 | 115 | }
|
105 | 116 |
|
106 | | - public function getRestriction($tableName) {
|
107 | | - return " $tableName.add_transaction_id = $this->transactionId OR $tableName.removeTransactionId = $this->transactionId ";
|
| 117 | + public function getRestriction($table) {
|
| 118 | + return
|
| 119 | + " " . $table->name . ".add_transaction_id =". $this->transactionId .
|
| 120 | + " OR " . $table->name . ".removeTransactionId =" . $this->transactionId;
|
108 | 121 | }
|
109 | 122 |
|
110 | | - public function versioningAttributes() {
|
| 123 | +// public function versioningAttributes() {
|
111 | 124 | // global
|
112 | 125 | // $recordLifeSpanAttribute;
|
113 | | -
|
114 | | - return array();
|
115 | | - }
|
| 126 | +//
|
| 127 | +// return array();
|
| 128 | +// }
|
116 | 129 |
|
117 | | - public function versioningFields($tableName) {
|
| 130 | +// public function versioningFields($tableName) {
|
118 | 131 | // return array($tableName . '.add_transaction_id', $tableName . '.remove_transaction_id', $tableName . '.remove_transaction_id IS NULL AS is_live');
|
119 | | - return array();
|
120 | | - }
|
| 132 | +// }
|
121 | 133 |
|
122 | | - public function versioningOrderBy() {
|
123 | | - return array();
|
124 | | - }
|
125 | | -
|
126 | | - public function setVersioningAttributes($record, $row) {
|
| 134 | +// public function setVersioningAttributes($record, $row) {
|
127 | 135 | // global
|
128 | 136 | // $recordLifeSpanAttribute;
|
129 | 137 | //
|
130 | 138 | // $record->setAttributeValue($recordLifeSpanAttribute, getRecordLifeSpanTuple($row['add_transaction_id'], $row['remove_transaction_id']));
|
| 139 | +// }
|
| 140 | +}
|
| 141 | +
|
| 142 | +class QueryAuthoritativeTransactionInformation extends DefaultQueryTransactionInformation {
|
| 143 | + protected $authorities;
|
| 144 | +
|
| 145 | + public function __construct($authorities) {
|
| 146 | + $this->authorities = $authorities;
|
131 | 147 | }
|
| 148 | +
|
| 149 | + protected function getKeyFieldRestrictions($table, $prefix) {
|
| 150 | + $result = array();
|
| 151 | +
|
| 152 | + foreach ($table->keyFields as $keyField)
|
| 153 | + $result[] = $table->name . "." . $keyField . "=" . $prefix . $table->name . "." . $keyField;
|
| 154 | +
|
| 155 | + return implode(" AND ", $result);
|
| 156 | + }
|
| 157 | +
|
| 158 | + public function getRestriction($table) {
|
| 159 | + return
|
| 160 | + $table->name . ".add_transaction_id=transactions.transaction_id" .
|
| 161 | + " AND (" .
|
| 162 | + getLatestTransactionRestriction($table->name) .
|
| 163 | + " OR (" .
|
| 164 | + " transactions.user_id IN (" . implode(", ", $this->authorities) . ") " .
|
| 165 | + " AND " .$table->name . ".add_transaction_id=(" .
|
| 166 | + " SELECT max(add_transaction_id) " .
|
| 167 | + " FROM " . $table->name . " AS latest_" . $table->name . ", transactions as latest_transactions" .
|
| 168 | + " WHERE " . $this->getKeyFieldRestrictions($table, 'latest_') .
|
| 169 | + " AND latest_transactions.transaction_id=latest_" . $table->name . ".add_transaction_id" .
|
| 170 | + " AND latest_transactions.user_id=transactions.user_id" .
|
| 171 | + ")" .
|
| 172 | + " AND NOT EXISTS (" .
|
| 173 | + " SELECT * " .
|
| 174 | + " FROM " . $table->name . " AS latest_" . $table->name . ", transactions as latest_transactions" .
|
| 175 | + " WHERE " . $this->getKeyFieldRestrictions($table, 'latest_') .
|
| 176 | + " AND latest_transactions.transaction_id=latest_" . $table->name . ".remove_transaction_id" .
|
| 177 | + " AND latest_transactions.user_id=transactions.user_id" .
|
| 178 | + " AND latest_" . $table->name . ".remove_transaction_id > " . $table->name . ".add_transaction_id" .
|
| 179 | + ")" .
|
| 180 | + " )" .
|
| 181 | + " )";
|
| 182 | + }
|
| 183 | +
|
| 184 | + public function getTables() {
|
| 185 | + return array("transactions");
|
| 186 | + }
|
| 187 | +
|
| 188 | + public function versioningAttributes() {
|
| 189 | + global
|
| 190 | + $authorityAttribute;
|
| 191 | +
|
| 192 | + return array($authorityAttribute);
|
| 193 | + }
|
| 194 | +
|
| 195 | + public function versioningFields($tableName) {
|
| 196 | + return array('transactions.user_id', $tableName . '.add_transaction_id');
|
| 197 | + }
|
| 198 | +
|
| 199 | + public function setVersioningAttributes($record, $row) {
|
| 200 | + global
|
| 201 | + $authorityAttribute;
|
| 202 | +
|
| 203 | + $userID = $row['user_id'];
|
| 204 | +
|
| 205 | + if (in_array($userID, $this->authorities))
|
| 206 | + $userName = getUserName($userID);
|
| 207 | + else
|
| 208 | + $userName = "";
|
| 209 | +
|
| 210 | + $record->setAttributeValue($authorityAttribute, $userName);
|
| 211 | + }
|
132 | 212 | }
|
133 | 213 |
|
134 | 214 | global
|
— | — | @@ -196,10 +276,12 @@ |
197 | 277 | $transactionIdAttribute, $userAttribute, $userIPAttribute, $timestampAttribute,
|
198 | 278 | $transactionStructure, $summaryAttribute,
|
199 | 279 | $addTransactionAttribute, $removeTransactionAttribute,
|
200 | | - $recordLifeSpanAttribute, $recordLifeSpanStructure;
|
| 280 | + $recordLifeSpanAttribute, $recordLifeSpanStructure,
|
| 281 | + $authorityAttribute;
|
201 | 282 |
|
202 | 283 | $transactionIdAttribute = new Attribute('transaction-id', 'Transaction ID', 'integer');
|
203 | 284 | $userAttribute = new Attribute('user', 'User', 'user');
|
| 285 | +$authorityAttribute = new Attribute('authority', 'Authority', 'authority');
|
204 | 286 | $userIPAttribute = new Attribute('user-ip', 'User IP', 'IP');
|
205 | 287 | $timestampAttribute = new Attribute('timestamp', 'Time', 'timestamp');
|
206 | 288 | $summaryAttribute = new Attribute('summary', 'Summary', 'text');
|
Index: trunk/extensions/Wikidata/WiktionaryZ/WiktionaryZRecordSets.php |
— | — | @@ -12,22 +12,30 @@ |
13 | 13 | |
14 | 14 | $selectFields = array_keys($fieldAttributeMapping); |
15 | 15 | $attributes = array_values($fieldAttributeMapping); |
| 16 | + $tableNames = array($table->name); |
16 | 17 | |
17 | 18 | if ($table->isVersioned) { |
18 | | - $restrictions[] = $transactionInformation->getRestriction($table->name); |
| 19 | + $restrictions[] = $transactionInformation->getRestriction($table); |
| 20 | + $tableNames = array_merge($tableNames, $transactionInformation->getTables()); |
19 | 21 | $orderBy = array_merge($orderBy, $transactionInformation->versioningOrderBy()); |
| 22 | + $groupBy = $transactionInformation->versioningGroupBy($table); |
20 | 23 | $selectFields = array_merge($selectFields, $transactionInformation->versioningFields($table->name)); |
21 | 24 | $allAttributes = array_merge($attributes, $transactionInformation->versioningAttributes()); |
22 | 25 | } |
23 | | - else |
| 26 | + else { |
24 | 27 | $allAttributes = $attributes; |
| 28 | + $groupBy = array(); |
| 29 | + } |
25 | 30 | |
26 | 31 | $query = "SELECT ". implode(", ", $selectFields) . |
27 | | - " FROM ". $table->name; |
| 32 | + " FROM ". implode(", ", $tableNames); |
28 | 33 | |
29 | 34 | if (count($restrictions) > 0) |
30 | 35 | $query .= " WHERE ". implode(' AND ', $restrictions); |
31 | 36 | |
| 37 | + if (count($groupBy) > 0) |
| 38 | + $query .= " GROUP BY " . implode(', ', $groupBy); |
| 39 | + |
32 | 40 | if (count($orderBy) > 0) |
33 | 41 | $query .= " ORDER BY " . implode(', ', $orderBy); |
34 | 42 | |
Index: trunk/extensions/Wikidata/WiktionaryZ/WikiDataTables.php |
— | — | @@ -3,10 +3,12 @@ |
4 | 4 | class Table { |
5 | 5 | public $name; |
6 | 6 | public $isVersioned; |
| 7 | + public $keyFields; |
7 | 8 | |
8 | | - public function __construct($name, $isVersioned) { |
| 9 | + public function __construct($name, $isVersioned, $keyFields) { |
9 | 10 | $this->name = $name; |
10 | 11 | $this->isVersioned = $isVersioned; |
| 12 | + $this->keyFields = $keyFields; |
11 | 13 | } |
12 | 14 | } |
13 | 15 | |
— | — | @@ -15,17 +17,17 @@ |
16 | 18 | $translatedContentTable, $alternativeDefinitionsTable, $translatedContentAttributeValuesTable, $transactionsTable, |
17 | 19 | $textAttributeValuesTable, $classAttributesTable; |
18 | 20 | |
19 | | -$transactionsTable = new Table('transactions', false); |
20 | | -$meaningRelationsTable = new Table('uw_meaning_relations', true); |
21 | | -$classMembershipsTable = new Table('uw_class_membership', true); |
22 | | -$collectionMembershipsTable = new Table('uw_collection_contents', true); |
23 | | -$syntransTable = new Table('uw_syntrans', true); |
24 | | -$translatedContentTable = new Table('translated_content', true); |
25 | | -$alternativeDefinitionsTable = new Table('uw_alt_meaningtexts', true); |
26 | | -$classAttributesTable = new Table('uw_class_attributes', true); |
| 21 | +$transactionsTable = new Table('transactions', false, array('transaction_id')); |
| 22 | +$meaningRelationsTable = new Table('uw_meaning_relations', true, array('relation_id')); |
| 23 | +$classMembershipsTable = new Table('uw_class_membership', true, array('class_membership_id')); |
| 24 | +$collectionMembershipsTable = new Table('uw_collection_contents', true, array('collection_id', 'member_mid')); |
| 25 | +$syntransTable = new Table('uw_syntrans', true, array('syntrans_sid')); |
| 26 | +$translatedContentTable = new Table('translated_content', true, array('translated_content_id', 'language_id')); |
| 27 | +$alternativeDefinitionsTable = new Table('uw_alt_meaningtexts', true, array('meaning_mid', 'meaning_text_tcid')); |
| 28 | +$classAttributesTable = new Table('uw_class_attributes', true, array('object_id')); |
27 | 29 | |
28 | | -$translatedContentAttributeValuesTable = new Table('uw_translated_content_attribute_values', true); |
29 | | -$textAttributeValuesTable = new Table('uw_text_attribute_values', true); |
30 | | -$urlAttributeValuesTable = new Table('uw_url_attribute_values', true); |
| 30 | +$translatedContentAttributeValuesTable = new Table('uw_translated_content_attribute_values', true, array('value_id')); |
| 31 | +$textAttributeValuesTable = new Table('uw_text_attribute_values', true, array('value_id')); |
| 32 | +$urlAttributeValuesTable = new Table('uw_url_attribute_values', true, array('value_id')); |
31 | 33 | |
32 | 34 | ?> |